From f3821d294580e2e7285d8cbd28b2a2dc773e31f5 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 6 Apr 2008 01:58:05 +0000 Subject: [PATCH] [!HAVE_CARBON]: Include Quickdraw.h instead of QuickDraw.h. (XtPointer): Move typedef from macmenu.c. (enum button_type): Move enum from macmenu.c. (widget_value): Move typedef from macmenu.c. (M_APPLE, I_ABOUT, EXTRA_STACK_ALLOC, ARGV_STRING_LIST_ID) (DIALOG_LEFT_MARGIN, DIALOG_TOP_MARGIN, DIALOG_RIGHT_MARGIN) (DIALOG_BOTTOM_MARGIN, DIALOG_MIN_INNER_WIDTH, DIALOG_MAX_INNER_WIDTH) (DIALOG_BUTTON_BUTTON_HORIZONTAL_SPACE) (DIALOG_BUTTON_BUTTON_VERTICAL_SPACE, DIALOG_BUTTON_MIN_WIDTH) (DIALOG_TEXT_MIN_HEIGHT, DIALOG_TEXT_BUTTONS_VERTICAL_SPACE) (DIALOG_ICON_WIDTH, DIALOG_ICON_HEIGHT, DIALOG_ICON_LEFT_MARGIN) (DIALOG_ICON_TOP_MARGIN): Move defines from macmenu.c. (Selection): Move typedef from macselect.c. (RAM_TOO_LARGE_ALERT_ID, ABOUT_ALERT_ID) [MAC_OS8]: Move defines from macterm.c. (mac_set_window_title, mac_set_window_modified, mac_is_window_visible) (mac_is_window_collapsed, mac_bring_window_to_front) (mac_send_window_behind, mac_hide_window, mac_show_window) (mac_collapse_window, mac_front_non_floating_window) (mac_active_non_floating_window, mac_activate_window) (mac_move_window_structure, mac_move_window, mac_size_window) (mac_get_global_mouse, mac_is_window_toolbar_visible): New defines. --- src/macgui.h | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/src/macgui.h b/src/macgui.h index b4c013f0dfa..1f4e454c714 100644 --- a/src/macgui.h +++ b/src/macgui.h @@ -71,7 +71,7 @@ typedef unsigned long Time; #undef Z #define Z (current_buffer->text->z) #else /* not HAVE_CARBON */ -#include /* for WindowRef */ +#include /* for WindowRef */ #include /* for GWorldPtr */ #include /* for ThemeCursor */ #include @@ -125,6 +125,28 @@ typedef unsigned long Time; #endif typedef WindowRef Window; +#if TARGET_API_MAC_CARBON +typedef ScrapRef Selection; +#else +typedef int Selection; +#endif +#define mac_set_window_title SetWindowTitleWithCFString +#define mac_set_window_modified SetWindowModified +#define mac_is_window_visible IsWindowVisible +#define mac_is_window_collapsed IsWindowCollapsed +#define mac_bring_window_to_front BringToFront +#define mac_send_window_behind SendBehind +#define mac_hide_window HideWindow +#define mac_show_window ShowWindow +#define mac_collapse_window CollapseWindow +#define mac_front_non_floating_window FrontNonFloatingWindow +#define mac_active_non_floating_window ActiveNonFloatingWindow +#define mac_activate_window ActivateWindow +#define mac_move_window_structure MoveWindowStructure +#define mac_move_window MoveWindow +#define mac_size_window SizeWindow +#define mac_get_global_mouse GetGlobalMouse +#define mac_is_window_toolbar_visible IsWindowToolbarVisible typedef GWorldPtr Pixmap; #define Cursor ThemeCursor @@ -361,6 +383,97 @@ typedef struct { (nr).right = ((nr).left + (width)), \ (nr).bottom = ((nr).top + (height))) +/* Definitions copied from lwlib.h */ + +typedef void * XtPointer; + +enum button_type +{ + BUTTON_TYPE_NONE, + BUTTON_TYPE_TOGGLE, + BUTTON_TYPE_RADIO +}; + +/* This structure is based on the one in ../lwlib/lwlib.h, modified + for Mac OS. */ +typedef struct _widget_value +{ + /* name of widget */ + Lisp_Object lname; + char* name; + /* value (meaning depend on widget type) */ + char* value; + /* keyboard equivalent. no implications for XtTranslations */ + Lisp_Object lkey; + char* key; + /* Help string or nil if none. + GC finds this string through the frame's menu_bar_vector + or through menu_items. */ + Lisp_Object help; + /* true if enabled */ + Boolean enabled; + /* true if selected */ + Boolean selected; + /* The type of a button. */ + enum button_type button_type; + /* true if menu title */ + Boolean title; +#if 0 + /* true if was edited (maintained by get_value) */ + Boolean edited; + /* true if has changed (maintained by lw library) */ + change_type change; + /* true if this widget itself has changed, + but not counting the other widgets found in the `next' field. */ + change_type this_one_change; +#endif + /* Contents of the sub-widgets, also selected slot for checkbox */ + struct _widget_value* contents; + /* data passed to callback */ + XtPointer call_data; + /* next one in the list */ + struct _widget_value* next; +#if 0 + /* slot for the toolkit dependent part. Always initialize to NULL. */ + void* toolkit_data; + /* tell us if we should free the toolkit data slot when freeing the + widget_value itself. */ + Boolean free_toolkit_data; + + /* we resource the widget_value structures; this points to the next + one on the free list if this one has been deallocated. + */ + struct _widget_value *free_list; +#endif +} widget_value; + +#if MAC_OS8 +#define M_APPLE 234 +#define I_ABOUT 1 + +#define EXTRA_STACK_ALLOC (256 * 1024) + +#define ARGV_STRING_LIST_ID 129 +#define RAM_TOO_LARGE_ALERT_ID 129 +#define ABOUT_ALERT_ID 128 +#endif + +#define DIALOG_LEFT_MARGIN (112) +#define DIALOG_TOP_MARGIN (24) +#define DIALOG_RIGHT_MARGIN (24) +#define DIALOG_BOTTOM_MARGIN (20) +#define DIALOG_MIN_INNER_WIDTH (338) +#define DIALOG_MAX_INNER_WIDTH (564) +#define DIALOG_BUTTON_BUTTON_HORIZONTAL_SPACE (12) +#define DIALOG_BUTTON_BUTTON_VERTICAL_SPACE (12) +#define DIALOG_BUTTON_MIN_WIDTH (68) +#define DIALOG_TEXT_MIN_HEIGHT (50) +#define DIALOG_TEXT_BUTTONS_VERTICAL_SPACE (10) +#define DIALOG_ICON_WIDTH (64) +#define DIALOG_ICON_HEIGHT (64) +#define DIALOG_ICON_LEFT_MARGIN (24) +#define DIALOG_ICON_TOP_MARGIN (15) + #endif /* EMACS_MACGUI_H */ /* arch-tag: 5a0da49a-35e2-418b-a58c-8a55778ae849 -- 2.39.2