[Xfce4-commits] <xfce4-notes-plugin:master> Update build for Xfce 4.7

Mike Massonnet noreply at xfce.org
Wed Dec 23 16:10:02 CET 2009


Updating branch refs/heads/master
         to 7c4751e5a3307e240d9ac3843e0cd851087241c5 (commit)
       from 553e6ab9cc7d87cd1a09151b02ad22b8d25a28e5 (commit)

commit 7c4751e5a3307e240d9ac3843e0cd851087241c5
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Tue Dec 22 15:50:00 2009 +0100

    Update build for Xfce 4.7

 ChangeLog                                          |   23 ++++
 configure.ac.in                                    |   15 +-
 lib/Makefile.am                                    |   35 +++++
 {panel-plugin => lib}/application.vala             |    3 +-
 {panel-plugin => lib}/color.c                      |    0
 {panel-plugin => lib}/color.h                      |    0
 {panel-plugin => lib}/color.vapi                   |    0
 {panel-plugin => lib}/hypertextview.vala           |    0
 {panel-plugin => lib}/note.vala                    |    2 +
 {panel-plugin => lib}/popup.c                      |    0
 {panel-plugin => lib}/popup.h                      |    0
 {panel-plugin => lib}/popup.vapi                   |    0
 {panel-plugin => lib}/window.vala                  |    0
 panel-plugin/Makefile.am                           |  136 +++++++-------------
 panel-plugin/config.vapi                           |   19 ---
 ...panel-plugin.vala => main-panel-plugin-47.vala} |   42 ++-----
 panel-plugin/main-panel-plugin.vala                |   21 +---
 ...ktop.in.in => xfce4-notes-plugin-47.desktop.in} |    1 -
 18 files changed, 128 insertions(+), 169 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f0cc8d2..a8d4e6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2009-12-22  Mike Massonnet <mmassonnet at xfce.org>
+
+Update build for Xfce 4.7
+
+Clean up the autoconf/automake scripts:
+- Always use AM_SILENT_RULES (can be disabled while compiling with make V=1).
+- Check for Vala 0.7.8 as the code uses construction chain up to Object.
+- Update xfce4-vala to 4.6/4.7, fix missing $ in front of LIBXFCE4PANEL47.
+
+Move shared code between the systray and the panel to lib/
+- Xfce 4.7 Panel is build with GTypeModule which results in different .c files
+  for note.vala, etc. The generated code cannot be reused to build the panel
+  plugin and the standalone systray application.
+- Use valac to build a library libnotes.vapi/libnotes.h.
+- Update panel-plugin/Makefile.am to build with libnotes, and drop the custom
+  VALAC compilation against pure automake 1.11. In fact automake 1.11 is all
+  about provide release tarballs without the need to compile Vala with its
+  pros and cons.
+
+Split main-panel-plugin.vala into two separate files because Vala provides
+targets for the .c files and it breaks when using one .vala file to build two
+different resulting .c files.
+
 2009-12-20  Mike Massonnet <mmassonnet at xfce.org>
 
 Woohoo! A build without warnings
diff --git a/configure.ac.in b/configure.ac.in
index 63790a6..2797d01 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -23,7 +23,7 @@ AC_CANONICAL_TARGET()
 AM_INIT_AUTOMAKE([1.11 dist-bzip2])
 AM_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE()
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AM_SILENT_RULES([yes])
 
 dnl Avoid g77 and g++ checks
 m4_undefine([AC_PROG_CXX])
@@ -56,14 +56,14 @@ XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4PANEL47], [libxfce4panel-1.0], [4.7.0], [],
 
 dnl Check for valac
 if test "x$USE_MAINTAINER_MODE" = "xyes" ; then
-	AM_PROG_VALAC([0.7.1])
+	AM_PROG_VALAC([0.7.8])
 	if test "x$VALAC" = "x" ; then
 		AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
 	fi
-	if test "xLIBXFCE4PANEL47_FOUND" = "xyes" ; then
-		XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [0.1]) # 4.8
+	if test "x$LIBXFCE4PANEL47_FOUND" = "xyes" ; then
+		XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [4.7])
 	else
-		XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [0.1]) # 4.6
+		XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [4.6])
 	fi
 fi
 
@@ -81,6 +81,7 @@ icons/22x22/Makefile
 icons/24x24/Makefile
 icons/32x32/Makefile
 icons/scalable/Makefile
+lib/Makefile
 panel-plugin/Makefile
 po/Makefile.in
 ])
