comparison src/xmenu.c @ 51212:332134065648

Make (some) trivial substitutions for renamed and new macros in dispextern.h, frame.h and window.h.
author Kim F. Storm <storm@cua.dk>
date Sat, 24 May 2003 22:09:50 +0000
parents 20b3d6c3c7e5
children e518bae63784
comparison
equal deleted inserted replaced
51211:28ea05de2dc5 51212:332134065648
707 707
708 UNBLOCK_INPUT; 708 UNBLOCK_INPUT;
709 709
710 /* xmenu_show expects window coordinates, not root window 710 /* xmenu_show expects window coordinates, not root window
711 coordinates. Translate. */ 711 coordinates. Translate. */
712 *x -= f->output_data.x->left_pos 712 *x -= f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
713 + FRAME_OUTER_TO_INNER_DIFF_X (f); 713 *y -= f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
714 *y -= f->output_data.x->top_pos
715 + FRAME_OUTER_TO_INNER_DIFF_Y (f);
716 } 714 }
717 715
718 #endif /* HAVE_X_WINDOWS */ 716 #endif /* HAVE_X_WINDOWS */
719 717
720 DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, 718 DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0,
859 else if (WINDOWP (window)) 857 else if (WINDOWP (window))
860 { 858 {
861 CHECK_LIVE_WINDOW (window); 859 CHECK_LIVE_WINDOW (window);
862 f = XFRAME (WINDOW_FRAME (XWINDOW (window))); 860 f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
863 861
864 xpos = (FONT_WIDTH (FRAME_FONT (f)) 862 xpos = WINDOW_LEFT_EDGE_X (XWINDOW (window));
865 * XFASTINT (XWINDOW (window)->left)); 863 ypos = WINDOW_TOP_EDGE_Y (XWINDOW (window));
866 ypos = (FRAME_LINE_HEIGHT (f)
867 * XFASTINT (XWINDOW (window)->top));
868 } 864 }
869 else 865 else
870 /* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME, 866 /* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME,
871 but I don't want to make one now. */ 867 but I don't want to make one now. */
872 CHECK_WINDOW (window); 868 CHECK_WINDOW (window);
1777 return 0; 1773 return 0;
1778 1774
1779 BLOCK_INPUT; 1775 BLOCK_INPUT;
1780 /* Save the size of the frame because the pane widget doesn't accept 1776 /* Save the size of the frame because the pane widget doesn't accept
1781 to resize itself. So force it. */ 1777 to resize itself. So force it. */
1782 columns = f->width; 1778 columns = FRAME_COLS (f);
1783 rows = f->height; 1779 rows = FRAME_LINES (f);
1784 1780
1785 /* Do the voodoo which means "I'm changing lots of things, don't try 1781 /* Do the voodoo which means "I'm changing lots of things, don't try
1786 to refigure sizes until I'm done." */ 1782 to refigure sizes until I'm done." */
1787 lw_refigure_widget (x->column_widget, False); 1783 lw_refigure_widget (x->column_widget, False);
1788 1784
2312 { 2308 {
2313 /* Not invoked by a click. pop up at x/y. */ 2309 /* Not invoked by a click. pop up at x/y. */
2314 pos_func = menu_position_func; 2310 pos_func = menu_position_func;
2315 2311
2316 /* Adjust coordinates to be root-window-relative. */ 2312 /* Adjust coordinates to be root-window-relative. */
2317 x += f->output_data.x->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f); 2313 x += f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
2318 y += f->output_data.x->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f); 2314 y += f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
2319 2315
2320 popup_x_y.x = x; 2316 popup_x_y.x = x;
2321 popup_x_y.y = y; 2317 popup_x_y.y = y;
2322 popup_x_y.f = f; 2318 popup_x_y.f = f;
2323 } 2319 }
2400 dummy.subwindow = dummy.root; 2396 dummy.subwindow = dummy.root;
2401 dummy.x = x; 2397 dummy.x = x;
2402 dummy.y = y; 2398 dummy.y = y;
2403 2399
2404 /* Adjust coordinates to be root-window-relative. */ 2400 /* Adjust coordinates to be root-window-relative. */
2405 x += f->output_data.x->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f); 2401 x += f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
2406 y += f->output_data.x->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f); 2402 y += f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
2407 2403
2408 dummy.x_root = x; 2404 dummy.x_root = x;
2409 dummy.y_root = y; 2405 dummy.y_root = y;
2410 2406
2411 dummy.state = 0; 2407 dummy.state = 0;
3118 } 3114 }
3119 } 3115 }
3120 #endif /* HAVE_X_WINDOWS */ 3116 #endif /* HAVE_X_WINDOWS */
3121 3117
3122 /* Adjust coordinates to be root-window-relative. */ 3118 /* Adjust coordinates to be root-window-relative. */
3123 x += f->output_data.x->left_pos; 3119 x += f->left_pos;
3124 y += f->output_data.x->top_pos; 3120 y += f->top_pos;
3125 3121
3126 /* Create all the necessary panes and their items. */ 3122 /* Create all the necessary panes and their items. */
3127 i = 0; 3123 i = 0;
3128 while (i < menu_items_used) 3124 while (i < menu_items_used)
3129 { 3125 {