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 567788 - Make EvJobPriority a proper GType
Make EvJobPriority a proper GType
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-14 19:38 UTC by Tomeu Vizoso
Modified: 2009-01-18 16:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
first try (1.89 KB, patch)
2009-01-14 19:38 UTC, Tomeu Vizoso
none Details | Review
use glib-mkenums (3.37 KB, patch)
2009-01-15 17:53 UTC, Tomeu Vizoso
none Details | Review
base use of glib-mkenums on gucharmap (4.19 KB, patch)
2009-01-18 15:25 UTC, Tomeu Vizoso
committed Details | Review

Description Tomeu Vizoso 2009-01-14 19:38:16 UTC
Need it to be a GType so it can be used by language bindings like python.
Comment 1 Tomeu Vizoso 2009-01-14 19:38:53 UTC
Created attachment 126447 [details] [review]
first try
Comment 2 Christian Persch 2009-01-15 13:49:37 UTC
Why not use glib-mkenums for this?
Comment 3 Tomeu Vizoso 2009-01-15 17:53:46 UTC
Created attachment 126522 [details] [review]
use glib-mkenums
Comment 4 Christian Persch 2009-01-18 13:41:14 UTC
+		--vtail "GType\n@enum_name@_get_type (void)\n{\n" \
+		--vtail "  static GType type = 0;\n\n" \
+		--vtail "  if (G_UNLIKELY (type == 0))\n" \

That's still using the wrong get_type function code, instead of g_once_*. You can copy for example from gucharmap (gucharmap/gucharmap-type-builtins.[ch].template + gucharmap/Makefile.am) for the right form.
Comment 5 Tomeu Vizoso 2009-01-18 15:25:29 UTC
Created attachment 126696 [details] [review]
base use of glib-mkenums on gucharmap
Comment 6 Carlos Garcia Campos 2009-01-18 16:01:44 UTC
Applied to svn trunk (r3353) slightly modified, though (added G_GNUC_CONST and moved ev-job-scheduler.h to the .c template using @filename@)

Thanks.