Bug 21578 - Use glib-mkenums to generate enum descriptions
Summary: Use glib-mkenums to generate enum descriptions
Status: RESOLVED FIXED
Alias: None
Product: libxklavier
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Sergey V. Udaltsov
QA Contact: Sergey V. Udaltsov
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-05 14:14 UTC by Sayamindu Dasgupta
Modified: 2009-07-02 14:08 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Proposed patch (6.44 KB, patch)
2009-05-05 14:25 UTC, Sayamindu Dasgupta
Details | Splinter Review
Use bitmask for XklEngineFeatures (992 bytes, patch)
2009-07-01 16:01 UTC, Sayamindu Dasgupta
Details | Splinter Review

Description Sayamindu Dasgupta 2009-05-05 14:14:24 UTC
libxklavier should use glib-mkenums so that language bindings and introspection utilities can use the enums (XklEngineStateChange, XklEngineFeatures, etc).

I'm working on Python bindings, and I cannot wrap the enums via the usual way unless this is done.
Comment 1 Sayamindu Dasgupta 2009-05-05 14:25:40 UTC
Created attachment 25511 [details] [review]
Proposed patch
Comment 2 Sergey V. Udaltsov 2009-06-25 14:36:56 UTC
Something is wrong:

In file included from xklavier_private.h:27,
                 from xklavier.c:28:
../libxklavier/xklavier.h:33:40: error: libxklavier/xkl-enum-types.h: No such file or directory
xklavier.c: In function ‘xkl_engine_class_init’:
xklavier.c:833: error: ‘XKL_TYPE_ENGINE_FEATURES’ undeclared (first use in this function)
xklavier.c:833: error: (Each undeclared identifier is reported only once
xklavier.c:833: error: for each function it appears in.)
xklavier.c:774: warning: unused variable ‘feature_flags’
Comment 3 Sergey V. Udaltsov 2009-06-28 08:46:21 UTC
Fixed in CVS. Please check.
Comment 4 Sayamindu Dasgupta 2009-07-01 10:00:07 UTC
Thanks so much for this :-)
Comment 5 Sayamindu Dasgupta 2009-07-01 16:01:15 UTC
Created attachment 27308 [details] [review]
Use bitmask for XklEngineFeatures

It looks like glib-mkenums expects a bitmask for flag types, and was wrongly XklEngineFeatures as a static enumeration type instead of a static flag type. 
The attached patch fixes this.

I'm not sure how libxklavier uses the values of the XklEngineFeatures flags internally, so I am not sure how valid this patch is.
Comment 6 Sayamindu Dasgupta 2009-07-01 16:02:22 UTC
Reopening, since with the initial patch a warning is being generated, and XklEngineFeatures related stuff may be broken.
Comment 7 Sergey V. Udaltsov 2009-07-02 14:08:16 UTC
I do not quite understand what is the difference, from C POV it is essentially same code. Anyway, committed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.