Changeset 551 for libcaca/trunk/caca
- Timestamp:
- Mar 8, 2006, 12:27:23 PM (15 years ago)
- Location:
- libcaca/trunk/caca
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/caca.c
r550 r551 80 80 kk->lastticks = 0; 81 81 82 kk->mouse _x = kk->qq->width / 2;83 kk->mouse _y = kk->qq->height / 2;82 kk->mouse.x = kk->qq->width / 2; 83 kk->mouse.y = kk->qq->height / 2; 84 84 85 85 kk->resize = 0; -
libcaca/trunk/caca/caca_internals.h
r550 r551 87 87 struct caca_context 88 88 { 89 /* A link to our cucul canvas */ 89 90 cucul_t *qq; 90 91 92 /* Device-specific functions */ 91 93 struct drv 92 94 { … … 104 106 } drv; 105 107 106 //unsigned int width, height; 107 unsigned int mouse_x, mouse_y; 108 /* Mouse position */ 109 struct mouse 110 { 111 unsigned int x, y; 112 } mouse; 108 113 114 /* Window resize handling */ 109 115 int resize; 110 116 int resize_event; 111 117 118 /* Framerate handling */ 112 119 unsigned int delay, rendertime; 113 120 struct caca_timer timer; -
libcaca/trunk/caca/driver_gl.c
r550 r551 332 332 kk->drv.p->mouse_clicked = 0; 333 333 } 334 kk->mouse _x = kk->drv.p->mouse_x;335 kk->mouse _y = kk->drv.p->mouse_y;336 event |= CACA_EVENT_MOUSE_MOTION | (kk->mouse _x << 12) | kk->mouse_y;334 kk->mouse.x = kk->drv.p->mouse_x; 335 kk->mouse.y = kk->drv.p->mouse_y; 336 event |= CACA_EVENT_MOUSE_MOTION | (kk->mouse.x << 12) | kk->mouse.y; 337 337 kk->drv.p->mouse_changed = 0; 338 338 } -
libcaca/trunk/caca/driver_ncurses.c
r550 r551 361 361 } 362 362 363 if(kk->mouse _x == (unsigned int)mevent.x &&364 kk->mouse _y == (unsigned int)mevent.y)363 if(kk->mouse.x == (unsigned int)mevent.x && 364 kk->mouse.y == (unsigned int)mevent.y) 365 365 return _pop_event(kk); 366 366 367 kk->mouse _x = mevent.x;368 kk->mouse _y = mevent.y;369 370 return CACA_EVENT_MOUSE_MOTION | (kk->mouse _x << 12) | kk->mouse_y;367 kk->mouse.x = mevent.x; 368 kk->mouse.y = mevent.y; 369 370 return CACA_EVENT_MOUSE_MOTION | (kk->mouse.x << 12) | kk->mouse.y; 371 371 } 372 372 -
libcaca/trunk/caca/driver_slang.c
r550 r551 288 288 _push_event(kk, CACA_EVENT_MOUSE_RELEASE | button); 289 289 290 if(kk->mouse _x == x && kk->mouse_y == y)290 if(kk->mouse.x == x && kk->mouse.y == y) 291 291 return _pop_event(kk); 292 292 293 kk->mouse _x = x;294 kk->mouse _y = y;295 296 return CACA_EVENT_MOUSE_MOTION | (kk->mouse _x << 12) | kk->mouse_y;293 kk->mouse.x = x; 294 kk->mouse.y = y; 295 296 return CACA_EVENT_MOUSE_MOTION | (kk->mouse.x << 12) | kk->mouse.y; 297 297 } 298 298 -
libcaca/trunk/caca/driver_win32.c
r550 r551 262 262 COORD pos = rec.Event.MouseEvent.dwMousePosition; 263 263 264 if(kk->mouse _x == (unsigned int)pos.X &&265 kk->mouse _y == (unsigned int)pos.Y)264 if(kk->mouse.x == (unsigned int)pos.X && 265 kk->mouse.y == (unsigned int)pos.Y) 266 266 continue; 267 267 268 kk->mouse_x = pos.X; 269 kk->mouse_y = pos.Y; 270 271 return CACA_EVENT_MOUSE_MOTION | (kk->mouse_x << 12) | kk->mouse_y; 268 kk->mouse.x = pos.X; 269 kk->mouse.y = pos.Y; 270 271 return CACA_EVENT_MOUSE_MOTION 272 | (kk->mouse.x << 12) | kk->mouse.y; 272 273 } 273 274 #if 0 -
libcaca/trunk/caca/driver_x11.c
r550 r551 388 388 newy = kk->qq->height - 1; 389 389 390 if(kk->mouse _x == newx && kk->mouse_y == newy)390 if(kk->mouse.x == newx && kk->mouse.y == newy) 391 391 continue; 392 392 393 kk->mouse _x = newx;394 kk->mouse _y = newy;395 396 return CACA_EVENT_MOUSE_MOTION | (kk->mouse _x << 12) | kk->mouse_y;393 kk->mouse.x = newx; 394 kk->mouse.y = newy; 395 396 return CACA_EVENT_MOUSE_MOTION | (kk->mouse.x << 12) | kk->mouse.y; 397 397 } 398 398 -
libcaca/trunk/caca/event.c
r550 r551 104 104 unsigned int caca_get_mouse_x(caca_t *kk) 105 105 { 106 if(kk->mouse _x >= kk->qq->width)107 kk->mouse _x = kk->qq->width - 1;108 109 return kk->mouse _x;106 if(kk->mouse.x >= kk->qq->width) 107 kk->mouse.x = kk->qq->width - 1; 108 109 return kk->mouse.x; 110 110 } 111 111 … … 121 121 unsigned int caca_get_mouse_y(caca_t *kk) 122 122 { 123 if(kk->mouse _y >= kk->qq->height)124 kk->mouse _y = kk->qq->height - 1;125 126 return kk->mouse _y;123 if(kk->mouse.y >= kk->qq->height) 124 kk->mouse.y = kk->qq->height - 1; 125 126 return kk->mouse.y; 127 127 } 128 128
Note: See TracChangeset
for help on using the changeset viewer.