35 |
with ID of wanted cursor as a parameter. Of course setCursor() method |
with ID of wanted cursor as a parameter. Of course setCursor() method |
36 |
should be implemented separately for both AWT and GL. |
should be implemented separately for both AWT and GL. |
37 |
|
|
38 |
|
RE-RESOLVED: Calling ``org.nongnu.libvob.GraphicsAPI.Window.setCursor()`` |
39 |
|
with java.awt.Cursor as parameter. |
40 |
|
|
41 |
|
- How java.awt.Cursor is mapped to Xlib mouse cursor values? |
42 |
|
|
43 |
|
RESOLVED: Mapping is done in setCursor() method |
44 |
|
in ``org.nongnu.libvob.impl.gl.GLScreen`` using switch structure. |
45 |
|
|
46 |
- What are the mouse cursor IDs? |
- What are the mouse cursor IDs? |
47 |
|
|
48 |
RESOLVED: IDs are our own constants mapped to integer values that |
RESOLVED: IDs are our own constants mapped to integer values that |
50 |
for specific mouse cursors are different in AWT and Xlib and that's |
for specific mouse cursors are different in AWT and Xlib and that's |
51 |
why we need our own mapping for them. |
why we need our own mapping for them. |
52 |
|
|
53 |
|
RE-RESOLVED: Irrelevant. |
54 |
|
|
55 |
- Where are the mouse cursor ID mappings located? |
- Where are the mouse cursor ID mappings located? |
56 |
|
|
57 |
RESOLVED: Mouse cursor constants are described with AWT values as default |
RESOLVED: Mouse cursor constants are described with AWT values as default |
59 |
mappings must be overwritten into |
mappings must be overwritten into |
60 |
``org.nongnu.libvob.impl.gl.GLAPI``. |
``org.nongnu.libvob.impl.gl.GLAPI``. |
61 |
|
|
62 |
|
RE-RESOLVED: Irrelevant. |
63 |
|
|
64 |
- What is the available set of mouse cursors? |
- What is the available set of mouse cursors? |
65 |
|
|
66 |
RESOLVED: The set of available mouse cursors is the interserction of |
RESOLVED: The set of available mouse cursors is the intersection of |
67 |
Xlib and AWT mouse cursors sets: |
Xlib and AWT mouse cursors sets: |
68 |
|
|
69 |
- http://java.sun.com/products/jdk/1.2/docs/api/java/awt/Cursor.html |
- http://java.sun.com/products/jdk/1.2/docs/api/java/awt/Cursor.html |
70 |
- http://tronche.com/gui/x/xlib/appendix/b/ |
- http://tronche.com/gui/x/xlib/appendix/b/ |
71 |
|
|
72 |
|
RE-RESOLVED: To be more specific, all Java AWT cursors except |
73 |
|
custom cursor are available. |
74 |
|
|
75 |
- Since it's possible to call setCursor() with pure integer values, is |
- Since it's possible to call setCursor() with pure integer values, is |
76 |
it allowed to use AWT or Xlib specific cursors? |
it allowed to use AWT or Xlib specific cursors? |
77 |
|
|
78 |
RESOLVED: Yes, but with care. If the application is runnable under |
RESOLVED: Yes, but with care. If the application is runnable under |
79 |
both AWT and GL, there should be checking for proper GraphicsAPI.. |
both AWT and GL, there should be checking for proper GraphicsAPI.. |
80 |
|
|
81 |
|
|
82 |
|
RESOLVED: Irrelevant. Not possible anymore. |
83 |
|
|
84 |
- Should we use our own custom cursors? |
- Should we use our own custom cursors? |
85 |
|
|
86 |
RESOLVED: Not yet. Probably we would like to use also our own |
RESOLVED: Not yet. Probably we would like to use also our own |
96 |
Java |
Java |
97 |
---- |
---- |
98 |
|
|
|
Into ``org.nongnu.libvob.GraphicsAPI``:: |
|
|
|
|
|
/** 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; |
|
|
|
|
99 |
Into ``org.nongnu.libvob.GraphicsAPI.Window``:: |
Into ``org.nongnu.libvob.GraphicsAPI.Window``:: |
100 |
|
|
101 |
/** Sets the mouse cursors shape. |
/** Sets the mouse cursors shape. |
102 |
*/ |
*/ |
103 |
void setCursor(int shape); |
void setCursor(Cursor cursor); |
104 |
|
|
105 |
Into ``org.nongnu.libvob.impl.awt.AWTScreen``:: |
Into ``org.nongnu.libvob.impl.awt.AWTScreen``:: |
106 |
|
|
107 |
public void setCursor(int shape) { |
public void setCursor(cursor Cursor) { |
108 |
canvas.setCursor(new Cursor(shape)); |
canvas.setCursor(cursor); |
109 |
} |
} |
110 |
|
|
|
Into ``org.nongnu.libvob.impl.GL.GLAPI``:: |
|
|
|
|
|
/** 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 |
|
|
|
|
111 |
Into ``org.nongnu.libvob.GL``:: |
Into ``org.nongnu.libvob.GL``:: |
112 |
|
|
113 |
static private native void impl_Window_setCursor(int id, int shape); |
static private native void impl_Window_setCursor(int id, int shape); |
120 |
|
|
121 |
Into ``org.nongnu.libvob.impl.GL.GLScreen``:: |
Into ``org.nongnu.libvob.impl.GL.GLScreen``:: |
122 |
|
|
123 |
public void setCursor(int shape) { |
public void setCursor(Cursor cursor) { |
124 |
window.setCursor(shape); |
switch cursor { |
125 |
|
case Cursor.CROSSHAIR_CURSOR: window.setCursor(130); break; // XC_tcross |
126 |
|
case Cursor.DEFAULT_CURSOR: window.setCursor(68); break; // XC_left_ptr |
127 |
|
case Cursor.E_RESIZE_CURSOR: window.setCursor(98); break; // XC_righside |
128 |
|
case Cursor.HAND_CURSOR: window.setCursor(60); break; // XC_hand2 |
129 |
|
case Cursor.MOVE_CURSOR: window.setCursor(52); break; // XC_fleur |
130 |
|
case Cursor.N_RESIZE_CURSOR: window.setCursor(138); break; // XC_top_side |
131 |
|
case Cursor.NE_RESIZE_CURSOR: window.setCursor(136); break; // XC_top_right_corner |
132 |
|
case Cursor.NW_RESIZE_CURSOR: window.setCursor(134); break; // XC_top_left_corner |
133 |
|
case Cursor.S_RESIZE_CURSOR: window.setCursor(16); break; // XC_bottom_side |
134 |
|
case Cursor.SE_RESIZE_CURSOR: window.setCursor(14); break; // XC_bottom_right_corner |
135 |
|
case Cursor.SW_RESIZE_CURSOR: window.setCursor(12); break; // XC_bottom_left_corner |
136 |
|
case Cursor.TEXT_CURSOR: window.setCursor(152); break; // XC_xterm |
137 |
|
case Cursor.W_RESIZE_CURSOR: window.setCursor(70); break; // XC_left_side |
138 |
|
case Cursor.WAIT_CURSOR: window.setCursor(150); break; // XC_watch |
139 |
|
} |
140 |
} |
} |
141 |
|
|
142 |
C |
C |