[MonoDevelop] [PATCH] Include _ on double-click selectionof words
Ben Motmans
ben.motmans at gmail.com
Sun Apr 22 08:12:17 EDT 2007
Hey,
On 4/22/07, Miguel de Icaza <miguel at ximian.com> wrote:
> I remember that we could not figure out a way of providing the new
> policy.
>
I googled around a bit this morning, and i stumbled onto some pango
documentation:
http://sector7.xor.aps.anl.gov/programming/gtk-2.6/pango/pango-Text-Processing.html#pango-break
http://sector7.xor.aps.anl.gov/programming/gtk-2.6/pango/PangoEngineLang.html#PangoEngineLangClass
essentially, what the docs tell us, is to create a new PangoEngineLang
class and implement the script_break () method, though there is an
issue with this solution:
according to monodoc, Pango# does not allow us to implement
script_break, maybe we could add a ScriptBreakFunc property? this way
we still allow the use of pango_default_break () when the property is
set to null and we can override it whenever we want
so, a possible solution?
Create a subclass of Pango.EngineLang that takes the old
Pango.EngineLang as a parameter. Expose the pango_default_break ()
method in Pango.Global.
When the ScriptBreakFunc of the constructor parameter is null, call
Pango.Global.DefaultBreak, otherwise call param.ScriptBreakFunc.
Afterwards, loop through the Pango.LogAttr array generated by calling
DefaultBreak or ScriptBreakFunc and set LogAttr.IsWordEnd/IsWordStart
for instances of '_'
though, please keep in mind I'm far from a Pango expert, so this chain
of thoughts could be totally useless .. so let me know if this is
leading to something or if you came to the same conclusions but found
some additional problems I'm not aware of
-- Ben
More information about the Monodevelop-list
mailing list