After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647467 - x11: Use the aliases previously added in x11.vapi
x11: Use the aliases previously added in x11.vapi
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Bindings
0.12.x
Other Linux
: Normal enhancement
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 647464
Blocks:
 
 
Reported: 2011-04-11 16:02 UTC by Alexander Kurtz
Modified: 2018-05-22 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use-aliases.patch (2.94 KB, patch)
2011-04-11 16:02 UTC, Alexander Kurtz
none Details | Review
Patch (3.31 KB, patch)
2012-02-04 20:06 UTC, Alexander Kurtz
needs-work Details | Review
ConvertTest.vala (1.15 KB, text/plain)
2012-02-04 20:17 UTC, Alexander Kurtz
  Details

Description Alexander Kurtz 2011-04-11 16:02:54 UTC
Created attachment 185725 [details] [review]
use-aliases.patch

After adding the symbolic names for X's data types (#647464), the attached
patch changes x11.vapi to use them.

Please note that this changes the signature of several functions, so
merging this patch *will probably break* existing programs. But since
most of these functions have only been available for a short while, I
thought it may be worth it.

A compromise could be to only change the new functions and leave out
these which have already been in a stable release. What do you think?
Comment 1 Alexander Kurtz 2012-02-04 20:06:22 UTC
Created attachment 206777 [details] [review]
Patch

I've attached an updated and ready to apply version of the original patch.
Comment 2 Alexander Kurtz 2012-02-04 20:17:32 UTC
Created attachment 206779 [details]
ConvertTest.vala

This is a simple test case for converting strings, KeySyms and KeyCodes.
Comment 3 Evan Nemerson 2013-02-18 02:36:42 UTC
Review of attachment 206777 [details] [review]:

This would be an API break.  We could get around the problem for return and out variables if those symbolic names used inheritance (make KeySym inherit from ulong, Cursor from uint, etc.), but it would still break in arguments... I don't see a straightforward way to keep something like this working:

ulong k_lower, k_upper;
ulong ksym = string_to_keysym ("A");
convert_case (ksym, out k_lower, out k_upper);

That said, I would be willing to accept a patch which deprecates the old methods and replaces them with something else.  With some [CCode (instance_pos = ...)] annotations, you could do something like this:

Display.get_keyboard_mapping -> KeyCode.get_keyboard_mapping
Display.grab_button -> Window.grab_button
Display.grab_pointer -> Window.grab_pointer
Display.keysym_to_keycode -> Keysym.to_keycode
string_to_keysym -> KeySym.parse
keysym_to_string -> KeySym.to_string

I think it would be really nice to clean out Display in general, but if we do that we should definitely take advantage of the opportunity to change the API.
Comment 4 GNOME Infrastructure Team 2018-05-22 14:00:38 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/192.