Mercurial > emacs
comparison src/macfns.c @ 90070:95879cc1ed20
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-81
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-748
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-749
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-751
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-753
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-754
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-755
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-757
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-78
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-79
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-80
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-81
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-82
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 02 Jan 2005 09:13:19 +0000 |
parents | f2ebccfa87d4 60ffced08532 |
children | cb67264d6096 |
comparison
equal
deleted
inserted
replaced
90069:fa0a5c4db2c8 | 90070:95879cc1ed20 |
---|---|
156 Lisp_Object Qcontrol; | 156 Lisp_Object Qcontrol; |
157 Lisp_Object Qshift; | 157 Lisp_Object Qshift; |
158 | 158 |
159 extern Lisp_Object Vwindow_system_version; | 159 extern Lisp_Object Vwindow_system_version; |
160 | 160 |
161 extern int mac_initialized; | 161 #if 0 /* Use xstricmp instead. */ |
162 | |
163 | |
164 /* compare two strings ignoring case */ | 162 /* compare two strings ignoring case */ |
165 | 163 |
166 static int | 164 static int |
167 stricmp (const char *s, const char *t) | 165 stricmp (const char *s, const char *t) |
168 { | 166 { |
169 for ( ; tolower (*s) == tolower (*t); s++, t++) | 167 for ( ; tolower (*s) == tolower (*t); s++, t++) |
170 if (*s == '\0') | 168 if (*s == '\0') |
171 return 0; | 169 return 0; |
172 return tolower (*s) - tolower (*t); | 170 return tolower (*s) - tolower (*t); |
173 } | 171 } |
172 #endif | |
174 | 173 |
175 /* compare two strings up to n characters, ignoring case */ | 174 /* compare two strings up to n characters, ignoring case */ |
176 | 175 |
177 static int | 176 static int |
178 strnicmp (const char *s, const char *t, unsigned int n) | 177 strnicmp (const char *s, const char *t, unsigned int n) |
179 { | 178 { |
180 for ( ; n-- > 0 && tolower (*s) == tolower (*t); s++, t++) | 179 for ( ; n > 0 && tolower (*s) == tolower (*t); n--, s++, t++) |
181 if (*s == '\0') | 180 if (*s == '\0') |
182 return 0; | 181 return 0; |
183 return n == 0 ? 0 : tolower (*s) - tolower (*t); | 182 return n == 0 ? 0 : tolower (*s) - tolower (*t); |
184 } | 183 } |
185 | 184 |
188 | 187 |
189 void | 188 void |
190 check_mac () | 189 check_mac () |
191 { | 190 { |
192 if (! mac_in_use) | 191 if (! mac_in_use) |
193 error ("Mac OS not in use or not initialized"); | 192 error ("Mac native windows not in use or not initialized"); |
194 } | 193 } |
195 | 194 |
196 /* Nonzero if we can use mouse menus. | 195 /* Nonzero if we can use mouse menus. |
197 You should not call this unless HAVE_MENUS is defined. */ | 196 You should not call this unless HAVE_MENUS is defined. */ |
198 | 197 |
226 | 225 |
227 struct mac_display_info * | 226 struct mac_display_info * |
228 check_x_display_info (frame) | 227 check_x_display_info (frame) |
229 Lisp_Object frame; | 228 Lisp_Object frame; |
230 { | 229 { |
231 if (!mac_initialized) | 230 struct mac_display_info *dpyinfo = NULL; |
232 { | |
233 mac_initialize (); | |
234 mac_initialized = 1; | |
235 } | |
236 | 231 |
237 if (NILP (frame)) | 232 if (NILP (frame)) |
238 { | 233 { |
239 struct frame *sf = XFRAME (selected_frame); | 234 struct frame *sf = XFRAME (selected_frame); |
240 | 235 |
241 if (FRAME_MAC_P (sf) && FRAME_LIVE_P (sf)) | 236 if (FRAME_MAC_P (sf) && FRAME_LIVE_P (sf)) |
242 return FRAME_MAC_DISPLAY_INFO (sf); | 237 dpyinfo = FRAME_MAC_DISPLAY_INFO (sf); |
238 else if (x_display_list != 0) | |
239 dpyinfo = x_display_list; | |
243 else | 240 else |
244 return &one_mac_display_info; | 241 error ("Mac native windows are not in use or not initialized"); |
245 } | 242 } |
246 else if (STRINGP (frame)) | 243 else if (STRINGP (frame)) |
247 return x_display_info_for_name (frame); | 244 dpyinfo = x_display_info_for_name (frame); |
248 else | 245 else |
249 { | 246 { |
250 FRAME_PTR f; | 247 FRAME_PTR f = check_x_frame (frame); |
251 | 248 dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
252 CHECK_LIVE_FRAME (frame); | 249 } |
253 f = XFRAME (frame); | 250 |
254 if (! FRAME_MAC_P (f)) | 251 return dpyinfo; |
255 error ("non-mac frame used"); | |
256 return FRAME_MAC_DISPLAY_INFO (f); | |
257 } | |
258 } | 252 } |
259 | 253 |
260 /* Return the Emacs frame-object corresponding to a mac window. | 254 /* Return the Emacs frame-object corresponding to a mac window. |
261 It could be the frame's main window or an icon window. */ | 255 It could be the frame's main window or an icon window. */ |
262 | 256 |
1107 int i; | 1101 int i; |
1108 | 1102 |
1109 BLOCK_INPUT; | 1103 BLOCK_INPUT; |
1110 | 1104 |
1111 for (i = 0; i < sizeof (mac_color_map) / sizeof (mac_color_map[0]); i++) | 1105 for (i = 0; i < sizeof (mac_color_map) / sizeof (mac_color_map[0]); i++) |
1112 if (stricmp (colorname, mac_color_map[i].name) == 0) | 1106 if (xstricmp (colorname, mac_color_map[i].name) == 0) |
1113 { | 1107 { |
1114 ret = make_number (mac_color_map[i].color); | 1108 ret = make_number (mac_color_map[i].color); |
1115 break; | 1109 break; |
1116 } | 1110 } |
1117 | 1111 |
2057 } | 2051 } |
2058 | 2052 |
2059 | 2053 |
2060 /* Subroutines of creating a frame. */ | 2054 /* Subroutines of creating a frame. */ |
2061 | 2055 |
2056 static char * | |
2057 mac_get_rdb_resource (rdb, resource) | |
2058 char *rdb; | |
2059 char *resource; | |
2060 { | |
2061 char *value = rdb; | |
2062 int len = strlen (resource); | |
2063 | |
2064 while (*value) | |
2065 { | |
2066 if ((strncmp (value, resource, len) == 0) && (value[len] == ':')) | |
2067 return xstrdup (&value[len + 1]); | |
2068 | |
2069 value = strchr (value, '\0') + 1; | |
2070 } | |
2071 | |
2072 return NULL; | |
2073 } | |
2074 | |
2075 /* Retrieve the string resource specified by NAME with CLASS from | |
2076 database RDB. */ | |
2077 | |
2062 char * | 2078 char * |
2063 x_get_string_resource (rdb, name, class) | 2079 x_get_string_resource (rdb, name, class) |
2064 XrmDatabase rdb; | 2080 XrmDatabase rdb; |
2065 char *name, *class; | 2081 char *name, *class; |
2066 { | 2082 { |
2067 /* MAC_TODO: implement resource strings */ | 2083 if (rdb) |
2084 { | |
2085 char *resource; | |
2086 | |
2087 if (resource = mac_get_rdb_resource (rdb, name)) | |
2088 return resource; | |
2089 if (resource = mac_get_rdb_resource (rdb, class)) | |
2090 return resource; | |
2091 } | |
2092 | |
2093 /* MAC_TODO: implement resource strings. (Maybe Property Lists?) */ | |
2094 #if 0 | |
2095 return mac_get_string_resource (name, class); | |
2096 #else | |
2068 return (char *)0; | 2097 return (char *)0; |
2098 #endif | |
2069 } | 2099 } |
2070 | 2100 |
2071 /* Return the value of parameter PARAM. | 2101 /* Return the value of parameter PARAM. |
2072 | 2102 |
2073 First search ALIST, then Vdefault_frame_alist, then the X defaults | 2103 First search ALIST, then Vdefault_frame_alist, then the X defaults |
2227 *height = tempHeight; | 2257 *height = tempHeight; |
2228 return (mask); | 2258 return (mask); |
2229 } | 2259 } |
2230 | 2260 |
2231 | 2261 |
2232 #if 0 /* MAC_TODO */ | |
2233 /* Create and set up the Mac window for frame F. */ | 2262 /* Create and set up the Mac window for frame F. */ |
2234 | 2263 |
2264 extern OSErr install_window_handler (WindowPtr); | |
2265 | |
2235 static void | 2266 static void |
2236 mac_window (f, window_prompting, minibuffer_only) | 2267 mac_window (f) |
2237 struct frame *f; | 2268 struct frame *f; |
2238 long window_prompting; | |
2239 int minibuffer_only; | |
2240 { | 2269 { |
2241 Rect r; | 2270 Rect r; |
2242 | 2271 |
2243 BLOCK_INPUT; | 2272 BLOCK_INPUT; |
2244 | |
2245 /* Use the resource name as the top-level window name | |
2246 for looking up resources. Make a non-Lisp copy | |
2247 for the window manager, so GC relocation won't bother it. | |
2248 | |
2249 Elsewhere we specify the window name for the window manager. */ | |
2250 | |
2251 { | |
2252 char *str = (char *) SDATA (Vx_resource_name); | |
2253 f->namebuf = (char *) xmalloc (strlen (str) + 1); | |
2254 strcpy (f->namebuf, str); | |
2255 } | |
2256 | 2273 |
2257 SetRect (&r, f->left_pos, f->top_pos, | 2274 SetRect (&r, f->left_pos, f->top_pos, |
2258 f->left_pos + FRAME_PIXEL_WIDTH (f), | 2275 f->left_pos + FRAME_PIXEL_WIDTH (f), |
2259 f->top_pos + FRAME_PIXEL_HEIGHT (f)); | 2276 f->top_pos + FRAME_PIXEL_HEIGHT (f)); |
2277 #if TARGET_API_MAC_CARBON | |
2278 CreateNewWindow (kDocumentWindowClass, | |
2279 kWindowStandardDocumentAttributes | |
2280 /* | kWindowToolbarButtonAttribute */, | |
2281 &r, &FRAME_MAC_WINDOW (f)); | |
2282 if (FRAME_MAC_WINDOW (f)) | |
2283 { | |
2284 SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac); | |
2285 if (install_window_handler (FRAME_MAC_WINDOW (f)) != noErr) | |
2286 { | |
2287 DisposeWindow (FRAME_MAC_WINDOW (f)); | |
2288 FRAME_MAC_WINDOW (f) = NULL; | |
2289 } | |
2290 } | |
2291 #else | |
2260 FRAME_MAC_WINDOW (f) | 2292 FRAME_MAC_WINDOW (f) |
2261 = NewCWindow (NULL, &r, "\p", 1, zoomDocProc, (WindowPtr) -1, 1, (long) f->output_data.mac); | 2293 = NewCWindow (NULL, &r, "\p", false, zoomDocProc, |
2294 (WindowPtr) -1, 1, (long) f->output_data.mac); | |
2295 #endif | |
2296 /* so that update events can find this mac_output struct */ | |
2297 f->output_data.mac->mFP = f; /* point back to emacs frame */ | |
2262 | 2298 |
2263 validate_x_resource_name (); | 2299 validate_x_resource_name (); |
2264 | 2300 |
2265 /* x_set_name normally ignores requests to set the name if the | 2301 /* x_set_name normally ignores requests to set the name if the |
2266 requested name is the same as the current name. This is the one | 2302 requested name is the same as the current name. This is the one |
2274 name = f->name; | 2310 name = f->name; |
2275 f->name = Qnil; | 2311 f->name = Qnil; |
2276 x_set_name (f, name, explicit); | 2312 x_set_name (f, name, explicit); |
2277 } | 2313 } |
2278 | 2314 |
2279 ShowWindow (FRAME_MAC_WINDOW (f)); | |
2280 | |
2281 UNBLOCK_INPUT; | 2315 UNBLOCK_INPUT; |
2282 | |
2283 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f)) | |
2284 initialize_frame_menubar (f); | |
2285 | 2316 |
2286 if (FRAME_MAC_WINDOW (f) == 0) | 2317 if (FRAME_MAC_WINDOW (f) == 0) |
2287 error ("Unable to create window"); | 2318 error ("Unable to create window"); |
2288 } | 2319 } |
2289 #endif /* MAC_TODO */ | |
2290 | 2320 |
2291 /* Handle the icon stuff for this window. Perhaps later we might | 2321 /* Handle the icon stuff for this window. Perhaps later we might |
2292 want an x_set_icon_position which can be called interactively as | 2322 want an x_set_icon_position which can be called interactively as |
2293 well. */ | 2323 well. */ |
2294 | 2324 |
2701 "toolBar", "ToolBar", RES_TYPE_NUMBER); | 2731 "toolBar", "ToolBar", RES_TYPE_NUMBER); |
2702 x_default_parameter (f, parms, Qbuffer_predicate, Qnil, | 2732 x_default_parameter (f, parms, Qbuffer_predicate, Qnil, |
2703 "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL); | 2733 "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL); |
2704 x_default_parameter (f, parms, Qtitle, Qnil, | 2734 x_default_parameter (f, parms, Qtitle, Qnil, |
2705 "title", "Title", RES_TYPE_STRING); | 2735 "title", "Title", RES_TYPE_STRING); |
2736 x_default_parameter (f, parms, Qfullscreen, Qnil, | |
2737 "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); | |
2706 | 2738 |
2707 f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window; | 2739 f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window; |
2708 | 2740 |
2709 #if TARGET_API_MAC_CARBON | 2741 #if TARGET_API_MAC_CARBON |
2710 f->output_data.mac->text_cursor = kThemeIBeamCursor; | 2742 f->output_data.mac->text_cursor = kThemeIBeamCursor; |
2726 window_prompting = x_figure_window_size (f, parms, 1); | 2758 window_prompting = x_figure_window_size (f, parms, 1); |
2727 | 2759 |
2728 tem = mac_get_arg (parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); | 2760 tem = mac_get_arg (parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); |
2729 f->no_split = minibuffer_only || EQ (tem, Qt); | 2761 f->no_split = minibuffer_only || EQ (tem, Qt); |
2730 | 2762 |
2731 /* mac_window (f, window_prompting, minibuffer_only); */ | 2763 mac_window (f); |
2732 make_mac_frame (f); | |
2733 | 2764 |
2734 x_icon (f, parms); | 2765 x_icon (f, parms); |
2735 x_make_gc (f); | 2766 x_make_gc (f); |
2736 | 2767 |
2737 /* Now consider the frame official. */ | 2768 /* Now consider the frame official. */ |
2761 | 2792 |
2762 SET_FRAME_COLS (f, 0); | 2793 SET_FRAME_COLS (f, 0); |
2763 FRAME_LINES (f) = 0; | 2794 FRAME_LINES (f) = 0; |
2764 change_frame_size (f, height, width, 1, 0, 0); | 2795 change_frame_size (f, height, width, 1, 0, 0); |
2765 | 2796 |
2766 #if 0 /* MAC_TODO: when we have window manager hints */ | |
2767 /* Tell the server what size and position, etc, we want, and how | 2797 /* Tell the server what size and position, etc, we want, and how |
2768 badly we want them. This should be done after we have the menu | 2798 badly we want them. This should be done after we have the menu |
2769 bar so that its size can be taken into account. */ | 2799 bar so that its size can be taken into account. */ |
2770 BLOCK_INPUT; | 2800 BLOCK_INPUT; |
2771 x_wm_set_size_hint (f, window_prompting, 0); | 2801 x_wm_set_size_hint (f, window_prompting, 0); |
2772 UNBLOCK_INPUT; | 2802 UNBLOCK_INPUT; |
2773 #endif | |
2774 | 2803 |
2775 /* Make the window appear on the frame and enable display, unless | 2804 /* Make the window appear on the frame and enable display, unless |
2776 the caller says not to. However, with explicit parent, Emacs | 2805 the caller says not to. However, with explicit parent, Emacs |
2777 cannot control visibility, so don't try. */ | 2806 cannot control visibility, so don't try. */ |
2778 if (! f->output_data.mac->explicit_parent) | 2807 if (! f->output_data.mac->explicit_parent) |
3142 Lisp_Object names; | 3171 Lisp_Object names; |
3143 struct mac_display_info *dpyinfo; | 3172 struct mac_display_info *dpyinfo; |
3144 | 3173 |
3145 CHECK_STRING (name); | 3174 CHECK_STRING (name); |
3146 | 3175 |
3176 if (! EQ (Vwindow_system, intern ("mac"))) | |
3177 error ("Not using Mac native windows"); | |
3178 | |
3147 for (dpyinfo = &one_mac_display_info, names = x_display_name_list; | 3179 for (dpyinfo = &one_mac_display_info, names = x_display_name_list; |
3148 dpyinfo; | 3180 dpyinfo; |
3149 dpyinfo = dpyinfo->next, names = XCDR (names)) | 3181 dpyinfo = dpyinfo->next, names = XCDR (names)) |
3150 { | 3182 { |
3151 Lisp_Object tem; | 3183 Lisp_Object tem; |
3169 XSETFASTINT (Vwindow_system_version, 3); | 3201 XSETFASTINT (Vwindow_system_version, 3); |
3170 | 3202 |
3171 return dpyinfo; | 3203 return dpyinfo; |
3172 } | 3204 } |
3173 | 3205 |
3174 #if 0 /* MAC_TODO: implement network support */ | |
3175 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, | 3206 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, |
3176 1, 3, 0, | 3207 1, 3, 0, |
3177 doc: /* Open a connection to a server. | 3208 doc: /* Open a connection to a server. |
3178 DISPLAY is the name of the display to connect to. | 3209 DISPLAY is the name of the display to connect to. |
3179 Optional second arg XRM-STRING is a string of resources in xrdb format. | 3210 Optional second arg XRM-STRING is a string of resources in xrdb format. |
3188 CHECK_STRING (display); | 3219 CHECK_STRING (display); |
3189 if (! NILP (xrm_string)) | 3220 if (! NILP (xrm_string)) |
3190 CHECK_STRING (xrm_string); | 3221 CHECK_STRING (xrm_string); |
3191 | 3222 |
3192 if (! EQ (Vwindow_system, intern ("mac"))) | 3223 if (! EQ (Vwindow_system, intern ("mac"))) |
3193 error ("Not using Mac OS"); | 3224 error ("Not using Mac native windows"); |
3194 | 3225 |
3195 if (! NILP (xrm_string)) | 3226 if (! NILP (xrm_string)) |
3196 xrm_option = (unsigned char *) SDATA (xrm_string); | 3227 xrm_option = (unsigned char *) SDATA (xrm_string); |
3197 else | 3228 else |
3198 xrm_option = (unsigned char *) 0; | 3229 xrm_option = (unsigned char *) 0; |
3236 BLOCK_INPUT; | 3267 BLOCK_INPUT; |
3237 /* Free the fonts in the font table. */ | 3268 /* Free the fonts in the font table. */ |
3238 for (i = 0; i < dpyinfo->n_fonts; i++) | 3269 for (i = 0; i < dpyinfo->n_fonts; i++) |
3239 if (dpyinfo->font_table[i].name) | 3270 if (dpyinfo->font_table[i].name) |
3240 { | 3271 { |
3241 if (dpyinfo->font_table[i].name != dpyinfo->font_table[i].full_name) | 3272 mac_unload_font (dpyinfo, dpyinfo->font_table[i].font); |
3242 xfree (dpyinfo->font_table[i].full_name); | |
3243 xfree (dpyinfo->font_table[i].name); | |
3244 x_unload_font (dpyinfo, dpyinfo->font_table[i].font); | |
3245 } | 3273 } |
3274 | |
3246 x_destroy_all_bitmaps (dpyinfo); | 3275 x_destroy_all_bitmaps (dpyinfo); |
3247 | 3276 |
3248 x_delete_display (dpyinfo); | 3277 x_delete_display (dpyinfo); |
3249 UNBLOCK_INPUT; | 3278 UNBLOCK_INPUT; |
3250 | 3279 |
3251 return Qnil; | 3280 return Qnil; |
3252 } | 3281 } |
3253 #endif /* 0 */ | |
3254 | 3282 |
3255 DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, | 3283 DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, |
3256 doc: /* Return the list of display names that Emacs has connections to. */) | 3284 doc: /* Return the list of display names that Emacs has connections to. */) |
3257 () | 3285 () |
3258 { | 3286 { |
3811 { | 3839 { |
3812 Rect r; | 3840 Rect r; |
3813 | 3841 |
3814 BLOCK_INPUT; | 3842 BLOCK_INPUT; |
3815 SetRect (&r, 0, 0, 1, 1); | 3843 SetRect (&r, 0, 0, 1, 1); |
3844 #if TARGET_API_MAC_CARBON | |
3816 if (CreateNewWindow (kHelpWindowClass, | 3845 if (CreateNewWindow (kHelpWindowClass, |
3817 #ifdef MAC_OS_X_VERSION_10_2 | 3846 #ifdef MAC_OS_X_VERSION_10_2 |
3818 kWindowIgnoreClicksAttribute | | 3847 kWindowIgnoreClicksAttribute | |
3819 #endif | 3848 #endif |
3849 kWindowNoUpdatesAttribute | | |
3820 kWindowNoActivatesAttribute, | 3850 kWindowNoActivatesAttribute, |
3821 &r, &tip_window) == noErr) | 3851 &r, &tip_window) == noErr) |
3852 #else | |
3853 if (tip_window = NewCWindow (NULL, &r, "\p", false, plainDBox, | |
3854 NULL, false, 0L)) | |
3855 #endif | |
3822 { | 3856 { |
3823 FRAME_MAC_WINDOW (f) = tip_window; | 3857 FRAME_MAC_WINDOW (f) = tip_window; |
3824 SetWRefCon (tip_window, (long) f->output_data.mac); | 3858 SetWRefCon (tip_window, (long) f->output_data.mac); |
3825 /* so that update events can find this mac_output struct */ | 3859 /* so that update events can find this mac_output struct */ |
3826 f->output_data.mac->mFP = f; | 3860 f->output_data.mac->mFP = f; |
3827 ShowWindow (tip_window); | |
3828 } | 3861 } |
3829 UNBLOCK_INPUT; | 3862 UNBLOCK_INPUT; |
3830 } | 3863 } |
3831 | 3864 |
3832 x_make_gc (f); | 3865 x_make_gc (f); |
4138 compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); | 4171 compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); |
4139 | 4172 |
4140 BLOCK_INPUT; | 4173 BLOCK_INPUT; |
4141 MoveWindow (FRAME_MAC_WINDOW (f), root_x, root_y, false); | 4174 MoveWindow (FRAME_MAC_WINDOW (f), root_x, root_y, false); |
4142 SizeWindow (FRAME_MAC_WINDOW (f), width, height, true); | 4175 SizeWindow (FRAME_MAC_WINDOW (f), width, height, true); |
4176 ShowWindow (FRAME_MAC_WINDOW (f)); | |
4143 BringToFront (FRAME_MAC_WINDOW (f)); | 4177 BringToFront (FRAME_MAC_WINDOW (f)); |
4144 UNBLOCK_INPUT; | 4178 UNBLOCK_INPUT; |
4145 | 4179 |
4146 /* Draw into the window. */ | 4180 /* Draw into the window. */ |
4147 w->must_be_updated_p = 1; | 4181 w->must_be_updated_p = 1; |
4196 return unbind_to (count, deleted); | 4230 return unbind_to (count, deleted); |
4197 } | 4231 } |
4198 | 4232 |
4199 | 4233 |
4200 | 4234 |
4201 #ifdef TARGET_API_MAC_CARBON | 4235 #if TARGET_API_MAC_CARBON |
4202 /*********************************************************************** | 4236 /*********************************************************************** |
4203 File selection dialog | 4237 File selection dialog |
4204 ***********************************************************************/ | 4238 ***********************************************************************/ |
4205 | 4239 |
4206 /** | 4240 /** |
4403 x_set_screen_gamma, | 4437 x_set_screen_gamma, |
4404 x_set_line_spacing, | 4438 x_set_line_spacing, |
4405 x_set_fringe_width, | 4439 x_set_fringe_width, |
4406 x_set_fringe_width, | 4440 x_set_fringe_width, |
4407 0, /* x_set_wait_for_wm, */ | 4441 0, /* x_set_wait_for_wm, */ |
4408 0, /* MAC_TODO: x_set_fullscreen, */ | 4442 x_set_fullscreen, |
4409 }; | 4443 }; |
4410 | 4444 |
4411 void | 4445 void |
4412 syms_of_macfns () | 4446 syms_of_macfns () |
4413 { | 4447 { |
4414 /* Certainly running on Mac. */ | 4448 #ifdef MAC_OSX |
4449 /* This is zero if not using Mac native windows. */ | |
4450 mac_in_use = 0; | |
4451 #else | |
4452 /* Certainly running on Mac native windows. */ | |
4415 mac_in_use = 1; | 4453 mac_in_use = 1; |
4454 #endif | |
4416 | 4455 |
4417 /* The section below is built by the lisp expression at the top of the file, | 4456 /* The section below is built by the lisp expression at the top of the file, |
4418 just above where these variables are declared. */ | 4457 just above where these variables are declared. */ |
4419 /*&&& init symbols here &&&*/ | 4458 /*&&& init symbols here &&&*/ |
4420 Qnone = intern ("none"); | 4459 Qnone = intern ("none"); |
4534 defsubr (&Sx_display_color_cells); | 4573 defsubr (&Sx_display_color_cells); |
4535 defsubr (&Sx_display_visual_class); | 4574 defsubr (&Sx_display_visual_class); |
4536 defsubr (&Sx_display_backing_store); | 4575 defsubr (&Sx_display_backing_store); |
4537 defsubr (&Sx_display_save_under); | 4576 defsubr (&Sx_display_save_under); |
4538 defsubr (&Sx_create_frame); | 4577 defsubr (&Sx_create_frame); |
4539 #if 0 /* MAC_TODO: implement network support */ | |
4540 defsubr (&Sx_open_connection); | 4578 defsubr (&Sx_open_connection); |
4541 defsubr (&Sx_close_connection); | 4579 defsubr (&Sx_close_connection); |
4542 #endif | |
4543 defsubr (&Sx_display_list); | 4580 defsubr (&Sx_display_list); |
4544 defsubr (&Sx_synchronize); | 4581 defsubr (&Sx_synchronize); |
4545 | 4582 |
4546 /* Setting callback functions for fontset handler. */ | 4583 /* Setting callback functions for fontset handler. */ |
4547 get_font_info_func = x_get_font_info; | 4584 get_font_info_func = x_get_font_info; |