[Xfce4-commits] <xfce4-vala:master> Add the button panel plugin example

Mike Massonnet noreply at xfce.org
Tue Dec 22 14:24:02 CET 2009


Updating branch refs/heads/master
         to a502e7780b6af35ebe5bc1c8db14cb1d83b2878b (commit)
       from 6ca65e39054c4a4ca795b5f74baf228d28cd78f9 (commit)

commit a502e7780b6af35ebe5bc1c8db14cb1d83b2878b
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Tue Dec 22 14:21:31 2009 +0100

    Add the button panel plugin example
    
    The panel plugin example is in and builds fine for 4.7.

 examples/panel-plugin/Makefile.am       |   16 ++++++++++++++++
 examples/panel-plugin/button.desktop    |    1 -
 examples/panel-plugin/button.desktop.in |    9 +++++++++
 examples/panel-plugin/button.vala       |   20 ++++++++++++++++++++
 examples/panel-plugin/configure.ac      |   21 +++++++++++++++++++++
 5 files changed, 66 insertions(+), 1 deletions(-)

diff --git a/examples/panel-plugin/Makefile.am b/examples/panel-plugin/Makefile.am
new file mode 100644
index 0000000..3302b4c
--- /dev/null
+++ b/examples/panel-plugin/Makefile.am
@@ -0,0 +1,16 @@
+VALAFLAGS = --pkg=gtk+-2.0 --pkg=libxfce4panel-1.0
+
+plugindir = $(libdir)/xfce4/panel-plugins
+plugin_LTLIBRARIES = libbutton.la
+
+libbutton_la_SOURCES = button.vala
+libbutton_la_CFLAGS = @LIBXFCE4PANEL_CFLAGS@
+libbutton_la_LIBADD = @LIBXFCE4PANEL_LIBS@
+
+button.desktop: button.desktop.in
+	$(AM_V_GEN)sed -e "s^@EXTERNAL_PLUGIN_PATH@^$(plugindir)^" $< > $@
+desktopdir = $(datadir)/xfce4/panel-plugins
+desktop_DATA = button.desktop
+
+EXTRA_DIST = button.desktop.in
+DISTCLEANFILES = button.desktop
diff --git a/examples/panel-plugin/button.desktop b/examples/panel-plugin/button.desktop
deleted file mode 100644
index 8b13789..0000000
--- a/examples/panel-plugin/button.desktop
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/examples/panel-plugin/button.desktop.in b/examples/panel-plugin/button.desktop.in
new file mode 100644
index 0000000..0b63bc7
--- /dev/null
+++ b/examples/panel-plugin/button.desktop.in
@@ -0,0 +1,9 @@
+[Xfce Panel]
+Type=X-XFCE-PanelPlugin
+Encoding=UTF-8
+Name=Button
+Comment=Test plugin for the Xfce 4.7 Panel
+X-XFCE-Unique=true
+X-XFCE-Module=button
+X-XFCE-Module-Path=@EXTERNAL_PLUGIN_PATH@
+X-XFCE-Internal=FALSE
diff --git a/examples/panel-plugin/button.vala b/examples/panel-plugin/button.vala
index 8b13789..787783c 100644
--- a/examples/panel-plugin/button.vala
+++ b/examples/panel-plugin/button.vala
@@ -1 +1,21 @@
+using Xfce;
 
+public class ButtonPlugin : Xfce.PanelPlugin {
+	private Gtk.Button button;
+
+	public ButtonPlugin () {
+		GLib.Object ();
+		debug ("constructor");
+	}
+
+	public override void @construct () {
+		button = new Gtk.Button.with_label ("Hello World!");
+		add (button);
+		button.show ();
+	}
+}
+
+[ModuleInit]
+public Type xfce_panel_module_init (TypeModule module) {
+	return typeof (ButtonPlugin);
+}
diff --git a/examples/panel-plugin/configure.ac b/examples/panel-plugin/configure.ac
new file mode 100644
index 0000000..8845bae
--- /dev/null
+++ b/examples/panel-plugin/configure.ac
@@ -0,0 +1,21 @@
+dnl Initialize
+AC_INIT([Xfce4 Vala], [project_version], [mmassonnet at xfce.org], [xfce4-vala])
+AM_INIT_AUTOMAKE([1.11 dist-bzip2])
+AM_MAINTAINER_MODE()
+AM_SILENT_RULES([yes])
+
+dnl Check for basic programs
+AC_PROG_INSTALL()
+AC_PROG_LIBTOOL()
+
+dnl Check for required packages
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.7.0])
+
+dnl Check for Vala
+AM_PROG_VALAC()
+
+dnl Makefile outputs
+AC_OUTPUT([
+Makefile
+])
+



More information about the Xfce4-commits mailing list