23 |
#include "macgui.h" |
#include "macgui.h" |
24 |
#include "frame.h" |
#include "frame.h" |
25 |
|
|
26 |
/* The class of this X application. */ |
/* Include Carbon.h to define Cursor and Rect. */ |
27 |
#define EMACS_CLASS "Emacs" |
#ifdef HAVE_CARBON |
28 |
|
#undef mktime |
29 |
|
#undef DEBUG |
30 |
|
#undef Z |
31 |
|
#undef free |
32 |
|
#undef malloc |
33 |
|
#undef realloc |
34 |
|
/* Macros max and min defined in lisp.h conflict with those in |
35 |
|
precompiled header Carbon.h. */ |
36 |
|
#undef max |
37 |
|
#undef min |
38 |
|
#undef init_process |
39 |
|
#include <Carbon/Carbon.h> |
40 |
|
#undef Z |
41 |
|
#define Z (current_buffer->text->z) |
42 |
|
#undef free |
43 |
|
#define free unexec_free |
44 |
|
#undef malloc |
45 |
|
#define malloc unexec_malloc |
46 |
|
#undef realloc |
47 |
|
#define realloc unexec_realloc |
48 |
|
#undef min |
49 |
|
#define min(a, b) ((a) < (b) ? (a) : (b)) |
50 |
|
#undef max |
51 |
|
#define max(a, b) ((a) > (b) ? (a) : (b)) |
52 |
|
#undef init_process |
53 |
|
#define init_process emacs_init_process |
54 |
|
#endif /* MAC_OSX */ |
55 |
|
|
56 |
#define RGB_TO_ULONG(r, g, b) (((r) << 16) | ((g) << 8) | (b)) |
#define RGB_TO_ULONG(r, g, b) (((r) << 16) | ((g) << 8) | (b)) |
57 |
|
|
69 |
|
|
70 |
#define FONT_MAX_WIDTH(f) FONT_WIDTH(f) /* fix later */ |
#define FONT_MAX_WIDTH(f) FONT_WIDTH(f) /* fix later */ |
71 |
|
|
|
enum text_cursor_kinds { |
|
|
NO_CURSOR = -1, |
|
|
FILLED_BOX_CURSOR, |
|
|
HOLLOW_BOX_CURSOR, |
|
|
BAR_CURSOR |
|
|
}; |
|
|
|
|
72 |
/* Structure recording bitmaps and reference count. |
/* Structure recording bitmaps and reference count. |
73 |
If REFCOUNT is 0 then this record is free to be reused. */ |
If REFCOUNT is 0 then this record is free to be reused. */ |
74 |
|
|
75 |
struct mac_bitmap_record |
struct mac_bitmap_record |
76 |
{ |
{ |
77 |
char *bitmap_data; |
char *bitmap_data; |
78 |
int refcount; |
int refcount; |
123 |
Window root_window; |
Window root_window; |
124 |
|
|
125 |
/* The cursor to use for vertical scroll bars. */ |
/* The cursor to use for vertical scroll bars. */ |
126 |
struct Cursor *vertical_scroll_bar_cursor; |
Cursor vertical_scroll_bar_cursor; |
127 |
|
|
128 |
|
/* Resource data base */ |
129 |
|
XrmDatabase xrdb; |
130 |
|
|
131 |
#if 0 |
#if 0 |
132 |
/* color palette information. */ |
/* color palette information. */ |
351 |
/* Foreground color for scroll bars. A value of -1 means use the |
/* Foreground color for scroll bars. A value of -1 means use the |
352 |
default (black for non-toolkit scroll bars). */ |
default (black for non-toolkit scroll bars). */ |
353 |
unsigned long scroll_bar_foreground_pixel; |
unsigned long scroll_bar_foreground_pixel; |
354 |
|
|
355 |
/* Background color for scroll bars. A value of -1 means use the |
/* Background color for scroll bars. A value of -1 means use the |
356 |
default (background color of the frame for non-toolkit scroll |
default (background color of the frame for non-toolkit scroll |
357 |
bars). */ |
bars). */ |
358 |
unsigned long scroll_bar_background_pixel; |
unsigned long scroll_bar_background_pixel; |
359 |
|
|
360 |
/* Descriptor for the cursor in use for this window. */ |
/* Descriptor for the cursor in use for this window. */ |
361 |
struct Cursor *text_cursor; |
Cursor text_cursor; |
362 |
struct Cursor *nontext_cursor; |
Cursor nontext_cursor; |
363 |
struct Cursor *modeline_cursor; |
Cursor modeline_cursor; |
364 |
struct Cursor *cross_cursor; |
Cursor hand_cursor; |
365 |
struct Cursor *hourglass_cursor; |
Cursor hourglass_cursor; |
366 |
|
Cursor horizontal_drag_cursor; |
367 |
#if 0 |
#if 0 |
368 |
/* Window whose cursor is hourglass_cursor. This window is temporarily |
/* Window whose cursor is hourglass_cursor. This window is temporarily |
369 |
mapped to display a hourglass-cursor. */ |
mapped to display a hourglass-cursor. */ |
370 |
Window hourglass_window; |
Window hourglass_window; |
371 |
|
|
372 |
/* Non-zero means hourglass cursor is currently displayed. */ |
/* Non-zero means hourglass cursor is currently displayed. */ |
373 |
unsigned hourglass_p : 1; |
unsigned hourglass_p : 1; |
374 |
|
|
377 |
|
|
378 |
#endif |
#endif |
379 |
|
|
|
/* What kind of text cursor is drawn in this window right now? |
|
|
(If there is no cursor (phys_cursor_x < 0), then this means nothing.) */ |
|
|
enum text_cursor_kinds current_cursor; |
|
|
|
|
|
/* What kind of text cursor should we draw in the future? |
|
|
This should always be filled_box_cursor or bar_cursor. */ |
|
|
enum text_cursor_kinds desired_cursor; |
|
|
|
|
|
/* Width of bar cursor (if we are using that). */ |
|
|
int cursor_width; |
|
|
|
|
380 |
#if 0 |
#if 0 |
381 |
DWORD dwStyle; |
DWORD dwStyle; |
382 |
#endif |
#endif |
429 |
/* The background for which the above relief GCs were set up. |
/* The background for which the above relief GCs were set up. |
430 |
They are changed only when a different background is involved. */ |
They are changed only when a different background is involved. */ |
431 |
unsigned long relief_background; |
unsigned long relief_background; |
432 |
|
|
433 |
|
/* See enum below */ |
434 |
|
int want_fullscreen; |
435 |
|
|
436 |
|
/* This many pixels are the difference between the outer window (i.e. the |
437 |
|
left of the window manager decoration) and FRAME_X_WINDOW. */ |
438 |
|
int x_pixels_diff; |
439 |
|
|
440 |
|
/* This many pixels are the difference between the outer window (i.e. the |
441 |
|
top of the window manager titlebar) and FRAME_X_WINDOW. */ |
442 |
|
int y_pixels_diff; |
443 |
}; |
}; |
444 |
|
|
445 |
typedef struct mac_output mac_output; |
typedef struct mac_output mac_output; |
446 |
|
|
447 |
|
/* Return the X output data for frame F. */ |
448 |
|
#define FRAME_X_OUTPUT(f) ((f)->output_data.mac) |
449 |
|
|
450 |
/* Return the Mac window used for displaying data in frame F. */ |
/* Return the Mac window used for displaying data in frame F. */ |
451 |
#define FRAME_MAC_WINDOW(f) ((f)->output_data.mac->mWP) |
#define FRAME_MAC_WINDOW(f) ((f)->output_data.mac->mWP) |
452 |
|
#define FRAME_X_WINDOW(f) ((f)->output_data.mac->mWP) |
453 |
|
|
454 |
#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) |
#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) |
455 |
#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel) |
#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel) |
472 |
|
|
473 |
/* This is the `Display *' which frame F is on. */ |
/* This is the `Display *' which frame F is on. */ |
474 |
#define FRAME_MAC_DISPLAY(f) (0) |
#define FRAME_MAC_DISPLAY(f) (0) |
475 |
|
#define FRAME_X_DISPLAY(f) (0) |
476 |
|
|
477 |
/* This is the 'font_info *' which frame F has. */ |
/* This is the 'font_info *' which frame F has. */ |
478 |
#define FRAME_MAC_FONT_TABLE(f) (FRAME_MAC_DISPLAY_INFO (f)->font_table) |
#define FRAME_MAC_FONT_TABLE(f) (FRAME_MAC_DISPLAY_INFO (f)->font_table) |
481 |
#define PIXEL_WIDTH(f) ((f)->output_data.mac->pixel_width) |
#define PIXEL_WIDTH(f) ((f)->output_data.mac->pixel_width) |
482 |
#define PIXEL_HEIGHT(f) ((f)->output_data.mac->pixel_height) |
#define PIXEL_HEIGHT(f) ((f)->output_data.mac->pixel_height) |
483 |
|
|
|
#define FRAME_DESIRED_CURSOR(f) ((f)->output_data.mac->desired_cursor) |
|
|
|
|
484 |
/* Value is the smallest width of any character in any font on frame F. */ |
/* Value is the smallest width of any character in any font on frame F. */ |
485 |
|
|
486 |
#define FRAME_SMALLEST_CHAR_WIDTH(F) \ |
#define FRAME_SMALLEST_CHAR_WIDTH(F) \ |
605 |
|
|
606 |
/* Return the length of the rectangle within which the top of the |
/* Return the length of the rectangle within which the top of the |
607 |
handle must stay. This isn't equivalent to the inside height, |
handle must stay. This isn't equivalent to the inside height, |
608 |
because the scroll bar handle has a minimum height. |
because the scroll bar handle has a minimum height. |
609 |
|
|
610 |
This is the real range of motion for the scroll bar, so when we're |
This is the real range of motion for the scroll bar, so when we're |
611 |
scaling buffer positions to scroll bar positions, we use this, not |
scaling buffer positions to scroll bar positions, we use this, not |
673 |
+ (f)->output_data.mac->internal_border_width) |
+ (f)->output_data.mac->internal_border_width) |
674 |
|
|
675 |
|
|
676 |
/* Return the row/column (zero-based) of the character cell containing |
/* Return the row/column (zero-based) of the character cell containing |
677 |
the pixel on FRAME at ROW/COL. */ |
the pixel on FRAME at ROW/COL. */ |
678 |
#define PIXEL_TO_CHAR_ROW(f, row) \ |
#define PIXEL_TO_CHAR_ROW(f, row) \ |
679 |
(((row) - (f)->output_data.mac->internal_border_width) \ |
(((row) - (f)->output_data.mac->internal_border_width) \ |
695 |
|
|
696 |
struct frame * check_x_frame (Lisp_Object); |
struct frame * check_x_frame (Lisp_Object); |
697 |
|
|
698 |
|
void activate_scroll_bars (FRAME_PTR); |
699 |
|
void deactivate_scroll_bars (FRAME_PTR); |
700 |
|
|
701 |
|
#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0 |
702 |
|
#define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0 |
703 |
|
|