[gnome-applets/wip/segeiger/in-process: 2/9] gweather: switch to in-process applet



commit 8c963e155b2df56c5a1d316a06113ec2435b2464
Author: Sebastian Geiger <sbastig gmx net>
Date:   Thu Sep 8 00:11:50 2016 +0200

    gweather: switch to in-process applet

 gweather/Makefile.am                               |   11 ++---------
 ...gnome.applets.GWeatherApplet.panel-applet.in.in |    3 ++-
 ...e.panel.applet.GWeatherAppletFactory.service.in |    3 ---
 gweather/src/Makefile.am                           |   15 ++++++++++-----
 gweather/src/main.c                                |    8 ++++----
 5 files changed, 18 insertions(+), 22 deletions(-)
---
diff --git a/gweather/Makefile.am b/gweather/Makefile.am
index d7c8140..f6c979d 100644
--- a/gweather/Makefile.am
+++ b/gweather/Makefile.am
@@ -5,6 +5,8 @@ SUBDIRS = help src
 uidir = $(pkgdatadir)/ui
 ui_DATA = gweather-applet-menu.xml
 
+APPLET_LOCATION=$(pkglibdir)/$(LIBPANEL_APPLET_API_VERSION)/libgweather-applet.so
+
 appletdir       = $(LIBPANEL_APPLET_DIR)
 applet_in_files = org.gnome.applets.GWeatherApplet.panel-applet.in
 applet_DATA     = $(applet_in_files:.panel-applet.in=.panel-applet)
@@ -17,15 +19,6 @@ $(applet_in_files): $(applet_in_files).in Makefile
 
 %.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.GWeatherAppletFactory.service.in
-service_DATA     = $(service_in_files:.service.in=.service)
-
-org.gnome.panel.applet.GWeatherAppletFactory.service: $(service_in_files)
-       $(AM_V_GEN)sed \
-            -e "s|\@LIBEXECDIR\@|$(libexecdir)|" \
-            $< > $@
-
 gsettings_schemas_in_in = \
        org.gnome.gnome-applets.gweather.gschema.xml.in.in
 
diff --git a/gweather/org.gnome.applets.GWeatherApplet.panel-applet.in.in 
b/gweather/org.gnome.applets.GWeatherApplet.panel-applet.in.in
index d805a55..2d5eabb 100644
--- a/gweather/org.gnome.applets.GWeatherApplet.panel-applet.in.in
+++ b/gweather/org.gnome.applets.GWeatherApplet.panel-applet.in.in
@@ -1,6 +1,7 @@
 [Applet Factory]
 Id=GWeatherAppletFactory
-Location=@LIBEXECDIR@/gweather-applet-2
+InProcess=true
+Location=@APPLET_LOCATION@
 _Name=Gweather Applet Factory
 _Description=Factory for creating the weather applet.
 
diff --git a/gweather/src/Makefile.am b/gweather/src/Makefile.am
index b5fadb5..503fb01 100644
--- a/gweather/src/Makefile.am
+++ b/gweather/src/Makefile.am
@@ -2,13 +2,17 @@ NULL =
 
 uidir = $(pkgdatadir)/ui
 
-libexec_PROGRAMS = gweather-applet-2
+gweather_appletlibdir = $(pkglibdir)/$(LIBPANEL_APPLET_API_VERSION)
+gweather_appletlib_LTLIBRARIES = libgweather-applet.la
 
-gweather_applet_2_CFLAGS = \
+libgweather_applet_la_CPPFLAGS = \
        -I$(srcdir) \
        -I$(top_srcdir) \
        -DGWEATHER_MENU_UI_DIR=\""$(uidir)"\" \
        -DGNOMELOCALEDIR=\""$(localedir)"\" \
+       $(NULL)
+
+libgweather_applet_la_CFLAGS = \
        $(DBUS_CFLAGS) \
        $(GNOME_APPLETS_CFLAGS) \
        $(DBUS_CFLAGS) \
@@ -18,7 +22,7 @@ gweather_applet_2_CFLAGS = \
        $(AM_CFLAGS) \
        $(NULL)
 
-gweather_applet_2_SOURCES = \
+libgweather_applet_la_SOURCES = \
        gweather.h \
        gweather-about.c \
        gweather-about.h \
@@ -33,12 +37,13 @@ gweather_applet_2_SOURCES = \
        main.c \
        $(NULL)
 
-gweather_applet_2_LDFLAGS = \
+libgweather_applet_la_LDFLAGS = \
+       -avoid-version \
        $(WARN_LDFLAGS) \
        $(AM_LDFLAGS) \
        $(NULL)
 
-gweather_applet_2_LDADD = \
+libgweather_applet_la_LIBADD = \
        $(DBUS_LIBS) \
        $(LIBNOTIFY_LIBS) \
        $(GNOME_APPLETS_LIBS) \
diff --git a/gweather/src/main.c b/gweather/src/main.c
index 9b6e9b5..9e5994d 100644
--- a/gweather/src/main.c
+++ b/gweather/src/main.c
@@ -57,7 +57,7 @@ gweather_applet_factory(PanelApplet *applet,
        return retval;
 }
 
-PANEL_APPLET_OUT_PROCESS_FACTORY ("GWeatherAppletFactory",
-                                 PANEL_TYPE_APPLET,
-                                 gweather_applet_factory,
-                                 NULL)
+PANEL_APPLET_IN_PROCESS_FACTORY ("GWeatherAppletFactory",
+                                 PANEL_TYPE_APPLET,
+                                 gweather_applet_factory,
+                                 NULL)


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