[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/macmenu.c
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/src/macmenu.c |
Date: |
Fri, 04 Apr 2003 01:23:59 -0500 |
Index: emacs/src/macmenu.c
diff -c emacs/src/macmenu.c:1.8 emacs/src/macmenu.c:1.9
*** emacs/src/macmenu.c:1.8 Sun Dec 22 18:14:51 2002
--- emacs/src/macmenu.c Tue Feb 4 09:03:12 2003
***************
*** 120,126 ****
char* name;
/* value (meaning depend on widget type) */
char* value;
! /* keyboard equivalent. no implications for XtTranslations */
char* key;
/* Help string or nil if none.
GC finds this string through the frame's menu_bar_vector
--- 120,126 ----
char* name;
/* value (meaning depend on widget type) */
char* value;
! /* keyboard equivalent. no implications for XtTranslations */
char* key;
/* Help string or nil if none.
GC finds this string through the frame's menu_bar_vector
***************
*** 174,180 ****
#define TRUE 1
#define FALSE 0
#endif /* no TRUE */
!
Lisp_Object Vmenu_updating_frame;
Lisp_Object Qdebug_on_next_call;
--- 174,180 ----
#define TRUE 1
#define FALSE 0
#endif /* no TRUE */
!
Lisp_Object Vmenu_updating_frame;
Lisp_Object Qdebug_on_next_call;
***************
*** 507,513 ****
/* This is a subroutine of single_keymap_panes that handles one
keymap entry.
! KEY is a key in a keymap and ITEM is its binding.
PENDING_MAPS_PTR points to a list of keymaps waiting to be made into
separate panes.
If NOTREAL is nonzero, only check for equivalent key bindings, don't
--- 507,513 ----
/* This is a subroutine of single_keymap_panes that handles one
keymap entry.
! KEY is a key in a keymap and ITEM is its binding.
PENDING_MAPS_PTR points to a list of keymaps waiting to be made into
separate panes.
If NOTREAL is nonzero, only check for equivalent key bindings, don't
***************
*** 523,529 ****
Lisp_Object map, item_string, enabled;
struct gcpro gcpro1, gcpro2;
int res;
!
/* Parse the menu item and leave the result in item_properties. */
GCPRO2 (key, item);
res = parse_menu_item (item, notreal, 0);
--- 523,529 ----
Lisp_Object map, item_string, enabled;
struct gcpro gcpro1, gcpro2;
int res;
!
/* Parse the menu item and leave the result in item_properties. */
GCPRO2 (key, item);
res = parse_menu_item (item, notreal, 0);
***************
*** 532,538 ****
return; /* Not a menu item. */
map = XVECTOR (item_properties)->contents[ITEM_PROPERTY_MAP];
!
if (notreal)
{
/* We don't want to make a menu, just traverse the keymaps to
--- 532,538 ----
return; /* Not a menu item. */
map = XVECTOR (item_properties)->contents[ITEM_PROPERTY_MAP];
!
if (notreal)
{
/* We don't want to make a menu, just traverse the keymaps to
***************
*** 543,549 ****
}
enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE];
! item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME];
if (!NILP (map) && SREF (item_string, 0) == '@')
{
--- 543,549 ----
}
enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE];
! item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME];
if (!NILP (map) && SREF (item_string, 0) == '@')
{
***************
*** 818,824 ****
keymaps = 0;
}
!
if (NILP (position))
{
discard_menu_items ();
--- 818,824 ----
keymaps = 0;
}
!
if (NILP (position))
{
discard_menu_items ();
***************
*** 971,977 ****
But first we recompute the menu bar contents (the whole tree).
This way we can safely execute Lisp code. */
!
void
x_activate_menubar (f)
FRAME_PTR f;
--- 971,977 ----
But first we recompute the menu bar contents (the whole tree).
This way we can safely execute Lisp code. */
!
void
x_activate_menubar (f)
FRAME_PTR f;
***************
*** 1182,1188 ****
first_wv = wv;
save_wv = 0;
prev_wv = 0;
!
/* Loop over all panes and items made during this call
and construct a tree of widget_value objects.
Ignore the panes and items made by previous calls to
--- 1182,1188 ----
first_wv = wv;
save_wv = 0;
prev_wv = 0;
!
/* Loop over all panes and items made during this call
and construct a tree of widget_value objects.
Ignore the panes and items made by previous calls to
***************
*** 1286,1292 ****
#endif /* not HAVE_MULTILINGUAL_MENU */
wv = xmalloc_widget_value ();
! if (prev_wv)
prev_wv->next = wv;
else
save_wv->contents = wv;
--- 1286,1292 ----
#endif /* not HAVE_MULTILINGUAL_MENU */
wv = xmalloc_widget_value ();
! if (prev_wv)
prev_wv->next = wv;
else
save_wv->contents = wv;
***************
*** 1432,1438 ****
break;
wv = single_submenu (key, string, maps);
! if (prev_wv)
prev_wv->next = wv;
else
first_wv->contents = wv;
--- 1432,1438 ----
break;
wv = single_submenu (key, string, maps);
! if (prev_wv)
prev_wv->next = wv;
else
first_wv->contents = wv;
***************
*** 1508,1514 ****
This value just has to be different from small integers. */
wv->call_data = (void *) (EMACS_INT) (-1);
! if (prev_wv)
prev_wv->next = wv;
else
first_wv->contents = wv;
--- 1508,1514 ----
This value just has to be different from small integers. */
wv->call_data = (void *) (EMACS_INT) (-1);
! if (prev_wv)
prev_wv->next = wv;
else
first_wv->contents = wv;
***************
*** 1537,1543 ****
DisposeMenu (menu);
menu = GetMenuHandle (++i);
}
!
i = MIN_SUBMENU_ID;
menu = GetMenuHandle (i);
while (menu != NULL)
--- 1537,1543 ----
DisposeMenu (menu);
menu = GetMenuHandle (++i);
}
!
i = MIN_SUBMENU_ID;
menu = GetMenuHandle (i);
while (menu != NULL)
***************
*** 1549,1557 ****
}
fill_menubar (first_wv->contents);
!
DrawMenuBar ();
!
free_menubar_widget_value_tree (first_wv);
UNBLOCK_INPUT;
--- 1549,1557 ----
}
fill_menubar (first_wv->contents);
!
DrawMenuBar ();
!
free_menubar_widget_value_tree (first_wv);
UNBLOCK_INPUT;
***************
*** 1640,1646 ****
wv->help = Qnil;
first_wv = wv;
first_pane = 1;
!
/* Loop over all panes and items, filling in the tree. */
i = 0;
while (i < menu_items_used)
--- 1640,1646 ----
wv->help = Qnil;
first_wv = wv;
first_pane = 1;
!
/* Loop over all panes and items, filling in the tree. */
i = 0;
while (i < menu_items_used)
***************
*** 1743,1751 ****
#endif /* not HAVE_MULTILINGUAL_MENU */
wv = xmalloc_widget_value ();
! if (prev_wv)
prev_wv->next = wv;
! else
save_wv->contents = wv;
wv->name = (char *) SDATA (item_name);
if (!NILP (descrip))
--- 1743,1751 ----
#endif /* not HAVE_MULTILINGUAL_MENU */
wv = xmalloc_widget_value ();
! if (prev_wv)
prev_wv->next = wv;
! else
save_wv->contents = wv;
wv->name = (char *) SDATA (item_name);
if (!NILP (descrip))
***************
*** 1830,1843 ****
menu_item_selection = LoWord (menu_item_choice);
/* Get the refcon to find the correct item*/
! if (menu_item_selection)
{
menu = GetMenuHandle (HiWord (menu_item_choice));
if (menu) {
GetMenuItemRefCon (menu, menu_item_selection, &refcon);
}
}
!
#if 0
/* Clean up extraneous mouse events which might have been generated
during the call. */
--- 1830,1843 ----
menu_item_selection = LoWord (menu_item_choice);
/* Get the refcon to find the correct item*/
! if (menu_item_selection)
{
menu = GetMenuHandle (HiWord (menu_item_choice));
if (menu) {
GetMenuItemRefCon (menu, menu_item_selection, &refcon);
}
}
!
#if 0
/* Clean up extraneous mouse events which might have been generated
during the call. */
***************
*** 1944,1956 ****
SInt16 part_code;
int control_part_code;
Point mouse;
!
dialog_name = wv->name;
nb_buttons = dialog_name[1] - '0';
left_count = nb_buttons - (dialog_name[4] - '0');
button_labels = (char **) alloca (sizeof (char *) * nb_buttons);
ref_cons = (UInt32 *) alloca (sizeof (UInt32) * nb_buttons);
!
wv = wv->contents;
prompt = (char *) alloca (strlen (wv->value) + 1);
strcpy (prompt, wv->value);
--- 1944,1956 ----
SInt16 part_code;
int control_part_code;
Point mouse;
!
dialog_name = wv->name;
nb_buttons = dialog_name[1] - '0';
left_count = nb_buttons - (dialog_name[4] - '0');
button_labels = (char **) alloca (sizeof (char *) * nb_buttons);
ref_cons = (UInt32 *) alloca (sizeof (UInt32) * nb_buttons);
!
wv = wv->contents;
prompt = (char *) alloca (strlen (wv->value) + 1);
strcpy (prompt, wv->value);
***************
*** 1974,1980 ****
#else
SetPort (window_ptr);
#endif
!
TextFont (0);
/* Left and right margins in the dialog are 13 pixels each.*/
dialog_width = 14;
--- 1974,1980 ----
#else
SetPort (window_ptr);
#endif
!
TextFont (0);
/* Left and right margins in the dialog are 13 pixels each.*/
dialog_width = 14;
***************
*** 1996,2002 ****
#else
SetPort (window_ptr);
#endif
!
TextFont (0);
MoveTo (13, 29);
--- 1996,2002 ----
#else
SetPort (window_ptr);
#endif
!
TextFont (0);
MoveTo (13, 29);
***************
*** 2034,2040 ****
}
DisposeWindow (window_ptr);
!
return i;
}
--- 2034,2040 ----
}
DisposeWindow (window_ptr);
!
return i;
}
***************
*** 2076,2082 ****
pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME];
prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX];
pane_string = (NILP (pane_name)
! ? "" : (char *) SDATA (pane_name));
prev_wv = xmalloc_widget_value ();
prev_wv->value = pane_string;
if (keymaps && !NILP (prefix))
--- 2076,2082 ----
pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME];
prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX];
pane_string = (NILP (pane_name)
! ? "" : (char *) SDATA (pane_name));
prev_wv = xmalloc_widget_value ();
prev_wv->value = pane_string;
if (keymaps && !NILP (prefix))
***************
*** 2085,2096 ****
prev_wv->name = "message";
prev_wv->help = Qnil;
first_wv = prev_wv;
!
/* Loop over all panes and items, filling in the tree. */
i = MENU_ITEMS_PANE_LENGTH;
while (i < menu_items_used)
{
!
/* Create a new item within current pane. */
Lisp_Object item_name, enable, descrip, help;
--- 2085,2096 ----
prev_wv->name = "message";
prev_wv->help = Qnil;
first_wv = prev_wv;
!
/* Loop over all panes and items, filling in the tree. */
i = MENU_ITEMS_PANE_LENGTH;
while (i < menu_items_used)
{
!
/* Create a new item within current pane. */
Lisp_Object item_name, enable, descrip, help;
***************
*** 2099,2105 ****
descrip
= XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP];
!
if (NILP (item_name))
{
free_menubar_widget_value_tree (first_wv);
--- 2099,2105 ----
descrip
= XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP];
!
if (NILP (item_name))
{
free_menubar_widget_value_tree (first_wv);
***************
*** 2240,2249 ****
if (name_is_separator (wv->name))
AppendMenu (menu, "\p-");
! else
{
AppendMenu (menu, "\pX");
!
#if TARGET_API_MAC_CARBON
pos = CountMenuItems (menu);
#else
--- 2240,2249 ----
if (name_is_separator (wv->name))
AppendMenu (menu, "\p-");
! else
{
AppendMenu (menu, "\pX");
!
#if TARGET_API_MAC_CARBON
pos = CountMenuItems (menu);
#else
***************
*** 2340,2346 ****
{
MenuHandle menu;
Str255 title;
!
strncpy (title, wv->name, 255);
title[255] = 0;
c2pstr (title);
--- 2340,2346 ----
{
MenuHandle menu;
Str255 title;
!
strncpy (title, wv->name, 255);
title[255] = 0;
c2pstr (title);
***************
*** 2348,2354 ****
if (wv->contents)
fill_menu (menu, wv->contents);
!
InsertMenu (menu, 0);
}
}
--- 2348,2354 ----
if (wv->contents)
fill_menu (menu, wv->contents);
!
InsertMenu (menu, 0);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/src/macmenu.c,
Miles Bader <=