Added directory 'util' for accessibility-related
[platform/core/uifw/at-spi2-atk.git] / util / mag_image.h
1 #ifndef __MAGNIFIER_IMAGE_H__
2 #define __MAGNIFIER_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 point       center_position;
33 point       curpos; /* Position of the magnified cursor */
34 GdkPixbuf*  image;
35 GdkPixbuf*  scaled_image;
36 Window      image_root_window;
37 int         screen_num;
38 int         old_factor;
39 xlib_colormap * x_cmap;
40
41 typedef struct _MagnifierData {
42         int mag_width;
43         int mag_height;
44         int factor;
45         point center;
46         int follow_mouse;
47         int color_inverted;
48         int contrast;
49         GtkWidget *output_window;
50         void *source_display;
51         void *target_display;
52 } MagnifierData;
53
54 #define FACTOR          1
55 #define CONTRAST        2
56 #define FOLLOW_MOUSE    3
57 #define COLOR_INVERTED  4
58 #define GOTO            5
59 #define STOP            6
60 #define SET_ROI         7
61 #define SET_EXTENTS     8
62
63 struct sockaddr_un mag_server;
64 struct sockaddr_un client_sockaddr;
65 int size_client;
66 int desc;
67 GtkWidget *drawing_area;
68
69 void parse_message(char *msg, MagnifierData *data);
70 void update_image(MagnifierData *data);
71 void expose_event(GtkWidget * w, GdkEventExpose *event, gpointer data);
72 void get_root_image(Window src,GdkPixbuf *dest,int src_x, int src_y, MagnifierData *data);
73 int display_image(gpointer data);
74
75 #endif
76