aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Innes2000-08-22 23:00:51 +0000
committerAndrew Innes2000-08-22 23:00:51 +0000
commit71eab8d17dbdc42e806c1a27d7a25613a0778008 (patch)
tree0cd2aa8cf65b2d6df23983b292bbc156d09ac19d
parent84f5bd8132890c09374d81b313408201b141df1f (diff)
downloademacs-71eab8d17dbdc42e806c1a27d7a25613a0778008.tar.gz
emacs-71eab8d17dbdc42e806c1a27d7a25613a0778008.zip
(max): Define macro.
(JOHAB_CHARSET): Define if not known. (MOD_ALT, MOD_CONTROL, MOD_SHIFT, MOD_WIN): Define if not known. (Fx_show_tip): Synch with X version.
-rw-r--r--src/w32fns.c72
1 files changed, 60 insertions, 12 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 7e44f78efda..3ccfdeef61d 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -30,11 +30,11 @@ Boston, MA 02111-1307, USA. */
30 30
31#include "lisp.h" 31#include "lisp.h"
32#include "charset.h" 32#include "charset.h"
33#include "dispextern.h"
33#include "w32term.h" 34#include "w32term.h"
34#include "frame.h" 35#include "frame.h"
35#include "window.h" 36#include "window.h"
36#include "buffer.h" 37#include "buffer.h"
37#include "dispextern.h"
38#include "fontset.h" 38#include "fontset.h"
39#include "intervals.h" 39#include "intervals.h"
40#include "keyboard.h" 40#include "keyboard.h"
@@ -52,6 +52,8 @@ Boston, MA 02111-1307, USA. */
52#include <shellapi.h> 52#include <shellapi.h>
53#include <ctype.h> 53#include <ctype.h>
54 54
55#define max(a, b) ((a) > (b) ? (a) : (b))
56
55extern void free_frame_menubar (); 57extern void free_frame_menubar ();
56extern double atof (); 58extern double atof ();
57extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state); 59extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state);
@@ -279,6 +281,9 @@ Lisp_Object Qw32_charset_gb2312;
279Lisp_Object Qw32_charset_chinesebig5; 281Lisp_Object Qw32_charset_chinesebig5;
280Lisp_Object Qw32_charset_oem; 282Lisp_Object Qw32_charset_oem;
281 283
284#ifndef JOHAB_CHARSET
285#define JOHAB_CHARSET 130
286#endif
282#ifdef JOHAB_CHARSET 287#ifdef JOHAB_CHARSET
283Lisp_Object Qw32_charset_easteurope; 288Lisp_Object Qw32_charset_easteurope;
284Lisp_Object Qw32_charset_turkish; 289Lisp_Object Qw32_charset_turkish;
@@ -12149,22 +12154,32 @@ x_create_tip_frame (dpyinfo, parms)
12149} 12154}
12150 12155
12151 12156
12152DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 4, 0, 12157DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
12153 "Show STRING in a \"tooltip\" window on frame FRAME.\n\ 12158 "Show STRING in a \"tooltip\" window on frame FRAME.\n\
12154A tooltip window is a small X window displaying STRING at\n\ 12159A tooltip window is a small X window displaying a string.\n\
12155the current mouse position.\n\ 12160\n\
12156FRAME nil or omitted means use the selected frame.\n\ 12161FRAME nil or omitted means use the selected frame.\n\
12162\n\
12157PARMS is an optional list of frame parameters which can be\n\ 12163PARMS is an optional list of frame parameters which can be\n\
12158used to change the tooltip's appearance.\n\ 12164used to change the tooltip's appearance.\n\
12165\n\
12159Automatically hide the tooltip after TIMEOUT seconds.\n\ 12166Automatically hide the tooltip after TIMEOUT seconds.\n\
12160TIMEOUT nil means use the default timeout of 5 seconds.") 12167TIMEOUT nil means use the default timeout of 5 seconds.\n\
12161 (string, frame, parms, timeout) 12168\n\
12162 Lisp_Object string, frame, parms, timeout; 12169If the list of frame parameters PARAMS contains a `left' parameters,\n\
12170the tooltip is displayed at that x-position. Otherwise it is\n\
12171displayed at the mouse position, with offset DX added (default is 5 if\n\
12172DX isn't specified). Likewise for the y-position; if a `top' frame\n\
12173parameter is specified, it determines the y-position of the tooltip\n\
12174window, otherwise it is displayed at the mouse position, with offset\n\
12175DY added (default is -5).")
12176 (string, frame, parms, timeout, dx, dy)
12177 Lisp_Object string, frame, parms, timeout, dx, dy;
12163{ 12178{
12164 struct frame *f; 12179 struct frame *f;
12165 struct window *w; 12180 struct window *w;
12166 Window root, child; 12181 Window root, child;
12167 Lisp_Object buffer; 12182 Lisp_Object buffer, top, left;
12168 struct buffer *old_buffer; 12183 struct buffer *old_buffer;
12169 struct text_pos pos; 12184 struct text_pos pos;
12170 int i, width, height; 12185 int i, width, height;
@@ -12185,6 +12200,16 @@ TIMEOUT nil means use the default timeout of 5 seconds.")
12185 else 12200 else
12186 CHECK_NATNUM (timeout, 2); 12201 CHECK_NATNUM (timeout, 2);
12187 12202
12203 if (NILP (dx))
12204 dx = make_number (5);
12205 else
12206 CHECK_NUMBER (dx, 5);
12207
12208 if (NILP (dy))
12209 dy = make_number (-5);
12210 else
12211 CHECK_NUMBER (dy, 6);
12212
12188 /* Hide a previous tip, if any. */ 12213 /* Hide a previous tip, if any. */
12189 Fx_hide_tip (); 12214 Fx_hide_tip ();
12190 12215
@@ -12262,15 +12287,30 @@ TIMEOUT nil means use the default timeout of 5 seconds.")
12262 height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); 12287 height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
12263 width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); 12288 width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
12264 12289
12290 /* User-specified position? */
12291 left = Fcdr (Fassq (Qleft, parms));
12292 top = Fcdr (Fassq (Qtop, parms));
12293
12265 /* Move the tooltip window where the mouse pointer is. Resize and 12294 /* Move the tooltip window where the mouse pointer is. Resize and
12266 show it. */ 12295 show it. */
12267#if 0 /* NTEMACS_TODO : W32 specifics */ 12296#if 0 /* NTEMACS_TODO : W32 specifics */
12268 BLOCK_INPUT; 12297 BLOCK_INPUT;
12269 XQueryPointer (FRAME_W32_DISPLAY (f), FRAME_W32_DISPLAY_INFO (f)->root_window, 12298 XQueryPointer (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window,
12270 &root, &child, &root_x, &root_y, &win_x, &win_y, &pmask); 12299 &root, &child, &root_x, &root_y, &win_x, &win_y, &pmask);
12271 XMoveResizeWindow (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), 12300 UNBLOCK_INPUT;
12272 root_x + 5, root_y - height - 5, width, height); 12301
12273 XMapRaised (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f)); 12302 root_x += XINT (dx);
12303 root_y += XINT (dy);
12304
12305 if (INTEGERP (left))
12306 root_x = XINT (left);
12307 if (INTEGERP (top))
12308 root_y = XINT (top);
12309
12310 BLOCK_INPUT;
12311 XMoveResizeWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
12312 root_x, root_y - height, width, height);
12313 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
12274 UNBLOCK_INPUT; 12314 UNBLOCK_INPUT;
12275#endif /* NTEMACS_TODO */ 12315#endif /* NTEMACS_TODO */
12276 12316
@@ -12649,6 +12689,14 @@ w32_parse_hot_key (key)
12649 && !NILP (Vw32_alt_is_meta)) 12689 && !NILP (Vw32_alt_is_meta))
12650 lisp_modifiers |= alt_modifier; 12690 lisp_modifiers |= alt_modifier;
12651 12691
12692 /* Supply defs missing from mingw32. */
12693#ifndef MOD_ALT
12694#define MOD_ALT 0x0001
12695#define MOD_CONTROL 0x0002
12696#define MOD_SHIFT 0x0004
12697#define MOD_WIN 0x0008
12698#endif
12699
12652 /* Convert lisp modifiers to Windows hot-key form. */ 12700 /* Convert lisp modifiers to Windows hot-key form. */
12653 w32_modifiers = (lisp_modifiers & hyper_modifier) ? MOD_WIN : 0; 12701 w32_modifiers = (lisp_modifiers & hyper_modifier) ? MOD_WIN : 0;
12654 w32_modifiers |= (lisp_modifiers & alt_modifier) ? MOD_ALT : 0; 12702 w32_modifiers |= (lisp_modifiers & alt_modifier) ? MOD_ALT : 0;