gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob/doc/pegboard/cursors--humppake peg.rst


From: Asko Soukka
Subject: [Gzz-commits] libvob/doc/pegboard/cursors--humppake peg.rst
Date: Fri, 09 May 2003 09:12:16 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Asko Soukka <address@hidden>    03/05/09 09:12:16

Modified files:
        doc/pegboard/cursors--humppake: peg.rst 

Log message:
        another update

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/doc/pegboard/cursors--humppake/peg.rst.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: libvob/doc/pegboard/cursors--humppake/peg.rst
diff -u libvob/doc/pegboard/cursors--humppake/peg.rst:1.4 
libvob/doc/pegboard/cursors--humppake/peg.rst:1.5
--- libvob/doc/pegboard/cursors--humppake/peg.rst:1.4   Fri May  9 07:56:28 2003
+++ libvob/doc/pegboard/cursors--humppake/peg.rst       Fri May  9 09:12:16 2003
@@ -4,8 +4,8 @@
 
 :Authors:  Asko Soukka
 :Date-Created: 2003-05-09
-:Last-Modified: $Date: 2003/05/09 11:56:28 $
-:Revision: $Revision: 1.4 $
+:Last-Modified: $Date: 2003/05/09 13:12:16 $
+:Revision: $Revision: 1.5 $
 :Status:   Current
 :Scope:    Trivial
 :Type:     Feature, Interface, Implementation
@@ -98,7 +98,7 @@
 
 Into ``org.nongnu.libvob.GraphicsAPI.Window``::
 
-    /** Sets the mouse cursors shape.
+    /** Set the mouse cursor for the window.
      */
     void setCursor(Cursor cursor);
 
@@ -108,20 +108,40 @@
        canvas.setCursor(cursor);
     }
 
-Into ``org.nongnu.libvob.GL``::
+Into ``org.nongnu.libvob.gl.GL``::
 
-    static private native void impl_Window_setCursor(int id, int shape);
+    static private native void impl_Window_setCursor(int id, String shape);
 
-Into ``org.nongnu.libvob.GL.Window``::
+Into ``org.nongnu.libvob.gl.GL.Window``::
 
-    /** Changes mouse cursor on the window.
+    /** Set the mouse cursor of the window.
      */
-    public void setCursor(int shape) { impl_Window_setCursor(getId(), shape); }
+    public void setCursor(String shape) { impl_Window_setCursor(getId(), 
shape); }
 
 Into ``org.nongnu.libvob.impl.GL.GLScreen``::
 
     public void setCursor(Cursor cursor) {
         switch cursor {
+       case Cursor.CROSSHAIR_CURSOR: window.setCursor("CROSSHAIR_CURSOR"); 
break;
+       case Cursor.DEFAULT_CURSOR: window.setCursor("DEFAULT_CURSOR"); break;
+       case Cursor.E_RESIZE_CURSOR: window.setCursor("E_RESIZE_CURSOR"); break;
+       case Cursor.HAND_CURSOR: window.setCursor("HAND_CURSOR"); break;
+       case Cursor.MOVE_CURSOR: window.setCursor("MOVE_CURSOR"); break;
+       case Cursor.N_RESIZE_CURSOR: window.setCursor("N_RESIZE_CURSOR"); break;
+       case Cursor.NE_RESIZE_CURSOR: window.setCursor("NE_RESIZE_CURSOR"); 
break;
+       case Cursor.NW_RESIZE_CURSOR: window.setCursor("NW_RESIZE_CURSOR"); 
break;
+       case Cursor.S_RESIZE_CURSOR: window.setCursor("S_RESIZE_CURSOR"); break;
+       case Cursor.SE_RESIZE_CURSOR: window.setCursor("SE_RESIZE_CURSOR"); 
break;
+       case Cursor.SW_RESIZE_CURSOR: window.setCursor("SW_RESIZE_CURSOR"); 
break;
+       case Cursor.TEXT_CURSOR: window.setCursor("TEXT_CURSOR"); break;
+       case Cursor.W_RESIZE_CURSOR: window.setCursor("W_RESIZE_CURSOR"); break;
+       case Cursor.WAIT_CURSOR: window.setCursor("WAIT_CURSOR"); break;
+       case Cursor.CUSTOM_CURSOR: window.setCursor("CUSTOM_CURSOR"); break;
+        }
+    }
+
+    public void setCursor(Cursor cursor) {
+        switch cursor {
            case Cursor.CROSSHAIR_CURSOR: window.setCursor(130); break;  // 
XC_tcross
            case Cursor.DEFAULT_CURSOR: window.setCursor(68); break; // 
XC_left_ptr
             case Cursor.E_RESIZE_CURSOR: window.setCursor(98); break; // 
XC_righside
@@ -144,15 +164,18 @@
 
 Into ``include/vob/os/Os.cxx Vob.Os.Window``::
 
-    virtual void setCursor(int shape) = 0;
+    virtual void setCursor(const std::string shape) = 0;
 
 Into ``src/jni/Main.cxx``::
 
     jf(void, impl_1Window_1setCursor)
-    (JNIEnv *env, jclass, jint id, jint shape) {
+    (JNIEnv *env, jclass, jint id, jstring shape) {
           Os::Window *w = (Os::Window *)windows.get(id);
           DBG(dbg) << "Set window "<<id<<" Cursor shape "<<shape<<" at 
"<<(int)w<<"\n";
-          w->setCursor(shape);
+          std::string shape_str = jstr2stdstr(env, shape);
+         std::transform(shape_str.begin(), shape_strend(),
+                       shape_str.begin(), std::toupper);
+          w->setCursor(shape_str);
     }
 
 Into ``src/os/Os-GLX.cxx``::
@@ -161,8 +184,37 @@
 
 Into ``src/os/Os-GLX.cxx Vob.Os.LXWindow``::
 
-    virtual void setCursor(int shape) {
-       XDefineCursor(ws->dpy, xw, XCreateFontCursor(ws->dpy, shape));
-    }
+    virtual void setCursor(const std::string shape) {
+    Cursor cursor = NULL;
+       if (shape == "CROSSHAIR_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_crosshair);
+       else if (shape == "DEFAULT_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_left_ptr);
+       else if (shape == "E_RESIZE_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_right_side);
+       else if (shape == "HAND_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_hand2);
+       else if (shape == "MOVE_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_fleur);
+       else if (shape == "N_RESIZE_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_top_side);
+       else if (shape == "NE_RESIZE_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_top_right_corner);
+       else if (shape == "NW_RESIZE_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_top_left_corner);
+       else if (shape == "S_RESIZE_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_bottom_side);
+       else if (shape == "SE_RESIZE_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_bottom_right_corner);
+       else if (shape == "SW_RESIZE_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_bottom_left_corner);
+       else if (shape == "TEXT_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_xterm);
+       else if (shape == "W_RESIZE_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_left_side);
+        else if (shape == "WAIT_CURSOR")
+         cursor = XCreateFontCursor(ws->dpy, XC_watch);
+       if (cursor != NULL) XDefineCursor(ws->dpy, xw, cursor);
+    } 
  
 




reply via email to

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