1
////////////////////////////////////////////////////////////////////////////////
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
4
// (c) copyright 1997, Vrije Universiteit Amsterdam.
5
// Author: Frank Dehne (frank@cs.vu.nl).
7
// TCM is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License as published by
9
// the Free Software Foundation; either version 2 of the License, or
10
// (at your option) any later version.
12
// TCM is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with TCM; if not, write to the Free Software
19
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21
////////////////////////////////////////////////////////////////////////////////
22
#include "mousecursor.h"
24
#include <X11/cursorfont.h>
26
MouseCursor::MouseCursor(Widget w) {
31
const int MouseCursor::WATCH = XC_watch;
32
const int MouseCursor::LEFT_PTR = XC_left_ptr;
33
const int MouseCursor::PLUS = XC_plus;
34
const int MouseCursor::TERM = XC_xterm;
35
const int MouseCursor::FLEUR = XC_fleur;
36
const int MouseCursor::H_DOUBLE_ARROW = XC_sb_h_double_arrow;
37
const int MouseCursor::V_DOUBLE_ARROW = XC_sb_v_double_arrow;
39
void MouseCursor::Set(int x) {
40
if (x == XC_left_ptr) {
48
Display *d = XtDisplay(widget);
49
Cursor c1 = XCreateFontCursor(d, x);
50
XDefineCursor(d, XtWindow(widget), c1);
54
void MouseCursor::SetSize(int w) {
56
case 0: Set(XC_fleur);
58
case 1: Set(XC_top_left_corner);
60
case 2: Set(XC_top_right_corner);
62
case 3: Set(XC_bottom_right_corner);
64
case 4: Set(XC_bottom_left_corner);
66
case 5: Set(XC_bottom_side);
68
case 6: Set(XC_top_side);
70
case 7: Set(XC_left_side);
72
case 8: Set(XC_right_side);
75
error("%s, line %d: impl error: wrong size cursor position\n",