From 08bb8398e0d218daaefdfe95c44940e370802508 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Tue, 11 Jul 2023 21:28:01 -0400 Subject: 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 --- drivemount/data/Makefile.am | 37 ++++++++++++++++------ ...riveMountApplet.mate-panel-applet.desktop.in.in | 2 +- ...panel.applet.DriveMountAppletFactory.service.in | 3 ++ drivemount/src/Makefile.am | 30 +++++++++++++----- drivemount/src/drivemount.c | 13 +++++--- 5 files changed, 62 insertions(+), 23 deletions(-) create mode 100644 drivemount/data/org.mate.panel.applet.DriveMountAppletFactory.service.in (limited to 'drivemount') diff --git a/drivemount/data/Makefile.am b/drivemount/data/Makefile.am index 642baf0d..5c7205a7 100644 --- a/drivemount/data/Makefile.am +++ b/drivemount/data/Makefile.am @@ -1,36 +1,55 @@ NULL = -APPLET_LOCATION = $(libdir)/mate-applets/libmate-drivemount-applet.so +applet_in_files = org.mate.applets.DriveMountApplet.mate-panel-applet.desktop.in +service_in_files = org.mate.panel.applet.DriveMountAppletFactory.service.in +gschema_in_files = org.mate.drivemount.gschema.xml.in + +if ENABLE_IN_PROCESS +APPLET_LOCATION = $(pkglibdir)/libmate-drivemount-applet.so +else !ENABLE_IN_PROCESS +APPLET_LOCATION = $(libexecdir)/mate-drivemount-applet +endif !ENABLE_IN_PROCESS -drivemount_gschema_in_files = org.mate.drivemount.gschema.xml.in -gsettings_SCHEMAS = $(drivemount_gschema_in_files:.xml.in=.xml) +gsettings_SCHEMAS = $(gschema_in_files:.xml.in=.xml) @GSETTINGS_RULES@ appletdir = $(datadir)/mate-panel/applets -applet_in_files = org.mate.applets.DriveMountApplet.mate-panel-applet.desktop.in applet_DATA = $(applet_in_files:.mate-panel-applet.desktop.in=.mate-panel-applet) $(applet_in_files): $(applet_in_files).in Makefile $(AM_V_GEN)sed \ -e "s|\@APPLET_LOCATION\@|$(APPLET_LOCATION)|" \ + -e "s|\@APPLET_IN_PROCESS\@|$(APPLET_IN_PROCESS)|" \ -e "s|\@VERSION\@|$(PACKAGE_VERSION)|" \ $< > $@ $(applet_DATA): $(applet_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 + CLEANFILES = \ $(applet_DATA) \ $(applet_in_files) \ + $(service_DATA) \ $(gsettings_SCHEMAS) \ *.gschema.valid \ $(NULL) -EXTRA_DIST = \ - $(applet_in_files:=.in) \ - $(drivemount_gschema_in_files) \ - drivemount-applet-menu.xml \ - drivemount-resources.gresource.xml \ +EXTRA_DIST = \ + $(applet_in_files:=.in) \ + $(gschema_in_files) \ + $(service_in_files) \ + drivemount-applet-menu.xml \ + drivemount-resources.gresource.xml \ $(NULL) -include $(top_srcdir)/git.mk diff --git a/drivemount/data/org.mate.applets.DriveMountApplet.mate-panel-applet.desktop.in.in b/drivemount/data/org.mate.applets.DriveMountApplet.mate-panel-applet.desktop.in.in index 852b7678..01e12296 100644 --- a/drivemount/data/org.mate.applets.DriveMountApplet.mate-panel-applet.desktop.in.in +++ b/drivemount/data/org.mate.applets.DriveMountApplet.mate-panel-applet.desktop.in.in @@ -1,7 +1,7 @@ [Applet Factory] Id=DriveMountAppletFactory Location=@APPLET_LOCATION@ -InProcess=true +InProcess=@APPLET_IN_PROCESS@ Name=Drive Mount Applet Factory Description=Factory for drive mount applet diff --git a/drivemount/data/org.mate.panel.applet.DriveMountAppletFactory.service.in b/drivemount/data/org.mate.panel.applet.DriveMountAppletFactory.service.in new file mode 100644 index 00000000..8034ae4d --- /dev/null +++ b/drivemount/data/org.mate.panel.applet.DriveMountAppletFactory.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.mate.panel.applet.DriveMountAppletFactory +Exec=@APPLET_LOCATION@ diff --git a/drivemount/src/Makefile.am b/drivemount/src/Makefile.am index a5b60c1e..a887b1e5 100644 --- a/drivemount/src/Makefile.am +++ b/drivemount/src/Makefile.am @@ -1,8 +1,5 @@ NULL = -mate_drivemount_applet_libdir= $(pkglibdir) -mate_drivemount_applet_lib_LTLIBRARIES=libmate-drivemount-applet.la - AM_CPPFLAGS = \ -I. \ -I$(srcdir) \ @@ -11,18 +8,34 @@ AM_CPPFLAGS = \ $(MATE_APPLETS4_CFLAGS) \ $(NULL) -libmate_drivemount_applet_la_SOURCES = \ +BUILT_SOURCES = \ + drivemount-resources.c \ + drivemount-resources.h \ + $(NULL) +APPLET_SOURCES = \ drivemount.c \ drive-list.c \ drive-list.h \ drive-button.c \ drive-button.h \ - drivemount-resources.c \ - drivemount-resources.h \ $(NULL) -libmate_drivemount_applet_la_LIBADD = \ - $(MATE_APPLETS4_LIBS) +APPLET_LIBS = $(MATE_APPLETS4_LIBS) + +if ENABLE_IN_PROCESS +pkglib_LTLIBRARIES = libmate-drivemount-applet.la +nodist_libmate_drivemount_applet_la_SOURCES = $(BUILT_SOURCES) +libmate_drivemount_applet_la_SOURCES = $(APPLET_SOURCES) +libmate_drivemount_applet_la_CFLAGS = $(AM_CFLAGS) +libmate_drivemount_applet_la_LDFLAGS = -module -avoid-version +libmate_drivemount_applet_la_LIBADD = $(APPLET_LIBS) +else !ENABLE_IN_PROCESS +libexec_PROGRAMS = mate-drivemount-applet +nodist_mate_drivemount_applet_SOURCES = $(BUILT_SOURCES) +mate_drivemount_applet_SOURCES = $(APPLET_SOURCES) +mate_drivemount_applet_CFLAGS = $(AM_CFLAGS) +mate_drivemount_applet_LDADD = $(APPLET_LIBS) +endif !ENABLE_IN_PROCESS drivemount-resources.c: ../data/drivemount-resources.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/../data/ --generate-dependencies $(srcdir)/../data/drivemount-resources.gresource.xml) $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data/ --generate --c-name drivemount $< @@ -31,6 +44,7 @@ drivemount-resources.h: ../data/drivemount-resources.gresource.xml $(shell $(GLI $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data/ --generate --c-name drivemount $< CLEANFILES = \ + $(BUILT_SOURCES) \ $(NULL) -include $(top_srcdir)/git.mk diff --git a/drivemount/src/drivemount.c b/drivemount/src/drivemount.c index 6b10f9fa..408c7645 100644 --- a/drivemount/src/drivemount.c +++ b/drivemount/src/drivemount.c @@ -179,6 +179,10 @@ applet_factory (MatePanelApplet *applet, GtkActionGroup *action_group; if (!strcmp (iid, drivemount_iid)) { +#ifndef ENABLE_IN_PROCESS + g_set_application_name (_("Disk Mounter")); +#endif + gtk_window_set_default_icon_name ("media-floppy"); mate_panel_applet_set_flags (applet, MATE_PANEL_APPLET_EXPAND_MINOR); @@ -221,8 +225,7 @@ applet_factory (MatePanelApplet *applet, return ret; } -MATE_PANEL_APPLET_IN_PROCESS_FACTORY (factory_iid, - PANEL_TYPE_APPLET, - "Drive-Mount-Applet", - applet_factory, NULL) - +PANEL_APPLET_FACTORY (factory_iid, + PANEL_TYPE_APPLET, + "Drive-Mount-Applet", + applet_factory, NULL) -- cgit v1.2.1