6ca08b72d824c4bdaabc56720cedd4dc22a17e46
[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 mag_x;
46         int mag_y;
47         int factor_x;
48         int factor_y;
49         point center;
50         int follow_mouse;
51         int color_inverted;
52         int fast_rgb_convert;
53         int contrast;
54         GtkWidget *output_window;
55         void *source_display;
56         void *target_display;
57 } MagnifierData;
58
59 #define FACTOR          1
60 #define CONTRAST        2
61 #define FOLLOW_MOUSE    3
62 #define COLOR_INVERTED  4
63 #define GOTO            5
64 #define STOP            6
65 #define SET_ROI         7
66 #define SET_EXTENTS     8
67
68 struct sockaddr_un mag_server;
69 struct sockaddr_un client_sockaddr;
70 int size_client;
71 int desc;
72 GtkWidget *drawing_area;
73
74 void parse_message(char *msg, MagnifierData *data);
75 void update_image(MagnifierData *data);
76 void expose_event(GtkWidget * w, GdkEventExpose *event, gpointer data);
77 void get_root_image(Window src,GdkPixbuf *dest,int src_x, int src_y, MagnifierData *data);
78 int display_image(gpointer data);
79
80 #endif
81