diff options
| author | YAMAMOTO Mitsuharu | 2015-02-16 10:53:40 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2015-02-16 10:53:40 +0900 |
| commit | a7930e125e27d3591bcf20aa3cd954dc5993ad1b (patch) | |
| tree | 5adc62d977eb033bd94fd0f874713530b97b3e28 /src | |
| parent | 426af0ef9f2008d78633a2f3c1daf1ddbe9d8e6e (diff) | |
| download | emacs-a7930e125e27d3591bcf20aa3cd954dc5993ad1b.tar.gz emacs-a7930e125e27d3591bcf20aa3cd954dc5993ad1b.zip | |
Modernize k&r cairo-related function declarations.
* gtkutil.c (xg_page_setup_dialog, xg_get_page_setup, draw_page)
(xg_print_frames_dialog): Modernize k&r declarations.
* xfns.c (Fx_export_frames, Fx_page_setup_dialog, Fx_get_page_setup)
(Fx_print_frames_dialog): Modernize k&r declarations.
* xterm.c (x_gc_get_ext_data, x_extension_initialize, x_begin_cr_clip)
(x_end_cr_clip, x_set_cr_source_with_gc_foreground)
(x_set_cr_source_with_gc_background, x_cr_define_fringe_bitmap)
(x_cr_destroy_fringe_bitmap, x_cr_draw_frame, x_cr_accumulate_data)
(x_cr_destroy, x_cr_export_frames, x_prepare_for_xlibdraw)
(x_set_clip_rectangles, x_reset_clip_rectangles, x_fill_rectangle)
(x_draw_rectangle, x_clear_window, x_fill_trapezoid_for_relief)
(x_clear_area): Modernize k&r declarations.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 14 | ||||
| -rw-r--r-- | src/gtkutil.c | 14 | ||||
| -rw-r--r-- | src/xfns.c | 10 | ||||
| -rw-r--r-- | src/xterm.c | 91 |
4 files changed, 47 insertions, 82 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5df51b487bd..76ca07d2dda 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,9 +1,23 @@ | |||
| 1 | 2015-02-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 1 | 2015-02-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 2 | ||
| 3 | * gtkutil.c (xg_page_setup_dialog, xg_get_page_setup, draw_page) | ||
| 4 | (xg_print_frames_dialog): Modernize k&r declarations. | ||
| 5 | |||
| 6 | * xfns.c (Fx_export_frames, Fx_page_setup_dialog, Fx_get_page_setup) | ||
| 7 | (Fx_print_frames_dialog): Modernize k&r declarations. | ||
| 8 | |||
| 3 | * xterm.c (x_draw_window_divider): Use x_fill_rectangle instead of | 9 | * xterm.c (x_draw_window_divider): Use x_fill_rectangle instead of |
| 4 | XFillRectangle. | 10 | XFillRectangle. |
| 5 | (x_draw_horizontal_wave) [USE_CAIRO]: New function. | 11 | (x_draw_horizontal_wave) [USE_CAIRO]: New function. |
| 6 | (x_draw_underwave) [USE_CAIRO]: Use it. | 12 | (x_draw_underwave) [USE_CAIRO]: Use it. |
| 13 | (x_gc_get_ext_data, x_extension_initialize, x_begin_cr_clip) | ||
| 14 | (x_end_cr_clip, x_set_cr_source_with_gc_foreground) | ||
| 15 | (x_set_cr_source_with_gc_background, x_cr_define_fringe_bitmap) | ||
| 16 | (x_cr_destroy_fringe_bitmap, x_cr_draw_frame, x_cr_accumulate_data) | ||
| 17 | (x_cr_destroy, x_cr_export_frames, x_prepare_for_xlibdraw) | ||
| 18 | (x_set_clip_rectangles, x_reset_clip_rectangles, x_fill_rectangle) | ||
| 19 | (x_draw_rectangle, x_clear_window, x_fill_trapezoid_for_relief) | ||
| 20 | (x_clear_area): Modernize k&r declarations. | ||
| 7 | 21 | ||
| 8 | 2015-02-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 22 | 2015-02-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 9 | 23 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index f111ea80cef..e357eb85730 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -4051,7 +4051,7 @@ static GtkPrintSettings *print_settings = NULL; | |||
| 4051 | static GtkPageSetup *page_setup = NULL; | 4051 | static GtkPageSetup *page_setup = NULL; |
| 4052 | 4052 | ||
| 4053 | void | 4053 | void |
| 4054 | xg_page_setup_dialog () | 4054 | xg_page_setup_dialog (void) |
| 4055 | { | 4055 | { |
| 4056 | GtkPageSetup *new_page_setup = NULL; | 4056 | GtkPageSetup *new_page_setup = NULL; |
| 4057 | 4057 | ||
| @@ -4065,7 +4065,7 @@ xg_page_setup_dialog () | |||
| 4065 | } | 4065 | } |
| 4066 | 4066 | ||
| 4067 | Lisp_Object | 4067 | Lisp_Object |
| 4068 | xg_get_page_setup () | 4068 | xg_get_page_setup (void) |
| 4069 | { | 4069 | { |
| 4070 | Lisp_Object result, orientation_symbol; | 4070 | Lisp_Object result, orientation_symbol; |
| 4071 | GtkPageOrientation orientation; | 4071 | GtkPageOrientation orientation; |
| @@ -4107,11 +4107,8 @@ xg_get_page_setup () | |||
| 4107 | } | 4107 | } |
| 4108 | 4108 | ||
| 4109 | static void | 4109 | static void |
| 4110 | draw_page (operation, context, page_nr, user_data) | 4110 | draw_page (GtkPrintOperation *operation, GtkPrintContext *context, |
| 4111 | GtkPrintOperation *operation; | 4111 | gint page_nr, gpointer user_data) |
| 4112 | GtkPrintContext *context; | ||
| 4113 | gint page_nr; | ||
| 4114 | gpointer user_data; | ||
| 4115 | { | 4112 | { |
| 4116 | Lisp_Object frames = *((Lisp_Object *) user_data); | 4113 | Lisp_Object frames = *((Lisp_Object *) user_data); |
| 4117 | struct frame *f = XFRAME (Fnth (make_number (page_nr), frames)); | 4114 | struct frame *f = XFRAME (Fnth (make_number (page_nr), frames)); |
| @@ -4121,8 +4118,7 @@ draw_page (operation, context, page_nr, user_data) | |||
| 4121 | } | 4118 | } |
| 4122 | 4119 | ||
| 4123 | void | 4120 | void |
| 4124 | xg_print_frames_dialog (frames) | 4121 | xg_print_frames_dialog (Lisp_Object frames) |
| 4125 | Lisp_Object frames; | ||
| 4126 | { | 4122 | { |
| 4127 | GtkPrintOperation *print; | 4123 | GtkPrintOperation *print; |
| 4128 | GtkPrintOperationResult res; | 4124 | GtkPrintOperationResult res; |
diff --git a/src/xfns.c b/src/xfns.c index 23af4388e5f..5b591d31769 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -6158,8 +6158,7 @@ FRAMES should be nil (the selected frame), a frame, or a list of | |||
| 6158 | frames (each of which corresponds to one page). Optional arg TYPE | 6158 | frames (each of which corresponds to one page). Optional arg TYPE |
| 6159 | should be either `pdf' (default), `png', `ps', or `svg'. Supported | 6159 | should be either `pdf' (default), `png', `ps', or `svg'. Supported |
| 6160 | types are determined by the compile-time configuration of cairo. */) | 6160 | types are determined by the compile-time configuration of cairo. */) |
| 6161 | (frames, type) | 6161 | (Lisp_Object frames, Lisp_Object type) |
| 6162 | Lisp_Object frames, type; | ||
| 6163 | { | 6162 | { |
| 6164 | Lisp_Object result, rest, tmp; | 6163 | Lisp_Object result, rest, tmp; |
| 6165 | cairo_surface_type_t surface_type; | 6164 | cairo_surface_type_t surface_type; |
| @@ -6224,7 +6223,7 @@ types are determined by the compile-time configuration of cairo. */) | |||
| 6224 | DEFUN ("x-page-setup-dialog", Fx_page_setup_dialog, Sx_page_setup_dialog, 0, 0, 0, | 6223 | DEFUN ("x-page-setup-dialog", Fx_page_setup_dialog, Sx_page_setup_dialog, 0, 0, 0, |
| 6225 | doc: /* Pop up a page setup dialog. | 6224 | doc: /* Pop up a page setup dialog. |
| 6226 | The current page setup can be obtained using `x-get-page-setup'. */) | 6225 | The current page setup can be obtained using `x-get-page-setup'. */) |
| 6227 | () | 6226 | (void) |
| 6228 | { | 6227 | { |
| 6229 | block_input (); | 6228 | block_input (); |
| 6230 | xg_page_setup_dialog (); | 6229 | xg_page_setup_dialog (); |
| @@ -6247,7 +6246,7 @@ The return value is an alist containing the following keys: | |||
| 6247 | The paper width can be obtained as the sum of width, left-margin, and | 6246 | The paper width can be obtained as the sum of width, left-margin, and |
| 6248 | right-margin values. Likewise, the paper height is the sum of height, | 6247 | right-margin values. Likewise, the paper height is the sum of height, |
| 6249 | top-margin, and bottom-margin values. */) | 6248 | top-margin, and bottom-margin values. */) |
| 6250 | () | 6249 | (void) |
| 6251 | { | 6250 | { |
| 6252 | Lisp_Object result; | 6251 | Lisp_Object result; |
| 6253 | 6252 | ||
| @@ -6263,8 +6262,7 @@ DEFUN ("x-print-frames-dialog", Fx_print_frames_dialog, Sx_print_frames_dialog, | |||
| 6263 | FRAMES should be nil (the selected frame), a frame, or a list of | 6262 | FRAMES should be nil (the selected frame), a frame, or a list of |
| 6264 | frames (each of which corresponds to one page). Each frame should be | 6263 | frames (each of which corresponds to one page). Each frame should be |
| 6265 | visible. */) | 6264 | visible. */) |
| 6266 | (frames) | 6265 | (Lisp_Object frames) |
| 6267 | Lisp_Object frames; | ||
| 6268 | { | 6266 | { |
| 6269 | Lisp_Object rest, tmp; | 6267 | Lisp_Object rest, tmp; |
| 6270 | 6268 | ||
diff --git a/src/xterm.c b/src/xterm.c index ae421a8d795..6cc96587ab7 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -348,10 +348,7 @@ static cairo_status_t x_cr_accumulate_data (void *, | |||
| 348 | #define FRAME_CR_SURFACE(f) ((f)->output_data.x->cr_surface) | 348 | #define FRAME_CR_SURFACE(f) ((f)->output_data.x->cr_surface) |
| 349 | 349 | ||
| 350 | static struct x_gc_ext_data * | 350 | static struct x_gc_ext_data * |
| 351 | x_gc_get_ext_data (f, gc, create_if_not_found_p) | 351 | x_gc_get_ext_data (struct frame *f, GC gc, int create_if_not_found_p) |
| 352 | struct frame *f; | ||
| 353 | GC gc; | ||
| 354 | int create_if_not_found_p; | ||
| 355 | { | 352 | { |
| 356 | struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); | 353 | struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); |
| 357 | XEDataObject object; | 354 | XEDataObject object; |
| @@ -376,8 +373,7 @@ x_gc_get_ext_data (f, gc, create_if_not_found_p) | |||
| 376 | } | 373 | } |
| 377 | 374 | ||
| 378 | static void | 375 | static void |
| 379 | x_extension_initialize (dpyinfo) | 376 | x_extension_initialize (struct x_display_info *dpyinfo) |
| 380 | struct x_display_info *dpyinfo; | ||
| 381 | { | 377 | { |
| 382 | XExtCodes *ext_codes = XAddExtension (dpyinfo->display); | 378 | XExtCodes *ext_codes = XAddExtension (dpyinfo->display); |
| 383 | 379 | ||
| @@ -398,9 +394,7 @@ x_cr_destroy_surface (struct frame *f) | |||
| 398 | } | 394 | } |
| 399 | 395 | ||
| 400 | cairo_t * | 396 | cairo_t * |
| 401 | x_begin_cr_clip (f, gc) | 397 | x_begin_cr_clip (struct frame *f, GC gc) |
| 402 | struct frame *f; | ||
| 403 | GC gc; | ||
| 404 | { | 398 | { |
| 405 | cairo_t *cr = FRAME_CR_CONTEXT (f); | 399 | cairo_t *cr = FRAME_CR_CONTEXT (f); |
| 406 | 400 | ||
| @@ -445,16 +439,13 @@ x_begin_cr_clip (f, gc) | |||
| 445 | } | 439 | } |
| 446 | 440 | ||
| 447 | void | 441 | void |
| 448 | x_end_cr_clip (f) | 442 | x_end_cr_clip (struct frame *f) |
| 449 | struct frame *f; | ||
| 450 | { | 443 | { |
| 451 | cairo_restore (FRAME_CR_CONTEXT (f)); | 444 | cairo_restore (FRAME_CR_CONTEXT (f)); |
| 452 | } | 445 | } |
| 453 | 446 | ||
| 454 | void | 447 | void |
| 455 | x_set_cr_source_with_gc_foreground (f, gc) | 448 | x_set_cr_source_with_gc_foreground (struct frame *f, GC gc) |
| 456 | struct frame *f; | ||
| 457 | GC gc; | ||
| 458 | { | 449 | { |
| 459 | XGCValues xgcv; | 450 | XGCValues xgcv; |
| 460 | XColor color; | 451 | XColor color; |
| @@ -467,9 +458,7 @@ x_set_cr_source_with_gc_foreground (f, gc) | |||
| 467 | } | 458 | } |
| 468 | 459 | ||
| 469 | void | 460 | void |
| 470 | x_set_cr_source_with_gc_background (f, gc) | 461 | x_set_cr_source_with_gc_background (struct frame *f, GC gc) |
| 471 | struct frame *f; | ||
| 472 | GC gc; | ||
| 473 | { | 462 | { |
| 474 | XGCValues xgcv; | 463 | XGCValues xgcv; |
| 475 | XColor color; | 464 | XColor color; |
| @@ -487,10 +476,7 @@ static int max_fringe_bmp = 0; | |||
| 487 | static cairo_pattern_t **fringe_bmp = 0; | 476 | static cairo_pattern_t **fringe_bmp = 0; |
| 488 | 477 | ||
| 489 | static void | 478 | static void |
| 490 | x_cr_define_fringe_bitmap (which, bits, h, wd) | 479 | x_cr_define_fringe_bitmap (int which, unsigned short *bits, int h, int wd) |
| 491 | int which; | ||
| 492 | unsigned short *bits; | ||
| 493 | int h, wd; | ||
| 494 | { | 480 | { |
| 495 | int i, stride; | 481 | int i, stride; |
| 496 | cairo_surface_t *surface; | 482 | cairo_surface_t *surface; |
| @@ -528,8 +514,7 @@ x_cr_define_fringe_bitmap (which, bits, h, wd) | |||
| 528 | } | 514 | } |
| 529 | 515 | ||
| 530 | static void | 516 | static void |
| 531 | x_cr_destroy_fringe_bitmap (which) | 517 | x_cr_destroy_fringe_bitmap (int which) |
| 532 | int which; | ||
| 533 | { | 518 | { |
| 534 | if (which >= max_fringe_bmp) | 519 | if (which >= max_fringe_bmp) |
| 535 | return; | 520 | return; |
| @@ -588,9 +573,7 @@ x_cr_draw_image (struct frame *f, | |||
| 588 | } | 573 | } |
| 589 | 574 | ||
| 590 | void | 575 | void |
| 591 | x_cr_draw_frame (cr, f) | 576 | x_cr_draw_frame (cairo_t *cr, struct frame *f) |
| 592 | cairo_t *cr; | ||
| 593 | struct frame *f; | ||
| 594 | { | 577 | { |
| 595 | int width, height; | 578 | int width, height; |
| 596 | 579 | ||
| @@ -605,10 +588,8 @@ x_cr_draw_frame (cr, f) | |||
| 605 | } | 588 | } |
| 606 | 589 | ||
| 607 | static cairo_status_t | 590 | static cairo_status_t |
| 608 | x_cr_accumulate_data (closure, data, length) | 591 | x_cr_accumulate_data (void *closure, const unsigned char *data, |
| 609 | void *closure; | 592 | unsigned int length) |
| 610 | const unsigned char *data; | ||
| 611 | unsigned int length; | ||
| 612 | { | 593 | { |
| 613 | Lisp_Object *acc = (Lisp_Object *) closure; | 594 | Lisp_Object *acc = (Lisp_Object *) closure; |
| 614 | 595 | ||
| @@ -618,8 +599,7 @@ x_cr_accumulate_data (closure, data, length) | |||
| 618 | } | 599 | } |
| 619 | 600 | ||
| 620 | static void | 601 | static void |
| 621 | x_cr_destroy (arg) | 602 | x_cr_destroy (Lisp_Object arg) |
| 622 | Lisp_Object arg; | ||
| 623 | { | 603 | { |
| 624 | cairo_t *cr = (cairo_t *) XSAVE_POINTER (arg, 0); | 604 | cairo_t *cr = (cairo_t *) XSAVE_POINTER (arg, 0); |
| 625 | 605 | ||
| @@ -629,9 +609,7 @@ x_cr_destroy (arg) | |||
| 629 | } | 609 | } |
| 630 | 610 | ||
| 631 | Lisp_Object | 611 | Lisp_Object |
| 632 | x_cr_export_frames (frames, surface_type) | 612 | x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type) |
| 633 | Lisp_Object frames; | ||
| 634 | cairo_surface_type_t surface_type; | ||
| 635 | { | 613 | { |
| 636 | struct frame *f; | 614 | struct frame *f; |
| 637 | cairo_surface_t *surface; | 615 | cairo_surface_t *surface; |
| @@ -730,8 +708,7 @@ x_cr_export_frames (frames, surface_type) | |||
| 730 | #endif /* USE_CAIRO */ | 708 | #endif /* USE_CAIRO */ |
| 731 | 709 | ||
| 732 | static void | 710 | static void |
| 733 | x_prepare_for_xlibdraw (f) | 711 | x_prepare_for_xlibdraw (struct frame *f) |
| 734 | struct frame *f; | ||
| 735 | { | 712 | { |
| 736 | #ifdef USE_CAIRO | 713 | #ifdef USE_CAIRO |
| 737 | if (f == NULL) | 714 | if (f == NULL) |
| @@ -760,11 +737,7 @@ x_prepare_for_xlibdraw (f) | |||
| 760 | } | 737 | } |
| 761 | 738 | ||
| 762 | static void | 739 | static void |
| 763 | x_set_clip_rectangles (f, gc, rectangles, n) | 740 | x_set_clip_rectangles (struct frame *f, GC gc, XRectangle *rectangles, int n) |
| 764 | struct frame *f; | ||
| 765 | GC gc; | ||
| 766 | XRectangle *rectangles; | ||
| 767 | int n; | ||
| 768 | { | 741 | { |
| 769 | XSetClipRectangles (FRAME_X_DISPLAY (f), gc, 0, 0, rectangles, n, Unsorted); | 742 | XSetClipRectangles (FRAME_X_DISPLAY (f), gc, 0, 0, rectangles, n, Unsorted); |
| 770 | #ifdef USE_CAIRO | 743 | #ifdef USE_CAIRO |
| @@ -780,9 +753,7 @@ x_set_clip_rectangles (f, gc, rectangles, n) | |||
| 780 | } | 753 | } |
| 781 | 754 | ||
| 782 | static void | 755 | static void |
| 783 | x_reset_clip_rectangles (f, gc) | 756 | x_reset_clip_rectangles (struct frame *f, GC gc) |
| 784 | struct frame *f; | ||
| 785 | GC gc; | ||
| 786 | { | 757 | { |
| 787 | XSetClipMask (FRAME_X_DISPLAY (f), gc, None); | 758 | XSetClipMask (FRAME_X_DISPLAY (f), gc, None); |
| 788 | #ifdef USE_CAIRO | 759 | #ifdef USE_CAIRO |
| @@ -796,11 +767,8 @@ x_reset_clip_rectangles (f, gc) | |||
| 796 | } | 767 | } |
| 797 | 768 | ||
| 798 | static void | 769 | static void |
| 799 | x_fill_rectangle (f, gc, x, y, width, height) | 770 | x_fill_rectangle (struct frame *f, GC gc, int x, int y, |
| 800 | struct frame *f; | 771 | unsigned int width, unsigned int height) |
| 801 | GC gc; | ||
| 802 | int x, y; | ||
| 803 | unsigned int width, height; | ||
| 804 | { | 772 | { |
| 805 | #ifdef USE_CAIRO | 773 | #ifdef USE_CAIRO |
| 806 | cairo_t *cr; | 774 | cairo_t *cr; |
| @@ -817,11 +785,8 @@ x_fill_rectangle (f, gc, x, y, width, height) | |||
| 817 | } | 785 | } |
| 818 | 786 | ||
| 819 | static void | 787 | static void |
| 820 | x_draw_rectangle (f, gc, x, y, width, height) | 788 | x_draw_rectangle (struct frame *f, GC gc, int x, int y, |
| 821 | struct frame *f; | 789 | unsigned int width, unsigned int height) |
| 822 | GC gc; | ||
| 823 | int x, y; | ||
| 824 | unsigned int width, height; | ||
| 825 | { | 790 | { |
| 826 | #ifdef USE_CAIRO | 791 | #ifdef USE_CAIRO |
| 827 | cairo_t *cr; | 792 | cairo_t *cr; |
| @@ -839,8 +804,7 @@ x_draw_rectangle (f, gc, x, y, width, height) | |||
| 839 | } | 804 | } |
| 840 | 805 | ||
| 841 | static void | 806 | static void |
| 842 | x_clear_window (f) | 807 | x_clear_window (struct frame *f) |
| 843 | struct frame *f; | ||
| 844 | { | 808 | { |
| 845 | #ifdef USE_CAIRO | 809 | #ifdef USE_CAIRO |
| 846 | cairo_t *cr; | 810 | cairo_t *cr; |
| @@ -856,12 +820,8 @@ x_clear_window (f) | |||
| 856 | 820 | ||
| 857 | #ifdef USE_CAIRO | 821 | #ifdef USE_CAIRO |
| 858 | static void | 822 | static void |
| 859 | x_fill_trapezoid_for_relief (f, gc, x, y, width, height, top_p) | 823 | x_fill_trapezoid_for_relief (struct frame *f, GC gc, int x, int y, |
| 860 | struct frame *f; | 824 | unsigned int width, unsigned int height, int top_p) |
| 861 | GC gc; | ||
| 862 | int x, y; | ||
| 863 | unsigned int width, height; | ||
| 864 | int top_p; | ||
| 865 | { | 825 | { |
| 866 | cairo_t *cr; | 826 | cairo_t *cr; |
| 867 | 827 | ||
| @@ -3667,10 +3627,7 @@ x_clear_area1 (Display *dpy, Window window, | |||
| 3667 | 3627 | ||
| 3668 | 3628 | ||
| 3669 | void | 3629 | void |
| 3670 | x_clear_area (f, x, y, width, height) | 3630 | x_clear_area (struct frame *f, int x, int y, int width, int height) |
| 3671 | struct frame *f; | ||
| 3672 | int x, y; | ||
| 3673 | int width, height; | ||
| 3674 | { | 3631 | { |
| 3675 | #ifdef USE_CAIRO | 3632 | #ifdef USE_CAIRO |
| 3676 | cairo_t *cr; | 3633 | cairo_t *cr; |