vala r2183 - in trunk: . vapi vapi/packages/libnotify vapigen



Author: juergbi
Date: Tue Dec 16 18:43:55 2008
New Revision: 2183
URL: http://svn.gnome.org/viewvc/vala?rev=2183&view=rev

Log:
2008-12-16  JÃrg Billeter  <j bitron ch>

	* vapigen/valagidlparser.vala:

	Extend metadata support for delegates

	* vapi/packages/libnotify/:

	Fix NotifyActionCallback and notify_notification_add_action
	bindings, fixes bug 562726

	* vapi/libnotify.vapi: regenerated


Modified:
   trunk/ChangeLog
   trunk/vapi/libnotify.vapi
   trunk/vapi/packages/libnotify/libnotify.metadata
   trunk/vapigen/valagidlparser.vala

Modified: trunk/vapi/libnotify.vapi
==============================================================================
--- trunk/vapi/libnotify.vapi	(original)
+++ trunk/vapi/libnotify.vapi	Tue Dec 16 18:43:55 2008
@@ -4,7 +4,7 @@
 namespace Notify {
 	[CCode (cheader_filename = "libnotify/notify.h")]
 	public class Notification : GLib.Object {
-		public void add_action (string action, string label, Notify.ActionCallback callback, GLib.FreeFunc free_func);
+		public void add_action (string action, string label, Notify.ActionCallback# callback);
 		public void attach_to_status_icon (Gtk.StatusIcon status_icon);
 		public void attach_to_widget (Gtk.Widget attach);
 		public void clear_actions ();
@@ -15,7 +15,7 @@
 		public void set_category (string category);
 		public void set_geometry_hints (Gdk.Screen screen, int x, int y);
 		public void set_hint_byte (string key, uchar value);
-		public void set_hint_byte_array (string key, uchar[] value, ulong len);
+		public void set_hint_byte_array (string key, uchar[] value, size_t len);
 		public void set_hint_double (string key, double value);
 		public void set_hint_int32 (string key, int value);
 		public void set_hint_string (string key, string value);
@@ -45,7 +45,7 @@
 		CRITICAL
 	}
 	[CCode (cheader_filename = "libnotify/notify.h")]
-	public static delegate void ActionCallback (Notify.Notification p1, string p2, void* p3);
+	public delegate void ActionCallback (Notify.Notification p1, string p2);
 	[CCode (cheader_filename = "libnotify/notify.h")]
 	public const int EXPIRES_DEFAULT;
 	[CCode (cheader_filename = "libnotify/notify.h")]

Modified: trunk/vapi/packages/libnotify/libnotify.metadata
==============================================================================
--- trunk/vapi/packages/libnotify/libnotify.metadata	(original)
+++ trunk/vapi/packages/libnotify/libnotify.metadata	Tue Dec 16 18:43:55 2008
@@ -1,2 +1,7 @@
 Notify cheader_filename="libnotify/notify.h"
 
+NotifyActionCallback has_target="1"
+NotifyActionCallback.p3 hidden="1"
+notify_notification_add_action.callback transfer_ownership="1"
+notify_notification_add_action.free_func hidden="1"
+

Modified: trunk/vapigen/valagidlparser.vala
==============================================================================
--- trunk/vapigen/valagidlparser.vala	(original)
+++ trunk/vapigen/valagidlparser.vala	Tue Dec 16 18:43:55 2008
@@ -309,6 +309,8 @@
 				} else if (nv[0] == "has_target") {
 					if (eval (nv[1]) == "0") {
 						check_has_target = false;
+					} else if (eval (nv[1]) == "1") {
+						cb.has_target = true;
 					}
 				}
 			}
@@ -334,7 +336,26 @@
 				ParameterDirection direction;
 				var p = new FormalParameter (param_name, parse_param (param, out direction));
 				p.direction = direction;
-				cb.add_parameter (p);
+
+				bool hide_param = false;
+				bool show_param = false;
+				attributes = get_attributes ("%s.%s".printf (node.name, param_node.name));
+				if (attributes != null) {
+					foreach (string attr in attributes) {
+						var nv = attr.split ("=", 2);
+						if (nv[0] == "hidden") {
+							if (eval (nv[1]) == "1") {
+								hide_param = true;
+							} else if (eval (nv[1]) == "0") {
+								show_param = true;
+							}
+						}
+					}
+				}
+
+				if (show_param || !hide_param) {
+					cb.add_parameter (p);
+				}
 			}
 
 			remaining_params--;



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