here's a patch for the curses vapi adding missing 'resize' function
and basic support for mouse.

if you wanna try a simple app written in vala+curses check:

  http://lolcathost.org/b/racu.tar.gz

Feel free to apply this curses vapi patch into mainstream

--pancake 
diff --git a/vapi/curses.vapi b/vapi/curses.vapi
index 5b9957a..7bddc56 100644
--- a/vapi/curses.vapi
+++ b/vapi/curses.vapi
@@ -214,6 +214,8 @@ namespace Curses {
 		public int instr(string str);
 		[CCode (cname = "wmove")]
 		public int move(int y, int x);
+		[CCode (cname = "wresize")]
+		public int resize(int h, int w);
 		[CCode (cname = "wnoutrefresh")]
 		public int noutrefresh();
 		[CCode (cname = "wprintw")]
@@ -442,4 +444,68 @@ namespace Curses {
 	}
 	
 	/* TODO: mouse + wide char support */
+	[CCode (cname="MEVENT")]
+	public struct MouseEvent {
+		short id;
+		int x;
+		int y;
+		int z;
+		long bstate;
+	}
+
+	[CCode (cprefix="")]
+	public enum MouseMask {
+		ALL_MOUSE_EVENTS,
+		REPORT_MOUSE_POSITION
+	}
+
+	public enum Button {
+		SHIFT,
+		CTRL,
+		ALT,
+	}
+
+	public enum Button1 {
+		PRESSED,
+		RELEASED,
+		CLICKED,
+		DOUBLE_CLICKED,
+		TRIPLE_CLICKED
+	}
+
+	public enum Button2 {
+		PRESSED,
+		RELEASED,
+		CLICKED,
+		DOUBLE_CLICKED,
+		TRIPLE_CLICKED
+	}
+
+	public enum Button3 {
+		PRESSED,
+		RELEASED,
+		CLICKED,
+		DOUBLE_CLICKED,
+		TRIPLE_CLICKED
+	}
+
+	public enum Button4 {
+		PRESSED,
+		RELEASED,
+		CLICKED,
+		DOUBLE_CLICKED,
+		TRIPLE_CLICKED
+	}
+
+	public enum Button5 {
+		PRESSED,
+		RELEASED,
+		CLICKED,
+		DOUBLE_CLICKED,
+		TRIPLE_CLICKED
+	}
+
+	public bool getmouse(out MouseEvent me);
+	public int mouseinterval(int erval);
+	public int mousemask(MouseMask @new, out MouseMask old);
 }
_______________________________________________
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to