diff options
author | lukefromdc <[email protected]> | 2023-07-11 21:28:01 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-07-17 02:47:28 +0200 |
commit | 08bb8398e0d218daaefdfe95c44940e370802508 (patch) | |
tree | 0c567b638dd31d831141a2ca4ef355a406883e08 /command | |
parent | f94afff3bd198dca2412a75053e122c55b4b48dd (diff) | |
download | mate-applets-08bb8398e0d218daaefdfe95c44940e370802508.tar.bz2 mate-applets-08bb8398e0d218daaefdfe95c44940e370802508.tar.xz |
Allow building all applets in or out of process
*Use --enable-in-process selector for in-process builds
*Accessx-status: mark as incompatable with wayland
*Accessx-status: Fix in-process runtime warning
*Stickynote, Geyes: style fixes
Diffstat (limited to 'command')
-rw-r--r-- | command/data/Makefile.am | 28 | ||||
-rw-r--r-- | command/data/org.mate.applets.CommandApplet.mate-panel-applet.desktop.in.in | 2 | ||||
-rw-r--r-- | command/data/org.mate.panel.applet.CommandAppletFactory.service.in | 3 | ||||
-rw-r--r-- | command/src/Makefile.am | 33 | ||||
-rw-r--r-- | command/src/command.c | 14 |
5 files changed, 60 insertions, 20 deletions
diff --git a/command/data/Makefile.am b/command/data/Makefile.am index b6c82434..47709166 100644 --- a/command/data/Makefile.am +++ b/command/data/Makefile.am @@ -1,31 +1,49 @@ -APPLET_LOCATION = $(libdir)/mate-applets/libcommand-applet.so +applets_in_files = org.mate.applets.CommandApplet.mate-panel-applet.desktop.in +service_in_files = org.mate.panel.applet.CommandAppletFactory.service.in +gschema_in_files = org.mate.panel.applet.command.gschema.xml.in + +if ENABLE_IN_PROCESS +APPLET_LOCATION = $(pkglibdir)/libcommand-applet.so +else !ENABLE_IN_PROCESS +APPLET_LOCATION = $(libexecdir)/command-applet +endif !ENABLE_IN_PROCESS appletsdir = $(datadir)/mate-panel/applets -applets_in_files = org.mate.applets.CommandApplet.mate-panel-applet.desktop.in applets_DATA = $(applets_in_files:.mate-panel-applet.desktop.in=.mate-panel-applet) $(applets_in_files): $(applets_in_files).in Makefile $(AM_V_GEN)sed \ -e "s|\@APPLET_LOCATION\@|$(APPLET_LOCATION)|" \ + -e "s|\@APPLET_IN_PROCESS\@|$(APPLET_IN_PROCESS)|" \ $< > $@ $(applets_DATA): $(applets_in_files) Makefile $(AM_V_GEN) $(MSGFMT) --desktop --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@ +if !ENABLE_IN_PROCESS +servicedir = $(datadir)/dbus-1/services +service_DATA = $(service_in_files:.service.in=.service) + +$(service_DATA): $(service_in_files) Makefile + $(AM_V_GEN)sed \ + -e "s|\@APPLET_LOCATION\@|$(APPLET_LOCATION)|" \ + $< > $@ +endif !ENABLE_IN_PROCESS -command_gschema_in_files = org.mate.panel.applet.command.gschema.xml.in -gsettings_SCHEMAS = $(command_gschema_in_files:.xml.in=.xml) +gsettings_SCHEMAS = $(gschema_in_files:.xml.in=.xml) @GSETTINGS_RULES@ EXTRA_DIST = \ $(applets_in_files).in \ - $(command_gschema_in_files) \ + $(service_in_files) \ + $(gschema_in_files) \ command-preferences.ui \ command-resources.gresource.xml CLEANFILES = \ $(applets_DATA) \ $(applets_in_files) \ + $(service_DATA) \ $(gsettings_SCHEMAS) \ *.gschema.valid diff --git a/command/data/org.mate.applets.CommandApplet.mate-panel-applet.desktop.in.in b/command/data/org.mate.applets.CommandApplet.mate-panel-applet.desktop.in.in index 1b2495ee..6d14aedb 100644 --- a/command/data/org.mate.applets.CommandApplet.mate-panel-applet.desktop.in.in +++ b/command/data/org.mate.applets.CommandApplet.mate-panel-applet.desktop.in.in @@ -1,7 +1,7 @@ [Applet Factory] Id=CommandAppletFactory Location=@APPLET_LOCATION@ -InProcess=true +InProcess=@APPLET_IN_PROCESS@ Name=Command Factory Description=Command Factory diff --git a/command/data/org.mate.panel.applet.CommandAppletFactory.service.in b/command/data/org.mate.panel.applet.CommandAppletFactory.service.in new file mode 100644 index 00000000..aad043dd --- /dev/null +++ b/command/data/org.mate.panel.applet.CommandAppletFactory.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.mate.panel.applet.CommandAppletFactory +Exec=@APPLET_LOCATION@ diff --git a/command/src/Makefile.am b/command/src/Makefile.am index 3497672d..b8a20cc1 100644 --- a/command/src/Makefile.am +++ b/command/src/Makefile.am @@ -1,27 +1,41 @@ NULL = -command_applet_libdir= $(pkglibdir) -command_applet_lib_LTLIBRARIES=libcommand-applet.la - AM_CPPFLAGS = \ + $(WARN_FLAGS) \ $(MATE_APPLETS4_CFLAGS) \ -I$(srcdir) \ $(DISABLE_DEPRECATED_CFLAGS) \ $(NULL) - -libcommand_applet_la_SOURCES = \ - command.c \ - ma-command.c \ - ma-command.h \ +BUILT_SOURCES = \ command-resources.c \ command-resources.h \ $(NULL) +APPLET_SOURCES = \ + command.c \ + ma-command.c \ + ma-command.h \ + $(NULL) -libcommand_applet_la_LIBADD = \ +APPLET_LIBS = \ $(MATE_APPLETS4_LIBS) \ $(NULL) +if ENABLE_IN_PROCESS +pkglib_LTLIBRARIES = libcommand-applet.la +nodist_libcommand_applet_la_SOURCES = $(BUILT_SOURCES) +libcommand_applet_la_SOURCES = $(APPLET_SOURCES) +libcommand_applet_la_CFLAGS = $(AM_CFLAGS) +libcommand_applet_la_LDFLAGS = -module -avoid-version +libcommand_applet_la_LIBADD = $(APPLET_LIBS) +else !ENABLE_IN_PROCESS +libexec_PROGRAMS = command-applet +nodist_command_applet_SOURCES = $(BUILT_SOURCES) +command_applet_SOURCES = $(APPLET_SOURCES) +command_applet_CFLAGS = $(AM_CFLAGS) +command_applet_LDADD = $(APPLET_LIBS) +endif !ENABLE_IN_PROCESS + command-resources.c: $(srcdir)/../data/command-resources.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/../data --generate-dependencies $(srcdir)/../data/command-resources.gresource.xml) $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data --generate --c-name command $< @@ -29,6 +43,7 @@ command-resources.h: $(srcdir)/../data/command-resources.gresource.xml $(shell $ $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data --generate --c-name command $< CLEANFILES = \ + $(BUILT_SOURCES) $(NULL) -include $(top_srcdir)/git.mk diff --git a/command/src/command.c b/command/src/command.c index cc751349..c4ff027a 100644 --- a/command/src/command.c +++ b/command/src/command.c @@ -418,6 +418,10 @@ command_applet_fill (MatePanelApplet* applet) CommandApplet *command_applet; AtkObject *atk_widget; +#ifndef ENABLE_IN_PROCESS + g_set_application_name (_("Command Applet")); +#endif + gtk_window_set_default_icon_name (APPLET_ICON); mate_panel_applet_set_flags (applet, MATE_PANEL_APPLET_EXPAND_MINOR); @@ -506,8 +510,8 @@ command_factory (MatePanelApplet* applet, const char* iid, gpointer data) } /* needed by mate-panel applet library */ -MATE_PANEL_APPLET_IN_PROCESS_FACTORY("CommandAppletFactory", - PANEL_TYPE_APPLET, - "Command applet", - command_factory, - NULL) +PANEL_APPLET_FACTORY ("CommandAppletFactory", + PANEL_TYPE_APPLET, + "Command applet", + command_factory, + NULL) |