/* * ez-gtk.h : boite a outil EZ-Draw-GTK pour simplifier GTK+ * * Edouard.Thiel@lif.univ-mrs.fr - 23/03/2010 - version 0.9 * * This program is free software under the terms of the * GNU Lesser General Public License (LGPL) version 2.1. */ #ifndef EZ_DRAW_GTK__H #define EZ_DRAW_GTK__H #include #include #include #include #include #include #include #if defined _WIN32 #include #define GDK_WINDOW_XWINDOW GDK_WINDOW_HWND #elif defined __APPLE__ #define GDK_WINDOW_XWINDOW(x) ((int)x) /* a ameliorer */ #else #include #endif /* Couleurs */ typedef enum { EZG_BLACK, EZG_WHITE, EZG_GREY, EZG_RED, EZG_GREEN, EZG_BLUE, EZG_YELLOW, EZG_CYAN, EZG_MAGENTA } Ezg_color; /* Alignement du texte */ typedef enum { EZG_AA = 183200, EZG_TL, EZG_TC, EZG_TR, /* Top Left, Top Center, Top Right */ EZG_ML, EZG_MC, EZG_MR, /* Middle Left, Middle Center, Middle Right */ EZG_BL, EZG_BC, EZG_BR, /* Bottom Left, Bottom Center, Bottom Right */ EZG_BB } Ezg_align; #define EZG_FONT_MAX 4 /* Fonctions publiques */ GtkWidget *ezg_window_create (int width, int height, const char *titre); GtkWidget *ezg_area_create (GtkWidget *win); void ezg_area_clear (GtkWidget *area); void ezg_area_expose (GtkWidget *area); GdkGC *ezg_get_gc (GtkWidget *widget); void ezg_set_color (GdkGC *gc, Ezg_color color); void ezg_set_thick (GdkGC *gc, int thick); void ezg_draw_triangle (GdkDrawable *drawable, GdkGC *gc, gboolean filled, int x0, int y0, int x1, int y1, int x2, int y2); void ezg_draw_text (GtkWidget *widget, GdkGC *gc, PangoLayout *layout, Ezg_align align, int x, int y, const char *format, ...); void ezg_set_font_name (PangoLayout *layout, char const *desc); void ezg_set_font_size (PangoLayout *layout, int size); void ezg_set_nfont (PangoLayout *layout, int num); int ezg_random (int n); /* Fonctions privees */ #endif /* EZ_DRAW_GTK__H */