|
There are no more that you "should" know about, because in order to
choose them, you would have to edit decw$sm_general.dat to add their
index. Here is the story.
When you install DECwindows, you get a file in decw$include called
cursorfont.h. This file contains the number for each cursor shape
which is provided in the X Standard cursor font. You can also look
at Appendix B of the X Window System book. It contains a list of the
shapes and index values for the standard cursor font.
For DECwindows, some of the cursors were redone in a private cursor
font. The numbers in decw$sm_general.dat are the index into that
private cursor font. There are other cursors in that font in addition
to the ones listed in the listbox. These are cursors used by
DECwindows application for special operations (ex. the watch cursor,
the text insertion cursor, etc...) We felt that it was not
appropriate to include those cursors in the Customize Pointer list box
since they have "special" functions.
After saying all this, I will tell you of a trick which allows you to
provide the standard X11 index (found in cursorfont.h) in your
decw$sm_general.dat and get a cursor shape that is not in the Customize
Pointer listbox. If you put a "-" in front of the index, the Session
Manager will index into the standard font rather than the DECwindows
private cursor font. For example a -8 will give you a boat.
This feature is not documented because at some point, we want to
provide a user interface that allows people to specify their own
shapes. In other words the ability to customize the Customize Pointer
listbox. We just aren't there yet. When we get there, I can't
guarantee that the "-" trick will still work. It is unsupported.
Karen
|
| > Is there any way to get the X11 cursors to show up in Session Manager's
> Customize Pointer list box?
Well, doesn't exactly do what you want, but here's a hack that
changes the pointer to use the X11 cursors... There are some
very strange looking one's out there... I don't think this
works on Motif as this is built to handle the 'dummy' window
that the XUI window manager throws up...
/*
** Include files
*/
#include <stdio.h>
#include <descrip.h>
#include <decw$include/dwtappl>
#include <decw$include/cursorfont.h>
#include <decw$include/X.h>
#include <decw$include/Xlib.h>
#include <decw$include/Xutil.h>
#include <decw$include/Xatom.h>
/*
** Function Prototypes
*/
Window WmRootWindow (Display*, Window);
char *fore_color = NULL;
char *back_color = NULL;
main(argc, argv)
int argc;
char *argv[];
{
int screen, /* screen number */
int_cursor; /* integer value of argv[1] */
Window root,wmroot; /* Returned root window identifier */
Display *display; /* display */
Cursor newcursor;
if (argc != 2)
{
printf ("Usage is %s fontindex\n", argv[0]);
exit (0);
}
/*
** Open connect to display
*/
if (!(display = XOpenDisplay(getenv("DECW$DISPLAY"))))
{
perror("Can't open display");
exit(-1);
}
/*
** Get screen stuff
*/
screen = DefaultScreen(display);
root = RootWindow(display, screen);
wmroot = WmRootWindow(display, root);
wmroot = WmRootWindow(display, wmroot);
int_cursor = atoi (argv[1]);
printf ("Cursor value passed was %d\n", int_cursor);
newcursor = XCreateFontCursor(display,int_cursor);
XClearWindow(display,wmroot);
XDefineCursor(display,wmroot,newcursor);
XFlush(display);
XSync(display,TRUE);
} /* main */
Window WmRootWindow (Display *dpy, Window root)
{
Window parent;
Window *child;
unsigned int nchildren;
XWindowAttributes rootatt, childatt;
if (!XGetWindowAttributes (dpy, root, &rootatt)) {
fprintf (stderr, "XGetWindowAttributes on root failed.\n");
exit(1);
}
if (XQueryTree (dpy, root, &root, &parent, &child, &nchildren)) {
int i;
for (i = 0; i < nchildren; i++) {
if (!XGetWindowAttributes (dpy, child[i], &childatt)) {
fprintf (stderr, "XGetWindowAttributes on child failed.\n");
exit(1);
}
if ((rootatt.width == childatt.width) &&
(rootatt.height == childatt.height))
return child[i];
}
return root;
} else {
fprintf (stderr, "XQueryTree failed (window doesn't exist).\n");
exit(1);
}
} /* end WmRootWindow */
|