-/* Graphical user interface functions for the Microsoft W32 API.
+/* Graphical user interface functions for the Microsoft Windows API.
-Copyright (C) 1989, 1992-2011 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2012 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include "w32term.h"
#include "frame.h"
#include "window.h"
+#include "character.h"
#include "buffer.h"
#include "intervals.h"
#include "dispextern.h"
#include "keyboard.h"
#include "blockinput.h"
#include "epaths.h"
-#include "character.h"
#include "charset.h"
#include "coding.h"
#include "ccl.h"
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;
-#if GLYPH_DEBUG
+#ifdef GLYPH_DEBUG
static int image_cache_refcount, dpyinfo_refcount;
#endif
{"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)
{
elt = XCAR (tail);
if (!CONSP (elt)) continue;
- tem = Fcar (elt);
+ tem = XCAR (elt);
if (lstrcmpi (SDATA (tem), colorname) == 0)
{
QUIT;
}
-
UNBLOCK_INPUT;
return ret;
}
/* not already mapped, so add to list and recreate Windows palette */
- list = (struct w32_palette_entry *)
- xmalloc (sizeof (struct w32_palette_entry));
+ list = xmalloc (sizeof (struct w32_palette_entry));
SET_W32_COLOR (list->entry, color);
list->refcount = 1;
list->next = FRAME_W32_DISPLAY_INFO (f)->color_list;
if (entry == NULL && alloc)
{
/* not already mapped, so add to list */
- entry = (struct w32_palette_entry *)
- xmalloc (sizeof (struct w32_palette_entry));
+ entry = xmalloc (sizeof (struct w32_palette_entry));
SET_W32_COLOR (entry->entry, XUINT (tem));
entry->next = NULL;
*prev = entry;
else if (!NILP (arg) || NILP (oldval))
return;
- f->icon_name = arg;
+ FVAR (f, icon_name) = arg;
#if 0
if (f->output_data.w32->icon_bitmap != 0)
BLOCK_INPUT;
result = x_text_icon (f,
- SSDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : !NILP (f->title)
- ? f->title
- : f->name)));
+ SSDATA ((!NILP (FVAR (f, icon_name))
+ ? FVAR (f, icon_name)
+ : !NILP (FVAR (f, title))
+ ? FVAR (f, title)
+ : FVAR (f, name))));
if (result)
{
}
UNBLOCK_INPUT;
- if (WINDOWP (f->tool_bar_window))
- clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
+ if (WINDOWP (FVAR (f, tool_bar_window)))
+ clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix);
}
run_window_configuration_change_hook (f);
/* Check for no change needed in this very common case
before we do any consing. */
if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name,
- SDATA (f->name)))
+ SDATA (FVAR (f, name))))
return;
name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name);
}
CHECK_STRING (name);
/* Don't change the name if it's already NAME. */
- if (! NILP (Fstring_equal (name, f->name)))
+ if (! NILP (Fstring_equal (name, FVAR (f, name))))
return;
- f->name = name;
+ FVAR (f, name) = name;
/* For setting the frame title, the title parameter should override
the name parameter. */
- if (! NILP (f->title))
- name = f->title;
+ if (! NILP (FVAR (f, title)))
+ name = FVAR (f, title);
if (FRAME_W32_WINDOW (f))
{
x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
{
/* Don't change the title if it's already NAME. */
- if (EQ (name, f->title))
+ if (EQ (name, FVAR (f, title)))
return;
update_mode_lines = 1;
- f->title = name;
+ FVAR (f, title) = name;
if (NILP (name))
- name = f->name;
+ name = FVAR (f, name);
if (FRAME_W32_WINDOW (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);
deferred_msg * msg_buf = find_deferred_msg (hwnd, msg);
if (msg_buf == NULL)
- /* Message may have been cancelled, so don't abort. */
+ /* Message may have been canceled, so don't abort. */
return;
msg_buf->result = result;
if (!NILP (Vthrow_on_input))
{
Vquit_flag = Vthrow_on_input;
+ /* Doing a QUIT from this thread is a bad idea, since this
+ unwinds the stack of the Lisp thread, and the Windows runtime
+ rightfully barfs. Disabled. */
+#if 0
/* If we're inside a function that wants immediate quits,
do it now. */
if (immediate_quit && NILP (Vinhibit_quit))
immediate_quit = 0;
QUIT;
}
+#endif
}
}
woken up if blocked in sys_select, but we do NOT want to post
the quit_char message itself (because it will usually be as if
the user had typed quit_char twice). Instead, we post a dummy
- message that has no particular effect. */
+ message that has no particular effect. */
{
int c = wParam;
if (isalpha (c) && wmsg.dwModifiers == ctrl_modifier)
c = make_ctrl_char (c) & 0377;
if (c == quit_char
- || (wmsg.dwModifiers == 0 &&
- w32_quit_key && wParam == w32_quit_key))
+ || (wmsg.dwModifiers == 0
+ && w32_quit_key && wParam == w32_quit_key))
{
Vquit_flag = Qt;
/* The choice of message is somewhat arbitrary, as long as
- the main thread handler just ignores it. */
+ the main thread handler just ignores it. */
msg = WM_NULL;
/* Interrupt any blocking system calls. */
the lisp thread to respond.
Note that we don't want to block the input thread waiting for
- a reponse from the lisp thread (although that would at least
+ a response from the lisp thread (although that would at least
solve the deadlock problem above), because we want to be able
to receive C-g to interrupt the lisp thread. */
cancel_all_deferred_msgs ();
key.uChar.AsciiChar = 0;
key.dwControlKeyState = modifiers;
- add = w32_kbd_patch_key (&key);
- /* 0 means an unrecognised keycode, negative means
+ add = w32_kbd_patch_key (&key, w32_keyboard_codepage);
+ /* 0 means an unrecognized keycode, negative means
dead key. Ignore both. */
while (--add >= 0)
{
(hwnd, WM_CHAR,
(unsigned char) key.uChar.AsciiChar, lParam,
w32_get_key_modifiers (wParam, lParam));
- w32_kbd_patch_key (&key);
+ w32_kbd_patch_key (&key, w32_keyboard_codepage);
}
return 0;
}
break;
case WM_IME_CHAR:
- /* If we can't get the IME result as unicode, use default processing,
+ /* If we can't get the IME result as Unicode, use default processing,
which will at least allow characters decodable in the system locale
get through. */
if (!get_composition_string_fn)
case WM_EMACS_SHOWWINDOW:
return ShowWindow ((HWND) wParam, (WPARAM) lParam);
+ case WM_EMACS_BRINGTOTOP:
case WM_EMACS_SETFOREGROUND:
{
HWND foreground_window;
foreground_thread = 0;
retval = SetForegroundWindow ((HWND) wParam);
+ if (msg == WM_EMACS_BRINGTOTOP)
+ retval = BringWindowToTop ((HWND) wParam);
/* Detach from the previous foreground thread. */
if (foreground_thread)
if (w32_system_caret_hwnd == NULL)
{
/* Use the default caret width, and avoid changing it
- unneccesarily, as it confuses screen reader software. */
+ unnecessarily, as it confuses screen reader software. */
w32_system_caret_hwnd = hwnd;
CreateCaret (hwnd, NULL, 0,
w32_system_caret_height);
flags |= TPM_RIGHTBUTTON;
/* Remember we did a SetCapture on the initial mouse down event,
- so for safety, we make sure the capture is cancelled now. */
+ so for safety, we make sure the capture is canceled now. */
ReleaseCapture ();
button_state = 0;
{
char *str = SSDATA (Vx_resource_name);
- f->namebuf = (char *) xmalloc (strlen (str) + 1);
+ f->namebuf = xmalloc (strlen (str) + 1);
strcpy (f->namebuf, str);
}
int explicit = f->explicit_name;
f->explicit_name = 0;
- name = f->name;
- f->name = Qnil;
+ name = FVAR (f, name);
+ FVAR (f, name) = Qnil;
x_set_name (f, name, explicit);
}
? IconicState
: NormalState));
- x_text_icon (f, SSDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : f->name)));
+ x_text_icon (f, SSDATA ((!NILP (FVAR (f, icon_name))
+ ? FVAR (f, icon_name)
+ : FVAR (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)))
{
-#if GLYPH_DEBUG
+#ifdef GLYPH_DEBUG
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
#endif
x_free_frame_resources (f);
+ free_glyphs (f);
-#if GLYPH_DEBUG
+#ifdef GLYPH_DEBUG
/* Check that reference counts are indeed correct. */
- xassert (dpyinfo->reference_count == dpyinfo_refcount);
- xassert (dpyinfo->image_cache->refcount == image_cache_refcount);
+ eassert (dpyinfo->reference_count == dpyinfo_refcount);
+ eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
#endif
return Qt;
}
for (i = 0; names[i]; i++)
{
- font = font_open_by_name (f, names[i]);
+ font = font_open_by_name (f, build_unibyte_string (names[i]));
if (! NILP (font))
break;
}
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 =
- (struct w32_output *) xmalloc (sizeof (struct w32_output));
- memset (f->output_data.w32, 0, sizeof (struct w32_output));
+ f->output_data.w32 = xzalloc (sizeof (struct w32_output));
FRAME_FONTSET (f) = -1;
- f->icon_name
+ FVAR (f, icon_name)
= x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title",
RES_TYPE_STRING);
- if (! STRINGP (f->icon_name))
- f->icon_name = Qnil;
+ if (! STRINGP (FVAR (f, icon_name)))
+ FVAR (f, icon_name) = Qnil;
/* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */
/* 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;
+#ifdef GLYPH_DEBUG
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
be set. */
if (EQ (name, Qunbound) || NILP (name))
{
- f->name = build_string (dpyinfo->w32_id_name);
+ FVAR (f, name) = build_string (dpyinfo->w32_id_name);
f->explicit_name = 0;
}
else
{
- f->name = name;
+ FVAR (f, name) = name;
f->explicit_name = 1;
/* use the frame's title when getting resources for this frame. */
specbind (Qx_resource_name, name);
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);
by x_get_arg and friends, now go in the misc. alist of the frame. */
for (tem = parameters; CONSP (tem); tem = XCDR (tem))
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
- f->param_alist = Fcons (XCAR (tem), f->param_alist);
+ FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist));
UNGCPRO;
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);
FORMAT gives the size in bits of each element if VALUE is a list.
It must be one of 8, 16 or 32.
If VALUE is a string or FORMAT is nil or not given, FORMAT defaults to 8.
-If OUTER_P is non-nil, the property is changed for the outer X window of
+If OUTER-P is non-nil, the property is changed for the outer X window of
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)
+ (Lisp_Object prop, Lisp_Object value, Lisp_Object frame,
+ Lisp_Object type, Lisp_Object format, Lisp_Object outer_p)
{
struct frame *f = check_x_frame (frame);
Atom prop_atom;
DEFUN ("x-window-property", Fx_window_property, Sx_window_property,
- 1, 2, 0,
+ 1, 6, 0,
doc: /* Value is the value of window property PROP on FRAME.
If FRAME is nil or omitted, use the selected frame.
-On MS Windows, this function only accepts the PROP and FRAME arguments.
-
On X Windows, the following optional arguments are also accepted:
If TYPE is nil or omitted, get the property as a string.
Otherwise TYPE is the name of the atom that denotes the type expected.
If SOURCE is non-nil, get the property on that window instead of from
FRAME. The number 0 denotes the root window.
-If DELETE_P is non-nil, delete the property after retreiving it.
-If VECTOR_RET_P is non-nil, don't return a string but a vector of values.
+If DELETE-P is non-nil, delete the property after retrieving it.
+If VECTOR-RET-P is non-nil, don't return a string but a vector of values.
+
+On MS Windows, this function accepts but ignores those optional arguments.
Value is nil if FRAME hasn't a property with name PROP or if PROP has
no value of TYPE (always string in the MS Windows case). */)
- (Lisp_Object prop, Lisp_Object frame)
+ (Lisp_Object prop, Lisp_Object frame, Lisp_Object type,
+ Lisp_Object source, Lisp_Object delete_p, Lisp_Object vector_ret_p)
{
struct frame *f = check_x_frame (frame);
Atom prop_atom;
cursor. Duplicated from xdisp.c, but cannot use the version there
due to lack of atimers on w32. */
#define DEFAULT_HOURGLASS_DELAY 1
-/* 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. */
-
-int
-hourglass_started (void)
-{
- return hourglass_shown_p || hourglass_timer;
-}
/* Cancel a currently active hourglass timer, and start a new one. */
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));
- memset (f->output_data.w32, 0, sizeof (struct w32_output));
+ f->output_data.w32 = xzalloc (sizeof (struct w32_output));
FRAME_FONTSET (f) = -1;
- f->icon_name = Qnil;
+ FVAR (f, icon_name) = Qnil;
-#if GLYPH_DEBUG
- image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
+#ifdef GLYPH_DEBUG
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
FRAME_KBOARD (f) = kb;
be set. */
if (EQ (name, Qunbound) || NILP (name))
{
- f->name = build_string (dpyinfo->w32_id_name);
+ FVAR (f, name) = build_string (dpyinfo->w32_id_name);
f->explicit_name = 0;
}
else
{
- f->name = name;
+ FVAR (f, name) = name;
f->explicit_name = 1;
/* use the frame's title when getting resources for this frame. */
specbind (Qx_resource_name, name);
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
/* Set up the frame's root window. */
w = XWINDOW (FRAME_ROOT_WINDOW (f));
- w->left_col = w->top_line = make_number (0);
+ WVAR (w, left_col) = WVAR (w, top_line) = make_number (0);
if (CONSP (Vx_max_tooltip_size)
&& INTEGERP (XCAR (Vx_max_tooltip_size))
&& INTEGERP (XCDR (Vx_max_tooltip_size))
&& XINT (XCDR (Vx_max_tooltip_size)) > 0)
{
- w->total_cols = XCAR (Vx_max_tooltip_size);
- w->total_lines = XCDR (Vx_max_tooltip_size);
+ WVAR (w, total_cols) = XCAR (Vx_max_tooltip_size);
+ WVAR (w, total_lines) = XCDR (Vx_max_tooltip_size);
}
else
{
- w->total_cols = make_number (80);
- w->total_lines = make_number (40);
+ WVAR (w, total_cols) = make_number (80);
+ WVAR (w, total_lines) = make_number (40);
}
- FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
+ FRAME_TOTAL_COLS (f) = XINT (WVAR (w, total_cols));
adjust_glyphs (f);
w->pseudo_window_p = 1;
/* Display the tooltip text in a temporary buffer. */
old_buffer = current_buffer;
- set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
+ set_buffer_internal_1 (XBUFFER (WVAR (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer)));
BVAR (current_buffer, truncate_lines) = Qnil;
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
/* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
not in pixels. */
width /= WINDOW_FRAME_COLUMN_WIDTH (w);
- w->total_cols = make_number (width);
+ WVAR (w, total_cols) = make_number (width);
FRAME_TOTAL_COLS (f) = width;
adjust_glyphs (f);
w->pseudo_window_p = 1;
file = DECODE_FILE (build_string (filename));
}
- /* User cancelled the dialog without making a selection. */
+ /* User canceled the dialog without making a selection. */
else if (!CommDlgExtendedError ())
file = Qnil;
/* An error occurred, fallback on reading from the mini-buffer. */
if (!NILP (Vlocale_coding_system))
{
Lisp_Object decoded =
- code_convert_string_norecord (make_unibyte_string (errstr,
- strlen (errstr)),
+ code_convert_string_norecord (build_unibyte_string (errstr),
Vlocale_coding_system, 0);
errstr = SSDATA (decoded);
}
/* Notify input thread about new hot-key definition, so that it
takes effect without needing to switch focus. */
-#ifdef USE_LISP_UNION_TYPE
PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY,
- (WPARAM) key.i, 0);
-#else
- PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY,
- (WPARAM) key, 0);
-#endif
+ (WPARAM) XLI (key), 0);
}
return key;
{
/* Notify input thread about hot-key definition being removed, so
that it takes effect without needing focus switch. */
-#ifdef USE_LISP_UNION_TYPE
if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,
- (WPARAM) XINT (XCAR (item)), (LPARAM) item.i))
-#else
- if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,
- (WPARAM) XINT (XCAR (item)), (LPARAM) item))
-#endif
+ (WPARAM) XINT (XCAR (item)), (LPARAM) XLI (item)))
{
MSG msg;
GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
if (!dwWindowsThreadId)
return make_number (w32_console_toggle_lock_key (vk_code, new_state));
-#ifdef USE_LISP_UNION_TYPE
- if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY,
- (WPARAM) vk_code, (LPARAM) new_state.i))
-#else
if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY,
- (WPARAM) vk_code, (LPARAM) new_state))
-#endif
+ (WPARAM) vk_code, (LPARAM) XLI (new_state)))
{
MSG msg;
GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
{
Lisp_Object line_status, battery_status, battery_status_symbol;
Lisp_Object load_percentage, seconds, minutes, hours, remain;
- Lisp_Object sequences[8];
long seconds_left = (long) system_status.BatteryLifeTime;
_snprintf (buffer, 16, "%ld:%02ld", m / 60, m % 60);
remain = build_string (buffer);
}
- sequences[0] = Fcons (make_number ('L'), line_status);
- sequences[1] = Fcons (make_number ('B'), battery_status);
- sequences[2] = Fcons (make_number ('b'), battery_status_symbol);
- sequences[3] = Fcons (make_number ('p'), load_percentage);
- sequences[4] = Fcons (make_number ('s'), seconds);
- sequences[5] = Fcons (make_number ('m'), minutes);
- sequences[6] = Fcons (make_number ('h'), hours);
- sequences[7] = Fcons (make_number ('t'), remain);
-
- status = Flist (8, sequences);
+
+ status = listn (CONSTYPE_HEAP, 8,
+ Fcons (make_number ('L'), line_status),
+ Fcons (make_number ('B'), battery_status),
+ Fcons (make_number ('b'), battery_status_symbol),
+ Fcons (make_number ('p'), load_percentage),
+ Fcons (make_number ('s'), seconds),
+ Fcons (make_number ('m'), minutes),
+ Fcons (make_number ('h'), hours),
+ Fcons (make_number ('t'), remain));
}
return status;
}
value = Qnil;
/* Determining the required information on Windows turns out, sadly,
- to be more involved than one would hope. The original Win32 api
+ to be more involved than one would hope. The original Windows API
call for this will return bogus information on some systems, but we
must dynamically probe for the replacement api, since that was
added rather late on. */
return Qnil;
}
/* Allocate memory for the PRINTER_INFO_2 struct */
- ppi2 = (PRINTER_INFO_2 *) xmalloc (dwNeeded);
+ ppi2 = xmalloc (dwNeeded);
if (!ppi2)
{
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)
Fput (Qundefined_color, Qerror_conditions,
- pure_cons (Qundefined_color, pure_cons (Qerror, Qnil)));
+ listn (CONSTYPE_PURE, 2, Qundefined_color, Qerror));
Fput (Qundefined_color, Qerror_message,
- make_pure_c_string ("Undefined color"));
+ build_pure_c_string ("Undefined color"));
staticpro (&w32_grabbed_keys);
w32_grabbed_keys = Qnil;