mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
c50941c82d
1999-10-03 Tor Lillqvist <tml@iki.fi> * gdk/gdkimage.h gdk/gdkpixmap.h: Change GDK_WINDOWING_WIN32 usage to #ifdef also here. * gdk/win32/*.h gdk/win32/*.c: Make corresponding changes as those Owen did to the X11 backend. * gdk/win32/gdkdraw.c (gdk_draw_pixmap): Fix it again, don't use ScrollWindowEx when blitting inside a window, it can't be correct in the general case. * gdk/win32/gdkevents.c: Don't handle WM_SIZING, handling WM_GETMINMAXINFO is easier. * gdk/win32/gdkimage.c (gdk_image_new): Create new image with depth equal to the bitspixel value, not the visual's depth. * gdk/win32/gdkvisual.c (gdk_visual_init): Set the visual's depth to 24 even if the bitspixel value is 32. * gdk/gdkrgb.c (gdk_rgb_select_conv): After the above change, no need to check for depth==32 when bpp==32, depth will always be 24.
80 lines
2.1 KiB
C
80 lines
2.1 KiB
C
#ifndef __GDK_IMAGE_H__
|
|
#define __GDK_IMAGE_H__
|
|
|
|
#include <gdk/gdktypes.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
/* Types of images.
|
|
* Normal: Normal X image type. These are slow as they involve passing
|
|
* the entire image through the X connection each time a draw
|
|
* request is required. On Win32, a bitmap.
|
|
* Shared: Shared memory X image type. These are fast as the X server
|
|
* and the program actually use the same piece of memory. They
|
|
* should be used with care though as there is the possibility
|
|
* for both the X server and the program to be reading/writing
|
|
* the image simultaneously and producing undesired results.
|
|
* On Win32, also a bitmap.
|
|
* Shared Pixmap: Also a shared memory image, which also has a
|
|
* pixmap using the same memory. Used by gdk_imlib with the
|
|
* Win32 backend.
|
|
*/
|
|
typedef enum
|
|
{
|
|
GDK_IMAGE_NORMAL,
|
|
GDK_IMAGE_SHARED,
|
|
GDK_IMAGE_FASTEST,
|
|
GDK_IMAGE_SHARED_PIXMAP
|
|
} GdkImageType;
|
|
|
|
struct _GdkImage
|
|
{
|
|
GdkImageType type;
|
|
GdkVisual *visual; /* visual used to create the image */
|
|
GdkByteOrder byte_order;
|
|
guint16 width;
|
|
guint16 height;
|
|
guint16 depth;
|
|
guint16 bpp; /* bytes per pixel */
|
|
guint16 bpl; /* bytes per line */
|
|
gpointer mem;
|
|
};
|
|
|
|
|
|
GdkImage* gdk_image_new_bitmap(GdkVisual *visual,
|
|
gpointer data,
|
|
gint width,
|
|
gint height);
|
|
GdkImage* gdk_image_new (GdkImageType type,
|
|
GdkVisual *visual,
|
|
gint width,
|
|
gint height);
|
|
#ifdef GDK_WINDOWING_WIN32
|
|
GdkImage* gdk_image_bitmap_new(GdkImageType type,
|
|
GdkVisual *visual,
|
|
gint width,
|
|
gint height);
|
|
#endif
|
|
GdkImage* gdk_image_get (GdkDrawable *drawable,
|
|
gint x,
|
|
gint y,
|
|
gint width,
|
|
gint height);
|
|
void gdk_image_put_pixel (GdkImage *image,
|
|
gint x,
|
|
gint y,
|
|
guint32 pixel);
|
|
guint32 gdk_image_get_pixel (GdkImage *image,
|
|
gint x,
|
|
gint y);
|
|
void gdk_image_destroy (GdkImage *image);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* __GDK_IMAGE_H__ */
|