GtkSourceCompletion

perriman <[email protected]>
Newsgroups gmane.comp.gnome.apps.gedit,gmane.comp.gnome.devtools
Message-ID <1194819752.5681.17.camel@localhost>
Hi all,

I have uploaded a new version of GtkSourceCompletion to svn. It supports
disable events, control if two differents plugins add the same events. I
have added a new delay property to show the completion popup. This
feature does the completion less intrusive.

svn: http://tools.assembla.com/svn/gtkdevtools/gtksourcecompletion/trunk

I have uploaded a new gedit plugin: Document words completion. This
plugin complete the written words in the current document. You can
activate the autocompletion or complete the actual word with a user
request (control+Return). You can set the completion delay too.

svn:
http://tools.assembla.com/svn/gtkdevtools/gedit-docwordscompletion-plugin/trunk

You need install gtksourcecompletion and then compile and install
gedit-docwordscompletion-plugin.

You can open a ticket with some new features or a bug in:

http://tools.assembla.com/gtkdevtools/wiki


I show to you an snippet using gtksourcecompletion. With only a few of
lines you can add autocompletion support to a GtkTextView:

DocwordscompletionPlugin * dw_plugin =
(DocwordscompletionPlugin*)plugin;
GtkTextView* view = GTK_TEXT_VIEW(gedit_window_get_active_view(window));
if (view!=NULL)
{
  GtkSourceCompletion *comp = gtk_source_completion_get_from_view(view);
  if (comp==NULL)
  {
    comp = gtk_source_completion_new(GTK_TEXT_VIEW(view));
  }
  if (!
gtk_source_completion_have_provider(comp,GSC_DOCUMENTWORDS_PROVIDER_NAME))
  {
    if (dw_plugin->priv->conf->ac_enabled)
    {
      gtk_source_completion_autocompletion_event_enable(comp);

gtk_source_completion_autocompletion_event_delay(comp,dw_plugin->priv->conf->ac_delay);
    }
    gtk_source_completion_active_user_request_event(comp);
    GscDocumentwordsProvider *dw  = gsc_documentwords_provider_new();

gtk_source_completion_register_provider(comp,GTK_SOURCE_COMPLETION_PROVIDER(dw));
  }
} 

Regards,
	Chuchi

PD: I will add the plugin to gedit plugins page.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.