From 06b48596f5a9a00b44fe44623f4cf51858539cd7 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 23 Nov 2001 05:39:13 +0000 Subject: [PATCH] - made the definable cursors feature available by default (removed the compile time option) --- ChangeLog | 6 +++-- README.definable-cursor | 62 ++++++++++++++----------------------------------- src/defaults.c | 27 +++++++-------------- src/screen.c | 2 -- src/startup.c | 7 ++---- src/wconfig.h.in | 6 ----- util/setstyle.c | 50 ++++++++++++++++++--------------------- 7 files changed, 55 insertions(+), 105 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbde8663..cdaa1da1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,8 +18,10 @@ Changes since version 0.70.0: saving dock/clip/session information on exit. - Added an internal strcasecmp() to WINGs (only on systems where's not present) - Deminiaturizing a window that is also shaded, will perform an unshade too. - (Note that this only applies to deminiaturizing shaded windows. - Unhiding an application will keep the shaded/unshaded state of windows.) + (Note that this only applies to deminiaturizing shaded windows. Unhiding + an application will keep the shaded/unshaded state of windows.) +- Removed compile time option for definable cursors and made them available by + default. Changes since version 0.65.1: diff --git a/README.definable-cursor b/README.definable-cursor index 14bd4745..22a24482 100644 --- a/README.definable-cursor +++ b/README.definable-cursor @@ -1,43 +1,16 @@ -# README.definable-cursor: How to use definable-cursor patch for Window Maker -# created 1999-Apr-24 14:53 jmk -# autodate: 2001-Sep-05 22:40 -+------------------------------------------+ -| Definable Mouse Cursors for Window Maker | -+------------------------------------------+ -The definable-cursor patch for Window Maker - allows user-definable mouse cursors; the +Definable Mouse Cursors for Window Maker +---------------------------------------- + +The definable-cursor feature allows user-definable mouse cursors; the cursors can either be the built-in ones from the X11 cursor font, or they can be bitmap (XBM) files. User-definable cursors can be useful for theme-builders, lefthanders, and the visually impaired. -This README describes how to enable user-definable cursors in Window -Maker as well as how to use them. - -+----------------------------+ -| Enabling Definable Cursors | -+----------------------------+ - -If you want to enable definable mouse cursors in Window Maker, you must -do so before you configure and build Window Maker. Here's how: - - (1) Edit src/wconfig.h.in and change the following line: - - #undef DEFINABLE_CURSOR - to: - - #define DEFINABLE_CURSOR - - (2) Configure and build Window Maker as you normally would: - - ./configure - make - -+---------------------------+ -| Defining Your Own Cursors | -+---------------------------+ +Defining Your Own Cursors +------------------------- A cursor specification takes one of the following forms in the ~/GNUstep/Defaults/WindowMaker file: @@ -84,23 +57,22 @@ Maker used them in the past, but doesn't use them anymore): ResizeCursor = (builtin, sizing); -+----------------------------------------------+ -| Using Cursors with 'getstyle' and 'setstyle' | -+----------------------------------------------+ -The 'getstyle' and 'setstyle' style- and theme-management utilities -can handle user-definable cursors. By default, 'getstyle' ignores -cursor definitions; using 'getstyle -t' to get theme-related settings -will also include any cursors you've defined in the resulting -stylefile. +Using Cursors with 'getstyle' and 'setstyle' +-------------------------------------------- -However, by default, 'setstyle' does *not* ignore cursor settings. If +The 'getstyle' and 'setstyle' style/theme-management utilities can +handle user-definable cursors. By default, 'getstyle' ignores cursor +definitions; using 'getstyle -t' to get theme-related settings will +also include any cursors you've defined in the resulting stylefile. + +However, by default, 'setstyle' does NOT ignore cursor settings. If you wish to set a style or theme without installing cursor settings, you can use 'setstyle --no-cursors' to ignore the cursor definitions. -+--------------+ -| Random Notes | -+--------------+ + +Random Notes +------------ Most X11 cursors are 16x16 bitmaps. Many X servers can actually handle larger cursors, though. To check, use: diff --git a/src/defaults.c b/src/defaults.c index 31cfc5ab..21117b4f 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -176,11 +176,9 @@ static int setMultiByte(); #endif static int updateUsableArea(); -#ifdef DEFINABLE_CURSOR extern Cursor wCursor[WCUR_LAST]; static int getCursor(); static int setCursor(); -#endif /* @@ -803,7 +801,7 @@ WDefaultEntry optionList[] = { &wPreferences.modelock, getBool, NULL } #endif /* KEEP_XKB_LOCK_STATUS */ -#ifdef DEFINABLE_CURSOR + ,{"NormalCursor", "(builtin, left_ptr)", (void*)WCUR_ROOT, NULL, getCursor, setCursor }, @@ -852,7 +850,6 @@ WDefaultEntry optionList[] = { {"SelectCursor", "(builtin, cross)", (void*)WCUR_SELECT, NULL, getCursor, setCursor } -#endif /* DEFINABLE_CURSOR */ }; @@ -2472,8 +2469,6 @@ getRImages(WScreen *scr, WDefaultEntry *entry, WMPropList *value, } #endif -#ifdef DEFINABLE_CURSOR - # include typedef struct { @@ -2736,8 +2731,6 @@ again: } #undef CURSOR_ID_NONE -#endif /* DEFINABLE_CURSOR */ - /* ---------------- value setting functions --------------- */ static int @@ -3435,28 +3428,26 @@ setMultiByte(WScreen *scr, WDefaultEntry *entry, char *value, void *foo) extern _WINGsConfiguration WINGsConfiguration; WINGsConfiguration.useMultiByte = *value; - + return 0; } #endif -#ifdef DEFINABLE_CURSOR + static int setCursor(WScreen *scr, WDefaultEntry *entry, Cursor *cursor, long index) { - if (None != wCursor[index]) - { + if (None != wCursor[index]) { XFreeCursor(dpy, wCursor[index]); - } - + } + wCursor[index] = *cursor; - if ((WCUR_ROOT == index) && (None != *cursor)) - { + if ((WCUR_ROOT == index) && (None != *cursor)) { XDefineCursor(dpy, scr->root_win, *cursor); - } + } return 0; } -#endif /* DEFINABLE_CURSOR*/ + diff --git a/src/screen.c b/src/screen.c index 71bf878e..f1d55d83 100644 --- a/src/screen.c +++ b/src/screen.c @@ -697,9 +697,7 @@ wScreenInit(int screen_number) return NULL; } -#ifndef DEFINABLE_CURSOR XDefineCursor(dpy, scr->root_win, wCursor[WCUR_DEFAULT]); -#endif /* screen descriptor for raster graphic library */ rattr.flags = RC_RenderMode | RC_ColorsPerChannel | RC_StandardColormap; diff --git a/src/startup.c b/src/startup.c index 9c6e4fdf..d8d2ad45 100644 --- a/src/startup.c +++ b/src/startup.c @@ -805,11 +805,8 @@ StartUp(Bool defaultScreenOnly) /* cursors */ -#ifdef DEFINABLE_CURSOR - wCursor[WCUR_NORMAL] = None; -#else - wCursor[WCUR_NORMAL] = XCreateFontCursor(dpy, XC_left_ptr); -#endif + /*wCursor[WCUR_NORMAL] = None;*/ + wCursor[WCUR_NORMAL] = XCreateFontCursor(dpy, XC_left_ptr); wCursor[WCUR_ROOT] = XCreateFontCursor(dpy, XC_left_ptr); wCursor[WCUR_ARROW] = XCreateFontCursor(dpy, XC_top_left_arrow); wCursor[WCUR_MOVE] = XCreateFontCursor(dpy, XC_fleur); diff --git a/src/wconfig.h.in b/src/wconfig.h.in index 6391b5b4..9a0f7946 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -213,12 +213,6 @@ */ #undef GRADIENT_CLIP_ARROWS -/* - * define DEFINABLE_CURSOR if you want WindowMaker's default cursor - * to be user-definable instead of using a hard-coded left_ptr. - */ -#undef DEFINABLE_CURSOR - #undef NO_WINDOW_ENUMERATOR diff --git a/util/setstyle.c b/util/setstyle.c index c5dd14d6..09225cbb 100644 --- a/util/setstyle.c +++ b/util/setstyle.c @@ -49,21 +49,21 @@ char *FontOptions[] = { }; char *CursorOptions[] = { - "NormalCursor" - ,"ArrowCursor" - ,"MoveCursor" - ,"ResizeCursor" - ,"TopLeftResizeCursor" - ,"TopRightResizeCursor" - ,"BottomLeftResizeCursor" - ,"BottomRightResizeCursor" - ,"VerticalResizeCursor" - ,"HorizontalResizeCursor" - ,"WaitCursor" - ,"QuestionCursor" - ,"TextCursor" - ,"SelectCursor" - ,NULL + "NormalCursor", + "ArrowCursor", + "MoveCursor", + "ResizeCursor", + "TopLeftResizeCursor", + "TopRightResizeCursor", + "BottomLeftResizeCursor", + "BottomRightResizeCursor", + "VerticalResizeCursor", + "HorizontalResizeCursor", + "WaitCursor", + "QuestionCursor", + "TextCursor", + "SelectCursor", + NULL }; @@ -379,20 +379,16 @@ print_help() printf("Usage: %s [OPTIONS] FILE\n", ProgName); puts("Reads style/theme configuration from FILE and updates Window Maker."); puts(""); - puts(" --no-fonts ignore font related options"); - /* Why these stupid tabs? They're misleading to the programmer, - * and they don't do any better than aligning via spaces: If you - * have a proportional font, all bets are off anyway. Sheesh. - */ - puts(" --no-cursors ignore cursor related options"); - puts(" --ignore