Re: pango_scan_string() deprecation

2017-01-05 Thread Richard Shann
On Thu, 2017-01-05 at 17:02 +0100, infirit wrote:
> Op 01/05/2017 om 03:39 PM schreef Richard Shann:
> > I see that pango_scan_string() is deprecated since version 1.38
> > but the documentation doesn't indicate what it should be replaced with -
> > anyone got any ideas?
> 
> See [1] for the reasoning. Its now deprecated but from the looks of it
> there is no intention just yet to remove it.
> 
> And there is no replacement but its fairly simple and self contained so
> you could just copy [2] it and include it in your own code.

Thank you I've done that.
Richard
> 
> ~infirit
> 
> [1] https://bugzilla.gnome.org/show_bug.cgi?id=682840
> [2] https://git.gnome.org/browse/pango/tree/pango/pango-utils.c#n448
> 


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: pango_scan_string() deprecation

2017-01-05 Thread infirit
Op 01/05/2017 om 03:39 PM schreef Richard Shann:
> I see that pango_scan_string() is deprecated since version 1.38
> but the documentation doesn't indicate what it should be replaced with -
> anyone got any ideas?

See [1] for the reasoning. Its now deprecated but from the looks of it
there is no intention just yet to remove it.

And there is no replacement but its fairly simple and self contained so
you could just copy [2] it and include it in your own code.

~infirit

[1] https://bugzilla.gnome.org/show_bug.cgi?id=682840
[2] https://git.gnome.org/browse/pango/tree/pango/pango-utils.c#n448

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


pango_scan_string() deprecation

2017-01-05 Thread Richard Shann
I see that pango_scan_string() is deprecated since version 1.38
but the documentation doesn't indicate what it should be replaced with -
anyone got any ideas?

Richard Shann


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Accessors vs Properties

2017-01-05 Thread Tobias Knopp
Hi,

so you mean that the getter/setter usually internally calls the dynamic 
„property“ version where the property is passed as a string?
Thus it would make sense that language bindings are fine using the 
get/set_property methods since there is no overhead.

Best regards,

Tobias


> Am 05.01.2017 um 08:27 schrieb Gergely Polonkai :
> 
> Hello,
> 
> I don't know about others, but in my own code, my_obj_set_property() does 
> nothing else just calls the setter functions (and the same for getters). It 
> makes much more sense, and I saw it in a lot of Gtk and Gnome code, too.
> 
> Best,
> Gergely
> 
> 
> On Wed, Jan 4, 2017, 19:27 Tobias Knopp  > wrote:
> Hi,
> 
> I am working on Gtk language bindings for the Julia programming language 
> (https://github.com/JuliaGraphics/Gtk.jl 
>  
>  >) and have a question regarding the 
> accessor methods (methods with „get“ and „set“ in them) and the property 
> system.
> 
> - Is any accessor backuped with a property and vice versa?
> - Which one is to prefer?
> 
> I tried to find documentation on this but have not found anything.
> 
> Thanks,
> 
> Tobias
> 
> 
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org 
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list 
> 
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Accessors vs Properties

2017-01-05 Thread Tobias Knopp
Thanks, do you know what the Python gtk bindings (3.x) are using?

Tobias

> Am 05.01.2017 um 11:05 schrieb Debarshi Ray :
> 
> On Tue, Jan 03, 2017 at 10:46:13PM +0100, Tobias Knopp wrote:
>> - Is any accessor backuped with a property and vice versa?
> 
> Nicola already answered this.
> 
>> - Which one is to prefer?
> 
> It depends.
> 
> For simple setting and getting of values from C, I prefer the
> accessors because (a) it lets the compiler do some minimal type
> checking (b) accessors are more efficient at returning a C string than
> g_object_get. However, you need properties if you want to have a
> 'parametrized constructor'. ie. pass arguments to a *_new function.
> 
> Properties are more convenient from higher-level languages. eg., in
> JavaScript, you can use my_obj.prop to access a property.
> 
> They also offer extra features:
> 
> (a) You can bind a property on one object to another property
> elsewhere (see g_object_bind_property*).
> 
> (b) Every property comes with its own 'notify' signal that you can use
> to listen for changes.
> 
> (c) They can be introspected at run-time, which is very useful if you
> are writing a tool like the gtk+ inspector, glade or d-feet.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Accessors vs Properties

2017-01-05 Thread Debarshi Ray
On Tue, Jan 03, 2017 at 10:46:13PM +0100, Tobias Knopp wrote:
> - Is any accessor backuped with a property and vice versa?

Nicola already answered this.

> - Which one is to prefer?

It depends.

For simple setting and getting of values from C, I prefer the
accessors because (a) it lets the compiler do some minimal type
checking (b) accessors are more efficient at returning a C string than
g_object_get. However, you need properties if you want to have a
'parametrized constructor'. ie. pass arguments to a *_new function.

Properties are more convenient from higher-level languages. eg., in
JavaScript, you can use my_obj.prop to access a property.

They also offer extra features:

(a) You can bind a property on one object to another property
elsewhere (see g_object_bind_property*).

(b) Every property comes with its own 'notify' signal that you can use
to listen for changes.

(c) They can be introspected at run-time, which is very useful if you
are writing a tool like the gtk+ inspector, glade or d-feet.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Accessors vs Properties

2017-01-05 Thread Nicola Fontana
Hi,

Il Tue, 3 Jan 2017 22:46:13 +0100 Tobias Knopp  scrisse:

> ...
> - Is any accessor backuped with a property and vice versa?

Only the second part stands, i.e. any property should have its
own accessors. There is some exception though, e.g.
GtkContainer:child, but that is a special property anyway (it is
write-only).

> - Which one is to prefer?

They are equivalent. Sometime you can encounter missing accessors,
so I'd use g_object_{set,get}_property(), more so if you plan
to do some automatic processing (e.g. writing binding code).

Ciao.
-- 
Nicola
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Accessors vs Properties

2017-01-05 Thread Nicola Fontana
Il Thu, 05 Jan 2017 07:27:10 + Gergely Polonkai  
scrisse:

> Hello,
> 
> I don't know about others, but in my own code, my_obj_set_property() does
> nothing else just calls the setter functions (and the same for getters). It
> makes much more sense, and I saw it in a lot of Gtk and Gnome code, too.

Hi,

at least in GTK+ it is the other way, i.e. the setters call
gtk_*_set_*():

https://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c?h=3.22.6#n3684

Ciao.
-- 
Nicola
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list