Bug 21578

Summary: Use glib-mkenums to generate enum descriptions
Product: libxklavier Reporter: Sayamindu Dasgupta <sayamindu>
Component: GeneralAssignee: Sergey V. Udaltsov <svu>
Status: RESOLVED FIXED QA Contact: Sergey V. Udaltsov <svu>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Proposed patch
Use bitmask for XklEngineFeatures

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.