138 |
for Far East languages. */ |
for Far East languages. */ |
139 |
int w32_enable_unicode_output; |
int w32_enable_unicode_output; |
140 |
|
|
141 |
|
/* Flag to enable Cleartype hack for font metrics. */ |
142 |
|
static int cleartype_active; |
143 |
|
|
144 |
DWORD dwWindowsThreadId = 0; |
DWORD dwWindowsThreadId = 0; |
145 |
HANDLE hWindowsThread = NULL; |
HANDLE hWindowsThread = NULL; |
146 |
DWORD dwMainThreadId = 0; |
DWORD dwMainThreadId = 0; |
910 |
int real_width; |
int real_width; |
911 |
GetCharWidth (hdc, *char2b, *char2b, &real_width); |
GetCharWidth (hdc, *char2b, *char2b, &real_width); |
912 |
#endif |
#endif |
913 |
|
if (cleartype_active) |
914 |
|
{ |
915 |
|
/* Cleartype antialiasing causes characters to overhang |
916 |
|
by a pixel on each side compared with what GetCharABCWidths |
917 |
|
reports. */ |
918 |
|
char_widths.abcA -= 1; |
919 |
|
char_widths.abcC -= 1; |
920 |
|
char_widths.abcB += 2; |
921 |
|
} |
922 |
|
|
923 |
pcm->width = char_widths.abcA + char_widths.abcB + char_widths.abcC; |
pcm->width = char_widths.abcA + char_widths.abcB + char_widths.abcC; |
924 |
#if 0 |
#if 0 |
925 |
/* As far as I can tell, this is the best way to determine what |
/* As far as I can tell, this is the best way to determine what |
6416 |
w32_system_caret_x = 0; |
w32_system_caret_x = 0; |
6417 |
w32_system_caret_y = 0; |
w32_system_caret_y = 0; |
6418 |
|
|
6419 |
|
/* Initialize w32_use_visible_system_caret based on whether a screen |
6420 |
|
reader is in use. */ |
6421 |
|
if (!SystemParametersInfo (SPI_GETSCREENREADER, 0, |
6422 |
|
&w32_use_visible_system_caret, 0)) |
6423 |
|
w32_use_visible_system_caret = 0; |
6424 |
|
|
6425 |
last_tool_bar_item = -1; |
last_tool_bar_item = -1; |
6426 |
any_help_event_p = 0; |
any_help_event_p = 0; |
6427 |
|
|
6466 |
/* Dynamically link to optional system components. */ |
/* Dynamically link to optional system components. */ |
6467 |
{ |
{ |
6468 |
HANDLE user_lib = LoadLibrary ("user32.dll"); |
HANDLE user_lib = LoadLibrary ("user32.dll"); |
6469 |
|
UINT smoothing_type; |
6470 |
|
BOOL smoothing_enabled; |
6471 |
|
|
6472 |
#define LOAD_PROC(fn) pfn##fn = (void *) GetProcAddress (user_lib, #fn) |
#define LOAD_PROC(fn) pfn##fn = (void *) GetProcAddress (user_lib, #fn) |
6473 |
|
|
6488 |
effectively form the border of the main scroll bar range. */ |
effectively form the border of the main scroll bar range. */ |
6489 |
vertical_scroll_bar_top_border = vertical_scroll_bar_bottom_border |
vertical_scroll_bar_top_border = vertical_scroll_bar_bottom_border |
6490 |
= GetSystemMetrics (SM_CYVSCROLL); |
= GetSystemMetrics (SM_CYVSCROLL); |
6491 |
|
|
6492 |
|
/* Constants that are not always defined by the system headers |
6493 |
|
since they only exist on certain versions of Windows. */ |
6494 |
|
#ifndef SPI_GETFONTSMOOTHING |
6495 |
|
#define SPI_GETFONTSMOOTHING 0x4A |
6496 |
|
#endif |
6497 |
|
#ifndef SPI_GETFONTSMOOTHINGTYPE |
6498 |
|
#define SPI_GETFONTSMOOTHINGTYPE 0x0200A |
6499 |
|
#endif |
6500 |
|
#ifndef FE_FONTSMOOTHINGCLEARTYPE |
6501 |
|
#define FE_FONTSMOOTHINGCLEARTYPE 0x2 |
6502 |
|
#endif |
6503 |
|
|
6504 |
|
/* Determine if Cleartype is in use. Used to enable a hack in |
6505 |
|
the char metric calculations which adds extra pixels to |
6506 |
|
compensate for the "sub-pixels" that are not counted by the |
6507 |
|
system APIs. */ |
6508 |
|
cleartype_active = |
6509 |
|
SystemParametersInfo (SPI_GETFONTSMOOTHING, 0, &smoothing_enabled, 0) |
6510 |
|
&& smoothing_enabled |
6511 |
|
&& SystemParametersInfo (SPI_GETFONTSMOOTHINGTYPE, 0, &smoothing_type, 0) |
6512 |
|
&& smoothing_type == FE_FONTSMOOTHINGCLEARTYPE; |
6513 |
} |
} |
6514 |
} |
} |
6515 |
|
|
6579 |
When this variable is set, other variables affecting the appearance of |
When this variable is set, other variables affecting the appearance of |
6580 |
the cursor have no effect. */); |
the cursor have no effect. */); |
6581 |
|
|
6582 |
/* Initialize w32_use_visible_system_caret based on whether a screen |
w32_use_visible_system_caret = 0; |
|
reader is in use. */ |
|
|
if (!SystemParametersInfo (SPI_GETSCREENREADER, 0, |
|
|
&w32_use_visible_system_caret, 0)) |
|
|
w32_use_visible_system_caret = 0; |
|
6583 |
|
|
6584 |
/* We don't yet support this, but defining this here avoids whining |
/* We don't yet support this, but defining this here avoids whining |
6585 |
from cus-start.el and other places, like "M-x set-variable". */ |
from cus-start.el and other places, like "M-x set-variable". */ |