1 #ifndef _ECORE_EVAS_EXTN_ENGINE_H_ 2 #define _ECORE_EVAS_EXTN_ENGINE_H_ 3 4 #ifdef HAVE_CONFIG_H 5 # include <config.h> 6 #endif 7 #ifdef STDC_HEADERS 8 # include <stdlib.h> 9 # include <stddef.h> 10 #else 11 # ifdef HAVE_STDLIB_H 12 # include <stdlib.h> 13 # endif 14 #endif 15 #include <stdio.h> 16 #include <sys/types.h> 17 #include <unistd.h> 18 #include <math.h> 19 #include <time.h> 20 21 #ifdef _WIN32 22 # include <evil_private.h> /* mmap */ 23 #else 24 # include <sys/mman.h> 25 #endif 26 27 #include <sys/stat.h> 28 #include <fcntl.h> 29 #include <string.h> 30 #include <sys/file.h> 31 #include <unistd.h> 32 #include <Evas.h> 33 #include <Evas_Engine_Buffer.h> 34 #include <Ecore.h> 35 #include <Ecore_Evas.h> 36 #include <Ecore_Input.h> 37 #include <Ecore_Ipc.h> 38 39 #include "ecore_private.h" // FIXME: Because of ECORE_MAGIC 40 #include "ecore_evas_private.h" 41 #include "ecore_evas_buffer.h" 42 #include "ecore_evas_extn.h" 43 44 typedef struct _Extnbuf Extnbuf; 45 46 Extnbuf *_extnbuf_new(const char *base, int id, Eina_Bool sys, int num, 47 int w, int h, Eina_Bool owner); 48 void _extnbuf_free(Extnbuf *b); 49 void *_extnbuf_data_get(Extnbuf *b, int *w, int *h, int *stride); 50 void *_extnbuf_lock(Extnbuf *b, int *w, int *h, int *stride); 51 void _extnbuf_unlock(Extnbuf *b); 52 const char *_extnbuf_lock_file_get(const Extnbuf *b); 53 Eina_Bool _extnbuf_lock_file_set(Extnbuf *b, const char *file); 54 Eina_Bool _extnbuf_lock_get(const Extnbuf *b); 55 56 // procotol version - change this as needed 57 #define MAJOR 0x2011 58 59 enum // opcodes 60 { 61 OP_RESIZE, 62 OP_SHOW, 63 OP_HIDE, 64 OP_FOCUS, 65 OP_UNFOCUS, 66 OP_UPDATE, 67 OP_UPDATE_DONE, 68 OP_SHM_REF0, 69 OP_SHM_REF1, 70 OP_SHM_REF2, 71 OP_PROFILE_CHANGE_REQUEST, 72 OP_PROFILE_CHANGE_DONE, 73 OP_EV_MOUSE_IN, 74 OP_EV_MOUSE_OUT, 75 OP_EV_MOUSE_UP, 76 OP_EV_MOUSE_DOWN, 77 OP_EV_MOUSE_MOVE, 78 OP_EV_MOUSE_WHEEL, 79 OP_EV_MULTI_UP, 80 OP_EV_MULTI_DOWN, 81 OP_EV_MULTI_MOVE, 82 OP_EV_KEY_UP, 83 OP_EV_KEY_DOWN, 84 OP_EV_HOLD, 85 OP_MSG_PARENT, 86 OP_MSG 87 }; 88 89 enum 90 { 91 MOD_SHIFT = (1 << 0), 92 MOD_CTRL = (1 << 1), 93 MOD_ALT = (1 << 2), 94 MOD_META = (1 << 3), 95 MOD_HYPER = (1 << 4), 96 MOD_SUPER = (1 << 5), 97 MOD_CAPS = (1 << 6), 98 MOD_NUM = (1 << 7), 99 MOD_SCROLL = (1 << 8), 100 }; 101 102 typedef struct _Ipc_Data_Resize Ipc_Data_Resize; 103 typedef struct _Ipc_Data_Update Ipc_Data_Update; 104 typedef struct _Ipc_Data_Ev_Mouse_In Ipc_Data_Ev_Mouse_In; 105 typedef struct _Ipc_Data_Ev_Mouse_Out Ipc_Data_Ev_Mouse_Out; 106 typedef struct _Ipc_Data_Ev_Mouse_Up Ipc_Data_Ev_Mouse_Up; 107 typedef struct _Ipc_Data_Ev_Mouse_Down Ipc_Data_Ev_Mouse_Down; 108 typedef struct _Ipc_Data_Ev_Mouse_Move Ipc_Data_Ev_Mouse_Move; 109 typedef struct _Ipc_Data_Ev_Mouse_Wheel Ipc_Data_Ev_Mouse_Wheel; 110 typedef struct _Ipc_Data_Ev_Hold Ipc_Data_Ev_Hold; 111 typedef struct _Ipc_Data_Ev_Multi_Up Ipc_Data_Ev_Multi_Up; 112 typedef struct _Ipc_Data_Ev_Multi_Down Ipc_Data_Ev_Multi_Down; 113 typedef struct _Ipc_Data_Ev_Multi_Move Ipc_Data_Ev_Multi_Move; 114 typedef struct _Ipc_Data_Ev_Key_Up Ipc_Data_Ev_Key_Up; 115 typedef struct _Ipc_Data_Ev_Key_Down Ipc_Data_Ev_Key_Down; 116 117 struct _Ipc_Data_Resize 118 { 119 int w, h; 120 }; 121 122 struct _Ipc_Data_Update 123 { 124 int x, w, y, h; 125 }; 126 127 struct _Ipc_Data_Ev_Mouse_In 128 { 129 unsigned int timestamp; 130 int mask; 131 Evas_Event_Flags event_flags; 132 }; 133 134 struct _Ipc_Data_Ev_Mouse_Out 135 { 136 unsigned int timestamp; 137 int mask; 138 Evas_Event_Flags event_flags; 139 }; 140 141 struct _Ipc_Data_Ev_Mouse_Up 142 { 143 int b; 144 Evas_Button_Flags flags; 145 int mask; 146 unsigned int timestamp; 147 Evas_Event_Flags event_flags; 148 }; 149 150 struct _Ipc_Data_Ev_Mouse_Down 151 { 152 int b; 153 Evas_Button_Flags flags; 154 int mask; 155 unsigned int timestamp; 156 Evas_Event_Flags event_flags; 157 }; 158 159 struct _Ipc_Data_Ev_Mouse_Move 160 { 161 int x, y; 162 Evas_Button_Flags flags; 163 int mask; 164 unsigned int timestamp; 165 Evas_Event_Flags event_flags; 166 }; 167 168 struct _Ipc_Data_Ev_Mouse_Wheel 169 { 170 int direction, z; 171 Evas_Button_Flags flags; 172 int mask; 173 unsigned int timestamp; 174 Evas_Event_Flags event_flags; 175 }; 176 177 struct _Ipc_Data_Ev_Hold 178 { 179 int hold; 180 unsigned int timestamp; 181 Evas_Event_Flags event_flags; 182 }; 183 184 struct _Ipc_Data_Ev_Multi_Up 185 { 186 Evas_Button_Flags flags; 187 int d, x, y; 188 double rad, radx, rady, pres, ang, fx, fy; 189 int mask; 190 unsigned int timestamp; 191 Evas_Event_Flags event_flags; 192 }; 193 194 struct _Ipc_Data_Ev_Multi_Down 195 { 196 Evas_Button_Flags flags; 197 int d, x, y; 198 double rad, radx, rady, pres, ang, fx, fy; 199 int mask; 200 unsigned int timestamp; 201 Evas_Event_Flags event_flags; 202 }; 203 204 struct _Ipc_Data_Ev_Multi_Move 205 { 206 int d, x, y; 207 double rad, radx, rady, pres, ang, fx, fy; 208 int mask; 209 unsigned int timestamp; 210 Evas_Event_Flags event_flags; 211 }; 212 213 struct _Ipc_Data_Ev_Key_Up 214 { 215 const char *keyname, *key, *string, *compose; 216 int mask; 217 unsigned int timestamp; 218 Evas_Event_Flags event_flags; 219 }; 220 221 struct _Ipc_Data_Ev_Key_Down 222 { 223 const char *keyname, *key, *string, *compose; 224 int mask; 225 unsigned int timestamp; 226 Evas_Event_Flags event_flags; 227 }; 228 229 #endif /*_ECORE_EVAS_EXTN_ENGINE_H_*/ 230