diff options
38 files changed, 396 insertions, 475 deletions
diff --git a/capplets/about-me/Makefile.am b/capplets/about-me/Makefile.am index 453474c0..aee23c53 100644 --- a/capplets/about-me/Makefile.am +++ b/capplets/about-me/Makefile.am @@ -4,6 +4,9 @@ cappletname = about-me ui_files = mate-about-me-dialog.ui mate-about-me-password.ui mate-about-me-fingerprint.ui Desktop_in_files = mate-about-me.desktop.in +BUILT_SOURCES = marshal.c marshal.h mate-about-me-resources.h mate-about-me-resources.c +nodist_mate_about_me_SOURCES = \ + $(BUILT_SOURCES) mate_about_me_SOURCES = \ mate-about-me-password.c \ mate-about-me-password.h \ @@ -11,17 +14,15 @@ mate_about_me_SOURCES = \ e-image-chooser.h \ mate-about-me-fingerprint.c \ mate-about-me-fingerprint.h \ - $(MARSHALFILES) \ fingerprint-strings.h \ mate-about-me.c -MARSHALFILES = marshal.c marshal.h -BUILT_SOURCES = $(MARSHALFILES) - marshal.h: fprintd-marshal.list @GLIB_GENMARSHAL@ --prefix=fprintd_marshal $< --header > $@ marshal.c: fprintd-marshal.list @GLIB_GENMARSHAL@ --prefix=fprintd_marshal $< --body --header > $@ +mate-about-me-resources.h mate-about-me-resources.c: org.mate.mcc.am.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.am.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name about_me $< bin_PROGRAMS = mate-about-me @@ -36,15 +37,11 @@ mate_about_me_LDFLAGS = -export-dynamic desktopdir = $(datadir)/applications desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) -uidir = $(pkgdatadir)/ui -ui_DATA = $(ui_files) - AM_CPPFLAGS = \ $(MATECC_CAPPLETS_CFLAGS) \ $(LIBEBOOK_CFLAGS) \ -DDATADIR="\"$(datadir)\"" \ -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \ - -DMATECC_UI_DIR="\"$(uidir)\"" \ -DMATECC_PIXMAP_DIR="\"$(pkgdatadir)/pixmaps\"" \ -DMATELOCALEDIR="\"$(datadir)/locale\"" @@ -53,7 +50,11 @@ AM_CPPFLAGS += \ $(ACCOUNTSSERVICE_CFLAGS) endif -CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(MARSHALFILES) -EXTRA_DIST = $(ui_files) fprintd-marshal.list $(Desktop_in_files) +CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES) +EXTRA_DIST = \ + $(ui_files) \ + fprintd-marshal.list \ + $(Desktop_in_files) \ + org.mate.mcc.am.gresource.xml -include $(top_srcdir)/git.mk diff --git a/capplets/about-me/mate-about-me-fingerprint.c b/capplets/about-me/mate-about-me-fingerprint.c index 095be8d2..9b30384e 100644 --- a/capplets/about-me/mate-about-me-fingerprint.c +++ b/capplets/about-me/mate-about-me-fingerprint.c @@ -506,6 +506,7 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable) EnrollData *data; GtkWidget *ass; char *msg; + GError *error = NULL; device = NULL; @@ -547,7 +548,11 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable) g_object_unref (p); dialog = gtk_builder_new (); - gtk_builder_add_from_file (dialog, MATECC_UI_DIR "/mate-about-me-fingerprint.ui", NULL); + if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/am/mate-about-me-fingerprint.ui", &error) == 0) + { + g_warning ("Could not parse UI definition: %s", error->message); + g_error_free (error); + } data->dialog = dialog; ass = WID ("assistant"); diff --git a/capplets/about-me/mate-about-me-password.c b/capplets/about-me/mate-about-me-password.c index c2e1242d..0f053f7f 100644 --- a/capplets/about-me/mate-about-me-password.c +++ b/capplets/about-me/mate-about-me-password.c @@ -1011,13 +1011,18 @@ passdlg_activate (GtkEntry *entry, GtkWidget *w) static void passdlg_init (PasswordDialog *pdialog, GtkWindow *parent) { - GtkBuilder *dialog; - GtkWidget *wpassdlg; + GtkBuilder *dialog; + GtkWidget *wpassdlg; GtkAccelGroup *group; + GError *error = NULL; /* Initialize dialog */ dialog = gtk_builder_new (); - gtk_builder_add_from_file (dialog, MATECC_UI_DIR "/mate-about-me-password.ui", NULL); + if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/am/mate-about-me-password.ui", &error) == 0) + { + g_warning ("Could not parse UI definition: %s", error->message); + g_error_free (error); + } pdialog->ui = dialog; wpassdlg = WID ("change-password"); diff --git a/capplets/about-me/mate-about-me.c b/capplets/about-me/mate-about-me.c index b66beb32..417dac3c 100644 --- a/capplets/about-me/mate-about-me.c +++ b/capplets/about-me/mate-about-me.c @@ -125,7 +125,7 @@ static void about_me_update_photo (MateAboutMe *me) { gchar *file; - GError *error; + GError *error = NULL; guchar *data; gsize length; @@ -428,6 +428,7 @@ about_me_setup_dialog (void) GtkWidget *main_dialog; GtkIconInfo *icon; GtkBuilder *dialog; + GError *error = NULL; gchar *str; #if HAVE_ACCOUNTSSERVICE ActUserManager* manager; @@ -437,7 +438,11 @@ about_me_setup_dialog (void) me->image = NULL; dialog = gtk_builder_new (); - gtk_builder_add_from_file (dialog, MATECC_UI_DIR "/mate-about-me-dialog.ui", NULL); + if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/am/mate-about-me-dialog.ui", &error) == 0) + { + g_warning ("Could not parse UI definition: %s", error->message); + g_error_free (error); + } me->image_chooser = e_image_chooser_new_with_size (MAX_WIDTH, MAX_HEIGHT); gtk_container_add (GTK_CONTAINER (WID ("button-image")), me->image_chooser); diff --git a/capplets/about-me/org.mate.mcc.am.gresource.xml b/capplets/about-me/org.mate.mcc.am.gresource.xml new file mode 100644 index 00000000..875df52d --- /dev/null +++ b/capplets/about-me/org.mate.mcc.am.gresource.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This file is part of MATE Control Center. + + MATE Control Center is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + MATE Control Center is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>. +--> +<gresources> + <gresource prefix="/org/mate/mcc/am"> + <file compressed="true">mate-about-me-dialog.ui</file> + <file compressed="true">mate-about-me-fingerprint.ui</file> + <file compressed="true">mate-about-me-password.ui</file> + </gresource> +</gresources> diff --git a/capplets/accessibility/at-properties/Makefile.am b/capplets/accessibility/at-properties/Makefile.am index 2af0ca50..a49e54b0 100644 --- a/capplets/accessibility/at-properties/Makefile.am +++ b/capplets/accessibility/at-properties/Makefile.am @@ -1,5 +1,11 @@ bin_PROGRAMS = mate-at-properties +ui_files = at-enable-dialog.ui + +BUILT_SOURCES = \ + mate-at-properties-resources.c \ + mate-at-properties-resources.h +nodist_mate_at_properties_SOURCES= $(BUILT_SOURCES) mate_at_properties_LDADD = $(AT_CAPPLET_LIBS) $(MATECC_CAPPLETS_LIBS) $(top_builddir)/capplets/common/libcommon.la mate_at_properties_SOURCES = \ main.c @@ -16,16 +22,20 @@ pixmap_DATA = \ at-startup.png \ at-support.png -uidir = $(pkgdatadir)/ui -ui_DATA = at-enable-dialog.ui - AM_CPPFLAGS = $(AT_CAPPLET_CFLAGS) \ $(MATECC_CAPPLETS_CFLAGS) \ - -DUIDIR=\""$(uidir)"\" \ -DPIXMAPDIR=\""$(pixmapdir)"\" \ -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \ -DMATELOCALEDIR="\"$(datadir)/locale\"" -CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) -EXTRA_DIST = $(ui_DATA) $(pixmap_DATA) $(Desktop_in_files) +CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES) +EXTRA_DIST = \ + $(ui_files) \ + $(pixmap_DATA) \ + $(Desktop_in_files) \ + org.mate.mcc.accessibility.at.gresource.xml + +# Generate resources +mate-at-properties-resources.h mate-at-properties-resources.c: org.mate.mcc.accessibility.at.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.accessibility.at.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name accessibility $< -include $(top_srcdir)/git.mk diff --git a/capplets/accessibility/at-properties/main.c b/capplets/accessibility/at-properties/main.c index f046517e..1640eac8 100644 --- a/capplets/accessibility/at-properties/main.c +++ b/capplets/accessibility/at-properties/main.c @@ -28,11 +28,10 @@ create_builder (void) { GtkBuilder *builder; GError *error = NULL; - static const gchar *uifile = UIDIR "/at-enable-dialog.ui"; builder = gtk_builder_new (); - if (gtk_builder_add_from_file (builder, uifile, &error)) { + if (gtk_builder_add_from_resource (builder, "/org/mate/mcc/accessibility/at/at-enable-dialog.ui", &error)) { GObject *object; gchar *prog; diff --git a/capplets/accessibility/at-properties/org.mate.mcc.accessibility.at.gresource.xml b/capplets/accessibility/at-properties/org.mate.mcc.accessibility.at.gresource.xml new file mode 100644 index 00000000..16c80370 --- /dev/null +++ b/capplets/accessibility/at-properties/org.mate.mcc.accessibility.at.gresource.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This file is part of MATE Control Center. + + MATE Control Center is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + MATE Control Center is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>. +--> +<gresources> + <gresource prefix="/org/mate/mcc/accessibility/at"> + <file compressed="true">at-enable-dialog.ui</file> + </gresource> +</gresources> diff --git a/capplets/appearance/Makefile.am b/capplets/appearance/Makefile.am index 500fcc64..7ae3edd1 100644 --- a/capplets/appearance/Makefile.am +++ b/capplets/appearance/Makefile.am @@ -1,10 +1,14 @@ SUBDIRS = data +BUILT_SOURCES = mate-appearance-properties-resources.h mate-appearance-properties-resources.c + # This is used in MATECC_CAPPLETS_CFLAGS cappletname = appearance bin_PROGRAMS = mate-appearance-properties +nodist_mate_appearance_properties_SOURCES = \ + $(BUILT_SOURCES) mate_appearance_properties_SOURCES = \ appearance.h \ appearance-desktop.c \ @@ -43,7 +47,6 @@ mate_appearance_properties_LDADD = \ $(MARCO_LIBS) mate_appearance_properties_LDFLAGS = -export-dynamic -gtkbuilderdir = $(pkgdatadir)/ui pixmapdir = $(pkgdatadir)/pixmaps wallpaperdir = $(datadir)/mate-background-properties @@ -53,10 +56,13 @@ AM_CPPFLAGS = \ $(FONT_CAPPLET_CFLAGS) \ -DMATELOCALEDIR="\"$(datadir)/locale\"" \ -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \ - -DMATECC_GTKBUILDER_DIR="\"$(gtkbuilderdir)\"" \ -DMATECC_PIXMAP_DIR="\"$(pixmapdir)\"" \ -DWALLPAPER_DATADIR="\"$(wallpaperdir)\"" -CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) +mate-appearance-properties-resources.h mate-appearance-properties-resources.c: org.mate.mcc.appearance.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.appearance.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name appearance $< + +CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(BUILT_SOURCES) +EXTRA_DIST = org.mate.mcc.appearance.gresource.xml -include $(top_srcdir)/git.mk diff --git a/capplets/appearance/appearance-main.c b/capplets/appearance/appearance-main.c index b2b77353..bd6fc87f 100644 --- a/capplets/appearance/appearance-main.c +++ b/capplets/appearance/appearance-main.c @@ -36,7 +36,6 @@ static AppearanceData * init_appearance_data (int *argc, char ***argv, GOptionContext *context) { AppearanceData *data = NULL; - gchar *uifile; GtkBuilder *ui; GError *err = NULL; @@ -45,11 +44,8 @@ init_appearance_data (int *argc, char ***argv, GOptionContext *context) activate_settings_daemon (); /* set up the data */ - uifile = g_build_filename (MATECC_GTKBUILDER_DIR, "appearance.ui", - NULL); ui = gtk_builder_new (); - gtk_builder_add_from_file (ui, uifile, &err); - g_free (uifile); + gtk_builder_add_from_resource (ui, "/org/mate/mcc/appearance/data/appearance.ui", &err); if (err) { diff --git a/capplets/appearance/data/Makefile.am b/capplets/appearance/data/Makefile.am index 4bec1621..9db85374 100644 --- a/capplets/appearance/data/Makefile.am +++ b/capplets/appearance/data/Makefile.am @@ -1,7 +1,4 @@ -gtkbuilderdir = $(pkgdatadir)/ui -dist_gtkbuilder_DATA = appearance.ui - pixmapdir = $(pkgdatadir)/pixmaps dist_pixmap_DATA = \ subpixel-bgr.png \ @@ -25,9 +22,6 @@ desktop_in_files = \ mate-theme-installer.desktop.in desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) - - - @INTLTOOL_XML_RULE@ xml_in_files = \ @@ -36,7 +30,6 @@ xml_in_files = \ mimedir = $(datadir)/mime/packages mime_DATA = $(xml_in_files:.xml.in=.xml) - install-data-hook: if ENABLE_UPDATE_MIMEDB $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime" @@ -47,7 +40,10 @@ if ENABLE_UPDATE_MIMEDB $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime" endif -EXTRA_DIST = $(xml_in_files) $(desktop_in_files) +EXTRA_DIST = \ + appearance.ui \ + $(xml_in_files) \ + $(desktop_in_files) CLEANFILES = $(desktop_DATA) $(mime_DATA) diff --git a/capplets/appearance/org.mate.mcc.appearance.gresource.xml b/capplets/appearance/org.mate.mcc.appearance.gresource.xml new file mode 100644 index 00000000..7fc4bf8e --- /dev/null +++ b/capplets/appearance/org.mate.mcc.appearance.gresource.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This file is part of MATE Control Center. + + MATE Control Center is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + MATE Control Center is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>. +--> +<gresources> + <gresource prefix="/org/mate/mcc/appearance"> + <file compressed="true">data/appearance.ui</file> + </gresource> +</gresources> diff --git a/capplets/default-applications/Makefile.am b/capplets/default-applications/Makefile.am index 756018fe..5a5e2e41 100644 --- a/capplets/default-applications/Makefile.am +++ b/capplets/default-applications/Makefile.am @@ -3,15 +3,18 @@ cappletname = mate-default-applications-properties bin_PROGRAMS = mate-default-applications-properties +BUILT_SOURCES = \ + mate-default-applications-properties-resources.h \ + mate-default-applications-properties-resources.c + mate_default_applications_properties_LDADD = $(MATECC_CAPPLETS_LIBS) +nodist_mate_default_applications_properties_SOURCES = \ + $(BUILT_SOURCES) mate_default_applications_properties_SOURCES = \ mate-da-capplet.c mate-da-capplet.h @INTLTOOL_DESKTOP_RULE@ -uidir = $(pkgdatadir)/ui -dist_ui_DATA = mate-default-applications-properties.ui - desktopdir = $(datadir)/applications Desktop_in_files = mate-default-applications-properties.desktop.in desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) @@ -23,10 +26,16 @@ AM_CPPFLAGS = \ $(MATECC_CAPPLETS_CFLAGS) \ $(DEFAULT_APPLICATIONS_CAPPLET_CFLAGS) \ -DAPPLICATIONSDIR=\""$(datadir)/applications"\"\ - -DMATELOCALEDIR=\""$(datadir)/locale"\"\ - -DMATECC_UI_DIR=\""$(uidir)"\" + -DMATELOCALEDIR=\""$(datadir)/locale"\" + +mate-default-applications-properties-resources.h mate-default-applications-properties-resources.c: org.mate.mcc.da.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.da.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name default_applications $< -CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(autostart_DATA) -EXTRA_DIST = mate-default-applications.pc.in $(Desktop_in_files) +CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(autostart_DATA) $(BUILT_SOURCES) +EXTRA_DIST = \ + mate-default-applications.pc.in \ + mate-default-applications-properties.ui \ + $(Desktop_in_files) \ + org.mate.mcc.da.gresource.xml -include $(top_srcdir)/git.mk diff --git a/capplets/default-applications/mate-da-capplet.c b/capplets/default-applications/mate-da-capplet.c index 1ecde4c0..de7c36bd 100644 --- a/capplets/default-applications/mate-da-capplet.c +++ b/capplets/default-applications/mate-da-capplet.c @@ -563,14 +563,7 @@ show_dialog(MateDACapplet* capplet, const gchar* start_page) capplet->builder = builder = gtk_builder_new (); - if (g_file_test(MATECC_UI_DIR "/mate-default-applications-properties.ui", G_FILE_TEST_EXISTS) != FALSE) - { - builder_result = gtk_builder_add_from_file(builder, MATECC_UI_DIR "/mate-default-applications-properties.ui", NULL); - } - else - { - builder_result = gtk_builder_add_from_file(builder, "./mate-default-applications-properties.ui", NULL); - } + builder_result = gtk_builder_add_from_resource (builder, "/org/mate/mcc/da/mate-default-applications-properties.ui", NULL); if (builder_result == 0) { diff --git a/capplets/default-applications/org.mate.mcc.da.gresource.xml b/capplets/default-applications/org.mate.mcc.da.gresource.xml new file mode 100644 index 00000000..6527fe68 --- /dev/null +++ b/capplets/default-applications/org.mate.mcc.da.gresource.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This file is part of MATE Control Center. + + MATE Control Center is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + MATE Control Center is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>. +--> +<gresources> + <gresource prefix="/org/mate/mcc/da"> + <file compressed="true">mate-default-applications-properties.ui</file> + </gresource> +</gresources> diff --git a/capplets/display/Makefile.am b/capplets/display/Makefile.am index 4b168ac0..98cd77ce 100644 --- a/capplets/display/Makefile.am +++ b/capplets/display/Makefile.am @@ -1,19 +1,22 @@ # This is used in MATECC_CAPPLETS_CFLAGS cappletname = display -uidir = $(pkgdatadir)/ui -dist_ui_DATA = display-capplet.ui +BUILT_SOURCES = \ + foo-marshal.h \ + foo-marshal.c \ + mate-display-properties-resources.h \ + mate-display-properties-resources.c bin_PROGRAMS = mate-display-properties sbin_PROGRAMS = mate-display-properties-install-systemwide +nodist_mate_display_properties_SOURCES = \ + $(BUILT_SOURCES) mate_display_properties_SOURCES = \ xrandr-capplet.c \ scrollarea.c \ - foo-marshal.c \ - scrollarea.h \ - foo-marshal.h + scrollarea.h mate_display_properties_LDFLAGS = -export-dynamic mate_display_properties_LDADD = \ @@ -43,13 +46,19 @@ desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) AM_CPPFLAGS = $(DISPLAY_CAPPLET_CFLAGS) \ $(MATECC_CAPPLETS_CFLAGS) \ -DSBINDIR="\"$(sbindir)\"" \ - -DUIDIR="\"$(uidir)\"" \ -DMATELOCALEDIR="\"$(datadir)/locale\"" \ -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" -CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) +foo-marshal.c: foo-marshal.list + @GLIB_GENMARSHAL@ --prefix=foo_marshal $< --header > $@ +foo-marshal.h: foo-marshal.list + @GLIB_GENMARSHAL@ --prefix=foo_marshal $< --body --header > $@ +mate-display-properties-resources.h mate-display-properties-resources.c: org.mate.mcc.display.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.display.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name display $< -EXTRA_DIST = org.mate.randr.policy.in $(Desktop_in_files) +CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES) + +EXTRA_DIST = display-capplet.ui foo-marshal.list $(Desktop_in_files) org.mate.mcc.display.gresource.xml org.mate.randr.policy.in DISTCLEANFILES = org.mate.randr.policy -include $(top_srcdir)/git.mk diff --git a/capplets/display/foo-marshal.c b/capplets/display/foo-marshal.c deleted file mode 100644 index a40b0863..00000000 --- a/capplets/display/foo-marshal.c +++ /dev/null @@ -1,279 +0,0 @@ - -#include <glib-object.h> - - -#ifdef G_ENABLE_DEBUG -#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) -#define g_marshal_value_peek_char(v) g_value_get_char (v) -#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) -#define g_marshal_value_peek_int(v) g_value_get_int (v) -#define g_marshal_value_peek_uint(v) g_value_get_uint (v) -#define g_marshal_value_peek_long(v) g_value_get_long (v) -#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) -#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) -#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) -#define g_marshal_value_peek_enum(v) g_value_get_enum (v) -#define g_marshal_value_peek_flags(v) g_value_get_flags (v) -#define g_marshal_value_peek_float(v) g_value_get_float (v) -#define g_marshal_value_peek_double(v) g_value_get_double (v) -#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) -#define g_marshal_value_peek_param(v) g_value_get_param (v) -#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) -#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) -#define g_marshal_value_peek_object(v) g_value_get_object (v) -#else /* !G_ENABLE_DEBUG */ -/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. - * Do not access GValues directly in your code. Instead, use the - * g_value_get_*() functions - */ -#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int -#define g_marshal_value_peek_char(v) (v)->data[0].v_int -#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint -#define g_marshal_value_peek_int(v) (v)->data[0].v_int -#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint -#define g_marshal_value_peek_long(v) (v)->data[0].v_long -#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 -#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 -#define g_marshal_value_peek_enum(v) (v)->data[0].v_long -#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_float(v) (v)->data[0].v_float -#define g_marshal_value_peek_double(v) (v)->data[0].v_double -#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer -#endif /* !G_ENABLE_DEBUG */ - - -/* VOID:OBJECT,OBJECT (marshal.list:1) */ -void -foo_marshal_VOID__OBJECT_OBJECT (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1, - gpointer arg_1, - gpointer arg_2, - gpointer data2); - register GMarshalFunc_VOID__OBJECT_OBJECT callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - - g_return_if_fail (n_param_values == 3); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_object (param_values + 1), - g_marshal_value_peek_object (param_values + 2), - data2); -} - -/* VOID:UINT,UINT,UINT,UINT (marshal.list:2) */ -void -foo_marshal_VOID__UINT_UINT_UINT_UINT (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__UINT_UINT_UINT_UINT) (gpointer data1, - guint arg_1, - guint arg_2, - guint arg_3, - guint arg_4, - gpointer data2); - register GMarshalFunc_VOID__UINT_UINT_UINT_UINT callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - - g_return_if_fail (n_param_values == 5); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_VOID__UINT_UINT_UINT_UINT) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_uint (param_values + 1), - g_marshal_value_peek_uint (param_values + 2), - g_marshal_value_peek_uint (param_values + 3), - g_marshal_value_peek_uint (param_values + 4), - data2); -} - -/* VOID:UINT,UINT (marshal.list:3) */ -void -foo_marshal_VOID__UINT_UINT (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__UINT_UINT) (gpointer data1, - guint arg_1, - guint arg_2, - gpointer data2); - register GMarshalFunc_VOID__UINT_UINT callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - - g_return_if_fail (n_param_values == 3); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_VOID__UINT_UINT) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_uint (param_values + 1), - g_marshal_value_peek_uint (param_values + 2), - data2); -} - -/* VOID:BOXED (marshal.list:4) */ - -/* VOID:BOXED,BOXED (marshal.list:5) */ -void -foo_marshal_VOID__BOXED_BOXED (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__BOXED_BOXED) (gpointer data1, - gpointer arg_1, - gpointer arg_2, - gpointer data2); - register GMarshalFunc_VOID__BOXED_BOXED callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - - g_return_if_fail (n_param_values == 3); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_VOID__BOXED_BOXED) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_boxed (param_values + 1), - g_marshal_value_peek_boxed (param_values + 2), - data2); -} - -/* VOID:POINTER,BOXED,POINTER (marshal.list:6) */ -void -foo_marshal_VOID__POINTER_BOXED_POINTER (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__POINTER_BOXED_POINTER) (gpointer data1, - gpointer arg_1, - gpointer arg_2, - gpointer arg_3, - gpointer data2); - register GMarshalFunc_VOID__POINTER_BOXED_POINTER callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - - g_return_if_fail (n_param_values == 4); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_VOID__POINTER_BOXED_POINTER) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_pointer (param_values + 1), - g_marshal_value_peek_boxed (param_values + 2), - g_marshal_value_peek_pointer (param_values + 3), - data2); -} - -/* VOID:POINTER,POINTER (marshal.list:7) */ -void -foo_marshal_VOID__POINTER_POINTER (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__POINTER_POINTER) (gpointer data1, - gpointer arg_1, - gpointer arg_2, - gpointer data2); - register GMarshalFunc_VOID__POINTER_POINTER callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - - g_return_if_fail (n_param_values == 3); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_VOID__POINTER_POINTER) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_pointer (param_values + 1), - g_marshal_value_peek_pointer (param_values + 2), - data2); -} - diff --git a/capplets/display/foo-marshal.h b/capplets/display/foo-marshal.h deleted file mode 100644 index 4bef795d..00000000 --- a/capplets/display/foo-marshal.h +++ /dev/null @@ -1,67 +0,0 @@ - -#ifndef __foo_marshal_MARSHAL_H__ -#define __foo_marshal_MARSHAL_H__ - -#include <glib-object.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* VOID:OBJECT,OBJECT (marshal.list:1) */ -extern void foo_marshal_VOID__OBJECT_OBJECT (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -/* VOID:UINT,UINT,UINT,UINT (marshal.list:2) */ -extern void foo_marshal_VOID__UINT_UINT_UINT_UINT (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -/* VOID:UINT,UINT (marshal.list:3) */ -extern void foo_marshal_VOID__UINT_UINT (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -/* VOID:BOXED (marshal.list:4) */ -#define foo_marshal_VOID__BOXED g_cclosure_marshal_VOID__BOXED - -/* VOID:BOXED,BOXED (marshal.list:5) */ -extern void foo_marshal_VOID__BOXED_BOXED (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -/* VOID:POINTER,BOXED,POINTER (marshal.list:6) */ -extern void foo_marshal_VOID__POINTER_BOXED_POINTER (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -/* VOID:POINTER,POINTER (marshal.list:7) */ -extern void foo_marshal_VOID__POINTER_POINTER (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -#ifdef __cplusplus -} -#endif - -#endif /* __foo_marshal_MARSHAL_H__ */ - diff --git a/capplets/display/foo-marshal.list b/capplets/display/foo-marshal.list new file mode 100644 index 00000000..dea3cd61 --- /dev/null +++ b/capplets/display/foo-marshal.list @@ -0,0 +1,6 @@ +VOID:OBJECT,OBJECT +VOID:UINT,UINT,UINT,UINT +VOID:UINT,UINT +VOID:BOXED,BOXED +VOID:POINTER,BOXED,POINTER +VOID:POINTER,POINTER diff --git a/capplets/display/org.mate.mcc.display.gresource.xml b/capplets/display/org.mate.mcc.display.gresource.xml new file mode 100644 index 00000000..56116487 --- /dev/null +++ b/capplets/display/org.mate.mcc.display.gresource.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This file is part of MATE Control Center. + + MATE Control Center is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + MATE Control Center is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>. +--> +<gresources> + <gresource prefix="/org/mate/mcc/display"> + <file compressed="true">display-capplet.ui</file> + </gresource> +</gresources> diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 0bb7430c..bf498cf6 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -2396,18 +2396,13 @@ _gtk_builder_get_widget (GtkBuilder *builder, const gchar *name) static void run_application (App *app) { -#ifndef UIDIR -#define UIDIR "." -#endif -#define UI_FILE UIDIR "/display-capplet.ui" GtkBuilder *builder; GtkWidget *align; - GError *error; + GError *error = NULL; - error = NULL; builder = gtk_builder_new (); - if (gtk_builder_add_from_file (builder, UI_FILE, &error) == 0) + if (gtk_builder_add_from_resource (builder, "/org/mate/mcc/display/display-capplet.ui", &error) == 0) { g_warning ("Could not parse UI definition: %s", error->message); g_error_free (error); diff --git a/capplets/keybindings/Makefile.am b/capplets/keybindings/Makefile.am index 9501dd8f..24c95a56 100644 --- a/capplets/keybindings/Makefile.am +++ b/capplets/keybindings/Makefile.am @@ -4,6 +4,9 @@ cappletname = keybinding bin_PROGRAMS = mate-keybinding-properties mate_keybinding_properties_LDADD = $(MATECC_CAPPLETS_LIBS) +BUILT_SOURCES = mate-keybinding-properties-resources.h mate-keybinding-properties-resources.c +nodist_mate_keybinding_properties_SOURCES = \ + $(BUILT_SOURCES) mate_keybinding_properties_SOURCES = \ mate-keybinding-properties.c \ eggcellrendererkeys.c \ @@ -13,9 +16,6 @@ mate_keybinding_properties_SOURCES = \ @INTLTOOL_DESKTOP_RULE@ -uidir = $(pkgdatadir)/ui -ui_DATA = mate-keybinding-properties.ui - desktopdir = $(datadir)/applications Desktop_in_files = mate-keybinding.desktop.in desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) @@ -29,16 +29,22 @@ xml_DATA = $(xml_in_files:.xml.in=.xml) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = mate-keybindings.pc +mate-keybinding-properties-resources.h mate-keybinding-properties-resources.c: org.mate.mcc.keybindings.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.keybindings.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name keybindings $< + AM_CPPFLAGS = \ $(MATECC_CAPPLETS_CFLAGS) \ -DMATELOCALEDIR="\"$(datadir)/locale\"" \ - -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \ - -DMATECC_UI_DIR="\"$(uidir)\"" + -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" CLEANFILES = \ + $(BUILT_SOURCES) \ $(MATECC_CAPPLETS_CLEANFILES) \ $(desktop_DATA) \ $(xml_DATA) -EXTRA_DIST = $(ui_DATA) $(xml_in_files) mate-keybindings.pc.in $(Desktop_in_files) - +EXTRA_DIST = $(xml_in_files) \ + mate-keybindings.pc.in \ + mate-keybinding-properties.ui \ + $(Desktop_in_files) \ + org.mate.mcc.keybindings.gresource.xml -include $(top_srcdir)/git.mk diff --git a/capplets/keybindings/mate-keybinding-properties.c b/capplets/keybindings/mate-keybinding-properties.c index cf1891d2..3a8eefc2 100644 --- a/capplets/keybindings/mate-keybinding-properties.c +++ b/capplets/keybindings/mate-keybinding-properties.c @@ -104,9 +104,8 @@ create_builder (void) { GtkBuilder *builder = gtk_builder_new(); GError *error = NULL; - static const gchar *uifile = MATECC_UI_DIR "/mate-keybinding-properties.ui"; - if (gtk_builder_add_from_file (builder, uifile, &error) == 0) { + if (gtk_builder_add_from_resource (builder, "/org/mate/mcc/keybindings/mate-keybinding-properties.ui", &error) == 0) { g_warning ("Could not load UI: %s", error->message); g_error_free (error); g_object_unref (builder); diff --git a/capplets/keybindings/org.mate.mcc.keybindings.gresource.xml b/capplets/keybindings/org.mate.mcc.keybindings.gresource.xml new file mode 100644 index 00000000..ac479418 --- /dev/null +++ b/capplets/keybindings/org.mate.mcc.keybindings.gresource.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This file is part of MATE Control Center. + + MATE Control Center is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + MATE Control Center is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>. +--> +<gresources> + <gresource prefix="/org/mate/mcc/keybindings"> + <file compressed="true">mate-keybinding-properties.ui</file> + </gresource> +</gresources> diff --git a/capplets/keyboard/Makefile.am b/capplets/keyboard/Makefile.am index b1a7c5af..30c77705 100644 --- a/capplets/keyboard/Makefile.am +++ b/capplets/keyboard/Makefile.am @@ -3,6 +3,9 @@ cappletname = keyboard bin_PROGRAMS = mate-keyboard-properties +BUILT_SOURCES = mate-keyboard-properties-resources.h mate-keyboard-properties-resources.c +nodist_mate_keyboard_properties_SOURCES = \ + $(BUILT_SOURCES) mate_keyboard_properties_SOURCES = \ mate-keyboard-properties.c \ mate-keyboard-properties-a11y.c \ @@ -19,24 +22,26 @@ mate_keyboard_properties_LDADD = $(MATECC_CAPPLETS_LIBS) $(LIBMATEKBDUI_LIBS) @INTLTOOL_DESKTOP_RULE@ -uidir = $(pkgdatadir)/ui -dist_ui_DATA = mate-keyboard-properties-a11y-notifications.ui \ - mate-keyboard-properties-dialog.ui \ - mate-keyboard-properties-layout-chooser.ui \ - mate-keyboard-properties-model-chooser.ui \ - mate-keyboard-properties-options-dialog.ui - desktopdir = $(datadir)/applications Desktop_in_files = mate-keyboard.desktop.in desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) +mate-keyboard-properties-resources.h mate-keyboard-properties-resources.c: org.mate.mcc.keyboard.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.keyboard.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name keyboard $< + AM_CPPFLAGS = \ $(MATECC_CAPPLETS_CFLAGS) \ $(LIBMATEKBDUI_CFLAGS) \ -DMATELOCALEDIR="\"$(datadir)/locale\"" \ - -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \ - -DMATECC_UI_DIR="\"$(uidir)\"" -CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) -EXTRA_DIST = $(ui_DATA) $(Desktop_in_files) + -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" +CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES) +EXTRA_DIST = \ + mate-keyboard-properties-a11y-notifications.ui \ + mate-keyboard-properties-dialog.ui \ + mate-keyboard-properties-layout-chooser.ui \ + mate-keyboard-properties-model-chooser.ui \ + mate-keyboard-properties-options-dialog.ui \ + $(Desktop_in_files) \ + org.mate.mcc.keyboard.gresource.xml -include $(top_srcdir)/git.mk diff --git a/capplets/keyboard/mate-keyboard-properties-a11y.c b/capplets/keyboard/mate-keyboard-properties-a11y.c index 9a9779a1..301b1ee1 100644 --- a/capplets/keyboard/mate-keyboard-properties-a11y.c +++ b/capplets/keyboard/mate-keyboard-properties-a11y.c @@ -134,10 +134,10 @@ notifications_button_clicked_cb (GtkWidget *button, GtkBuilder *dialog) { GtkWidget *w; - notifications_dialog = gtk_builder_new (); - gtk_builder_add_from_file (notifications_dialog, MATECC_UI_DIR - "/mate-keyboard-properties-a11y-notifications.ui", - NULL); + notifications_dialog = gtk_builder_new (); + gtk_builder_add_from_resource (notifications_dialog, + "/org/mate/mcc/keyboard/mate-keyboard-properties-a11y-notifications.ui", + NULL); stickykeys_enable_toggled_cb (WID ("stickykeys_enable"), dialog); slowkeys_enable_toggled_cb (WID ("slowkeys_enable"), dialog); diff --git a/capplets/keyboard/mate-keyboard-properties-xkbltadd.c b/capplets/keyboard/mate-keyboard-properties-xkbltadd.c index 7ec09919..6b54fff2 100644 --- a/capplets/keyboard/mate-keyboard-properties-xkbltadd.c +++ b/capplets/keyboard/mate-keyboard-properties-xkbltadd.c @@ -474,9 +474,9 @@ xkb_layout_choose (GtkBuilder * dialog) GtkBuilder *chooser_dialog; chooser_dialog = gtk_builder_new (); - gtk_builder_add_from_file (chooser_dialog, MATECC_UI_DIR - "/mate-keyboard-properties-layout-chooser.ui", - NULL); + gtk_builder_add_from_resource (chooser_dialog, + "/org/mate/mcc/keyboard/mate-keyboard-properties-layout-chooser.ui", + NULL); GtkWidget *chooser = CWID ("xkb_layout_chooser"); GtkWidget *lang_chooser = CWID ("xkb_languages_available"); GtkWidget *notebook = CWID ("choosers_nb"); diff --git a/capplets/keyboard/mate-keyboard-properties-xkbmc.c b/capplets/keyboard/mate-keyboard-properties-xkbmc.c index e6ae7eb7..6ffc69e6 100644 --- a/capplets/keyboard/mate-keyboard-properties-xkbmc.c +++ b/capplets/keyboard/mate-keyboard-properties-xkbmc.c @@ -312,12 +312,12 @@ void choose_model (GtkBuilder * dialog) { GtkBuilder *chooser_dialog; - GtkWidget *chooser; + GtkWidget *chooser; - chooser_dialog = gtk_builder_new (); - gtk_builder_add_from_file (chooser_dialog, MATECC_UI_DIR - "/mate-keyboard-properties-model-chooser.ui", - NULL); + chooser_dialog = gtk_builder_new (); + gtk_builder_add_from_resource (chooser_dialog, + "/org/mate/mcc/keyboard/mate-keyboard-properties-model-chooser.ui", + NULL); chooser = CWID ("xkb_model_chooser"); gtk_window_set_transient_for (GTK_WINDOW (chooser), GTK_WINDOW (WID diff --git a/capplets/keyboard/mate-keyboard-properties-xkbot.c b/capplets/keyboard/mate-keyboard-properties-xkbot.c index 5be80c2e..e67fcf86 100644 --- a/capplets/keyboard/mate-keyboard-properties-xkbot.c +++ b/capplets/keyboard/mate-keyboard-properties-xkbot.c @@ -448,9 +448,9 @@ xkb_options_popup_dialog (GtkBuilder * dialog) GtkWidget *chooser; chooser_dialog = gtk_builder_new (); - gtk_builder_add_from_file (chooser_dialog, MATECC_UI_DIR - "/mate-keyboard-properties-options-dialog.ui", - NULL); + gtk_builder_add_from_resource (chooser_dialog, + "/org/mate/mcc/keyboard/mate-keyboard-properties-options-dialog.ui", + NULL); chooser = CWID ("xkb_options_dialog"); gtk_window_set_transient_for (GTK_WINDOW (chooser), diff --git a/capplets/keyboard/mate-keyboard-properties.c b/capplets/keyboard/mate-keyboard-properties.c index 4cf0f4c9..a5da8f0d 100644 --- a/capplets/keyboard/mate-keyboard-properties.c +++ b/capplets/keyboard/mate-keyboard-properties.c @@ -58,10 +58,9 @@ create_dialog (void) GtkSizeGroup *size_group; GtkWidget *image; GError *error = NULL; - static const gchar *uifile = MATECC_UI_DIR "/mate-keyboard-properties-dialog.ui"; dialog = gtk_builder_new (); - if (gtk_builder_add_from_file (dialog, uifile, &error) == 0) { + if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/keyboard/mate-keyboard-properties-dialog.ui", &error) == 0) { g_warning ("Could not load UI: %s", error->message); g_error_free (error); g_object_unref (dialog); diff --git a/capplets/keyboard/org.mate.mcc.keyboard.gresource.xml b/capplets/keyboard/org.mate.mcc.keyboard.gresource.xml new file mode 100644 index 00000000..1bcb8c9c --- /dev/null +++ b/capplets/keyboard/org.mate.mcc.keyboard.gresource.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This file is part of MATE Control Center. + + MATE Control Center is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + MATE Control Center is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>. +--> +<gresources> + <gresource prefix="/org/mate/mcc/keyboard"> + <file compressed="true">mate-keyboard-properties-a11y-notifications.ui</file> + <file compressed="true">mate-keyboard-properties-dialog.ui</file> + <file compressed="true">mate-keyboard-properties-layout-chooser.ui</file> + <file compressed="true">mate-keyboard-properties-model-chooser.ui</file> + <file compressed="true">mate-keyboard-properties-options-dialog.ui</file> + </gresource> +</gresources> diff --git a/capplets/mouse/Makefile.am b/capplets/mouse/Makefile.am index 1cfc2f1f..158806a4 100644 --- a/capplets/mouse/Makefile.am +++ b/capplets/mouse/Makefile.am @@ -4,6 +4,9 @@ cappletname = mouse bin_PROGRAMS = mate-mouse-properties mate_mouse_properties_LDADD = $(MATECC_CAPPLETS_LIBS) +BUILT_SOURCES = mate-mouse-properties-resources.h mate-mouse-properties-resources.c +nodist_mate_mouse_properties_SOURCES = \ + $(BUILT_SOURCES) mate_mouse_properties_SOURCES = \ mate-mouse-properties.c \ msd-input-helper.c \ @@ -17,19 +20,18 @@ pixmap_DATA = \ double-click-off.svg \ double-click-maybe.svg -uidir = $(pkgdatadir)/ui -ui_DATA = mate-mouse-properties.ui - desktopdir = $(datadir)/applications Desktop_in_files = mate-settings-mouse.desktop.in desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) +mate-mouse-properties-resources.h mate-mouse-properties-resources.c: org.mate.mcc.mouse.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.mouse.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name mouse $< + AM_CPPFLAGS = \ $(MATECC_CAPPLETS_CFLAGS) \ -DMATELOCALEDIR="\"$(datadir)/locale\"" \ - -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \ - -DMATECC_UI_DIR="\"$(uidir)\"" -CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) -EXTRA_DIST = $(ui_DATA) $(pixmap_DATA) $(Desktop_in_files) + -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" +CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES) +EXTRA_DIST = mate-mouse-properties.ui $(pixmap_DATA) $(Desktop_in_files) org.mate.mcc.mouse.gresource.xml -include $(top_srcdir)/git.mk diff --git a/capplets/mouse/mate-mouse-properties.c b/capplets/mouse/mate-mouse-properties.c index d5fef831..fe8bad31 100644 --- a/capplets/mouse/mate-mouse-properties.c +++ b/capplets/mouse/mate-mouse-properties.c @@ -373,9 +373,10 @@ create_dialog (void) GError *error = NULL; dialog = gtk_builder_new (); - gtk_builder_add_from_file (dialog, MATECC_UI_DIR "/mate-mouse-properties.ui", &error); - if (error != NULL) { + if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/mouse/mate-mouse-properties.ui", &error) == 0) { g_warning ("Error loading UI file: %s", error->message); + g_error_free (error); + g_object_unref (dialog); return NULL; } diff --git a/capplets/mouse/org.mate.mcc.mouse.gresource.xml b/capplets/mouse/org.mate.mcc.mouse.gresource.xml new file mode 100644 index 00000000..5024edbe --- /dev/null +++ b/capplets/mouse/org.mate.mcc.mouse.gresource.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This file is part of MATE Control Center. + + MATE Control Center is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + MATE Control Center is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>. +--> +<gresources> + <gresource prefix="/org/mate/mcc/mouse"> + <file compressed="true">mate-mouse-properties.ui</file> + </gresource> +</gresources> diff --git a/capplets/network/Makefile.am b/capplets/network/Makefile.am index 904d2e28..cb1671eb 100644 --- a/capplets/network/Makefile.am +++ b/capplets/network/Makefile.am @@ -3,24 +3,26 @@ cappletname = network bin_PROGRAMS = mate-network-properties +BUILT_SOURCES = mate-network-properties-resources.h mate-network-properties-resources.c +nodist_mate_network_properties_SOURCES = \ + $(BUILT_SOURCES) mate_network_properties_SOURCES = mate-network-properties.c mate_network_properties_LDADD = $(MATECC_CAPPLETS_LIBS) @INTLTOOL_DESKTOP_RULE@ -uidir = $(pkgdatadir)/ui -dist_ui_DATA = mate-network-properties.ui - desktopdir = $(datadir)/applications desktop_in_files = mate-network-properties.desktop.in desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +mate-network-properties-resources.h mate-network-properties-resources.c: org.mate.mcc.network.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.network.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name network $< + AM_CPPFLAGS = \ $(MATECC_CAPPLETS_CFLAGS) \ - -DMATELOCALEDIR="\"$(datadir)/locale\"" \ - -DMATECC_UI_DIR="\"$(uidir)\"" + -DMATELOCALEDIR="\"$(datadir)/locale\"" -CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) -EXTRA_DIST = $(desktop_in_files) +CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES) +EXTRA_DIST = mate-network-properties.ui $(desktop_in_files) org.mate.mcc.network.gresource.xml -include $(top_srcdir)/git.mk diff --git a/capplets/network/mate-network-properties.c b/capplets/network/mate-network-properties.c index 51a149dd..c2243fb3 100644 --- a/capplets/network/mate-network-properties.c +++ b/capplets/network/mate-network-properties.c @@ -80,8 +80,6 @@ enum { #define SOCKS_PROXY_HOST_KEY "host" #define SOCKS_PROXY_PORT_KEY "port" -#define MATECC_GNP_UI_FILE (MATECC_UI_DIR "/mate-network-properties.ui") - static GtkWidget *details_dialog = NULL; static GSList *ignore_hosts = NULL; static GtkTreeModel *model = NULL; @@ -276,8 +274,8 @@ cb_http_details_button_clicked (GtkWidget *button, } builder = gtk_builder_new (); - if (gtk_builder_add_objects_from_file (builder, MATECC_GNP_UI_FILE, - builder_widgets, &error) == 0) { + if (gtk_builder_add_objects_from_resource (builder, "/org/mate/mcc/network/mate-network-properties.ui", + builder_widgets, &error) == 0) { g_warning ("Could not load details dialog: %s", error->message); g_error_free (error); g_object_unref (builder); @@ -468,8 +466,8 @@ main (int argc, char **argv) gtk_init (&argc, &argv); builder = gtk_builder_new (); - if (gtk_builder_add_objects_from_file (builder, MATECC_GNP_UI_FILE, - builder_widgets, &error) == 0) { + if (gtk_builder_add_objects_from_resource (builder, "/org/mate/mcc/network/mate-network-properties.ui", + builder_widgets, &error) == 0) { g_warning ("Could not load main dialog: %s", error->message); g_error_free (error); diff --git a/capplets/network/org.mate.mcc.network.gresource.xml b/capplets/network/org.mate.mcc.network.gresource.xml new file mode 100644 index 00000000..84cefc59 --- /dev/null +++ b/capplets/network/org.mate.mcc.network.gresource.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This file is part of MATE Control Center. + + MATE Control Center is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + MATE Control Center is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>. +--> +<gresources> + <gresource prefix="/org/mate/mcc/network"> + <file compressed="true">mate-network-properties.ui</file> + </gresource> +</gresources> diff --git a/configure.ac b/configure.ac index b43e1bc3..4e9f67ef 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,22 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package]) AM_GLIB_GNU_GETTEXT +# GLIB_COMPILE_RESOURCES + +AC_ARG_VAR([GLIB_COMPILE_RESOURCES],[glib-compile-resources bin]) +AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources],[]) +if test -z "$GLIB_COMPILE_RESOURCES"; then + AC_MSG_ERROR([glib-compile-resources not found]) +fi + +# XMLLINT + +AC_ARG_VAR([XMLLINT],[xmllint bin]) +AC_PATH_PROG([XMLLINT],[xmllint],[]) +if test -z "$XMLLINT"; then + AC_MSG_ERROR([xmllint not found]) +fi + MATE_COMMON_INIT MATE_DEBUG_CHECK MATE_COMPILE_WARNINGS([maximum]) |