+2000-03-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
+ (gdk_win32_gdi_failed) New function for reporting errors from GDI,
+ for which it is no use to call GetLastError onWin9x.
+ (gdk_other_api_failed) New function, for general error
+ reporting without calling GetLastError.
+ (gdk_win32_api_failed) OTOH, this function always calls
+ GetLastError. (gdk_win32_last_error_string) Remove this function,
+ GLib has the equivalent now.
+
+ * gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
+ call them with function name, file name and line number in the
+ arguments.
+
+ * gdk/win32/*.c: Use the new macros for reporting errors from GDI
+ functions.
+
+ * gtk/gtk.def: Add some missing entry points.
+
+ * gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
+ gtk_paned_set_gutter_size, which don't exist any longer, as void.
+
+ Fixes by Hans Breuer:
+
+ * gdk/makefile.msc: Update for debugging.
+
+ * gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
+ implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
+ PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
+ in the dash_list.
+
+ * gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
+ the x11 backend.
+
+ * gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
+
+ * gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
+
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
+2000-03-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
+ (gdk_win32_gdi_failed) New function for reporting errors from GDI,
+ for which it is no use to call GetLastError onWin9x.
+ (gdk_other_api_failed) New function, for general error
+ reporting without calling GetLastError.
+ (gdk_win32_api_failed) OTOH, this function always calls
+ GetLastError. (gdk_win32_last_error_string) Remove this function,
+ GLib has the equivalent now.
+
+ * gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
+ call them with function name, file name and line number in the
+ arguments.
+
+ * gdk/win32/*.c: Use the new macros for reporting errors from GDI
+ functions.
+
+ * gtk/gtk.def: Add some missing entry points.
+
+ * gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
+ gtk_paned_set_gutter_size, which don't exist any longer, as void.
+
+ Fixes by Hans Breuer:
+
+ * gdk/makefile.msc: Update for debugging.
+
+ * gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
+ implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
+ PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
+ in the dash_list.
+
+ * gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
+ the x11 backend.
+
+ * gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
+
+ * gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
+
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
+2000-03-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
+ (gdk_win32_gdi_failed) New function for reporting errors from GDI,
+ for which it is no use to call GetLastError onWin9x.
+ (gdk_other_api_failed) New function, for general error
+ reporting without calling GetLastError.
+ (gdk_win32_api_failed) OTOH, this function always calls
+ GetLastError. (gdk_win32_last_error_string) Remove this function,
+ GLib has the equivalent now.
+
+ * gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
+ call them with function name, file name and line number in the
+ arguments.
+
+ * gdk/win32/*.c: Use the new macros for reporting errors from GDI
+ functions.
+
+ * gtk/gtk.def: Add some missing entry points.
+
+ * gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
+ gtk_paned_set_gutter_size, which don't exist any longer, as void.
+
+ Fixes by Hans Breuer:
+
+ * gdk/makefile.msc: Update for debugging.
+
+ * gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
+ implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
+ PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
+ in the dash_list.
+
+ * gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
+ the x11 backend.
+
+ * gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
+
+ * gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
+
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
+2000-03-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
+ (gdk_win32_gdi_failed) New function for reporting errors from GDI,
+ for which it is no use to call GetLastError onWin9x.
+ (gdk_other_api_failed) New function, for general error
+ reporting without calling GetLastError.
+ (gdk_win32_api_failed) OTOH, this function always calls
+ GetLastError. (gdk_win32_last_error_string) Remove this function,
+ GLib has the equivalent now.
+
+ * gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
+ call them with function name, file name and line number in the
+ arguments.
+
+ * gdk/win32/*.c: Use the new macros for reporting errors from GDI
+ functions.
+
+ * gtk/gtk.def: Add some missing entry points.
+
+ * gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
+ gtk_paned_set_gutter_size, which don't exist any longer, as void.
+
+ Fixes by Hans Breuer:
+
+ * gdk/makefile.msc: Update for debugging.
+
+ * gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
+ implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
+ PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
+ in the dash_list.
+
+ * gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
+ the x11 backend.
+
+ * gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
+
+ * gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
+
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
+2000-03-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
+ (gdk_win32_gdi_failed) New function for reporting errors from GDI,
+ for which it is no use to call GetLastError onWin9x.
+ (gdk_other_api_failed) New function, for general error
+ reporting without calling GetLastError.
+ (gdk_win32_api_failed) OTOH, this function always calls
+ GetLastError. (gdk_win32_last_error_string) Remove this function,
+ GLib has the equivalent now.
+
+ * gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
+ call them with function name, file name and line number in the
+ arguments.
+
+ * gdk/win32/*.c: Use the new macros for reporting errors from GDI
+ functions.
+
+ * gtk/gtk.def: Add some missing entry points.
+
+ * gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
+ gtk_paned_set_gutter_size, which don't exist any longer, as void.
+
+ Fixes by Hans Breuer:
+
+ * gdk/makefile.msc: Update for debugging.
+
+ * gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
+ implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
+ PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
+ in the dash_list.
+
+ * gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
+ the x11 backend.
+
+ * gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
+
+ * gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
+
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
+2000-03-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
+ (gdk_win32_gdi_failed) New function for reporting errors from GDI,
+ for which it is no use to call GetLastError onWin9x.
+ (gdk_other_api_failed) New function, for general error
+ reporting without calling GetLastError.
+ (gdk_win32_api_failed) OTOH, this function always calls
+ GetLastError. (gdk_win32_last_error_string) Remove this function,
+ GLib has the equivalent now.
+
+ * gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
+ call them with function name, file name and line number in the
+ arguments.
+
+ * gdk/win32/*.c: Use the new macros for reporting errors from GDI
+ functions.
+
+ * gtk/gtk.def: Add some missing entry points.
+
+ * gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
+ gtk_paned_set_gutter_size, which don't exist any longer, as void.
+
+ Fixes by Hans Breuer:
+
+ * gdk/makefile.msc: Update for debugging.
+
+ * gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
+ implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
+ PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
+ in the dash_list.
+
+ * gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
+ the x11 backend.
+
+ * gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
+
+ * gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
+
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
+2000-03-07 Tor Lillqvist <tml@iki.fi>
+
+ * gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
+ (gdk_win32_gdi_failed) New function for reporting errors from GDI,
+ for which it is no use to call GetLastError onWin9x.
+ (gdk_other_api_failed) New function, for general error
+ reporting without calling GetLastError.
+ (gdk_win32_api_failed) OTOH, this function always calls
+ GetLastError. (gdk_win32_last_error_string) Remove this function,
+ GLib has the equivalent now.
+
+ * gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
+ call them with function name, file name and line number in the
+ arguments.
+
+ * gdk/win32/*.c: Use the new macros for reporting errors from GDI
+ functions.
+
+ * gtk/gtk.def: Add some missing entry points.
+
+ * gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
+ gtk_paned_set_gutter_size, which don't exist any longer, as void.
+
+ Fixes by Hans Breuer:
+
+ * gdk/makefile.msc: Update for debugging.
+
+ * gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
+ implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
+ PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
+ in the dash_list.
+
+ * gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
+ the x11 backend.
+
+ * gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
+
+ * gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
+
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
!IFNDEF DEBUG
# Full optimization:
-OPTIMIZE = -Ox -MD
+OPTIMIZE = -Ox -MD -Zi
+LINKDEBUG = /nodefaultlib:libc.lib
!ELSE
# Debugging:
OPTIMIZE = -Zi -MDd
+LINKDEBUG = /nodefaultlib:libcd.lib /nodefaultlib:libc.lib /debug
!ENDIF
# cl -? describes the options
#ifdef SOME_STRANGE_BUG
if (!ResizePalette (colormap->palette, colormap->size + nmore))
{
- WIN32_API_FAILED ("ResizePalette")
+ WIN32_GDI_FAILED ("ResizePalette")
return FALSE;
}
g_print("alloc_color_cells: %#x to %d\n",
/* It was a free'd entry anyway, so we can use it, and
set it to the correct color. */
if (SetPaletteEntries (colormap->palette, index, 1, &entry) == 0)
- WIN32_API_FAILED ("SetPaletteEntries #1");
+ WIN32_GDI_FAILED ("SetPaletteEntries");
}
else
{
/* A free slot, use it. */
if (SetPaletteEntries (colormap->palette,
index, 1, &entry) == 0)
- WIN32_API_FAILED ("SetPaletteEntries #2");
+ WIN32_GDI_FAILED ("SetPaletteEntries");
index = i;
break;
}
index = colormap->size;
colormap->size++;
if (!ResizePalette (colormap->palette, colormap->size))
- WIN32_API_FAILED ("ResizePalette");
+ WIN32_GDI_FAILED ("ResizePalette");
if (SetPaletteEntries (colormap->palette, index, 1, &entry) == 0)
- WIN32_API_FAILED ("SetPaletteEntries #3");
+ WIN32_GDI_FAILED ("SetPaletteEntries");
}
}
}
if (SetPaletteEntries (colormap->palette, lowestpixel,
highestpixel - lowestpixel + 1,
entries + lowestpixel) == 0)
- WIN32_API_FAILED ("SetPaletteEntries");
+ WIN32_GDI_FAILED ("SetPaletteEntries");
#endif
colormap->stale = TRUE;
#if 0
if (SetPaletteEntries (private->xcolormap->palette,
0, ncolors, palette) == 0)
- WIN32_API_FAILED ("SetPaletteEntries");
+ WIN32_GDI_FAILED ("SetPaletteEntries");
private->xcolormap->stale = TRUE;
break;
if (SetPaletteEntries (private->xcolormap->palette,
0, nstore, store) == 0)
- WIN32_API_FAILED ("SetPaletteEntries");
+ WIN32_GDI_FAILED ("SetPaletteEntries");
private->xcolormap->stale = TRUE;
g_free (store);
if (SetPaletteEntries (private->xcolormap->palette,
color->pixel, 1, &xcolor) == 0)
- WIN32_API_FAILED ("SetPaletteEntries");
+ WIN32_GDI_FAILED ("SetPaletteEntries");
private->xcolormap->stale = TRUE;
return TRUE;
context = target_context_new ();
hres = CoLockObjectExternal ((IUnknown *) &context->idt, TRUE, FALSE);
if (!SUCCEEDED (hres))
- WIN32_API_FAILED ("CoLockObjectExternal");
+ OTHER_API_FAILED ("CoLockObjectExternal");
else
{
hres = RegisterDragDrop (GDK_DRAWABLE_XID (window), &context->idt);
CoLockObjectExternal ((IUnknown *) &context->idt, FALSE, FALSE);
}
else if (!SUCCEEDED (hres))
- WIN32_API_FAILED ("RegisterDragDrop");
+ OTHER_API_FAILED ("RegisterDragDrop");
else
{
gdk_window_add_filter (window, gdk_destroy_filter, &context->idt);
if (gc_data->fill_style == GDK_OPAQUE_STIPPLED)
{
if (!BeginPath (hdc))
- WIN32_API_FAILED ("BeginPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("BeginPath"), ok = FALSE;
/* Win9x doesn't support Rectangle calls in a path,
* thus use Polyline.
MoveToEx (hdc, x, y, NULL);
if (ok && !Polyline (hdc, pts, 4))
- WIN32_API_FAILED ("Polyline"), ok = FALSE;
+ WIN32_GDI_FAILED ("Polyline"), ok = FALSE;
if (ok && !CloseFigure (hdc))
- WIN32_API_FAILED ("CloseFigure"), ok = FALSE;
+ WIN32_GDI_FAILED ("CloseFigure"), ok = FALSE;
if (ok && !EndPath (hdc))
- WIN32_API_FAILED ("EndPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("EndPath"), ok = FALSE;
if (ok && !filled)
if (!WidenPath (hdc))
- WIN32_API_FAILED ("WidenPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("WidenPath"), ok = FALSE;
if (ok && !FillPath (hdc))
- WIN32_API_FAILED ("FillPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("FillPath"), ok = FALSE;
if (hbr != NULL)
if (!DeleteObject (hbr))
- WIN32_API_FAILED ("DeleteObject");
+ WIN32_GDI_FAILED ("DeleteObject");
}
else
{
oldbrush = SelectObject (hdc, GetStockObject (HOLLOW_BRUSH));
if (!Rectangle (hdc, x, y, x+width+1, y+height+1))
- WIN32_API_FAILED ("Rectangle");
+ WIN32_GDI_FAILED ("Rectangle");
if (filled)
SelectObject (hdc, oldpen);
x, y, x+width, y+height,
nXStartArc, nYStartArc,
nXEndArc, nYEndArc));
- Pie (hdc, x, y, x+width, y+height,
- nXStartArc, nYStartArc, nXEndArc, nYEndArc);
+ if (!Pie (hdc, x, y, x+width, y+height,
+ nXStartArc, nYStartArc, nXEndArc, nYEndArc))
+ WIN32_GDI_FAILED ("Pie");
}
else
{
x, y, x+width, y+height,
nXStartArc, nYStartArc,
nXEndArc, nYEndArc));
- Arc (hdc, x, y, x+width, y+height,
- nXStartArc, nYStartArc, nXEndArc, nYEndArc);
+ if (!Arc (hdc, x, y, x+width, y+height,
+ nXStartArc, nYStartArc, nXEndArc, nYEndArc))
+ WIN32_GDI_FAILED ("Arc");
}
gdk_gc_postdraw (drawable, gc_private,
GDK_GC_FOREGROUND|GDK_GC_BACKGROUND);
if (gc_data->fill_style == GDK_OPAQUE_STIPPLED)
{
if (!BeginPath (hdc))
- WIN32_API_FAILED ("BeginPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("BeginPath"), ok = FALSE;
MoveToEx (hdc, points[0].x, points[0].y, NULL);
npoints--;
if (ok && !Polyline (hdc, pts, 4))
- WIN32_API_FAILED ("Polyline"), ok = FALSE;
+ WIN32_GDI_FAILED ("Polyline"), ok = FALSE;
if (ok && !CloseFigure (hdc))
- WIN32_API_FAILED ("CloseFigure"), ok = FALSE;
+ WIN32_GDI_FAILED ("CloseFigure"), ok = FALSE;
if (ok && !EndPath (hdc))
- WIN32_API_FAILED ("EndPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("EndPath"), ok = FALSE;
if (ok && !filled)
if (!WidenPath (hdc))
- WIN32_API_FAILED ("WidenPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("WidenPath"), ok = FALSE;
if (ok && !FillPath (hdc))
- WIN32_API_FAILED ("FillPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("FillPath"), ok = FALSE;
if (hbr != NULL)
if (!DeleteObject (hbr))
- WIN32_API_FAILED ("DeleteObject");
+ WIN32_GDI_FAILED ("DeleteObject");
}
else
{
if (filled)
{
if (!Polygon (hdc, pts, npoints))
- WIN32_API_FAILED ("Polygon");
+ WIN32_GDI_FAILED ("Polygon");
}
else
{
if (!Polyline (hdc, pts, npoints))
- WIN32_API_FAILED ("Polyline");
+ WIN32_GDI_FAILED ("Polyline");
}
}
g_free (pts);
if ((oldfont = SelectObject (argp->hdc, singlefont->xfont)) == NULL)
{
- WIN32_API_FAILED ("SelectObject");
+ WIN32_GDI_FAILED ("SelectObject");
return;
}
if (!TextOutW (argp->hdc, argp->x, argp->y, wcstr, wclen))
- WIN32_API_FAILED ("TextOutW");
+ WIN32_GDI_FAILED ("TextOutW");
GetTextExtentPoint32W (argp->hdc, wcstr, wclen, &size);
argp->x += size.cx;
if (src_private->window_type == GDK_DRAWABLE_PIXMAP)
{
if ((srcdc = CreateCompatibleDC (hdc)) == NULL)
- WIN32_API_FAILED ("CreateCompatibleDC");
+ WIN32_GDI_FAILED ("CreateCompatibleDC");
if ((hgdiobj = SelectObject (srcdc, GDK_DRAWABLE_XID (src))) == NULL)
- WIN32_API_FAILED ("SelectObject #1");
+ WIN32_GDI_FAILED ("SelectObject");
if (!BitBlt (hdc, xdest, ydest, width, height,
srcdc, xsrc, ysrc, SRCCOPY))
- WIN32_API_FAILED ("BitBlt");
+ WIN32_GDI_FAILED ("BitBlt");
if ((SelectObject (srcdc, hgdiobj) == NULL))
- WIN32_API_FAILED ("SelectObject #2");
+ WIN32_GDI_FAILED ("SelectObject");
if (!DeleteDC (srcdc))
- WIN32_API_FAILED ("DeleteDC");
+ WIN32_GDI_FAILED ("DeleteDC");
}
else
{
if (!ScrollDC (hdc, xdest - xsrc, ydest - ysrc,
&scrollRect, &clipRect,
updateRgn, NULL))
- WIN32_API_FAILED ("ScrollDC");
+ WIN32_GDI_FAILED ("ScrollDC");
if (!InvalidateRgn (GDK_DRAWABLE_XID (drawable), updateRgn, FALSE))
- WIN32_API_FAILED ("InvalidateRgn");
+ WIN32_GDI_FAILED ("InvalidateRgn");
if (!UpdateWindow (GDK_DRAWABLE_XID (drawable)))
- WIN32_API_FAILED ("UpdateWindow");
+ WIN32_GDI_FAILED ("UpdateWindow");
}
else
{
if ((srcdc = GetDC (GDK_DRAWABLE_XID (src))) == NULL)
- WIN32_API_FAILED ("GetDC");
+ WIN32_GDI_FAILED ("GetDC");
if (!BitBlt (hdc, xdest, ydest, width, height,
srcdc, xsrc, ysrc, SRCCOPY))
- WIN32_API_FAILED ("BitBlt");
+ WIN32_GDI_FAILED ("BitBlt");
ReleaseDC (GDK_DRAWABLE_XID (src), srcdc);
}
}
gboolean ok = TRUE;
int i;
- GDK_NOTE (MISC, g_print ("gdk_win32_draw_segments: %#x destdc: (%d) %#x "
- "nsegs: %d\n",
- GDK_DRAWABLE_XID (drawable),
- gc_private, hdc,
- nsegs));
+ GDK_NOTE (MISC, g_print ("gdk_win32_draw_segments: %#x nsegs: %d\n",
+ GDK_DRAWABLE_XID (drawable), nsegs));
hdc = gdk_gc_predraw (drawable, gc_private,
GDK_GC_FOREGROUND|GDK_GC_BACKGROUND);
if (gc_data->fill_style == GDK_OPAQUE_STIPPLED)
{
if (!BeginPath (hdc))
- WIN32_API_FAILED ("BeginPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("BeginPath"), ok = FALSE;
for (i = 0; i < nsegs; i++)
{
if (ok && !MoveToEx (hdc, segs[i].x1, segs[i].y1, NULL))
- WIN32_API_FAILED ("MoveToEx"), ok = FALSE;
+ WIN32_GDI_FAILED ("MoveToEx"), ok = FALSE;
if (ok && !LineTo (hdc, segs[i].x2, segs[i].y2))
- WIN32_API_FAILED ("LineTo #1"), ok = FALSE;
+ WIN32_GDI_FAILED ("LineTo"), ok = FALSE;
/* Draw end pixel */
if (ok && gc_data->pen_width == 1)
if (!LineTo (hdc, segs[i].x2 + 1, segs[i].y2))
- WIN32_API_FAILED ("LineTo #2"), ok = FALSE;
+ WIN32_GDI_FAILED ("LineTo"), ok = FALSE;
}
if (ok && !EndPath (hdc))
- WIN32_API_FAILED ("EndPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("EndPath"), ok = FALSE;
if (ok && !WidenPath (hdc))
- WIN32_API_FAILED ("WidenPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("WidenPath"), ok = FALSE;
if (ok && !FillPath (hdc))
- WIN32_API_FAILED ("FillPath"), ok = FALSE;
+ WIN32_GDI_FAILED ("FillPath"), ok = FALSE;
if (hbr != NULL)
if (!DeleteObject (hbr))
- WIN32_API_FAILED ("DeleteObject");
+ WIN32_GDI_FAILED ("DeleteObject");
}
else
{
for (i = 0; i < nsegs; i++)
{
if (!MoveToEx (hdc, segs[i].x1, segs[i].y1, NULL))
- WIN32_API_FAILED ("MoveToEx");
+ WIN32_GDI_FAILED ("MoveToEx");
if (!LineTo (hdc, segs[i].x2, segs[i].y2))
- WIN32_API_FAILED ("LineTo #1");
+ WIN32_GDI_FAILED ("LineTo");
/* Draw end pixel */
if (gc_data->pen_width == 1)
if (!LineTo (hdc, segs[i].x2 + 1, segs[i].y2))
- WIN32_API_FAILED ("LineTo #2");
+ WIN32_GDI_FAILED ("LineTo");
}
}
gdk_gc_postdraw (drawable, gc_private, GDK_GC_FOREGROUND|GDK_GC_BACKGROUND);
}
if (!Polyline (hdc, pts, npoints))
- WIN32_API_FAILED ("Polyline");
+ WIN32_GDI_FAILED ("Polyline");
g_free (pts);
{
MoveToEx (hdc, points[npoints-1].x, points[npoints-1].y, NULL);
if (!LineTo (hdc, points[npoints-1].x + 1, points[npoints-1].y))
- WIN32_API_FAILED ("LineTo");
+ WIN32_GDI_FAILED ("LineTo");
}
#else
MoveToEx (hdc, points[0].x, points[0].y, NULL);
for (i = 1; i < npoints; i++)
if (!LineTo (hdc, points[i].x, points[i].y))
- WIN32_API_FAILED ("LineTo #1");
+ WIN32_GDI_FAILED ("LineTo");
/* Draw end pixel */
/* LineTo doesn't draw the last point, so if we have a pen width of 1,
*/
if (gc_data->pen_width == 1 && windows_version > 0x80000000)
if (!LineTo (hdc, points[npoints-1].x + 1, points[npoints-1].y))
- WIN32_API_FAILED ("LineTo #2");
+ WIN32_GDI_FAILED ("LineTo");
#endif
gdk_gc_postdraw (drawable, gc_private, GDK_GC_FOREGROUND|GDK_GC_BACKGROUND);
}
if (p_TrackMouseEvent != NULL)
GDK_NOTE (EVENTS, g_print ("Using TrackMouseEvent to detect leave events\n"));
#endif
- if (windows_version < 0x80000000 && (windows_version & 0xFF) == 5)
+ if (IS_WIN_NT (windows_version) && (windows_version & 0xFF) == 5)
{
/* On Win2k (Beta 3, at least) WM_IME_CHAR doesn't seem to work
* correctly for non-Unicode applications. Handle
doesnt_want_scroll (gint mask,
MSG *xevent)
{
+#if 0
return !(mask & GDK_SCROLL_MASK);
+#else
+ return !(mask & GDK_BUTTON_PRESS_MASK);
+#endif
}
static gboolean
if (SelectPalette (hdc, colormap_private->xcolormap->palette,
FALSE) == NULL)
- WIN32_API_FAILED ("SelectPalette");
+ WIN32_GDI_FAILED ("SelectPalette");
if ((k = RealizePalette (hdc)) == GDI_ERROR)
- WIN32_API_FAILED ("RealizePalette");
+ WIN32_GDI_FAILED ("RealizePalette");
#if 0
g_print ("WM_ERASEBKGND: selected %#x, realized %d colors\n",
colormap_private->xcolormap->palette, k);
g_print ("...CreateSolidBrush (%.08x) = %.08x\n", bg, hbr);
#endif
if (!FillRect (hdc, &rect, hbr))
- WIN32_API_FAILED ("FillRect");
+ WIN32_GDI_FAILED ("FillRect");
DeleteObject (hbr);
}
else if (GDK_WINDOW_WIN32DATA (window)->bg_type == GDK_WIN32_BG_PIXMAP)
GDK_NOTE (EVENTS, g_print ("...small pixmap, using brush\n"));
hbr = CreatePatternBrush (GDK_DRAWABLE_XID (pixmap));
if (!FillRect (hdc, &rect, hbr))
- WIN32_API_FAILED ("FillRect");
+ WIN32_GDI_FAILED ("FillRect");
DeleteObject (hbr);
}
else
if (!(bgdc = CreateCompatibleDC (hdc)))
{
- WIN32_API_FAILED ("CreateCompatibleDC");
+ WIN32_GDI_FAILED ("CreateCompatibleDC");
break;
}
if (!(oldbitmap = SelectObject (bgdc, GDK_DRAWABLE_XID (pixmap))))
{
- WIN32_API_FAILED ("SelectObject");
+ WIN32_GDI_FAILED ("SelectObject");
DeleteDC (bgdc);
break;
}
pixmap_private->width, pixmap_private->height,
bgdc, 0, 0, SRCCOPY))
{
- WIN32_API_FAILED (" BitBlt");
+ WIN32_GDI_FAILED ("BitBlt");
goto loopexit;
}
}
hbr = GetStockObject (BLACK_BRUSH);
GetClipBox (hdc, &rect);
if (!FillRect (hdc, &rect, hbr))
- WIN32_API_FAILED ("FillRect");
+ WIN32_GDI_FAILED ("FillRect");
}
break;
if (GetObject (singlefont->xfont, sizeof (LOGFONT), &logfont) == 0)
{
- WIN32_API_FAILED ("GetObject");
+ WIN32_GDI_FAILED ("GetObject");
return NULL;
}
if ((oldfont = SelectObject (gdk_DC, singlefont->xfont)) == NULL)
{
- WIN32_API_FAILED ("SelectObject");
+ WIN32_GDI_FAILED ("SelectObject");
return;
}
GetTextExtentPoint32W (gdk_DC, wcstr, wclen, &this_size);
{
if (data->clip_region != NULL)
if (!DeleteObject (data->clip_region))
- WIN32_API_FAILED ("DeleteObject");
+ WIN32_GDI_FAILED ("DeleteObject");
if (values->clip_mask != NULL)
{
data->clip_region =
1);
hbr = GetStockObject (WHITE_BRUSH);
if ((hdc = CreateCompatibleDC (NULL)) == NULL)
- WIN32_API_FAILED ("CreateCompatibleDC");
+ WIN32_GDI_FAILED ("CreateCompatibleDC");
if ((oldbitmap =
SelectObject (hdc, GDK_DRAWABLE_XID (pixmap))) == NULL)
- WIN32_API_FAILED ("SelectObject #1");
+ WIN32_GDI_FAILED ("SelectObject");
hbr = GetStockObject (BLACK_BRUSH);
if (!FillRect (hdc, &rect, hbr))
- WIN32_API_FAILED ("FillRect");
+ WIN32_GDI_FAILED ("FillRect");
hbr = GetStockObject (WHITE_BRUSH);
if (!FillRgn (hdc, data->clip_region, hbr))
- WIN32_API_FAILED ("FillRgn");
+ WIN32_GDI_FAILED ("FillRgn");
if (SelectObject (hdc, oldbitmap) == NULL)
- WIN32_API_FAILED ("SelectObject #2");
+ WIN32_GDI_FAILED ("SelectObject");
DeleteDC (hdc);
values->clip_mask = pixmap;
}
{
GdkGCWin32Data *data = GDK_GC_WIN32DATA (gc);
- /* XXX ??? */
-
data->pen_style &= ~(PS_STYLE_MASK);
data->pen_style |= PS_DASH;
+
+ /*
+ * Set the extended line style. This could be done by
+ * PS_USERSTYLE and ExtCreatePen; but ONLY on WinNT,
+ * so let's make a guess (based on the implementation
+ * in DIA). On Win9x this does only work for lines
+ * with width one ...
+ *
+ * More workarounds for Win9x descibed at:
+ * http://www.codeguru.com/gdi/dashed.shtml
+ */
+ if (!IS_WIN_NT (windows_version) && data->pen_width > 1)
+ {
+ GDK_NOTE (MISC, g_print ("gdk_win32_gc_set_dashes: not fully supported\n"));
+ data->pen_style |= PS_SOLID;
+ return;
+ }
+
+ /* data->pen_style = PS_COSMETIC; ??? */
+ if (2 == n)
+ {
+ if ((dash_list[0] == dash_list[1]) && (dash_list[0] > 2))
+ {
+ data->pen_style |= PS_DASH;
+ GDK_NOTE (MISC, g_print("gdk_win32_gc_set_dashes: PS_DASH (%d,%d)\n",
+ dash_list[0], dash_list[1]));
+ }
+ else
+ {
+ data->pen_style |= PS_DOT;
+ GDK_NOTE (MISC, g_print("gdk_win32_gc_set_dashes: PS_DOT (%d,%d)\n",
+ dash_list[0], dash_list[1]));
+ }
+ }
+ else if (4 == n)
+ {
+ data->pen_style |= PS_DASHDOT;
+ GDK_NOTE (MISC, g_print("gdk_win32_gc_set_dashes: PS_DASHDOT (%d,%d,%d,%d)\n",
+ dash_list[0], dash_list[1],
+ dash_list[2], dash_list[3]));
+ }
+ else if (6 == n)
+ {
+ data->pen_style |= PS_DASHDOTDOT;
+ GDK_NOTE (MISC, g_print("gdk_win32_gc_set_dashes: PS_DASHDOTDOT (%d,%d,%d,%d,%d,%d)\n",
+ dash_list[0], dash_list[1],
+ dash_list[2], dash_list[3],
+ dash_list[4], dash_list[5]));
+ }
+ else
+ {
+ data->pen_style |= PS_DASH;
+ GDK_NOTE (MISC, g_print("gdk_win32_gc_set_dashes: no guess for %d dashes\n", n));
+ }
}
void
if (data->clip_region != NULL)
if (!DeleteObject (data->clip_region))
- WIN32_API_FAILED ("DeleteObject");
+ WIN32_GDI_FAILED ("DeleteObject");
if (rectangle)
{
GDK_NOTE (MISC,
CreateRectRgn (rectangle->x, rectangle->y,
rectangle->x + rectangle->width,
rectangle->y + rectangle->height)) == NULL)
- WIN32_API_FAILED ("CreateRectRgn");
+ WIN32_GDI_FAILED ("CreateRectRgn");
data->values_mask |= GDK_GC_CLIP_MASK;
}
if (data->clip_region != NULL)
if (!DeleteObject (data->clip_region))
- WIN32_API_FAILED ("DeleteObject");
+ WIN32_GDI_FAILED ("DeleteObject");
if (region)
{
GdkRegionPrivate *region_private;
gdk_drawable_unref (dst_data->stipple);
if (dst_data->clip_region != NULL)
if (!DeleteObject (dst_data->clip_region))
- WIN32_API_FAILED ("DeleteObject");
+ WIN32_GDI_FAILED ("DeleteObject");
*dst_data = *src_data;
rgn = g_malloc (nbytes);
GetRegionData (dst_data->clip_region, nbytes, rgn);
if ((dst_data->clip_region = ExtCreateRegion (NULL, nbytes, rgn)) == NULL)
- WIN32_API_FAILED ("ExtCreateRegion");
+ WIN32_GDI_FAILED ("ExtCreateRegion");
g_free (rgn);
}
logpal.palPalEntry[1].peBlue = 0xFF;
logpal.palPalEntry[1].peFlags = 0x00;
if ((hpal = CreatePalette ((LOGPALETTE *) &logpal)) == NULL)
- WIN32_API_FAILED ("CreatePalette");
+ WIN32_GDI_FAILED ("CreatePalette");
}
SelectPalette (data->xgc, hpal, FALSE);
RealizePalette (data->xgc);
int k;
if (SelectPalette (data->xgc, colormap_private->xcolormap->palette,
FALSE) == NULL)
- WIN32_API_FAILED ("SelectPalette");
+ WIN32_GDI_FAILED ("SelectPalette");
if (TRUE || colormap_private->xcolormap->stale)
{
if ((k = RealizePalette (data->xgc)) == GDI_ERROR)
- WIN32_API_FAILED ("RealizePalette");
+ WIN32_GDI_FAILED ("RealizePalette");
colormap_private->xcolormap->stale = FALSE;
}
#if 0
fg = gdk_colormap_color (colormap_private, data->foreground);
if (SetTextColor (data->xgc, fg) == CLR_INVALID)
- WIN32_API_FAILED ("SetTextColor");
+ WIN32_GDI_FAILED ("SetTextColor");
/* Create and select pen and brush. */
if ((hpen = ExtCreatePen (data->pen_style, data->pen_width,
&logbrush, 0, NULL)) == NULL)
- WIN32_API_FAILED ("ExtCreatePen");
+ WIN32_GDI_FAILED ("ExtCreatePen");
if (SelectObject (data->xgc, hpen) == NULL)
- WIN32_API_FAILED ("SelectObject #2");
+ WIN32_GDI_FAILED ("SelectObject");
switch (data->fill_style)
{
case GDK_OPAQUE_STIPPLED:
if ((hbr = CreatePatternBrush (GDK_DRAWABLE_XID (data->stipple))) == NULL)
- WIN32_API_FAILED ("CreatePatternBrush");
+ WIN32_GDI_FAILED ("CreatePatternBrush");
SetBrushOrgEx(data->xgc, data->ts_x_origin,
data->ts_y_origin, NULL);
case GDK_SOLID:
default:
if ((hbr = CreateSolidBrush (fg)) == NULL)
- WIN32_API_FAILED ("CreateSolidBrush");
+ WIN32_GDI_FAILED ("CreateSolidBrush");
break;
}
if (SelectObject (data->xgc, hbr) == NULL)
- WIN32_API_FAILED ("SelectObject #3");
+ WIN32_GDI_FAILED ("SelectObject");
}
void
COLORREF bg = gdk_colormap_color (colormap_private, data->background);
if (SetBkColor (data->xgc, bg) == CLR_INVALID)
- WIN32_API_FAILED ("SetBkColor");
+ WIN32_GDI_FAILED ("SetBkColor");
}
HDC
if (GDK_DRAWABLE_TYPE (drawable) == GDK_DRAWABLE_PIXMAP)
{
if ((data->xgc = CreateCompatibleDC (NULL)) == NULL)
- WIN32_API_FAILED ("CreateCompatibleDC");
+ WIN32_GDI_FAILED ("CreateCompatibleDC");
if ((data->saved_dc = SaveDC (data->xgc)) == 0)
- WIN32_API_FAILED ("SaveDC #1");
+ WIN32_GDI_FAILED ("SaveDC");
if (SelectObject (data->xgc, data->hwnd) == NULL)
- WIN32_API_FAILED ("SelectObject #1");
+ WIN32_GDI_FAILED ("SelectObject");
}
else
{
if ((data->xgc = GetDC (data->hwnd)) == NULL)
- WIN32_API_FAILED ("GetDC");
+ WIN32_GDI_FAILED ("GetDC");
if ((data->saved_dc = SaveDC (data->xgc)) == 0)
- WIN32_API_FAILED ("SaveDC #2");
+ WIN32_GDI_FAILED ("SaveDC");
}
if (usage & GDK_GC_FOREGROUND)
if (usage & GDK_GC_FONT)
{
if (SetBkMode (data->xgc, TRANSPARENT) == 0)
- WIN32_API_FAILED ("SetBkMode");
+ WIN32_GDI_FAILED ("SetBkMode");
if (SetTextAlign (data->xgc, TA_BASELINE) == GDI_ERROR)
- WIN32_API_FAILED ("SetTextAlign");
+ WIN32_GDI_FAILED ("SetTextAlign");
}
if (data->values_mask & GDK_GC_FUNCTION)
if (SetROP2 (data->xgc, data->rop2) == 0)
- WIN32_API_FAILED ("SetROP2");
+ WIN32_GDI_FAILED ("SetROP2");
if ((data->values_mask & GDK_GC_CLIP_MASK)
&& data->clip_region != NULL)
if (usage & GDK_GC_FOREGROUND)
{
if ((hpen = GetCurrentObject (data->xgc, OBJ_PEN)) == NULL)
- WIN32_API_FAILED ("GetCurrentObject #1");
+ WIN32_GDI_FAILED ("GetCurrentObject");
if ((hbr = GetCurrentObject (data->xgc, OBJ_BRUSH)) == NULL)
- WIN32_API_FAILED ("GetCurrentObject #2");
+ WIN32_GDI_FAILED ("GetCurrentObject");
}
if (!RestoreDC (data->xgc, data->saved_dc))
- WIN32_API_FAILED ("RestoreDC");
+ WIN32_GDI_FAILED ("RestoreDC");
#if 0
if (colormap_private != NULL
&& colormap_private->xcolormap->rc_palette
{
SelectPalette (data->xgc, GetStockObject (DEFAULT_PALETTE), FALSE);
if (!UnrealizeObject (colormap_private->xcolormap->palette))
- WIN32_API_FAILED ("UnrealizeObject");
+ WIN32_GDI_FAILED ("UnrealizeObject");
}
#endif
if (GDK_DRAWABLE_TYPE (drawable) == GDK_DRAWABLE_PIXMAP)
{
if (!DeleteDC (data->xgc))
- WIN32_API_FAILED ("DeleteDC");
+ WIN32_GDI_FAILED ("DeleteDC");
}
else
{
if (hpen != NULL)
if (!DeleteObject (hpen))
- WIN32_API_FAILED ("DeleteObject #1");
+ WIN32_GDI_FAILED ("DeleteObject");
if (hbr != NULL)
if (!DeleteObject (hbr))
- WIN32_API_FAILED ("DeleteObject #2");
+ WIN32_GDI_FAILED ("DeleteObject");
if ((data->values_mask & GDK_GC_CLIP_MASK)
&& data->clip_region != NULL
logpal.palPalEntry[1].peBlue = 0xFF;
logpal.palPalEntry[1].peFlags = 0;
if ((bwPalette = CreatePalette ((LOGPALETTE *) &logpal)) == NULL)
- WIN32_API_FAILED ("CreatePalette");
+ WIN32_GDI_FAILED ("CreatePalette");
}
/* Create a memory DC inside which we will scan the bitmap content */
hMemDC = CreateCompatibleDC (NULL);
if (!hMemDC)
{
- WIN32_API_FAILED ("CreateCompatibleDC #1");
+ WIN32_GDI_FAILED ("CreateCompatibleDC");
return NULL;
}
#endif
if (!hbm8)
{
- WIN32_API_FAILED ("CreateDIBSection");
+ WIN32_GDI_FAILED ("CreateDIBSection");
DeleteDC (hMemDC);
return NULL;
}
hDC = CreateCompatibleDC (hMemDC);
if (!hDC)
{
- WIN32_API_FAILED ("CreateCompatibleDC #2");
+ WIN32_GDI_FAILED ("CreateCompatibleDC #2");
SelectObject (hMemDC, holdBmp);
DeleteObject (hbm8);
DeleteDC (hMemDC);
if (!BitBlt (hMemDC, 0, 0, bm.bmWidth, bm.bmHeight, hDC, 0, 0, SRCCOPY))
{
- WIN32_API_FAILED ("BitBlt");
+ WIN32_GDI_FAILED ("BitBlt");
SelectObject (hDC, holdBmp2);
SelectObject (hMemDC, holdBmp);
DeleteObject (hbm8);
if (private->ximage == NULL)
{
- WIN32_API_FAILED ("CreateDIBSection");
+ WIN32_GDI_FAILED ("CreateDIBSection");
g_free (image);
return NULL;
}
{
if ((hdc = CreateCompatibleDC (NULL)) == NULL)
{
- WIN32_API_FAILED ("CreateCompatibleDC #1");
+ WIN32_GDI_FAILED ("CreateCompatibleDC");
g_free (image);
return NULL;
}
if ((oldbitmap1 = SelectObject (hdc, GDK_DRAWABLE_XID (window))) == NULL)
{
- WIN32_API_FAILED ("SelectObject #1");
+ WIN32_GDI_FAILED ("SelectObject");
DeleteDC (hdc);
g_free (image);
return NULL;
{
if ((hdc = GetDC (GDK_DRAWABLE_XID (window))) == NULL)
{
- WIN32_API_FAILED ("GetDC");
+ WIN32_GDI_FAILED ("GetDC");
g_free (image);
return NULL;
}
if ((memdc = CreateCompatibleDC (hdc)) == NULL)
{
- WIN32_API_FAILED ("CreateCompatibleDC #2");
+ WIN32_GDI_FAILED ("CreateCompatibleDC");
if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
SelectObject (hdc, oldbitmap1);
CreateDIBSection (hdc, (BITMAPINFO *) &bmi, iUsage,
&image->mem, NULL, 0)) == NULL)
{
- WIN32_API_FAILED ("CreateDIBSection");
+ WIN32_GDI_FAILED ("CreateDIBSection");
DeleteDC (memdc);
if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
if ((oldbitmap2 = SelectObject (memdc, private->ximage)) == NULL)
{
- WIN32_API_FAILED ("SelectObject #2");
+ WIN32_GDI_FAILED ("SelectObject");
DeleteObject (private->ximage);
DeleteDC (memdc);
if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
if (!BitBlt (memdc, 0, 0, width, height, hdc, x, y, SRCCOPY))
{
- WIN32_API_FAILED ("BitBlt");
+ WIN32_GDI_FAILED ("BitBlt");
SelectObject (memdc, oldbitmap2);
DeleteObject (private->ximage);
DeleteDC (memdc);
}
if (SelectObject (memdc, oldbitmap2) == NULL)
- WIN32_API_FAILED ("SelectObject #3");
+ WIN32_GDI_FAILED ("SelectObject");
if (!DeleteDC (memdc))
- WIN32_API_FAILED ("DeleteDC");
+ WIN32_GDI_FAILED ("DeleteDC");
if (GDK_DRAWABLE_TYPE (window) == GDK_DRAWABLE_PIXMAP)
{
case GDK_IMAGE_SHARED:
if (!DeleteObject (private->ximage))
- WIN32_API_FAILED ("DeleteObject");
+ WIN32_GDI_FAILED ("DeleteObject");
break;
default:
if (GetObject (image_private->ximage, sizeof (DIBSECTION),
&ds) != sizeof (DIBSECTION))
{
- WIN32_API_FAILED ("GetObject");
+ WIN32_GDI_FAILED ("GetObject");
}
#if 0
g_print("xdest = %d, ydest = %d, xsrc = %d, ysrc = %d, width = %d, height = %d\n",
ds.dsBm.bmBits,
(CONST BITMAPINFO *) &bmi,
DIB_PAL_COLORS) == 0)
- WIN32_API_FAILED ("SetDIBitsToDevice");
+ WIN32_GDI_FAILED ("SetDIBitsToDevice");
}
else
{
if ((memdc = CreateCompatibleDC (hdc)) == NULL)
{
- WIN32_API_FAILED ("CreateCompatibleDC");
+ WIN32_GDI_FAILED ("CreateCompatibleDC");
gdk_gc_postdraw (drawable, gc_private, 0);
return;
}
if ((oldbitmap = SelectObject (memdc, image_private->ximage)) == NULL)
{
- WIN32_API_FAILED ("SelectObject #1");
+ WIN32_GDI_FAILED ("SelectObject");
gdk_gc_postdraw (drawable, gc_private, 0);
return;
}
if (!BitBlt (hdc, xdest, ydest, width, height,
memdc, xsrc, ysrc, SRCCOPY))
- WIN32_API_FAILED ("BitBlt");
+ WIN32_GDI_FAILED ("BitBlt");
if (SelectObject (memdc, oldbitmap) == NULL)
- WIN32_API_FAILED ("SelectObject #2");
+ WIN32_GDI_FAILED ("SelectObject");
if (!DeleteDC (memdc))
- WIN32_API_FAILED ("DeleteDC");
+ WIN32_GDI_FAILED ("DeleteDC");
}
gdk_gc_postdraw (drawable, gc_private, 0);
}
return TRUE;
}
-gchar *
-gdk_win32_last_error_string (void)
+void
+gdk_win32_api_failed (const gchar *where,
+ gint line,
+ const gchar *api)
{
- static gchar error[100];
- int nbytes;
-
- if ((nbytes = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (),
- 0, error, sizeof (error), NULL)) == 0)
- strcat (error, "Unknown error");
-
- if (nbytes > 2 && error[nbytes-1] == '\n' && error[nbytes-2] == '\r')
- error[nbytes-2] = '\0';
+ gchar *msg = g_win32_error_message (GetLastError ());
+ g_warning ("%s:%d: %s failed: %s", where, line, api, msg);
+ g_free (msg);
+}
- return error;
+void
+gdk_other_api_failed (const gchar *where,
+ gint line,
+ const gchar *api)
+{
+ g_warning ("%s:%d: %s failed", where, line, api);
}
void
-gdk_win32_api_failed (const gchar *where,
+gdk_win32_gdi_failed (const gchar *where,
gint line,
const gchar *api)
{
- g_warning ("%s:%d: %s failed: %s", where, line, api,
- gdk_win32_last_error_string ());
+ /* On Win9x GDI calls are implemented in 16-bit code and thus
+ * don't set the 32-bit error code, sigh.
+ */
+ if (IS_WIN_NT (windows_version))
+ gdk_win32_api_failed (where, line, api);
+ else
+ gdk_other_api_failed (where, line, api);
}
void
GDK_DRAWABLE_XID (pixmap)));
if (!DeleteObject (GDK_DRAWABLE_XID (pixmap)))
- WIN32_API_FAILED ("DeleteObject");
+ WIN32_GDI_FAILED ("DeleteObject");
gdk_xid_table_remove (GDK_DRAWABLE_XID (pixmap));
if ((hdc = GetDC (GDK_DRAWABLE_XID (window))) == NULL)
{
- WIN32_API_FAILED ("GetDC");
+ WIN32_GDI_FAILED ("GetDC");
g_free (private);
return NULL;
}
CreateDIBSection (hdc, (BITMAPINFO *) &bmi,
iUsage, (PVOID *) &bits, NULL, 0)) == NULL)
{
- WIN32_API_FAILED ("CreateDIBSection");
+ WIN32_GDI_FAILED ("CreateDIBSection");
ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
g_free (pixmap);
return NULL;
void *),
void *arg);
-gchar *gdk_color_to_string (const GdkColor *);
-gchar *gdk_win32_last_error_string (void);
-void gdk_win32_api_failed (const gchar *where,
- gint line,
- const gchar *api);
+gchar *gdk_color_to_string (const GdkColor *);
+void gdk_win32_api_failed (const gchar *where,
+ gint line,
+ const gchar *api);
+void gdk_other_api_failed (const gchar *where,
+ gint line,
+ const gchar *api);
+void gdk_win32_gdi_failed (const gchar *where,
+ gint line,
+ const gchar *api);
#ifdef __GNUC__
-#define WIN32_API_FAILED(api) gdk_win32_api_failed (__PRETTY_FUNCTION__, __LINE__, api)
+#define WIN32_API_FAILED(api) gdk_win32_api_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
+#define WIN32_GDI_FAILED(api) gdk_win32_gdi_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
+#define OTHER_API_FAILED(api) gdk_other_api_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
#else
#define WIN32_API_FAILED(api) gdk_win32_api_failed (__FILE__, __LINE__, api)
+#define WIN32_GDI_FAILED(api) gdk_win32_gdi_failed (__FILE__, __LINE__, api)
+#define OTHER_API_FAILED(api) gdk_other_api_failed (__FILE__, __LINE__, api)
#endif
extern LRESULT CALLBACK gdk_WindowProc (HWND, UINT, WPARAM, LPARAM);
extern GdkAtom gdk_ole2_dnd_atom;
extern DWORD windows_version;
+#define IS_WIN_NT(dwVersion) (dwVersion < 0x80000000)
#ifdef __cplusplus
}
#define GDK_WINDOW_XDISPLAY GDK_DRAWABLE_XDISPLAY
#define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID
+#define GDK_FONT_XFONT(font) (((GdkWin32SingleFont *)((GdkFontPrivateWin32 *)font)->fonts->data)->xfont)
GdkVisual* gdkx_visual_get (VisualID xvisualid);
rect.top = y;
rect.bottom = y + height;
if (!InvalidateRect (GDK_DRAWABLE_XID (window), &rect, TRUE))
- WIN32_API_FAILED ("InvalidateRect");
+ WIN32_GDI_FAILED ("InvalidateRect");
UpdateWindow (GDK_DRAWABLE_XID (window));
}
}
gtk_alignment_get_type
gtk_alignment_new
gtk_alignment_set
+ gtk_arg_name_strip_type
+ gtk_args_collect_cleanup
gtk_arrow_get_type
gtk_arrow_new
gtk_arrow_set
gtk_hscrollbar_new
gtk_hseparator_get_type
gtk_hseparator_new
+ gtk_identifier_get_type
gtk_idle_add
gtk_idle_add_full
gtk_idle_add_priority
gtk_rc_reparse_all
gtk_rc_set_default_files
gtk_rc_set_image_loader
+ gtk_rc_style_new
+ gtk_rc_style_ref
gtk_ruler_draw_pos
gtk_ruler_draw_ticks
gtk_ruler_get_type
#define gtk_container_border_width gtk_container_set_border_width
#define gtk_notebook_current_page gtk_notebook_get_current_page
#define gtk_packer_configure gtk_packer_set_child_packing
-#define gtk_paned_gutter_size gtk_paned_set_gutter_size
+#define gtk_paned_gutter_size(p,s) (void) 0
+#define gtk_paned_set_gutter_size(p,s) (void) 0
#define gtk_paned_handle_size gtk_paned_set_handle_size
#define gtk_scale_value_width gtk_scale_get_value_width
#define gtk_window_position gtk_window_set_position
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+#include "config.h"
+
#undef G_LOG_DOMAIN
#include <stdio.h>
#include <sys/stat.h>
#include <math.h>
#include <time.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
#include "gtk.h"
#include "gdk/gdk.h"
#include "gdk/gdkkeysyms.h"
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+#include "config.h"
+
#undef G_LOG_DOMAIN
#include <stdio.h>
#include <sys/stat.h>
#include <math.h>
#include <time.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
#include "gtk.h"
#include "gdk/gdk.h"
#include "gdk/gdkkeysyms.h"