glade-cursor.h 1.66 KB
Newer Older
Jose Maria Celorio's avatar
Jose Maria Celorio committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#ifndef __GLADE_CURSOR_H__
#define __GLADE_CURSOR_H__

G_BEGIN_DECLS

/* GladeCursor is just a structures that has a pointer to all the cursors
 * that we are going to use. The benefit of this struct is that once
 * glade_cursor_init is called you just need to call glade_cursor_set
 * with it's enumed value to set the window cursor.
 */

/* Has a pointer to the loaded GdkCursors. It is loaded when _init
 * is called
 */
Tristan Van Berkom's avatar
Tristan Van Berkom committed
15
typedef struct _GladeCursor {
Jose Maria Celorio's avatar
Jose Maria Celorio committed
16
	GdkCursor *selector;
Tristan Van Berkom's avatar
Tristan Van Berkom committed
17
	GdkCursor *add_widget;        /* fallback cursor if we cannot use widget_class->cursor */ 
18 19 20 21 22 23 24 25 26
	GdkCursor *resize_top_left;
	GdkCursor *resize_top_right;
	GdkCursor *resize_bottom_left;
	GdkCursor *resize_bottom_right;
	GdkCursor *resize_left;
	GdkCursor *resize_right;
	GdkCursor *resize_top;
	GdkCursor *resize_bottom;
	GdkCursor *drag;
Tristan Van Berkom's avatar
Tristan Van Berkom committed
27 28

	GdkPixbuf *add_widget_pixbuf;   /* a pixbuf of the generic 'add' cursor */
Tristan Van Berkom's avatar
Tristan Van Berkom committed
29
} GladeCursor;
Jose Maria Celorio's avatar
Jose Maria Celorio committed
30 31 32 33 34 35 36

/* Enumed values for each of the cursors for GladeCursor. For every
 * GdkCursor above there should be a enum here
 */
typedef enum {
	GLADE_CURSOR_SELECTOR,
	GLADE_CURSOR_ADD_WIDGET,
37 38 39 40 41 42 43 44 45
	GLADE_CURSOR_RESIZE_TOP_LEFT,
	GLADE_CURSOR_RESIZE_TOP_RIGHT,
	GLADE_CURSOR_RESIZE_BOTTOM_LEFT,
	GLADE_CURSOR_RESIZE_BOTTOM_RIGHT,
	GLADE_CURSOR_RESIZE_LEFT,
	GLADE_CURSOR_RESIZE_RIGHT,
	GLADE_CURSOR_RESIZE_TOP,
	GLADE_CURSOR_RESIZE_BOTTOM,
	GLADE_CURSOR_DRAG
Jose Maria Celorio's avatar
Jose Maria Celorio committed
46 47
} GladeCursorType;

48 49 50 51
void               glade_cursor_init                  (void);
void               glade_cursor_set                   (GladeProject    *project,
						       GdkWindow       *window, 
						       GladeCursorType  type);
Tristan Van Berkom's avatar
Tristan Van Berkom committed
52
const GdkPixbuf*   glade_cursor_get_add_widget_pixbuf (void);
Jose Maria Celorio's avatar
Jose Maria Celorio committed
53 54 55 56

G_END_DECLS

#endif /* __GLADE_CURSOR_H__ */