@@ -97,8 +98,8 @@ echo
 echo "    * Vala:               $VALAC $am__vala_version"
 echo
 fi
-if test "xLIBXFCE4PANEL47_FOUND" = "xyes" ; then
-echo "* Xfce Panel:             4.8"
+if test "x$LIBXFCE4PANEL47_FOUND" = "xyes" ; then
+echo "* Xfce Panel:             4.7"
 else
 echo "* Xfce Panel:             4.6"
 fi
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 0000000..af147db
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,35 @@
+INCLUDES =								\
+	-DGETTEXT_PACKAGE=\""$(GETTEXT_PACKAGE)"\"
+
+noinst_LTLIBRARIES = libnotes.la
+
+libnotes_la_VALAFLAGS =							\
+	--library=libnotes						\
+	--header=libnotes.h						\
+	--vapidir=.							\
+	--pkg=config							\
+	--pkg=color							\
+	--pkg=gtk+-2.0							\
+	--pkg=libxfconf-0						\
+	--pkg=libxfce4util-1.0
+
+libnotes_la_SOURCES =							\
+	application.vala						\
+	hypertextview.vala						\
+	note.vala							\
+	window.vala							\
+	color.c								\
+	popup.c
+
+libnotes_la_CFLAGS =							\
+	@LIBX11_CFLAGS@							\
+	@GTK_CFLAGS@							\
+	@LIBXFCE4UTIL_CFLAGS@						\
+	@XFCONF_CFLAGS@
+
+libnotes_la_LIBADD =							\
+	@LIBX11_LIBS@							\
+	@GTK_LIBS@							\
+	@LIBXFCE4UTIL_LIBS@						\
+	@XFCONF_LIBS@
+
diff --git a/panel-plugin/application.vala b/lib/application.vala
similarity index 99%
rename from panel-plugin/application.vala
rename to lib/application.vala
index 03317ac..828bda6 100644
--- a/panel-plugin/application.vala
+++ b/lib/application.vala
@@ -34,6 +34,8 @@ namespace Xnp {
 		}
 
 		public Application (string config_file) {
+			GLib.Object (config_file: config_file);
+
 			try {
 				Xfconf.init ();
 			}
@@ -41,7 +43,6 @@ namespace Xnp {
 				critical ("%s", e.message);
 			}
 
-			this.config_file = config_file;
 			xfconf_channel = new Xfconf.Channel.with_property_base ("xfce4-panel", "/plugins/notes");
 			string color = xfconf_channel.get_string ("/global/background-color", "#F7EB96");
 			Xnp.Color.set_background (color);
diff --git a/panel-plugin/color.c b/lib/color.c
similarity index 100%
rename from panel-plugin/color.c
rename to lib/color.c
diff --git a/panel-plugin/color.h b/lib/color.h
similarity index 100%
rename from panel-plugin/color.h
rename to lib/color.h
diff --git a/panel-plugin/color.vapi b/lib/color.vapi
similarity index 100%
rename from panel-plugin/color.vapi
rename to lib/color.vapi
diff --git a/panel-plugin/hypertextview.vala b/lib/hypertextview.vala
similarity index 100%
rename from panel-plugin/hypertextview.vala
rename to lib/hypertextview.vala
diff --git a/panel-plugin/note.vala b/lib/note.vala
similarity index 99%
rename from panel-plugin/note.vala
rename to lib/note.vala
index f2183f9..028a4c3 100644
--- a/panel-plugin/note.vala
+++ b/lib/note.vala
@@ -52,6 +52,8 @@ namespace Xnp {
 		public signal void save_data ();
 
 		public Note (string name) {
+			GLib.Object ();
+
 			this.name = name;
 
 			this.scrolled_window = new Gtk.ScrolledWindow (null, null);
diff --git a/panel-plugin/popup.c b/lib/popup.c
similarity index 100%
rename from panel-plugin/popup.c
rename to lib/popup.c
diff --git a/panel-plugin/popup.h b/lib/popup.h
similarity index 100%
rename from panel-plugin/popup.h
rename to lib/popup.h
diff --git a/panel-plugin/popup.vapi b/lib/popup.vapi
similarity index 100%
rename from panel-plugin/popup.vapi
rename to lib/popup.vapi
diff --git a/panel-plugin/window.vala b/lib/window.vala
similarity index 100%
rename from panel-plugin/window.vala
rename to lib/window.vala
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 616a2a5..4ab3254 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,5 +1,6 @@
 INCLUDES =								\
 	-I$(top_srcdir)							\
+	-I$(top_srcdir)/lib						\
 	-DGETTEXT_PACKAGE=\""$(GETTEXT_PACKAGE)"\"			\
 	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\"
 
@@ -10,7 +11,7 @@ INCLUDES =								\
 bin_PROGRAMS = xfce4-popup-notes
 
 xfce4_popup_notes_SOURCES =						\
-	popup.h								\
+	$(top_srcdir)/lib/popup.h					\
 	xfce4-popup-notes.c
 
 xfce4_popup_notes_CFLAGS =						\
@@ -28,8 +29,8 @@ xfce4_popup_notes_LDADD =						\
 bin_PROGRAMS += xfce4-notes-settings
 
 xfce4_notes_settings_SOURCES =						\
-	color.c								\
-	color.h								\
+	$(top_srcdir)/lib/color.c					\
+	$(top_srcdir)/lib/color.h					\
 	defines.h							\
 	xfce4-notes-settings.c
 
@@ -48,50 +49,6 @@ xfce4_notes_settings_LDADD =						\
 	@UNIQUE_LIBS@
 
 #
-# Vala sources
-#
-
-notes_VAPISOURCES =							\
-	config.vapi							\
-	color.vapi							\
-	popup.vapi							\
-	xfce-autostart.vapi
-
-notes_VALASOURCES =							\
-	hypertextview.vala						\
-	note.vala							\
-	window.vala							\
-	application.vala
-
-notes_panel_plugin_VALASOURCES =					\
-	main-panel-plugin.vala
-
-notes_status_icon_VALASOURCES =						\
-	main-status-icon.vala
-
-notes_VALABUILTSOURCES = $(notes_VALASOURCES:.vala=.c)
-notes_panel_plugin_VALABUILTSOURCES = $(notes_panel_plugin_VALASOURCES:.vala=.c)
-notes_status_icon_VALABUILTSOURCES = $(notes_status_icon_VALASOURCES:.vala=.c)
-
-if MAINTAINER_MODE
-if HAVE_LIBXFCE4PANEL47
-DEFINES=-D HAVE_LIBXFCE4PANEL47
-PACKAGES=--pkg=config --pkg=color --pkg=popup --pkg=libxfcegui4-1.0 --pkg=gtk+-2.0
-else
-PACKAGES=--pkg=config --pkg=color --pkg=popup --pkg=gtk+-2.0
-endif
-BUILT_SOURCES = vala.stamp
-vala.stamp: $(notes_VALASOURCES) $(notes_panel_plugin_VALASOURCES) $(notes_status_icon_VALASOURCES)
-	$(VALAC) $(DEFINES) --vapidir=$(srcdir) $(PACKAGES)				\
-		 --pkg=libxfconf-0 --pkg=libxfce4panel-1.0				\
-		 $(notes_VALASOURCES) $(notes_panel_plugin_VALASOURCES) -C
-	$(VALAC) $(DEFINES) --vapidir=$(srcdir) $(PACKAGES) --pkg=unique-1.0		\
-		 --pkg=xfce-autostart --pkg=libxfconf-0 --pkg=libxfce4util-1.0		\
-		 $(notes_VALASOURCES) $(notes_status_icon_VALASOURCES) -C
-	touch $@
-endif
-
-#
 # Panel plugin
 #
 
@@ -100,26 +57,30 @@ if HAVE_LIBXFCE4PANEL47
 plugindir = $(libdir)/xfce4/panel-plugins
 plugin_LTLIBRARIES = libnotes.la
 
+libnotes_la_VALAFLAGS =							\
+	--vapidir=$(top_srcdir)/lib					\
+	--pkg=libnotes							\
+	--pkg=config							\
+	--pkg=popup							\
+	--pkg=gtk+-2.0							\
+	--pkg=libxfce4panel-1.0						\
+	--pkg=libxfconf-0						\
+	--pkg=libxfce4util-1.0
+
 libnotes_la_SOURCES =							\
-	color.c								\
-	color.h								\
-	popup.c								\
-	popup.h								\
-	$(notes_VALABUILTSOURCES)					\
-	$(notes_panel_plugin_VALABUILTSOURCES)
+	main-panel-plugin-47.vala
 
 libnotes_la_CFLAGS =							\
 	@LIBX11_CFLAGS@							\
 	@LIBXFCE4PANEL_CFLAGS@						\
 	@LIBXFCE4UTIL_CFLAGS@						\
-	@LIBXFCEGUI4_CFLAGS@						\
 	@XFCONF_CFLAGS@
 
 libnotes_la_LIBADD =							\
+	$(top_srcdir)/lib/libnotes.la					\
 	@LIBX11_LIBS@							\
 	@LIBXFCE4PANEL_LIBS@						\
 	@LIBXFCE4UTIL_LIBS@						\
-	@LIBXFCEGUI4_LIBS@						\
 	@XFCONF_LIBS@
 
 else
@@ -127,26 +88,30 @@ else
 plugindir = $(libexecdir)/xfce4/panel-plugins
 plugin_PROGRAMS = xfce4-notes-plugin
 
+xfce4_notes_plugin_VALAFLAGS =						\
+	--vapidir=$(top_srcdir)/lib					\
+	--pkg=libnotes							\
+	--pkg=config							\
+	--pkg=popup							\
+	--pkg=gtk+-2.0							\
+	--pkg=libxfce4panel-1.0						\
+	--pkg=libxfconf-0						\
+	--pkg=libxfce4util-1.0
+
 xfce4_notes_plugin_SOURCES =						\
-	color.c								\
-	color.h								\
-	popup.c								\
-	popup.h								\
-	$(notes_VALABUILTSOURCES)					\
-	$(notes_panel_plugin_VALABUILTSOURCES)
+	main-panel-plugin.vala
 
 xfce4_notes_plugin_CFLAGS =						\
 	@LIBX11_CFLAGS@							\
 	@LIBXFCE4PANEL_CFLAGS@						\
 	@LIBXFCE4UTIL_CFLAGS@						\
-	@LIBXFCEGUI4_CFLAGS@						\
 	@XFCONF_CFLAGS@
 
 xfce4_notes_plugin_LDADD =						\
+	$(top_srcdir)/lib/libnotes.la					\
 	@LIBX11_LIBS@							\
 	@LIBXFCE4PANEL_LIBS@						\
 	@LIBXFCE4UTIL_LIBS@						\
-	@LIBXFCEGUI4_LIBS@						\
 	@XFCONF_LIBS@
 
 endif
@@ -157,29 +122,34 @@ endif
 
 bin_PROGRAMS += xfce4-notes
 
+xfce4_notes_VALAFLAGS =							\
+	--vapidir=$(top_srcdir)/lib					\
+	--pkg=libnotes							\
+	--pkg=config							\
+	--pkg=popup							\
+	--vapidir=.							\
+	--pkg=xfce-autostart						\
+	--pkg=unique-1.0						\
+	--pkg=gtk+-2.0							\
+	--pkg=libxfconf-0						\
+	--pkg=libxfce4util-1.0
+
 xfce4_notes_SOURCES =							\
-	color.c								\
-	color.h								\
-	popup.c								\
-	popup.h								\
 	xfce-autostart.c						\
-	xfce-autostart.h						\
-	$(notes_VALABUILTSOURCES)					\
-	$(notes_status_icon_VALABUILTSOURCES)
+	main-status-icon.vala
 
 xfce4_notes_CFLAGS =							\
 	@LIBX11_CFLAGS@							\
 	@GTK_CFLAGS@							\
 	@LIBXFCE4UTIL_CFLAGS@						\
-	@LIBXFCEGUI4_CFLAGS@						\
 	@XFCONF_CFLAGS@							\
 	@UNIQUE_CFLAGS@
 
 xfce4_notes_LDADD =							\
+	$(top_srcdir)/lib/libnotes.la					\
 	@LIBX11_LIBS@							\
 	@GTK_LIBS@							\
 	@LIBXFCE4UTIL_LIBS@						\
-	@LIBXFCEGUI4_LIBS@						\
 	@XFCONF_LIBS@							\
 	@UNIQUE_LIBS@
 
@@ -187,12 +157,11 @@ xfce4_notes_LDADD =							\
 # Plugin desktop file
 #
 
+desktopdir = $(datadir)/xfce4/panel-plugins
 desktop_in_in_files =							\
-	xfce4-notes-plugin-47.desktop.in.in				\
+	xfce4-notes-plugin-47.desktop.in				\
 	xfce4-notes-plugin.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
-
-desktopdir = $(datadir)/xfce4/panel-plugins
+desktop_in_files = xfce4-notes-plugin.desktop.in
 if HAVE_LIBXFCE4PANEL47
 desktop_DATA = xfce4-notes-plugin-47.desktop
 else
@@ -200,9 +169,8 @@ desktop_DATA = xfce4-notes-plugin.desktop
 endif
 @INTLTOOL_DESKTOP_RULE@
 
-%.desktop.in: %.desktop.in.in
-	sed -e "s^@EXTERNAL_PLUGIN_PATH@^$(plugindir)^" \
-		$< > $@
+xfce4-notes-plugin.desktop.in: xfce4-notes-plugin.desktop.in.in
+	$(AM_V_GEN) sed -e "s^@EXTERNAL_PLUGIN_PATH@^$(plugindir)^" $< > $@
 
 #
 # Autostart file
@@ -218,19 +186,9 @@ autostart_DATA = $(autostart_in_files:.desktop.in=.desktop)
 #
 
 EXTRA_DIST =								\
-	$(notes_VAPISOURCES)						\
-	$(notes_VALASOURCES)						\
-	$(notes_panel_plugin_VALASOURCES)				\
-	$(notes_status_icon_VALASOURCES)				\
 	$(desktop_in_in_files)						\
 	$(autostart_in_files)
 
-if MAINTAINER_MODE
-CLEANFILES =								\
-	$(BUILT_SOURCES)						\
-	$(notes_VALABUILTSOURCES)
-endif
-
 DISTCLEANFILES =							\
 	$(desktop_DATA)							\
 	$(desktop_in_files)						\
diff --git a/panel-plugin/config.vapi b/panel-plugin/config.vapi
deleted file mode 100644
index 4cf9447..0000000
--- a/panel-plugin/config.vapi
+++ /dev/null
@@ -1,19 +0,0 @@
-[CCode (cprefix = "", lower_case_prefix = "", cheader_filename = "config.h")]
-namespace Config {
-	[CCode (cname = "GETTEXT_PACKAGE")]
-	public const string GETTEXT_PACKAGE;
-	[CCode (cname = "PACKAGE_LOCALE_DIR")]
-	public const string PACKAGE_LOCALE_DIR;
-	[CCode (cname = "PACKAGE")]
-	public const string PACKAGE;
-	[CCode (cname = "PACKAGE_BUGREPORT")]
-	public const string PACKAGE_BUGREPORT;
-	[CCode (cname = "PACKAGE_NAME")]
-	public const string PACKAGE_NAME;
-	[CCode (cname = "PACKAGE_STRING")]
-	public const string PACKAGE_STRING;
-	[CCode (cname = "PACKAGE_TARNAME")]
-	public const string PACKAGE_TARNAME;
-	[CCode (cname = "PACKAGE_VERSION")]
-	public const string PACKAGE_VERSION;
-}
diff --git a/panel-plugin/main-panel-plugin.vala b/panel-plugin/main-panel-plugin-47.vala
similarity index 72%
copy from panel-plugin/main-panel-plugin.vala
copy to panel-plugin/main-panel-plugin-47.vala
index 22644eb..2503bd7 100644
--- a/panel-plugin/main-panel-plugin.vala
+++ b/panel-plugin/main-panel-plugin-47.vala
@@ -21,35 +21,27 @@ using Config;
 using Xfce;
 using Gtk;
 
-#if HAVE_LIBXFCE4PANEL47
 public class NotesPlugin : Xfce.PanelPlugin {
-#else
-public class NotesPlugin : GLib.Object {
-#endif
 
 	private Gtk.Invisible invisible;
 	private Gtk.Button button;
-	private Gtk.Image image;
+	private Xfce.PanelImage image;
 	private weak Xfce.PanelPlugin panel_plugin;
 	private Xnp.Application application;
 
-#if HAVE_LIBXFCE4PANEL47
+	public NotesPlugin () {
+		GLib.Object ();
+		debug ("constructor");
+	}
+
 	public override void @construct () {
 		panel_plugin = this;
-#else
-	public NotesPlugin (Xfce.PanelPlugin panel_plugin) {
-		this.panel_plugin = panel_plugin;
-#endif
 
 		Xfce.textdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALE_DIR);
 		application = new Xnp.Application (panel_plugin.save_location (true));
 
-#if HAVE_LIBXFCE4PANEL47
-		button = (Gtk.Button)Xfce.panel_create_button ();
-#else
-		button = Xfce.create_panel_button ();
-#endif
-		image = new Gtk.Image ();
+		button = Xfce.panel_create_button ();
+		image = new Xfce.PanelImage.from_source ("xfce4-notes-plugin");
 		button.add (image);
 		button.clicked += () => { application.show_hide_notes (); };
 		button.show_all ();
@@ -69,11 +61,6 @@ public class NotesPlugin : GLib.Object {
 
 		panel_plugin.size_changed += (p, size) => {
 			button.set_size_request (size, size);
-			size -= 2 + 2 * ((button.style.xthickness > button.style.ythickness) ? button.style.xthickness : button.style.ythickness);
-			var pixbuf = Xfce.Icon.load ("xfce4-notes-plugin", size);
-			if (pixbuf == null)
-				pixbuf = Xfce.Icon.load (Gtk.STOCK_EDIT, size);
-			image.set_from_pixbuf (pixbuf);
 			return true;
 		};
 		panel_plugin.save += () => {
@@ -113,17 +100,8 @@ public class NotesPlugin : GLib.Object {
 
 }
 
-#if HAVE_LIBXFCE4PANEL47
 [ModuleInit]
-public Type __xpp_init (TypeModule module) {
+public Type xfce_panel_module_init (TypeModule module) {
 	return typeof (NotesPlugin);
 }
-#else
-static NotesPlugin plugin;
-public static void panel_plugin_register (Xfce.PanelPlugin panel_plugin) {
-	plugin = new NotesPlugin (panel_plugin);
-}
-public static int main (string[] args) {
-	return Xfce.PanelPluginRegisterExternal (ref args, panel_plugin_register);
-}
-#endif
+
diff --git a/panel-plugin/main-panel-plugin.vala b/panel-plugin/main-panel-plugin.vala
index 22644eb..1e26f71 100644
--- a/panel-plugin/main-panel-plugin.vala
+++ b/panel-plugin/main-panel-plugin.vala
@@ -21,11 +21,7 @@ using Config;
 using Xfce;
 using Gtk;
 
-#if HAVE_LIBXFCE4PANEL47
-public class NotesPlugin : Xfce.PanelPlugin {
-#else
 public class NotesPlugin : GLib.Object {
-#endif
 
 	private Gtk.Invisible invisible;
 	private Gtk.Button button;
@@ -33,22 +29,13 @@ public class NotesPlugin : GLib.Object {
 	private weak Xfce.PanelPlugin panel_plugin;
 	private Xnp.Application application;
 
-#if HAVE_LIBXFCE4PANEL47
-	public override void @construct () {
-		panel_plugin = this;
-#else
 	public NotesPlugin (Xfce.PanelPlugin panel_plugin) {
 		this.panel_plugin = panel_plugin;
-#endif
 
 		Xfce.textdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALE_DIR);
 		application = new Xnp.Application (panel_plugin.save_location (true));
 
-#if HAVE_LIBXFCE4PANEL47
-		button = (Gtk.Button)Xfce.panel_create_button ();
-#else
 		button = Xfce.create_panel_button ();
-#endif
 		image = new Gtk.Image ();
 		button.add (image);
 		button.clicked += () => { application.show_hide_notes (); };
@@ -113,12 +100,6 @@ public class NotesPlugin : GLib.Object {
 
 }
 
-#if HAVE_LIBXFCE4PANEL47
-[ModuleInit]
-public Type __xpp_init (TypeModule module) {
-	return typeof (NotesPlugin);
-}
-#else
 static NotesPlugin plugin;
 public static void panel_plugin_register (Xfce.PanelPlugin panel_plugin) {
 	plugin = new NotesPlugin (panel_plugin);
@@ -126,4 +107,4 @@ public static void panel_plugin_register (Xfce.PanelPlugin panel_plugin) {
 public static int main (string[] args) {
 	return Xfce.PanelPluginRegisterExternal (ref args, panel_plugin_register);
 }
-#endif
+
diff --git a/panel-plugin/xfce4-notes-plugin-47.desktop.in.in b/panel-plugin/xfce4-notes-plugin-47.desktop.in
similarity index 81%
rename from panel-plugin/xfce4-notes-plugin-47.desktop.in.in
rename to panel-plugin/xfce4-notes-plugin-47.desktop.in
index af12073..7da3981 100644
--- a/panel-plugin/xfce4-notes-plugin-47.desktop.in.in
+++ b/panel-plugin/xfce4-notes-plugin-47.desktop.in
@@ -6,5 +6,4 @@ _Comment=Ideal for your quick notes
 Icon=xfce4-notes-plugin
 X-XFCE-Unique=true
 X-XFCE-Module=notes
-X-XFCE-Module-Path=@EXTERNAL_PLUGIN_PATH@
 X-XFCE-Internal=FALSE



More information about the Xfce4-commits mailing list