#endif
typedef XColor Emacs_Color;
+typedef Cursor Emacs_Cursor;
+#define No_Cursor (None)
+
#else /* !HAVE_X_WINDOWS */
/* XColor-like struct used by non-X code. */
unsigned short red, green, blue;
} Emacs_Color;
+/* Accommodate X's usage of None as a null resource ID. */
+#define No_Cursor (NULL)
#endif /* HAVE_X_WINDOWS */
#ifdef MSDOS
#endif
#ifndef HAVE_WINDOW_SYSTEM
-typedef int Cursor;
-#define No_Cursor (0)
+typedef void *Emacs_Cursor;
#endif
#ifndef NativeRectangle
void (*draw_glyph_string) (struct glyph_string *s);
/* Define cursor CURSOR on frame F. */
- void (*define_frame_cursor) (struct frame *f, Cursor cursor);
+ void (*define_frame_cursor) (struct frame *f, Emacs_Cursor cursor);
/* Clear the area at (X,Y,WIDTH,HEIGHT) of frame F. */
void (*clear_frame_area) (struct frame *f, int x, int y,
#endif
#ifdef __OBJC__
-typedef NSCursor * Cursor;
+typedef NSCursor *Emacs_Cursor;
#else
-typedef void *Cursor;
+typedef void *Emacs_Cursor;
#endif
-#define No_Cursor (0)
-
typedef int Window;
Lisp_Object rdb;
/* The cursor to use for vertical scroll bars. */
- Cursor vertical_scroll_bar_cursor;
+ Emacs_Cursor vertical_scroll_bar_cursor;
/* The cursor to use for horizontal scroll bars. */
- Cursor horizontal_scroll_bar_cursor;
+ Emacs_Cursor horizontal_scroll_bar_cursor;
/* Information about the range of text currently shown in
mouse-face. */
#endif
/* NSCursors are initialized in initFrameFromEmacs. */
- Cursor text_cursor;
- Cursor nontext_cursor;
- Cursor modeline_cursor;
- Cursor hand_cursor;
- Cursor hourglass_cursor;
- Cursor horizontal_drag_cursor;
- Cursor vertical_drag_cursor;
- Cursor left_edge_cursor;
- Cursor top_left_corner_cursor;
- Cursor top_edge_cursor;
- Cursor top_right_corner_cursor;
- Cursor right_edge_cursor;
- Cursor bottom_right_corner_cursor;
- Cursor bottom_edge_cursor;
- Cursor bottom_left_corner_cursor;
+ Emacs_Cursor text_cursor;
+ Emacs_Cursor nontext_cursor;
+ Emacs_Cursor modeline_cursor;
+ Emacs_Cursor hand_cursor;
+ Emacs_Cursor hourglass_cursor;
+ Emacs_Cursor horizontal_drag_cursor;
+ Emacs_Cursor vertical_drag_cursor;
+ Emacs_Cursor left_edge_cursor;
+ Emacs_Cursor top_left_corner_cursor;
+ Emacs_Cursor top_edge_cursor;
+ Emacs_Cursor top_right_corner_cursor;
+ Emacs_Cursor right_edge_cursor;
+ Emacs_Cursor bottom_right_corner_cursor;
+ Emacs_Cursor bottom_edge_cursor;
+ Emacs_Cursor bottom_left_corner_cursor;
/* NS-specific */
- Cursor current_pointer;
+ Emacs_Cursor current_pointer;
/* lord knows why Emacs needs to know about our Window ids.. */
Window window_desc, parent_desc;
static void
-ns_define_frame_cursor (struct frame *f, Cursor cursor)
+ns_define_frame_cursor (struct frame *f, Emacs_Cursor cursor)
/* --------------------------------------------------------------------------
External (RIF): set frame mouse pointer type.
-------------------------------------------------------------------------- */
\f
/* Subroutines for creating a frame. */
-Cursor w32_load_cursor (LPCTSTR);
+HCURSOR w32_load_cursor (LPCTSTR);
-Cursor
+HCURSOR
w32_load_cursor (LPCTSTR name)
{
/* Try first to load cursor from application resource. */
- Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle (NULL),
- name, IMAGE_CURSOR, 0, 0,
- LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED);
+ HCURSOR cursor = LoadImage ((HINSTANCE) GetModuleHandle (NULL),
+ name, IMAGE_CURSOR, 0, 0,
+ LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED);
if (!cursor)
{
/* Then try to load a shared predefined cursor. */
case WM_EMACS_SETCURSOR:
{
- Cursor cursor = (Cursor) wParam;
+ HCURSOR cursor = (HCURSOR) wParam;
f = w32_window_to_frame (dpyinfo, hwnd);
if (f && cursor)
{
typedef XGCValues * GC;
typedef HWND Window;
typedef HDC Display; /* HDC so it doesn't conflict with xpm lib. */
-typedef HCURSOR Cursor;
-
-#define No_Cursor (0)
+typedef HCURSOR Emacs_Cursor;
#define XChar2b wchar_t
extern unsigned int msh_mousewheel;
extern int w32_codepage_for_font (char *fontname);
-extern Cursor w32_load_cursor (LPCTSTR name);
+extern HCURSOR w32_load_cursor (LPCTSTR name);
\f
/* This is display since w32 does not support multiple ones. */
static void w32_handle_tool_bar_click (struct frame *,
struct input_event *);
-static void w32_define_cursor (Window, Cursor);
+static void w32_define_cursor (Window, Emacs_Cursor);
static void w32_scroll_bar_clear (struct frame *);
static void w32_raise_frame (struct frame *);
Lisp_Object *, Lisp_Object *,
Time *);
static void
-w32_define_cursor (Window window, Cursor cursor)
+w32_define_cursor (Window window, Emacs_Cursor cursor)
{
PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0);
}
/* RIF: Define cursor CURSOR on frame F. */
static void
-w32_define_frame_cursor (struct frame *f, Cursor cursor)
+w32_define_frame_cursor (struct frame *f, Emacs_Cursor cursor)
{
w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
}
Window root_window;
/* The cursor to use for vertical scroll bars. */
- Cursor vertical_scroll_bar_cursor;
+ HCURSOR vertical_scroll_bar_cursor;
/* The cursor to use for horizontal scroll bars. */
- Cursor horizontal_scroll_bar_cursor;
+ HCURSOR horizontal_scroll_bar_cursor;
/* Resource data base */
const char *rdb;
COLORREF scroll_bar_background_pixel;
/* Descriptor for the cursor in use for this window. */
- Cursor text_cursor;
- Cursor nontext_cursor;
- Cursor modeline_cursor;
- Cursor hand_cursor;
- Cursor hourglass_cursor;
- Cursor horizontal_drag_cursor;
- Cursor vertical_drag_cursor;
- Cursor left_edge_cursor;
- Cursor top_left_corner_cursor;
- Cursor top_edge_cursor;
- Cursor top_right_corner_cursor;
- Cursor right_edge_cursor;
- Cursor bottom_right_corner_cursor;
- Cursor bottom_edge_cursor;
- Cursor bottom_left_corner_cursor;
+ HCURSOR text_cursor;
+ HCURSOR nontext_cursor;
+ HCURSOR modeline_cursor;
+ HCURSOR hand_cursor;
+ HCURSOR hourglass_cursor;
+ HCURSOR horizontal_drag_cursor;
+ HCURSOR vertical_drag_cursor;
+ HCURSOR left_edge_cursor;
+ HCURSOR top_left_corner_cursor;
+ HCURSOR top_edge_cursor;
+ HCURSOR top_right_corner_cursor;
+ HCURSOR right_edge_cursor;
+ HCURSOR bottom_right_corner_cursor;
+ HCURSOR bottom_edge_cursor;
+ HCURSOR bottom_left_corner_cursor;
/* Non-zero means hourglass cursor is currently displayed. */
unsigned hourglass_p : 1;
/* Non-hourglass cursor that is currently active. */
- Cursor current_cursor;
+ HCURSOR current_cursor;
DWORD dwStyle;
/* Display frame CURSOR, optionally using shape defined by POINTER. */
static void
-define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer)
+define_frame_cursor1 (struct frame *f, Emacs_Cursor cursor, Lisp_Object pointer)
{
#ifdef HAVE_WINDOW_SYSTEM
if (!FRAME_WINDOW_P (f))
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- Cursor cursor = No_Cursor;
+ Emacs_Cursor cursor = No_Cursor;
Lisp_Object pointer = Qnil;
int dx, dy, width, height;
ptrdiff_t charpos;
enum window_part part = ON_NOTHING;
Lisp_Object window;
struct window *w;
- Cursor cursor = No_Cursor;
+ Emacs_Cursor cursor = No_Cursor;
Lisp_Object pointer = Qnil; /* Takes precedence over cursor! */
struct buffer *b;
/* RIF: Define cursor CURSOR on frame F. */
static void
-x_define_frame_cursor (struct frame *f, Cursor cursor)
+x_define_frame_cursor (struct frame *f, Emacs_Cursor cursor)
{
if (!f->pointer_invisible
&& f->output_data.x->current_cursor != cursor)
#endif
};
-#define No_Cursor (None)
-
enum
{
/* Values for focus_state, used as bit mask.