1 /* 2 * This program is free software; you can redistribute it and/or modify it 3 * under the terms of the GNU Lesser General Public License as published by 4 * the Free Software Foundation. 5 * 6 * This program is distributed in the hope that it will be useful, but 7 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 8 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 9 * for more details. 10 * 11 * You should have received a copy of the GNU Lesser General Public License 12 * along with this program; if not, see <http://www.gnu.org/licenses/>. 13 * 14 * 15 * Authors: 16 * Chris Lahey <clahey@ximian.com> 17 * 18 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) 19 * 20 */ 21 22 #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) 23 #error "Only <e-util/e-util.h> should be included directly." 24 #endif 25 26 #ifndef E_CANVAS_VBOX_H 27 #define E_CANVAS_VBOX_H 28 29 #include <gtk/gtk.h> 30 #include <libgnomecanvas/gnome-canvas.h> 31 32 /* Standard GObject macros */ 33 #define E_TYPE_CANVAS_VBOX \ 34 (e_canvas_vbox_get_type ()) 35 #define E_CANVAS_VBOX(obj) \ 36 (G_TYPE_CHECK_INSTANCE_CAST \ 37 ((obj), E_TYPE_CANVAS_VBOX, ECanvasVbox)) 38 #define E_CANVAS_VBOX_CLASS(cls) \ 39 (G_TYPE_CHECK_CLASS_CAST \ 40 ((cls), E_TYPE_CANVAS_VBOX, ECanvasVboxClass)) 41 #define E_IS_CANVAS_VBOX(obj) \ 42 (G_TYPE_CHECK_INSTANCE_TYPE \ 43 ((obj), E_TYPE_CANVAS_VBOX)) 44 #define E_IS_CANVAS_VBOX_CLASS(cls) \ 45 (G_TYPE_CHECK_CLASS_TYPE \ 46 ((cls), E_TYPE_CANVAS_VBOX)) 47 #define E_CANVAS_VBOX_GET_CLASS(obj) \ 48 (G_TYPE_INSTANCE_GET_CLASS \ 49 ((obj), E_TYPE_CANVAS_VBOX, ECanvasVboxClass)) 50 51 G_BEGIN_DECLS 52 53 typedef struct _ECanvasVbox ECanvasVbox; 54 typedef struct _ECanvasVboxClass ECanvasVboxClass; 55 56 struct _ECanvasVbox { 57 GnomeCanvasGroup parent; 58 59 /* item specific fields */ 60 GList *items; /* Of type GnomeCanvasItem */ 61 62 gdouble width; 63 gdouble minimum_width; 64 gdouble height; 65 gdouble spacing; 66 }; 67 68 struct _ECanvasVboxClass { 69 GnomeCanvasGroupClass parent_class; 70 71 void (*add_item) (ECanvasVbox *canvas_vbox, 72 GnomeCanvasItem *item); 73 void (*add_item_start) (ECanvasVbox *canvas_vbox, 74 GnomeCanvasItem *item); 75 }; 76 77 /* 78 * To be added to a CanvasVbox, an item must have the argument "width" as 79 * a Read/Write argument and "height" as a Read Only argument. It 80 * should also do an ECanvas parent CanvasVbox request if its size 81 * changes. 82 */ 83 GType e_canvas_vbox_get_type (void) G_GNUC_CONST; 84 void e_canvas_vbox_add_item (ECanvasVbox *canvas_vbox, 85 GnomeCanvasItem *item); 86 void e_canvas_vbox_add_item_start (ECanvasVbox *canvas_vbox, 87 GnomeCanvasItem *item); 88 89 G_END_DECLS 90 91 #endif /* E_CANVAS_VBOX_H */ 92