project-wizard: bgo#642723 - Small in C header template
[anjuta.git] / libfoocanvas / foo-canvas-widget.h
blob09612ee275e1cc75613b4ff130b1a5774677e32c
1 /*
2 * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
3 * All rights reserved.
5 * This file is part of the Gnome Library.
7 * The Gnome Library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
12 * The Gnome Library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with the Gnome Library; see the file COPYING.LIB. If not,
19 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 @NOTATION@
25 /* Widget item type for FooCanvas widget
27 * FooCanvas is basically a port of the Tk toolkit's most excellent canvas widget. Tk is
28 * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties.
31 * Author: Federico Mena <federico@nuclecu.unam.mx>
34 #ifndef FOO_CANVAS_WIDGET_H
35 #define FOO_CANVAS_WIDGET_H
38 #include <libfoocanvas/foo-canvas.h>
41 G_BEGIN_DECLS
44 /* Widget item for canvas. The widget is positioned with respect to an anchor point.
45 * The following object arguments are available:
47 * name type read/write description
48 * ------------------------------------------------------------------------------------------
49 * widget GtkWidget* RW Pointer to the widget
50 * x double RW X coordinate of anchor point
51 * y double RW Y coordinate of anchor point
52 * width double RW Width of widget (see below)
53 * height double RW Height of widget (see below)
54 * anchor GtkAnchorType RW Anchor side for widget
55 * size_pixels boolean RW Specifies whether the widget size
56 * is specified in pixels or canvas units.
57 * If it is in pixels, then the widget will not
58 * be scaled when the canvas zoom factor changes.
59 * Otherwise, it will be scaled.
63 #define FOO_TYPE_CANVAS_WIDGET (foo_canvas_widget_get_type ())
64 #define FOO_CANVAS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_CANVAS_WIDGET, FooCanvasWidget))
65 #define FOO_CANVAS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_CANVAS_WIDGET, FooCanvasWidgetClass))
66 #define FOO_IS_CANVAS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_CANVAS_WIDGET))
67 #define FOO_IS_CANVAS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_CANVAS_WIDGET))
68 #define FOO_CANVAS_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_TYPE_CANVAS_WIDGET, FooCanvasWidgetClass))
71 typedef struct _FooCanvasWidget FooCanvasWidget;
72 typedef struct _FooCanvasWidgetClass FooCanvasWidgetClass;
74 struct _FooCanvasWidget {
75 FooCanvasItem item;
77 GtkWidget *widget; /* The child widget */
79 double x, y; /* Position at anchor */
80 double width, height; /* Dimensions of widget */
81 GtkAnchorType anchor; /* Anchor side for widget */
83 int cx, cy; /* Top-left canvas coordinates for widget */
84 int cwidth, cheight; /* Size of widget in pixels */
86 guint destroy_id; /* Signal connection id for destruction of child widget */
88 guint size_pixels : 1; /* Is size specified in (unchanging) pixels or units (get scaled)? */
89 guint in_destroy : 1; /* Is child widget being destroyed? */
92 struct _FooCanvasWidgetClass {
93 FooCanvasItemClass parent_class;
97 /* Standard Gtk function */
98 GType foo_canvas_widget_get_type (void) G_GNUC_CONST;
101 G_END_DECLS
103 #endif