mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Introduce Emacs_Cursor typedef
* src/dispextern.h [HAVE_X_WINDOWS]: Define Emacs_Cursor alias. Move the No_Cursor definition from xterm.h. (redisplay_interface): Use Emacs_Cursor over Cursor. * src/nsgui.h: * src/nsterm.h: * src/nsterm.m: * src/w32gui.h: * src/w32term.c: * src/xdisp.c: * src/xterm.c (x_define_frame_cursor): Use Emacs_Cursor over Cursor.
This commit is contained in:
parent
c0e146e4ec
commit
06db2a052f
11 changed files with 61 additions and 63 deletions
|
|
@ -36,6 +36,9 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
|||
#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. */
|
||||
|
|
@ -46,6 +49,8 @@ typedef struct
|
|||
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
|
||||
|
|
@ -93,8 +98,7 @@ typedef XImagePtr XImagePtr_or_DC;
|
|||
#endif
|
||||
|
||||
#ifndef HAVE_WINDOW_SYSTEM
|
||||
typedef int Cursor;
|
||||
#define No_Cursor (0)
|
||||
typedef void *Emacs_Cursor;
|
||||
#endif
|
||||
|
||||
#ifndef NativeRectangle
|
||||
|
|
@ -2889,7 +2893,7 @@ struct redisplay_interface
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -102,13 +102,11 @@ typedef void *Pixmap;
|
|||
#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;
|
||||
|
||||
|
||||
|
|
|
|||
36
src/nsterm.h
36
src/nsterm.h
|
|
@ -872,10 +872,10 @@ struct ns_display_info
|
|||
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. */
|
||||
|
|
@ -931,24 +931,24 @@ struct ns_output
|
|||
#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;
|
||||
|
|
|
|||
|
|
@ -2576,7 +2576,7 @@ so some key presses (TAB) are swallowed by the system. */
|
|||
|
||||
|
||||
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.
|
||||
-------------------------------------------------------------------------- */
|
||||
|
|
|
|||
12
src/w32fns.c
12
src/w32fns.c
|
|
@ -2247,15 +2247,15 @@ w32_set_z_group (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
|
|||
|
||||
/* 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. */
|
||||
|
|
@ -5217,7 +5217,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case WM_EMACS_SETCURSOR:
|
||||
{
|
||||
Cursor cursor = (Cursor) wParam;
|
||||
HCURSOR cursor = (HCURSOR) wParam;
|
||||
f = w32_window_to_frame (dpyinfo, hwnd);
|
||||
if (f && cursor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,9 +45,7 @@ typedef HBITMAP Bitmap;
|
|||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ static int any_help_event_p;
|
|||
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);
|
||||
|
||||
|
||||
/* This is display since w32 does not support multiple ones. */
|
||||
|
|
@ -166,7 +166,7 @@ int w32_message_fd = -1;
|
|||
|
||||
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 *);
|
||||
|
|
@ -3429,7 +3429,7 @@ static void w32_horizontal_scroll_bar_report_motion (struct frame **, Lisp_Objec
|
|||
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);
|
||||
}
|
||||
|
|
@ -5806,7 +5806,7 @@ w32_draw_bar_cursor (struct window *w, struct glyph_row *row,
|
|||
/* 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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,10 +114,10 @@ struct w32_display_info
|
|||
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;
|
||||
|
|
@ -348,27 +348,27 @@ struct w32_output
|
|||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -31153,7 +31153,7 @@ Returns the alist element for the first matching AREA in MAP. */)
|
|||
|
||||
/* 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))
|
||||
|
|
@ -31205,7 +31205,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
|
|||
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;
|
||||
|
|
@ -31518,7 +31518,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
|
|||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -9356,7 +9356,7 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text
|
|||
/* 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)
|
||||
|
|
|
|||
|
|
@ -731,8 +731,6 @@ struct x_output
|
|||
#endif
|
||||
};
|
||||
|
||||
#define No_Cursor (None)
|
||||
|
||||
enum
|
||||
{
|
||||
/* Values for focus_state, used as bit mask.
|
||||
|
|
|
|||
Loading…
Reference in a new issue