Templates for enum registration
authorMatthias Clasen <mclasen@redhat.com>
Sat, 1 Dec 2007 01:53:00 +0000 (01:53 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 1 Dec 2007 01:53:00 +0000 (01:53 +0000)
2007-11-30  Matthias Clasen <mclasen@redhat.com>

        * gioenumtypes.[hc].template: Templates for enum registration

        * Makefile.am: Generate gioenumtypes.[hc]

        * gio.h: Include gioenumtypes.h
        * gappinfo.h:
        * gfile.h: Add some explicit nicks.

        * gio.symbols: Add new symbols

        * pltcheck.sh: Adjust

svn path=/trunk/; revision=6002

gio/ChangeLog
gio/Makefile.am
gio/gappinfo.h
gio/gfile.h
gio/gio.h
gio/gio.symbols
gio/gioenumtypes.c.template [new file with mode: 0644]
gio/gioenumtypes.h.template [new file with mode: 0644]
gio/pltcheck.sh

index eab9299..ede30d0 100644 (file)
@@ -1,5 +1,19 @@
 2007-11-30  Matthias Clasen <mclasen@redhat.com>
 
+       * gioenumtypes.[hc].template: Templates for enum registration
+
+       * Makefile.am: Generate gioenumtypes.[hc]
+
+       * gio.h: Include gioenumtypes.h
+       * gappinfo.h:
+       * gfile.h: Add some explicit nicks.
+
+       * gio.symbols: Add new symbols
+
+       * pltcheck.sh: Adjust
+
+2007-11-30  Matthias Clasen <mclasen@redhat.com>
+
        * *.c: Explain etags and link to the explanation
 
 2007-11-29  Matthias Clasen <mclasen@redhat.com>
index a1cfe17..2e92df5 100644 (file)
@@ -165,6 +165,8 @@ libgio_2_0_la_SOURCES =             \
        gvolume.c               \
        gvolumemonitor.c        \
        gvolumeprivate.h        \
+       gioenumtypes.h          \
+       gioenumtypes.c          \
        $(appinfo_sources)      \
        $(unix_sources)         \
        $(local_sources)        \
@@ -189,8 +191,7 @@ endif
 
 libgio_2_0_la_LDFLAGS= -export-dynamic $(no_undefined) -export-symbols-regex '^g_.*'
 
-gioincludedir=$(includedir)/glib-2.0/gio/
-gioinclude_HEADERS = \
+gio_headers =                  \
        gappinfo.h              \
        gasyncresult.h          \
        gbufferedinputstream.h  \
@@ -231,15 +232,35 @@ gioinclude_HEADERS = \
        gvolumemonitor.h        \
        $(NULL)
 
+gioincludedir=$(includedir)/glib-2.0/gio/
+gioinclude_HEADERS =           \
+       $(gio_headers)          \
+       gioenumtypes.h
 
 # these sources (also mentioned above) are generated.
-BUILT_SOURCES = gio-marshal.h gio-marshal.c gioalias.h gioaliasdef.c
+BUILT_SOURCES =                \
+       gio-marshal.h           \
+       gio-marshal.c           \
+       gioalias.h              \
+       gioaliasdef.c           \
+       gioenumtypes.h          \
+       gioenumtypes.c          \
+       $(NULL)
 
 EXTRA_DIST =                   \
        gio-marshal.list        \
        gio.symbols             \
+       gioenumtypes.h.template \
+       gioenumtypes.c.template \
        $(NULL)
 
 CLEANFILES =                   \
        $(marshal_sources)      \
        $(NULL)
+
+gioenumtypes.h: $(gio_headers)
+       ( cd $(srcdir) && $(top_builddir)/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > gioenumtypes.h
+       
+gioenumtypes.c: $(gio_headers)
+       ( cd $(srcdir) && $(top_builddir)/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > gioenumtypes.c
+       
index 4e42685..758a378 100644 (file)
@@ -48,8 +48,8 @@ G_BEGIN_DECLS
  * Flags used when creating a #GAppInfo.
  */
 typedef enum {
-  G_APP_INFO_CREATE_FLAGS_NONE = 0,
-  G_APP_INFO_CREATE_NEEDS_TERMINAL = (1<<0)
+  G_APP_INFO_CREATE_FLAGS_NONE = 0,           /*< nick=none >*/
+  G_APP_INFO_CREATE_NEEDS_TERMINAL = (1<<0)   /*< nick=needs-terminal >*/
 } GAppInfoCreateFlags;
 
 typedef struct _GAppLaunchContext        GAppLaunchContext;
index 035f953..d5ebcf4 100644 (file)
@@ -44,7 +44,7 @@ G_BEGIN_DECLS
  * Flags used when querying a #GFileInfo.
  */
 typedef enum {
-  G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1<<0)
+  G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1<<0)   /*< nick=nofollow-symlinks >*/
 } GFileQueryInfoFlags;
 
 /**
@@ -71,7 +71,7 @@ typedef enum  {
  * Flags used when copying or moving files. 
  */
 typedef enum {
-  G_FILE_COPY_FLAGS_NONE = 0,
+  G_FILE_COPY_FLAGS_NONE = 0,          /*< nick=none >*/
   G_FILE_COPY_OVERWRITE = (1<<0),
   G_FILE_COPY_BACKUP = (1<<1),
   G_FILE_COPY_NOFOLLOW_SYMLINKS = (1<<2),
index 30ff70a..5f4e706 100644 (file)
--- a/gio/gio.h
+++ b/gio/gio.h
@@ -47,5 +47,6 @@
 #include <gio/gmemoryinputstream.h>
 #include <gio/gmemoryoutputstream.h>
 #include <gio/gsimpleasyncresult.h>
+#include <gio/gioenumtypes.h>
 
 #endif /* __G_IO_H__ */
index 0bc2966..d51eaf4 100644 (file)
@@ -714,3 +714,24 @@ g_local_file_monitor_get_type  G_GNUC_CONST
 g_local_directory_monitor_get_type  G_GNUC_CONST
 #endif
 #endif
+
+#if IN_HEADER(__GIO_ENUM_TYPES_H__)
+#if IN_FILE(__GIO_ENUM_TYPES_C__)
+g_app_info_create_flags_get_type G_GNUC_CONST
+g_data_stream_byte_order_get_type G_GNUC_CONST
+g_data_stream_newline_type_get_type G_GNUC_CONST
+g_file_attribute_flags_get_type G_GNUC_CONST
+g_file_attribute_status_get_type G_GNUC_CONST
+g_file_attribute_type_get_type G_GNUC_CONST
+g_file_copy_flags_get_type G_GNUC_CONST
+g_file_create_flags_get_type G_GNUC_CONST
+g_file_monitor_event_get_type G_GNUC_CONST
+g_file_monitor_flags_get_type G_GNUC_CONST
+g_file_query_info_flags_get_type G_GNUC_CONST
+g_file_type_get_type G_GNUC_CONST
+g_io_error_enum_get_type G_GNUC_CONST
+g_output_stream_splice_flags_get_type G_GNUC_CONST
+g_password_flags_get_type G_GNUC_CONST
+g_password_save_get_type G_GNUC_CONST
+#endif
+#endif
diff --git a/gio/gioenumtypes.c.template b/gio/gioenumtypes.c.template
new file mode 100644 (file)
index 0000000..106922d
--- /dev/null
@@ -0,0 +1,38 @@
+/*** BEGIN file-header ***/
+#include <gio.h>
+#include "gioalias.h"
+
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType
+@enum_name@_get_type (void)
+{
+    static GType etype = 0;
+
+    if (G_UNLIKELY(etype == 0)) {
+        static const G@Type@Value values[] = {
+/*** END value-header ***/
+
+/*** BEGIN value-production ***/
+            { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+
+/*** BEGIN value-tail ***/
+            { 0, NULL, NULL }
+        };
+        etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
+    }
+    return etype;
+}
+
+/*** END value-tail ***/
+
+/*** BEGIN file-tail ***/
+#define __GIO_ENUM_TYPES_C__
+#include "gioaliasdef.c"
+/*** END file-tail ***/
diff --git a/gio/gioenumtypes.h.template b/gio/gioenumtypes.h.template
new file mode 100644 (file)
index 0000000..7460056
--- /dev/null
@@ -0,0 +1,24 @@
+/*** BEGIN file-header ***/
+#ifndef __GIO_ENUM_TYPES_H__
+#define __GIO_ENUM_TYPES_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type (void) G_GNUC_CONST;
+#define G_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* __GIO_ENUM_TYPES_H__ */
+/*** END file-tail ***/
index 6858527..9ac48ef 100755 (executable)
@@ -9,7 +9,7 @@ if ! which readelf 2>/dev/null >/dev/null; then
        exit 0
 fi
 
-SKIP='\<g_access\|\<g_array_\|\<g_ascii\|\<g_list_\|\<g_assert_warning\|\<g_atomic_int\|\<g_build_filename\|\<g_byte_array\|\<g_child_watch\|\<g_convert\|\<g_dir_\|\<g_error_\|\<g_file_error_quark\|\<g_file_get_contents\|\<g_file_set_contents\|\<g_file_test\|\<g_filename_\|\<g_find_program_in_path\|\<g_free\|\<g_get_\|\<g_getenv\|\<g_hash_table_\|\<g_idle_\|\<g_intern_static_string\|\<g_io_channel_\|\<g_key_file_\|\<g_listenv\|\<g_locale_to_utf8\|\<g_log\|\<g_main_context_wakeup\|\<g_malloc\|\<g_markup_\|\<g_mkdir_\|\<g_mkstemp\|\<g_module_\|\<g_object_\|\<g_once_\|\<g_param_spec_\|\<g_path_\|\<g_printerr\|\<g_propagate_error\|\<g_ptr_array_\|\<g_qsort_\|\<g_quark_\|\<g_queue_\|\<g_realloc\|\<g_return_if_fail\|\<g_set_error\|\<g_shell_\|\<g_signal_\|\<g_slice_\|\<g_slist_\|\<g_snprintf\|\<g_source_\|\<g_spawn_\|\<g_static_\|\<g_str\|\<g_thread_pool_\|\<g_time_val_add\|\<g_timeout_\|\<g_type_\|\<g_unlink\|\<g_uri_\|\<g_utf8_\|\<g_value_'
+SKIP='\<g_access\|\<g_array_\|\<g_ascii\|\<g_list_\|\<g_assert_warning\|\<g_atomic_int\|\<g_build_filename\|\<g_byte_array\|\<g_child_watch\|\<g_convert\|\<g_dir_\|\<g_error_\|\<g_file_error_quark\|\<g_file_get_contents\|\<g_file_set_contents\|\<g_file_test\|\<g_filename_\|\<g_find_program_in_path\|\<g_free\|\<g_get_\|\<g_getenv\|\<g_hash_table_\|\<g_idle_\|\<g_intern_static_string\|\<g_io_channel_\|\<g_key_file_\|\<g_listenv\|\<g_locale_to_utf8\|\<g_log\|\<g_main_context_wakeup\|\<g_malloc\|\<g_markup_\|\<g_mkdir_\|\<g_mkstemp\|\<g_module_\|\<g_object_\|\<g_once_\|\<g_param_spec_\|\<g_path_\|\<g_printerr\|\<g_propagate_error\|\<g_ptr_array_\|\<g_qsort_\|\<g_quark_\|\<g_queue_\|\<g_realloc\|\<g_return_if_fail\|\<g_set_error\|\<g_shell_\|\<g_signal_\|\<g_slice_\|\<g_slist_\|\<g_snprintf\|\<g_source_\|\<g_spawn_\|\<g_static_\|\<g_str\|\<g_thread_pool_\|\<g_time_val_add\|\<g_timeout_\|\<g_type_\|\<g_unlink\|\<g_uri_\|\<g_utf8_\|\<g_value_\|\<g_enum_\|\<g_flags_' 
 
 for so in .libs/lib*.so; do
        echo Checking $so for local PLT entries