[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

3180.0. "Change mouse pointers?" by THEWAV::MIKKELSON (Where's that $250,000,000 I lost?) Wed Aug 08 1990 12:15

    
    Is there a file somewhere that stores the shapes for the default mouse
    pointers, or are their shapes encoded in the DECwindows code?
    
    in either case, is it possible to alter/add to the shapes displayed in
    the Customize Pointer application?
    
    - David
    
T.RTitleUserPersonal
Name
DateLines
3180.1can't add shapesDECWIN::BROUILLETTEWed Aug 08 1990 15:039
    
    The shapes are stored in a font and the decw$cursor.h file provides the
    indexes for the font.   The indexes of the cursors displayed in the
    pointer list box are either in UIL or CODE.   This means you cannot add
    shapes to the Customize Pointer application.
    
    Perhaps someday  in the future...
    
    Karen
3180.2More . . .THEWAV::MIKKELSONWhere's that $250,000,000 I lost?Wed Aug 08 1990 16:018
    
    Well, since changing the value of sm.pointer_shape in
    DECW$SM_GENERAL.DAT appears to produce some unlisted mouse pointers,
    are there any more not displayed in Customize Pointer that we should
    know about?
    
    - David
    
3180.3more info on cursorsDECWIN::BROUILLETTEThu Aug 09 1990 13:5034
    
    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
3180.4also look at sys$library:decw$cursor.hDECWIN::BROUILLETTEThu Aug 09 1990 14:146
    
    I believe we are also shipping decw$cursor.h which contains the set of
    shapes in the DECwindows cursor font (as opposed to the standard cursor
    font).   The file is in sys$library:decw$cursor.h.    Look at that file
    to see the list of all available DECwindows cursors.
    
3180.5Hacker's delight...SCAM::DIALThu Aug 09 1990 15:124
    Is there any way to get the X11 cursors to show up in Session Manager's
    Customize Pointer list box?
    
    Barry
3180.6Hack away...PEACHS::BELDINSat Aug 11 1990 09:01112
>    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 */