Use glib-mkenums to generate enum types

Rather than generating enum classes by hand (and complaining in each
file that "this should really be standard"), use glib-mkenums.

Unfortunately, we need a very new version of glib-mkenums in order to
deal with NM's naming conventions and to fix a few other bugs, so just
import that into the source tree temporarily.

Also, to simplify the use of glib-mkenums, import Makefile.glib from
https://bugzilla.gnome.org/654395.

To avoid having to run glib-mkenums for every subdirectory of src/,
add a new "generated" directory, and put the generated enums files
there.

Finally, use Makefile.glib for marshallers too, and generate separate
ones for libnm-glib and NetworkManager.
This commit is contained in:
Dan Winship
2012-02-08 12:56:52 -05:00
parent 0b57cc68fd
commit 839eab5564
112 changed files with 1031 additions and 1289 deletions

View File

@@ -94,13 +94,6 @@ static const LogDesc domain_descs[] = {
/************************************************************************/
enum {
NM_LOGGING_ERROR_UNKNOWN_LEVEL = 0,
NM_LOGGING_ERROR_UNKNOWN_DOMAIN = 1,
};
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GQuark
nm_logging_error_quark (void)
{
@@ -111,22 +104,6 @@ nm_logging_error_quark (void)
return ret;
}
GType
nm_logging_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_LOGGING_ERROR_UNKNOWN_LEVEL, "UnknownLevel"),
ENUM_ENTRY (NM_LOGGING_ERROR_UNKNOWN_DOMAIN, "UnknownDomain"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMLoggingError", values);
}
return etype;
}
/************************************************************************/
gboolean