gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob include/vob/os/Os.hxx org/nongnu/libvob/...


From: Asko Soukka
Subject: [Gzz-commits] libvob include/vob/os/Os.hxx org/nongnu/libvob/...
Date: Fri, 09 May 2003 06:55:38 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Asko Soukka <address@hidden>    03/05/09 06:55:38

Modified files:
        include/vob/os : Os.hxx 
        org/nongnu/libvob: GraphicsAPI.java 
        org/nongnu/libvob/gl: GL.java 
        org/nongnu/libvob/impl/gl: GLAPI.java GLScreen.java 
        org/nongnu/libvob/impl/awt: AWTScreen.java 
        src/jni        : Main.cxx 
        src/os         : Os-GLX.cxx 

Log message:
        I suppose thes go now to a new branch

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/os/Os.hxx.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/GraphicsAPI.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/gl/GL.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/impl/gl/GLAPI.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/impl/gl/GLScreen.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/impl/awt/AWTScreen.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Main.cxx.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/os/Os-GLX.cxx.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: libvob/include/vob/os/Os.hxx
diff -u libvob/include/vob/os/Os.hxx:1.3 libvob/include/vob/os/Os.hxx:1.4
--- libvob/include/vob/os/Os.hxx:1.3    Wed Mar 12 08:37:57 2003
+++ libvob/include/vob/os/Os.hxx        Fri May  9 06:55:37 2003
@@ -86,6 +86,7 @@
 
        virtual void resize(int w, int h) = 0;
        virtual void move(int x, int y) = 0;
