diff options
| author | YAMAMOTO Mitsuharu | 2006-10-31 08:32:56 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2006-10-31 08:32:56 +0000 |
| commit | 369a7a37d8c0f803b515f7bc96f462f60d19fb22 (patch) | |
| tree | 112fa0dcc3b4931d68593efc87b16c6b03f0b4af /src | |
| parent | 11e0f75563dddb35cf1381a69f46553182a684d8 (diff) | |
| download | emacs-369a7a37d8c0f803b515f7bc96f462f60d19fb22.tar.gz emacs-369a7a37d8c0f803b515f7bc96f462f60d19fb22.zip | |
(mac_create_bitmap_from_bitmap_data): Make variable
`swap_nibbles' static const.
(atsu_get_text_layout_with_text_ptr): Make variables `lengths',
`tags', `sizes', `values' static const.
(mac_draw_string_common): Make variables `context' static. Make
variables `tags', `sizes', and `values' static const.
(pcm_get_status, x_detect_focus_change, x_scroll_bar_handle_click)
(xlfdpat_create, xlfdpat_block_match_1, xlfdpat_match)
(mac_to_x_fontname, parse_x_font_name, add_mac_font_name)
(mac_do_list_fonts, is_fully_specified_xlfd, do_grow_window)
(mac_store_event_ref_as_apple_event, mac_make_rdb): Add const
qualifier to arguments.
(xlfd_scalable_fields, keycode_to_xkeysym_table)
(fn_keycode_to_keycode_table): Make static const.
(mac_load_query_font): Make variables `tags', `sizes', `values',
`types', and `selectors' static const.
(mac_handle_command_event, mac_handle_window_event): Make
variables `names' and `types' static const.
(init_command_handler, install_window_handler): Make variables
`specs*' static const.
(mac_handle_font_event, mac_handle_text_input_event)
(mac_store_service_event): Make variables `names' and `types'
const. Make variables `names_*' and `types_*' static const.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macterm.c | 201 |
1 files changed, 108 insertions, 93 deletions
diff --git a/src/macterm.c b/src/macterm.c index 864852129e2..97a87cd3d3a 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -244,7 +244,8 @@ static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *)); | |||
| 244 | static void mac_focus_changed P_ ((int, struct mac_display_info *, | 244 | static void mac_focus_changed P_ ((int, struct mac_display_info *, |
| 245 | struct frame *, struct input_event *)); | 245 | struct frame *, struct input_event *)); |
| 246 | static void x_detect_focus_change P_ ((struct mac_display_info *, | 246 | static void x_detect_focus_change P_ ((struct mac_display_info *, |
| 247 | EventRecord *, struct input_event *)); | 247 | const EventRecord *, |
| 248 | struct input_event *)); | ||
| 248 | static void XTframe_rehighlight P_ ((struct frame *)); | 249 | static void XTframe_rehighlight P_ ((struct frame *)); |
| 249 | static void x_frame_rehighlight P_ ((struct x_display_info *)); | 250 | static void x_frame_rehighlight P_ ((struct x_display_info *)); |
| 250 | static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); | 251 | static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); |
| @@ -640,7 +641,7 @@ mac_create_bitmap_from_bitmap_data (bitmap, bits, w, h) | |||
| 640 | char *bits; | 641 | char *bits; |
| 641 | int w, h; | 642 | int w, h; |
| 642 | { | 643 | { |
| 643 | static unsigned char swap_nibble[16] | 644 | static const unsigned char swap_nibble[16] |
| 644 | = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */ | 645 | = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */ |
| 645 | 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */ | 646 | 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */ |
| 646 | 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */ | 647 | 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */ |
| @@ -826,9 +827,9 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout) | |||
| 826 | 827 | ||
| 827 | if (saved_text_layout == NULL) | 828 | if (saved_text_layout == NULL) |
| 828 | { | 829 | { |
| 829 | UniCharCount lengths[] = {kATSUToTextEnd}; | 830 | static const UniCharCount lengths[] = {kATSUToTextEnd}; |
| 830 | ATSUAttributeTag tags[] = {kATSULineLayoutOptionsTag}; | 831 | static const ATSUAttributeTag tags[] = {kATSULineLayoutOptionsTag}; |
| 831 | ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)}; | 832 | static const ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)}; |
| 832 | static ATSLineLayoutOptions line_layout = | 833 | static ATSLineLayoutOptions line_layout = |
| 833 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 | 834 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
| 834 | kATSLineDisableAllLayoutOperations | kATSLineUseDeviceMetrics | 835 | kATSLineDisableAllLayoutOperations | kATSLineUseDeviceMetrics |
| @@ -837,7 +838,7 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout) | |||
| 837 | kATSLineIsDisplayOnly | kATSLineFractDisable | 838 | kATSLineIsDisplayOnly | kATSLineFractDisable |
| 838 | #endif | 839 | #endif |
| 839 | ; | 840 | ; |
| 840 | ATSUAttributeValuePtr values[] = {&line_layout}; | 841 | static const ATSUAttributeValuePtr values[] = {&line_layout}; |
| 841 | 842 | ||
| 842 | err = ATSUCreateTextLayoutWithTextPtr (text, | 843 | err = ATSUCreateTextLayoutWithTextPtr (text, |
| 843 | kATSUFromTextBeginning, | 844 | kATSUFromTextBeginning, |
| @@ -960,11 +961,11 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, | |||
| 960 | else | 961 | else |
| 961 | { | 962 | { |
| 962 | CGrafPtr port; | 963 | CGrafPtr port; |
| 963 | CGContextRef context; | 964 | static CGContextRef context; |
| 964 | float port_height = FRAME_PIXEL_HEIGHT (f); | 965 | float port_height = FRAME_PIXEL_HEIGHT (f); |
| 965 | ATSUAttributeTag tags[] = {kATSUCGContextTag}; | 966 | static const ATSUAttributeTag tags[] = {kATSUCGContextTag}; |
| 966 | ByteCount sizes[] = {sizeof (CGContextRef)}; | 967 | static const ByteCount sizes[] = {sizeof (CGContextRef)}; |
| 967 | ATSUAttributeValuePtr values[] = {&context}; | 968 | static const ATSUAttributeValuePtr values[] = {&context}; |
| 968 | 969 | ||
| 969 | #if USE_CG_DRAWING | 970 | #if USE_CG_DRAWING |
| 970 | context = mac_begin_cg_clip (f, gc); | 971 | context = mac_begin_cg_clip (f, gc); |
| @@ -2196,7 +2197,7 @@ pcm_init (pcm, count) | |||
| 2196 | 2197 | ||
| 2197 | static enum pcm_status | 2198 | static enum pcm_status |
| 2198 | pcm_get_status (pcm) | 2199 | pcm_get_status (pcm) |
| 2199 | XCharStruct *pcm; | 2200 | const XCharStruct *pcm; |
| 2200 | { | 2201 | { |
| 2201 | int height = pcm->ascent + pcm->descent; | 2202 | int height = pcm->ascent + pcm->descent; |
| 2202 | 2203 | ||
| @@ -4219,7 +4220,7 @@ mac_focus_changed (type, dpyinfo, frame, bufp) | |||
| 4219 | static void | 4220 | static void |
| 4220 | x_detect_focus_change (dpyinfo, event, bufp) | 4221 | x_detect_focus_change (dpyinfo, event, bufp) |
| 4221 | struct mac_display_info *dpyinfo; | 4222 | struct mac_display_info *dpyinfo; |
| 4222 | EventRecord *event; | 4223 | const EventRecord *event; |
| 4223 | struct input_event *bufp; | 4224 | struct input_event *bufp; |
| 4224 | { | 4225 | { |
| 4225 | struct frame *frame; | 4226 | struct frame *frame; |
| @@ -5232,7 +5233,7 @@ static void | |||
| 5232 | x_scroll_bar_handle_click (bar, part_code, er, bufp) | 5233 | x_scroll_bar_handle_click (bar, part_code, er, bufp) |
| 5233 | struct scroll_bar *bar; | 5234 | struct scroll_bar *bar; |
| 5234 | ControlPartCode part_code; | 5235 | ControlPartCode part_code; |
| 5235 | EventRecord *er; | 5236 | const EventRecord *er; |
| 5236 | struct input_event *bufp; | 5237 | struct input_event *bufp; |
| 5237 | { | 5238 | { |
| 5238 | int win_y, top_range; | 5239 | int win_y, top_range; |
| @@ -6695,11 +6696,12 @@ xlfdpat_destroy (pat) | |||
| 6695 | 6696 | ||
| 6696 | static struct xlfdpat * | 6697 | static struct xlfdpat * |
| 6697 | xlfdpat_create (pattern) | 6698 | xlfdpat_create (pattern) |
| 6698 | char *pattern; | 6699 | const char *pattern; |
| 6699 | { | 6700 | { |
| 6700 | struct xlfdpat *pat; | 6701 | struct xlfdpat *pat; |
| 6701 | int nblocks, i, skip; | 6702 | int nblocks, i, skip; |
| 6702 | unsigned char last_char, *p, *q, *anychar_head; | 6703 | unsigned char last_char, *p, *q, *anychar_head; |
| 6704 | const unsigned char *ptr; | ||
| 6703 | struct xlfdpat_block *blk; | 6705 | struct xlfdpat_block *blk; |
| 6704 | 6706 | ||
| 6705 | pat = xmalloc (sizeof (struct xlfdpat)); | 6707 | pat = xmalloc (sizeof (struct xlfdpat)); |
| @@ -6710,9 +6712,9 @@ xlfdpat_create (pattern) | |||
| 6710 | anychar_head = NULL; | 6712 | anychar_head = NULL; |
| 6711 | q = pat->buf; | 6713 | q = pat->buf; |
| 6712 | last_char = '\0'; | 6714 | last_char = '\0'; |
| 6713 | for (p = pattern; *p; p++) | 6715 | for (ptr = pattern; *ptr; ptr++) |
| 6714 | { | 6716 | { |
| 6715 | unsigned char c = *p; | 6717 | unsigned char c = *ptr; |
| 6716 | 6718 | ||
| 6717 | if (c == '*') | 6719 | if (c == '*') |
| 6718 | if (last_char == '*') | 6720 | if (last_char == '*') |
| @@ -6816,14 +6818,15 @@ xlfdpat_exact_p (pat) | |||
| 6816 | that the pattern in *BLK matches with its prefix. Return NULL | 6818 | that the pattern in *BLK matches with its prefix. Return NULL |
| 6817 | there is no such strings. STRING must be lowered in advance. */ | 6819 | there is no such strings. STRING must be lowered in advance. */ |
| 6818 | 6820 | ||
| 6819 | static char * | 6821 | static const char * |
| 6820 | xlfdpat_block_match_1 (blk, string, start_max) | 6822 | xlfdpat_block_match_1 (blk, string, start_max) |
| 6821 | struct xlfdpat_block *blk; | 6823 | struct xlfdpat_block *blk; |
| 6822 | unsigned char *string; | 6824 | const unsigned char *string; |
| 6823 | int start_max; | 6825 | int start_max; |
| 6824 | { | 6826 | { |
| 6825 | int start, infinity; | 6827 | int start, infinity; |
| 6826 | unsigned char *p, *s; | 6828 | unsigned char *p; |
| 6829 | const unsigned char *s; | ||
| 6827 | 6830 | ||
| 6828 | xassert (blk->len > 0); | 6831 | xassert (blk->len > 0); |
| 6829 | xassert (start_max + blk->len <= strlen (string)); | 6832 | xassert (start_max + blk->len <= strlen (string)); |
| @@ -6880,17 +6883,17 @@ xlfdpat_block_match_1 (blk, string, start_max) | |||
| 6880 | ((b)->len == 1 ? memchr ((s), (b)->last_char, (m) + 1) \ | 6883 | ((b)->len == 1 ? memchr ((s), (b)->last_char, (m) + 1) \ |
| 6881 | : xlfdpat_block_match_1 (b, s, m)) | 6884 | : xlfdpat_block_match_1 (b, s, m)) |
| 6882 | 6885 | ||
| 6883 | /* Check if XLFD pattern PAT, which is generated by `xfldpat_create', | 6886 | /* Check if XLFD pattern PAT, which is generated by `xlfdpat_create', |
| 6884 | matches with STRING. STRING must be lowered in advance. */ | 6887 | matches with STRING. STRING must be lowered in advance. */ |
| 6885 | 6888 | ||
| 6886 | static int | 6889 | static int |
| 6887 | xlfdpat_match (pat, string) | 6890 | xlfdpat_match (pat, string) |
| 6888 | struct xlfdpat *pat; | 6891 | struct xlfdpat *pat; |
| 6889 | unsigned char *string; | 6892 | const unsigned char *string; |
| 6890 | { | 6893 | { |
| 6891 | int str_len, nblocks, i, start_max; | 6894 | int str_len, nblocks, i, start_max; |
| 6892 | struct xlfdpat_block *blk; | 6895 | struct xlfdpat_block *blk; |
| 6893 | unsigned char *s; | 6896 | const unsigned char *s; |
| 6894 | 6897 | ||
| 6895 | xassert (pat->nblocks > 0); | 6898 | xassert (pat->nblocks > 0); |
| 6896 | 6899 | ||
| @@ -7061,7 +7064,7 @@ decode_mac_font_name (name, size, coding_system) | |||
| 7061 | 7064 | ||
| 7062 | static char * | 7065 | static char * |
| 7063 | mac_to_x_fontname (name, size, style, charset) | 7066 | mac_to_x_fontname (name, size, style, charset) |
| 7064 | char *name; | 7067 | const char *name; |
| 7065 | int size; | 7068 | int size; |
| 7066 | Style style; | 7069 | Style style; |
| 7067 | char *charset; | 7070 | char *charset; |
| @@ -7108,7 +7111,8 @@ const int kDefaultFontSize = 12; | |||
| 7108 | 7111 | ||
| 7109 | static int | 7112 | static int |
| 7110 | parse_x_font_name (xf, family, size, style, charset) | 7113 | parse_x_font_name (xf, family, size, style, charset) |
| 7111 | char *xf, *family; | 7114 | const char *xf; |
| 7115 | char *family; | ||
| 7112 | int *size; | 7116 | int *size; |
| 7113 | Style *style; | 7117 | Style *style; |
| 7114 | char *charset; | 7118 | char *charset; |
| @@ -7191,10 +7195,10 @@ add_font_name_table_entry (char *font_name) | |||
| 7191 | 7195 | ||
| 7192 | static void | 7196 | static void |
| 7193 | add_mac_font_name (name, size, style, charset) | 7197 | add_mac_font_name (name, size, style, charset) |
| 7194 | char *name; | 7198 | const char *name; |
| 7195 | int size; | 7199 | int size; |
| 7196 | Style style; | 7200 | Style style; |
| 7197 | char *charset; | 7201 | const char *charset; |
| 7198 | { | 7202 | { |
| 7199 | if (size > 0) | 7203 | if (size > 0) |
| 7200 | add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset)); | 7204 | add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset)); |
| @@ -7496,7 +7500,7 @@ enum xlfd_scalable_field_index | |||
| 7496 | XLFD_SCL_LAST | 7500 | XLFD_SCL_LAST |
| 7497 | }; | 7501 | }; |
| 7498 | 7502 | ||
| 7499 | static int xlfd_scalable_fields[] = | 7503 | static const int xlfd_scalable_fields[] = |
| 7500 | { | 7504 | { |
| 7501 | 6, /* PIXEL_SIZE */ | 7505 | 6, /* PIXEL_SIZE */ |
| 7502 | 7, /* POINT_SIZE */ | 7506 | 7, /* POINT_SIZE */ |
| @@ -7506,14 +7510,16 @@ static int xlfd_scalable_fields[] = | |||
| 7506 | 7510 | ||
| 7507 | static Lisp_Object | 7511 | static Lisp_Object |
| 7508 | mac_do_list_fonts (pattern, maxnames) | 7512 | mac_do_list_fonts (pattern, maxnames) |
| 7509 | char *pattern; | 7513 | const char *pattern; |
| 7510 | int maxnames; | 7514 | int maxnames; |
| 7511 | { | 7515 | { |
| 7512 | int i, n_fonts = 0; | 7516 | int i, n_fonts = 0; |
| 7513 | Lisp_Object font_list = Qnil; | 7517 | Lisp_Object font_list = Qnil; |
| 7514 | struct xlfdpat *pat; | 7518 | struct xlfdpat *pat; |
| 7515 | char *scaled, *ptr; | 7519 | char *scaled; |
| 7516 | int scl_val[XLFD_SCL_LAST], *field, *val; | 7520 | const char *ptr; |
| 7521 | int scl_val[XLFD_SCL_LAST], *val; | ||
| 7522 | const int *field; | ||
| 7517 | int exact; | 7523 | int exact; |
| 7518 | 7524 | ||
| 7519 | if (font_name_table == NULL) /* Initialize when first used. */ | 7525 | if (font_name_table == NULL) /* Initialize when first used. */ |
| @@ -7763,7 +7769,8 @@ x_compute_min_glyph_bounds (f) | |||
| 7763 | fields are present, none is '*'. */ | 7769 | fields are present, none is '*'. */ |
| 7764 | 7770 | ||
| 7765 | static int | 7771 | static int |
| 7766 | is_fully_specified_xlfd (char *p) | 7772 | is_fully_specified_xlfd (p) |
| 7773 | const char *p; | ||
| 7767 | { | 7774 | { |
| 7768 | int i; | 7775 | int i; |
| 7769 | char *q; | 7776 | char *q; |
| @@ -7840,18 +7847,21 @@ mac_load_query_font (f, fontname) | |||
| 7840 | if (strcmp (charset, "iso10646-1") == 0) /* XXX */ | 7847 | if (strcmp (charset, "iso10646-1") == 0) /* XXX */ |
| 7841 | { | 7848 | { |
| 7842 | OSStatus err; | 7849 | OSStatus err; |
| 7843 | ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag, | 7850 | static const ATSUAttributeTag tags[] = |
| 7844 | kATSUQDBoldfaceTag, kATSUQDItalicTag}; | 7851 | {kATSUFontTag, kATSUSizeTag, |
| 7845 | ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed), | 7852 | kATSUQDBoldfaceTag, kATSUQDItalicTag}; |
| 7846 | sizeof (Boolean), sizeof (Boolean)}; | 7853 | static const ByteCount sizes[] = |
| 7854 | {sizeof (ATSUFontID), sizeof (Fixed), | ||
| 7855 | sizeof (Boolean), sizeof (Boolean)}; | ||
| 7847 | static Fixed size_fixed; | 7856 | static Fixed size_fixed; |
| 7848 | static Boolean bold_p, italic_p; | 7857 | static Boolean bold_p, italic_p; |
| 7849 | ATSUAttributeValuePtr values[] = {&font_id, &size_fixed, | 7858 | static const ATSUAttributeValuePtr values[] = |
| 7850 | &bold_p, &italic_p}; | 7859 | {&font_id, &size_fixed, |
| 7851 | ATSUFontFeatureType types[] = {kAllTypographicFeaturesType, | 7860 | &bold_p, &italic_p}; |
| 7852 | kDiacriticsType}; | 7861 | static const ATSUFontFeatureType types[] = |
| 7853 | ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector, | 7862 | {kAllTypographicFeaturesType, kDiacriticsType}; |
| 7854 | kDecomposeDiacriticsSelector}; | 7863 | static const ATSUFontFeatureSelector selectors[] = |
| 7864 | {kAllTypeFeaturesOffSelector, kDecomposeDiacriticsSelector}; | ||
| 7855 | Lisp_Object font_id_cons; | 7865 | Lisp_Object font_id_cons; |
| 7856 | FMFontStyle style; | 7866 | FMFontStyle style; |
| 7857 | 7867 | ||
| @@ -8642,7 +8652,7 @@ extern void terminate_applescript(); | |||
| 8642 | except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>) | 8652 | except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>) |
| 8643 | on the right of the Cmd key on laptops, and fn + `enter' (-> | 8653 | on the right of the Cmd key on laptops, and fn + `enter' (-> |
| 8644 | <linefeed>). */ | 8654 | <linefeed>). */ |
| 8645 | static unsigned char keycode_to_xkeysym_table[] = { | 8655 | static const unsigned char keycode_to_xkeysym_table[] = { |
| 8646 | /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 8656 | /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 8647 | /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 8657 | /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 8648 | /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 8658 | /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| @@ -8679,7 +8689,7 @@ static unsigned char keycode_to_xkeysym_table[] = { | |||
| 8679 | keyboard, and they may not be the same on other types of keyboards. | 8689 | keyboard, and they may not be the same on other types of keyboards. |
| 8680 | If the destination is identical to the source (f1 ... f12), it | 8690 | If the destination is identical to the source (f1 ... f12), it |
| 8681 | doesn't map `fn' key to a modifier. */ | 8691 | doesn't map `fn' key to a modifier. */ |
| 8682 | static unsigned char fn_keycode_to_keycode_table[] = { | 8692 | static const unsigned char fn_keycode_to_keycode_table[] = { |
| 8683 | /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 8693 | /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 8684 | /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 8694 | /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 8685 | /*0x20*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 8695 | /*0x20*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| @@ -9137,7 +9147,9 @@ do_apple_menu (SInt16 menu_item) | |||
| 9137 | Mesander and IM - Window Manager A. */ | 9147 | Mesander and IM - Window Manager A. */ |
| 9138 | 9148 | ||
| 9139 | static void | 9149 | static void |
| 9140 | do_grow_window (WindowPtr w, EventRecord *e) | 9150 | do_grow_window (w, e) |
| 9151 | WindowPtr w; | ||
| 9152 | const EventRecord *e; | ||
| 9141 | { | 9153 | { |
| 9142 | Rect limit_rect; | 9154 | Rect limit_rect; |
| 9143 | int rows, columns, width, height; | 9155 | int rows, columns, width, height; |
| @@ -9321,8 +9333,8 @@ mac_store_event_ref_as_apple_event (class, id, class_key, id_key, | |||
| 9321 | Lisp_Object class_key, id_key; | 9333 | Lisp_Object class_key, id_key; |
| 9322 | EventRef event; | 9334 | EventRef event; |
| 9323 | UInt32 num_params; | 9335 | UInt32 num_params; |
| 9324 | EventParamName *names; | 9336 | const EventParamName *names; |
| 9325 | EventParamType *types; | 9337 | const EventParamType *types; |
| 9326 | { | 9338 | { |
| 9327 | OSStatus err = eventNotHandledErr; | 9339 | OSStatus err = eventNotHandledErr; |
| 9328 | Lisp_Object binding; | 9340 | Lisp_Object binding; |
| @@ -9383,10 +9395,10 @@ mac_handle_command_event (next_handler, event, data) | |||
| 9383 | { | 9395 | { |
| 9384 | OSStatus result, err; | 9396 | OSStatus result, err; |
| 9385 | HICommand command; | 9397 | HICommand command; |
| 9386 | static EventParamName names[] = {kEventParamDirectObject, | 9398 | static const EventParamName names[] = |
| 9387 | kEventParamKeyModifiers}; | 9399 | {kEventParamDirectObject, kEventParamKeyModifiers}; |
| 9388 | static EventParamType types[] = {typeHICommand, | 9400 | static const EventParamType types[] = |
| 9389 | typeUInt32}; | 9401 | {typeHICommand, typeUInt32}; |
| 9390 | int num_params = sizeof (names) / sizeof (names[0]); | 9402 | int num_params = sizeof (names) / sizeof (names[0]); |
| 9391 | 9403 | ||
| 9392 | result = CallNextEventHandler (next_handler, event); | 9404 | result = CallNextEventHandler (next_handler, event); |
| @@ -9410,7 +9422,8 @@ mac_handle_command_event (next_handler, event, data) | |||
| 9410 | static OSStatus | 9422 | static OSStatus |
| 9411 | init_command_handler () | 9423 | init_command_handler () |
| 9412 | { | 9424 | { |
| 9413 | EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; | 9425 | static const EventTypeSpec specs[] = |
| 9426 | {{kEventClassCommand, kEventCommandProcess}}; | ||
| 9414 | static EventHandlerUPP handle_command_eventUPP = NULL; | 9427 | static EventHandlerUPP handle_command_eventUPP = NULL; |
| 9415 | 9428 | ||
| 9416 | if (handle_command_eventUPP == NULL) | 9429 | if (handle_command_eventUPP == NULL) |
| @@ -9570,18 +9583,18 @@ mac_handle_window_event (next_handler, event, data) | |||
| 9570 | case kEventWindowToolbarSwitchMode: | 9583 | case kEventWindowToolbarSwitchMode: |
| 9571 | result = CallNextEventHandler (next_handler, event); | 9584 | result = CallNextEventHandler (next_handler, event); |
| 9572 | { | 9585 | { |
| 9573 | static EventParamName names[] = {kEventParamDirectObject, | 9586 | static const EventParamName names[] = {kEventParamDirectObject, |
| 9574 | kEventParamWindowMouseLocation, | 9587 | kEventParamWindowMouseLocation, |
| 9575 | kEventParamKeyModifiers, | 9588 | kEventParamKeyModifiers, |
| 9576 | kEventParamMouseButton, | 9589 | kEventParamMouseButton, |
| 9577 | kEventParamClickCount, | 9590 | kEventParamClickCount, |
| 9578 | kEventParamMouseChord}; | 9591 | kEventParamMouseChord}; |
| 9579 | static EventParamType types[] = {typeWindowRef, | 9592 | static const EventParamType types[] = {typeWindowRef, |
| 9580 | typeQDPoint, | 9593 | typeQDPoint, |
| 9581 | typeUInt32, | 9594 | typeUInt32, |
| 9582 | typeMouseButton, | 9595 | typeMouseButton, |
| 9583 | typeUInt32, | 9596 | typeUInt32, |
| 9584 | typeUInt32}; | 9597 | typeUInt32}; |
| 9585 | int num_params = sizeof (names) / sizeof (names[0]); | 9598 | int num_params = sizeof (names) / sizeof (names[0]); |
| 9586 | 9599 | ||
| 9587 | err = mac_store_event_ref_as_apple_event (0, 0, | 9600 | err = mac_store_event_ref_as_apple_event (0, 0, |
| @@ -9688,18 +9701,18 @@ mac_handle_font_event (next_handler, event, data) | |||
| 9688 | OSStatus result, err; | 9701 | OSStatus result, err; |
| 9689 | Lisp_Object id_key; | 9702 | Lisp_Object id_key; |
| 9690 | int num_params; | 9703 | int num_params; |
| 9691 | EventParamName *names; | 9704 | const EventParamName *names; |
| 9692 | EventParamType *types; | 9705 | const EventParamType *types; |
| 9693 | static EventParamName names_sel[] = {kEventParamATSUFontID, | 9706 | static const EventParamName names_sel[] = {kEventParamATSUFontID, |
| 9694 | kEventParamATSUFontSize, | 9707 | kEventParamATSUFontSize, |
| 9695 | kEventParamFMFontFamily, | 9708 | kEventParamFMFontFamily, |
| 9696 | kEventParamFMFontSize, | 9709 | kEventParamFMFontSize, |
| 9697 | kEventParamFontColor}; | 9710 | kEventParamFontColor}; |
| 9698 | static EventParamType types_sel[] = {typeATSUFontID, | 9711 | static const EventParamType types_sel[] = {typeATSUFontID, |
| 9699 | typeATSUSize, | 9712 | typeATSUSize, |
| 9700 | typeFMFontFamily, | 9713 | typeFMFontFamily, |
| 9701 | typeFMFontSize, | 9714 | typeFMFontSize, |
| 9702 | typeFontColor}; | 9715 | typeFontColor}; |
| 9703 | 9716 | ||
| 9704 | result = CallNextEventHandler (next_handler, event); | 9717 | result = CallNextEventHandler (next_handler, event); |
| 9705 | if (result != eventNotHandledErr) | 9718 | if (result != eventNotHandledErr) |
| @@ -9740,10 +9753,10 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 9740 | OSStatus result, err = noErr; | 9753 | OSStatus result, err = noErr; |
| 9741 | Lisp_Object id_key = Qnil; | 9754 | Lisp_Object id_key = Qnil; |
| 9742 | int num_params; | 9755 | int num_params; |
| 9743 | EventParamName *names; | 9756 | const EventParamName *names; |
| 9744 | EventParamType *types; | 9757 | const EventParamType *types; |
| 9745 | static UInt32 seqno_uaia = 0; | 9758 | static UInt32 seqno_uaia = 0; |
| 9746 | static EventParamName names_uaia[] = | 9759 | static const EventParamName names_uaia[] = |
| 9747 | {kEventParamTextInputSendComponentInstance, | 9760 | {kEventParamTextInputSendComponentInstance, |
| 9748 | kEventParamTextInputSendRefCon, | 9761 | kEventParamTextInputSendRefCon, |
| 9749 | kEventParamTextInputSendSLRec, | 9762 | kEventParamTextInputSendSLRec, |
| @@ -9756,7 +9769,7 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 9756 | kEventParamTextInputSendTextServiceEncoding, | 9769 | kEventParamTextInputSendTextServiceEncoding, |
| 9757 | kEventParamTextInputSendTextServiceMacEncoding, | 9770 | kEventParamTextInputSendTextServiceMacEncoding, |
| 9758 | EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER}; | 9771 | EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER}; |
| 9759 | static EventParamType types_uaia[] = | 9772 | static const EventParamType types_uaia[] = |
| 9760 | {typeComponentInstance, | 9773 | {typeComponentInstance, |
| 9761 | typeLongInteger, | 9774 | typeLongInteger, |
| 9762 | typeIntlWritingCode, | 9775 | typeIntlWritingCode, |
| @@ -9773,12 +9786,12 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 9773 | typeUInt32, | 9786 | typeUInt32, |
| 9774 | typeUInt32, | 9787 | typeUInt32, |
| 9775 | typeUInt32}; | 9788 | typeUInt32}; |
| 9776 | static EventParamName names_ufke[] = | 9789 | static const EventParamName names_ufke[] = |
| 9777 | {kEventParamTextInputSendComponentInstance, | 9790 | {kEventParamTextInputSendComponentInstance, |
| 9778 | kEventParamTextInputSendRefCon, | 9791 | kEventParamTextInputSendRefCon, |
| 9779 | kEventParamTextInputSendSLRec, | 9792 | kEventParamTextInputSendSLRec, |
| 9780 | kEventParamTextInputSendText}; | 9793 | kEventParamTextInputSendText}; |
| 9781 | static EventParamType types_ufke[] = | 9794 | static const EventParamType types_ufke[] = |
| 9782 | {typeComponentInstance, | 9795 | {typeComponentInstance, |
| 9783 | typeLongInteger, | 9796 | typeLongInteger, |
| 9784 | typeIntlWritingCode, | 9797 | typeIntlWritingCode, |
| @@ -9931,12 +9944,12 @@ mac_store_service_event (event) | |||
| 9931 | OSStatus err; | 9944 | OSStatus err; |
| 9932 | Lisp_Object id_key; | 9945 | Lisp_Object id_key; |
| 9933 | int num_params; | 9946 | int num_params; |
| 9934 | EventParamName *names; | 9947 | const EventParamName *names; |
| 9935 | EventParamType *types; | 9948 | const EventParamType *types; |
| 9936 | static EventParamName names_pfm[] = {kEventParamServiceMessageName, | 9949 | static const EventParamName names_pfm[] = |
| 9937 | kEventParamServiceUserData}; | 9950 | {kEventParamServiceMessageName, kEventParamServiceUserData}; |
| 9938 | static EventParamType types_pfm[] = {typeCFStringRef, | 9951 | static const EventParamType types_pfm[] = |
| 9939 | typeCFStringRef}; | 9952 | {typeCFStringRef, typeCFStringRef}; |
| 9940 | 9953 | ||
| 9941 | switch (GetEventKind (event)) | 9954 | switch (GetEventKind (event)) |
| 9942 | { | 9955 | { |
| @@ -9974,7 +9987,7 @@ install_window_handler (window) | |||
| 9974 | { | 9987 | { |
| 9975 | OSStatus err = noErr; | 9988 | OSStatus err = noErr; |
| 9976 | #if USE_CARBON_EVENTS | 9989 | #if USE_CARBON_EVENTS |
| 9977 | EventTypeSpec specs_window[] = | 9990 | static const EventTypeSpec specs_window[] = |
| 9978 | {{kEventClassWindow, kEventWindowUpdate}, | 9991 | {{kEventClassWindow, kEventWindowUpdate}, |
| 9979 | {kEventClassWindow, kEventWindowGetIdealSize}, | 9992 | {kEventClassWindow, kEventWindowGetIdealSize}, |
| 9980 | {kEventClassWindow, kEventWindowBoundsChanging}, | 9993 | {kEventClassWindow, kEventWindowBoundsChanging}, |
| @@ -9992,16 +10005,18 @@ install_window_handler (window) | |||
| 9992 | {kEventClassWindow, kEventWindowFocusRelinquish}, | 10005 | {kEventClassWindow, kEventWindowFocusRelinquish}, |
| 9993 | #endif | 10006 | #endif |
| 9994 | }; | 10007 | }; |
| 9995 | EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}}; | 10008 | static const EventTypeSpec specs_mouse[] = |
| 10009 | {{kEventClassMouse, kEventMouseWheelMoved}}; | ||
| 9996 | static EventHandlerUPP handle_window_eventUPP = NULL; | 10010 | static EventHandlerUPP handle_window_eventUPP = NULL; |
| 9997 | static EventHandlerUPP handle_mouse_eventUPP = NULL; | 10011 | static EventHandlerUPP handle_mouse_eventUPP = NULL; |
| 9998 | #if USE_MAC_FONT_PANEL | 10012 | #if USE_MAC_FONT_PANEL |
| 9999 | EventTypeSpec specs_font[] = {{kEventClassFont, kEventFontPanelClosed}, | 10013 | static const EventTypeSpec specs_font[] = |
| 10000 | {kEventClassFont, kEventFontSelection}}; | 10014 | {{kEventClassFont, kEventFontPanelClosed}, |
| 10015 | {kEventClassFont, kEventFontSelection}}; | ||
| 10001 | static EventHandlerUPP handle_font_eventUPP = NULL; | 10016 | static EventHandlerUPP handle_font_eventUPP = NULL; |
| 10002 | #endif | 10017 | #endif |
| 10003 | #if USE_MAC_TSM | 10018 | #if USE_MAC_TSM |
| 10004 | EventTypeSpec specs_text_input[] = | 10019 | static const EventTypeSpec specs_text_input[] = |
| 10005 | {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea}, | 10020 | {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea}, |
| 10006 | {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent}, | 10021 | {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent}, |
| 10007 | {kEventClassTextInput, kEventTextInputOffsetToPos}}; | 10022 | {kEventClassTextInput, kEventTextInputOffsetToPos}}; |
| @@ -11218,7 +11233,7 @@ mac_initialize_display_info () | |||
| 11218 | 11233 | ||
| 11219 | static XrmDatabase | 11234 | static XrmDatabase |
| 11220 | mac_make_rdb (xrm_option) | 11235 | mac_make_rdb (xrm_option) |
| 11221 | char *xrm_option; | 11236 | const char *xrm_option; |
| 11222 | { | 11237 | { |
| 11223 | XrmDatabase database; | 11238 | XrmDatabase database; |
| 11224 | 11239 | ||