aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/w32fns.c82
2 files changed, 41 insertions, 48 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 80b6ff8922b..85b81de2c29 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12008-07-14 Jason Rumney <jasonr@gnu.org>
2
3 * w32fns.c (w32_get_arg): Remove wrapper function.
4 (w32_createwindow, x_icon, x_create_tip_frame): Use x_get_arg
5 directly.
6 (Fx_create_frame): Sync with xfns.c. Use x_get_arg directly.
7
12008-07-14 Kenichi Handa <handa@m17n.org> 82008-07-14 Kenichi Handa <handa@m17n.org>
2 9
3 * xfont.c (xfont_open): Add workaround for X's bug. 10 * xfont.c (xfont_open): Add workaround for X's bug.
diff --git a/src/w32fns.c b/src/w32fns.c
index 490ce4b7b24..eba776fae44 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1985,32 +1985,8 @@ void x_set_scroll_bar_default_width (f)
1985} 1985}
1986 1986
1987 1987
1988/* Subroutines of creating a frame. */ 1988/* Subroutines for creating a frame. */
1989 1989
1990
1991/* Return the value of parameter PARAM.
1992
1993 First search ALIST, then Vdefault_frame_alist, then the X defaults
1994 database, using ATTRIBUTE as the attribute name and CLASS as its class.
1995
1996 Convert the resource to the type specified by desired_type.
1997
1998 If no default is specified, return Qunbound. If you call
1999 w32_get_arg, make sure you deal with Qunbound in a reasonable way,
2000 and don't let it get stored in any Lisp-visible variables! */
2001
2002static Lisp_Object
2003w32_get_arg (alist, param, attribute, class, type)
2004 Lisp_Object alist, param;
2005 char *attribute;
2006 char *class;
2007 enum resource_types type;
2008{
2009 return x_get_arg (check_x_display_info (Qnil),
2010 alist, param, attribute, class, type);
2011}
2012
2013
2014Cursor 1990Cursor
2015w32_load_cursor (LPCTSTR name) 1991w32_load_cursor (LPCTSTR name)
2016{ 1992{
@@ -2074,6 +2050,7 @@ w32_createwindow (f)
2074 RECT rect; 2050 RECT rect;
2075 Lisp_Object top = Qunbound; 2051 Lisp_Object top = Qunbound;
2076 Lisp_Object left = Qunbound; 2052 Lisp_Object left = Qunbound;
2053 struct w32_display_info *dpyinfo = &one_w32_display_info;
2077 2054
2078 rect.left = rect.top = 0; 2055 rect.left = rect.top = 0;
2079 rect.right = FRAME_PIXEL_WIDTH (f); 2056 rect.right = FRAME_PIXEL_WIDTH (f);
@@ -2098,8 +2075,8 @@ w32_createwindow (f)
2098 { 2075 {
2099 /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero 2076 /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero
2100 for anything that is not a number and is not Qunbound. */ 2077 for anything that is not a number and is not Qunbound. */
2101 left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); 2078 left = x_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER);
2102 top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); 2079 top = x_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER);
2103 } 2080 }
2104 2081
2105 FRAME_W32_WINDOW (f) = hwnd 2082 FRAME_W32_WINDOW (f) = hwnd
@@ -4140,11 +4117,12 @@ x_icon (f, parms)
4140 Lisp_Object parms; 4117 Lisp_Object parms;
4141{ 4118{
4142 Lisp_Object icon_x, icon_y; 4119 Lisp_Object icon_x, icon_y;
4120 struct w32_display_info *dpyinfo = &one_w32_display_info;
4143 4121
4144 /* Set the position of the icon. Note that Windows 95 groups all 4122 /* Set the position of the icon. Note that Windows 95 groups all
4145 icons in the tray. */ 4123 icons in the tray. */
4146 icon_x = w32_get_arg (parms, Qicon_left, 0, 0, RES_TYPE_NUMBER); 4124 icon_x = x_get_arg (dpyinfo, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
4147 icon_y = w32_get_arg (parms, Qicon_top, 0, 0, RES_TYPE_NUMBER); 4125 icon_y = x_get_arg (dpyinfo, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
4148 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) 4126 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
4149 { 4127 {
4150 CHECK_NUMBER (icon_x); 4128 CHECK_NUMBER (icon_x);
@@ -4161,7 +4139,7 @@ x_icon (f, parms)
4161#if 0 /* TODO */ 4139#if 0 /* TODO */
4162 /* Start up iconic or window? */ 4140 /* Start up iconic or window? */
4163 x_wm_set_window_state 4141 x_wm_set_window_state
4164 (f, (EQ (w32_get_arg (parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL), Qicon) 4142 (f, (EQ (x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL), Qicon)
4165 ? IconicState 4143 ? IconicState
4166 : NormalState)); 4144 : NormalState));
4167 4145
@@ -4302,8 +4280,6 @@ This function is an internal primitive--use `make-frame' instead. */)
4302 Lisp_Object parent; 4280 Lisp_Object parent;
4303 struct kboard *kb; 4281 struct kboard *kb;
4304 4282
4305 check_w32 ();
4306
4307 /* Make copy of frame parameters because the original is in pure 4283 /* Make copy of frame parameters because the original is in pure
4308 storage now. */ 4284 storage now. */
4309 parameters = Fcopy_alist (parameters); 4285 parameters = Fcopy_alist (parameters);
@@ -4312,7 +4288,9 @@ This function is an internal primitive--use `make-frame' instead. */)
4312 until we know if this frame has a specified name. */ 4288 until we know if this frame has a specified name. */
4313 Vx_resource_name = Vinvocation_name; 4289 Vx_resource_name = Vinvocation_name;
4314 4290
4315 display = w32_get_arg (parameters, Qdisplay, 0, 0, RES_TYPE_STRING); 4291 display = x_get_arg (dpyinfo, parameters, Qterminal, 0, 0, RES_TYPE_NUMBER);
4292 if (EQ (display, Qunbound))
4293 display = x_get_arg (dpyinfo, parameters, Qdisplay, 0, 0, RES_TYPE_STRING);
4316 if (EQ (display, Qunbound)) 4294 if (EQ (display, Qunbound))
4317 display = Qnil; 4295 display = Qnil;
4318 dpyinfo = check_x_display_info (display); 4296 dpyinfo = check_x_display_info (display);
@@ -4322,7 +4300,10 @@ This function is an internal primitive--use `make-frame' instead. */)
4322 kb = &the_only_kboard; 4300 kb = &the_only_kboard;
4323#endif 4301#endif
4324 4302
4325 name = w32_get_arg (parameters, Qname, "name", "Name", RES_TYPE_STRING); 4303 if (!dpyinfo->terminal->name)
4304 error ("Terminal is not live, can't create new frames on it");
4305
4306 name = x_get_arg (dpyinfo, parameters, Qname, "name", "Name", RES_TYPE_STRING);
4326 if (!STRINGP (name) 4307 if (!STRINGP (name)
4327 && ! EQ (name, Qunbound) 4308 && ! EQ (name, Qunbound)
4328 && ! NILP (name)) 4309 && ! NILP (name))
@@ -4332,7 +4313,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4332 Vx_resource_name = name; 4313 Vx_resource_name = name;
4333 4314
4334 /* See if parent window is specified. */ 4315 /* See if parent window is specified. */
4335 parent = w32_get_arg (parameters, Qparent_id, NULL, NULL, RES_TYPE_NUMBER); 4316 parent = x_get_arg (dpyinfo, parameters, Qparent_id, NULL, NULL, RES_TYPE_NUMBER);
4336 if (EQ (parent, Qunbound)) 4317 if (EQ (parent, Qunbound))
4337 parent = Qnil; 4318 parent = Qnil;
4338 if (! NILP (parent)) 4319 if (! NILP (parent))
@@ -4343,7 +4324,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4343 it to make_frame_without_minibuffer. */ 4324 it to make_frame_without_minibuffer. */
4344 frame = Qnil; 4325 frame = Qnil;
4345 GCPRO4 (parameters, parent, name, frame); 4326 GCPRO4 (parameters, parent, name, frame);
4346 tem = w32_get_arg (parameters, Qminibuffer, "minibuffer", "Minibuffer", 4327 tem = x_get_arg (dpyinfo, parameters, Qminibuffer, "minibuffer", "Minibuffer",
4347 RES_TYPE_SYMBOL); 4328 RES_TYPE_SYMBOL);
4348 if (EQ (tem, Qnone) || NILP (tem)) 4329 if (EQ (tem, Qnone) || NILP (tem))
4349 f = make_frame_without_minibuffer (Qnil, kb, display); 4330 f = make_frame_without_minibuffer (Qnil, kb, display);
@@ -4376,14 +4357,19 @@ This function is an internal primitive--use `make-frame' instead. */)
4376 record_unwind_protect (unwind_create_frame, frame); 4357 record_unwind_protect (unwind_create_frame, frame);
4377 4358
4378 f->icon_name 4359 f->icon_name
4379 = w32_get_arg (parameters, Qicon_name, "iconName", "Title", RES_TYPE_STRING); 4360 = x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title",
4361 RES_TYPE_STRING);
4380 if (! STRINGP (f->icon_name)) 4362 if (! STRINGP (f->icon_name))
4381 f->icon_name = Qnil; 4363 f->icon_name = Qnil;
4382 4364
4383/* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */ 4365/* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */
4384#ifdef MULTI_KBOARD 4366
4385 FRAME_KBOARD (f) = kb; 4367 /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */
4386#endif 4368 record_unwind_protect (unwind_create_frame, frame);
4369#if GLYPH_DEBUG
4370 image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
4371 dpyinfo_refcount = dpyinfo->reference_count;
4372#endif /* GLYPH_DEBUG */
4387 4373
4388 /* Specify the parent under which to make this window. */ 4374 /* Specify the parent under which to make this window. */
4389 4375
@@ -4427,14 +4413,14 @@ This function is an internal primitive--use `make-frame' instead. */)
4427 x_default_font_parameter (f, parameters); 4413 x_default_font_parameter (f, parameters);
4428 x_default_parameter (f, parameters, Qborder_width, make_number (2), 4414 x_default_parameter (f, parameters, Qborder_width, make_number (2),
4429 "borderWidth", "BorderWidth", RES_TYPE_NUMBER); 4415 "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
4430 /* This defaults to 2 in order to match xterm. We recognize either 4416
4431 internalBorderWidth or internalBorder (which is what xterm calls 4417 /* We recognize either internalBorderWidth or internalBorder
4432 it). */ 4418 (which is what xterm calls it). */
4433 if (NILP (Fassq (Qinternal_border_width, parameters))) 4419 if (NILP (Fassq (Qinternal_border_width, parameters)))
4434 { 4420 {
4435 Lisp_Object value; 4421 Lisp_Object value;
4436 4422
4437 value = w32_get_arg (parameters, Qinternal_border_width, 4423 value = x_get_arg (dpyinfo, parameters, Qinternal_border_width,
4438 "internalBorder", "InternalBorder", RES_TYPE_NUMBER); 4424 "internalBorder", "InternalBorder", RES_TYPE_NUMBER);
4439 if (! EQ (value, Qunbound)) 4425 if (! EQ (value, Qunbound))
4440 parameters = Fcons (Fcons (Qinternal_border_width, value), 4426 parameters = Fcons (Fcons (Qinternal_border_width, value),
@@ -4501,7 +4487,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4501 4487
4502 window_prompting = x_figure_window_size (f, parameters, 1); 4488 window_prompting = x_figure_window_size (f, parameters, 1);
4503 4489
4504 tem = w32_get_arg (parameters, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); 4490 tem = x_get_arg (dpyinfo, parameters, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
4505 f->no_split = minibuffer_only || EQ (tem, Qt); 4491 f->no_split = minibuffer_only || EQ (tem, Qt);
4506 4492
4507 w32_window (f, window_prompting, minibuffer_only); 4493 w32_window (f, window_prompting, minibuffer_only);
@@ -4553,7 +4539,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4553 { 4539 {
4554 Lisp_Object visibility; 4540 Lisp_Object visibility;
4555 4541
4556 visibility = w32_get_arg (parameters, Qvisibility, 0, 0, RES_TYPE_SYMBOL); 4542 visibility = x_get_arg (dpyinfo, parameters, Qvisibility, 0, 0, RES_TYPE_SYMBOL);
4557 if (EQ (visibility, Qunbound)) 4543 if (EQ (visibility, Qunbound))
4558 visibility = Qt; 4544 visibility = Qt;
4559 4545
@@ -5442,7 +5428,7 @@ x_create_tip_frame (dpyinfo, parms, text)
5442#endif 5428#endif
5443 5429
5444 /* Get the name of the frame to use for resource lookup. */ 5430 /* Get the name of the frame to use for resource lookup. */
5445 name = w32_get_arg (parms, Qname, "name", "Name", RES_TYPE_STRING); 5431 name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
5446 if (!STRINGP (name) 5432 if (!STRINGP (name)
5447 && !EQ (name, Qunbound) 5433 && !EQ (name, Qunbound)
5448 && !NILP (name)) 5434 && !NILP (name))
@@ -5532,7 +5518,7 @@ x_create_tip_frame (dpyinfo, parms, text)
5532 { 5518 {
5533 Lisp_Object value; 5519 Lisp_Object value;
5534 5520
5535 value = w32_get_arg (parms, Qinternal_border_width, 5521 value = x_get_arg (dpyinfo, parms, Qinternal_border_width,
5536 "internalBorder", "internalBorder", RES_TYPE_NUMBER); 5522 "internalBorder", "internalBorder", RES_TYPE_NUMBER);
5537 if (! EQ (value, Qunbound)) 5523 if (! EQ (value, Qunbound))
5538 parms = Fcons (Fcons (Qinternal_border_width, value), 5524 parms = Fcons (Fcons (Qinternal_border_width, value),