{
HDC hdc;
HBRUSH hb;
+ HANDLE oldobj;
RECT rect;
if (_hdc)
else
{
if (!f) return;
- hdc = GetFrameDC (f);
+ hdc = my_get_dc (FRAME_WIN32_WINDOW (f));
}
hb = CreateSolidBrush (pix);
+ oldobj = SelectObject (hdc, hb);
+
FillRect (hdc, lprect, hb);
+ SelectObject (hdc, oldobj);
DeleteObject (hb);
if (!_hdc)
- ReleaseFrameDC (f, hdc);
+ ReleaseDC (FRAME_WIN32_WINDOW (f), hdc);
}
void
FRAME_PTR f;
{
RECT rect;
-
+
GetClientRect (FRAME_WIN32_WINDOW (f), &rect);
win32_clear_rect (f, NULL, &rect);
}
BLOCK_INPUT;
- /* Regenerate display palette before drawing if list of requested
- colors has changed. */
- if (FRAME_WIN32_DISPLAY_INFO (f)->regen_palette)
- {
- win32_regenerate_palette (f);
- FRAME_WIN32_DISPLAY_INFO (f)->regen_palette = FALSE;
- }
-
if (f == FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_frame)
{
/* Don't do highlighting for mouse motion during the update. */
int orig_left = left;
HDC hdc;
- hdc = GetFrameDC (f);
+ hdc = my_get_dc (window);
while (n > 0)
{
}
}
- ReleaseFrameDC (f, hdc);
+ ReleaseDC (window, hdc);
}
\f
x_display_cursor (updating_frame, 0);
- hdc = GetFrameDC (f);
+ hdc = my_get_dc (FRAME_WIN32_WINDOW (f));
for (i = 0; i < ht; ++i)
if (line_dance[i] != -1 && (distance = line_dance[i]-i) > 0)
i = j+1;
}
- ReleaseFrameDC (f, hdc);
+ ReleaseDC (FRAME_WIN32_WINDOW (f), hdc);
for (i = 0; i < ht; ++i)
if (line_dance[i] == -1)
if (numchars <= 0)
abort (); /* Don't think this happens. */
- while (get_next_msg (&msg, FALSE))
+ while (get_next_msg (&msg, 0))
{
switch (msg.msg.message)
{
}
break;
- case WM_PALETTECHANGED:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
- if (f)
- /* Realize palette - will force update if needed. */
- ReleaseFrameDC (f, GetFrameDC (f));
- break;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
int width;
int height;
- GetClientRect (msg.msg.hwnd, &rect);
+ GetClientRect(msg.msg.hwnd, &rect);
height = rect.bottom - rect.top + 1;
width = rect.right - rect.left + 1;
HBRUSH hb;
HDC hdc;
- hdc = GetFrameDC (f);
+ hdc = my_get_dc (FRAME_WIN32_WINDOW (f));
hb = CreateSolidBrush (f->output_data.win32->cursor_pixel);
rect.left = CHAR_TO_PIXEL_COL (f, curs_x);
rect.top = CHAR_TO_PIXEL_ROW (f, curs_y);
- rect.right = rect.left + FONT_WIDTH (f->output_data.win32->font);
- rect.bottom = rect.top + f->output_data.win32->line_height;
-
+ rect.right = rect.left + FONT_WIDTH (f->output_data.win32->font) - 1;
+ rect.bottom = rect.top + f->output_data.win32->line_height - 1;
+
+ /* rect.left++; */
+ /* rect.top++; */
+ rect.right--;
+ rect.bottom--;
+
FrameRect (hdc, &rect, hb);
+
DeleteObject (hb);
-
- ReleaseFrameDC (f, hdc);
+
+ ReleaseDC (FRAME_WIN32_WINDOW (f), hdc);
}
/* Clear the cursor of frame F to background color,
rt.left = rt.right = rt.top = rt.bottom = 0;
BLOCK_INPUT;
- AdjustWindowRect (&rt, f->output_data.win32->dwStyle,
- FRAME_EXTERNAL_MENU_BAR (f));
+ AdjustWindowRect(&rt, f->output_data.win32->dwStyle,
+ FRAME_EXTERNAL_MENU_BAR (f));
UNBLOCK_INPUT;
pt.x += (rt.right - rt.left);
rect.right = pixelwidth;
rect.bottom = pixelheight;
- AdjustWindowRect (&rect, f->output_data.win32->dwStyle,
- FRAME_EXTERNAL_MENU_BAR (f));
+ AdjustWindowRect(&rect, f->output_data.win32->dwStyle,
+ FRAME_EXTERNAL_MENU_BAR (f));
/* All windows have an extra pixel */
if we get to x_make_frame_visible a second time
before the window gets really visible. */
if (! FRAME_ICONIFIED_P (f)
- && ! f->output_data.win32->asked_for_visible) {
- x_set_offset (f, f->output_data.win32->left_pos,
- f->output_data.win32->top_pos, 0);
- SetForegroundWindow (FRAME_WIN32_WINDOW (f));
- }
+ && ! f->output_data.win32->asked_for_visible)
+ x_set_offset (f, f->output_data.win32->left_pos, f->output_data.win32->top_pos, 0);
f->output_data.win32->asked_for_visible = 1;
+
ShowWindow (FRAME_WIN32_WINDOW (f), SW_SHOW);
}
/* Change window state from mapped to iconified. */
-void
-x_iconify_frame (f)
+void x_iconify_frame (f)
struct frame *f;
{
int result;
flexlines = f->height;
- enter_crit (CRIT_MSG);
+ enter_crit ();
SetWindowLong (window, WND_X_UNITS_INDEX, FONT_WIDTH (f->output_data.win32->font));
SetWindowLong (window, WND_Y_UNITS_INDEX, f->output_data.win32->line_height);
- leave_crit (CRIT_MSG);
+ leave_crit ();
}
/* Window manager things */
char *defaultvalue;
struct win32_display_info *dpyinfo;
HDC hdc;
-
+
BLOCK_INPUT;
if (!win32_initialized)
win32_display_name_list = Fcons (Fcons (display_name, Qnil),
win32_display_name_list);
dpyinfo->name_list_element = XCONS (win32_display_name_list)->car;
-
+
dpyinfo->win32_id_name
= (char *) xmalloc (XSTRING (Vinvocation_name)->size
+ XSTRING (Vsystem_name)->size
all versions. */
dpyinfo->xrdb = xrdb;
#endif
- hdc = GetDC (GetDesktopWindow ());
+ hdc = my_get_dc (GetDesktopWindow ());
dpyinfo->height = GetDeviceCaps (hdc, VERTRES);
dpyinfo->width = GetDeviceCaps (hdc, HORZRES);
dpyinfo->n_cbits = GetDeviceCaps (hdc, BITSPIXEL);
dpyinfo->height_in = GetDeviceCaps (hdc, LOGPIXELSX);
dpyinfo->width_in = GetDeviceCaps (hdc, LOGPIXELSY);
- dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE;
dpyinfo->grabbed = 0;
dpyinfo->reference_count = 0;
dpyinfo->n_fonts = 0;
ReleaseDC (GetDesktopWindow (), hdc);
- /* initialise palette with white and black */
- {
- COLORREF color;
- defined_color (0, "white", &color, 1);
- defined_color (0, "black", &color, 1);
- }
-
#ifndef F_SETOWN_BUG
#ifdef F_SETOWN
#ifdef F_SETOWN_SOCK_NEG
}
}
- /* free palette table */
- {
- struct win32_palette_entry * plist;
-
- plist = dpyinfo->p_colors_in_use;
- while (plist)
- {
- struct win32_palette_entry * pentry = plist;
- plist = plist->next;
- xfree (pentry);
- }
- dpyinfo->p_colors_in_use = NULL;
- if (dpyinfo->h_palette)
- DeleteObject (dpyinfo->h_palette);
- }
xfree (dpyinfo->font_table);
xfree (dpyinfo->win32_id_name);
}