[Xfce4-commits] <xfce4-notes-plugin:master> Update build to compile CCode for both panel plugins version 4.6 and 4.7

Mike Massonnet noreply at xfce.org
Sat Mar 27 09:44:01 CET 2010


Updating branch refs/heads/master
         to 9443d4c63abe98d73fcf0590088737f97adb253e (commit)
       from a863c3aeb4a330478ad5c3b4114c4a00bfc09aef (commit)

commit 9443d4c63abe98d73fcf0590088737f97adb253e
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Thu Mar 25 23:52:56 2010 +0100

    Update build to compile CCode for both panel plugins version 4.6 and 4.7

 ChangeLog                               |    4 +
 data/Makefile.am                        |    2 +
 data/vapi/xfce46/libxfce4panel-1.0.deps |    9 ++
 data/vapi/xfce46/libxfce4panel-1.0.vapi |  143 +++++++++++++++++++++++++++++++
 data/vapi/xfce47/libxfce4panel-1.0.deps |    8 ++
 data/vapi/xfce47/libxfce4panel-1.0.vapi |  126 +++++++++++++++++++++++++++
 src/Makefile.am                         |   42 +++-------
 7 files changed, 303 insertions(+), 31 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 99602fb..fd2ce0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-25  Mike Massonnet <mmassonnet at xfce.org>
+
+Update build to compile CCode for both panel plugins version 4.6 and 4.7
+
 2010-03-21  Mike Massonnet <mmassonnet at xfce.org>
 
 Don't forget to properly save notes with the last commit
diff --git a/data/Makefile.am b/data/Makefile.am
index 613438d..cb479dc 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -2,3 +2,5 @@ SUBDIRS =								\
 	gtk-2.0								\
 	icons								\
 	pixmaps
