summaryrefslogtreecommitdiff
path: root/magnifier/zoom-region.h
blob: ef22889248d944914f62fc8c00c1e4dc2eb2a933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
 * AT-SPI - Assistive Technology Service Provider Interface
 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
 *
 * Copyright 2001 Sun Microsystems Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef ZOOM_REGION_H_
#define ZOOM_REGION_H_


#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <bonobo/bonobo-object.h>
#include "GNOME_Magnifier.h"

#define ZOOM_REGION_TYPE         (zoom_region_get_type ())
#define ZOOM_REGION(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), ZOOM_REGION_TYPE, ZoomRegion))
#define ZOOM_REGION_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), ZOOM_REGION_TYPE, ZoomRegionClass))
#define IS_ZOOM_REGION(o)        (G_TYPE_CHECK__INSTANCE_TYPE ((o), ZOOM_REGION_TYPE))
#define IS_ZOOM_REGION_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), ZOOM_REGION_TYPE))
#define ZOOM_REGION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ZOOM_REGION_TYPE, ZoomRegionClass))

typedef GList * (*CoalesceFunc)(GList *, int);

typedef struct _ZoomRegionPrivate ZoomRegionPrivate;

typedef struct {
        BonoboObject parent;
	BonoboPropertyBag *properties;
	gboolean invert;
	gboolean is_managed;
	gboolean draw_cursor;
	gboolean cache_source;
	gchar *smoothing;
	gchar *object_path;
	gfloat contrast;
	gfloat xscale;
	gfloat yscale;
	gfloat contrast_r;
	gfloat contrast_g;
	gfloat contrast_b;
	gfloat bright_r;
	gfloat bright_g;
	gfloat bright_b;
	gint border_size_top;
	gint border_size_left;
	gint border_size_right;
	gint border_size_bottom;
	guint32 border_color; /* A-RGB, 8 bits each, MSB==alpha */
	gint x_align_policy;  /* TODO: enums here */
	gint y_align_policy;
	GNOME_Magnifier_ZoomRegion_ScrollingPolicy smooth_scroll_policy;
	GNOME_Magnifier_ZoomRegion_ColorBlindFilter color_blind_filter;
        /* bounds of viewport, in target magnifier window coords */
	GNOME_Magnifier_RectBounds roi;
	GNOME_Magnifier_RectBounds viewport; 
	ZoomRegionPrivate *priv;
	CoalesceFunc coalesce_func;
	gint timing_iterations;
	gboolean timing_output;
	gint timing_pan_rate;
	gboolean exit_magnifier;
        gboolean poll_mouse;
#ifdef ZOOM_REGION_DEBUG
        gboolean alive;
#endif
} ZoomRegion;

typedef struct {
        BonoboObjectClass                    parent_class;
        POA_GNOME_Magnifier_ZoomRegion__epv  epv;
        DBusGConnection                     *connection;
} ZoomRegionClass;

GType     zoom_region_get_type (void);
ZoomRegion *zoom_region_new     (void);

/* D-BUS methods */
gboolean impl_dbus_zoom_region_set_mag_factor (ZoomRegion *zoom_region, const float mag_factor_x,
		const float mag_factor_y);
gboolean impl_dbus_zoom_region_get_mag_factor (ZoomRegion *zoom_region);
gboolean impl_dbus_zoom_region_set_roi (ZoomRegion *zoom_region, const gint32 **roi);
gboolean impl_dbus_zoom_region_update_pointer (ZoomRegion *zoom_region);
gboolean impl_dbus_zoom_region_mark_dirty (ZoomRegion *zoom_region);
gboolean impl_dbus_zoom_region_get_roi (ZoomRegion *zoom_region);
gboolean impl_dbus_zoom_region_move_resize (ZoomRegion *zoom_region, const gint32 **viewport);
gboolean impl_dbus_zoom_region_dispose (ZoomRegion *zoom_region);
gboolean impl_dbus_zoom_region_set_pointer_pos (ZoomRegion *zoom_region);
gboolean impl_dbus_zoom_region_set_contrast (ZoomRegion *zoom_region);
gboolean impl_dbus_zoom_region_get_contrast (ZoomRegion *zoom_region);
gboolean impl_dbus_zoom_region_set_brightness (ZoomRegion *zoom_region);
gboolean impl_dbus_zoom_region_get_brightness (ZoomRegion *zoom_region);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* ZOOM_REGION_H_ */