Re: [Vala] [PATCH] add missing XStringToKeysym() function to x11.vapi



On Wed, Mar 30, 2011 at 10:08:05PM +0200, Alexander Kurtz wrote:
Am Mittwoch, den 30.03.2011, 21:43 +0200 schrieb Luca Bruno:
I'd rather put that static function outside Display, what do you think?

IMHO XStringToKeysym() is somewhat similar to XKeysymToKeycode() which
(of course) is inside Display. Consider this example code:

      Display display = new X.Display();
      int keysym = display.string_to_keysym(keystr);
      int keycode = display.keysym_to_keycode(keysym);

So, in total I would consider it more intuitive if all these XFooToBar()
functions would be in the same place (I plan to also submit a patch
which would add the other functions).

However, it's not that important after all, just do what you think is
best!

Let's say Keysym was an enum (it's not the case because there's a really 
huge number of keysyms starting with XK_).
In this scenario string_to_keysym should have been an instance method of
this Keysym enum. Therefore it's a method that _only_ belongs to keysyms and
has nothing to do with Display, while the keycode is tied to the Display.

-- 
http://www.debian.org - The Universal Operating System

Attachment: signature.asc
Description: Digital signature



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