2
// -------------------------------------------
4
// $Date: 2003/06/23 14:47:22 $
5
// $Revision: 1.1.1.1 $
6
// $Source: /cvsroot/miwm/miwm/miwm/cursor.cc,v $
7
// $Id: cursor.cc,v 1.1.1.1 2003/06/23 14:47:22 bwise837 Exp $
8
// $RCSfile: cursor.cc,v $
9
// -------------------------------------------
10
// Copyright by Ben Paul Wise.
11
// -------------------------------------------
12
// This program is free software; you can redistribute it and/or modify
13
// it under the terms of the GNU General Public License as published by
14
// the Free Software Foundation; either version 2 of the License, or
15
// (at your option) any later version.
17
// This program is distributed in the hope that it will be useful,
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
// GNU General Public License for more details.
22
// You should have received a copy of the GNU General Public License
23
// along with this program; if not, write to the Free Software
24
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
// -------------------------------------------
31
#include <X11/Xutil.h>
32
#include <X11/cursorfont.h>
40
static struct CursorMapping {
47
* These *MUST* be in the same order as they appear in miwm.h, because
48
* we index rather than search in edgecursor() later on.
51
{ETopLeft, XC_top_left_corner, 0,},
52
{ETop, XC_top_side, 0,},
53
{ETopRight, XC_top_right_corner, 0,},
54
{ERight, XC_right_side, 0,},
55
{ENone, XC_fleur, 0,},
56
{ELeft, XC_left_side, 0,},
57
{EBottomLeft, XC_bottom_left_corner, 0,},
58
{EBottom, XC_bottom_side, 0,},
59
{EBottomRight, XC_bottom_right_corner, 0,},
70
// XC_crosshair, XC_X_cursor, XC_fleur are all reasonable for BPW
71
cmp = DefaultColormap(dpy, DefaultScreen(dpy));
72
// root_cursor = XCreateFontCursor(dpy, XC_X_cursor);
73
root_cursor = XCreateFontCursor(dpy, XC_X_cursor);
74
frame_cursor = XCreateFontCursor(dpy, XC_left_ptr);
75
menu_cursor = XCreateFontCursor(dpy, XC_crosshair);
77
// XRecolorCursor(dpy, root_cursor, &red, &exact);
78
XRecolorCursor(dpy, root_cursor, &theWM->rootCursorColor, &exact);
79
XRecolorCursor(dpy, menu_cursor, &theWM->frameCursorColor, &exact);
80
XRecolorCursor(dpy, frame_cursor, &theWM->frameCursorColor, &exact);
82
for (i = 0; cursor_map[i].font_char != 0; i++) {
83
cursor_map[i].cursor = XCreateFontCursor(dpy, cursor_map[i].font_char);
84
XRecolorCursor(dpy, cursor_map[i].cursor, &theWM->frameCursorColor, &exact);
86
// cout << "init cursor finished" << endl << flush;
91
edgecursor(Edge edge) {
92
return cursor_map[(int)edge].cursor;
96
// -------------------------------------------
98
// -------------------------------------------