gtk/gdk/gdkimage.h
Havoc Pennington 0bee26c7ba Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28  Havoc Pennington  <hp@pobox.com>

	* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
	image data to the screen, using a server grab to avoid race
	conditions.

	* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
	check for NULL return from gtk_image_new_from_stock(), it never
	returns NULL.
	(gtk_item_factory_create_item): fix bug where we parsed the stock
	ID as an inline pixbuf

	* gtk/gtktext.c (gtk_text_key_press): numeric keypad support

	* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
	support (should be using binding set here)

	* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
	support (should be using binding set here)

	* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
	support

	* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support

	* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad

	* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad

	* gtk/gtkimcontextsimple.c
	(gtk_im_context_simple_filter_keypress): keypad

	* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad

	* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes

	* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support

	* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
	should be binding-setted)

	* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes

	* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes

	* gtk/gtkcalendar.c: numeric keypad fixes

	* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
	support

	* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
	screwup

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
	clip the render area to the drawable's clip region in advance,
	so we don't get data from the server that we don't need.

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
	check return value of gdk_pixbuf_get_from_drawable(), fall back
	to bilevel alpha if we can't get the pixbuf to composite against.

	* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap

	* gdk/gdkimage.c (gdk_image_get_colormap): add
	gdk_image_set_colormap, gdk_image_get_colormap

	* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
	take a region of the image, instead of converting the entire
	image.

	* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
	keybinding signal. Add default bindings for it. Add default
	handler for show_help that shows the tooltip for the widget.

	* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
	"close" keybinding signal, remove key press handler.

	* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
	it's not our usual practice to leave a deprecated function around
	with a runtime warning, plus we don't want it to appear in docs,
	plus if we make them yellow no one will want to change them
	anyhow.
2001-06-29 01:59:02 +00:00

103 lines
2.9 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.
*/
typedef enum
{
GDK_IMAGE_NORMAL,
GDK_IMAGE_SHARED,
GDK_IMAGE_FASTEST
} GdkImageType;
typedef struct _GdkImageClass GdkImageClass;
#define GDK_TYPE_IMAGE (gdk_image_get_type ())
#define GDK_IMAGE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_IMAGE, GdkImage))
#define GDK_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_IMAGE, GdkImageClass))
#define GDK_IS_IMAGE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_IMAGE))
#define GDK_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_IMAGE))
#define GDK_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_IMAGE, GdkImageClass))
struct _GdkImage
{
GObject parent_instance;
GdkImageType type;
GdkVisual *visual; /* visual used to create the image */
GdkByteOrder byte_order;
gint width;
gint height;
guint16 depth;
guint16 bpp; /* bytes per pixel */
guint16 bpl; /* bytes per line */
guint16 bits_per_pixel; /* bits per pixel */
gpointer mem;
GdkColormap *colormap;
gpointer windowing_data;
};
struct _GdkImageClass
{
GObjectClass parent_class;
};
GType gdk_image_get_type (void) G_GNUC_CONST;
GdkImage* gdk_image_new (GdkImageType type,
GdkVisual *visual,
gint width,
gint height);
GdkImage* gdk_image_get (GdkDrawable *drawable,
gint x,
gint y,
gint width,
gint height);
GdkImage * gdk_image_ref (GdkImage *image);
void gdk_image_unref (GdkImage *image);
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_set_colormap (GdkImage *image,
GdkColormap *colormap);
GdkColormap* gdk_image_get_colormap (GdkImage *image);
#ifdef GDK_ENABLE_BROKEN
GdkImage* gdk_image_new_bitmap (GdkVisual *visual,
gpointer data,
gint width,
gint height);
#endif /* GDK_ENABLE_BROKEN */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_IMAGE_H__ */