/* Graphical user interface functions for the Microsoft W32 API.
-Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include <dlgs.h>
#include <imm.h>
#define FILE_NAME_TEXT_FIELD edt1
+#define FILE_NAME_COMBO_BOX cmb13
+#define FILE_NAME_LIST lst1
#include "font.h"
#include "w32font.h"
extern void w32_free_menu_strings (HWND);
extern const char *map_w32_filename (const char *, const char **);
-extern int quit_char;
-
-extern const char *const lispy_function_keys[];
-
-/* The colormap for converting color names to RGB values */
-Lisp_Object Vw32_color_map;
-
-/* Non nil if alt key presses are passed on to Windows. */
-Lisp_Object Vw32_pass_alt_to_system;
-
-/* Non nil if alt key is translated to meta_modifier, nil if it is translated
- to alt_modifier. */
-Lisp_Object Vw32_alt_is_meta;
-
-/* If non-zero, the windows virtual key code for an alternative quit key. */
-int w32_quit_key;
-
-/* Non nil if left window key events are passed on to Windows (this only
- affects whether "tapping" the key opens the Start menu). */
-Lisp_Object Vw32_pass_lwindow_to_system;
-
-/* Non nil if right window key events are passed on to Windows (this
- only affects whether "tapping" the key opens the Start menu). */
-Lisp_Object Vw32_pass_rwindow_to_system;
-
-/* Virtual key code used to generate "phantom" key presses in order
- to stop system from acting on Windows key events. */
-Lisp_Object Vw32_phantom_key_code;
-
-/* Modifier associated with the left "Windows" key, or nil to act as a
- normal key. */
-Lisp_Object Vw32_lwindow_modifier;
-
-/* Modifier associated with the right "Windows" key, or nil to act as a
- normal key. */
-Lisp_Object Vw32_rwindow_modifier;
-
-/* Modifier associated with the "Apps" key, or nil to act as a normal
- key. */
-Lisp_Object Vw32_apps_modifier;
-
-/* Value is nil if Num Lock acts as a function key. */
-Lisp_Object Vw32_enable_num_lock;
-
-/* Value is nil if Caps Lock acts as a function key. */
-Lisp_Object Vw32_enable_caps_lock;
-
-/* Modifier associated with Scroll Lock, or nil to act as a normal key. */
-Lisp_Object Vw32_scroll_lock_modifier;
-
-/* Switch to control whether we inhibit requests for synthesized bold
- and italic versions of fonts. */
-int w32_enable_synthesized_fonts;
-
-/* Enable palette management. */
-Lisp_Object Vw32_enable_palette;
-
-/* Control how close left/right button down events must be to
- be converted to a middle button down event. */
-int w32_mouse_button_tolerance;
-
-/* Minimum interval between mouse movement (and scroll bar drag)
- events that are passed on to the event loop. */
-int w32_mouse_move_interval;
-
-/* Flag to indicate if XBUTTON events should be passed on to Windows. */
-static int w32_pass_extra_mouse_buttons_to_system;
-
-/* Flag to indicate if media keys should be passed on to Windows. */
-static int w32_pass_multimedia_buttons_to_system;
-
-/* Non nil if no window manager is in use. */
-Lisp_Object Vx_no_window_manager;
-
/* If non-zero, a w32 timer that, when it expires, displays an
hourglass cursor on all frames. */
static unsigned hourglass_timer = 0;
static HWND hourglass_hwnd = NULL;
-#if 0 /* TODO: Mouse cursor customization. */
-/* The background and shape of the mouse pointer, and shape when not
- over text or in the modeline. */
-Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape;
-Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape;
-
-/* The shape when over mouse-sensitive text. */
-
-Lisp_Object Vx_sensitive_text_pointer_shape;
-#endif
-
#ifndef IDC_HAND
#define IDC_HAND MAKEINTRESOURCE(32649)
#endif
-/* Color of chars displayed in cursor box. */
-Lisp_Object Vx_cursor_fore_pixel;
-
/* Nonzero if using Windows. */
static int w32_in_use;
-/* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. */
-
-Lisp_Object Vx_pixel_size_width_font_regexp;
-
-/* Alist of bdf fonts and the files that define them. */
-Lisp_Object Vw32_bdf_filename_alist;
-
-/* A flag to control whether fonts are matched strictly or not. */
-static int w32_strict_fontnames;
-
-/* A flag to control whether we should only repaint if GetUpdateRect
- indicates there is an update region. */
-static int w32_strict_painting;
-
Lisp_Object Qnone;
Lisp_Object Qsuppress_icon;
Lisp_Object Qundefined_color;
Lisp_Object Qshift;
-/* The ANSI codepage. */
-int w32_ansi_code_page;
-
/* Prefix for system colors. */
#define SYSTEM_COLOR_PREFIX "System"
#define SYSTEM_COLOR_PREFIX_LEN (sizeof (SYSTEM_COLOR_PREFIX) - 1)
DWORD dwFlags;
};
-/* Reportedly, VS 6 does not have this in its headers. */
-#if defined (_MSC_VER) && _MSC_VER < 1300
+/* Reportedly, MSVC does not have this in its headers. */
+#ifdef _MSC_VER
DECLARE_HANDLE(HMONITOR);
#endif
#define MENU_FREE_DELAY 1000
static unsigned menu_free_timer = 0;
-/* In dispnew.c */
-
-extern Lisp_Object Vwindow_system_version;
-
-/* The below are defined in frame.c. */
-
-extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
-extern Lisp_Object Vwindow_system_version;
-extern Lisp_Object Qtooltip;
-
-#ifdef GLYPH_DEBUG
-int image_cache_refcount, dpyinfo_refcount;
+#if GLYPH_DEBUG
+static int image_cache_refcount, dpyinfo_refcount;
#endif
-
-/* From w32term.c. */
-extern int w32_num_mouse_buttons;
-extern Lisp_Object Vw32_recognize_altgr;
-
-extern HWND w32_system_caret_hwnd;
-
-extern int w32_system_caret_height;
-extern int w32_system_caret_x;
-extern int w32_system_caret_y;
-extern int w32_use_visible_system_caret;
-
static HWND w32_visible_system_caret_hwnd;
/* From w32menu.c */
{"LightGreen" , PALETTERGB (144,238,144)},
};
-DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
- 0, 0, 0, doc: /* Return the default color map. */)
- (void)
+static Lisp_Object
+w32_default_color_map (void)
{
int i;
colormap_t *pc = w32_color_map;
return (cmap);
}
+DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
+ 0, 0, 0, doc: /* Return the default color map. */)
+ (void)
+{
+ return w32_default_color_map ();
+}
+
static Lisp_Object
w32_color_map_lookup (char *colorname)
{
QUIT;
}
-
UNBLOCK_INPUT;
return ret;
BLOCK_INPUT;
result = x_text_icon (f,
- (char *) SDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : !NILP (f->title)
- ? f->title
- : f->name)));
+ SSDATA ((!NILP (f->icon_name)
+ ? f->icon_name
+ : !NILP (f->title)
+ ? f->title
+ : f->name)));
if (result)
{
x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int nlines;
- int olines = FRAME_MENU_BAR_LINES (f);
/* Right now, menu bars don't work properly in minibuf-only frames;
most of the commands try to apply themselves to the minibuffer
}
FRAME_TOOL_BAR_LINES (f) = nlines;
- change_window_heights (root_window, delta);
+ resize_frame_windows (f, FRAME_LINES (f), 0);
adjust_glyphs (f);
/* We also have to make sure that the internal border at the top of
if (WINDOWP (f->tool_bar_window))
clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
}
+
+ run_window_configuration_change_hook (f);
+
}
key_mapping = Qnil;
}
- /* NB. This code runs in the input thread, asychronously to the lisp
+ /* NB. This code runs in the input thread, asynchronously to the lisp
thread, so we must be careful to ensure access to lisp data is
thread-safe. The following code is safe because the modifier
variable values are updated atomically from lisp and symbols are
some third party shell extensions can cause it to be used in
system dialogs, which causes a crash if it is not initialized.
This is a known bug in Windows, which was fixed long ago, but
- the patch for XP is not publically available until XP SP3,
+ the patch for XP is not publicly available until XP SP3,
and older versions will never be patched. */
CoInitialize (NULL);
w32_createwindow ((struct frame *) msg.wParam);
base character (ie. translating the base key plus
shift modifier). */
int add;
- int isdead = 0;
KEY_EVENT_RECORD key;
key.bKeyDown = TRUE;
key.dwControlKeyState = modifiers;
add = w32_kbd_patch_key (&key);
- /* 0 means an unrecognised keycode, negative means
+ /* 0 means an unrecognized keycode, negative means
dead key. Ignore both. */
while (--add >= 0)
{
HIMC context = get_ime_context_fn (hwnd);
wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam);
/* Get buffer size. */
- size = get_composition_string_fn (context, GCS_RESULTSTR, buffer, 0);
+ size = get_composition_string_fn (context, GCS_RESULTSTR, NULL, 0);
buffer = alloca (size);
size = get_composition_string_fn (context, GCS_RESULTSTR,
buffer, size);
{
/* Free memory used by owner-drawn and help-echo strings. */
w32_free_menu_strings (hwnd);
- f->output_data.w32->menubar_active = 0;
+ if (f)
+ f->output_data.w32->menubar_active = 0;
menubar_in_use = 0;
}
}
if (LOWORD (lParam) == HTCLIENT)
{
f = x_window_to_frame (dpyinfo, hwnd);
- if (f->output_data.w32->hourglass_p && !menubar_in_use
- && !current_popup_menu)
+ if (f && f->output_data.w32->hourglass_p
+ && !menubar_in_use && !current_popup_menu)
SetCursor (f->output_data.w32->hourglass_cursor);
- else
+ else if (f)
SetCursor (f->output_data.w32->current_cursor);
return 0;
}
Elsewhere we specify the window name for the window manager. */
{
- char *str = (char *) SDATA (Vx_resource_name);
+ char *str = SSDATA (Vx_resource_name);
f->namebuf = (char *) xmalloc (strlen (str) + 1);
strcpy (f->namebuf, str);
}
? IconicState
: NormalState));
- x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : f->name)));
+ x_text_icon (f, SSDATA ((!NILP (f->icon_name)
+ ? f->icon_name
+ : f->name)));
#endif
UNBLOCK_INPUT;
/* Handler for signals raised during x_create_frame and
- x_create_top_frame. FRAME is the frame which is partially
+ x_create_tip_frame. FRAME is the frame which is partially
constructed. */
static Lisp_Object
struct frame *f = XFRAME (frame);
/* If frame is ``official'', nothing to do. */
- if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame))
+ if (NILP (Fmemq (frame, Vframe_list)))
{
-#ifdef GLYPH_DEBUG
+#if GLYPH_DEBUG
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
#endif
x_free_frame_resources (f);
+ free_glyphs (f);
#if GLYPH_DEBUG
/* Check that reference counts are indeed correct. */
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
f->output_method = output_w32;
f->output_data.w32 =
/* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */
record_unwind_protect (unwind_create_frame, frame);
#if GLYPH_DEBUG
- image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
x_make_gc (f);
/* Now consider the frame official. */
+ f->terminal->reference_count++;
FRAME_W32_DISPLAY_INFO (f)->reference_count++;
Vframe_list = Fcons (frame, Vframe_list);
/* Initialize `default-minibuffer-frame' in case this is the first
frame on this terminal. */
if (FRAME_HAS_MINIBUF_P (f)
- && (!FRAMEP (kb->Vdefault_minibuffer_frame)
- || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
- kb->Vdefault_minibuffer_frame = frame;
+ && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
+ || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
+ KVAR (kb, Vdefault_minibuffer_frame) = frame;
/* All remaining specified parameters, which have not been "used"
by x_get_arg and friends, now go in the misc. alist of the frame. */
If omitted or nil, that stands for the selected frame's display. */)
(Lisp_Object display)
{
- struct w32_display_info *dpyinfo = check_x_display_info (display);
-
return make_number (1);
}
validate_x_resource_name ();
dpyinfo = w32_term_init (name, (unsigned char *)0,
- (char *) SDATA (Vx_resource_name));
+ SSDATA (Vx_resource_name));
if (dpyinfo == 0)
error ("Cannot connect to server %s", SDATA (name));
UNGCPRO;
}
if (NILP (Vw32_color_map))
- Vw32_color_map = Fw32_default_color_map ();
+ Vw32_color_map = w32_default_color_map ();
/* Merge in system logical colors. */
add_system_logical_colors_to_map (&Vw32_color_map);
if (! NILP (xrm_string))
- xrm_option = (unsigned char *) SDATA (xrm_string);
+ xrm_option = SDATA (xrm_string);
else
xrm_option = (unsigned char *) 0;
/* This is what opens the connection and sets x_current_display.
This also initializes many symbols, such as those used for input. */
dpyinfo = w32_term_init (display, xrm_option,
- (char *) SDATA (Vx_resource_name));
+ SSDATA (Vx_resource_name));
if (dpyinfo == 0)
{
(Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
- int i;
if (dpyinfo->reference_count > 0)
error ("Display still has frames on it");
Window properties
***********************************************************************/
+#if 0 /* TODO : port window properties to W32 */
+
DEFUN ("x-change-window-property", Fx_change_window_property,
Sx_change_window_property, 2, 6, 0,
doc: /* Change window property PROP to VALUE on the X window of FRAME.
FRAME. Default is to change on the edit X window. */)
(Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p)
{
-#if 0 /* TODO : port window properties to W32 */
struct frame *f = check_x_frame (frame);
Atom prop_atom;
XFlush (FRAME_W32_DISPLAY (f));
UNBLOCK_INPUT;
-#endif /* TODO */
-
return value;
}
FRAME nil or omitted means use the selected frame. Value is PROP. */)
(Lisp_Object prop, Lisp_Object frame)
{
-#if 0 /* TODO : port window properties to W32 */
-
struct frame *f = check_x_frame (frame);
Atom prop_atom;
/* Make sure the property is removed when we return. */
XFlush (FRAME_W32_DISPLAY (f));
UNBLOCK_INPUT;
-#endif /* TODO */
return prop;
}
no value of TYPE (always string in the MS Windows case). */)
(Lisp_Object prop, Lisp_Object frame)
{
-#if 0 /* TODO : port window properties to W32 */
-
struct frame *f = check_x_frame (frame);
Atom prop_atom;
int rc;
return prop_value;
-#endif /* TODO */
return Qnil;
}
+#endif /* TODO */
\f
/***********************************************************************
cursor. Duplicated from xdisp.c, but cannot use the version there
due to lack of atimers on w32. */
#define DEFAULT_HOURGLASS_DELAY 1
-extern Lisp_Object Vhourglass_delay;
-
/* Return non-zero if houglass timer has been started or hourglass is shown. */
/* PENDING: if W32 can use atimers (atimer.[hc]) then the common impl in
xdisp.c could be used. */
Lisp_Object last_show_tip_args;
-/* Maximum size for tooltips; a cons (COLUMNS . ROWS). */
-
-Lisp_Object Vx_max_tooltip_size;
-
static Lisp_Object
unwind_create_tip_frame (Lisp_Object frame)
Lisp_Object parms, Lisp_Object text)
{
struct frame *f;
- Lisp_Object frame, tem;
+ Lisp_Object frame;
Lisp_Object name;
long window_prompting = 0;
int width, height;
Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (buffer));
- current_buffer->truncate_lines = Qnil;
+ BVAR (current_buffer, truncate_lines) = Qnil;
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
from this point on, x_destroy_window might screw up reference
counts etc. */
f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
f->output_method = output_w32;
f->output_data.w32 =
(struct w32_output *) xmalloc (sizeof (struct w32_output));
f->icon_name = Qnil;
#if GLYPH_DEBUG
- image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE ? FRAME_IMAGE_CACHE (f)->refcount : 0;
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
FRAME_KBOARD (f) = kb;
UNGCPRO;
+ /* Now that the frame is official, it counts as a reference to
+ its display. */
+ FRAME_W32_DISPLAY_INFO (f)->reference_count++;
+ f->terminal->reference_count++;
+
/* It is now ok to make the frame official even if we get an error
below. And the frame needs to be on Vframe_list or making it
visible won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- /* Now that the frame is official, it counts as a reference to
- its display. */
- FRAME_W32_DISPLAY_INFO (f)->reference_count++;
-
/* Setting attributes of faces of the tooltip frame from resources
and similar will increment face_change_count, which leads to the
clearing of all current matrices. Since this isn't necessary
/* Display the tooltip text in a temporary buffer. */
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
- current_buffer->truncate_lines = Qnil;
+ BVAR (current_buffer, truncate_lines) = Qnil;
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
- try_window (FRAME_ROOT_WINDOW (f), pos, 0);
+ try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
/* Compute width and height of the tooltip. */
width = height = seen_reversed_p = 0;
{
if (!row->reversed_p)
{
-#ifdef TODO /* Investigate why some fonts need more width than is
- calculated for some tooltips. */
-
/* There's a glyph at the end of rows that is used to
place the cursor there. Don't include the width of
this glyph. */
last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
if (INTEGERP (last->object))
row_width -= last->pixel_width;
-#endif
}
else
{
}
}
- /* TODO: find why tips do not draw along baseline as instructed. */
height += row->height;
width = max (width, row_width);
}
w->total_cols = make_number (width);
FRAME_TOTAL_COLS (f) = width;
adjust_glyphs (f);
+ w->pseudo_window_p = 1;
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
- try_window (FRAME_ROOT_WINDOW (f), pos, 0);
+ try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
width = height = 0;
/* Recompute width and height of the tooltip. */
for (i = 0; i < w->desired_matrix->nrows; ++i)
break;
row->full_width_p = 1;
row_width = row->pixel_width;
-#ifdef TODO /* See above. */
if (row->used[TEXT_AREA] && !row->reversed_p)
{
last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
if (INTEGERP (last->object))
row_width -= last->pixel_width;
}
-#endif
height += row->height;
width = max (width, row_width);
}
}
- /* Add the frame's internal border to the width and height the X
+ /* Round up the height to an integral multiple of FRAME_LINE_HEIGHT. */
+ if (height % FRAME_LINE_HEIGHT (f) != 0)
+ height += FRAME_LINE_HEIGHT (f) - height % FRAME_LINE_HEIGHT (f);
+ /* Add the frame's internal border to the width and height the w32
window should have. */
height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
FRAME_EXTERNAL_MENU_BAR (f));
/* Position and size tooltip, and put it in the topmost group.
- The add-on of 3 to the 5th argument is a kludge: without it,
- some fonts cause the last character of the tip to be truncated,
- for some obscure reason. */
+ The add-on of FRAME_COLUMN_WIDTH to the 5th argument is a
+ peculiarity of w32 display: without it, some fonts cause the
+ last character of the tip to be truncated or wrapped around to
+ the next line. */
SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
- root_x, root_y, rect.right - rect.left + 3,
+ root_x, root_y,
+ rect.right - rect.left + FRAME_COLUMN_WIDTH (f),
rect.bottom - rect.top, SWP_NOACTIVATE);
/* Ensure tooltip is on top of other topmost windows (eg menus). */
UNGCPRO;
return unbind_to (count, deleted);
}
-
-
\f
/***********************************************************************
File selection dialog
***********************************************************************/
-extern Lisp_Object Qfile_name_history;
/* Callback for altering the behavior of the Open File dialog.
Makes the Filename text field contain "Current Directory" and be
{
HWND dialog = GetParent (hwnd);
HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
+ HWND list = GetDlgItem (dialog, FILE_NAME_LIST);
+
+ /* At least on Windows 7, the above attempt to get the window handle
+ to the File Name Text Field fails. The following code does the
+ job though. Note that this code is based on my examination of the
+ window hierarchy using Microsoft Spy++. bk */
+ if (edit_control == NULL)
+ {
+ HWND tmp = GetDlgItem (dialog, FILE_NAME_COMBO_BOX);
+ if (tmp)
+ {
+ tmp = GetWindow (tmp, GW_CHILD);
+ if (tmp)
+ edit_control = GetWindow (tmp, GW_CHILD);
+ }
+ }
- /* Directories is in index 2. */
+ /* Directories is in index 2. */
if (notify->lpOFN->nFilterIndex == 2)
{
CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD,
"Current Directory");
EnableWindow (edit_control, FALSE);
+ /* Note that at least on Windows 7, the above call to EnableWindow
+ disables the window that would ordinarily have focus. If we
+ do not set focus to some other window here, focus will land in
+ no man's land and the user will be unable to tab through the
+ dialog box (pressing tab will only result in a beep).
+ Avoid that problem by setting focus to the list here. */
+ if (notify->hdr.code == CDN_INITDONE)
+ SetFocus (list);
}
else
{
else
filename[0] = '\0';
+ /* The code in file_dialog_callback that attempts to set the text
+ of the file name edit window when handling the CDN_INITDONE
+ WM_NOTIFY message does not work. Setting filename to "Current
+ Directory" in the only_dir_p case here does work however. */
+ if (filename[0] == 0 && ! NILP (only_dir_p))
+ strcpy (filename, "Current Directory");
+
{
NEWOPENFILENAME new_file_details;
BOOL file_opened = FALSE;
CHECK_STRING (document);
/* Encode filename, current directory and parameters. */
- current_dir = ENCODE_FILE (current_buffer->directory);
+ current_dir = ENCODE_FILE (BVAR (current_buffer, directory));
document = ENCODE_FILE (document);
if (STRINGP (parameters))
parameters = ENCODE_SYSTEM (parameters);
code_convert_string_norecord (make_unibyte_string (errstr,
strlen (errstr)),
Vlocale_coding_system, 0);
- errstr = (char *)SDATA (decoded);
+ errstr = SSDATA (decoded);
}
error ("ShellExecute failed: %s", errstr);
}
ClosePrinter (hPrn);
return Qnil;
}
- /* Call GetPrinter again with big enouth memory block */
+ /* Call GetPrinter again with big enough memory block. */
err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned);
ClosePrinter (hPrn);
if (!err)
DEFSYM (Qfont_param, "font-parameter");
/* This is the end of symbol initialization. */
- /* Text property `display' should be nonsticky by default. */
- Vtext_property_default_nonsticky
- = Fcons (Fcons (Qdisplay, Qt), Vtext_property_default_nonsticky);
-
Fput (Qundefined_color, Qerror_conditions,
pure_cons (Qundefined_color, pure_cons (Qerror, Qnil)));
staticpro (&w32_grabbed_keys);
w32_grabbed_keys = Qnil;
- DEFVAR_LISP ("w32-color-map", &Vw32_color_map,
+ DEFVAR_LISP ("w32-color-map", Vw32_color_map,
doc: /* An array of color name mappings for Windows. */);
Vw32_color_map = Qnil;
- DEFVAR_LISP ("w32-pass-alt-to-system", &Vw32_pass_alt_to_system,
+ DEFVAR_LISP ("w32-pass-alt-to-system", Vw32_pass_alt_to_system,
doc: /* Non-nil if Alt key presses are passed on to Windows.
When non-nil, for example, Alt pressed and released and then space will
open the System menu. When nil, Emacs processes the Alt key events, and
then silently swallows them. */);
Vw32_pass_alt_to_system = Qnil;
- DEFVAR_LISP ("w32-alt-is-meta", &Vw32_alt_is_meta,
+ DEFVAR_LISP ("w32-alt-is-meta", Vw32_alt_is_meta,
doc: /* Non-nil if the Alt key is to be considered the same as the META key.
When nil, Emacs will translate the Alt key to the ALT modifier, not to META. */);
Vw32_alt_is_meta = Qt;
- DEFVAR_INT ("w32-quit-key", &w32_quit_key,
+ DEFVAR_INT ("w32-quit-key", w32_quit_key,
doc: /* If non-zero, the virtual key code for an alternative quit key. */);
w32_quit_key = 0;
DEFVAR_LISP ("w32-pass-lwindow-to-system",
- &Vw32_pass_lwindow_to_system,
+ Vw32_pass_lwindow_to_system,
doc: /* If non-nil, the left \"Windows\" key is passed on to Windows.
When non-nil, the Start menu is opened by tapping the key.
Vw32_pass_lwindow_to_system = Qt;
DEFVAR_LISP ("w32-pass-rwindow-to-system",
- &Vw32_pass_rwindow_to_system,
+ Vw32_pass_rwindow_to_system,
doc: /* If non-nil, the right \"Windows\" key is passed on to Windows.
When non-nil, the Start menu is opened by tapping the key.
Vw32_pass_rwindow_to_system = Qt;
DEFVAR_LISP ("w32-phantom-key-code",
- &Vw32_phantom_key_code,
+ Vw32_phantom_key_code,
doc: /* Virtual key code used to generate \"phantom\" key presses.
Value is a number between 0 and 255.
XSETINT (Vw32_phantom_key_code, 255);
DEFVAR_LISP ("w32-enable-num-lock",
- &Vw32_enable_num_lock,
+ Vw32_enable_num_lock,
doc: /* If non-nil, the Num Lock key acts normally.
Set to nil to handle Num Lock as the `kp-numlock' key. */);
Vw32_enable_num_lock = Qt;
DEFVAR_LISP ("w32-enable-caps-lock",
- &Vw32_enable_caps_lock,
+ Vw32_enable_caps_lock,
doc: /* If non-nil, the Caps Lock key acts normally.
Set to nil to handle Caps Lock as the `capslock' key. */);
Vw32_enable_caps_lock = Qt;
DEFVAR_LISP ("w32-scroll-lock-modifier",
- &Vw32_scroll_lock_modifier,
+ Vw32_scroll_lock_modifier,
doc: /* Modifier to use for the Scroll Lock ON state.
The value can be hyper, super, meta, alt, control or shift for the
respective modifier, or nil to handle Scroll Lock as the `scroll' key.
Vw32_scroll_lock_modifier = Qnil;
DEFVAR_LISP ("w32-lwindow-modifier",
- &Vw32_lwindow_modifier,
+ Vw32_lwindow_modifier,
doc: /* Modifier to use for the left \"Windows\" key.
The value can be hyper, super, meta, alt, control or shift for the
respective modifier, or nil to appear as the `lwindow' key.
Vw32_lwindow_modifier = Qnil;
DEFVAR_LISP ("w32-rwindow-modifier",
- &Vw32_rwindow_modifier,
+ Vw32_rwindow_modifier,
doc: /* Modifier to use for the right \"Windows\" key.
The value can be hyper, super, meta, alt, control or shift for the
respective modifier, or nil to appear as the `rwindow' key.
Vw32_rwindow_modifier = Qnil;
DEFVAR_LISP ("w32-apps-modifier",
- &Vw32_apps_modifier,
+ Vw32_apps_modifier,
doc: /* Modifier to use for the \"Apps\" key.
The value can be hyper, super, meta, alt, control or shift for the
respective modifier, or nil to appear as the `apps' key.
Any other value will cause the key to be ignored. */);
Vw32_apps_modifier = Qnil;
- DEFVAR_BOOL ("w32-enable-synthesized-fonts", &w32_enable_synthesized_fonts,
+ DEFVAR_BOOL ("w32-enable-synthesized-fonts", w32_enable_synthesized_fonts,
doc: /* Non-nil enables selection of artificially italicized and bold fonts. */);
w32_enable_synthesized_fonts = 0;
- DEFVAR_LISP ("w32-enable-palette", &Vw32_enable_palette,
+ DEFVAR_LISP ("w32-enable-palette", Vw32_enable_palette,
doc: /* Non-nil enables Windows palette management to map colors exactly. */);
Vw32_enable_palette = Qt;
DEFVAR_INT ("w32-mouse-button-tolerance",
- &w32_mouse_button_tolerance,
+ w32_mouse_button_tolerance,
doc: /* Analogue of double click interval for faking middle mouse events.
The value is the minimum time in milliseconds that must elapse between
left and right button down events before they are considered distinct events.
w32_mouse_button_tolerance = GetDoubleClickTime () / 2;
DEFVAR_INT ("w32-mouse-move-interval",
- &w32_mouse_move_interval,
+ w32_mouse_move_interval,
doc: /* Minimum interval between mouse move events.
The value is the minimum time in milliseconds that must elapse between
successive mouse move (or scroll bar drag) events before they are
w32_mouse_move_interval = 0;
DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system",
- &w32_pass_extra_mouse_buttons_to_system,
+ w32_pass_extra_mouse_buttons_to_system,
doc: /* If non-nil, the fourth and fifth mouse buttons are passed to Windows.
Recent versions of Windows support mice with up to five buttons.
Since most applications don't support these extra buttons, most mouse
w32_pass_extra_mouse_buttons_to_system = 0;
DEFVAR_BOOL ("w32-pass-multimedia-buttons-to-system",
- &w32_pass_multimedia_buttons_to_system,
+ w32_pass_multimedia_buttons_to_system,
doc: /* If non-nil, media buttons are passed to Windows.
Some modern keyboards contain buttons for controlling media players, web
browsers and other applications. Generally these buttons are handled on a
w32_pass_multimedia_buttons_to_system = 1;
#if 0 /* TODO: Mouse cursor customization. */
- DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape,
+ DEFVAR_LISP ("x-pointer-shape", Vx_pointer_shape,
doc: /* The shape of the pointer when over text.
Changing the value does not affect existing frames
unless you set the mouse color. */);
Vx_mode_pointer_shape = Qnil;
- DEFVAR_LISP ("x-hourglass-pointer-shape", &Vx_hourglass_pointer_shape,
+ DEFVAR_LISP ("x-hourglass-pointer-shape", Vx_hourglass_pointer_shape,
doc: /* The shape of the pointer when Emacs is busy.
This variable takes effect when you create a new frame
or when you set the mouse color. */);
Vx_hourglass_pointer_shape = Qnil;
DEFVAR_LISP ("x-sensitive-text-pointer-shape",
- &Vx_sensitive_text_pointer_shape,
+ Vx_sensitive_text_pointer_shape,
doc: /* The shape of the pointer when over mouse-sensitive text.
This variable takes effect when you create a new frame
or when you set the mouse color. */);
Vx_sensitive_text_pointer_shape = Qnil;
DEFVAR_LISP ("x-window-horizontal-drag-cursor",
- &Vx_window_horizontal_drag_shape,
+ Vx_window_horizontal_drag_shape,
doc: /* Pointer shape to use for indicating a window can be dragged horizontally.
This variable takes effect when you create a new frame
or when you set the mouse color. */);
Vx_window_horizontal_drag_shape = Qnil;
#endif
- DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel,
+ DEFVAR_LISP ("x-cursor-fore-pixel", Vx_cursor_fore_pixel,
doc: /* A string indicating the foreground color of the cursor box. */);
Vx_cursor_fore_pixel = Qnil;
- DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size,
+ DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size,
doc: /* Maximum size for tooltips.
Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */);
Vx_max_tooltip_size = Fcons (make_number (80), make_number (40));
- DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,
+ DEFVAR_LISP ("x-no-window-manager", Vx_no_window_manager,
doc: /* Non-nil if no window manager is in use.
Emacs doesn't try to figure this out; this is always nil
unless you set it to something else. */);
Vx_no_window_manager = Qnil;
DEFVAR_LISP ("x-pixel-size-width-font-regexp",
- &Vx_pixel_size_width_font_regexp,
+ Vx_pixel_size_width_font_regexp,
doc: /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'.
Since Emacs gets width of a font matching with this regexp from
Vx_pixel_size_width_font_regexp = Qnil;
DEFVAR_LISP ("w32-bdf-filename-alist",
- &Vw32_bdf_filename_alist,
+ Vw32_bdf_filename_alist,
doc: /* List of bdf fonts and their corresponding filenames. */);
Vw32_bdf_filename_alist = Qnil;
DEFVAR_BOOL ("w32-strict-fontnames",
- &w32_strict_fontnames,
+ w32_strict_fontnames,
doc: /* Non-nil means only use fonts that are exact matches for those requested.
Default is nil, which allows old fontnames that are not XLFD compliant,
and allows third-party CJK display to work by specifying false charset
w32_strict_fontnames = 0;
DEFVAR_BOOL ("w32-strict-painting",
- &w32_strict_painting,
+ w32_strict_painting,
doc: /* Non-nil means use strict rules for repainting frames.
Set this to nil to get the old behavior for repainting; this should
only be necessary if the default setting causes problems. */);
GetProcAddress (imm32_lib, "ImmSetCompositionWindow");
}
DEFVAR_INT ("w32-ansi-code-page",
- &w32_ansi_code_page,
+ w32_ansi_code_page,
doc: /* The ANSI code page used by the system. */);
w32_ansi_code_page = GetACP ();
{
return GetLastError ();
}
-