Re: Units and resolution independence for gtk+
- From: "BJörn Lindqvist" <bjourne gmail com>
- To: "David Zeuthen" <david fubar dk>
- Cc: gtk-devel-list gnome org
- Subject: Re: Units and resolution independence for gtk+
- Date: Fri, 8 Aug 2008 18:36:38 +0200
2008/8/8 David Zeuthen <david fubar dk>:
> The thinking is that if the feature becomes default then the macro will
> be resolved to a GtkSize with high bits set at compile time. For 2.x,
> the thinking is that it will resolve to a function call and the
> conversion happens at run time, e.g.
In bindings the macro will always be a function call, obivously.
> o if RI is enabled, GTK_SIZE_EM(size) will resolve to a GtkSize with
> some high bit sets: (size | (1<<30))
>
> o if RI is not enabled, GTK_SIZE_EM(size) will resolve to the pixel
> size: size*12
>
> Right now it just looks like this
>
> #define GTK_SIZE_EM(em) gtk_size_em(em)
>
> with
>
> GtkSize gtk_size_em (double em);
>
> Is this approach a problem for binding authors?
Not a bigger or smaller problem than other macros.
The problem with macros is that they cant be wrapped automatically and
a custom wrap function has to be written (and documented) for each
binding. So you use semantically different code in bindings and
C. "gtk_hbox_new(FALSE,GTK_SIZE_EM (1.0))" in C and something like
"gtk.HBox(False,gtk.size_em(1.0))" in PyGTK and something else in
Gtk#.
I think a function-only interface would be preferrable, unless there
are some major performance issues involved here.
--
mvh Björn
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]