+       virtual void setCursor(int shape) = 0;
 
        /** Call EventHandler->timeout at least X milliseconds 
         * from now.
Index: libvob/org/nongnu/libvob/GraphicsAPI.java
diff -u libvob/org/nongnu/libvob/GraphicsAPI.java:1.4 
libvob/org/nongnu/libvob/GraphicsAPI.java:1.5
--- libvob/org/nongnu/libvob/GraphicsAPI.java:1.4       Sun Mar 30 11:19:57 2003
+++ libvob/org/nongnu/libvob/GraphicsAPI.java   Fri May  9 06:55:37 2003
@@ -44,6 +44,24 @@
     private static GraphicsAPI gfxapi = null;
     private static String type;
 
+    /** Available mouse cursor, set after AWT by default, must
+     * be overwritten in GL. 
+     */
+    public static int CROSSHAIR_CURSOR = Cursor.CROSSHAIR_CURSOR;
+    public static int DEFAULT_CURSOR = Cursor.DEFAULT_CURSOR;
+    public static int E_RESIZE_CURSOR = Cursor.E_RESIZE_CURSOR;
+    public static int HAND_CURSOR = Cursor.HAND_CURSOR;
+    public static int MOVE_CURSOR = Cursor.MOVE_CURSOR;
+    public static int N_RESIZE_CURSOR = Cursor.N_RESIZE_CURSOR;
+    public static int NE_RESIZE_CURSOR = Cursor.NE_RESIZE_CURSOR;
+    public static int NW_RESIZE_CURSOR = Cursor.NW_RESIZE_CURSOR;
+    public static int S_RESIZE_CURSOR = Cursor.S_RESIZE_CURSOR;
+    public static int SE_RESIZE_CURSOR = Cursor.SE_RESIZE_CURSOR;
+    public static int SW_RESIZE_CURSOR = Cursor.SW_RESIZE_CURSOR;
+    public static int TEXT_CURSOR = Cursor.TEXT_CURSOR;
+    public static int W_RESIZE_CURSOR = Cursor.W_RESIZE_CURSOR;
+    public static int WAIT_CURSOR = Cursor.WAIT_CURSOR;
+
     static private void init() {
        String cl = System.getProperty("vob.api");
        if(cl == null || cl.equals("awt")) {
@@ -135,6 +153,9 @@
         */
        void setLocation(int x, int y, int w, int h) ;
 
+       /** Sets the mouse cursors shape.
+        */
+       void setCursor(int shape);
 
        /** Set the event handler for the window.
         */
Index: libvob/org/nongnu/libvob/gl/GL.java
diff -u libvob/org/nongnu/libvob/gl/GL.java:1.11 
libvob/org/nongnu/libvob/gl/GL.java:1.12
--- libvob/org/nongnu/libvob/gl/GL.java:1.11    Tue Apr 15 09:54:20 2003
+++ libvob/org/nongnu/libvob/gl/GL.java Fri May  9 06:55:38 2003
@@ -309,6 +309,9 @@
        /** Resize the window.
         */
        public void resize(int w, int h) { impl_Window_resize(getId(), w, h); }
+       /** Changes mouse cursor on the window.
+        */
+       public void setCursor(int shape) { impl_Window_setCursor(getId(), 
shape); }
     }
     final private static Window defaultWindow = new Window(-1);
 
@@ -327,6 +330,7 @@
     static private native void impl_Window_setCurrent(int id);
     static private native void impl_Window_release(int id);
     static private native void impl_Window_move(int id, int x, int y);
+    static private native void impl_Window_setCursor(int id, int shape);
     static private native void impl_Window_resize(int id, int w, int h);
 
 //--------- Image
Index: libvob/org/nongnu/libvob/impl/awt/AWTScreen.java
diff -u libvob/org/nongnu/libvob/impl/awt/AWTScreen.java:1.6 
libvob/org/nongnu/libvob/impl/awt/AWTScreen.java:1.7
--- libvob/org/nongnu/libvob/impl/awt/AWTScreen.java:1.6        Thu Mar 27 
07:04:37 2003
+++ libvob/org/nongnu/libvob/impl/awt/AWTScreen.java    Fri May  9 06:55:38 2003
@@ -37,7 +37,7 @@
 public abstract class AWTScreen
        extends GraphicsAPI.AbstractWindow
        implements MouseListener, MouseMotionListener, 
JUpdateManager.EventProcessor {
-    public static final String rcsid = "$Id: AWTScreen.java,v 1.6 2003/03/27 
12:04:37 benja Exp $";
+    public static final String rcsid = "$Id: AWTScreen.java,v 1.7 2003/05/09 
10:55:38 humppake Exp $";
 
     public static boolean dbg = false;
     private static void pa(String s) { System.out.println(s); }
@@ -50,6 +50,10 @@
 
     // XXX Should use VolatileImage in new JDKs?
     Image cache;
+
+    public void setCursor(int shape) {
+       canvas.setCursor(new Cursor(shape));
+    }
 
     public VobScene createVobScene(Dimension size) {
        return new VobScene(
Index: libvob/org/nongnu/libvob/impl/gl/GLAPI.java
diff -u libvob/org/nongnu/libvob/impl/gl/GLAPI.java:1.2 
libvob/org/nongnu/libvob/impl/gl/GLAPI.java:1.3
--- libvob/org/nongnu/libvob/impl/gl/GLAPI.java:1.2     Fri Mar  7 06:38:22 2003
+++ libvob/org/nongnu/libvob/impl/gl/GLAPI.java Fri May  9 06:55:38 2003
@@ -37,6 +37,24 @@
 /** Java.awt.Graphics implementation of GraphicsAPI
  */
 public class GLAPI extends GraphicsAPI {
+    /** Available mouse cursor
+     * After Xlib: http://tronche.com/gui/x/xlib/appendix/b/
+     */
+    public static int CROSSHAIR_CURSOR = 130; // XC_tcross
+    public static int DEFAULT_CURSOR = 68; // XC_left_ptr
+    public static int E_RESIZE_CURSOR = 98; // XC_righside
+    public static int HAND_CURSOR = 60; // XC_hand2
+    public static int MOVE_CURSOR = 52; // XC_fleur
+    public static int N_RESIZE_CURSOR = 138; // XC_top_side
+    public static int NE_RESIZE_CURSOR = 136; // XC_top_right_corner
+    public static int NW_RESIZE_CURSOR = 134; // XC_top_left_corner
+    public static int S_RESIZE_CURSOR = 16; // XC_bottom_side
+    public static int SE_RESIZE_CURSOR = 14; // XC_bottom_right_corner
+    public static int SW_RESIZE_CURSOR = 12; // XC_bottom_left_corner
+    public static int TEXT_CURSOR = 152; // XC_xterm
+    public static int W_RESIZE_CURSOR = 70; // XC_left_side
+    public static int WAIT_CURSOR = 150; // XC_watch
+
     public void startUpdateManager(final Runnable r) {
        GLUpdateManager.startGLUpdateManager(
                new Runnable() {
Index: libvob/org/nongnu/libvob/impl/gl/GLScreen.java
diff -u libvob/org/nongnu/libvob/impl/gl/GLScreen.java:1.2 
libvob/org/nongnu/libvob/impl/gl/GLScreen.java:1.3
--- libvob/org/nongnu/libvob/impl/gl/GLScreen.java:1.2  Fri Mar  7 06:38:22 2003
+++ libvob/org/nongnu/libvob/impl/gl/GLScreen.java      Fri May  9 06:55:38 2003
@@ -35,14 +35,14 @@
 import org.nongnu.libvob.gl.*;
 
 public class GLScreen extends GLRenderingSurface implements GraphicsAPI.Window 
{
-public static final String rcsid = "$Id: GLScreen.java,v 1.2 2003/03/07 
11:38:22 tjl Exp $";
+public static final String rcsid = "$Id: GLScreen.java,v 1.3 2003/05/09 
10:55:38 humppake Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.err.println(s); }
 
     java.awt.Canvas fakeSource = new java.awt.Canvas();
 
     HashMap timeouts = new HashMap();
-
+   
     static int mapButton(int button) {
        switch(button) {
            case 1 : return InputEvent.BUTTON1_MASK;
@@ -184,6 +184,11 @@
     public GLScreen(GraphicsAPI api) {
        super(api, 0, 0, 200, 200);
        if(dbg) pa("Created glscreen");
+    }
+
+
+    public void setCursor(int shape) {
+       window.setCursor(shape);
     }
 
 
Index: libvob/src/jni/Main.cxx
diff -u libvob/src/jni/Main.cxx:1.12 libvob/src/jni/Main.cxx:1.13
--- libvob/src/jni/Main.cxx:1.12        Tue Mar 25 07:04:10 2003
+++ libvob/src/jni/Main.cxx     Fri May  9 06:55:38 2003
@@ -364,6 +364,13 @@
       w->move(x,y);
 }
 
+jf(void, impl_1Window_1setCursor)
+  (JNIEnv *env, jclass, jint id, jint shape) {
+      Os::Window *w = (Os::Window *)windows.get(id);
+      DBG(dbg) << "Set window "<<id<<" Cursor shape "<<shape<<" at 
"<<(int)w<<"\n";
+      w->setCursor(shape);
+}
+
 jf(void, impl_1Window_1resize)
   (JNIEnv *env, jclass, jint id, jint wid, jint h) {
       Os::Window *w = (Os::Window *)windows.get(id);
Index: libvob/src/os/Os-GLX.cxx
diff -u libvob/src/os/Os-GLX.cxx:1.3 libvob/src/os/Os-GLX.cxx:1.4
--- libvob/src/os/Os-GLX.cxx:1.3        Wed Apr  9 10:09:26 2003
+++ libvob/src/os/Os-GLX.cxx    Fri May  9 06:55:38 2003
@@ -41,6 +41,9 @@
 #include <GL/glx.h>
 #include <X11/keysym.h>
 
+//#include <X11/cursorfont.h>
+#include <X11/Xlib.h>
+
 #include <vob/os/Os.hxx>
 #include <vob/Debug.hxx>
 
@@ -488,6 +491,9 @@
        virtual void resize(int w, int h) {
            XResizeWindow(ws->dpy, xw, w, h);
        }
+        virtual void setCursor(int shape) {
+           XDefineCursor(ws->dpy, xw, XCreateFontCursor(ws->dpy, shape));
+        } 
        void getSize(int *xywh) {
            // cout << "GetGeometry "<<int(ws)<<" "<<int(ws->dpy)<<" 
"<<int(xw)<<"\n";
            XWindowAttributes attrs;
@@ -602,6 +608,8 @@
        }
     };
 
+ 
+
     Os::Window *LXWindowSystem::openWindow(int x, int y, int w, int h) {
        LXWindow *win = new LXWindow(this, x, y, w, h);
        windows.insert(windows.end(), win);
@@ -634,7 +642,6 @@
     void LXWindowSystem::interrupt() {
        write(interruptPipe[1], &intr, 1);
     }
-
 
     void LXWindowSystem::eventLoop(bool wait) {
        DBG(dbg) << "In C++ eventloop : "<<wait<<"\n";




reply via email to

[Prev in Thread] Current Thread [Next in Thread]