java-gobject-introspection-examples r13 - trunk/src/org/verbum



Author: walters
Date: Sat Dec 20 03:42:13 2008
New Revision: 13
URL: http://svn.gnome.org/viewvc/java-gobject-introspection-examples?rev=13&view=rev

Log:
Adjust for new package names

Modified:
   trunk/src/org/verbum/GConfTest.java
   trunk/src/org/verbum/GStreamerTest.java
   trunk/src/org/verbum/GooCanvasTest.java
   trunk/src/org/verbum/GtkSourceViewTest.java
   trunk/src/org/verbum/GtkTest.java
   trunk/src/org/verbum/GvfsMonitorTest.java
   trunk/src/org/verbum/HelloClutter.java
   trunk/src/org/verbum/NotifyTest.java
   trunk/src/org/verbum/RecentTest.java
   trunk/src/org/verbum/VteTest.java
   trunk/src/org/verbum/WebKitTest.java

Modified: trunk/src/org/verbum/GConfTest.java
==============================================================================
--- trunk/src/org/verbum/GConfTest.java	(original)
+++ trunk/src/org/verbum/GConfTest.java	Sat Dec 20 03:42:13 2008
@@ -1,17 +1,17 @@
 package org.verbum;
 
-import org.gnome.gir.dynamic.GConf.Client;
-import org.gnome.gir.dynamic.GConf.ClientNotifyFunc;
-import org.gnome.gir.dynamic.GConf.ClientPreloadType;
-import org.gnome.gir.dynamic.GConf.Entry;
-import org.gnome.gir.dynamic.GConf.GConfGlobals;
-import org.gnome.gir.dynamic.Gdk.Event;
-import org.gnome.gir.dynamic.Gtk.GtkGlobals;
-import org.gnome.gir.dynamic.Gtk.Label;
-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.gobject.GErrorException;
+import gobject.introspection.GConf.Client;
+import gobject.introspection.GConf.ClientNotifyFunc;
+import gobject.introspection.GConf.ClientPreloadType;
+import gobject.introspection.GConf.Entry;
+import gobject.introspection.GConf.GConfGlobals;
+import gobject.introspection.Gdk.Event;
+import gobject.introspection.Gtk.GtkGlobals;
+import gobject.introspection.Gtk.Label;
+import gobject.introspection.Gtk.Widget;
+import gobject.introspection.Gtk.Window;
+import gobject.introspection.Gtk.WindowType;
+import gobject.runtime.GErrorException;
 
 public class GConfTest {
 	

Modified: trunk/src/org/verbum/GStreamerTest.java
==============================================================================
--- trunk/src/org/verbum/GStreamerTest.java	(original)
+++ trunk/src/org/verbum/GStreamerTest.java	Sat Dec 20 03:42:13 2008
@@ -1,17 +1,17 @@
 package org.verbum;
 
-import org.gnome.gir.dynamic.Gst.Bus;
-import org.gnome.gir.dynamic.Gst.BusFunc;
-import org.gnome.gir.dynamic.Gst.Element;
-import org.gnome.gir.dynamic.Gst.ElementFactory;
-import org.gnome.gir.dynamic.Gst.GstGlobals;
-import org.gnome.gir.dynamic.Gst.Message;
-import org.gnome.gir.dynamic.Gst.MessageType;
-import org.gnome.gir.dynamic.Gst.Pad;
-import org.gnome.gir.dynamic.Gst.Pipeline;
-import org.gnome.gir.dynamic.Gst.State;
-import org.gnome.gir.dynamic.Gst.Element.PadAdded;
-import org.gnome.gir.gobject.MainLoop;
+import gobject.introspection.Gst.Bus;
+import gobject.introspection.Gst.BusFunc;
+import gobject.introspection.Gst.Element;
+import gobject.introspection.Gst.ElementFactory;
+import gobject.introspection.Gst.GstGlobals;
+import gobject.introspection.Gst.Message;
+import gobject.introspection.Gst.MessageType;
+import gobject.introspection.Gst.Pad;
+import gobject.introspection.Gst.Pipeline;
+import gobject.introspection.Gst.State;
+import gobject.introspection.Gst.Element.PadAdded;
+import org.gnome.gir.runtime.MainLoop;
 
 public class GStreamerTest {
 	
@@ -50,14 +50,14 @@
 		  bus.addWatch(new BusFunc() {
 			@Override
 			public boolean callback(Bus arg0, Message msg) {
-				if (msg.type == MessageType.EOS) {
+				if (msg.type.contains(MessageType.EOS)) {
 					System.out.println("End of stream");
 					loop.quit();
-				} else if (msg.type == MessageType.ERROR) {
+				} else if (msg.type.contains(MessageType.ERROR)) {
 					System.err.println("error!");
 					
 					loop.quit();
-				} else if (msg.type == MessageType.STATE_CHANGED) {
+				} else if (msg.type.contains(MessageType.STATE_CHANGED)) {
 					
 				} else {
 					System.err.printf("Got Message type: %d%n", msg.type);					

Modified: trunk/src/org/verbum/GooCanvasTest.java
==============================================================================
--- trunk/src/org/verbum/GooCanvasTest.java	(original)
+++ trunk/src/org/verbum/GooCanvasTest.java	Sat Dec 20 03:42:13 2008
@@ -2,18 +2,18 @@
 
 import java.util.HashMap;
 
-import org.gnome.gir.dynamic.Gdk.Event;
-import org.gnome.gir.dynamic.GooCanvas.Canvas;
-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;
-import org.gnome.gir.dynamic.Gtk.ShadowType;
-import org.gnome.gir.dynamic.Gtk.Widget;
-import org.gnome.gir.dynamic.Gtk.Window;
-import org.gnome.gir.dynamic.Gtk.WindowType;
+import gobject.introspection.Gdk.Event;
+import gobject.introspection.GooCanvas.Canvas;
+import gobject.introspection.GooCanvas.CanvasItem;
+import gobject.introspection.GooCanvas.CanvasRect;
+import gobject.introspection.GooCanvas.CanvasText;
+import gobject.introspection.Gtk.AnchorType;
+import gobject.introspection.Gtk.GtkGlobals;
+import gobject.introspection.Gtk.ScrolledWindow;
+import gobject.introspection.Gtk.ShadowType;
+import gobject.introspection.Gtk.Widget;
+import gobject.introspection.Gtk.Window;
+import gobject.introspection.Gtk.WindowType;
 
 public class GooCanvasTest {
 

Modified: trunk/src/org/verbum/GtkSourceViewTest.java
==============================================================================
--- trunk/src/org/verbum/GtkSourceViewTest.java	(original)
+++ trunk/src/org/verbum/GtkSourceViewTest.java	Sat Dec 20 03:42:13 2008
@@ -1,16 +1,16 @@
 package org.verbum;
 
-import org.gnome.gir.dynamic.Gdk.Event;
-import org.gnome.gir.dynamic.Gtk.GtkGlobals;
-import org.gnome.gir.dynamic.Gtk.ScrolledWindow;
-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.GtkSourceGlobals;
-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;
+import gobject.introspection.Gdk.Event;
+import gobject.introspection.Gtk.GtkGlobals;
+import gobject.introspection.Gtk.ScrolledWindow;
+import gobject.introspection.Gtk.Widget;
+import gobject.introspection.Gtk.Window;
+import gobject.introspection.Gtk.WindowType;
+import gobject.introspection.GtkSource.GtkSourceGlobals;
+import gobject.introspection.GtkSource.SourceBuffer;
+import gobject.introspection.GtkSource.SourceLanguage;
+import gobject.introspection.GtkSource.SourceLanguageManager;
+import gobject.introspection.GtkSource.SourceView;
 
 public class GtkSourceViewTest {
 	public static void main(String[] args) {

Modified: trunk/src/org/verbum/GtkTest.java
==============================================================================
--- trunk/src/org/verbum/GtkTest.java	(original)
+++ trunk/src/org/verbum/GtkTest.java	Sat Dec 20 03:42:13 2008
@@ -2,23 +2,20 @@
 
 import java.util.concurrent.TimeUnit;
 
-import org.gnome.gir.dynamic.Gdk.Event;
-import org.gnome.gir.dynamic.Gdk.EventAny;
-import org.gnome.gir.dynamic.GdkPixbuf.GdkPixbufGlobals;
-import org.gnome.gir.dynamic.GdkPixbuf.Pixbuf;
-import org.gnome.gir.dynamic.GdkPixbuf.PixbufLoader;
-import org.gnome.gir.dynamic.Gtk.GtkGlobals;
-import org.gnome.gir.dynamic.Gtk.Label;
-import org.gnome.gir.dynamic.Gtk.TextBuffer;
-import org.gnome.gir.dynamic.Gtk.TextIter;
-import org.gnome.gir.dynamic.Gtk.TextView;
-import org.gnome.gir.dynamic.Gtk.VBox;
-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.gobject.GErrorException;
-import org.gnome.gir.gobject.GObject;
-import org.gnome.gir.gobject.MainLoop;
+import gobject.introspection.Gdk.Event;
+import gobject.introspection.Gdk.EventAny;
+import gobject.introspection.Gtk.GtkGlobals;
+import gobject.introspection.Gtk.Label;
+import gobject.introspection.Gtk.TextBuffer;
+import gobject.introspection.Gtk.TextIter;
+import gobject.introspection.Gtk.TextView;
+import gobject.introspection.Gtk.VBox;
+import gobject.introspection.Gtk.Widget;
+import gobject.introspection.Gtk.Window;
+import gobject.introspection.Gtk.WindowType;
+import gobject.runtime.GErrorException;
+import gobject.runtime.GObject;
+import gobject.runtime.MainLoop;
 
 public class GtkTest {
 

Modified: trunk/src/org/verbum/GvfsMonitorTest.java
==============================================================================
--- trunk/src/org/verbum/GvfsMonitorTest.java	(original)
+++ trunk/src/org/verbum/GvfsMonitorTest.java	Sat Dec 20 03:42:13 2008
@@ -1,28 +1,24 @@
 package org.verbum;
 
+import gobject.introspection.Gio.File;
+import gobject.introspection.Gio.FileIcon;
+import gobject.introspection.Gio.FileMonitor;
+import gobject.introspection.Gio.FileMonitorEvent;
+import gobject.introspection.Gio.FileMonitorFlags;
+import gobject.introspection.Gio.GioGlobals;
+import gobject.runtime.GErrorException;
+import gobject.runtime.MainLoop;
+
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
-import org.gnome.gir.dynamic.Gio.File;
-import org.gnome.gir.dynamic.Gio.FileIcon;
-import org.gnome.gir.dynamic.Gio.FileMonitor;
-import org.gnome.gir.dynamic.Gio.FileMonitorEvent;
-import org.gnome.gir.dynamic.Gio.FileMonitorFlags;
-import org.gnome.gir.dynamic.Gio.GioGlobals;
-import org.gnome.gir.dynamic.Gio.LoadableIcon;
-import org.gnome.gir.gobject.GErrorException;
-import org.gnome.gir.gobject.GObjectGlobals;
-import org.gnome.gir.gobject.MainLoop;
-
 public class GvfsMonitorTest {
 	
-	public static void main(final String...args) throws IOException, GErrorException {
-		GObjectGlobals.init();
-		
-		java.io.File tmp = java.io.File.createTempFile("gvfstest", "test");
+	public static void main(final String...args) throws IOException {
+		final java.io.File tmp = java.io.File.createTempFile("gvfstest", "test");
 		
 		File f = GioGlobals.fileNewForPath(tmp.toString());
-		FileMonitor fm = f.monitorFile((int) FileMonitorFlags.WATCH_MOUNTS, null);
+		FileMonitor fm = f.monitorFile(new FileMonitorFlags(FileMonitorFlags.WATCH_MOUNTS), null);
 		System.err.printf("Returned File stub: %s%n", f);
 
 		fm.connect(new FileMonitor.Changed() {
@@ -59,21 +55,22 @@
 		});
 
 		FileIcon icon = new FileIcon(GioGlobals.fileNewForPath("doesnotexist"));
-		icon.load(24, null, null);
+		try {
+			System.err.println("Expecting error...");
+			icon.load(24, null, null);
+			System.err.println("unexpected success!");
+		} catch (GErrorException e) {
+			e.printStackTrace();
+			System.err.println("...ok");
+		}
 		
-		/*
-		MainLoop.getDefault().invokeLater(5, TimeUnit.SECONDS, new Runnable() {
+		MainLoop.getDefault().invokeLater(3, TimeUnit.SECONDS, new Runnable() {
 			@Override
 			public void run() {
-				java.io.File tmp = new java.io.File(args[0], "tmp");
-				try {
-					tmp.createNewFile();
-				} catch (IOException e) {
-					throw new RuntimeException(e);
-				}
+				System.err.println("Deleting tmp, expecting notification:");
 				tmp.delete();
 			}
-		}); */
+		});
 		
 		new MainLoop().run();
 	}

Modified: trunk/src/org/verbum/HelloClutter.java
==============================================================================
--- trunk/src/org/verbum/HelloClutter.java	(original)
+++ trunk/src/org/verbum/HelloClutter.java	Sat Dec 20 03:42:13 2008
@@ -1,12 +1,12 @@
 package org.verbum;
 
-import org.gnome.gir.dynamic.Clutter.ClutterGlobals;
-import org.gnome.gir.dynamic.Clutter.Color;
-import org.gnome.gir.dynamic.Clutter.Entry;
-import org.gnome.gir.dynamic.Clutter.Rectangle;
-import org.gnome.gir.dynamic.Clutter.RotateAxis;
-import org.gnome.gir.dynamic.Clutter.Stage;
-import org.gnome.gir.dynamic.Clutter.Timeline;
+import gobject.introspection.Clutter.ClutterGlobals;
+import gobject.introspection.Clutter.Color;
+import gobject.introspection.Clutter.Rectangle;
+import gobject.introspection.Clutter.RotateAxis;
+import gobject.introspection.Clutter.Stage;
+import gobject.introspection.Clutter.Timeline;
+
 import org.gnome.gir.gobject.GObjectGlobals;
 
 public class HelloClutter {

Modified: trunk/src/org/verbum/NotifyTest.java
==============================================================================
--- trunk/src/org/verbum/NotifyTest.java	(original)
+++ trunk/src/org/verbum/NotifyTest.java	Sat Dec 20 03:42:13 2008
@@ -1,12 +1,12 @@
 package org.verbum;
 
-import org.gnome.gir.dynamic.Gtk.Widget;
-import org.gnome.gir.dynamic.Notify.ActionCallback;
-import org.gnome.gir.dynamic.Notify.Notification;
-import org.gnome.gir.dynamic.Notify.NotifyGlobals;
-import org.gnome.gir.dynamic.Notify.Notification.Closed;
-import org.gnome.gir.gobject.GErrorException;
-import org.gnome.gir.gobject.MainLoop;
+import gobject.introspection.Gtk.Widget;
+import gobject.introspection.Notify.ActionCallback;
+import gobject.introspection.Notify.Notification;
+import gobject.introspection.Notify.NotifyGlobals;
+import gobject.introspection.Notify.Notification.Closed;
+import gobject.runtime.GErrorException;
+import gobject.runtime.MainLoop;
 
 import com.sun.jna.Pointer;
 
@@ -15,7 +15,7 @@
 	private static final String MESSAGE = "This is a test of the emergency Java-GObject-Introspection bindings. "
 		+"This is only a test.  Do not panic.";
 	
-	public static void main(String[] args) {
+	public static void main(String[] args) throws GErrorException {
 		NotifyGlobals.init("MyApp");
 		
 		final MainLoop loop = new MainLoop();

Modified: trunk/src/org/verbum/RecentTest.java
==============================================================================
--- trunk/src/org/verbum/RecentTest.java	(original)
+++ trunk/src/org/verbum/RecentTest.java	Sat Dec 20 03:42:13 2008
@@ -1,7 +1,8 @@
 package org.verbum;
 
-import org.gnome.gir.dynamic.Gtk.GtkGlobals;
-import org.gnome.gir.dynamic.Gtk.RecentManager;
+import gobject.introspection.Gtk.GtkGlobals;
+import gobject.introspection.Gtk.RecentManager;
+
 import org.gnome.gir.gobject.GErrorException;
 
 public class RecentTest {

Modified: trunk/src/org/verbum/VteTest.java
==============================================================================
--- trunk/src/org/verbum/VteTest.java	(original)
+++ trunk/src/org/verbum/VteTest.java	Sat Dec 20 03:42:13 2008
@@ -1,11 +1,11 @@
 package org.verbum;
 
-import org.gnome.gir.dynamic.Gdk.Event;
-import org.gnome.gir.dynamic.Gtk.GtkGlobals;
-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.Vte.Terminal;
+import gobject.introspection.Gdk.Event;
+import gobject.introspection.Gtk.GtkGlobals;
+import gobject.introspection.Gtk.Widget;
+import gobject.introspection.Gtk.Window;
+import gobject.introspection.Gtk.WindowType;
+import gobject.introspection.Vte.Terminal;
 
 public class VteTest {
 	public static void main(String[] args) {

Modified: trunk/src/org/verbum/WebKitTest.java
==============================================================================
--- trunk/src/org/verbum/WebKitTest.java	(original)
+++ trunk/src/org/verbum/WebKitTest.java	Sat Dec 20 03:42:13 2008
@@ -1,10 +1,10 @@
 package org.verbum;
 
-import org.gnome.gir.dynamic.Gtk.GtkGlobals;
-import org.gnome.gir.dynamic.Gtk.ScrolledWindow;
-import org.gnome.gir.dynamic.Gtk.Window;
-import org.gnome.gir.dynamic.Gtk.WindowType;
-import org.gnome.gir.dynamic.WebKit.WebView;
+import gobject.introspection.Gtk.GtkGlobals;
+import gobject.introspection.Gtk.ScrolledWindow;
+import gobject.introspection.Gtk.Window;
+import gobject.introspection.Gtk.WindowType;
+import gobject.introspection.WebKit.WebView;
 import org.gnome.gir.gobject.GObjectGlobals;
 
 public class WebKitTest {



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