• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/src/

Lines Matching +defs:buffer +defs:menu

64 #include "buffer.h"
411 /* Holds the address of the text-mode screen buffer. */
427 /* Update the screen from a part of relocated DOS/V screen buffer which
887 glyph during the construction of the buffer that is then blitted to
1113 /* The allocated buffer for screen writes is too small.
1125 /* Prepare to reuse the same buffer again. */
1130 /* There's enough place in the allocated buffer to add
1162 /* Dump whatever is left in the screen buffer. */
1355 /* Find the glyph matrix position of buffer position POS in window W.
1375 /* If the position sought is the end of the buffer,
1378 && pos == BUF_ZV (XBUFFER (w->buffer)))
1415 /* If we're looking for the end of the buffer,
1492 /* When a menu is active, don't highlight because this looks odd. */
1537 And verify the buffer's text has not changed. */
1539 && EQ (w->window_end_valid, w->buffer)
1540 && XFASTINT (w->last_modified) == BUF_MODIFF (XBUFFER (w->buffer))
1542 == BUF_OVERLAY_MODIFF (XBUFFER (w->buffer))))
1590 struct buffer *obuf;
1593 if (pos > BUF_Z (XBUFFER (w->buffer)))
1596 /* Make the window's buffer temporarily current for
1599 current_buffer = XBUFFER (w->buffer);
1641 w->buffer);
1679 XSETINT (end, (BUF_Z (XBUFFER (w->buffer))
1684 w->buffer, beginning);
1687 w->buffer, end);
1968 if (NILP (w->buffer))
1978 if (NILP (w->buffer) || i < w->desired_matrix->nrows)
2025 buffer-local value or the value from the frame parameters if the
2026 buffer doesn't define its local value for the cursor type. */
2036 struct buffer *b = XBUFFER (sw->buffer);
2170 already point to the relocated buffer address returned by
3521 /* These hold text of the current and the previous menu help messages. */
3523 /* Pane number and item number of the menu item which generated the
3524 last menu help message. */
3530 XMenu *menu;
3532 menu = (XMenu *) xmalloc (sizeof (XMenu));
3533 menu->allocated = menu->count = menu->panecount = menu->width = 0;
3534 return menu;
3541 IT_menu_make_room (XMenu *menu)
3543 if (menu->allocated == 0)
3545 int count = menu->allocated = 10;
3546 menu->text = (char **) xmalloc (count * sizeof (char *));
3547 menu->submenu = (XMenu **) xmalloc (count * sizeof (XMenu *));
3548 menu->panenumber = (int *) xmalloc (count * sizeof (int));
3549 menu->help_text = (char **) xmalloc (count * sizeof (char *));
3551 else if (menu->allocated == menu->count)
3553 int count = menu->allocated = menu->allocated + 10;
3554 menu->text
3555 = (char **) xrealloc (menu->text, count * sizeof (char *));
3556 menu->submenu
3557 = (XMenu **) xrealloc (menu->submenu, count * sizeof (XMenu *));
3558 menu->panenumber
3559 = (int *) xrealloc (menu->panenumber, count * sizeof (int));
3560 menu->help_text
3561 = (char **) xrealloc (menu->help_text, count * sizeof (char *));
3565 /* Search the given menu structure for a given pane number. */
3568 IT_menu_search_pane (XMenu *menu, int pane)
3573 for (i = 0; i < menu->count; i++)
3574 if (menu->submenu[i])
3576 if (pane == menu->panenumber[i])
3577 return menu->submenu[i];
3578 if ((try = IT_menu_search_pane (menu->submenu[i], pane)))
3584 /* Determine how much screen space a given menu needs. */
3587 IT_menu_calc_size (XMenu *menu, int *width, int *height)
3592 maxheight = menu->count;
3593 for (i = 0; i < menu->count; i++)
3595 if (menu->submenu[i])
3597 IT_menu_calc_size (menu->submenu[i], &w2, &h2);
3602 *width = menu->width + maxsubwidth;
3609 IT_menu_display (XMenu *menu, int y, int x, int pn, int *faces, int disp_help)
3618 width = menu->width;
3623 for (i = 0; i < menu->count; i++)
3629 = (!menu->submenu[i] && menu->panenumber[i]) || (menu->submenu[i]);
3632 /* The following if clause means that we display the menu help
3633 strings even if the menu item is currently disabled. */
3636 menu_help_message = menu->help_text[i];
3643 for (j = 0, q = menu->text[i]; *q; j++)
3659 /* Don't let the menu text overflow into the next screen row. */
3668 SET_CHAR_GLYPH (*p, menu->submenu[i] ? 16 : ' ', face, 0);
3685 /* Create a brand new menu structure. */
3698 XMenuAddPane (Display *foo, XMenu *menu, char *txt, int enable)
3706 IT_menu_make_room (menu);
3707 menu->submenu[menu->count] = IT_menu_create ();
3708 menu->text[menu->count] = txt;
3709 menu->panenumber[menu->count] = ++menu->panecount;
3710 menu->help_text[menu->count] = NULL;
3711 menu->count++;
3719 if (len > menu->width)
3720 menu->width = len;
3722 return menu->panecount;
3725 /* Create a new item in a menu pane. */
3728 XMenuAddSelection (Display *bar, XMenu *menu, int pane,
3735 if (!(menu = IT_menu_search_pane (menu, pane)))
3737 IT_menu_make_room (menu);
3738 menu->submenu[menu->count] = (XMenu *) 0;
3739 menu->text[menu->count] = txt;
3740 menu->panenumber[menu->count] = enable;
3741 menu->help_text[menu->count] = help_text;
3742 menu->count++;
3750 if (len > menu->width)
3751 menu->width = len;
3756 /* Decide where the menu would be placed if requested at (X,Y). */
3759 XMenuLocate (Display *foo0, XMenu *menu, int foo1, int foo2, int x, int y,
3762 IT_menu_calc_size (menu, width, height);
3771 XMenu *menu;
3777 /* Display menu, wait for user's response, and return that response. */
3780 XMenuActivate (Display *foo, XMenu *menu, int *pane, int *selidx,
3786 int title_faces[4]; /* face to display the menu title */
3794 /* Don't allow non-positive x0 and y0, lest the menu will wrap
3805 state = alloca (menu->panecount * sizeof (struct IT_menu_state));
3808 = lookup_derived_face (sf, intern ("msdos-menu-passive-face"),
3811 = lookup_derived_face (sf, intern ("msdos-menu-active-face"),
3813 selectface = intern ("msdos-menu-select-face");
3819 /* Make sure the menu title is always displayed with
3820 `msdos-menu-active-face', no matter where the mouse pointer is. */
3826 /* Don't let the title for the "Buffers" popup menu include a
3832 if (strncmp (menu->text[0], "Buffers 1", 9) == 0)
3834 menu->text[0][7] = '\0';
3842 state[0].menu = menu;
3846 /* Turn off the cursor. Otherwise it shows through the menu
3850 /* Display the menu title. */
3851 IT_menu_display (menu, y0 - 1, x0 - 1, 1, title_faces, 0);
3853 menu->text[0][7] = ' ';
3854 if ((onepane = menu->count == 1 && menu->submenu[0]))
3856 menu->width = menu->submenu[0]->width;
3857 state[0].menu = menu->submenu[0];
3861 state[0].menu = menu;
3879 if (state[i].x <= x && x < state[i].x + state[i].menu->width + 2)
3882 if (0 <= dy && dy < state[i].menu->count)
3884 if (!state[i].menu->submenu[dy])
3885 if (state[i].menu->panenumber[dy])
3891 /* We hit some part of a menu, so drop extra menus that
3895 || state[i].menu->submenu[dy] != state[i+1].menu)
3905 if (i == statecount - 1 && state[i].menu->submenu[dy])
3907 IT_menu_display (state[i].menu,
3912 state[statecount].menu = state[i].menu->submenu[dy];
3913 state[statecount].pane = state[i].menu->panenumber[dy];
3918 = state[i].x + state[i].menu->width + 2;
3924 IT_menu_display (state[statecount - 1].menu,
3947 that order. This avoids popping down the menu pane unless
3965 screen contents as it was before we started drawing this menu.
3969 of menu items chosen by the user.) However, if the menu had some
3988 These events are likely to be generated before the menu was even
3990 (which invoked the menu) too quickly. If we don't remove these events,
4001 /* Dispose of a menu. */
4004 XMenuDestroy (Display *foo, XMenu *menu)
4007 if (menu->allocated)
4009 for (i = 0; i < menu->count; i++)
4010 if (menu->submenu[i])
4011 XMenuDestroy (foo, menu->submenu[i]);
4012 xfree (menu->text);
4013 xfree (menu->submenu);
4014 xfree (menu->panenumber);
4015 xfree (menu->help_text);
4017 xfree (menu);
4145 cause relocation of the buffer whose address we get in ADDR.
4160 __write (int handle, const void *buffer, size_t count)
4166 return _write (handle, buffer, count);
4170 const char *bp = buffer;