Irc-Unix.net

Главная | Actual Topics | Обратная связь | Guest Book | В избранное | Сделать домашней
Категории
 System & Utilities
 Unix News
 OS Emulator
 Developing
 Learning/Education
 Games
 Humour
Каталог статей
Все статьи

Antispam
Статьи
Биллу Гейтсу тоже предлагают избавиться ...
Вымогательство в борьбе со спамом
Календарь

October, 2017
ПнВтСрЧтПтСбВс
1
2345678
9101112131415
16171819202122
23242526272829
3031
Опросы
Какой из этих ОС Вы отдаете большее предпочтение?

QNX
FreeBSD
Linux(any)
Solaris
Mac OS
Windows XP
Windows 2003
Что такое ОС? :)


Результаты
Другие опросы

Всего голосов: 325
Комментарии: 0
Ссылки

Архив Новостей
 October 2017 (8)
 September 2017 (18)
 August 2017 (13)
 February 2017 (14)
 January 2017 (19)
 December 2016 (16)
 November 2016 (16)
 October 2016 (21)
 September 2016 (18)
 August 2016 (16)
 July 2016 (16)
 June 2016 (20)
 May 2016 (18)
 April 2016 (15)
 March 2016 (22)
 February 2016 (17)
 January 2016 (15)
 December 2015 (15)
 November 2015 (22)
 October 2015 (20)
 September 2015 (17)
 August 2015 (25)
 July 2015 (20)
 June 2015 (23)
 May 2015 (21)
 April 2015 (17)
 March 2015 (19)
 February 2015 (9)
 January 2015 (23)
 December 2014 (9)
 November 2014 (13)
 October 2014 (12)
 September 2014 (18)
 August 2014 (20)
 July 2014 (10)
 June 2014 (12)
 May 2014 (12)
 April 2014 (10)
 March 2014 (22)
 February 2014 (10)
 January 2014 (8)
 December 2013 (26)
 November 2013 (53)
 October 2013 (40)
 September 2013 (48)
 August 2013 (63)
 July 2013 (56)
 June 2013 (52)
 May 2013 (49)
 April 2013 (67)
 March 2013 (74)
 February 2013 (63)
 January 2013 (62)
 December 2012 (62)
 November 2012 (66)
 October 2012 (68)
 September 2012 (48)
 August 2012 (75)
 July 2012 (60)
 June 2012 (71)
 May 2012 (69)
 April 2012 (85)
 March 2012 (86)
 February 2012 (90)
 January 2012 (81)
 December 2011 (103)
 November 2011 (118)
 October 2011 (74)
 September 2011 (2)
 June 2011 (110)
 May 2011 (118)
 April 2011 (111)
 March 2011 (112)
 February 2011 (101)
 January 2011 (119)
 December 2010 (117)
 November 2010 (118)
 October 2010 (131)
 September 2010 (117)
 August 2010 (226)
 July 2010 (351)
 June 2010 (305)
 May 2010 (319)
 April 2010 (343)
 March 2010 (329)
 February 2010 (311)
 January 2010 (312)
 December 2009 (266)
 November 2009 (156)
 July 2009 (101)
 June 2009 (279)
 May 2009 (365)
 April 2009 (348)
 March 2009 (347)
 February 2009 (323)
 January 2009 (318)
 December 2008 (237)
 November 2008 (155)
 October 2008 (334)
 September 2008 (310)
 August 2008 (343)
 July 2008 (362)
 June 2008 (322)
 May 2008 (621)
 April 2008 (1276)
 March 2008 (1658)
 February 2008 (250)
 January 2008 (6)
 November 2007 (1)
 September 2007 (1)
 June 2007 (1)
 May 2007 (1)
 March 2007 (1)
 January 2007 (2)
 December 2006 (1)
 October 2006 (2)
 September 2006 (1)
 August 2006 (2)

Calligra Words: undo/redo framework

System & Utilities

As C.Boemann already said, we met at my place for two days in order to fix some serious issues we had with the undo/redo framework in Calligra Words (and Stage for that matter).

The undo/redo framework is something I wrote when I first started contributing to KOffice about 3 years ago. I have to say that I was not really looking forward having to jump into this stuff again. I am not such a masochist and the memories I have of writing this are not ones of an easy glide.
It actually turned out to be really fun and gratifying. There were some headaches involved to be sure but overall I really enjoyed it.

To summarise a bit (more detailed description bellow for the hard hearted): we use Qt Scribe framework for our document. When an edition is done on a QTextDocument, it emits a signal telling that an undo/redo action was added on the QTextDocument internal undoStack. The application listens to this signal and can create an undo action on its stack to match QTextDocument's internal one.
The initial framework I created basically followed that behaviour. There was one thing that it was never meant to handle: nested commands. This means that when nesting commands, like for example the delete command now contains a deleteInlineObject command, the framework would create 2 commands on the application's stack.

