[gnome-applets/wip/segeiger/in-process] inhibit: switch to in-process applet



commit 94d49f33a1f8b8dad77508027b500276eaa489d6
Author: Sebastian Geiger <sbastig gmx net>
Date:   Wed Sep 7 14:07:18 2016 +0200

    inhibit: switch to in-process applet

 inhibit/Makefile.am                                |   13 +++----------
 inhibit/org.gnome.InhibitApplet.panel-applet.in.in |    3 ++-
 ...me.panel.applet.InhibitAppletFactory.service.in |    3 ---
 inhibit/src/Makefile.am                            |   15 ++++++++++-----
 inhibit/src/inhibit-applet.c                       |   11 ++++-------
 5 files changed, 19 insertions(+), 26 deletions(-)
---
diff --git a/inhibit/Makefile.am b/inhibit/Makefile.am
index b552911..f4ace95 100644
--- a/inhibit/Makefile.am
+++ b/inhibit/Makefile.am
@@ -2,27 +2,20 @@ NULL =
 
 SUBDIRS = icons src
 
+APPLET_LOCATION=$(pkglibdir)/$(LIBPANEL_APPLET_API_VERSION)/libinhibit-applet.so
+
 appletdir       = $(LIBPANEL_APPLET_DIR)
 applet_in_files = org.gnome.InhibitApplet.panel-applet.in
 applet_DATA     = $(applet_in_files:.panel-applet.in=.panel-applet)
 
 $(applet_in_files): $(applet_in_files).in Makefile
        $(AM_V_GEN)sed \
-            -e "s|\@LIBEXECDIR\@|$(libexecdir)|" \
+            -e "s|\@APPLET_LOCATION\@|$(APPLET_LOCATION)|" \
             -e "s|\@VERSION\@|$(PACKAGE_VERSION)|" \
             $< > $@
 
 %.panel-applet: %.panel-applet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) 
$(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
 
-servicedir       = $(datadir)/dbus-1/services
-service_in_files = org.gnome.panel.applet.InhibitAppletFactory.service.in
-service_DATA     = $(service_in_files:.service.in=.service)
-
-org.gnome.panel.applet.InhibitAppletFactory.service: $(service_in_files)
-       $(AM_V_GEN)sed \
-            -e "s|\@LIBEXECDIR\@|$(libexecdir)|" \
-            $< > $@
-
 uidir   = $(pkgdatadir)/ui
 ui_DATA = inhibit-applet-menu.xml
 
diff --git a/inhibit/org.gnome.InhibitApplet.panel-applet.in.in 
b/inhibit/org.gnome.InhibitApplet.panel-applet.in.in
index 6573acd..9b37599 100644
--- a/inhibit/org.gnome.InhibitApplet.panel-applet.in.in
+++ b/inhibit/org.gnome.InhibitApplet.panel-applet.in.in
@@ -1,6 +1,7 @@
 [Applet Factory]
 Id=InhibitAppletFactory
-Location=@LIBEXECDIR@/gnome-inhibit-applet
+InProcess=true
+Location=@APPLET_LOCATION@
 Name=Inhibit Applet Factory
 Description=Factory for Inhibit Applet
 
diff --git a/inhibit/src/Makefile.am b/inhibit/src/Makefile.am
index 2e1e78c..9ea0aeb 100644
--- a/inhibit/src/Makefile.am
+++ b/inhibit/src/Makefile.am
@@ -2,30 +2,35 @@ NULL =
 
 uidir = $(pkgdatadir)/ui
 
-libexec_PROGRAMS=gnome-inhibit-applet
+inhibit_appletlibdir = $(pkglibdir)/$(LIBPANEL_APPLET_API_VERSION)
+inhibit_appletlib_LTLIBRARIES = libinhibit-applet.la
 
-gnome_inhibit_applet_CFLAGS = \
+libinhibit_applet_la_CPPFLAGS = \
        -I. \
        -I$(srcdir) \
        -DINHIBIT_MENU_UI_DIR=\""$(uidir)"\" \
        -DGNOMELOCALEDIR=\""$(localedir)"\" \
        -DPKG_DATA_DIR=\""$(pkgdatadir)"\" \
+       $(NULL)
+
+libinhibit_applet_la_CFLAGS = \
        $(GNOME_APPLETS_CFLAGS) \
        $(WARN_CFLAGS) \
        $(AM_CFLAGS) \
        $(NULL)
 
-gnome_inhibit_applet_SOURCES = \
+libinhibit_applet_la_SOURCES = \
        $(BUILT_SOURCES) \
        inhibit-applet.c \
        $(NULL)
 
-gnome_inhibit_applet_LDFLAGS = \
+libinhibit_applet_la_LDFLAGS = \
+       -avoid-version \
        $(WARN_LDFLAGS) \
        $(AM_LDFLAGS) \
        $(NULL)
 
-gnome_inhibit_applet_LDADD = \
+libinhibit_applet_la_LIBADD = \
        $(GNOME_APPLETS_LIBS) \
        $(NULL)
 
diff --git a/inhibit/src/inhibit-applet.c b/inhibit/src/inhibit-applet.c
index a76b658..01dad46 100644
--- a/inhibit/src/inhibit-applet.c
+++ b/inhibit/src/inhibit-applet.c
@@ -509,10 +509,7 @@ gpm_applet_cb (PanelApplet *_applet, const gchar *iid, gpointer data)
 /**
  * this generates a main with a applet factory
  **/
-PANEL_APPLET_OUT_PROCESS_FACTORY
-       (/* the factory iid */
-       GPM_INHIBIT_APPLET_FACTORY_ID,
-       /* generates inhibit applet instead of regular gnome applets  */
-       GPM_TYPE_INHIBIT_APPLET,
-       /* our callback (with no user data) */
-       gpm_applet_cb, NULL)
+PANEL_APPLET_IN_PROCESS_FACTORY (GPM_INHIBIT_APPLET_FACTORY_ID,
+                                 GPM_TYPE_INHIBIT_APPLET,
+                                 gpm_applet_cb,
+                                 NULL)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]