1
/* Copyright 2006, 2007, 2008, Soren Sandmann <sandmann@daimi.au.dk>
3
* This library is free software; you can redistribute it and/or
4
* modify it under the terms of the GNU Lesser General Public
5
* License as published by the Free Software Foundation; either
6
* version 2 of the License, or (at your option) any later version.
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public
14
* License along with this library; if not, write to the
15
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16
* Boston, MA 02111-1307, USA.
21
#define FOO_TYPE_SCROLL_AREA (foo_scroll_area_get_type ())
22
#define FOO_SCROLL_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_SCROLL_AREA, FooScrollArea))
23
#define FOO_SCROLL_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_SCROLL_AREA, FooScrollAreaClass))
24
#define FOO_IS_SCROLL_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_SCROLL_AREA))
25
#define FOO_IS_SCROLL_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_SCROLL_AREA))
26
#define FOO_SCROLL_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_TYPE_SCROLL_AREA, FooScrollAreaClass))
28
typedef struct FooScrollArea FooScrollArea;
29
typedef struct FooScrollAreaClass FooScrollAreaClass;
30
typedef struct FooScrollAreaPrivate FooScrollAreaPrivate;
31
typedef struct FooScrollAreaEvent FooScrollAreaEvent;
40
} FooScrollAreaEventType;
42
struct FooScrollAreaEvent
44
FooScrollAreaEventType type;
49
typedef void (* FooScrollAreaEventFunc) (FooScrollArea *area,
50
FooScrollAreaEvent *event,
55
GtkContainer parent_instance;
57
FooScrollAreaPrivate *priv;
60
struct FooScrollAreaClass
62
GtkContainerClass parent_class;
64
void (*set_scroll_adjustments) (FooScrollArea *scroll_area,
65
GtkAdjustment *hadjustment,
66
GtkAdjustment *vadjustment);
68
void (*viewport_changed) (FooScrollArea *scroll_area,
69
GdkRectangle *old_viewport,
70
GdkRectangle *new_viewport);
72
void (*paint) (FooScrollArea *scroll_area,
74
GdkRectangle *extents,
75
cairo_region_t *region);
78
GType foo_scroll_area_get_type (void);
80
FooScrollArea *foo_scroll_area_new (void);
82
/* Set the requisition for the widget. */
83
void foo_scroll_area_set_min_size (FooScrollArea *scroll_area,
87
/* Set how much of the canvas can be scrolled into view */
88
void foo_scroll_area_set_size (FooScrollArea *scroll_area,
91
void foo_scroll_area_set_size_fixed_y (FooScrollArea *scroll_area,
96
void foo_scroll_area_set_viewport_pos (FooScrollArea *scroll_area,
99
void foo_scroll_area_get_viewport (FooScrollArea *scroll_area,
100
GdkRectangle *viewport);
101
void foo_scroll_area_add_input_from_stroke (FooScrollArea *scroll_area,
103
FooScrollAreaEventFunc func,
105
void foo_scroll_area_add_input_from_fill (FooScrollArea *scroll_area,
107
FooScrollAreaEventFunc func,
109
void foo_scroll_area_invalidate_region (FooScrollArea *area,
110
cairo_region_t *region);
111
void foo_scroll_area_invalidate (FooScrollArea *scroll_area);
112
void foo_scroll_area_invalidate_rect (FooScrollArea *scroll_area,
117
void foo_scroll_area_begin_grab (FooScrollArea *scroll_area,
118
FooScrollAreaEventFunc func,
119
gpointer input_data);
120
void foo_scroll_area_end_grab (FooScrollArea *scroll_area,
121
FooScrollAreaEvent *event);
122
gboolean foo_scroll_area_is_grabbed (FooScrollArea *scroll_area);
124
void foo_scroll_area_begin_auto_scroll (FooScrollArea *scroll_area);
125
void foo_scroll_area_auto_scroll (FooScrollArea *scroll_area,
126
FooScrollAreaEvent *event);
127
void foo_scroll_area_end_auto_scroll (FooScrollArea *scroll_area);