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