So we sat with Boemann thinking how to solve that problem. In the end we only needed to add, instead of a single head command member in the framework, a stack of head commands.
Now we have a framework which is way more complete and solid, plus it is now documented in the code.
There are some improvements we could already think of to make the API a bit more flexible, but we can be confident now that we have solid foundations for the upcoming Calligra Words releases.

Overall, I had a really good time coding with C.Boemann, who is not only a very talented coder but also somebody I really appreciate. It is amazing to see what we achieved in those just two days.

A bit more details:

As I said, we use QTextDocuments to hold the data of one text frame (text shapes). This document is edited through a specific handler: a KoTextEditor. This editor is not only responsible for editing the QTextDocument but also to listen to the QTextDocument's undoCommandAdded signal and keep our application's stack in sync.
There are 3 use cases of our undo/redo framework:
- editing done within the KoTextEditor
- complete commands pushed on the KoTextEditor by an external tool
- on-the-fly macro commands

In addition to this, there are two special cases in editing QTextDocument: inserting text and deleting text. These two actions only trigger a signal on the first edit. Any subsequent compatible edit is "merged" into the original edit command and will not trigger a signal. Inserting text and deleting are therefore open ended actions, as far as our framework is concerned.

In order to handle this, a sort of state machine is used. The KoTextEditor can be in a NoOp, KeyPress, Delete, Format or Custom state. Furthermore, for each signal received from the QTextDocument, we create a "dummy" UndoTextCommand, whose sole purpose is to call QTextDocument::undo or QTextDocument::redo. These commands need to be parented to a command which we push on our application's stack. This head command will call undo or redo on all its children when the user press undo or redo in the application.
In order to allow for nested head commands, we maintain a stack. Its top-most command will be the parent of the signal induced UndoTextCommands.
Depending on the KoTextEditor state and commandStack, new head commands are pushed on the commandStack, or the current top command is popped.

I will not enter into more details here, if you are interested in the whole gory logic of this, you can look at the code in calligra/libs/kotext/KoTextEditor_undo.cpp (which for now lies in the text_undo_munichsprint git branch). The code has now been pretty well documented, something I had not done before.

That's it for today. Once again, I ask from as much of you to try our next test release, specifically the undo/redo framework, so that we can ensure that we release a really good stable Calligra Words.





  


Разместил: Planet KDE | Дата: 24.02.2012 | Прочитано: 592 | Раздел: System & Utilities   

Рейтинг статьи

Средняя оценка: 0.00/0Средняя оценка: 0Всего голосов:0

Отлично
Хорошо Нормально Пойдёт Плохо


Смотрите также связанные темы

