java-gobject-introspection-examples r10 - in trunk: . src/org/verbum



Author: walters
Date: Sat Oct 18 21:45:55 2008
New Revision: 10
URL: http://svn.gnome.org/viewvc/java-gobject-introspection-examples?rev=10&view=rev

Log:
Update examples


Modified:
   trunk/.classpath
   trunk/src/org/verbum/GooCanvasTest.java
   trunk/src/org/verbum/GtkSourceViewTest.java
   trunk/src/org/verbum/GtkTest.java
   trunk/src/org/verbum/VteTest.java

Modified: trunk/.classpath
==============================================================================
--- trunk/.classpath	(original)
+++ trunk/.classpath	Sat Oct 18 21:45:55 2008
@@ -1,34 +1,33 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry excluding="org/verbum/SoupTest.java" kind="src" path="src"/>
+	<classpathentry excluding="org/verbum/SoupTest.java|org/verbum/HippoCanvasTest.java" kind="src" path="src"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="lib" path="/usr/share/java/jna.jar" sourcepath="/src/fedora/jna/devel/jna-3.0.4-svn630.orig/src"/>
 	<classpathentry kind="lib" path="/usr/share/java/objectweb-asm/asm.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/objectweb-asm/asm-commons.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/objectweb-asm/asm-analysis.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/objectweb-asm/asm-tree.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Gtk.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/objectweb-asm/asm-util.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GdkPixbuf.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Gio.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Atk.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/HippoCanvas.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Gdk.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Vte.jar"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/java-gobject-introspection"/>
 	<classpathentry kind="lib" path="/src/build/gi/share/java/jgir.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Notify.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Gst.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/ClutterCairo.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Clutter.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/ClutterJson.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/ClutterGtk.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/cairo.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GooCanvas.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GnomeKeyring.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GConf.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Soup.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/WebKit.jar"/>
-	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GtkSource.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GdkPixbuf-2.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Gtk-2.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Atk-1.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Gio-2.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Gdk-2.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Notify-0.4.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Vte-1.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Gst-0.10.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/ClutterCairo-0.8.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Clutter-0.8.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/ClutterJson-0.8.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/ClutterGtk-0.8.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/cairo-1.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GooCanvas-0.10.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GnomeKeyring-2.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GConf-2.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/Soup-2.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/WebKit-1.0.jar"/>
+	<classpathentry kind="lib" path="/src/build/gi/share/girepository/GtkSource-2.2.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: trunk/src/org/verbum/GooCanvasTest.java
==============================================================================
--- trunk/src/org/verbum/GooCanvasTest.java	(original)
+++ trunk/src/org/verbum/GooCanvasTest.java	Sat Oct 18 21:45:55 2008
@@ -4,9 +4,9 @@
 
 import org.gnome.gir.dynamic.Gdk.Event;
 import org.gnome.gir.dynamic.GooCanvas.Canvas;
-import org.gnome.gir.dynamic.GooCanvas.Item;
-import org.gnome.gir.dynamic.GooCanvas.Rect;
-import org.gnome.gir.dynamic.GooCanvas.Text;
+import org.gnome.gir.dynamic.GooCanvas.CanvasItem;
+import org.gnome.gir.dynamic.GooCanvas.CanvasRect;
+import org.gnome.gir.dynamic.GooCanvas.CanvasText;
 import org.gnome.gir.dynamic.Gtk.AnchorType;
 import org.gnome.gir.dynamic.Gtk.GtkGlobals;
 import org.gnome.gir.dynamic.Gtk.ScrolledWindow;
@@ -43,9 +43,9 @@
 		canvas.setBounds(0.0, 0.0, 1000.0, 1000.0);
 		canvas.show();
 		scrolledWin.add(canvas);
-		final Item root = canvas.getRootItem();
+		final CanvasItem root = canvas.getRootItem();
 
