Web lists-archives.com

Re: [RFC] Renaming the GtkSourceView namespace from GtkSource to Gsv

On 10/20/2016 08:05 AM, Georges Basile Stavracas Neto wrote:
> My personal opinion is that it's a good move, even though it'll create
> some pain. Since the API itself won't change behavior-wise, adapting the
> code to the new change will be simple enough (a Search and Replace
> throughout the codebase will be enough, I think).

A script will be provided for C code, based on:

(to keep a good indentation/alignment of the code, assuming the code
aligns function parameters on the opening parenthesis).

For other languages, a sed s/GtkSource/Gsv/ should be enough.

In Vala it's different because Vala has changed GtkSource.[...] to
Gtk.Source[...]. So for example in Vala, GtkSourceView becomes
Gtk.SourceView. And if there is "using Gtk;" at the top of a file, then
what needs to be searched/replaced is "Source", which can result to more
false positives.

Anyway, an intermediary release/tarball will be provided, with the only
change being the namespace change (and maybe also removing the
deprecated API). Still using GTK+ 3. So that app developers can adapt
their code to the new Gsv namespace, and be able to compile/test the
code before porting to GTK+ 4 and GtkSourceView 4.

On Thu, Oct 20, 2016 at 12:12:54PM -0700, Christian Hergert wrote:
> It will certainly make it easier for me to stay within my ideal line width
> for some of the longer named functions. I don't mind a change to Gsv, that's
> what I think/type already when talking about the project.

Yes having shorter code is another advantage, though not the most
important to my eyes. When using GObject-based APIs, it is not rare to
end up with lines of 120 columns, even if there is only one indentation
level, with only one function parameter at the end of the line. This
happens e.g. when chaining-up to the parent vfunc. But 120 columns is
still OK IMHO. Of course 200 columns would be more problematic.

gtk-devel-list mailing list