From 1b40a682eac74a10720e4941cb9fc5e45038d3da Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 27 Jan 2010 10:25:49 -0600 Subject: Making it so there is another level of translation so that we can use different strings in the enum. --- src/Makefile.am | 16 +++++- src/libappindicator/app-indicator-enum-types.c.in | 61 ---------------------- .../app-indicator-enum-types.gen.c.in | 61 ++++++++++++++++++++++ 3 files changed, 75 insertions(+), 63 deletions(-) delete mode 100644 src/libappindicator/app-indicator-enum-types.c.in create mode 100644 src/libappindicator/app-indicator-enum-types.gen.c.in diff --git a/src/Makefile.am b/src/Makefile.am index 38e6dd9..efae713 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -63,9 +63,21 @@ pkgconfig_DATA = libappindicator/appindicator-0.1.pc pkgconfigdir = $(libdir)/pkgconfig glib_enum_h = libappindicator/app-indicator-enum-types.h -glib_enum_c = libappindicator/app-indicator-enum-types.c +glib_enum_c = libappindicator/app-indicator-enum-types.gen.c glib_enum_headers = $(libappindicator_headers) +libappindicator/app-indicator-enum-types.c: libappindicator/app-indicator-enum-types.gen.c + sed -e "s|\"passive\"|\"Passive\"|" \ + -e "s|\"active\"|\"Active\"|" \ + -e "s|\"attention\"|\"NeedsAttention\"|" \ + -e "s|\"application-status\"|\"ApplicationStatus\"|" \ + -e "s|\"communications\"|\"Communications\"|" \ + -e "s|\"system-services\"|\"SystemServices\"|" \ + -e "s|\"hardware\"|\"Hardware\"|" \ + -e "s|\"other\"|\"Other\"|" \ + $< > $@ +DISTCLEANFILES += libappindicator/app-indicator-enum-types.c + lib_LTLIBRARIES = \ libappindicator.la @@ -80,7 +92,7 @@ libappindicatorinclude_HEADERS = \ libappindicator_la_SOURCES = \ $(libappindicator_headers) \ - $(glib_enum_c) \ + libappindicator/app-indicator-enum-types.c \ notification-watcher-client.h \ notification-item-server.h \ libappindicator/app-indicator.c diff --git a/src/libappindicator/app-indicator-enum-types.c.in b/src/libappindicator/app-indicator-enum-types.c.in deleted file mode 100644 index 449f3fc..0000000 --- a/src/libappindicator/app-indicator-enum-types.c.in +++ /dev/null @@ -1,61 +0,0 @@ -/*** BEGIN file-header ***/ -/* -An object to represent the application as an application indicator -in the system panel. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the - Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by - the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see - -*/ - -#include "libappindicator/app-indicator-enum-types.h" - -/*** END file-header ***/ - -/*** BEGIN file-production ***/ -#include "@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 ***/ diff --git a/src/libappindicator/app-indicator-enum-types.gen.c.in b/src/libappindicator/app-indicator-enum-types.gen.c.in new file mode 100644 index 0000000..449f3fc --- /dev/null +++ b/src/libappindicator/app-indicator-enum-types.gen.c.in @@ -0,0 +1,61 @@ +/*** BEGIN file-header ***/ +/* +An object to represent the application as an application indicator +in the system panel. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of either or both of the following licenses: + +1) the GNU Lesser General Public License version 3, as published by the + Free Software Foundation; and/or +2) the GNU Lesser General Public License version 2.1, as published by + the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR +PURPOSE. See the applicable version of the GNU Lesser General Public +License for more details. + +You should have received a copy of both the GNU Lesser General Public +License version 3 and version 2.1 along with this program. If not, see + +*/ + +#include "libappindicator/app-indicator-enum-types.h" + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +#include "@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 ***/ -- cgit v1.2.3