/* Generic frame functions.
Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include "termhooks.h"
#include "dispextern.h"
#include "window.h"
-#ifdef HAVE_WINDOW_SYSTEM
#include "font.h"
+#ifdef HAVE_WINDOW_SYSTEM
#include "fontset.h"
#endif
#ifdef MSDOS
Lisp_Object Qheight, Qwidth;
Lisp_Object Qleft, Qright;
Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name;
+Lisp_Object Qtooltip;
Lisp_Object Qinternal_border_width;
Lisp_Object Qmouse_color;
Lisp_Object Qminibuffer;
\f
DEFUN ("framep", Fframep, Sframep, 1, 1, 0,
doc: /* Return non-nil if OBJECT is a frame.
-Value is t for a termcap frame (a character-only terminal),
-`x' for an Emacs frame that is really an X window,
-`w32' for an Emacs frame that is a window on MS-Windows display,
-`ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
-`pc' for a direct-write MS-DOS frame.
+Value is:
+ t for a termcap frame (a character-only terminal),
+ 'x' for an Emacs frame that is really an X window,
+ 'w32' for an Emacs frame that is a window on MS-Windows display,
+ 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
+ 'pc' for a direct-write MS-DOS frame.
See also `frame-live-p'. */)
(object)
Lisp_Object object;
DEFUN ("window-system", Fwindow_system, Swindow_system, 0, 1, 0,
doc: /* The name of the window system that FRAME is displaying through.
-The value is a symbol---for instance, 'x' for X windows.
-The value is nil if Emacs is using a text-only terminal.
-
-FRAME defaults to the currently selected frame. */)
+The value is a symbol:
+ nil for a termcap frame (a character-only terminal),
+ 'x' for an Emacs frame that is really an X window,
+ 'w32' for an Emacs frame that is a window on MS-Windows display,
+ 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
+ 'pc' for a direct-write MS-DOS frame.
+
+FRAME defaults to the currently selected frame.
+
+Use of this function as a predicate is deprecated. Instead,
+use `display-graphic-p' or any of the other `display-*-p'
+predicates which report frame's specific UI-related capabilities. */)
(frame)
Lisp_Object frame;
{
struct frame *sf = SELECTED_FRAME ();
struct kboard *kb;
- int minibuffer_selected;
+ int minibuffer_selected, tooltip_frame;
if (EQ (frame, Qnil))
{
}
}
+ tooltip_frame = !NILP (Fframe_parameter (frame, intern ("tooltip")));
+
/* Run `delete-frame-functions' unless FORCE is `noelisp' or
frame is a tooltip. FORCE is set to `noelisp' when handling
a disconnect from the terminal, so we don't dare call Lisp
code. */
- if (NILP (Vrun_hooks) || !NILP (Fframe_parameter (frame, intern ("tooltip"))))
+ if (NILP (Vrun_hooks) || tooltip_frame)
;
- if (EQ (force, Qnoelisp))
+ else if (EQ (force, Qnoelisp))
pending_funcalls
= Fcons (list3 (Qrun_hook_with_args, Qdelete_frame_functions, frame),
pending_funcalls);
}
/* Cause frame titles to update--necessary if we now have just one frame. */
- update_mode_lines = 1;
+ if (!tooltip_frame)
+ update_mode_lines = 1;
return Qnil;
}
val = values[i];
store_frame_param (f, prop, val);
- /* Changing the background color might change the background
- mode, so that we have to load new defface specs.
- Call frame-set-background-mode to do that. */
- if (EQ (prop, Qbackground_color))
- call1 (Qframe_set_background_mode, frame);
+ if (EQ (prop, Qforeground_color)
+ || EQ (prop, Qbackground_color))
+ update_face_from_frame_parameter (f, prop, val);
}
}
return Qnil;
case RES_TYPE_NUMBER:
return make_number (atoi (SDATA (tem)));
+ case RES_TYPE_BOOLEAN_NUMBER:
+ if (!strcmp (SDATA (tem), "on")
+ || !strcmp (SDATA (tem), "true"))
+ return make_number (1);
+ return make_number (atoi (SDATA (tem)));
+ break;
+
case RES_TYPE_FLOAT:
return make_float (atof (SDATA (tem)));
This function does not make the coordinates positive. */
-#define DEFAULT_ROWS 40
+#define DEFAULT_ROWS 35
#define DEFAULT_COLS 80
int
{
if (! NILP (Vmake_pointer_invisible))
{
- struct frame *f = SELECTED_FRAME ();
+ struct frame *f;
+ if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
+ return;
+
+ f = SELECTED_FRAME ();
if (f && !f->pointer_invisible
&& FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
{
{
/* We don't check Vmake_pointer_invisible here in case the
pointer was invisible when Vmake_pointer_invisible was set to nil. */
+ struct frame *f;
- struct frame *f = SELECTED_FRAME ();
+ if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
+ return;
+
+ f = SELECTED_FRAME ();
if (f && f->pointer_invisible && f->mouse_moved
&& FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
{
staticpro (&Qicon_left);
Qicon_top = intern_c_string ("icon-top");
staticpro (&Qicon_top);
+ Qtooltip = intern_c_string ("tooltip");
+ staticpro (&Qtooltip);
Qleft = intern_c_string ("left");
staticpro (&Qleft);
Qright = intern_c_string ("right");