Drawings

Name

Drawings -- Multiple representation facility.

Synopsis


struct      drawing_style_t;
enum        drawing_flags_t;
GtkWidget*  create_drawing                  (void);
void        register_drawing_style          (GtkWidget *drawing,
                                             drawing_style_t *style);
void        update_drawing                  (GtkWidget *drawing);

Description

This allow easy impletentation of multiple representations for the same subsystem.

Details

struct drawing_style_t

typedef struct {				/* descrives a drawing style */
	GtkWidget *widget;			/* widget to be shown */
	gchar *name;				/* name for this style */
	void (*update)(GtkWidget *widget);	/* function to update the
						   style */
	drawing_flags_t flags;			/* one of drawing_flags_t */
} drawing_style_t;


enum drawing_flags_t

typedef enum {
	DRAWING_FIXED_SIZE=1,		/* the widget will not change it's
					   size scrollbars should be used */
	DRAWING_FIXED_RATIO=1<<1	/* the widget will change it's size
					   if needed but wants to keep it's
					   width/height ratio */
} drawing_flags_t;


create_drawing ()

GtkWidget*  create_drawing                  (void);

Creates a widget capable of containing multiple representations for a certain subsystem.

Returns : a widget ready to be handled with the apropiate GTK+ functions.


register_drawing_style ()

void        register_drawing_style          (GtkWidget *drawing,
                                             drawing_style_t *style);

Adds style to drawing.

drawing : a widget returned by create_drawing.
style : the structure descriving a drawing style.


update_drawing ()

void        update_drawing                  (GtkWidget *drawing);

Updates the styles (representations) in a "drawing".

drawing : a widget returned by create_drawing.