Re: [gedit-list] Snippets



Hi all!!

	I am implementing libgtksnippets. This is a snippets utility for
gtktextview (an another editors like scite in a near future).

http://sourceforge.net/projects/gtksnippets/

	It is a shared library based on gedit snippets plugin (i love it!!).
Adding snippets support is very easy, we do this and we have support:


//Load de snippets from disk or database etc.
GtkSnippetsLoader *loader = gtk_snippets_loader_new();
//For load default snippets for all applications (we can load a specific
snippets only for the application we want)
gtk_snippets_loader_load_default(loader);
//Manager gets control of the all editor events 
GtkSnippetsManager *manager = gtk_snippets_manager_new(loader);
g_object_unref(loader);
//Add snippet support for a specific editor and language (filtering by
language. If NULL show all snippets)
gtk_snippets_manager_add_support (manager, (gpointer)editor, "C");
gtk_snippets_manager_add_support (manager, (gpointer)editor2, "Python");
gtk_snippets_manager_add_support (manager, (gpointer)editor3, "C");



The library do all the work.

While i am implementing it, i think in add a new feature that gedit
snippets plugin doesn't have:

When we press control+space a snippet list is showed. Well, when we
press press right in this list, we show a few lines of the snippet
content. What do you think about? Is possible to add this feature in
gedit snippets plugin? Some voluntary? :)

Seen the code pasting in the mail. What do you think about this
implementation? Do you see some problem with this structure? Some
advice?

Regards,
	Chuchi


El vie, 05-01-2007 a las 11:00 +0100, Jesse van den Kieboom escribi� Op donderdag 04-01-2007 om 15:56 uur [tijdzone +0100], schreef Chuchi
> Perriman: 
> > Hi all!!
> > 
> > Who are developed snippets plugin?? It's a perfect plugin!! All, idea,
> > management, utility...
> 
> That would be me, so thanks :)
> 
> > I'm thinking to do a snippets library for GtkSourceView or, perhaps,
> > for GtkTextView for anjuta IDE.
> > 
> > My idea is:
> > 
> >    Create snippets library libsnippetsxxx with a snippets-manager
> > object that load the configuration and snippets and later add support
> > to gtksourceviews and the snippets-manager catch signal for show the
> > snippets when they click "control+space" or the configured keys.
> 
> We are thinking about implementing a more generic popup completion
> window for gtksourceview (first implemented in gedit) so you would be
> able to use that.
> 
> >    In the same library (or another), add an object
> > snippets-manager-dialog that open the gtk dialog (Like in gedit) for
> > add, remove etc snippets.
> 
> I think it would also be nice to add a parser for the snippets. One
> problem with implementing it in C might be to properly support python
> snippets (don't know if you want that).
> 
> >    I write to you because you are developed the perfect snippets
> > plugin for me and i want to do almost the same in a C library.
> 
> It's probably a lot of work in C, so enjoy :) Please let us know about
> your progress so we can backport any improvements you make on snippets.
> 
> 




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