95 |
NOTE: In Java, Toolkit.createCustomCursor is available since |
NOTE: In Java, Toolkit.createCustomCursor is available since |
96 |
JDK 1.2. How custom cursor could be used efficiently in GL? |
JDK 1.2. How custom cursor could be used efficiently in GL? |
97 |
|
|
98 |
RE-RESOLVED: Using custom cursor is allowed, thought it left |
RE-RESOLVED: Since ustom cursors should be also possible |
99 |
unimplemented in GL. |
outside the AWT, using custom cursor is allowed. Althought, left |
100 |
|
yet unimplemented in GL. |
101 |
|
|
102 |
Changes |
Changes |
103 |
======= |
======= |
163 |
Os::Window *w = (Os::Window *)windows.get(id); |
Os::Window *w = (Os::Window *)windows.get(id); |
164 |
DBG(dbg) << "Set window "<<id<<" Cursor shape "<<shape<<" at "<<(int)w<<"\n"; |
DBG(dbg) << "Set window "<<id<<" Cursor shape "<<shape<<" at "<<(int)w<<"\n"; |
165 |
std::string shape_str = jstr2stdstr(env, shape); |
std::string shape_str = jstr2stdstr(env, shape); |
|
std::transform(shape_str.begin(), shape_strend(), |
|
|
shape_str.begin(), std::toupper); |
|
166 |
w->setCursor(shape_str); |
w->setCursor(shape_str); |
167 |
} |
} |
168 |
|
|
169 |
Into ``src/os/Os-GLX.cxx``:: |
Into ``src/os/Os-GLX.cxx``:: |
170 |
|
|
171 |
// For setCursor() |
// For setCursor() |
172 |
#include <X11/Xlib.h> |
#include <X11/Xlib.h> |
173 |
#include <X11/cursorfont.h> |
#include <X11/cursorfont.h> |
174 |
#include <string> |
// |
|
using std::string; |
|
|
// |
|
175 |
|
|
176 |
Into ``src/os/Os-GLX.cxx Vob.Os.LXWindow``:: |
Into ``src/os/Os-GLX.cxx Vob.Os.LXWindow``:: |
177 |
|
|
203 |
cursor = XCreateFontCursor(ws->dpy, XC_xterm); |
cursor = XCreateFontCursor(ws->dpy, XC_xterm); |
204 |
else if (shape == "W_RESIZE_CURSOR") |
else if (shape == "W_RESIZE_CURSOR") |
205 |
cursor = XCreateFontCursor(ws->dpy, XC_left_side); |
cursor = XCreateFontCursor(ws->dpy, XC_left_side); |
206 |
else if (shape == "WAIT_CURSOR") |
else if (shape == "WAIT_CURSOR") |
207 |
cursor = XCreateFontCursor(ws->dpy, XC_watch); |
cursor = XCreateFontCursor(ws->dpy, XC_watch); |
208 |
if (cursor != 0) XDefineCursor(ws->dpy, xw, cursor); |
if (cursor != 0) XDefineCursor(ws->dpy, xw, cursor); |
209 |
} |
} |