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 678975 - Keysyms in gdk/gdkkeysyms.h should be defined not as macros, but as an enum
Keysyms in gdk/gdkkeysyms.h should be defined not as macros, but as an enum
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 669994
 
 
Reported: 2012-06-27 11:58 UTC by Mark Vender
Modified: 2018-05-02 15:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Modify gdk/gdkkeysyms-update.pl to output enum instead of #defines (2.37 KB, patch)
2012-06-27 12:00 UTC, Mark Vender
none Details | Review

Description Mark Vender 2012-06-27 11:58:21 UTC
Keysyms should be defined as an enum, not as macro constants. This has the following advantages:

 * Consistency with other enumerations within GTK+
 * Enums follow the scoping rules
 * Much easier wrapping in gtkmm. Enums can be wrapped using standard gmmproc machinery

This change would break the introspection ABI. Since the benefits are too small to justify the breakage, it should be applied only when IABI is going to be broken anyway.

See also answers to this post in the mailing list:

https://mail.gnome.org/archives/gtk-devel-list/2012-June/msg00052.html
Comment 1 Mark Vender 2012-06-27 12:00:56 UTC
Created attachment 217390 [details] [review]
Modify gdk/gdkkeysyms-update.pl to output enum instead of #defines

The attached patch updates gdk/gdkkeysyms-update.pl to output enum instead of #defines (gdk/gdkkeysyms.h would still need to be regenerated).

The enum is generated in the following format:

enum {
    GDK_KEY_*** = ***,
    <...>
    GDK_KEY_*** = ***
};
Comment 2 Kjell Ahlstedt 2017-10-17 09:07:00 UTC
> This change would break the introspection ABI. Since the benefits are too
> small to justify the breakage, it should be applied only when IABI is going to
> be broken anyway.

Can this be implemented in gtk+4?

From gtkmm's point of view, it would be better if the generated enum looked like
other enums, such as

typedef enum
{
  GDK_KEY_*** = ***,
  .......
  GDK_KEY_*** = ***
} GdkKeySyms;
Comment 3 GNOME Infrastructure Team 2018-05-02 15:26:47 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/gtk/issues/398.