Monday 20 August 2012

Final end of GSoC 2012

Today is firm "pencils down" date, so it's time for summary of work done in last 3 months. I learned a lot during this time and I hope I will be able to work on any GSoC project next year again.
As you know this summer I worked on whiteboarding feature of Swift which is XMPP based chat client. UI side wasn't very demanding and I think the hardest part was the synchronization protocol. There is no standard whiteboard protocol approved by XSF, so I needed to create my own. Remko(my mentor) wanted to use Operational Transformation to keep clients in sync. The problem was that descriptions of OT which I found didn't covered everything. I needed to find own universal method to compute relevant operations for different situations. It took me a while to understand everything and implement it, but final whiteboard works quite nice thanks to that algorithm.  Whole protocol has been implemented in Swiften library, so it could be easily reused in other clients using this library. At this time only one-to-one sessions are supported, but I will try make it work with MUCs after GSoC. I will also have to finish up my XEP, which so far contains descriptions of 4 situations and general way of computing relevant operations.

Monday 13 August 2012

Suggested pencils down time

Last week I worked a little with XEP describing my protocol and then I focused on changes changes proposed by Remko. I changed texts informing about session status, added button to cancel whiteboard request, added "Opened whiteboards" section to chats tab(which allows to see opened whiteboard chats and bring it up), added handling of sessions where one side goes offline, reorganized a little session handling code, "ifdefed" whiteboard code to include it only if experimental flag is set, finally added eraser icon and modified UI a little. At the end of the week I rebased my branch on master and did some final touches according to Remko's comments. He said that he suspects that whiteboard can be integrated quite soon after GSoC pencils down under experimental.

Sunday 5 August 2012

Final preparations

This week I implemented last missing functionality which is moving of elements up and down. I modified existing "update" operation so it now has newPos field. I tried to use as few as possible operations because of amount of transformation functions(They has to handle every combination). Besides that I also added some small fixes and started writing the XEP describing protocol which I've created. Its XML format is quite simple so it doesn't need much description, but whole protocol is largely based on on operational transformation algorithm which needs detailed description about how to handle specific situations.

Sunday 29 July 2012

Minor improvements

This week I added option to modify brush and pen of selected element. I also added support for delete operation of the same element on both sides and combination of delete and update. I had a problems with bug which caused weird behaviour when I repeated several times delete and update operations of the same element, but I fixed that already and everything is working fine now as you can see here: http://www.youtube.com/watch?v=0_dta0JjPlI . I still need to implement moving of elements up and down and add some small fixes but whiteboard is almost ready.

Saturday 21 July 2012

Supplying transformation functions

This week I continued to work with synchronization protocol. I still needed to handle operations such as delete and update. Because of the versatility of the client and server class I had to provide only appropriate transformation functions. By adding these operations I could add ability to modify(move, change line width, change colours) and delete elements. The protocol is almost ready for now, but I still have to consider few more situations(such as the same element deleted on both sides).

Sunday 15 July 2012

Continuation of working with OT

This week I continued to work on class handling client side of OT. I was afraid that it will be hard to compute all weird situations, but it turned out to be quite easy. Everything is based on "bridge" of operations. New local operations are added to it's back and all incoming server operations should be transformed against all "bridge" operations, which as result gives new bridge and transformed operation which could be applied on local side. My transformation function is quite easy for now and it is able to compute only insert operations. I will have to extend it to handle also element updates and removes. At the end of the week I combined actual whiteboard with classes handling synchronization and I think it works quite well, both whiteboards are the same after putting little mess on them. Here is screencast presenting this: http://www.youtube.com/watch?v=Ep2YFX39PJk

Sunday 8 July 2012

Working on Operational Transformation

This week I worked on server and client side classes handling Operational Transformation algorithm. I will use them to keep whiteboard between clients in sync. Client and server are just roles assigned to clients and there will be no real server. I am using algorithm similar to this used in Google Wave and I am basing on this description: http://www.codecommit.com/blog/java/understanding-and-applying-operational-transformation. Server side is quite easy to implement because it takes care only for own operations and operations which are parented somewhere in it's history(it's easy to compute adequate operation to append to the end of history). Because of that it has to store only history of own operations. Client class is more complex. It has to take care of own and has to compute appropriate server operations(which anyway are computed in transformation function during computation of client version operations). So far I have created server with it's unit tests and client which is able to resolve such situation. Next week I will try to expand client class to handle more complicated operations.

Monday 2 July 2012

Finishing serialization of graphics items

My recent work was to handle serialization and parsing of graphics elements so I could send and receive them easily in session class where synchronization protocol will be located. After serialization elements are in svg format(it's already documented and it's enough for my purposes). This work wasn't much time consuming and hasn't taken 2 weeks, but I had exam session previous week so I didn't have much time and this week I already began to work on implementation of Operational Transformation to keep elements in sync. So far I have been focused mainly on thinking about good data structure to store history of OT operations, but I haven't found any yet.

Sunday 17 June 2012

Improving session class

This week I still worked on session handling and at the end of the week I started working on serialization/parsing of graphics objects. At the beginning of the week I  splitted WhiteboardSession class into IncomingWhiteboardSession and OutgoingWhiteboardSession. I also changed a little a way of responding to initialization IQs. Now IQ result is send no matter if user accepts or not the session. Here is screencast which presents how everything works: http://www.screencast-o-matic.com/watch/cl1lXDmGj. Later this week I improved a little initialization from the UI side. Here is new screencast showing these improvements: http://www.youtube.com/watch?v=LV4CeYp2GOE (I uploaded it to youtube because previous one doesn't work on my computer). As I said before, at the end of the week I worked on serialization and parsing of graphics elements. I created base code to handle this which at now works with a simple line and which I will extend with more elements.

Monday 11 June 2012

Session handling class

This week I worked on class responsible for managing UI and class used to connect UI with the world. After talking with Remko I transformed WhiteboardController into WhiteboardManager because there is no need for typical controller but only for something taking care of WhiteboardWindow instances. Receiving and sending of data in WhiteboardWindows is done  through WhiteboardSession. Work on this and session manager classes took me most of the week. It can now send and receive raw data and initialize session with other user. Session initialization from user side looks very similar to initialization of file transfer. On received session request information about it with option to accept or cancel session is added to chat window.

Saturday 2 June 2012

Started implementing prototype into Swift

This week I created class to handle freehand paths and I added option to move items up and down. After that I started implementing my prototype into swift. I created classes needed to handle new window and  then I created simple controller class and added simple payload to swiften. I placed my controller in ChatController, but I did that only for testing purposes. I will think about right place for it later. I wanted to "make something working", so I added serialization function to whiteboard window class(It isn't place for it, but it was easiest way to do serialization). After connecting everything in the controller I was able to send lines and handfree paths.

Saturday 26 May 2012

First week effects

This week I worked on a whiteboard prototype. It is quite usable now. It offers drawing straight lines, freehand paths, rectangles, circles, polygons and writing text. It also allows to delete items and move them.
Here is screenshot of my prototype:


To implement it I use QGraphicsScene with classes inherited from QGraphicsItem which provides almost every functionality I need. I think that I will have to create my own class for handling freehand paths because QPainterPath, which I use now, automatically closes path and fills covered area.

Friday 18 May 2012

First post

It's first post on this newly created blog. I thought about creating some kind of homepage some time ago, but I never realized that idea. Recently I have been accepted to Google Summer of Code 2012 and I was encouraged to create a blog. So here it is :). I will use it mainly to post informations about progress with my project, but not only. This summer I will be adding whiteboarding to Swift. I think it is very interesting project and I won't be bored.