diff options
author | Ivan Briano <sachieru@gmail.com> | 2013-02-17 14:53:25 -0300 |
---|---|---|
committer | Ivan Briano <sachieru@gmail.com> | 2013-02-17 14:53:25 -0300 |
commit | 61b8e2aefe0d988806c9edd080d86b265b53d647 (patch) | |
tree | 20ad42c561e7f378347138f3ed5098ec39090a37 /src/lib | |
parent | d0c0a21240c22dda9f71e1b1b5244fcbef95c0d4 (diff) |
More removal of \r
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/ecore_cocoa/ecore_cocoa_private.h | 22 | ||||
-rw-r--r-- | src/lib/ecore_file/ecore_file_monitor_win32.c | 612 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_image.c | 78 | ||||
-rw-r--r-- | src/lib/evas/include/evas_private.h | 4 |
4 files changed, 358 insertions, 358 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_private.h b/src/lib/ecore_cocoa/ecore_cocoa_private.h index 0b4cf3178e..7cd08be9d2 100644 --- a/src/lib/ecore_cocoa/ecore_cocoa_private.h +++ b/src/lib/ecore_cocoa/ecore_cocoa_private.h | |||
@@ -1,11 +1,11 @@ | |||
1 | #ifndef _ECORE_COCOA_PRIVATE_H | 1 | #ifndef _ECORE_COCOA_PRIVATE_H |
2 | #define _ECORE_COCOA_PRIVATE_H | 2 | #define _ECORE_COCOA_PRIVATE_H |
3 | 3 | ||
4 | struct _Ecore_Cocoa_Window | 4 | struct _Ecore_Cocoa_Window |
5 | { | 5 | { |
6 | NSWindow *window; | 6 | NSWindow *window; |
7 | unsigned int borderless : 1; | 7 | unsigned int borderless : 1; |
8 | }; | 8 | }; |
9 | 9 | ||
10 | 10 | ||
11 | #endif | 11 | #endif |
diff --git a/src/lib/ecore_file/ecore_file_monitor_win32.c b/src/lib/ecore_file/ecore_file_monitor_win32.c index 84ac083cfd..52b876a5a7 100644 --- a/src/lib/ecore_file/ecore_file_monitor_win32.c +++ b/src/lib/ecore_file/ecore_file_monitor_win32.c | |||
@@ -1,306 +1,306 @@ | |||
1 | /* | 1 | /* |
2 | * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 | 2 | * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #ifdef HAVE_CONFIG_H | 5 | #ifdef HAVE_CONFIG_H |
6 | # include <config.h> | 6 | # include <config.h> |
7 | #endif | 7 | #endif |
8 | 8 | ||
9 | # define WIN32_LEAN_AND_MEAN | 9 | # define WIN32_LEAN_AND_MEAN |
10 | # include <windows.h> | 10 | # include <windows.h> |
11 | # undef WIN32_LEAN_AND_MEAN | 11 | # undef WIN32_LEAN_AND_MEAN |
12 | # include <process.h> | 12 | # include <process.h> |
13 | 13 | ||
14 | # include "ecore_file_private.h" | 14 | # include "ecore_file_private.h" |
15 | 15 | ||
16 | 16 | ||
17 | typedef struct _Ecore_File_Monitor_Win32 Ecore_File_Monitor_Win32; | 17 | typedef struct _Ecore_File_Monitor_Win32 Ecore_File_Monitor_Win32; |
18 | typedef struct _Ecore_File_Monitor_Win32_Data Ecore_File_Monitor_Win32_Data; | 18 | typedef struct _Ecore_File_Monitor_Win32_Data Ecore_File_Monitor_Win32_Data; |
19 | 19 | ||
20 | /* 4096 = 256 * sizeof(FILE_NOTIFY_INFORMATION) */ | 20 | /* 4096 = 256 * sizeof(FILE_NOTIFY_INFORMATION) */ |
21 | # define ECORE_FILE_MONITOR_WIN32_BUFFER_SIZE 4096 | 21 | # define ECORE_FILE_MONITOR_WIN32_BUFFER_SIZE 4096 |
22 | # define ECORE_FILE_MONITOR_WIN32(x) ((Ecore_File_Monitor_Win32 *)(x)) | 22 | # define ECORE_FILE_MONITOR_WIN32(x) ((Ecore_File_Monitor_Win32 *)(x)) |
23 | 23 | ||
24 | struct _Ecore_File_Monitor_Win32_Data | 24 | struct _Ecore_File_Monitor_Win32_Data |
25 | { | 25 | { |
26 | char buffer[ECORE_FILE_MONITOR_WIN32_BUFFER_SIZE]; | 26 | char buffer[ECORE_FILE_MONITOR_WIN32_BUFFER_SIZE]; |
27 | OVERLAPPED overlapped; | 27 | OVERLAPPED overlapped; |
28 | HANDLE handle; | 28 | HANDLE handle; |
29 | HANDLE event; | 29 | HANDLE event; |
30 | Ecore_File_Monitor *monitor; | 30 | Ecore_File_Monitor *monitor; |
31 | Ecore_Win32_Handler *h; | 31 | Ecore_Win32_Handler *h; |
32 | DWORD buf_length; | 32 | DWORD buf_length; |
33 | int is_dir; | 33 | int is_dir; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct _Ecore_File_Monitor_Win32 | 36 | struct _Ecore_File_Monitor_Win32 |
37 | { | 37 | { |
38 | Ecore_File_Monitor monitor; | 38 | Ecore_File_Monitor monitor; |
39 | Ecore_File_Monitor_Win32_Data *file; | 39 | Ecore_File_Monitor_Win32_Data *file; |
40 | Ecore_File_Monitor_Win32_Data *dir; | 40 | Ecore_File_Monitor_Win32_Data *dir; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | static Ecore_File_Monitor *_monitors = NULL; | 43 | static Ecore_File_Monitor *_monitors = NULL; |
44 | 44 | ||
45 | static Eina_Bool _ecore_file_monitor_win32_cb(void *data, Ecore_Win32_Handler *wh); | 45 | static Eina_Bool _ecore_file_monitor_win32_cb(void *data, Ecore_Win32_Handler *wh); |
46 | 46 | ||
47 | 47 | ||
48 | static Ecore_File_Monitor_Win32_Data * | 48 | static Ecore_File_Monitor_Win32_Data * |
49 | _ecore_file_monitor_win32_data_new(Ecore_File_Monitor *monitor, int type) | 49 | _ecore_file_monitor_win32_data_new(Ecore_File_Monitor *monitor, int type) |
50 | { | 50 | { |
51 | Ecore_File_Monitor_Win32_Data *md; | 51 | Ecore_File_Monitor_Win32_Data *md; |
52 | DWORD filter; | 52 | DWORD filter; |
53 | 53 | ||
54 | md = (Ecore_File_Monitor_Win32_Data *)calloc(1, sizeof(Ecore_File_Monitor_Win32_Data)); | 54 | md = (Ecore_File_Monitor_Win32_Data *)calloc(1, sizeof(Ecore_File_Monitor_Win32_Data)); |
55 | if (!md) return NULL; | 55 | if (!md) return NULL; |
56 | 56 | ||
57 | md->handle = CreateFile(monitor->path, | 57 | md->handle = CreateFile(monitor->path, |
58 | FILE_LIST_DIRECTORY, | 58 | FILE_LIST_DIRECTORY, |
59 | FILE_SHARE_READ | | 59 | FILE_SHARE_READ | |
60 | FILE_SHARE_WRITE, | 60 | FILE_SHARE_WRITE, |
61 | NULL, | 61 | NULL, |
62 | OPEN_EXISTING, | 62 | OPEN_EXISTING, |
63 | FILE_FLAG_BACKUP_SEMANTICS | | 63 | FILE_FLAG_BACKUP_SEMANTICS | |
64 | FILE_FLAG_OVERLAPPED, | 64 | FILE_FLAG_OVERLAPPED, |
65 | NULL); | 65 | NULL); |
66 | if (md->handle == INVALID_HANDLE_VALUE) | 66 | if (md->handle == INVALID_HANDLE_VALUE) |
67 | goto free_md; | 67 | goto free_md; |
68 | 68 | ||
69 | md->event = CreateEvent(NULL, FALSE, FALSE, NULL); | 69 | md->event = CreateEvent(NULL, FALSE, FALSE, NULL); |
70 | if (!md->event) | 70 | if (!md->event) |
71 | goto close_handle; | 71 | goto close_handle; |
72 | 72 | ||
73 | ZeroMemory (&md->overlapped, sizeof(md->overlapped)); | 73 | ZeroMemory (&md->overlapped, sizeof(md->overlapped)); |
74 | md->overlapped.hEvent = md->event; | 74 | md->overlapped.hEvent = md->event; |
75 | 75 | ||
76 | filter = (type == 0) ? FILE_NOTIFY_CHANGE_FILE_NAME : FILE_NOTIFY_CHANGE_DIR_NAME; | 76 | filter = (type == 0) ? FILE_NOTIFY_CHANGE_FILE_NAME : FILE_NOTIFY_CHANGE_DIR_NAME; |
77 | filter |= | 77 | filter |= |
78 | FILE_NOTIFY_CHANGE_ATTRIBUTES | | 78 | FILE_NOTIFY_CHANGE_ATTRIBUTES | |
79 | FILE_NOTIFY_CHANGE_SIZE | | 79 | FILE_NOTIFY_CHANGE_SIZE | |
80 | FILE_NOTIFY_CHANGE_LAST_WRITE | | 80 | FILE_NOTIFY_CHANGE_LAST_WRITE | |
81 | FILE_NOTIFY_CHANGE_LAST_ACCESS | | 81 | FILE_NOTIFY_CHANGE_LAST_ACCESS | |
82 | FILE_NOTIFY_CHANGE_CREATION | | 82 | FILE_NOTIFY_CHANGE_CREATION | |
83 | FILE_NOTIFY_CHANGE_SECURITY; | 83 | FILE_NOTIFY_CHANGE_SECURITY; |
84 | 84 | ||
85 | if (!ReadDirectoryChangesW(md->handle, | 85 | if (!ReadDirectoryChangesW(md->handle, |
86 | md->buffer, | 86 | md->buffer, |
87 | ECORE_FILE_MONITOR_WIN32_BUFFER_SIZE, | 87 | ECORE_FILE_MONITOR_WIN32_BUFFER_SIZE, |
88 | FALSE, | 88 | FALSE, |
89 | filter, | 89 | filter, |
90 | &md->buf_length, | 90 | &md->buf_length, |
91 | &md->overlapped, | 91 | &md->overlapped, |
92 | NULL)) | 92 | NULL)) |
93 | goto close_event; | 93 | goto close_event; |
94 | 94 | ||
95 | md->h = ecore_main_win32_handler_add(md->event, | 95 | md->h = ecore_main_win32_handler_add(md->event, |
96 | _ecore_file_monitor_win32_cb, | 96 | _ecore_file_monitor_win32_cb, |
97 | md); | 97 | md); |
98 | if (!md->h) | 98 | if (!md->h) |
99 | goto close_event; | 99 | goto close_event; |
100 | 100 | ||
101 | md->monitor = monitor; | 101 | md->monitor = monitor; |
102 | md->is_dir = type; | 102 | md->is_dir = type; |
103 | 103 | ||
104 | return md; | 104 | return md; |
105 | 105 | ||
106 | close_event: | 106 | close_event: |
107 | CloseHandle(md->event); | 107 | CloseHandle(md->event); |
108 | close_handle: | 108 | close_handle: |
109 | CloseHandle(md->handle); | 109 | CloseHandle(md->handle); |
110 | free_md: | 110 | free_md: |
111 | free(md); | 111 | free(md); |
112 | 112 | ||
113 | return NULL; | 113 | return NULL; |
114 | } | 114 | } |
115 | 115 | ||
116 | static void | 116 | static void |
117 | _ecore_file_monitor_win32_data_free(Ecore_File_Monitor_Win32_Data *md) | 117 | _ecore_file_monitor_win32_data_free(Ecore_File_Monitor_Win32_Data *md) |
118 | { | 118 | { |
119 | if (!md) return; | 119 | if (!md) return; |
120 | 120 | ||
121 | CloseHandle(md->event); | 121 | CloseHandle(md->event); |
122 | CloseHandle (md->handle); | 122 | CloseHandle (md->handle); |
123 | free (md); | 123 | free (md); |
124 | } | 124 | } |
125 | 125 | ||
126 | static Eina_Bool | 126 | static Eina_Bool |
127 | _ecore_file_monitor_win32_cb(void *data, Ecore_Win32_Handler *wh) | 127 | _ecore_file_monitor_win32_cb(void *data, Ecore_Win32_Handler *wh) |
128 | { | 128 | { |
129 | char filename[PATH_MAX]; | 129 | char filename[PATH_MAX]; |
130 | PFILE_NOTIFY_INFORMATION fni; | 130 | PFILE_NOTIFY_INFORMATION fni; |
131 | Ecore_File_Monitor_Win32_Data *md; | 131 | Ecore_File_Monitor_Win32_Data *md; |
132 | wchar_t *wname; | 132 | wchar_t *wname; |
133 | char *name; | 133 | char *name; |
134 | DWORD filter; | 134 | DWORD filter; |
135 | DWORD offset; | 135 | DWORD offset; |
136 | DWORD buf_length; | 136 | DWORD buf_length; |
137 | Ecore_File_Event event = ECORE_FILE_EVENT_NONE; | 137 | Ecore_File_Event event = ECORE_FILE_EVENT_NONE; |
138 | 138 | ||
139 | md = (Ecore_File_Monitor_Win32_Data *)data; | 139 | md = (Ecore_File_Monitor_Win32_Data *)data; |
140 | 140 | ||
141 | if (!GetOverlappedResult (md->handle, &md->overlapped, &buf_length, TRUE)) | 141 | if (!GetOverlappedResult (md->handle, &md->overlapped, &buf_length, TRUE)) |
142 | return 1; | 142 | return 1; |
143 | 143 | ||
144 | fni = (PFILE_NOTIFY_INFORMATION)md->buffer; | 144 | fni = (PFILE_NOTIFY_INFORMATION)md->buffer; |
145 | do { | 145 | do { |
146 | if (!fni) | 146 | if (!fni) |
147 | break; | 147 | break; |
148 | offset = fni->NextEntryOffset; | 148 | offset = fni->NextEntryOffset; |
149 | 149 | ||
150 | wname = (wchar_t *)malloc(sizeof(wchar_t) * (fni->FileNameLength + 1)); | 150 | wname = (wchar_t *)malloc(sizeof(wchar_t) * (fni->FileNameLength + 1)); |
151 | if (!wname) | 151 | if (!wname) |
152 | return 0; | 152 | return 0; |
153 | 153 | ||
154 | memcpy(wname, fni->FileName, fni->FileNameLength); | 154 | memcpy(wname, fni->FileName, fni->FileNameLength); |
155 | wname[fni->FileNameLength]='\0'; | 155 | wname[fni->FileNameLength]='\0'; |
156 | name = evil_wchar_to_char(wname); | 156 | name = evil_wchar_to_char(wname); |
157 | free(wname); | 157 | free(wname); |
158 | if (!name) | 158 | if (!name) |
159 | return 0; | 159 | return 0; |
160 | 160 | ||
161 | _snprintf(filename, PATH_MAX, "%s\\%s", md->monitor->path, name); | 161 | _snprintf(filename, PATH_MAX, "%s\\%s", md->monitor->path, name); |
162 | free(name); | 162 | free(name); |
163 | 163 | ||
164 | switch (fni->Action) | 164 | switch (fni->Action) |
165 | { | 165 | { |
166 | case FILE_ACTION_ADDED: | 166 | case FILE_ACTION_ADDED: |
167 | if (md->is_dir) | 167 | if (md->is_dir) |
168 | event = ECORE_FILE_EVENT_CREATED_DIRECTORY; | 168 | event = ECORE_FILE_EVENT_CREATED_DIRECTORY; |
169 | else | 169 | else |
170 | event = ECORE_FILE_EVENT_CREATED_FILE; | 170 | event = ECORE_FILE_EVENT_CREATED_FILE; |
171 | break; | 171 | break; |
172 | case FILE_ACTION_REMOVED: | 172 | case FILE_ACTION_REMOVED: |
173 | if (md->is_dir) | 173 | if (md->is_dir) |
174 | event = ECORE_FILE_EVENT_DELETED_DIRECTORY; | 174 | event = ECORE_FILE_EVENT_DELETED_DIRECTORY; |
175 | else | 175 | else |
176 | event = ECORE_FILE_EVENT_DELETED_FILE; | 176 | event = ECORE_FILE_EVENT_DELETED_FILE; |
177 | break; | 177 | break; |
178 | case FILE_ACTION_MODIFIED: | 178 | case FILE_ACTION_MODIFIED: |
179 | if (!md->is_dir) | 179 | if (!md->is_dir) |
180 | event = ECORE_FILE_EVENT_MODIFIED; | 180 | event = ECORE_FILE_EVENT_MODIFIED; |
181 | break; | 181 | break; |
182 | case FILE_ACTION_RENAMED_OLD_NAME: | 182 | case FILE_ACTION_RENAMED_OLD_NAME: |
183 | if (md->is_dir) | 183 | if (md->is_dir) |
184 | event = ECORE_FILE_EVENT_DELETED_DIRECTORY; | 184 | event = ECORE_FILE_EVENT_DELETED_DIRECTORY; |
185 | else | 185 | else |
186 | event = ECORE_FILE_EVENT_DELETED_FILE; | 186 | event = ECORE_FILE_EVENT_DELETED_FILE; |
187 | break; | 187 | break; |
188 | case FILE_ACTION_RENAMED_NEW_NAME: | 188 | case FILE_ACTION_RENAMED_NEW_NAME: |
189 | if (md->is_dir) | 189 | if (md->is_dir) |
190 | event = ECORE_FILE_EVENT_CREATED_DIRECTORY; | 190 | event = ECORE_FILE_EVENT_CREATED_DIRECTORY; |
191 | else | 191 | else |
192 | event = ECORE_FILE_EVENT_CREATED_FILE; | 192 | event = ECORE_FILE_EVENT_CREATED_FILE; |
193 | break; | 193 | break; |
194 | default: | 194 | default: |
195 | fprintf(stderr, "unknown event\n"); | 195 | fprintf(stderr, "unknown event\n"); |
196 | event = ECORE_FILE_EVENT_NONE; | 196 | event = ECORE_FILE_EVENT_NONE; |
197 | break; | 197 | break; |
198 | } | 198 | } |
199 | if (event != ECORE_FILE_EVENT_NONE) | 199 | if (event != ECORE_FILE_EVENT_NONE) |
200 | md->monitor->func(md->monitor->data, md->monitor, event, filename); | 200 | md->monitor->func(md->monitor->data, md->monitor, event, filename); |
201 | 201 | ||
202 | fni = (PFILE_NOTIFY_INFORMATION)((LPBYTE)fni + offset); | 202 | fni = (PFILE_NOTIFY_INFORMATION)((LPBYTE)fni + offset); |
203 | } while (offset); | 203 | } while (offset); |
204 | 204 | ||
205 | filter = (md->is_dir == 0) ? FILE_NOTIFY_CHANGE_FILE_NAME : FILE_NOTIFY_CHANGE_DIR_NAME; | 205 | filter = (md->is_dir == 0) ? FILE_NOTIFY_CHANGE_FILE_NAME : FILE_NOTIFY_CHANGE_DIR_NAME; |
206 | filter |= | 206 | filter |= |
207 | FILE_NOTIFY_CHANGE_ATTRIBUTES | | 207 | FILE_NOTIFY_CHANGE_ATTRIBUTES | |
208 | FILE_NOTIFY_CHANGE_SIZE | | 208 | FILE_NOTIFY_CHANGE_SIZE | |
209 | FILE_NOTIFY_CHANGE_LAST_WRITE | | 209 | FILE_NOTIFY_CHANGE_LAST_WRITE | |
210 | FILE_NOTIFY_CHANGE_LAST_ACCESS | | 210 | FILE_NOTIFY_CHANGE_LAST_ACCESS | |
211 | FILE_NOTIFY_CHANGE_CREATION | | 211 | FILE_NOTIFY_CHANGE_CREATION | |
212 | FILE_NOTIFY_CHANGE_SECURITY; | 212 | FILE_NOTIFY_CHANGE_SECURITY; |
213 | 213 | ||
214 | ReadDirectoryChangesW(md->handle, | 214 | ReadDirectoryChangesW(md->handle, |
215 | md->buffer, | 215 | md->buffer, |
216 | ECORE_FILE_MONITOR_WIN32_BUFFER_SIZE, | 216 | ECORE_FILE_MONITOR_WIN32_BUFFER_SIZE, |
217 | FALSE, | 217 | FALSE, |
218 | filter, | 218 | filter, |
219 | &md->buf_length, | 219 | &md->buf_length, |
220 | &md->overlapped, | 220 | &md->overlapped, |
221 | NULL); | 221 | NULL); |
222 | return 1; | 222 | return 1; |
223 | } | 223 | } |
224 | 224 | ||
225 | int | 225 | int |
226 | ecore_file_monitor_backend_init(void) | 226 | ecore_file_monitor_backend_init(void) |
227 | { | 227 | { |
228 | return 1; | 228 | return 1; |
229 | } | 229 | } |
230 | 230 | ||
231 | int | 231 | int |
232 | ecore_file_monitor_backend_shutdown(void) | 232 | ecore_file_monitor_backend_shutdown(void) |
233 | { | 233 | { |
234 | return 1; | 234 | return 1; |
235 | } | 235 | } |
236 | 236 | ||
237 | Ecore_File_Monitor * | 237 | Ecore_File_Monitor * |
238 | ecore_file_monitor_backend_add(const char *path, | 238 | ecore_file_monitor_backend_add(const char *path, |
239 | void (*func) (void *data, Ecore_File_Monitor *em, | 239 | void (*func) (void *data, Ecore_File_Monitor *em, |
240 | Ecore_File_Event event, | 240 | Ecore_File_Event event, |
241 | const char *path), | 241 | const char *path), |
242 | void *data) | 242 | void *data) |
243 | { | 243 | { |
244 | Ecore_File_Monitor_Win32 *m; | 244 | Ecore_File_Monitor_Win32 *m; |
245 | Ecore_File_Monitor *em; | 245 | Ecore_File_Monitor *em; |
246 | size_t len; | 246 | size_t len; |
247 | 247 | ||
248 | if (!path || (*path == '\0')) return NULL; | 248 | if (!path || (*path == '\0')) return NULL; |
249 | if (!ecore_file_exists(path) || !ecore_file_is_dir(path)) | 249 | if (!ecore_file_exists(path) || !ecore_file_is_dir(path)) |
250 | return NULL; | 250 | return NULL; |
251 | if (!func) return NULL; | 251 | if (!func) return NULL; |
252 | 252 | ||
253 | em = (Ecore_File_Monitor *)calloc(1, sizeof(Ecore_File_Monitor_Win32)); | 253 | em = (Ecore_File_Monitor *)calloc(1, sizeof(Ecore_File_Monitor_Win32)); |
254 | if (!em) return NULL; | 254 | if (!em) return NULL; |
255 | 255 | ||
256 | em->func = func; | 256 | em->func = func; |
257 | em->data = data; | 257 | em->data = data; |
258 | 258 | ||
259 | em->path = strdup(path); | 259 | em->path = strdup(path); |
260 | if (!em->path) | 260 | if (!em->path) |
261 | { | 261 | { |
262 | free(em); | 262 | free(em); |
263 | return NULL; | 263 | return NULL; |
264 | } | 264 | } |
265 | len = strlen(em->path); | 265 | len = strlen(em->path); |
266 | if (em->path[len - 1] == '/' || em->path[len - 1] == '\\') | 266 | if (em->path[len - 1] == '/' || em->path[len - 1] == '\\') |
267 | em->path[len - 1] = '\0'; | 267 | em->path[len - 1] = '\0'; |
268 | 268 | ||
269 | m = ECORE_FILE_MONITOR_WIN32(em); | 269 | m = ECORE_FILE_MONITOR_WIN32(em); |
270 | 270 | ||
271 | m->file = _ecore_file_monitor_win32_data_new(em, 0); | 271 | m->file = _ecore_file_monitor_win32_data_new(em, 0); |
272 | if (!m->file) | 272 | if (!m->file) |
273 | { | 273 | { |
274 | free(em->path); | 274 | free(em->path); |
275 | free(em); | 275 | free(em); |
276 | return NULL; | 276 | return NULL; |
277 | } | 277 | } |
278 | 278 | ||
279 | m->dir = _ecore_file_monitor_win32_data_new(em, 1); | 279 | m->dir = _ecore_file_monitor_win32_data_new(em, 1); |
280 | if (!m->dir) | 280 | if (!m->dir) |
281 | { | 281 | { |
282 | _ecore_file_monitor_win32_data_free(m->file); | 282 | _ecore_file_monitor_win32_data_free(m->file); |
283 | free(em->path); | 283 | free(em->path); |
284 | free(em); | 284 | free(em); |
285 | return NULL; | 285 | return NULL; |
286 | } | 286 | } |
287 | 287 | ||
288 | _monitors = ECORE_FILE_MONITOR(eina_inlist_append(EINA_INLIST_GET(_monitors), EINA_INLIST_GET(em))); | 288 | _monitors = ECORE_FILE_MONITOR(eina_inlist_append(EINA_INLIST_GET(_monitors), EINA_INLIST_GET(em))); |
289 | 289 | ||
290 | return em; | 290 | return em; |
291 | } | 291 | } |
292 | 292 | ||
293 | void | 293 | void |
294 | ecore_file_monitor_backend_del(Ecore_File_Monitor *em) | 294 | ecore_file_monitor_backend_del(Ecore_File_Monitor *em) |
295 | { | 295 | { |
296 | Ecore_File_Monitor_Win32 *m; | 296 | Ecore_File_Monitor_Win32 *m; |
297 | 297 | ||
298 | if (!em) | 298 | if (!em) |
299 | return; | 299 | return; |
300 | 300 | ||
301 | m = ECORE_FILE_MONITOR_WIN32(em); | 301 | m = ECORE_FILE_MONITOR_WIN32(em); |
302 | _ecore_file_monitor_win32_data_free(m->dir); | 302 | _ecore_file_monitor_win32_data_free(m->dir); |
303 | _ecore_file_monitor_win32_data_free(m->file); | 303 | _ecore_file_monitor_win32_data_free(m->file); |
304 | free(em->path); | 304 | free(em->path); |
305 | free(em); | 305 | free(em); |
306 | } | 306 | } |
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index b3df22b65a..b1c59bb0ed 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c | |||
@@ -4465,7 +4465,7 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4465 | Evas_Object_Image *o = eo_data_get(eo_obj, MY_CLASS); | 4465 | Evas_Object_Image *o = eo_data_get(eo_obj, MY_CLASS); |
4466 | int imagew, imageh, uvw, uvh; | 4466 | int imagew, imageh, uvw, uvh; |
4467 | void *pixels; | 4467 | void *pixels; |
4468 | Evas_Func *eng = obj->layer->evas->engine.func; | 4468 | Evas_Func *eng = obj->layer->evas->engine.func; |
4469 | int is_inside = 0; | 4469 | int is_inside = 0; |
4470 | 4470 | ||
4471 | /* the following code is similar to evas_object_image_render(), but doesn't | 4471 | /* the following code is similar to evas_object_image_render(), but doesn't |
@@ -4539,7 +4539,7 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4539 | } | 4539 | } |
4540 | else | 4540 | else |
4541 | { | 4541 | { |
4542 | void *im; | 4542 | void *im; |
4543 | DATA32 *data = NULL; | 4543 | DATA32 *data = NULL; |
4544 | int err = 0; | 4544 | int err = 0; |
4545 | 4545 | ||
@@ -4547,8 +4547,8 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4547 | (obj->layer->evas->engine.data.output, pixels, 0, &data, &err); | 4547 | (obj->layer->evas->engine.data.output, pixels, 0, &data, &err); |
4548 | if ((!im) || (!data) || (err)) | 4548 | if ((!im) || (!data) || (err)) |
4549 | { | 4549 | { |
4550 | ERR("Couldn't get image pixels %p: im=%p, data=%p, err=%d", | 4550 | ERR("Couldn't get image pixels %p: im=%p, data=%p, err=%d", |
4551 | pixels, im, data, err); | 4551 | pixels, im, data, err); |
4552 | goto end; | 4552 | goto end; |
4553 | } | 4553 | } |
4554 | 4554 | ||
@@ -4596,13 +4596,13 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4596 | */ | 4596 | */ |
4597 | { | 4597 | { |
4598 | DATA8 alpha = 0; | 4598 | DATA8 alpha = 0; |
4599 | 4599 | ||
4600 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4600 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4601 | 0, 0, | 4601 | 0, 0, |
4602 | imagew, imageh, | 4602 | imagew, imageh, |
4603 | obj->cur.geometry.x + ix, | 4603 | obj->cur.geometry.x + ix, |
4604 | obj->cur.geometry.y + iy, | 4604 | obj->cur.geometry.y + iy, |
4605 | iw, ih)) | 4605 | iw, ih)) |
4606 | { | 4606 | { |
4607 | is_inside = alpha > 0; | 4607 | is_inside = alpha > 0; |
4608 | dobreak_h = 1; | 4608 | dobreak_h = 1; |
@@ -4663,9 +4663,9 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4663 | inw = bl; inh = bt; | 4663 | inw = bl; inh = bt; |
4664 | outx = ox; outy = oy; | 4664 | outx = ox; outy = oy; |
4665 | outw = bsl; outh = bst; | 4665 | outw = bsl; outh = bst; |
4666 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4666 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4667 | inx, iny, inw, inh, | 4667 | inx, iny, inw, inh, |
4668 | outx, outy, outw, outh)) | 4668 | outx, outy, outw, outh)) |
4669 | { | 4669 | { |
4670 | is_inside = alpha > 0; | 4670 | is_inside = alpha > 0; |
4671 | dobreak_h = 1; | 4671 | dobreak_h = 1; |
@@ -4679,9 +4679,9 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4679 | inw = imw - bl - br; inh = bt; | 4679 | inw = imw - bl - br; inh = bt; |
4680 | outx = ox + bsl; outy = oy; | 4680 | outx = ox + bsl; outy = oy; |
4681 | outw = iw - bsl - bsr; outh = bst; | 4681 | outw = iw - bsl - bsr; outh = bst; |
4682 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4682 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4683 | inx, iny, inw, inh, | 4683 | inx, iny, inw, inh, |
4684 | outx, outy, outw, outh)) | 4684 | outx, outy, outw, outh)) |
4685 | { | 4685 | { |
4686 | is_inside = alpha > 0; | 4686 | is_inside = alpha > 0; |
4687 | dobreak_h = 1; | 4687 | dobreak_h = 1; |
@@ -4694,9 +4694,9 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4694 | inw = br; inh = bt; | 4694 | inw = br; inh = bt; |
4695 | outx = ox + iw - bsr; outy = oy; | 4695 | outx = ox + iw - bsr; outy = oy; |
4696 | outw = bsr; outh = bst; | 4696 | outw = bsr; outh = bst; |
4697 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4697 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4698 | inx, iny, inw, inh, | 4698 | inx, iny, inw, inh, |
4699 | outx, outy, outw, outh)) | 4699 | outx, outy, outw, outh)) |
4700 | { | 4700 | { |
4701 | is_inside = alpha > 0; | 4701 | is_inside = alpha > 0; |
4702 | dobreak_h = 1; | 4702 | dobreak_h = 1; |
@@ -4704,14 +4704,14 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4704 | break; | 4704 | break; |
4705 | } | 4705 | } |
4706 | // .-- | 4706 | // .-- |
4707 | // # | 4707 | // # |
4708 | inx = 0; iny = bt; | 4708 | inx = 0; iny = bt; |
4709 | inw = bl; inh = imh - bt - bb; | 4709 | inw = bl; inh = imh - bt - bb; |
4710 | outx = ox; outy = oy + bst; | 4710 | outx = ox; outy = oy + bst; |
4711 | outw = bsl; outh = ih - bst - bsb; | 4711 | outw = bsl; outh = ih - bst - bsb; |
4712 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4712 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4713 | inx, iny, inw, inh, | 4713 | inx, iny, inw, inh, |
4714 | outx, outy, outw, outh)) | 4714 | outx, outy, outw, outh)) |
4715 | { | 4715 | { |
4716 | is_inside = alpha > 0; | 4716 | is_inside = alpha > 0; |
4717 | dobreak_h = 1; | 4717 | dobreak_h = 1; |
@@ -4726,9 +4726,9 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4726 | inw = imw - bl - br; inh = imh - bt - bb; | 4726 | inw = imw - bl - br; inh = imh - bt - bb; |
4727 | outx = ox + bsl; outy = oy + bst; | 4727 | outx = ox + bsl; outy = oy + bst; |
4728 | outw = iw - bsl - bsr; outh = ih - bst - bsb; | 4728 | outw = iw - bsl - bsr; outh = ih - bst - bsb; |
4729 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4729 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4730 | inx, iny, inw, inh, | 4730 | inx, iny, inw, inh, |
4731 | outx, outy, outw, outh)) | 4731 | outx, outy, outw, outh)) |
4732 | { | 4732 | { |
4733 | is_inside = alpha > 0; | 4733 | is_inside = alpha > 0; |
4734 | dobreak_h = 1; | 4734 | dobreak_h = 1; |
@@ -4742,9 +4742,9 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4742 | inw = br; inh = imh - bt - bb; | 4742 | inw = br; inh = imh - bt - bb; |
4743 | outx = ox + iw - bsr; outy = oy + bst; | 4743 | outx = ox + iw - bsr; outy = oy + bst; |
4744 | outw = bsr; outh = ih - bst - bsb; | 4744 | outw = bsr; outh = ih - bst - bsb; |
4745 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4745 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4746 | inx, iny, inw, inh, | 4746 | inx, iny, inw, inh, |
4747 | outx, outy, outw, outh)) | 4747 | outx, outy, outw, outh)) |
4748 | { | 4748 | { |
4749 | is_inside = alpha > 0; | 4749 | is_inside = alpha > 0; |
4750 | dobreak_h = 1; | 4750 | dobreak_h = 1; |
@@ -4757,9 +4757,9 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4757 | inw = bl; inh = bb; | 4757 | inw = bl; inh = bb; |
4758 | outx = ox; outy = oy + ih - bsb; | 4758 | outx = ox; outy = oy + ih - bsb; |
4759 | outw = bsl; outh = bsb; | 4759 | outw = bsl; outh = bsb; |
4760 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4760 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4761 | inx, iny, inw, inh, | 4761 | inx, iny, inw, inh, |
4762 | outx, outy, outw, outh)) | 4762 | outx, outy, outw, outh)) |
4763 | { | 4763 | { |
4764 | is_inside = alpha > 0; | 4764 | is_inside = alpha > 0; |
4765 | dobreak_h = 1; | 4765 | dobreak_h = 1; |
@@ -4772,9 +4772,9 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4772 | inw = imw - bl - br; inh = bb; | 4772 | inw = imw - bl - br; inh = bb; |
4773 | outx = ox + bsl; outy = oy + ih - bsb; | 4773 | outx = ox + bsl; outy = oy + ih - bsb; |
4774 | outw = iw - bsl - bsr; outh = bsb; | 4774 | outw = iw - bsl - bsr; outh = bsb; |
4775 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4775 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4776 | inx, iny, inw, inh, | 4776 | inx, iny, inw, inh, |
4777 | outx, outy, outw, outh)) | 4777 | outx, outy, outw, outh)) |
4778 | { | 4778 | { |
4779 | is_inside = alpha > 0; | 4779 | is_inside = alpha > 0; |
4780 | dobreak_h = 1; | 4780 | dobreak_h = 1; |
@@ -4787,9 +4787,9 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj | |||
4787 | inw = br; inh = bb; | 4787 | inw = br; inh = bb; |
4788 | outx = ox + iw - bsr; outy = oy + ih - bsb; | 4788 | outx = ox + iw - bsr; outy = oy + ih - bsb; |
4789 | outw = bsr; outh = bsb; | 4789 | outw = bsr; outh = bsb; |
4790 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, | 4790 | if (eng->pixel_alpha_get(pixels, px, py, &alpha, |
4791 | inx, iny, inw, inh, | 4791 | inx, iny, inw, inh, |
4792 | outx, outy, outw, outh)) | 4792 | outx, outy, outw, outh)) |
4793 | { | 4793 | { |
4794 | is_inside = alpha > 0; | 4794 | is_inside = alpha > 0; |
4795 | dobreak_h = 1; | 4795 | dobreak_h = 1; |
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 088107eb5a..995f00e6e8 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h | |||
@@ -905,8 +905,8 @@ struct _Evas_Func | |||
905 | 905 | ||
906 | /* multiple font draws */ | 906 | /* multiple font draws */ |
907 | Eina_Bool (*multi_font_draw) (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, Evas_Font_Array *texts, Eina_Bool do_async); | 907 | Eina_Bool (*multi_font_draw) (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, Evas_Font_Array *texts, Eina_Bool do_async); |
908 | 908 | ||
909 | Eina_Bool (*pixel_alpha_get) (void *image, int x, int y, DATA8 *alpha, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h); | 909 | Eina_Bool (*pixel_alpha_get) (void *image, int x, int y, DATA8 *alpha, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h); |
910 | }; | 910 | }; |
911 | 911 | ||
912 | struct _Evas_Image_Load_Func | 912 | struct _Evas_Image_Load_Func |