Anjuta Snippets Manager - weekly report #4



Hello,

    My 4th weekly report can also be viewed on my blog [1], and the
source code is hosted on github [2]. The text of my blog post:

    So it's time for my forth weekly report.

# This is what I managed to do this week:

* Done the trigger-key based insertion (at the moment it's Ctrl+E to
insert the snippet, and the trigger-key considered is the word before
the current position of the cursor -- similar to the way the Gedit
Snippets insertion work). The shortcut for this will be configurable
by the user.
* Changed the file format and internal functions to make it possible
for snippets to be common for more languages (considering most
snippets from C will be found in C++ also). This was actually
something I should have done from the start, but bad planning made me
edit almost every single file, so I can add this feature.
* Ported the macros which were used by the Macro Plugin to snippets
used by my plugin.
* Wrote some functions that will be used when making the snippets
dynamic (and I actually have a plan for using them).
* Reviewed a lot of my code until this point and changed even more
:-). This means fixing some memory problems (and a very serious one
which I didn't noticed until this point) or just rewriting some
portions of code which were a mess.

# What I will do for the next week?

     Well ... after talking to Johannes, we decided I should start
working on the UI right now. That means a Snippets Browser (for which
the tree model should be the snippets database - and the snippets
database already implements GtkTreeModel) and a Snippets Editor which
should appear attached to the browser when an arrow is pressed. A GUI
prototype for what I said looks like this: [3] [4].

    Basically, before pushing the arrow on the Snippets Browser we
have our standard Anjuta UI as it is arranged by the user [3]. After
pushing the arrow, the browser will be placed on the left side with
the editor attached (they actually are in the same dockable widget -
which is maximized now), letting the user choose a snippet from the
browser to edit [4]. Pushing the arrow again at this point will bring
up the layout which was chosen by the user [3].
    If anyone doesn't agree with my view about this, I'm waiting for
feedback :-).

    I don't think I will do all of this stuff until my next weekly
report, but here are 2 goals:
* Implement the Snippets Browser (not sure if I can provide all the
features it will have in the end until next week, but at least having
a view of the database should be done).
* Try to implement the prototype above, but without the editor, just
some placeholder.

# How did I do compared to my plans?

    It actually was pretty okay. Last week I proposed some stuff I
should do for the next 2 weeks and I did most of the stuff there
(minus some bits which I will postpone until after the UI is done).

# What I have learned this week?

     Think a lot when planning ahead or you will be forced to rewrite
about 500 lines of code just to fix your initial mess.

[1] http://dragos-dena.blogspot.com/2010/06/anjutasnippetsplugin-weekly-report-4.html
[2] http://github.com/dragos-dena/Anjuta-Snippets-Plugin/tree/
[3] http://swarm.cs.pub.ro/~laura/ddena/before_arrow_push.png
[4] http://swarm.cs.pub.ro/~laura/ddena/after.png

    Best regards,
         Dragos


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]