29.12.2015 Luxoft Teams Up with QNX on Automotive ADAS Technologies
"Collaboration focused on advanced technologies, including road scene reconstruction and augmented navigation, which can enable semiautonomous driving.December 15, 2015 Luxoft Holding, Inc. NYSE:LXFT, a leading provider of software development services and innovative IT solutions to a global client base, and QNX Software Systems Limited, a subsidiary of BlackBerry Limited, today announced a new technology partnership focused on ADAS systems used by automotive original equipment manufacturers OEMs and Tier 1 suppliers. As part of the initiative, Luxoft will leverage its expertise in road-model...
04.03.2008 Вышел QtiPlot 0.9.3
QtiPlot - программа для анализа и визуализации научных данных. Поддерживает написание скриптов на python. Использует для отрисовки 3d-графиков OpenGL. В новой версии: Добавлена поддержка UndoRedo при работе с матрицами. Реализован ASCII импорт / экспорт для матриц. Улучшен импорт из Origin 7.5 файлов. Добавлена возможность определять текстовые надписи для каждой точки данных. Поддержка 3D pie графиков. Некоторые исправления. Страница программы:
15.08.2012 Calligra 2.5 Office and Creativity Suite Released
Words, the word processor, has among other things improved support for editing of tables, tight run-around of text around images, manipulation of table borders, and dragging of text.
18.10.2012 Five reasons to try the new Razor-qt Linux desktop
Razor-qt is a lightweight desktop environment that's based on the Qt framework, much like KDE, and it is "tailored for users who value simplicity, speed, and an intuitive interface," in the project's own words.
06.06.2013 New Version of QNX CAR Platform Expands Design Choices to Include Android Apps and Qt User Interfaces
"Enables automotive companies to tap into vast ecosystem of mobile developers creating Android, HTML5, OpenGL ES, and Qt appsDETROIT, Telematics Detroit Conference, June 5, 2013 QNX Software Systems Limited, a global leader in software platforms for in-car electronics, today demonstrated how the new version of its QNX CAR Platform for Infotainment will enable developers of car infotainment systems to leverage an even broader choice of mobile apps and content.The QNX CAR Platform already supports both HTML5 and OpenGL ES, the two most popular open standards for mobile app development. With the ...
17.10.2013 QNX Platform to Support New Intel Atom Processor Family
"E3800 family designed to address performance/watt needs of wide range of embedded systemsOTTAWA, October 15, 2013 QNX Software Systems Limited, a global leader in software platforms for connected embedded systems, today announced it will support Intel Corporations new Intel Atom processor E3800 product family, formerly codenamed Bay Trail. Targeted at the embedded market, the new processor family is designed to address the growing performance-per-watt needs of a wide range of intelligent systems such as automotive infotainment systems, medical devices, building automation panels, and industri...
12.08.2014 QNX Releases New Version of IEC 62304-Compliant OS for Medical Devices
"Helps manufacturers reduce cost and effort of developing devices that require regulatory approval from agencies such as the FDA, MDD, and MHRA.OTTAWA, July 15, 2014 Building on its proven history of providing highly reliable software platforms for safety-critical environments, QNX Software Systems Limited, a subsidiary of BlackBerry, today announced a new release of its OS for medical devices.The QNX OS for Medical 1.1 complies with the IEC 62304 medical device standard for software life cycle processes and is designed to help manufacturers reduce the cost of developing robotic surgical instr...
10.01.2013 QNX CAR Application Platform 2.0 Chosen by Delphi for Next-Generation Infotainment Systems
"Global tier one automotive supplier uses HTML5-based platform to create seamless connectivity from mobile devices to in-vehicle infotainment experienceLAS VEGAS, 2013 International CES North Hall, Booth 1837, January 8 QNX Software Systems Limited, a global leader in software platforms for in-car electronics, today announced that Delphi Automotive NYSE: DLPH has chosen the QNX CAR application platform 2.0 for use in next-generation infotainment systems. This week, at CES, Delphi will demonstrate how it has leveraged the HTML5 framework in the QNX CAR application platform to create a powerfu...
18.10.2012 New HTML5 SDK from QNX Bridges the Gap Between App Developers and Automakers
Mobile developers can now create automotive apps based on standard web technologies like CSS3, HTML5, and JavaScriptDETROIT, SAE Convergence 2012 booth 815, October 16, 2012 Mobile app developers see car infotainment as a potentially lucrative new market, and automakers want to leverage the talents of the mobile community but until now, the two sides have had little way of working together. Today, QNX Software Systems Limited announced a new solution designed to tear down these barriers and to enable new partnerships between the mobile and automotive worlds: the HTML5 SDK for the QNX CAR 2 app...
12.03.2015 Euroimpiantis Autonomous Robots Gear Up with Latest Release of QNX Neutrino OS
"Global leader in automated warehouse solutions standardizes on QNX Neutrino for the control systems and human machine interfaces of its next-generation robots.NUREMBURG, Embedded World 2015, Booth 4-358, February 24 QNX Software Systems Limited, a subsidiary of BlackBerry Limited, today announced that Euroimpianti S.p.A., a global leader in automated warehouse solutions, will use the latest release of the QNX Neutrino OS to power the realtime control systems and human machine interfaces HMIs of its next-generation autonomous warehouse robots.A long-established QNX customer, Euroimpianti uses...
Нет комментариев. Почему бы Вам не оставить свой?
Вы не можете отправить комментарий анонимно, пожалуйста зарегистрируйтесь.
Google Search
Google

Web irc-unix.net

Топ Новостей
1: KDE Community announces fully open source Plasma Mobile
Hot NEWS!
Просмотров - 559


2: KWallet5 can be auto-unlocked during login again
Просмотров - 500

3: Interview with Laura
Просмотров - 471

4: Use ownCloud provided Packages, then VM, then Zip, no distro packages.
Просмотров - 467

5: Plasma Components on Android: Accelerating Subsurface Mobile Development
Просмотров - 457

6: VMware Workstation 11 and kwin - hangs and hiccups (solved?)
Просмотров - 435

7: debian/rake: Ruby DH Sequencing?
Просмотров - 435

8: Plasma 5 Powers KaOS Productivity
Просмотров - 426

9: KWrite on Mac – Application Bundle
Просмотров - 421

10: FOSDEM Desktops DevRoom 2016 Call for Participation
Просмотров - 396

11: New Year Calligra Words Sprint
Просмотров - 394

12: digiKam 5.0.0-beta2 is released
Просмотров - 393

13: Interview with Pierre Geier
Просмотров - 388

14: back in the habit
Просмотров - 378

15: Kexi 3
Просмотров - 373

Google 120X240
Ссылки

Главная | Actual Topics | Статьи | Обратная связь | Guest Book
Генерация: 0.912 сек. и 13 запросов к базе данных за 0.839 сек.
Powered by SLAED CMS © 2005-2007 SLAED. All rights reserved.