diff options
| author | Dan Nicolaescu | 2010-07-12 12:29:49 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-07-12 12:29:49 -0700 |
| commit | ebd156110cd758dd0b356424844c8a14dfc4c615 (patch) | |
| tree | 954ad0daf8c790ebb71a57be6f11757be1c58ee9 /src/widget.c | |
| parent | de06a2dd4d6bd4b352a22b71b58dd7ae15c81fe0 (diff) | |
| download | emacs-ebd156110cd758dd0b356424844c8a14dfc4c615.tar.gz emacs-ebd156110cd758dd0b356424844c8a14dfc4c615.zip | |
Convert function definitions to standard C.
* src/xterm.c (x_frame_of_widget, x_alloc_nearest_color_for_widget)
(x_alloc_lighter_color_for_widget, cvt_string_to_pixel)
(cvt_pixel_dtor, x_window_to_menu_bar, xt_action_hook)
(xaw_jump_callback, xaw_scroll_callback)
(x_create_toolkit_scroll_bar, x_set_toolkit_scroll_bar_thumb)
(x_wm_set_size_hint, x_activate_timeout_atimer): Convert
definitions to standard C.
* src/xmenu.c (menubar_id_to_frame, popup_get_selection)
(popup_activate_callback, popup_deactivate_callback)
(menu_highlight_callback, menubar_selection_callback)
(apply_systemfont_to_dialog, apply_systemfont_to_menu)
(free_frame_menubar, popup_selection_callback, as)
(create_and_show_popup_menu, dialog_selection_callback)
(create_and_show_dialog):
* src/xfns.c (hack_wm_protocols, x_window):
* src/xfaces.c (x_update_menu_appearance):
* src/widget.c (get_default_char_pixel_size, pixel_to_char_size)
(char_to_pixel_size, round_size_to_char, get_wm_shell)
(set_frame_size, update_wm_hints, setup_frame_gcs)
(update_various_frame_slots, update_from_various_frame_slots)
(EmacsFrameInitialize, EmacsFrameRealize, EmacsFrameResize)
(EmacsFrameSetValues, EmacsFrameQueryGeometry)
(EmacsFrameSetCharSize, widget_store_internal_border): Likewise.
Diffstat (limited to 'src/widget.c')
| -rw-r--r-- | src/widget.c | 97 |
1 files changed, 25 insertions, 72 deletions
diff --git a/src/widget.c b/src/widget.c index 0c3aa64a74e..2301f76c7c9 100644 --- a/src/widget.c +++ b/src/widget.c | |||
| @@ -76,14 +76,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 76 | #define DEFAULT_FACE_FONT "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" | 76 | #define DEFAULT_FACE_FONT "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" |
| 77 | 77 | ||
| 78 | 78 | ||
| 79 | static void EmacsFrameInitialize (/*Widget, Widget, ArgList, Cardinal * */); | 79 | static void EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2); |
| 80 | static void EmacsFrameDestroy (/* Widget */); | 80 | static void EmacsFrameDestroy (Widget widget); |
| 81 | static void EmacsFrameRealize (/* Widget, XtValueMask*, XSetWindowAttributes* */); | 81 | static void EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs); |
| 82 | void EmacsFrameResize (/* Widget widget */); | 82 | void EmacsFrameResize (Widget widget); |
| 83 | static Boolean EmacsFrameSetValues (/* Widget, Widget, Widget, | 83 | static Boolean EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, ArgList dum1, Cardinal *dum2); |
| 84 | ArgList, Cardinal * */); | 84 | static XtGeometryResult EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result); |
| 85 | static XtGeometryResult EmacsFrameQueryGeometry (/* Widget, XtWidgetGeometry*, | ||
| 86 | XtWidgetGeometry* */); | ||
| 87 | 85 | ||
| 88 | 86 | ||
| 89 | #undef XtOffset | 87 | #undef XtOffset |
| @@ -180,10 +178,7 @@ EmacsFrameClassRec emacsFrameClassRec = { | |||
| 180 | WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec; | 178 | WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec; |
| 181 | 179 | ||
| 182 | static void | 180 | static void |
| 183 | get_default_char_pixel_size (ew, pixel_width, pixel_height) | 181 | get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height) |
| 184 | EmacsFrame ew; | ||
| 185 | int* pixel_width; | ||
| 186 | int* pixel_height; | ||
| 187 | { | 182 | { |
| 188 | struct frame* f = ew->emacs_frame.frame; | 183 | struct frame* f = ew->emacs_frame.frame; |
| 189 | *pixel_width = FRAME_COLUMN_WIDTH (f); | 184 | *pixel_width = FRAME_COLUMN_WIDTH (f); |
| @@ -191,12 +186,7 @@ get_default_char_pixel_size (ew, pixel_width, pixel_height) | |||
| 191 | } | 186 | } |
| 192 | 187 | ||
| 193 | static void | 188 | static void |
| 194 | pixel_to_char_size (ew, pixel_width, pixel_height, char_width, char_height) | 189 | pixel_to_char_size (EmacsFrame ew, Dimension pixel_width, Dimension pixel_height, int *char_width, int *char_height) |
| 195 | EmacsFrame ew; | ||
| 196 | Dimension pixel_width; | ||
| 197 | Dimension pixel_height; | ||
| 198 | int* char_width; | ||
| 199 | int* char_height; | ||
| 200 | { | 190 | { |
| 201 | struct frame* f = ew->emacs_frame.frame; | 191 | struct frame* f = ew->emacs_frame.frame; |
| 202 | *char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width); | 192 | *char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width); |
| @@ -204,12 +194,7 @@ pixel_to_char_size (ew, pixel_width, pixel_height, char_width, char_height) | |||
| 204 | } | 194 | } |
| 205 | 195 | ||
| 206 | static void | 196 | static void |
| 207 | char_to_pixel_size (ew, char_width, char_height, pixel_width, pixel_height) | 197 | char_to_pixel_size (EmacsFrame ew, int char_width, int char_height, Dimension *pixel_width, Dimension *pixel_height) |
| 208 | EmacsFrame ew; | ||
| 209 | int char_width; | ||
| 210 | int char_height; | ||
| 211 | Dimension* pixel_width; | ||
| 212 | Dimension* pixel_height; | ||
| 213 | { | 198 | { |
| 214 | struct frame* f = ew->emacs_frame.frame; | 199 | struct frame* f = ew->emacs_frame.frame; |
| 215 | *pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width); | 200 | *pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width); |
| @@ -217,12 +202,7 @@ char_to_pixel_size (ew, char_width, char_height, pixel_width, pixel_height) | |||
| 217 | } | 202 | } |
| 218 | 203 | ||
| 219 | static void | 204 | static void |
| 220 | round_size_to_char (ew, in_width, in_height, out_width, out_height) | 205 | round_size_to_char (EmacsFrame ew, Dimension in_width, Dimension in_height, Dimension *out_width, Dimension *out_height) |
| 221 | EmacsFrame ew; | ||
| 222 | Dimension in_width; | ||
| 223 | Dimension in_height; | ||
| 224 | Dimension* out_width; | ||
| 225 | Dimension* out_height; | ||
| 226 | { | 206 | { |
| 227 | int char_width; | 207 | int char_width; |
| 228 | int char_height; | 208 | int char_height; |
| @@ -231,8 +211,7 @@ round_size_to_char (ew, in_width, in_height, out_width, out_height) | |||
| 231 | } | 211 | } |
| 232 | 212 | ||
| 233 | static Widget | 213 | static Widget |
| 234 | get_wm_shell (w) | 214 | get_wm_shell (Widget w) |
| 235 | Widget w; | ||
| 236 | { | 215 | { |
| 237 | Widget wmshell; | 216 | Widget wmshell; |
| 238 | 217 | ||
| @@ -269,8 +248,7 @@ static Boolean first_frame_p = True; | |||
| 269 | #endif | 248 | #endif |
| 270 | 249 | ||
| 271 | static void | 250 | static void |
| 272 | set_frame_size (ew) | 251 | set_frame_size (EmacsFrame ew) |
| 273 | EmacsFrame ew; | ||
| 274 | { | 252 | { |
| 275 | /* The widget hierarchy is | 253 | /* The widget hierarchy is |
| 276 | 254 | ||
| @@ -491,8 +469,7 @@ set_frame_size (ew) | |||
| 491 | int update_hints_inhibit; | 469 | int update_hints_inhibit; |
| 492 | 470 | ||
| 493 | static void | 471 | static void |
| 494 | update_wm_hints (ew) | 472 | update_wm_hints (EmacsFrame ew) |
| 495 | EmacsFrame ew; | ||
| 496 | { | 473 | { |
| 497 | Widget wmshell = get_wm_shell ((Widget)ew); | 474 | Widget wmshell = get_wm_shell ((Widget)ew); |
| 498 | int cw; | 475 | int cw; |
| @@ -570,8 +547,7 @@ static char setup_frame_cursor_bits[] = | |||
| 570 | }; | 547 | }; |
| 571 | 548 | ||
| 572 | static void | 549 | static void |
| 573 | setup_frame_gcs (ew) | 550 | setup_frame_gcs (EmacsFrame ew) |
| 574 | EmacsFrame ew; | ||
| 575 | { | 551 | { |
| 576 | XGCValues gc_values; | 552 | XGCValues gc_values; |
| 577 | struct frame* s = ew->emacs_frame.frame; | 553 | struct frame* s = ew->emacs_frame.frame; |
| @@ -649,8 +625,7 @@ setup_frame_gcs (ew) | |||
| 649 | } | 625 | } |
| 650 | 626 | ||
| 651 | static void | 627 | static void |
| 652 | update_various_frame_slots (ew) | 628 | update_various_frame_slots (EmacsFrame ew) |
| 653 | EmacsFrame ew; | ||
| 654 | { | 629 | { |
| 655 | struct frame *f = ew->emacs_frame.frame; | 630 | struct frame *f = ew->emacs_frame.frame; |
| 656 | struct x_output *x = f->output_data.x; | 631 | struct x_output *x = f->output_data.x; |
| @@ -661,8 +636,7 @@ update_various_frame_slots (ew) | |||
| 661 | } | 636 | } |
| 662 | 637 | ||
| 663 | static void | 638 | static void |
| 664 | update_from_various_frame_slots (ew) | 639 | update_from_various_frame_slots (EmacsFrame ew) |
| 665 | EmacsFrame ew; | ||
| 666 | { | 640 | { |
| 667 | struct frame *f = ew->emacs_frame.frame; | 641 | struct frame *f = ew->emacs_frame.frame; |
| 668 | struct x_output *x = f->output_data.x; | 642 | struct x_output *x = f->output_data.x; |
| @@ -677,11 +651,7 @@ update_from_various_frame_slots (ew) | |||
| 677 | } | 651 | } |
| 678 | 652 | ||
| 679 | static void | 653 | static void |
| 680 | EmacsFrameInitialize (request, new, dum1, dum2) | 654 | EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2) |
| 681 | Widget request; | ||
| 682 | Widget new; | ||
| 683 | ArgList dum1; | ||
| 684 | Cardinal *dum2; | ||
| 685 | { | 655 | { |
| 686 | EmacsFrame ew = (EmacsFrame)new; | 656 | EmacsFrame ew = (EmacsFrame)new; |
| 687 | 657 | ||
| @@ -698,10 +668,7 @@ EmacsFrameInitialize (request, new, dum1, dum2) | |||
| 698 | 668 | ||
| 699 | 669 | ||
| 700 | static void | 670 | static void |
| 701 | EmacsFrameRealize (widget, mask, attrs) | 671 | EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs) |
| 702 | Widget widget; | ||
| 703 | XtValueMask *mask; | ||
| 704 | XSetWindowAttributes *attrs; | ||
| 705 | { | 672 | { |
| 706 | EmacsFrame ew = (EmacsFrame)widget; | 673 | EmacsFrame ew = (EmacsFrame)widget; |
| 707 | 674 | ||
| @@ -717,11 +684,10 @@ EmacsFrameRealize (widget, mask, attrs) | |||
| 717 | update_wm_hints (ew); | 684 | update_wm_hints (ew); |
| 718 | } | 685 | } |
| 719 | 686 | ||
| 720 | extern void free_frame_faces (/* struct frame * */); | 687 | extern void free_frame_faces (struct frame *); |
| 721 | 688 | ||
| 722 | static void | 689 | static void |
| 723 | EmacsFrameDestroy (widget) | 690 | EmacsFrameDestroy (Widget widget) |
| 724 | Widget widget; | ||
| 725 | { | 691 | { |
| 726 | EmacsFrame ew = (EmacsFrame) widget; | 692 | EmacsFrame ew = (EmacsFrame) widget; |
| 727 | struct frame* s = ew->emacs_frame.frame; | 693 | struct frame* s = ew->emacs_frame.frame; |
| @@ -739,8 +705,7 @@ EmacsFrameDestroy (widget) | |||
| 739 | } | 705 | } |
| 740 | 706 | ||
| 741 | void | 707 | void |
| 742 | EmacsFrameResize (widget) | 708 | EmacsFrameResize (Widget widget) |
| 743 | Widget widget; | ||
| 744 | { | 709 | { |
| 745 | EmacsFrame ew = (EmacsFrame)widget; | 710 | EmacsFrame ew = (EmacsFrame)widget; |
| 746 | struct frame *f = ew->emacs_frame.frame; | 711 | struct frame *f = ew->emacs_frame.frame; |
| @@ -756,12 +721,7 @@ EmacsFrameResize (widget) | |||
| 756 | } | 721 | } |
| 757 | 722 | ||
| 758 | static Boolean | 723 | static Boolean |
| 759 | EmacsFrameSetValues (cur_widget, req_widget, new_widget, dum1, dum2) | 724 | EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, ArgList dum1, Cardinal *dum2) |
| 760 | Widget cur_widget; | ||
| 761 | Widget req_widget; | ||
| 762 | Widget new_widget; | ||
| 763 | ArgList dum1; | ||
| 764 | Cardinal *dum2; | ||
| 765 | { | 725 | { |
| 766 | EmacsFrame cur = (EmacsFrame)cur_widget; | 726 | EmacsFrame cur = (EmacsFrame)cur_widget; |
| 767 | EmacsFrame new = (EmacsFrame)new_widget; | 727 | EmacsFrame new = (EmacsFrame)new_widget; |
| @@ -834,10 +794,7 @@ EmacsFrameSetValues (cur_widget, req_widget, new_widget, dum1, dum2) | |||
| 834 | } | 794 | } |
| 835 | 795 | ||
| 836 | static XtGeometryResult | 796 | static XtGeometryResult |
| 837 | EmacsFrameQueryGeometry (widget, request, result) | 797 | EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result) |
| 838 | Widget widget; | ||
| 839 | XtWidgetGeometry* request; | ||
| 840 | XtWidgetGeometry* result; | ||
| 841 | { | 798 | { |
| 842 | EmacsFrame ew = (EmacsFrame)widget; | 799 | EmacsFrame ew = (EmacsFrame)widget; |
| 843 | 800 | ||
| @@ -867,10 +824,7 @@ EmacsFrameQueryGeometry (widget, request, result) | |||
| 867 | 824 | ||
| 868 | /* Special entrypoints */ | 825 | /* Special entrypoints */ |
| 869 | void | 826 | void |
| 870 | EmacsFrameSetCharSize (widget, columns, rows) | 827 | EmacsFrameSetCharSize (Widget widget, int columns, int rows) |
| 871 | Widget widget; | ||
| 872 | int columns; | ||
| 873 | int rows; | ||
| 874 | { | 828 | { |
| 875 | EmacsFrame ew = (EmacsFrame) widget; | 829 | EmacsFrame ew = (EmacsFrame) widget; |
| 876 | struct frame *f = ew->emacs_frame.frame; | 830 | struct frame *f = ew->emacs_frame.frame; |
| @@ -880,8 +834,7 @@ EmacsFrameSetCharSize (widget, columns, rows) | |||
| 880 | 834 | ||
| 881 | 835 | ||
| 882 | void | 836 | void |
| 883 | widget_store_internal_border (widget) | 837 | widget_store_internal_border (Widget widget) |
| 884 | Widget widget; | ||
| 885 | { | 838 | { |
| 886 | EmacsFrame ew = (EmacsFrame) widget; | 839 | EmacsFrame ew = (EmacsFrame) widget; |
| 887 | FRAME_PTR f = ew->emacs_frame.frame; | 840 | FRAME_PTR f = ew->emacs_frame.frame; |