Re: Separating GdkAtom and Atom



[...]

>
>So, we need to add functions to GTK+-2.0 to do the same operations,
>but in a "using the default display" manner. These functions will be
>protected with #ifndef GDK_MULTIHEAD_SAFE in GTK+-2.2. The names I
>have currently are:
>
> Atom    gdk_x11_atom_to_xatom     (GdkAtom      atom);
> GdkAtom gdk_x11_xatom_to_atom     (Atom         xatom);
> Atom    gdk_x11_get_xatom_by_name (const gchar *atom_name);
> gchar * gdk_x11_get_xatom_name    (Atom         xatom);
>
>I actually like these names considerably better than the
>multihead-branch names, because it's hard for me to keep straight what
>is the "real" atom, and what the "virtual" atom.
>
>But it is rather confusing to use unrelated names for the
>same operations depending on whether there is a GdkDisplay
>parameter or not.
>
>So, we probably should pick one of the following schemes:
>
> gdk_x11_default_atom_to_xatom (GdkAtom atom);
> gdk_x11_atom_to_xatom (GdkDisplay *display, Atom atom);
> 
> gdk_x11_atom_to_xatom (GdkAtom atom);
> gdk_x11_display_atom_to_xatom (GdkDisplay *display, GdkAtom atom);
> 
> gdk_x11_atom_to_xatom (GdkAtom atom);
> gdk_x11_atom_to_xatom_for_display (GdkDisplay *display, GdkAtom atom);

I'll propage this changes in the multihead branch.

[...]

>
>With the code to implement virtual GdkAtoms in hand, I started
>looking at converting the code in GDK and GTK+ to properly
>use atoms. Even having Erwann's work in gtk-multihead
>as comparison point, it didn't look like a fun job.
>(I started off doing plug and socket in GTK+ and immediately
>found a couple of places where the conversion was missing
>in gtk-multihead.)

Thanks for pointing this out, I'll use our "debugging aid" to check 
for any missing conversion.

[..]

>I originally planned to just do this as a transition measure
>turned on with a #define and switch back to the standard gulong define
>later, but on consideration I think it's  better to keep it this
>way. 

I agree, this could catch bugs earlier rather than later.

[..]
> - Finalize the naming scheme

What else is there to finalize ?

[..]

Erwann


[ I speak for myself, not for Sun ]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Erwann Chénedé, Sun Microsystems Ireland
  Desktop Applications & Middleware Group
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]