it, and including `bitmaps/gray' more than once is a problem when
config.h defines `static' as an empty replacement string. */
-int gray_bitmap_width = gray_width;
-int gray_bitmap_height = gray_height;
-unsigned char *gray_bitmap_bits = gray_bits;
-
/* The colormap for converting color names to RGB values */
Lisp_Object Vw32_color_map;
int w32_mouse_move_interval;
/* Flag to indicate if XBUTTON events should be passed on to Windows. */
-int w32_pass_extra_mouse_buttons_to_system;
+static int w32_pass_extra_mouse_buttons_to_system;
/* Flag to indicate if media keys should be passed on to Windows. */
-int w32_pass_multimedia_buttons_to_system;
+static int w32_pass_multimedia_buttons_to_system;
/* Non nil if no window manager is in use. */
Lisp_Object Vx_no_window_manager;
Lisp_Object Vw32_bdf_filename_alist;
/* A flag to control whether fonts are matched strictly or not. */
-int w32_strict_fontnames;
+static int w32_strict_fontnames;
/* A flag to control whether we should only repaint if GetUpdateRect
indicates there is an update region. */
-int w32_strict_painting;
+static int w32_strict_painting;
/* Associative list linking character set strings to Windows codepages. */
-Lisp_Object Vw32_charset_info_alist;
+static Lisp_Object Vw32_charset_info_alist;
/* VIETNAMESE_CHARSET is not defined in some versions of MSVC. */
#ifndef VIETNAMESE_CHARSET
CHECK_NUMBER (blue);
CHECK_STRING (name);
- XSETINT (rgb, RGB(XUINT (red), XUINT (green), XUINT (blue)));
+ XSETINT (rgb, RGB (XUINT (red), XUINT (green), XUINT (blue)));
BLOCK_INPUT;
return (cmap);
}
-Lisp_Object
+static Lisp_Object
w32_to_x_color (rgb)
Lisp_Object rgb;
{
int size;
color = colorname + 1;
- size = strlen(color);
+ size = strlen (color);
if (size == 3 || size == 6 || size == 9 || size == 12)
{
UINT colorval;
/* The check for 'x' in the following conditional takes into
account the fact that strtol allows a "0x" in front of
our numbers, and we don't. */
- if (!isxdigit(color[0]) || color[1] == 'x')
+ if (!isxdigit (color[0]) || color[1] == 'x')
break;
t = color[size];
color[size] = '\0';
- value = strtoul(color, &end, 16);
+ value = strtoul (color, &end, 16);
color[size] = t;
if (errno == ERANGE || end - color != size)
break;
}
}
}
- else if (strnicmp(colorname, "rgb:", 4) == 0)
+ else if (strnicmp (colorname, "rgb:", 4) == 0)
{
char *color;
UINT colorval;
/* The check for 'x' in the following conditional takes into
account the fact that strtol allows a "0x" in front of
our numbers, and we don't. */
- if (!isxdigit(color[0]) || color[1] == 'x')
+ if (!isxdigit (color[0]) || color[1] == 'x')
break;
- value = strtoul(color, &end, 16);
+ value = strtoul (color, &end, 16);
if (errno == ERANGE)
break;
switch (end - color)
color = end + 1;
}
}
- else if (strnicmp(colorname, "rgbi:", 5) == 0)
+ else if (strnicmp (colorname, "rgbi:", 5) == 0)
{
/* This is an RGB Intensity specification. */
char *color;
double value;
UINT val;
- value = strtod(color, &end);
+ value = strtod (color, &end);
if (errno == ERANGE)
break;
if (value < 0.0 || value > 1.0)
#endif /* TODO */
}
-/* Defined in w32term.c. */
void
x_set_cursor_color (f, arg, oldval)
struct frame *f;
name = ENCODE_SYSTEM (name);
BLOCK_INPUT;
- SetWindowText(FRAME_W32_WINDOW (f), SDATA (name));
+ SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));
UNBLOCK_INPUT;
}
}
name = ENCODE_SYSTEM (name);
BLOCK_INPUT;
- SetWindowText(FRAME_W32_WINDOW (f), SDATA (name));
+ SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));
UNBLOCK_INPUT;
}
}
w32_load_cursor (LPCTSTR name)
{
/* Try first to load cursor from application resource. */
- Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle(NULL),
+ Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle (NULL),
name, IMAGE_CURSOR, 0, 0,
LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED);
if (!cursor)
extern LRESULT CALLBACK w32_wnd_proc ();
-BOOL
+static BOOL
w32_init_class (hinst)
HINSTANCE hinst;
{
return (RegisterClass (&wc));
}
-HWND
+static HWND
w32_createscrollbar (f, bar)
struct frame *f;
struct scroll_bar * bar;
{
return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE,
/* Position and size of scroll bar. */
- XINT(bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
- XINT(bar->top),
- XINT(bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
- XINT(bar->height),
+ XINT (bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
+ XINT (bar->top),
+ XINT (bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
+ XINT (bar->height),
FRAME_W32_WINDOW (f),
NULL,
hinst,
NULL));
}
-void
+static void
w32_createwindow (f)
struct frame *f;
{
}
}
-void
+static void
my_post_msg (wmsg, hwnd, msg, wParam, lParam)
W32Msg * wmsg;
HWND hwnd;
return 0;
}
-unsigned int
+static unsigned int
w32_get_modifiers ()
{
return ((modifier_set (VK_SHIFT) ? shift_modifier : 0) |
}
/* List of special key combinations which w32 would normally capture,
- but emacs should grab instead. Not directly visible to lisp, to
+ but Emacs should grab instead. Not directly visible to lisp, to
simplify synchronization. Each item is an integer encoding a virtual
key code and modifier combination to capture. */
-Lisp_Object w32_grabbed_keys;
+static Lisp_Object w32_grabbed_keys;
-#define HOTKEY(vk,mods) make_number (((vk) & 255) | ((mods) << 8))
+#define HOTKEY(vk, mods) make_number (((vk) & 255) | ((mods) << 8))
#define HOTKEY_ID(k) (XFASTINT (k) & 0xbfff)
#define HOTKEY_VK_CODE(k) (XFASTINT (k) & 255)
#define HOTKEY_MODIFIERS(k) (XFASTINT (k) >> 8)
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 cancelled, so don't abort. */
return;
msg_buf->result = result;
PostThreadMessage (dwWindowsThreadId, WM_NULL, 0, 0);
}
-void
+static void
cancel_all_deferred_msgs ()
{
deferred_msg * item;
/* Detect quit_char and set quit-flag directly. Note that we
still need to post a message to ensure the main thread will be
- woken up if blocked in sys_select(), but we do NOT want to post
+ 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. */
/* If GetUpdateRect returns 0 (meaning there is no update
region), assume the whole window needs to be repainted. */
- GetClientRect(hwnd, &wmsg.rect);
+ GetClientRect (hwnd, &wmsg.rect);
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
return 0;
}
DWORD scrollbar_extra;
RECT wr;
- wp.length = sizeof(wp);
+ wp.length = sizeof (wp);
GetWindowRect (hwnd, &wr);
enter_crit ();
\f
/* Return the charset portion of a font name. */
-char * xlfd_charset_of_font (char * fontname)
+char *
+xlfd_charset_of_font (char * fontname)
{
char *charset, *encoding;
- encoding = strrchr(fontname, '-');
+ encoding = strrchr (fontname, '-');
if (!encoding || encoding == fontname)
return NULL;
if (*charset == '-')
break;
- if (charset == fontname || strcmp(charset, "-*-*") == 0)
+ if (charset == fontname || strcmp (charset, "-*-*") == 0)
return NULL;
return charset + 1;
static BOOL x_to_w32_font (char *lpxstr, LOGFONT *lplogfont);
static struct font_info *
-w32_load_system_font (f,fontname,size)
+w32_load_system_font (f, fontname, size)
struct frame *f;
char * fontname;
int size;
GetFontLanguageInfo, we check the properties of the
codepage directly, since that is ultimately what we are
working from anyway. */
- /* font->double_byte_p = GetFontLanguageInfo(hdc) & GCP_DBCS; */
+ /* font->double_byte_p = GetFontLanguageInfo (hdc) & GCP_DBCS; */
CPINFO cpi = {0};
GetCPInfo (codepage, &cpi);
font->double_byte_p = cpi.MaxCharSize > 1;
pointer to the structure font_info while allocating it dynamically.
If loading fails, return NULL. */
struct font_info *
-w32_load_font (f,fontname,size)
-struct frame *f;
-char * fontname;
-int size;
+w32_load_font (f, fontname, size)
+ struct frame *f;
+ char * fontname;
+ int size;
{
Lisp_Object bdf_fonts;
struct font_info *retval = NULL;
if (retval)
return retval;
- return w32_load_system_font(f, fontname, size);
+ return w32_load_system_font (f, fontname, size);
}
if (font->per_char) xfree (font->per_char);
if (font->bdf) w32_free_bdf_font (font->bdf);
- if (font->hfont) DeleteObject(font->hfont);
+ if (font->hfont) DeleteObject (font->hfont);
xfree (font);
}
}
{
if (!lpw) return (FW_DONTCARE);
- if (stricmp (lpw,"heavy") == 0) return FW_HEAVY;
- else if (stricmp (lpw,"extrabold") == 0) return FW_EXTRABOLD;
- else if (stricmp (lpw,"bold") == 0) return FW_BOLD;
- else if (stricmp (lpw,"demibold") == 0) return FW_SEMIBOLD;
- else if (stricmp (lpw,"semibold") == 0) return FW_SEMIBOLD;
- else if (stricmp (lpw,"medium") == 0) return FW_MEDIUM;
- else if (stricmp (lpw,"normal") == 0) return FW_NORMAL;
- else if (stricmp (lpw,"light") == 0) return FW_LIGHT;
- else if (stricmp (lpw,"extralight") == 0) return FW_EXTRALIGHT;
- else if (stricmp (lpw,"thin") == 0) return FW_THIN;
+ if (stricmp (lpw, "heavy") == 0) return FW_HEAVY;
+ else if (stricmp (lpw, "extrabold") == 0) return FW_EXTRABOLD;
+ else if (stricmp (lpw, "bold") == 0) return FW_BOLD;
+ else if (stricmp (lpw, "demibold") == 0) return FW_SEMIBOLD;
+ else if (stricmp (lpw, "semibold") == 0) return FW_SEMIBOLD;
+ else if (stricmp (lpw, "medium") == 0) return FW_MEDIUM;
+ else if (stricmp (lpw, "normal") == 0) return FW_NORMAL;
+ else if (stricmp (lpw, "light") == 0) return FW_LIGHT;
+ else if (stricmp (lpw, "extralight") == 0) return FW_EXTRALIGHT;
+ else if (stricmp (lpw, "thin") == 0) return FW_THIN;
else
return FW_DONTCARE;
}
Format of each entry is
(CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)).
*/
- this_entry = Fassoc (build_string(charset), Vw32_charset_info_alist);
+ this_entry = Fassoc (build_string (charset), Vw32_charset_info_alist);
- if (NILP(this_entry))
+ if (NILP (this_entry))
{
/* At startup, we want iso8859-1 fonts to come up properly. */
- if (stricmp(charset, "iso8859-1") == 0)
+ if (stricmp (charset, "iso8859-1") == 0)
return ANSI_CHARSET;
else
return DEFAULT_CHARSET;
case ANSI_CHARSET:
/* Handle startup case of w32-charset-info-alist not
being set up yet. */
- if (NILP(Vw32_charset_info_alist))
+ if (NILP (Vw32_charset_info_alist))
return "iso8859-1";
charset_type = Qw32_charset_ansi;
break;
return buf;
}
- strncpy(buf, best_match, 31);
+ strncpy (buf, best_match, 31);
buf[31] = '\0';
return buf;
}
case ANSI_CHARSET:
/* Handle startup case of w32-charset-info-alist not
being set up yet. */
- if (NILP(Vw32_charset_info_alist))
+ if (NILP (Vw32_charset_info_alist))
return Fcons (build_string ("iso8859-1"), Qnil);
charset_type = Qw32_charset_ansi;
*end = '\0';
}
- entry = Fassoc (build_string(charset), Vw32_charset_info_alist);
+ entry = Fassoc (build_string (charset), Vw32_charset_info_alist);
if (NILP (entry))
return CP_UNKNOWN;
coding.composing = COMPOSITION_DISABLED;
bufsz = decoding_buffer_size (&coding, LF_FACESIZE);
- fontname = alloca(sizeof(*fontname) * bufsz);
+ fontname = alloca (sizeof (*fontname) * bufsz);
decode_coding (&coding, lplogfont->lfFaceName, fontname,
- strlen(lplogfont->lfFaceName), bufsz - 1);
+ strlen (lplogfont->lfFaceName), bufsz - 1);
*(fontname + coding.produced) = '\0';
/* Replace dashes with underscores so the dashes are not
if (fields > 0)
{
- strncpy (lplogfont->lfFaceName,name, LF_FACESIZE);
+ strncpy (lplogfont->lfFaceName, name, LF_FACESIZE);
lplogfont->lfFaceName[LF_FACESIZE-1] = 0;
}
else
}
return (fast_string_match_ignore_case (build_string (regex),
- build_string(font_name_copy)) >= 0);
+ build_string (font_name_copy)) >= 0);
}
/* Callback functions, and a structure holding info they need, for
/* Interface to fontset handler. (adapted from mw32font.c in Meadow
and xterm.c in Emacs 20.3) */
-static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names)
+static Lisp_Object
+w32_list_bdf_fonts (Lisp_Object pattern, int max_names)
{
char *fontname, *ptnstr;
Lisp_Object list, tem, newlist = Qnil;
codepage = w32_codepage_for_font (SDATA (tpat));
if (codepage != CP_8BIT && codepage != CP_UNICODE
&& codepage != CP_DEFAULT && codepage != CP_UNKNOWN
- && !IsValidCodePage(codepage))
+ && !IsValidCodePage (codepage))
continue;
/* See if we cached the result for this particular query.
XSETCDR (tem, make_number (0));
SelectObject (hdc, oldobj);
ReleaseDC (dpyinfo->root_window, hdc);
- DeleteObject(thisinfo.hfont);
+ DeleteObject (thisinfo.hfont);
UNBLOCK_INPUT;
}
found_size = XINT (XCDR (tem));
Lisp_Object combined[2];
combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts);
combined[1] = newlist;
- newlist = Fnconc(2, combined);
+ newlist = Fnconc (2, combined);
}
return newlist;
for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++)
{
- if (stricmp(pfi->name, fontname) == 0) return pfi;
+ if (stricmp (pfi->name, fontname) == 0) return pfi;
}
return NULL;
}
/* directory-files from dired.c. */
-Lisp_Object Fdirectory_files P_((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
+Lisp_Object Fdirectory_files P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
\f
/* Find BDF files in a specified directory. (use GCPRO when calling,
Lisp_Object filelist, list = Qnil;
char fontname[100];
- if (!STRINGP(directory))
+ if (!STRINGP (directory))
return Qnil;
filelist = Fdirectory_files (directory, Qt,
build_string (".*\\.[bB][dD][fF]"), Qt);
- for ( ; CONSP(filelist); filelist = XCDR (filelist))
+ for ( ; CONSP (filelist); filelist = XCDR (filelist))
{
Lisp_Object filename = XCAR (filelist);
if (w32_BDF_to_x_font (SDATA (filename), fontname, 100))
pair[0] = list;
pair[1] = Qnil;
GCPRO2 (directory, list);
- pair[1] = w32_find_bdf_fonts_in_dir( XCAR (directory) );
- list = Fnconc( 2, pair );
+ pair[1] = w32_find_bdf_fonts_in_dir ( XCAR (directory) );
+ list = Fnconc ( 2, pair );
UNGCPRO;
}
return list;
/* We force 24+ bit depths to 24-bit, both to prevent an overflow
and because probably is more meaningful on Windows anyway */
if (cap < 0)
- cap = 1 << min(dpyinfo->n_planes * dpyinfo->n_cbits, 24);
+ cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24);
ReleaseDC (dpyinfo->root_window, hdc);
Lisp_Object color_file;
struct gcpro gcpro1;
- color_file = build_string("~/rgb.txt");
+ color_file = build_string ("~/rgb.txt");
GCPRO1 (color_file);
*last = '\0';
}
- file = DECODE_FILE(build_string (filename));
+ file = DECODE_FILE (build_string (filename));
}
/* User cancelled the dialog without making a selection. */
else if (!CommDlgExtendedError ())
#else
if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,
(WPARAM) XINT (XCAR (item)), (LPARAM) item))
-
#endif
{
MSG msg;
doc: /* Return list of registered hot-key IDs. */)
()
{
- return Fcopy_sequence (w32_grabbed_keys);
+ return Fdelq (Qnil, Fcopy_sequence (w32_grabbed_keys));
}
DEFUN ("w32-reconstruct-hot-key", Fw32_reconstruct_hot_key,
LARGE_INTEGER freebytes;
LARGE_INTEGER totalbytes;
- if (pfn_GetDiskFreeSpaceEx(rootname,
- (ULARGE_INTEGER *)&availbytes,
- (ULARGE_INTEGER *)&totalbytes,
- (ULARGE_INTEGER *)&freebytes))
+ if (pfn_GetDiskFreeSpaceEx (rootname,
+ (ULARGE_INTEGER *)&availbytes,
+ (ULARGE_INTEGER *)&totalbytes,
+ (ULARGE_INTEGER *)&freebytes))
value = list3 (make_float ((double) totalbytes.QuadPart),
make_float ((double) freebytes.QuadPart),
make_float ((double) availbytes.QuadPart));
DWORD free_clusters;
DWORD total_clusters;
- if (GetDiskFreeSpace(rootname,
- §ors_per_cluster,
- &bytes_per_sector,
- &free_clusters,
- &total_clusters))
+ if (GetDiskFreeSpace (rootname,
+ §ors_per_cluster,
+ &bytes_per_sector,
+ &free_clusters,
+ &total_clusters))
value = list3 (make_float ((double) total_clusters
* sectors_per_cluster * bytes_per_sector),
make_float ((double) free_clusters
ClosePrinter (hPrn);
return Qnil;
}
- /* Call GetPrinter() again with big enouth memory block */
+ /* Call GetPrinter again with big enouth memory block */
err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned);
ClosePrinter (hPrn);
if (!err)
{
- xfree(ppi2);
+ xfree (ppi2);
return Qnil;
}
{
/* a remote printer */
if (*ppi2->pServerName == '\\')
- _snprintf(pname_buf, sizeof (pname_buf), "%s\\%s", ppi2->pServerName,
+ _snprintf (pname_buf, sizeof (pname_buf), "%s\\%s", ppi2->pServerName,
ppi2->pShareName);
else
- _snprintf(pname_buf, sizeof (pname_buf), "\\\\%s\\%s", ppi2->pServerName,
+ _snprintf (pname_buf, sizeof (pname_buf), "\\\\%s\\%s", ppi2->pServerName,
ppi2->pShareName);
pname_buf[sizeof (pname_buf) - 1] = '\0';
}
else
{
/* a local printer */
- strncpy(pname_buf, ppi2->pPortName, sizeof (pname_buf));
+ strncpy (pname_buf, ppi2->pPortName, sizeof (pname_buf));
pname_buf[sizeof (pname_buf) - 1] = '\0';
/* `pPortName' can include several ports, delimited by ','.
* we only use the first one. */
- strtok(pname_buf, ",");
+ strtok (pname_buf, ",");
}
- xfree(ppi2);
+ xfree (ppi2);
}
return build_string (pname_buf);
&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
+browsers and other applications. Generally these buttons are handled on a
system wide basis, but by setting this to nil they are made available
to Emacs for binding. Depending on your keyboard, additional keys that
may be available are:
media-channel-up, media-channel-down,
volume-mute, volume-up, volume-down,
mic-volume-mute, mic-volume-down, mic-volume-up, mic-toggle,
-bass-down, bass-boost, bass-up, treble-down, treble-up
- */);
+bass-down, bass-boost, bass-up, treble-down, treble-up */);
w32_pass_multimedia_buttons_to_system = 1;
DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape,
Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
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. */);
#undef abort
void
-w32_abort()
+w32_abort ()
{
int button;
button = MessageBox (NULL,
/* For convenience when debugging. */
int
-w32_last_error()
+w32_last_error ()
{
return GetLastError ();
}