-		Rect rect = new Rect(new HashMap<String,Object>() {
+		CanvasRect rect = new CanvasRect(new HashMap<String,Object>() {
 			{
 				put("parent", root);
 				put("x", 100.0);
@@ -60,7 +60,7 @@
 			}
 		});
 
-		Text text = new Text(new HashMap<String,Object>() {
+		CanvasText text = new CanvasText(new HashMap<String,Object>() {
 			{
 				put("parent", root);
 				put("text", "Hello World");
@@ -75,9 +75,9 @@
 
 		/* This handles button presses in item views. We simply output a message to
 	     the console. */
-		rect.connect(new Item.ButtonPressEvent() {
+		rect.connect(new CanvasItem.ButtonPressEvent() {
 			@Override
-			public boolean onButtonPressEvent(Item arg0, Item arg1, Event arg2) {
+			public boolean onButtonPressEvent(CanvasItem arg0, CanvasItem arg1, Event arg2) {
 			    System.out.printf("rect item received button press event%n");
 				return true;
 			}

Modified: trunk/src/org/verbum/GtkSourceViewTest.java
==============================================================================
--- trunk/src/org/verbum/GtkSourceViewTest.java	(original)
+++ trunk/src/org/verbum/GtkSourceViewTest.java	Sat Oct 18 21:45:55 2008
@@ -6,11 +6,11 @@
 import org.gnome.gir.dynamic.Gtk.Widget;
 import org.gnome.gir.dynamic.Gtk.Window;
 import org.gnome.gir.dynamic.Gtk.WindowType;
-import org.gnome.gir.dynamic.GtkSource.Buffer;
 import org.gnome.gir.dynamic.GtkSource.GtkSourceGlobals;
-import org.gnome.gir.dynamic.GtkSource.Language;
-import org.gnome.gir.dynamic.GtkSource.LanguageManager;
-import org.gnome.gir.dynamic.GtkSource.View;
+import org.gnome.gir.dynamic.GtkSource.SourceBuffer;
+import org.gnome.gir.dynamic.GtkSource.SourceLanguage;
+import org.gnome.gir.dynamic.GtkSource.SourceLanguageManager;
+import org.gnome.gir.dynamic.GtkSource.SourceView;
 
 public class GtkSourceViewTest {
 	public static void main(String[] args) {
@@ -21,13 +21,13 @@
 		w.add(sw);
 		
 		/* The GtkSourceView specific bits */
-		Buffer buffer = new Buffer();
-		LanguageManager mgr = GtkSourceGlobals.languageManagerGetDefault();
-		Language lang = mgr.getLanguage("python");
+		SourceBuffer buffer = new SourceBuffer();
+		SourceLanguageManager mgr = GtkSourceGlobals.languageManagerGetDefault();
+		SourceLanguage lang = mgr.getLanguage("python");
 		assert lang != null;
 		buffer.setLanguage(lang);
 		buffer.setHighlightSyntax(true);
-		View view = new View(buffer);
+		SourceView view = new SourceView(buffer);
 		view.setShowLineNumbers(true);
 		sw.add(view);
 		

Modified: trunk/src/org/verbum/GtkTest.java
==============================================================================
--- trunk/src/org/verbum/GtkTest.java	(original)
+++ trunk/src/org/verbum/GtkTest.java	Sat Oct 18 21:45:55 2008
@@ -12,6 +12,7 @@
 import org.gnome.gir.dynamic.Gtk.Window;
 import org.gnome.gir.dynamic.Gtk.WindowType;
 import org.gnome.gir.gobject.GErrorException;
+import org.gnome.gir.gobject.GObject;
 
 public class GtkTest {
 
@@ -23,9 +24,10 @@
 		Label l = new Label("hello world");
 		box.packStart(l, false, false, 0);
 		TextView tv = new TextView();
-		final TextBuffer buf = tv.getBuffer();
+		final TextBuffer buf = (TextBuffer) ((GObject)tv).get("buffer");
 		buf.insertAtCursor("hello world!", -1);
 		box.add(tv);
+		System.out.printf("buf: %s%n", tv.getCanDefault());
 		w.setDefaultSize(640, 480);
 		w.connect(new Widget.DeleteEvent() {
 			@Override

Modified: trunk/src/org/verbum/VteTest.java
==============================================================================
--- trunk/src/org/verbum/VteTest.java	(original)
+++ trunk/src/org/verbum/VteTest.java	Sat Oct 18 21:45:55 2008
@@ -20,6 +20,14 @@
         term.setMouseAutohide(true);
 		w.add(term);
 		
+		term.forkCommand("top", new String[] { "top", }, 
+				null, "/", false, false, false);
+		term.connect(new Terminal.ChildExited() {
+			@Override
+			public void onChildExited(Terminal arg0) {
+				System.err.printf("Child exited%n");
+			}
+		});
 		//term.forkCommand(arg0, arg1, arg2, arg3, arg4, arg5, arg6)
 		
 		/* GTK+ boilerplate */



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