+
+EXTRA_DIST = vapi
diff --git a/data/vapi/xfce46/libxfce4panel-1.0.deps b/data/vapi/xfce46/libxfce4panel-1.0.deps
new file mode 100644
index 0000000..2ebda27
--- /dev/null
+++ b/data/vapi/xfce46/libxfce4panel-1.0.deps
@@ -0,0 +1,9 @@
+atk
+gio-2.0
+cairo
+pango
+gdk-pixbuf-2.0
+gdk-2.0
+gtk+-2.0
+libxfce4util-1.0
+libxfcegui4-1.0
diff --git a/data/vapi/xfce46/libxfce4panel-1.0.vapi b/data/vapi/xfce46/libxfce4panel-1.0.vapi
new file mode 100644
index 0000000..0a68e17
--- /dev/null
+++ b/data/vapi/xfce46/libxfce4panel-1.0.vapi
@@ -0,0 +1,143 @@
+/*
+ *  xfce4-vala - Vala bindings for Xfce
+ *  Copyright (c) 2009  Mike Massonnet <mmassonnet at xfce.org>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", cprefix = "Xfce", lower_case_cprefix = "xfce_")]
+namespace Xfce {
+	public static int PanelPluginRegisterExternal ([CCode (array_length_pos = 0)] ref unowned string[] argv, PanelPluginFunc register) {
+		return PanelPluginRegisterExternalFull (ref argv, register, null, null);
+	}
+	public static int PanelPluginRegisterExternalFull ([CCode (array_length_pos = 0)] ref unowned string[] argv, PanelPluginFunc register, PanelPluginPreInit? preinit, PanelPluginCheck? check) {
+		if (preinit != null) {
+			if (!preinit (argv)) {
+				return 3;
+			}
+		}
+		Gtk.init (ref argv);
+		if (check != null) {
+			if (!check (Gdk.Screen.get_default ())) {
+				return 2;
+			}
+		}
+		var panel_plugin = new Xfce.ExternalPanelPlugin (argv, register);
+		if (panel_plugin == null)
+			return 1;
+		GLib.Signal.connect_after (panel_plugin, "destroy", () => { Gtk.main_quit (); }, null);
+		panel_plugin.show ();
+		Gtk.main ();
+		return 0;
+	}
+	/*
+	TODO:
+	- PanelPluginRegisterInternal
+	*/
+
+	public class ExternalPanelPlugin : Gtk.Plug, PanelPlugin {
+		public ExternalPanelPlugin ([CCode (array_length_pos = 0)] string[] argv, PanelPluginFunc register);
+	}
+	public class InternalPanelPlugin : Gtk.EventBox, PanelPlugin {
+		public InternalPanelPlugin (string name, string id, string display_name, int size, ScreenPosition screen_position, PanelPluginFunc register);
+	}
+
+	[CCode (has_target = false)]
+	public delegate void PanelPluginFunc (PanelPlugin panel_plugin);
+	[CCode (has_target = false)]
+	public delegate bool PanelPluginCheck (Gdk.Screen screen);
+	[CCode (has_target = false)]
+	public delegate bool PanelPluginPreInit ([CCode (array_length_pos = 0)] string[] argv);
+
+	public interface PanelPlugin : Gtk.Container {
+		public string display_name { get; }
+		public bool expand { get; set; }
+		public string id { get; }
+		public string name { get; }
+		public ScreenPosition screen_position { get; }
+		public int size { get; }
+		public virtual signal void about ();
+		public virtual signal void configure_plugin ();
+		public virtual signal void free_data ();
+		public virtual signal void orientation_changed (Gtk.Orientation orientation);
+		public virtual signal void save ();
+		public virtual signal void screen_position_changed (ScreenPosition screen_position);
+		public virtual signal bool size_changed (int size);
+		public string get_name ();
+		public string get_id ();
+		public string get_display_name ();
+		public int get_size ();
+		public ScreenPosition get_screen_position ();
+		public void set_expand (bool expand);
+		public bool get_expand ();
+		public Gtk.Orientation get_orientation ();
+		public void add_action_widget (Gtk.Widget widget);
+		public void menu_insert_item (Gtk.MenuItem item);
+		public void menu_show_about ();
+		public void menu_show_configure ();
+		public void block_menu ();
+		public void unblock_menu ();
+		public void register_menu (Gtk.Menu menu);
+		public string lookup_rc_file ();
+		public string save_location (bool create);
+		public void focus_widget (Gtk.Widget widget);
+		public void set_panel_hidden (bool hidden);
+	}
+
+	public class ArrowButton : Gtk.ToggleButton {
+		public Gtk.ArrowType arrow_type { get; set; }
+		public virtual signal void arrow_type_changed (Gtk.ArrowType type);
+		public ArrowButton (Gtk.ArrowType type);
+		public void set_arrow_type (Gtk.ArrowType type);
+		public Gtk.ArrowType get_arrow_type ();
+	}
+	public class HVBox : Gtk.Box {
+		[CCode (cname = "xfce_hvbox_new")]
+		public HVBox (Gtk.Orientation orientation, bool homogeneous, int spacing);
+		[CCode (cname = "xfce_hvbox_set_orientation")]
+		public void set_orientation (Gtk.Orientation orientation);
+	}
+
+	public static Gtk.Button create_panel_button ();
+	public static Gtk.ToggleButton create_panel_toggle_button ();
+	public static bool allow_panel_customization ();
+
+	[CCode (has_type_id = false)]
+	public enum ScreenPosition {
+		NONE,
+		NW_H,          /* North West Horizontal */
+		N,             /* North                 */
+		NE_H,          /* North East Horizontal */
+		NW_V,          /* North West Vertical   */
+		W,             /* West                  */
+		SW_V,          /* South West Vertical   */
+		NE_V,          /* North East Vertical   */
+		E,             /* East                  */
+		SE_V,          /* South East Vertical   */
+		SW_H,          /* South West Horizontal */
+		S,             /* South                 */
+		SE_H,          /* South East Horizontal */
+		FLOATING_H,    /* Floating Horizontal */
+		FLOATING_V     /* Floating Vertical */
+	}
+
+	[CCode (has_type_id = false)]
+	public enum HandleStyle {
+		NONE,
+		BOTH,
+		START,
+		END
+	}
+}
diff --git a/data/vapi/xfce47/libxfce4panel-1.0.deps b/data/vapi/xfce47/libxfce4panel-1.0.deps
new file mode 100644
index 0000000..b47d055
--- /dev/null
+++ b/data/vapi/xfce47/libxfce4panel-1.0.deps
@@ -0,0 +1,8 @@
+atk
+gio-2.0
+cairo
+pango
+gdk-pixbuf-2.0
+gdk-2.0
+gtk+-2.0
+libxfce4util-1.0
diff --git a/data/vapi/xfce47/libxfce4panel-1.0.vapi b/data/vapi/xfce47/libxfce4panel-1.0.vapi
new file mode 100644
index 0000000..5557627
--- /dev/null
+++ b/data/vapi/xfce47/libxfce4panel-1.0.vapi
@@ -0,0 +1,126 @@
+/* libxfce4panel-1.0.vapi generated by vapigen, do not modify. */
+
+[CCode (cprefix = "Xfce", lower_case_cprefix = "xfce_")]
+namespace Xfce {
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public class ArrowButton : Gtk.ToggleButton, Gtk.Activatable, Gtk.Buildable, Atk.Implementor {
+		[CCode (type = "GtkWidget*", has_construct_function = false)]
+		public ArrowButton (Gtk.ArrowType arrow_type);
+		public Gtk.ArrowType get_arrow_type ();
+		public bool get_blinking ();
+		public void set_arrow_type (Gtk.ArrowType arrow_type);
+		public void set_blinking (bool blinking);
+		public Gtk.ArrowType arrow_type { get; set; }
+		public virtual signal void arrow_type_changed (Gtk.ArrowType type);
+	}
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public class HVBox : Gtk.Box, Gtk.Buildable, Atk.Implementor, Gtk.Orientable {
+		public Gtk.Orientation orientation;
+		[CCode (cname = "xfce_hvbox_new", type = "GtkWidget*", has_construct_function = false)]
+		public HVBox (Gtk.Orientation orientation, bool homogeneous, int spacing);
+		[CCode (cname = "xfce_hvbox_get_orientation")]
+		public Gtk.Orientation get_orientation ();
+		[CCode (cname = "xfce_hvbox_set_orientation")]
+		public void set_orientation (Gtk.Orientation orientation);
+	}
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public class PanelImage : Gtk.Widget {
+		[CCode (has_construct_function = false)]
+		public PanelImage ();
+		public void clear ();
+		[CCode (has_construct_function = false)]
+		public PanelImage.from_pixbuf (Gdk.Pixbuf pixbuf);
+		[CCode (has_construct_function = false)]
+		public PanelImage.from_source (string source);
+		public void set_from_pixbuf (Gdk.Pixbuf pixbuf);
+		public void set_from_source (string source);
+	}
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public class PanelPlugin : Gtk.EventBox, Gtk.Buildable, Atk.Implementor, Xfce.PanelPluginProvider {
+		public void add_action_widget (Gtk.Widget widget);
+		public Gtk.ArrowType arrow_type ();
+		public void block_autohide (bool blocked);
+		public void block_menu ();
+		[NoWrapper]
+		public virtual void @construct ();
+		public void focus_widget (Gtk.Widget widget);
+		public unowned string get_arguments ();
+		public unowned string get_comment ();
+		public unowned string get_display_name ();
+		public bool get_expand ();
+		public Gtk.Orientation get_orientation ();
+		public unowned string get_property_base ();
+		public Xfce.ScreenPosition get_screen_position ();
+		public int get_size ();
+		public int get_unique_id ();
+		public unowned string lookup_rc_file ();
+		public void menu_insert_item (Gtk.MenuItem item);
+		public void menu_show_about ();
+		public void menu_show_configure ();
+		public static void position_menu (Gtk.Menu menu, int x, int y, bool push_in, void* panel_plugin);
+		public void position_widget (Gtk.Widget menu_widget, Gtk.Widget attach_widget, int x, int y);
+		public void register_menu (Gtk.Menu menu);
+		public unowned string save_location (bool create);
+		public void set_expand (bool expand);
+		public void take_window (Gtk.Window window);
+		public void unblock_menu ();
+		[CCode (array_length = false, array_null_terminated = true)]
+		public string[] arguments { get; construct; }
+		public string comment { get; construct; }
+		public string display_name { get; construct; }
+		public bool expand { get; set; }
+		public string name { get; construct; }
+		public Gtk.Orientation orientation { get; }
+		public Xfce.ScreenPosition screen_position { get; }
+		public int size { get; }
+		public int unique_id { get; construct; }
+		public virtual signal void about ();
+		public virtual signal void configure_plugin ();
+		public virtual signal void free_data ();
+		public virtual signal void orientation_changed (Gtk.Orientation orientation);
+		public virtual signal bool remote_event (string name, GLib.Value value);
+		public virtual signal void removed ();
+		public virtual signal void save ();
+		public virtual signal void screen_position_changed (Xfce.ScreenPosition position);
+		public virtual signal bool size_changed (int size);
+	}
+	[Compact]
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public class PanelTypeModule {
+	}
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public interface PanelPluginProvider {
+	}
+	[CCode (cprefix = "XFCE_SCREEN_POSITION_", cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public enum ScreenPosition {
+		NONE,
+		NW_H,
+		N,
+		NE_H,
+		NW_V,
+		W,
+		SW_V,
+		NE_V,
+		E,
+		SE_V,
+		SW_H,
+		S,
+		SE_H,
+		FLOATING_H,
+		FLOATING_V
+	}
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", has_target = false)]
+	public delegate bool PanelPluginCheck (Gdk.Screen screen);
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", has_target = false)]
+	public delegate void PanelPluginFunc (Xfce.PanelPlugin plugin);
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", has_target = false)]
+	public delegate bool PanelPluginPreInit (int argc, string argv);
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public const string PANEL_PLUGIN_CHANNEL_NAME;
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public static bool panel_allow_customization ();
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public static unowned Gtk.Button panel_create_button ();
+	[CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")]
+	public static unowned Gtk.ToggleButton panel_create_toggle_button ();
+}
diff --git a/src/Makefile.am b/src/Makefile.am
index b95ddce..e16d6d2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -53,12 +53,8 @@ xfce4_notes_settings_LDADD =						\
 # Panel plugin
 #
 
-if HAVE_LIBXFCE4PANEL47
-
-plugindir = $(libdir)/xfce4/panel-plugins
-plugin_LTLIBRARIES = libnotes.la
-
-libnotes_la_VALAFLAGS =							\
+if MAINTAINER_MODE
+notes_VALAFLAGS =							\
 	--vapidir=$(top_srcdir)/lib					\
 	--pkg=libnotes							\
 	--pkg=config							\
@@ -68,15 +64,18 @@ libnotes_la_VALAFLAGS =							\
 	--pkg=libxfconf-0						\
 	--pkg=libxfce4util-1.0
 
-if MAINTAINER_MODE
-BUILT_SOURCES = main-panel-plugin-47.c main-panel-plugin.c
+BUILT_SOURCES = main-panel-plugin.c main-panel-plugin-47.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) $(libnotes_la_VALAFLAGS) $< -C
-
-main-panel-plugin.c:
-	$(AM_V_GEN) echo "*** The build-env is configured for Xfce Panel 4.7 ***" > $@
+	$(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
 
@@ -98,25 +97,6 @@ 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
-
-if MAINTAINER_MODE
-BUILT_SOURCES = main-panel-plugin.c main-panel-plugin-47.c
-main-panel-plugin.c: main-panel-plugin.vala
-	$(AM_V_GEN) $(VALAC) $(xfce4_notes_plugin_VALAFLAGS) $< -C
-
-main-panel-plugin-47.c:
-	$(AM_V_GEN) echo "*** The build-env is configured for Xfce Panel 4.4 ***" > $@
-endif
-
 xfce4_notes_plugin_SOURCES =						\
 	main-panel-plugin.c
 



More information about the Xfce4-commits mailing list