Connected implementation for Accessibility_Magnifier_exit ()
[platform/upstream/at-spi2-core.git] / util / mag_image.h
1 #ifndef __MAGNIFIER_SPI_IMAGE_H__
2 #define __MAGNIFIER_SPI_IMAGE_H__
3 #include <stdio.h>
4 #include <unistd.h>
5 #include <sys/types.h>
6 #include <sys/socket.h>
7 #include <sys/un.h>
8 #include <errno.h>
9 #include <unistd.h>
10 #include <gtk/gtk.h>
11 #include <glib.h>
12 #include <stdlib.h>
13 #include <X11/Xlib.h>
14 #include <gdk-pixbuf/gdk-pixbuf.h>
15 #include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
16 #include <gdk/gdkx.h>
17
18 typedef struct _point {
19   int x;
20   int y;
21 } point;
22
23 typedef struct xlib_colormap_struct xlib_colormap;
24
25 struct xlib_colormap_struct {
26         int size;
27         XColor *colors;
28         Visual *visual;
29         Colormap colormap;
30 };
31
32 typedef struct {
33         GdkRectangle extents;
34         GdkRectangle roi;
35         float zoom_x;
36         float zoom_y;
37         int contrast;
38         gboolean is_managed;
39         gboolean is_dirty;
40 } ZoomRegionData;
41
42 point       center_position;
43 point       curpos; /* Position of the magnified cursor */
44 GdkPixbuf*  image;
45 GdkPixbuf*  scaled_image;
46 Window      spi_image_root_window;
47 int         screen_num;
48 int         old_factor_x;
49 int         old_factor_y;
50 xlib_colormap * x_cmap;
51
52 typedef struct _MagnifierData {
53         int mag_width;
54         int mag_height;
55         int mag_x;
56         int mag_y;
57         int factor_x;
58         int factor_y;
59         point center;
60         int follow_mouse;
61         int color_inverted;
62         int fast_rgb_convert;
63         int contrast;
64         GtkWidget *output_window;
65         void *source_display;
66         void *target_display;
67         GList *zoom_regions;
68 } MagnifierData;
69
70 #define FACTOR          1
71 #define CONTRAST        2
72 #define FOLLOW_MOUSE    3
73 #define COLOR_INVERTED  4
74 #define GOTO            5
75 #define STOP            6
76 #define SET_ROI         7
77 #define SET_EXTENTS     8
78
79 struct sockaddr_un mag_server;
80 struct sockaddr_un client_sockaddr;
81 int size_client;
82 int desc;
83 GtkWidget *drawing_area;
84
85 void parse_message(char *msg, MagnifierData *data);
86 void update_image(MagnifierData *data);
87 void expose_event(GtkWidget * w, GdkEventExpose *event, gpointer data);
88 void get_root_image(Window src,GdkPixbuf *dest,int src_x, int src_y, MagnifierData *data);
89 int display_image(gpointer data);
90
91 #endif
92