Mercurial > dwindows
comparison android/dw.cpp @ 2533:7c863a3a125f
Android: Pass the cached window handle to the callback so the handles...
are as consistent as possible... so we can minimize dw_window_compare() use.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 11 May 2021 05:14:56 +0000 |
parents | 457c91634881 |
children | c4255630cade |
comparison
equal
deleted
inserted
replaced
2532:457c91634881 | 2533:7c863a3a125f |
---|---|
236 int width = DW_POINTER_TO_INT(params[3]); | 236 int width = DW_POINTER_TO_INT(params[3]); |
237 int height = DW_POINTER_TO_INT(params[4]); | 237 int height = DW_POINTER_TO_INT(params[4]); |
238 | 238 |
239 if(width > 0 && height > 0) | 239 if(width > 0 && height > 0) |
240 { | 240 { |
241 return sizefunc(object, width, height, handler->data); | 241 return sizefunc(handler->window, width, height, handler->data); |
242 } | 242 } |
243 return 0; | 243 return 0; |
244 } | 244 } |
245 case 2: | 245 case 2: |
246 { | 246 { |
255 case 4: | 255 case 4: |
256 { | 256 { |
257 int (* API buttonfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))handler->signalfunction; | 257 int (* API buttonfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))handler->signalfunction; |
258 int button = 1; | 258 int button = 1; |
259 | 259 |
260 return buttonfunc(object, DW_POINTER_TO_INT(params[3]), DW_POINTER_TO_INT(params[4]), button, handler->data); | 260 return buttonfunc(handler->window, DW_POINTER_TO_INT(params[3]), DW_POINTER_TO_INT(params[4]), button, handler->data); |
261 } | 261 } |
262 /* Motion notify event */ | 262 /* Motion notify event */ |
263 case 5: | 263 case 5: |
264 { | 264 { |
265 int (* API motionfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))handler->signalfunction; | 265 int (* API motionfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))handler->signalfunction; |
266 | 266 |
267 return motionfunc(object, DW_POINTER_TO_INT(params[3]), DW_POINTER_TO_INT(params[4]), DW_POINTER_TO_INT(params[5]), handler->data); | 267 return motionfunc(handler->window, DW_POINTER_TO_INT(params[3]), DW_POINTER_TO_INT(params[4]), DW_POINTER_TO_INT(params[5]), handler->data); |
268 } | 268 } |
269 /* Window close event */ | 269 /* Window close event */ |
270 case 6: | 270 case 6: |
271 { | 271 { |
272 int (* API closefunc)(HWND, void *) = (int (* API)(HWND, void *))handler->signalfunction; | 272 int (* API closefunc)(HWND, void *) = (int (* API)(HWND, void *))handler->signalfunction; |
273 return closefunc(object, handler->data); | 273 return closefunc(handler->window, handler->data); |
274 } | 274 } |
275 /* Window expose/draw event */ | 275 /* Window expose/draw event */ |
276 case 7: | 276 case 7: |
277 { | 277 { |
278 DWExpose exp; | 278 DWExpose exp; |
280 | 280 |
281 exp.x = DW_POINTER_TO_INT(params[3]); | 281 exp.x = DW_POINTER_TO_INT(params[3]); |
282 exp.y = DW_POINTER_TO_INT(params[4]); | 282 exp.y = DW_POINTER_TO_INT(params[4]); |
283 exp.width = DW_POINTER_TO_INT(params[5]); | 283 exp.width = DW_POINTER_TO_INT(params[5]); |
284 exp.height = DW_POINTER_TO_INT(params[6]); | 284 exp.height = DW_POINTER_TO_INT(params[6]); |
285 int result = exposefunc(object, &exp, handler->data); | 285 int result = exposefunc(handler->window, &exp, handler->data); |
286 return result; | 286 return result; |
287 } | 287 } |
288 /* Clicked event for buttons and menu items */ | 288 /* Clicked event for buttons and menu items */ |
289 case 8: | 289 case 8: |
290 { | 290 { |
291 int (* API clickfunc)(HWND, void *) = (int (* API)(HWND, void *))handler->signalfunction; | 291 int (* API clickfunc)(HWND, void *) = (int (* API)(HWND, void *))handler->signalfunction; |
292 | 292 |
293 return clickfunc(object, handler->data); | 293 return clickfunc(handler->window, handler->data); |
294 } | 294 } |
295 /* Container class selection event */ | 295 /* Container class selection event */ |
296 case 9: | 296 case 9: |
297 { | 297 { |
298 int (*containerselectfunc)(HWND, char *, void *, void *) =(int (* API)(HWND, char *, void *, void *)) handler->signalfunction; | 298 int (*containerselectfunc)(HWND, char *, void *, void *) =(int (* API)(HWND, char *, void *, void *)) handler->signalfunction; |