Re: [gedit-list] Create new language files



Hi all

    Sorry for the bad documentation :(

     In Gedit plugins, I'm currentlly adding the providers into the impl_update_ui. I write some comments into the code:


static void
impl_update_ui (GeditPlugin *plugin,
GeditWindow *window)
{
DocwordscompletionPlugin * dw_plugin = (DocwordscompletionPlugin*)plugin;
dw_plugin->priv->gedit_window = window;
        //We get the current view
GtkTextView* view = GTK_TEXT_VIEW(gedit_window_get_active_view(window));
if (view!=NULL)
{
GscManager *comp = gsc_manager_get_from_view(view);
if (comp==NULL)
{
                        //Create completion if not exists
comp = gsc_manager_new(GTK_TEXT_VIEW(view));
}

                //Check if the provider has been registered
if (gsc_manager_get_provider(comp,GSC_DOCUMENTWORDS_PROVIDER_NAME)==NULL)
{
                        //I register a trigger for configured keys
GscTriggerCustomkey *ur_trigger = gsc_trigger_customkey_new(comp,
    USER_REQUEST_TRIGGER,
    dw_plugin->priv->conf->ure_keys);
gsc_manager_register_trigger(comp,GSC_TRIGGER(ur_trigger));
g_object_unref(ur_trigger);

                        //We create the provider
GscDocumentwordsProvider *dw  = gsc_documentwords_provider_new(view);
                        /And we register the prov.
gsc_manager_register_provider(comp,GSC_PROVIDER(dw),GSC_TRIGGER_AUTOWORDS_NAME);
                        g_object_unref(dw);

                        //We need activate the completion
gsc_manager_activate(comp);
}

}
}

If you want to develop a new provider, you only need to implement the GscProvider interface.

Regards,

    Perriman


El dom, 14-09-2008 a las 20:39 +0000, Mats Taraldsvik escribió:
On Sun, 2008-09-14 at 22:22 +0200, Jesse van den Kieboom wrote:
> On zo, 2008-09-14 at 20:03 +0000, Mats Taraldsvik wrote:
> > Hi,
> > 
> > Great timing, as I'm considering creating a LilyPond syntax file for
> > gedit ( I have already added Compile and View .ly in the External Tools
> > wiki ). This will be completed "at some point", though, I have too many
> > projects going right now.
> > 
> > Somewhat related to this: How is (gtksource)completion (isn't that whay
> > gedit uses?) related to this? How can we make completion for the
> > syntax( files) ?
> 
> Unfortunately gtksourcecompletion is not used yet by gedit because we
> still need to review and integrate it. I would have liked to have it in
> this release cycle (2.24) but we didn't have the time.
> 

Ok. Once it gets integrated, I'm sure there will be an interest for
completion. It will add another star for using gedit for programming. :)

I didn't find documentation on how to add Providers for
GtkSourceCompletion. Do you know where the documentation is?

> > On Sun, 2008-09-14 at 10:54 +0200, Jesse van den Kieboom wrote:
> > > Hi all,
> > > 
> > > I've put up a wiki page to describe the process of creating a new
> > > language file. We can refer to that in the future when more requests
> > > arrive on how to create custom highlighting for unsupported languages.
> > > Also if you have anything to add, feel free to modify the page:
> > > 
> > > http://live.gnome.org/Gedit/NewLanguage
> > > 
> > > 
> > 
> > cheers,
> > Mats
> > 
> > _______________________________________________
> > gedit-list mailing list
> > gedit-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gedit-list
> > 

Mats

_______________________________________________
gedit-list mailing list
gedit-list gnome org
http://mail.gnome.org/mailman/listinfo/gedit-list

 
Pulse para ir al sitio web  
Jesús Barbero Rodríguez
Departamento de Análisis y Programación - Desarrollo tecnológico
Zoco Gran Santander, 1ª Planta ■ 39011 Peñacastillo ■ Santander ■ ESPAÑA

Tel.: +34 902 233 323 ■ Fax: +34 902 234 280




AVISO LEGAL: Este mensaje contiene información destinada exclusivamente al usuario de destino, pudiendo contener información confidencial o protegida legalmente. Si, por un error de envío o transmisión, ha recibido este mensaje y usted no es el destinatario del mismo, por favor, notifique de este hecho al remitente y no use, informe, distribuya, imprima, copie o difunda este mensaje bajo ningún medio . Cualquier opinión en él contenida, es exclusiva de su autor y no representa necesariamente la opinión de Quiter Servicios Informáticos, S.L.

LEGAL WARNING: This e-mail and any attachment, contain information intended solely for the addressee and may contain confidential information or legally protected data. If you are not the intended recipient, please notify the sender and do not use, disclose, distribute, copy, print or rely on this e-mail under any circumstances. The views and opinions expressed are the authorŽs own and do not necessarily reflect those of Quiter Servicios Informáticos, S.L.  






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