* mouseDownAt */
| 355 | * mouseDownAt |
| 356 | */ |
| 357 | WD_RESULT mouseDownAt(WINDOW_HANDLE windowHandle, long x, long y, long button) |
| 358 | { |
| 359 | init_logging(); |
| 360 | |
| 361 | const int timePerEvent = 10 /* ms */; |
| 362 | |
| 363 | LOG(DEBUG) << "---------- starting mouseDownAt: " << windowHandle << "---------"; |
| 364 | GdkDrawable* hwnd = (GdkDrawable*) windowHandle; |
| 365 | |
| 366 | MouseEventsHandler mousep_handler(hwnd); |
| 367 | |
| 368 | struct timespec sleep_time; |
| 369 | sleep_time.tv_sec = timePerEvent / 1000; |
| 370 | sleep_time.tv_nsec = (timePerEvent % 1000) * 1000000; |
| 371 | LOG(DEBUG) << "Sleep time is " << sleep_time.tv_sec << " seconds and " << |
| 372 | sleep_time.tv_nsec << " nanoseconds."; |
| 373 | |
| 374 | list<GdkEvent*> events_for_mouse = mousep_handler.CreateEventsForMouseDown(x, y, button); |
| 375 | submit_and_free_events_list(events_for_mouse, timePerEvent); |
| 376 | |
| 377 | |
| 378 | if (gLatestEventTime < mousep_handler.get_last_event_time()) { |
| 379 | gLatestEventTime = mousep_handler.get_last_event_time(); |
| 380 | } |
| 381 | |
| 382 | LOG(DEBUG) << "---------- Ending mouseDownAt ----------"; |
| 383 | return 0; |
| 384 | } |
| 385 | |
| 386 | /** |
| 387 | * mouseUpAt |
nothing calls this directly
no test coverage detected