00001 #ifndef __RE_Cursor__
00002 #define __RE_Cursor__
00003
00004 #include "RE_API.h"
00005 #include <stdio.h>
00006 #include <string.h>
00007 #include <stdlib.h>
00008 #include <UT/UT_String.h>
00009 #include "RE_Types.h"
00010
00011 #define RE_CURSOR_I_AM_BUSY "busy"
00012 #define RE_CURSOR_I_AM_INTERRUPTABLE "interruptable"
00013 #define RE_CURSOR_ARROW_RIGHT "arrowRight"
00014 #define RE_CURSOR_ARROW_UP "arrowUp"
00015 #define RE_CURSOR_ARROW_LEFT "arrowLeft"
00016 #define RE_CURSOR_ARROW_DOWN "arrowDown"
00017 #define RE_CURSOR_ARROW_ALL "arrowAll"
00018 #define RE_CURSOR_ARROW_ALL_D "arrowAllDiagonal"
00019 #define RE_CURSOR_ARROW_UP_DOWN "arrowUpDown"
00020 #define RE_CURSOR_ARROW_LEFT_RIGHT "arrowLeftRight"
00021 #define RE_CURSOR_ARROW_D1 "arrowD1"
00022
00023 #define RE_CURSOR_ARROW_D2 "arrowD2"
00024 #define RE_CURSOR_ARROW_D3 "arrowD3"
00025 #define RE_CURSOR_ARROW_D4 "arrowD4"
00026 #define RE_CURSOR_ARROW_D1D3 "arrowD1D3"
00027 #define RE_CURSOR_ARROW_D2D4 "arrowD2D4"
00028 #define RE_CURSOR_CROSS "cross"
00029 #define RE_CURSOR_CUT "cut"
00030 #define RE_CURSOR_ARROW "arrow"
00031
00032
00033 #define RE_CURSOR_IRIS "iris"
00034 #define RE_CURSOR_X "X"
00035
00036 #define RE_CORNER_BL "cornerBL"
00037 #define RE_CORNER_BR "cornerBR"
00038 #define RE_CORNER_TL "cornerTL"
00039 #define RE_CORNER_TR "cornerTR"
00040
00041 #define RE_CURSOR_DRAGDROP_ON "dragdropOn"
00042 #define RE_CURSOR_DRAGDROP_OFF "dragdropOff"
00043
00044 #define RE_CURSOR_HAND "hand"
00045 #define RE_CURSOR_HAND_POINT "handpoint"
00046 #define RE_CURSOR_QUESTION "question"
00047 #define RE_CURSOR_SELECT_IRIS "select"
00048
00049
00050
00051
00052
00053
00054 #define RE_CURSOR_SELECT_PREFIX "select_"
00055 #define RE_CURSOR_SELECT_WHITE_REPLACE "select_white_replace"
00056 #define RE_CURSOR_SELECT_WHITE_ADD "select_white_add"
00057 #define RE_CURSOR_SELECT_WHITE_REMOVE "select_white_remove"
00058 #define RE_CURSOR_SELECT_WHITE_TOGGLE "select_white_toggle"
00059 #define RE_CURSOR_SELECT_BLACK_REPLACE "select_black_replace"
00060 #define RE_CURSOR_SELECT_BLACK_ADD "select_black_add"
00061 #define RE_CURSOR_SELECT_BLACK_REMOVE "select_black_remove"
00062 #define RE_CURSOR_SELECT_BLACK_TOGGLE "select_black_toggle"
00063
00064
00065 class RE_API RE_Cursor
00066 {
00067 public:
00068 RE_Cursor();
00069 virtual ~RE_Cursor();
00070
00071 virtual RE_IDType getDeviceId(RE_IDType wid) = 0;
00072 virtual void unload();
00073
00074 const char * getName() const { return cursorName; }
00075
00076 protected:
00077 RE_Cursor(const char *name);
00078
00079 static bool getCursorInfo(const char *name,
00080 UT_String &path, int &x, int &y);
00081
00082 short readCursor(FILE *fp, const char *file);
00083 int loadBitmap(FILE *fp, int n, int l, const char *file);
00084
00085
00086 const char *cursorName;
00087 short originX;
00088 short originY;
00089 unsigned short *bitmap;
00090 unsigned short *mask;
00091 };
00092 #endif