mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add multi-touch support for OSR (issue #1059)
This commit is contained in:
committed by
Marshall Greenblatt
parent
9ba28dd730
commit
5f615a95bc
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f99ba0878f8b6313adc7a43ad1fa295304fa9bcb$
|
||||
// $hash=15f23de47af54fa690b6c5810e3049f97ae2aabd$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||
@@ -617,6 +617,12 @@ typedef struct _cef_browser_host_t {
|
||||
int deltaX,
|
||||
int deltaY);
|
||||
|
||||
///
|
||||
// Send a touch event to the browser for a windowless browser.
|
||||
///
|
||||
void(CEF_CALLBACK* send_touch_event)(struct _cef_browser_host_t* self,
|
||||
const struct _cef_touch_event_t* event);
|
||||
|
||||
///
|
||||
// Send a focus event to the browser.
|
||||
///
|
||||
|
@@ -638,6 +638,12 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
|
||||
int deltaX,
|
||||
int deltaY) = 0;
|
||||
|
||||
///
|
||||
// Send a touch event to the browser for a windowless browser.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SendTouchEvent(const CefTouchEvent& event) = 0;
|
||||
|
||||
///
|
||||
// Send a focus event to the browser.
|
||||
///
|
||||
|
@@ -1696,6 +1696,74 @@ typedef struct _cef_mouse_event_t {
|
||||
uint32 modifiers;
|
||||
} cef_mouse_event_t;
|
||||
|
||||
///
|
||||
// Touch points states types.
|
||||
///
|
||||
typedef enum {
|
||||
CEF_TET_RELEASED = 0,
|
||||
CEF_TET_PRESSED,
|
||||
CEF_TET_MOVED,
|
||||
CEF_TET_CANCELLED
|
||||
} cef_touch_event_type_t;
|
||||
|
||||
///
|
||||
// Structure representing touch event information.
|
||||
///
|
||||
typedef struct _cef_touch_event_t {
|
||||
///
|
||||
// Id of a touch point. Must be unique per touch, can be any number except -1.
|
||||
// Note that a maximum of 16 concurrent touches will be tracked; touches
|
||||
// beyond that will be ignored.
|
||||
///
|
||||
int id;
|
||||
|
||||
///
|
||||
// X coordinate relative to the left side of the view.
|
||||
///
|
||||
float x;
|
||||
|
||||
///
|
||||
// Y coordinate relative to the top side of the view.
|
||||
///
|
||||
float y;
|
||||
|
||||
///
|
||||
// X radius in pixels. Set to 0 if not applicable.
|
||||
///
|
||||
float radius_x;
|
||||
|
||||
///
|
||||
// Y radius in pixels. Set to 0 if not applicable.
|
||||
///
|
||||
float radius_y;
|
||||
|
||||
///
|
||||
// Rotation angle in radians. Set to 0 if not applicable.
|
||||
///
|
||||
float rotation_angle;
|
||||
|
||||
///
|
||||
// The normalized pressure of the pointer input in the range of [0,1].
|
||||
// Set to 0 if not applicable.
|
||||
///
|
||||
float pressure;
|
||||
|
||||
///
|
||||
// The state of the touch point. Touches begin with one CEF_TET_PRESSED event
|
||||
// followed by zero or more CEF_TET_MOVED events and finally one
|
||||
// CEF_TET_RELEASED or CEF_TET_CANCELLED event. Events not respecting this
|
||||
// order will be ignored.
|
||||
///
|
||||
cef_touch_event_type_t type;
|
||||
|
||||
///
|
||||
// Bit flags describing any pressed modifier keys. See
|
||||
// cef_event_flags_t for values.
|
||||
///
|
||||
uint32 modifiers;
|
||||
|
||||
} cef_touch_event_t;
|
||||
|
||||
///
|
||||
// Paint element types.
|
||||
///
|
||||
|
@@ -481,6 +481,25 @@ struct CefMouseEventTraits {
|
||||
///
|
||||
typedef CefStructBase<CefMouseEventTraits> CefMouseEvent;
|
||||
|
||||
struct CefTouchEventTraits {
|
||||
typedef cef_touch_event_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void set(const struct_type* src,
|
||||
struct_type* target,
|
||||
bool copy) {
|
||||
*target = *src;
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing a touch event.
|
||||
///
|
||||
typedef CefStructBase<CefTouchEventTraits> CefTouchEvent;
|
||||
|
||||
struct CefPopupFeaturesTraits {
|
||||
typedef cef_popup_features_t struct_type;
|
||||
|
||||
|
Reference in New Issue
Block a user