[Xfce4-commits] <xfce4-notes-plugin:master> Bump dependency to Xfce 4.10

Mike Massonnet noreply at xfce.org
Wed Oct 24 06:10:01 CEST 2012


Updating branch refs/heads/master
         to d11fe51fae95b5b4963847be76ae4a07409a6076 (commit)
       from 7380224d7bd90f085adc9de0a94a9053193324b5 (commit)

commit d11fe51fae95b5b4963847be76ae4a07409a6076
Author: Mike Massonnet <mmassonnet at gmail.com>
Date:   Wed Oct 24 06:07:29 2012 +0200

    Bump dependency to Xfce 4.10
    
    Drop support for Xfce <= 4.6.
    Replace libxfcegui4 dependency against libxfce4ui.
    Update to new libtool syntax (use LT_PREREQ.)

 configure.ac.in                                    |   39 +++------
 lib/window.vala                                    |    1 +
 src/Makefile.am                                    |   55 ++----------
 src/main-panel-plugin-47.vala                      |   98 --------------------
 src/main-panel-plugin.vala                         |   60 +++++-------
 ...47.desktop.in => xfce4-notes-plugin.desktop.in} |    0
 src/xfce4-notes-plugin.desktop.in.in               |    8 --
 src/xfce4-notes-settings.c                         |    6 +-
 8 files changed, 47 insertions(+), 220 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index d59022b..a6f83e5 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -19,21 +19,17 @@ AC_INIT([Notes], [xfce4_notes_plugin_version], [http://bugzilla.xfce.org/], [xfc
 AC_REVISION([xfce4_notes_plugin_version_build])
 AC_CANONICAL_TARGET()
 
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
 AM_INIT_AUTOMAKE([1.11 dist-bzip2])
 AM_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE()
 AM_SILENT_RULES([yes])
 
-dnl Avoid g77 and g++ checks
-m4_undefine([AC_PROG_CXX])
-m4_defun([AC_PROG_CXX],[])
-m4_undefine([AC_PROG_F77])
-m4_defun([AC_PROG_F77],[])
-
 dnl Check for basic programs
 AM_PROG_CC_C_O()
 AC_PROG_LD()
-AC_PROG_LIBTOOL()
 AC_PROG_INSTALL()
 AC_PROG_INTLTOOL()
 
@@ -46,33 +42,22 @@ AC_SUBST([MATH_LIBS], [" -lm"])
 
 dnl Check for required packages
 XDT_CHECK_LIBX11_REQUIRE()
-XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.16.0])
-XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.16.0])
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.4.0])
-XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
+XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.24.0])
+XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.24.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.20.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.10.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.10.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.10.0])
+XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.10.0])
 XDT_CHECK_PACKAGE([UNIQUE], [unique-1.0], [1.0.0])
 
-dnl Check for libxfce4panel >= 4.7
-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.10.0])
+	AM_PROG_VALAC([0.16.0])
 	if test "x$VALAC" = "x" ; then
 		AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
 	fi
-	if test "x$LIBXFCE4PANEL47_FOUND" = "xyes" ; then
-		XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [4.7])
-	else
-		XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [4.6])
-		PKG_CHECK_EXISTS([xfce4-vala >= 4.7],
-				AC_ERROR([
-	*** Build configured for Xfce Panel 4.6 but  ***
-	*** Xfce Vala bindings for 4.7 are installed ***]), [])
-	fi
+	XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [4.10])
 fi
 
 dnl Translations
diff --git a/lib/window.vala b/lib/window.vala
index 57d7219..dfcd543 100644
--- a/lib/window.vala
+++ b/lib/window.vala
@@ -620,6 +620,7 @@ namespace Xnp {
 			window.get_geometry (out winx, out winy, out width, out height, out depth);
 			window.get_origin (out x, out y);
 			menu.size_request (out requisition);
+			push_in = false;
 
 			if (y + content_box.allocation.y + requisition.height > Gdk.Screen.height ()) {
 				/* Show menu above */
diff --git a/src/Makefile.am b/src/Makefile.am
index 09b4c84..b8d3d8b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,7 +36,7 @@ xfce4_notes_settings_SOURCES =						\
 xfce4_notes_settings_CFLAGS =						\
 	@LIBX11_CFLAGS@							\
 	@GTK_CFLAGS@							\
-	@LIBXFCEGUI4_CFLAGS@						\
+	@LIBXFCE4UI_CFLAGS@						\
 	@XFCONF_CFLAGS@							\
 	@UNIQUE_CFLAGS@
 
@@ -44,7 +44,7 @@ xfce4_notes_settings_LDADD =						\
 	$(top_builddir)/lib/libnotes.la					\
 	@LIBX11_LIBS@							\
 	@GTK_LIBS@							\
-	@LIBXFCEGUI4_LIBS@						\
+	@LIBXFCE4UI_LIBS@						\
 	@XFCONF_LIBS@							\
 	@UNIQUE_LIBS@
 
@@ -63,20 +63,16 @@ notes_VALAFLAGS =							\
 	--pkg=libxfconf-0						\
 	--pkg=libxfce4util-1.0
 
-BUILT_SOURCES = main-panel-plugin.c main-panel-plugin-47.c
+BUILT_SOURCES = main-panel-plugin.c
 main-panel-plugin.c: main-panel-plugin.vala
-	$(AM_V_GEN) $(VALAC) --vapidir=$(top_srcdir)/data/vapi/xfce46 $(notes_VALAFLAGS) $< -C
-main-panel-plugin-47.c: main-panel-plugin-47.vala
 	$(AM_V_GEN) $(VALAC) --vapidir=$(top_srcdir)/data/vapi/xfce47 $(notes_VALAFLAGS) $< -C
 endif
 
-if HAVE_LIBXFCE4PANEL47
-
 plugindir = $(libdir)/xfce4/panel-plugins
 plugin_LTLIBRARIES = libnotes.la
 
 libnotes_la_SOURCES =							\
-	main-panel-plugin-47.c
+	main-panel-plugin.c
 
 libnotes_la_CFLAGS =							\
 	@LIBX11_CFLAGS@							\
@@ -91,29 +87,6 @@ libnotes_la_LIBADD =							\
 	@LIBXFCE4UTIL_LIBS@						\
 	@XFCONF_LIBS@
 
-else
-
-plugindir = $(libexecdir)/xfce4/panel-plugins
-plugin_PROGRAMS = xfce4-notes-plugin
-
-xfce4_notes_plugin_SOURCES =						\
-	main-panel-plugin.c
-
-xfce4_notes_plugin_CFLAGS =						\
-	@LIBX11_CFLAGS@							\
-	@LIBXFCE4PANEL_CFLAGS@						\
-	@LIBXFCE4UTIL_CFLAGS@						\
-	@XFCONF_CFLAGS@
-
-xfce4_notes_plugin_LDADD =						\
-	$(top_builddir)/lib/libnotes.la					\
-	@LIBX11_LIBS@							\
-	@LIBXFCE4PANEL_LIBS@						\
-	@LIBXFCE4UTIL_LIBS@						\
-	@XFCONF_LIBS@
-
-endif
-
 #
 # Status icon
 #
@@ -164,29 +137,17 @@ xfce4_notes_LDADD =							\
 #
 
 desktopdir = $(datadir)/xfce4/panel-plugins
-desktop_in_in_files =							\
-	xfce4-notes-plugin-47.desktop.in				\
-	xfce4-notes-plugin.desktop.in.in
 desktop_in_files = xfce4-notes-plugin.desktop.in
-if HAVE_LIBXFCE4PANEL47
-desktop_DATA = xfce4-notes-plugin-47.desktop
-install-data-hook:
-	mv $(desktopdir)/xfce4-notes-plugin-47.desktop $(desktopdir)/xfce4-notes-plugin.desktop
-else
 desktop_DATA = xfce4-notes-plugin.desktop
-endif
 @INTLTOOL_DESKTOP_RULE@
 
-xfce4-notes-plugin.desktop.in: xfce4-notes-plugin.desktop.in.in
-	$(AM_V_GEN) sed -e "s^@EXTERNAL_PLUGIN_PATH@^$(plugindir)^" $< > $@
-
 #
 # Applications desktop file
 #
 
 applicationsdir = $(datadir)/applications
 applications_in_files = xfce4-notes.desktop.in
-applications_DATA = $(applications_in_files:.desktop.in=.desktop)
+applications_DATA = xfce4-notes.desktop
 @INTLTOOL_DESKTOP_RULE@
 
 #
@@ -195,7 +156,7 @@ applications_DATA = $(applications_in_files:.desktop.in=.desktop)
 
 autostartdir = $(sysconfdir)/xdg/autostart
 autostart_in_files = xfce4-notes-autostart.desktop.in
-autostart_DATA = $(autostart_in_files:.desktop.in=.desktop)
+autostart_DATA = xfce4-notes-autostart.desktop
 @INTLTOOL_DESKTOP_RULE@
 
 #
@@ -203,16 +164,14 @@ autostart_DATA = $(autostart_in_files:.desktop.in=.desktop)
 #
 
 EXTRA_DIST =								\
-	main-panel-plugin-47.vala					\
 	main-panel-plugin.vala						\
 	main-status-icon.vala						\
-	$(desktop_in_in_files)						\
+	$(desktop_in_files)						\
 	$(applications_in_files)					\
 	$(autostart_in_files)
 
 DISTCLEANFILES =							\
 	$(desktop_DATA)							\
-	$(desktop_in_files)						\
 	$(applications_DATA)						\
 	$(autostart_DATA)
 
diff --git a/src/main-panel-plugin-47.vala b/src/main-panel-plugin-47.vala
deleted file mode 100644
index a789eff..0000000
--- a/src/main-panel-plugin-47.vala
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *  Notes - panel plugin for Xfce Desktop Environment
- *  Copyright (C) 2009-2010  Mike Massonnet <mmassonnet at xfce.org>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-using Config;
-using Xfce;
-using Gtk;
-
-public class NotesPlugin : Xfce.PanelPlugin {
-
-	private Gtk.Invisible invisible;
-	private Gtk.Button button;
-	private Xfce.PanelImage image;
-	private Xnp.Application application;
-
-	public NotesPlugin () {
-		GLib.Object ();
-	}
-
-	public override void @construct () {
-		Xfce.textdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALE_DIR);
-		application = new Xnp.Application (save_location (true));
-
-		button = Xfce.panel_create_button ();
-		image = new Xfce.PanelImage.from_source ("xfce4-notes-plugin");
-		button.add (image);
-		button.clicked.connect (() => { application.show_hide_notes (); });
-		button.show_all ();
-		add (button);
-		add_action_widget (button);
-		set_tooltip_text (_("Notes"));
-		menu_show_configure ();
-		menu_show_about ();
-
-		var mi = new Gtk.MenuItem.with_mnemonic (_("_Groups"));
-		var menu = application.context_menu ();
-		mi.set_submenu (menu);
-		mi.show_all ();
-		menu_insert_item (mi);
-
-		set_x_selection ();
-
-		size_changed.connect ((p, size) => {
-			button.set_size_request (size, size);
-			return true;
-		});
-		save.connect (() => { application.save_windows_configuration (); });
-		free_data.connect (() => {
-			application.save_windows_configuration ();
-			application.save_notes ();
-		});
-		configure_plugin.connect (() => { application.open_settings_dialog (); });
-		about.connect (() => { application.open_about_dialog (); });
-		destroy.connect (() => { Gtk.main_quit (); });
-	}
-
-	/**
-	 * set_x_selection:
-	 *
-	 * Set an X selection to listen to for the popup command.
-	 */
-	private bool set_x_selection () {
-		invisible = new Gtk.Invisible ();
-		if (!Xnp.Popup.set_x_selection (invisible)) {
-			return false;
-		}
-		invisible.client_event.connect ((w, event) => {
-			if (Xnp.Popup.get_message_from_event (event) == "SHOW_HIDE") {
-				application.show_hide_notes ();
-				return true;
-			}
-			return false;
-		});
-		return true;
-	}
-
-}
-
-[ModuleInit]
-public Type xfce_panel_module_init (TypeModule module) {
-	return typeof (NotesPlugin);
-}
-
diff --git a/src/main-panel-plugin.vala b/src/main-panel-plugin.vala
index 7c570ad..a789eff 100644
--- a/src/main-panel-plugin.vala
+++ b/src/main-panel-plugin.vala
@@ -21,61 +21,52 @@ using Config;
 using Xfce;
 using Gtk;
 
-public class NotesPlugin : GLib.Object {
+public class NotesPlugin : Xfce.PanelPlugin {
 
 	private Gtk.Invisible invisible;
 	private Gtk.Button button;
-	private Gtk.Image image;
-	private weak Xfce.PanelPlugin panel_plugin;
+	private Xfce.PanelImage image;
 	private Xnp.Application application;
 
-	public NotesPlugin (Xfce.PanelPlugin panel_plugin) {
-		this.panel_plugin = panel_plugin;
+	public NotesPlugin () {
+		GLib.Object ();
+	}
 
+	public override void @construct () {
 		Xfce.textdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALE_DIR);
-		application = new Xnp.Application (panel_plugin.save_location (true));
+		application = new Xnp.Application (save_location (true));
 
-		button = Xfce.create_panel_button ();
-		image = new Gtk.Image ();
+		button = Xfce.panel_create_button ();
+		image = new Xfce.PanelImage.from_source ("xfce4-notes-plugin");
 		button.add (image);
 		button.clicked.connect (() => { application.show_hide_notes (); });
 		button.show_all ();
-		panel_plugin.add (button);
-		panel_plugin.add_action_widget (button);
-		panel_plugin.set_tooltip_text (_("Notes"));
-		panel_plugin.menu_show_configure ();
-		panel_plugin.menu_show_about ();
+		add (button);
+		add_action_widget (button);
+		set_tooltip_text (_("Notes"));
+		menu_show_configure ();
+		menu_show_about ();
 
 		var mi = new Gtk.MenuItem.with_mnemonic (_("_Groups"));
 		var menu = application.context_menu ();
 		mi.set_submenu (menu);
 		mi.show_all ();
-		panel_plugin.menu_insert_item (mi);
+		menu_insert_item (mi);
 
 		set_x_selection ();
 
-		panel_plugin.size_changed.connect ((p, size) => {
+		size_changed.connect ((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.connect (() => {
-			application.save_windows_configuration ();
-		});
-		panel_plugin.free_data.connect (() => {
+		save.connect (() => { application.save_windows_configuration (); });
+		free_data.connect (() => {
 			application.save_windows_configuration ();
 			application.save_notes ();
 		});
-		panel_plugin.configure_plugin.connect (() => {
-			application.open_settings_dialog ();
-		});
-		panel_plugin.about.connect (() => {
-			application.open_about_dialog ();
-		});
+		configure_plugin.connect (() => { application.open_settings_dialog (); });
+		about.connect (() => { application.open_about_dialog (); });
+		destroy.connect (() => { Gtk.main_quit (); });
 	}
 
 	/**
@@ -100,11 +91,8 @@ public class NotesPlugin : GLib.Object {
 
 }
 
-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);
+[ModuleInit]
+public Type xfce_panel_module_init (TypeModule module) {
+	return typeof (NotesPlugin);
 }
 
diff --git a/src/xfce4-notes-plugin-47.desktop.in b/src/xfce4-notes-plugin.desktop.in
similarity index 100%
rename from src/xfce4-notes-plugin-47.desktop.in
rename to src/xfce4-notes-plugin.desktop.in
diff --git a/src/xfce4-notes-plugin.desktop.in.in b/src/xfce4-notes-plugin.desktop.in.in
deleted file mode 100644
index 08a8cef..0000000
--- a/src/xfce4-notes-plugin.desktop.in.in
+++ /dev/null
@@ -1,8 +0,0 @@
-[Xfce Panel]
-Type=X-XFCE-PanelPlugin
-Encoding=UTF-8
-_Name=Notes
-_Comment=Ideal for your quick notes
-Icon=xfce4-notes-plugin
-X-XFCE-Exec=@EXTERNAL_PLUGIN_PATH@/xfce4-notes-plugin
-X-XFCE-Unique=true
diff --git a/src/xfce4-notes-settings.c b/src/xfce4-notes-settings.c
index 00f8b51..adbe2e5 100644
--- a/src/xfce4-notes-settings.c
+++ b/src/xfce4-notes-settings.c
@@ -25,7 +25,7 @@
 #include <xfconf/xfconf.h>
 #include <gtk/gtk.h>
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "defines.h"
 #include "color.h"
@@ -119,7 +119,7 @@ prop_dialog_new (void)
 
   /* === Global settings === */
   box = gtk_vbox_new (FALSE, BORDER);
-  frame = xfce_create_framebox_with_content (_("Global settings"), box);
+  frame = xfce_gtk_frame_box_new_with_content (_("Global settings"), box);
   gtk_container_set_border_width (GTK_CONTAINER (frame), BORDER);
   gtk_container_add (GTK_CONTAINER (vbox), frame);
 
@@ -177,7 +177,7 @@ prop_dialog_new (void)
 
   /* === New window settings === */
   box = gtk_vbox_new (FALSE, BORDER);
-  frame = xfce_create_framebox_with_content (_("New group settings"), box);
+  frame = xfce_gtk_frame_box_new_with_content (_("New group settings"), box);
   gtk_container_set_border_width (GTK_CONTAINER (frame), BORDER);
   gtk_container_add (GTK_CONTAINER (vbox), frame);
 


More information about the Xfce4-commits mailing list