diff options
| author | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
| commit | 971de7fb158335fbda39525feb2d7776a26bc030 (patch) | |
| tree | 605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/xmenu.c | |
| parent | b8463cbfbe2c5183cf40772df2746e58b787ddeb (diff) | |
| download | emacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip | |
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C.
* src/atimer.c:
* src/bidi.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/ccl.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/doprnt.c:
* src/ecrt0.c:
* src/editfns.c:
* src/fileio.c:
* src/filelock.c:
* src/filemode.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/ftfont.c:
* src/ftxfont.c:
* src/gtkutil.c:
* src/indent.c:
* src/insdel.c:
* src/intervals.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/md5.c:
* src/menu.c:
* src/minibuf.c:
* src/prefix-args.c:
* src/print.c:
* src/ralloc.c:
* src/regex.c:
* src/region-cache.c:
* src/scroll.c:
* src/search.c:
* src/sound.c:
* src/strftime.c:
* src/syntax.c:
* src/sysdep.c:
* src/termcap.c:
* src/terminal.c:
* src/terminfo.c:
* src/textprop.c:
* src/tparam.c:
* src/undo.c:
* src/unexelf.c:
* src/window.c:
* src/xfaces.c:
* src/xfns.c:
* src/xfont.c:
* src/xftfont.c:
* src/xgselect.c:
* src/xmenu.c:
* src/xrdb.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c:
* src/xterm.c: Likewise.
Diffstat (limited to 'src/xmenu.c')
| -rw-r--r-- | src/xmenu.c | 83 |
1 files changed, 20 insertions, 63 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 189bcbf9a25..deb7c091877 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -196,10 +196,7 @@ menubar_id_to_frame (id) | |||
| 196 | the scroll bar or the edit window. Fx_popup_menu needs to be | 196 | the scroll bar or the edit window. Fx_popup_menu needs to be |
| 197 | sure it is the edit window. */ | 197 | sure it is the edit window. */ |
| 198 | void | 198 | void |
| 199 | mouse_position_for_popup (f, x, y) | 199 | mouse_position_for_popup (FRAME_PTR f, int *x, int *y) |
| 200 | FRAME_PTR f; | ||
| 201 | int *x; | ||
| 202 | int *y; | ||
| 203 | { | 200 | { |
| 204 | Window root, dummy_window; | 201 | Window root, dummy_window; |
| 205 | int dummy; | 202 | int dummy; |
| @@ -391,8 +388,7 @@ for instance using the window manager, then this produces a quit and | |||
| 391 | /* Set menu_items_inuse so no other popup menu or dialog is created. */ | 388 | /* Set menu_items_inuse so no other popup menu or dialog is created. */ |
| 392 | 389 | ||
| 393 | void | 390 | void |
| 394 | x_menu_set_in_use (in_use) | 391 | x_menu_set_in_use (int in_use) |
| 395 | int in_use; | ||
| 396 | { | 392 | { |
| 397 | menu_items_inuse = in_use ? Qt : Qnil; | 393 | menu_items_inuse = in_use ? Qt : Qnil; |
| 398 | popup_activated_flag = in_use; | 394 | popup_activated_flag = in_use; |
| @@ -638,9 +634,7 @@ If FRAME is nil or not given, use the selected frame. */) | |||
| 638 | Used for popup menus and dialogs. */ | 634 | Used for popup menus and dialogs. */ |
| 639 | 635 | ||
| 640 | static void | 636 | static void |
| 641 | popup_widget_loop (do_timers, widget) | 637 | popup_widget_loop (int do_timers, GtkWidget *widget) |
| 642 | int do_timers; | ||
| 643 | GtkWidget *widget; | ||
| 644 | { | 638 | { |
| 645 | ++popup_activated_flag; | 639 | ++popup_activated_flag; |
| 646 | 640 | ||
| @@ -668,8 +662,7 @@ popup_widget_loop (do_timers, widget) | |||
| 668 | execute Lisp code. */ | 662 | execute Lisp code. */ |
| 669 | 663 | ||
| 670 | void | 664 | void |
| 671 | x_activate_menubar (f) | 665 | x_activate_menubar (FRAME_PTR f) |
| 672 | FRAME_PTR f; | ||
| 673 | { | 666 | { |
| 674 | if (! FRAME_X_P (f)) | 667 | if (! FRAME_X_P (f)) |
| 675 | abort (); | 668 | abort (); |
| @@ -724,9 +717,7 @@ popup_activate_callback (widget, id, client_data) | |||
| 724 | 717 | ||
| 725 | #ifdef USE_GTK | 718 | #ifdef USE_GTK |
| 726 | static void | 719 | static void |
| 727 | popup_deactivate_callback (widget, client_data) | 720 | popup_deactivate_callback (GtkWidget *widget, gpointer client_data) |
| 728 | GtkWidget *widget; | ||
| 729 | gpointer client_data; | ||
| 730 | { | 721 | { |
| 731 | popup_activated_flag = 0; | 722 | popup_activated_flag = 0; |
| 732 | } | 723 | } |
| @@ -746,10 +737,7 @@ popup_deactivate_callback (widget, id, client_data) | |||
| 746 | for that widget. | 737 | for that widget. |
| 747 | F is the frame if known, or NULL if not known. */ | 738 | F is the frame if known, or NULL if not known. */ |
| 748 | static void | 739 | static void |
| 749 | show_help_event (f, widget, help) | 740 | show_help_event (FRAME_PTR f, xt_or_gtk_widget widget, Lisp_Object help) |
| 750 | FRAME_PTR f; | ||
| 751 | xt_or_gtk_widget widget; | ||
| 752 | Lisp_Object help; | ||
| 753 | { | 741 | { |
| 754 | Lisp_Object frame; | 742 | Lisp_Object frame; |
| 755 | 743 | ||
| @@ -787,9 +775,7 @@ show_help_event (f, widget, help) | |||
| 787 | 775 | ||
| 788 | #ifdef USE_GTK | 776 | #ifdef USE_GTK |
| 789 | void | 777 | void |
| 790 | menu_highlight_callback (widget, call_data) | 778 | menu_highlight_callback (GtkWidget *widget, gpointer call_data) |
| 791 | GtkWidget *widget; | ||
| 792 | gpointer call_data; | ||
| 793 | { | 779 | { |
| 794 | xg_menu_item_cb_data *cb_data; | 780 | xg_menu_item_cb_data *cb_data; |
| 795 | Lisp_Object help; | 781 | Lisp_Object help; |
| @@ -839,9 +825,7 @@ static int xg_crazy_callback_abort; | |||
| 839 | Figure out what the user chose | 825 | Figure out what the user chose |
| 840 | and put the appropriate events into the keyboard buffer. */ | 826 | and put the appropriate events into the keyboard buffer. */ |
| 841 | static void | 827 | static void |
| 842 | menubar_selection_callback (widget, client_data) | 828 | menubar_selection_callback (GtkWidget *widget, gpointer client_data) |
| 843 | GtkWidget *widget; | ||
| 844 | gpointer client_data; | ||
| 845 | { | 829 | { |
| 846 | xg_menu_item_cb_data *cb_data = (xg_menu_item_cb_data*) client_data; | 830 | xg_menu_item_cb_data *cb_data = (xg_menu_item_cb_data*) client_data; |
| 847 | 831 | ||
| @@ -903,8 +887,7 @@ menubar_selection_callback (widget, id, client_data) | |||
| 903 | changed. Value is non-zero if widgets were updated. */ | 887 | changed. Value is non-zero if widgets were updated. */ |
| 904 | 888 | ||
| 905 | static int | 889 | static int |
| 906 | update_frame_menubar (f) | 890 | update_frame_menubar (FRAME_PTR f) |
| 907 | FRAME_PTR f; | ||
| 908 | { | 891 | { |
| 909 | #ifdef USE_GTK | 892 | #ifdef USE_GTK |
| 910 | return xg_update_frame_menubar (f); | 893 | return xg_update_frame_menubar (f); |
| @@ -995,10 +978,7 @@ apply_systemfont_to_menu (w) | |||
| 995 | it is set the first time this is called, from initialize_frame_menubar. */ | 978 | it is set the first time this is called, from initialize_frame_menubar. */ |
| 996 | 979 | ||
| 997 | void | 980 | void |
| 998 | set_frame_menubar (f, first_time, deep_p) | 981 | set_frame_menubar (FRAME_PTR f, int first_time, int deep_p) |
| 999 | FRAME_PTR f; | ||
| 1000 | int first_time; | ||
| 1001 | int deep_p; | ||
| 1002 | { | 982 | { |
| 1003 | xt_or_gtk_widget menubar_widget; | 983 | xt_or_gtk_widget menubar_widget; |
| 1004 | #ifdef USE_X_TOOLKIT | 984 | #ifdef USE_X_TOOLKIT |
| @@ -1347,8 +1327,7 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1347 | is visible. */ | 1327 | is visible. */ |
| 1348 | 1328 | ||
| 1349 | void | 1329 | void |
| 1350 | initialize_frame_menubar (f) | 1330 | initialize_frame_menubar (FRAME_PTR f) |
| 1351 | FRAME_PTR f; | ||
| 1352 | { | 1331 | { |
| 1353 | /* This function is called before the first chance to redisplay | 1332 | /* This function is called before the first chance to redisplay |
| 1354 | the frame. It has to be, so the frame will have the right size. */ | 1333 | the frame. It has to be, so the frame will have the right size. */ |
| @@ -1458,12 +1437,7 @@ struct next_popup_x_y | |||
| 1458 | 1437 | ||
| 1459 | Here only X and Y are used. */ | 1438 | Here only X and Y are used. */ |
| 1460 | static void | 1439 | static void |
| 1461 | menu_position_func (menu, x, y, push_in, user_data) | 1440 | menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data) |
| 1462 | GtkMenu *menu; | ||
| 1463 | gint *x; | ||
| 1464 | gint *y; | ||
| 1465 | gboolean *push_in; | ||
| 1466 | gpointer user_data; | ||
| 1467 | { | 1441 | { |
| 1468 | struct next_popup_x_y* data = (struct next_popup_x_y*)user_data; | 1442 | struct next_popup_x_y* data = (struct next_popup_x_y*)user_data; |
| 1469 | GtkRequisition req; | 1443 | GtkRequisition req; |
| @@ -1484,9 +1458,7 @@ menu_position_func (menu, x, y, push_in, user_data) | |||
| 1484 | } | 1458 | } |
| 1485 | 1459 | ||
| 1486 | static void | 1460 | static void |
| 1487 | popup_selection_callback (widget, client_data) | 1461 | popup_selection_callback (GtkWidget *widget, gpointer client_data) |
| 1488 | GtkWidget *widget; | ||
| 1489 | gpointer client_data; | ||
| 1490 | { | 1462 | { |
| 1491 | xg_menu_item_cb_data *cb_data = (xg_menu_item_cb_data*) client_data; | 1463 | xg_menu_item_cb_data *cb_data = (xg_menu_item_cb_data*) client_data; |
| 1492 | 1464 | ||
| @@ -1495,8 +1467,7 @@ popup_selection_callback (widget, client_data) | |||
| 1495 | } | 1467 | } |
| 1496 | 1468 | ||
| 1497 | static Lisp_Object | 1469 | static Lisp_Object |
| 1498 | pop_down_menu (arg) | 1470 | pop_down_menu (Lisp_Object arg) |
| 1499 | Lisp_Object arg; | ||
| 1500 | { | 1471 | { |
| 1501 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | 1472 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); |
| 1502 | 1473 | ||
| @@ -1511,13 +1482,7 @@ pop_down_menu (arg) | |||
| 1511 | menu pops down. | 1482 | menu pops down. |
| 1512 | menu_item_selection will be set to the selection. */ | 1483 | menu_item_selection will be set to the selection. */ |
| 1513 | static void | 1484 | static void |
| 1514 | create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp) | 1485 | create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, int for_click, EMACS_UINT timestamp) |
| 1515 | FRAME_PTR f; | ||
| 1516 | widget_value *first_wv; | ||
| 1517 | int x; | ||
| 1518 | int y; | ||
| 1519 | int for_click; | ||
| 1520 | EMACS_UINT timestamp; | ||
| 1521 | { | 1486 | { |
| 1522 | int i; | 1487 | int i; |
| 1523 | GtkWidget *menu; | 1488 | GtkWidget *menu; |
| @@ -1977,9 +1942,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 1977 | 1942 | ||
| 1978 | #ifdef USE_GTK | 1943 | #ifdef USE_GTK |
| 1979 | static void | 1944 | static void |
| 1980 | dialog_selection_callback (widget, client_data) | 1945 | dialog_selection_callback (GtkWidget *widget, gpointer client_data) |
| 1981 | GtkWidget *widget; | ||
| 1982 | gpointer client_data; | ||
| 1983 | { | 1946 | { |
| 1984 | /* The EMACS_INT cast avoids a warning. There's no problem | 1947 | /* The EMACS_INT cast avoids a warning. There's no problem |
| 1985 | as long as pointers have enough bits to hold small integers. */ | 1948 | as long as pointers have enough bits to hold small integers. */ |
| @@ -1993,9 +1956,7 @@ dialog_selection_callback (widget, client_data) | |||
| 1993 | dialog pops down. | 1956 | dialog pops down. |
| 1994 | menu_item_selection will be set to the selection. */ | 1957 | menu_item_selection will be set to the selection. */ |
| 1995 | static void | 1958 | static void |
| 1996 | create_and_show_dialog (f, first_wv) | 1959 | create_and_show_dialog (FRAME_PTR f, widget_value *first_wv) |
| 1997 | FRAME_PTR f; | ||
| 1998 | widget_value *first_wv; | ||
| 1999 | { | 1960 | { |
| 2000 | GtkWidget *menu; | 1961 | GtkWidget *menu; |
| 2001 | 1962 | ||
| @@ -2092,11 +2053,7 @@ static char * button_names [] = { | |||
| 2092 | "button6", "button7", "button8", "button9", "button10" }; | 2053 | "button6", "button7", "button8", "button9", "button10" }; |
| 2093 | 2054 | ||
| 2094 | static Lisp_Object | 2055 | static Lisp_Object |
| 2095 | xdialog_show (f, keymaps, title, header, error_name) | 2056 | xdialog_show (FRAME_PTR f, int keymaps, Lisp_Object title, Lisp_Object header, char **error_name) |
| 2096 | FRAME_PTR f; | ||
| 2097 | int keymaps; | ||
| 2098 | Lisp_Object title, header; | ||
| 2099 | char **error_name; | ||
| 2100 | { | 2057 | { |
| 2101 | int i, nb_buttons=0; | 2058 | int i, nb_buttons=0; |
| 2102 | char dialog_name[6]; | 2059 | char dialog_name[6]; |
| @@ -2658,7 +2615,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error, timestamp) | |||
| 2658 | /* Detect if a dialog or menu has been posted. */ | 2615 | /* Detect if a dialog or menu has been posted. */ |
| 2659 | 2616 | ||
| 2660 | int | 2617 | int |
| 2661 | popup_activated () | 2618 | popup_activated (void) |
| 2662 | { | 2619 | { |
| 2663 | return popup_activated_flag; | 2620 | return popup_activated_flag; |
| 2664 | } | 2621 | } |
| @@ -2677,7 +2634,7 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_ | |||
| 2677 | } | 2634 | } |
| 2678 | 2635 | ||
| 2679 | void | 2636 | void |
| 2680 | syms_of_xmenu () | 2637 | syms_of_xmenu (void) |
| 2681 | { | 2638 | { |
| 2682 | Qdebug_on_next_call = intern_c_string ("debug-on-next-call"); | 2639 | Qdebug_on_next_call = intern_c_string ("debug-on-next-call"); |
| 2683 | staticpro (&Qdebug_on_next_call); | 2640 | staticpro (&Qdebug_on_next_call); |