API: remove GdkGC
XXX: Some traces in the win32 code are left. I suppose they'd best be replaced using Cairo.
This commit is contained in:
@ -40,7 +40,6 @@ libgdk_win32_la_SOURCES = \
|
||||
gdkdrawable-win32.c \
|
||||
gdkdrawable-win32.h \
|
||||
gdkevents-win32.c \
|
||||
gdkgc-win32.c \
|
||||
gdkgeometry-win32.c \
|
||||
gdkglobals-win32.c \
|
||||
gdkim-win32.c \
|
||||
|
||||
@ -317,93 +317,6 @@ render_line_vertical (GdkGCWin32 *gcwin32,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
draw_tiles_lowlevel (HDC dest,
|
||||
HDC tile,
|
||||
int rop3,
|
||||
gint dest_x,
|
||||
gint dest_y,
|
||||
gint tile_x_origin,
|
||||
gint tile_y_origin,
|
||||
gint width,
|
||||
gint height,
|
||||
gint tile_width,
|
||||
gint tile_height)
|
||||
{
|
||||
gint x, y;
|
||||
|
||||
GDK_NOTE (DRAW, g_print ("draw_tiles_lowlevel: %p %+d%+d tile=%p:%dx%d@%+d%+d %dx%d\n",
|
||||
dest,
|
||||
dest_x, dest_y,
|
||||
tile, tile_width, tile_height,
|
||||
tile_x_origin, tile_y_origin,
|
||||
width, height));
|
||||
|
||||
y = tile_y_origin % tile_height;
|
||||
if (y > 0)
|
||||
y -= tile_height;
|
||||
while (y < dest_y + height)
|
||||
{
|
||||
if (y + tile_height >= dest_y)
|
||||
{
|
||||
x = tile_x_origin % tile_width;
|
||||
if (x > 0)
|
||||
x -= tile_width;
|
||||
while (x < dest_x + width)
|
||||
{
|
||||
if (x + tile_width >= dest_x)
|
||||
{
|
||||
gint src_x = MAX (0, dest_x - x);
|
||||
gint src_y = MAX (0, dest_y - y);
|
||||
|
||||
if (!GDI_CALL (BitBlt, (dest, x + src_x, y + src_y,
|
||||
MIN (tile_width, dest_x + width - (x + src_x)),
|
||||
MIN (tile_height, dest_y + height - (y + src_y)),
|
||||
tile,
|
||||
src_x, src_y,
|
||||
rop3)))
|
||||
return;
|
||||
}
|
||||
x += tile_width;
|
||||
}
|
||||
}
|
||||
y += tile_height;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
draw_tiles (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
int rop3,
|
||||
GdkPixmap *tile,
|
||||
gint dest_x,
|
||||
gint dest_y,
|
||||
gint tile_x_origin,
|
||||
gint tile_y_origin,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
const GdkGCValuesMask mask = GDK_GC_FOREGROUND;
|
||||
gint tile_width, tile_height;
|
||||
GdkGC *gc_copy;
|
||||
HDC dest_hdc, tile_hdc;
|
||||
|
||||
gc_copy = gdk_gc_new (tile);
|
||||
gdk_gc_copy (gc_copy, gc);
|
||||
dest_hdc = gdk_win32_hdc_get (drawable, gc, mask);
|
||||
tile_hdc = gdk_win32_hdc_get (tile, gc_copy, mask);
|
||||
|
||||
gdk_drawable_get_size (tile, &tile_width, &tile_height);
|
||||
|
||||
draw_tiles_lowlevel (dest_hdc, tile_hdc, rop3,
|
||||
dest_x, dest_y, tile_x_origin, tile_y_origin,
|
||||
width, height, tile_width, tile_height);
|
||||
|
||||
gdk_win32_hdc_release (drawable, gc, mask);
|
||||
gdk_win32_hdc_release (tile, gc_copy, mask);
|
||||
g_object_unref (gc_copy);
|
||||
}
|
||||
|
||||
static cairo_region_t *
|
||||
widen_bounds (GdkRectangle *bounds,
|
||||
gint pen_width)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -105,13 +105,6 @@
|
||||
#define GDK_DEBUG_MISC_OR_COLORMAP (GDK_DEBUG_MISC|GDK_DEBUG_COLORMAP)
|
||||
#define GDK_DEBUG_MISC_OR_EVENTS (GDK_DEBUG_MISC|GDK_DEBUG_EVENTS)
|
||||
|
||||
#define GDK_TYPE_GC_WIN32 (_gdk_gc_win32_get_type ())
|
||||
#define GDK_GC_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_WIN32, GdkGCWin32))
|
||||
#define GDK_GC_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC_WIN32, GdkGCWin32Class))
|
||||
#define GDK_IS_GC_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_WIN32))
|
||||
#define GDK_IS_GC_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC_WIN32))
|
||||
#define GDK_GC_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC_WIN32, GdkGCWin32Class))
|
||||
|
||||
//#define GDK_WINDOW_SCREEN(win) (_gdk_screen)
|
||||
GdkScreen *GDK_WINDOW_SCREEN(GObject *win);
|
||||
|
||||
@ -120,8 +113,6 @@ GdkScreen *GDK_WINDOW_SCREEN(GObject *win);
|
||||
typedef struct _GdkColormapPrivateWin32 GdkColormapPrivateWin32;
|
||||
typedef struct _GdkCursorPrivate GdkCursorPrivate;
|
||||
typedef struct _GdkWin32SingleFont GdkWin32SingleFont;
|
||||
typedef struct _GdkGCWin32 GdkGCWin32;
|
||||
typedef struct _GdkGCWin32Class GdkGCWin32Class;
|
||||
|
||||
struct _GdkCursorPrivate
|
||||
{
|
||||
@ -159,48 +150,6 @@ struct _GdkColormapPrivateWin32
|
||||
GdkColorInfo *info;
|
||||
};
|
||||
|
||||
struct _GdkGCWin32
|
||||
{
|
||||
GdkGC parent_instance;
|
||||
|
||||
/* A Windows Device Context (DC) is not equivalent to an X11
|
||||
* GC. We can use a DC only in the window for which it was
|
||||
* allocated, or (in the case of a memory DC) with the bitmap that
|
||||
* has been selected into it. Thus, we have to release and
|
||||
* reallocate a DC each time the GdkGC is used to paint into a new
|
||||
* window or pixmap. We thus keep all the necessary values in the
|
||||
* GdkGCWin32 object.
|
||||
*/
|
||||
|
||||
HRGN hcliprgn;
|
||||
|
||||
GdkGCValuesMask values_mask;
|
||||
|
||||
gint rop2;
|
||||
GdkSubwindowMode subwindow_mode;
|
||||
gint graphics_exposures;
|
||||
gint pen_width;
|
||||
DWORD pen_style;
|
||||
GdkLineStyle line_style;
|
||||
GdkCapStyle cap_style;
|
||||
GdkJoinStyle join_style;
|
||||
DWORD *pen_dashes; /* use for PS_USERSTYLE or step-by-step rendering */
|
||||
gint pen_num_dashes;
|
||||
gint pen_dash_offset;
|
||||
HBRUSH pen_hbrbg;
|
||||
|
||||
/* Following fields are valid while the GC exists as a Windows DC */
|
||||
HDC hdc;
|
||||
int saved_dc;
|
||||
|
||||
HPALETTE holdpal;
|
||||
};
|
||||
|
||||
struct _GdkGCWin32Class
|
||||
{
|
||||
GdkGCClass parent_class;
|
||||
};
|
||||
|
||||
GType _gdk_gc_win32_get_type (void);
|
||||
|
||||
gulong _gdk_win32_get_next_tick (gulong suggested_tick);
|
||||
@ -232,10 +181,6 @@ void gdk_win32_handle_table_insert (HANDLE *handle,
|
||||
gpointer data);
|
||||
void gdk_win32_handle_table_remove (HANDLE handle);
|
||||
|
||||
GdkGC *_gdk_win32_gc_new (GdkDrawable *drawable,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask);
|
||||
|
||||
void _gdk_win32_blit (gboolean use_fg_bg,
|
||||
GdkDrawableImplWin32 *drawable,
|
||||
GdkGC *gc,
|
||||
|
||||
Reference in New Issue
Block a user