Re: [gedit-list] GtkSourceCompletion



Op maandag 23-07-2007 om 09:25 uur [tijdzone +0200], schreef chuchi:
> Hi Jesse,
> 
>     There are no problem. If two plugins wants to provide completion
> items for the same event, GtkSourceCompletion completion calls to the
> first provider and insert the items into the popup. Then it calls to
> the second provider and insert the items into the popup. When
> GtkSourceCompletion has called to all providers, show the popup with
> all items of all providers.
> 
>     When an event occurs, It call all the providers but is not
> mandatory to show items. I explain: We trigget an event when the user
> write "." and we have two providers registered to this event. When the
> user write "." then GtkSourceCompletion calls the first provider but
> the first provider detects that we are in a comment and not return any
> Item to be shown. The second provider detects that the we are in a
> comment an then return only gtk-doc items (Is an example).

This is not what I meant (I think). What I mean is, that when you have
an event that you'd like to be triggered by say ".", then it seems that
the provider has to detect the insertion of "." and then fire the
correct event on the source-completion. When you then have multiple
providers wanting to be triggered by this same custom "." event, then
they both need to listen on the text-buffer for insertion of ".". When
this happens they both fire up the completion. You can of course fix
this by disregarding any event request when the popup is already shown,
but this is 1) not that clean of a solution and 2) all providers need to
do the same work which can be abstracted and put away in the
source-completion.

>     The event is triggered when the user write "." but the provider
> can filter anything and decide if it want to show data or not and what
> data want to show.

> Regards,
>     Chuchi
> 
> El lun, 23-07-2007 a las 09:11 +0200, Jesse van den Kieboom escribió: 
> > Wouldn't this be problematic if you have more than one plugin that wants to
> > provide completion items for the same events (say "."). How would this
> > work. Both need to detect insertion of "." and popup the completion dialog,
> > but this goes wrong if they're both active. It might be a good idea to add
> > a function with which you can register a provider together with a list of
> > strings which initiates the event? Another problem might be how that you
> > don't always show a popup for "->" or "." in programming languages due to
> > the context of a string or a comment. We might be able to use the contexts
> > in the new highlighting engine if they could be exposed somehow (as they
> > are now just some internal representation of different parts to highlight).
> > 
> > Jesse
> > 
> > On Sun, 22 Jul 2007 23:22:11 +0200, perriman <chuchiperriman gmail com>
> > wrote:
> > > Hi Johannes!
> > > 
> > > I explain you some about the trigger events:
> > > 
> > > Actually GtkSourceCompletion have two default events:
> > > 
> > > .- User request event: When a user press control+return
> > > .- Word completion event: When a user writes 4 consecutive characters
> > > 
> > > You can develop a lot of external events like a "c-completion-event"
> > > that trigger an event when the user writes "->" or "." etc. This event
> > > only have to detect the user entry ("->", "." etc) and then call
> > > gtk_source_completion_popup_raise_event with the parameters and
> > > GtkSourceCompletionPopup call to all providers registered to this event.
> > > 
> > > Other way to do this: Create a provider and register it with the "word
> > > completion event" then detect if the user write a c symbol "->", "." etc
> > > and show the data.
> > > 
> > > 
> > > I don't know the new Tooltip API but I can study it. Can you give me an
> > > URL or some documentation where I can learn it?
> > > 
> > > Regards,
> > > 	Chuchi
> > > 
> > > El dom, 22-07-2007 a las 17:20 +0200, Johannes Schmid escribió:
> > >> Hi Perriman!
> > >> 
> > >> Looks good! Some questions:
> > >> 
> > >> What can trigger events? We usually want that an event occurs when the
> > >> user types in a word, something like "->" or "." or "(", etc. Is this
> > >> possible?
> > >> 
> > >> Another thing that would be nice is that we integrate tooltips into this
> > >> API (using the new Tooltip API) because we already have all this code
> > >> for the events.
> > >> 
> > >> Regards,
> > >> Johannes
> > >> 
> > >> perriman schrieb:
> > >> > I have changed some things:
> > >> > 
> > >> >  - Added a priority property to GtkSourceCompletionData
> > >> >  - GtkSourceCompletionPopup sort all items by priority
> > >> >  - I have removed gtk_source_completion_popup_add_event
> > >> >  - I have changed gtk_source_completion_popup_register_provider. Now
> > > you
> > >> > must 
> > >> >    pass a parameter with the event name. When an event occurs, the
> > > popup
> > >> > only call
> > >> >    the providers registered for this event.
> > >> > 
> > >> > If you have some another change, make me know.
> > >> > 
> > >> > 
> > >> > _______________________________________________
> > >> > gnome-devtools mailing list
> > >> > gnome-devtools gnome org
> > >> > http://mail.gnome.org/mailman/listinfo/gnome-devtools
> > >> > 
> > >> 
> > > 
> > > _______________________________________________
> > > gedit-list mailing list
> > > gedit-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/gedit-list
> > > 
> > 
> > _______________________________________________
> > 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.   
> 
> 
> 
> 
> 
-- 
Jesse van den Kieboom

Visit: http://www.icecrew.nl




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