Re: What gives us the macro GSEAL()?
- From: Colomban Wendling <ban-ubuntu club-internet fr>
- To: gtk-devel-list gnome org
- Subject: Re: What gives us the macro GSEAL()?
- Date: Mon, 13 Apr 2009 14:30:42 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Grzegorz Kuczyński a écrit :
> Colomban Wendling pisze:
>>> Ok I understand the idea, but... how work it? for example:
>>> --------------- struct _GtkWindow { GtkBin bin;
>>>
>>> gchar *GSEAL (title); --------------- void gtk_window_set_title
>>> (GtkWindow *window, const gchar *title) { char *new_title;
>>>
>>> g_return_if_fail (GTK_IS_WINDOW (window));
>>>
>>> new_title = g_strdup (title); g_free (window->title); window->title
>>> = new_title; //eeee I don't know property title!!! ---------------
>>> So, when define GSEAL_ENABLE code in gtkwindow.c must change in
>>> window->_g_sealed__title = new_title; //??
>>>
>> Well… you must understand that the mean is to broke *user's* source
>> that use members directly if the user wants, not to use when compiling
>> GTK+. See it as a "smooth way to 3.0" feature.
>>
> I understand, it OOP philosophy, GTK+ simulates it
>> But you're right: it is impossible to compile GTK+ with GSEAL_ENABLE
>> enabled. But as GTK+ is used to be compiled separately from the code
>> that use it, there is no problem: just define GSEAL_ENABLE when
>> compiling user's code and not when compiling GTK+.
>>
> I understand that define GSEAL_ENABLE will be placed eg file gtk.h
> after compiling GTK+,
> but what when user will alone compiling GTK+?
> I mean this is the symbolic protections for direct access members of
> struct.
No, AFAIK, GSEAL_ENABLE is not meant to be put in any GTK+ header,
only to be added by hand to your programs' compiling options (e.g.
- -DGSEAL_ENABLE to a GCC's command line) in order to check your program
for compatibility with upcoming releases.
>> But it could be possible (even if it is useless and needs hard work to
>> find places to update) to update the source to use the sealed names,
>> simply by using "GSEAL(name)" instead of "name". But what's the point
>> to do that? Nothing, I think.
>>
> I also do not know what? :)
>>> I don't want write stupidity in Wikibooks. Because I want write
>>> analize for struct GtkWindow AND I myself want understand :)
>>>
>> Explaining the meaning of GTK's structure members is not a good idea
>> IMO since they may are going to change and perhaps become opaque. The
>> right way to access object's properties is to use accessors, and that
>> will become the only way.
>>
> unless you are right, but this is not change this that I must be know
> (and I want) know what is going in GTK+ sources
> I think about this...
I don't really understand what you mean here, sorry :/
Regards,
Colomban
PS:
sorry for the private mail, I forget to update recipient list :/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAknjMHIACgkQyqbACDEjVWjE7ACcDynJzLWhthoJcYYlbvJ3cfiZ
0L4AnRzh2gNRX/0ERf6DXt6TTIb1jMFD
=cYiy
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]