/* Menu support for GNU Emacs on the for Mac OS.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include "charset.h"
#include "coding.h"
-#ifdef MAC_OSX
-#undef mktime
-#undef DEBUG
-#undef Z
-#undef free
-#undef malloc
-#undef realloc
-/* Macros max and min defined in lisp.h conflict with those in
- precompiled header Carbon.h. */
-#undef max
-#undef min
-#undef init_process
-#include <Carbon/Carbon.h>
-#undef Z
-#define Z (current_buffer->text->z)
-#undef free
-#define free unexec_free
-#undef malloc
-#define malloc unexec_malloc
-#undef realloc
-#define realloc unexec_realloc
-#undef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#undef max
-#define max(a, b) ((a) > (b) ? (a) : (b))
-#undef init_process
-#define init_process emacs_init_process
-#else /* not MAC_OSX */
+#ifndef MAC_OSX
#include <MacTypes.h>
#include <Menus.h>
#include <QuickDraw.h>
CHECK_LIVE_WINDOW (window);
f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
- xpos = (FONT_WIDTH (FRAME_FONT (f))
- * XFASTINT (XWINDOW (window)->left));
- ypos = (FRAME_LINE_HEIGHT (f)
- * XFASTINT (XWINDOW (window)->top));
+ xpos = WINDOW_LEFT_EDGE_X (XWINDOW (window));
+ ypos = WINDOW_TOP_EDGE_Y (XWINDOW (window));
}
else
/* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME,
int j;
struct input_event buf;
Lisp_Object frame;
+ EVENT_INIT (buf);
XSETFRAME (frame, f);
buf.kind = MENU_BAR_EVENT;
for (i = 0; i < previous_menu_items_used; i++)
if (menu_items_used == i
- || (!Fequal (previous_items[i], XVECTOR (menu_items)->contents[i])))
+ || (NILP (Fequal (previous_items[i],
+ XVECTOR (menu_items)->contents[i]))))
break;
if (i == menu_items_used && i == previous_menu_items_used && i != 0)
{
pos.h = x;
pos.v = y;
-#if TARGET_API_MAC_CARBON
- SetPort (GetWindowPort (FRAME_MAC_WINDOW (f)));
-#else
- SetPort (FRAME_MAC_WINDOW (f));
-#endif
+ SetPortWindowPort (FRAME_MAC_WINDOW (f));
LocalToGlobal (&pos);
window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowPtr) -1);
-#if TARGET_API_MAC_CARBON
- SetPort (GetWindowPort (window_ptr));
-#else
- SetPort (window_ptr);
-#endif
+ SetPortWindowPort (window_ptr);
TextFont (0);
/* Left and right margins in the dialog are 13 pixels each.*/
SizeWindow (window_ptr, dialog_width, 78, 0);
ShowWindow (window_ptr);
-#if TARGET_API_MAC_CARBON
- SetPort (GetWindowPort (window_ptr));
-#else
- SetPort (window_ptr);
-#endif
+ SetPortWindowPort (window_ptr);
TextFont (0);
defsubr (&Sx_popup_dialog);
#endif
}
+
+/* arch-tag: 40b2c6c7-b8a9-4a49-b930-1b2707184cce
+ (do not change this comment) */