mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Extract mouse processor trait
Mainly for consistency with the keyboard processor trait. This could allow to provide alternative mouse processors.
This commit is contained in:
parent
bcf5a9750f
commit
f7d1efdf1d
9 changed files with 298 additions and 184 deletions
39
app/src/trait/mouse_processor.h
Normal file
39
app/src/trait/mouse_processor.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#ifndef SC_MOUSE_PROCESSOR_H
|
||||
#define SC_MOUSE_PROCESSOR_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <SDL2/SDL_events.h>
|
||||
|
||||
/**
|
||||
* Mouse processor trait.
|
||||
*
|
||||
* Component able to process and inject mouse events should implement this
|
||||
* trait.
|
||||
*/
|
||||
struct sc_mouse_processor {
|
||||
const struct sc_mouse_processor_ops *ops;
|
||||
};
|
||||
|
||||
struct sc_mouse_processor_ops {
|
||||
void
|
||||
(*process_mouse_motion)(struct sc_mouse_processor *mp,
|
||||
const SDL_MouseMotionEvent *event);
|
||||
|
||||
void
|
||||
(*process_touch)(struct sc_mouse_processor *mp,
|
||||
const SDL_TouchFingerEvent *event);
|
||||
|
||||
void
|
||||
(*process_mouse_button)(struct sc_mouse_processor *mp,
|
||||
const SDL_MouseButtonEvent *event);
|
||||
|
||||
void
|
||||
(*process_mouse_wheel)(struct sc_mouse_processor *mp,
|
||||
const SDL_MouseWheelEvent *event);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue