#include <stdlib.h>
#include <string.h>
#include "events/mouse_event.h"
#include "core/document.h"
#include "utils/utils.h"
|
dom_exception | _dom_mouse_event_create (struct dom_mouse_event **evt) |
|
void | _dom_mouse_event_destroy (struct dom_mouse_event *evt) |
|
dom_exception | _dom_mouse_event_initialise (struct dom_mouse_event *evt) |
|
dom_exception | _dom_mouse_event_get_screen_x (dom_mouse_event *evt, int32_t *x) |
|
dom_exception | _dom_mouse_event_get_screen_y (dom_mouse_event *evt, int32_t *y) |
|
dom_exception | _dom_mouse_event_get_client_x (dom_mouse_event *evt, int32_t *x) |
|
dom_exception | _dom_mouse_event_get_client_y (dom_mouse_event *evt, int32_t *y) |
|
dom_exception | _dom_mouse_event_get_ctrl_key (dom_mouse_event *evt, bool *key) |
|
dom_exception | _dom_mouse_event_get_shift_key (dom_mouse_event *evt, bool *key) |
|
dom_exception | _dom_mouse_event_get_alt_key (dom_mouse_event *evt, bool *key) |
|
dom_exception | _dom_mouse_event_get_meta_key (dom_mouse_event *evt, bool *key) |
|
dom_exception | _dom_mouse_event_get_button (dom_mouse_event *evt, unsigned short *button) |
|
dom_exception | _dom_mouse_event_get_related_target (dom_mouse_event *evt, dom_event_target **et) |
|
dom_exception | _dom_mouse_event_get_modifier_state (dom_mouse_event *evt, dom_string *m, bool *state) |
|
dom_exception | _dom_mouse_event_init (dom_mouse_event *evt, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, int32_t detail, int32_t screen_x, int32_t screen_y, int32_t client_x, int32_t client_y, bool ctrl, bool alt, bool shift, bool meta, unsigned short button, dom_event_target *et) |
|
dom_exception | _dom_mouse_event_init_ns (dom_mouse_event *evt, dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, int32_t detail, int32_t screen_x, int32_t screen_y, int32_t client_x, int32_t client_y, bool ctrl, bool alt, bool shift, bool meta, unsigned short button, dom_event_target *et) |
|
◆ _dom_mouse_event_create()
◆ _dom_mouse_event_destroy()
◆ _dom_mouse_event_get_alt_key()
Get the alt key state
- Parameters
-
evt | The Event object |
key | Whether the Alt key is pressed down |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_get_button()
Get the button which get pressed
- Parameters
-
evt | The Event object |
button | The pressed mouse button |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_get_client_x()
Get clientX
- Parameters
-
evt | The Event object |
x | The returned clientX |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_get_client_y()
Get clientY
- Parameters
-
evt | The Event object |
y | The returned clientY |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_get_ctrl_key()
Get the ctrl key state
- Parameters
-
evt | The Event object |
key | Whether the Control key is pressed down |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_get_meta_key()
Get the meta key state
- Parameters
-
evt | The Event object |
key | Whether the Meta key is pressed down |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_get_modifier_state()
Query the state of a modifier using a key identifier
- Parameters
-
evt | The event object |
ml | The modifier identifier, such as "Alt", "Control", "Meta", "AltGraph", "CapsLock", "NumLock", "Scroll", "Shift". |
state | Whether the modifier key is pressed |
- Returns
- DOM_NO_ERR on success, appropriate dom_exception on failure.
- Note
- : If an application wishes to distinguish between right and left modifiers, this information could be deduced using keyboard events and KeyboardEvent.keyLocation.
◆ _dom_mouse_event_get_related_target()
Get the related target
- Parameters
-
evt | The Event object |
et | The related EventTarget |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_get_screen_x()
Get screenX
- Parameters
-
evt | The Event object |
x | The returned screenX |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_get_screen_y()
Get screenY
- Parameters
-
evt | The Event object |
y | The returned screenY |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_get_shift_key()
Get the shift key state
- Parameters
-
evt | The Event object |
key | Whether the Shift key is pressed down |
- Returns
- DOM_NO_ERR.
◆ _dom_mouse_event_init()
dom_exception _dom_mouse_event_init |
( |
dom_mouse_event * | evt, |
|
|
dom_string * | type, |
|
|
bool | bubble, |
|
|
bool | cancelable, |
|
|
struct dom_abstract_view * | view, |
|
|
int32_t | detail, |
|
|
int32_t | screen_x, |
|
|
int32_t | screen_y, |
|
|
int32_t | client_x, |
|
|
int32_t | client_y, |
|
|
bool | ctrl, |
|
|
bool | alt, |
|
|
bool | shift, |
|
|
bool | meta, |
|
|
unsigned short | button, |
|
|
dom_event_target * | et ) |
Initialise this mouse event
- Parameters
-
evt | The Event object |
type | The event's type |
bubble | Whether this is a bubbling event |
cancelable | Whether this is a cancelable event |
view | The AbstractView associated with this event |
detail | The detail information of this mouse event |
screen_x | The x position of the mouse pointer in screen |
screen_y | The y position of the mouse pointer in screen |
client_x | The x position of the mouse pointer in client window |
client_y | The y position of the mouse pointer in client window |
alt | The state of Alt key, true for pressed, false otherwise |
shift | The state of Shift key, true for pressed, false otherwise |
mata | The state of Meta key, true for pressed, false otherwise |
button | The mouse button pressed |
et | The related target of this event, may be NULL |
- Returns
- DOM_NO_ERR on success, appropriate dom_exception on failure.
◆ _dom_mouse_event_init_ns()
dom_exception _dom_mouse_event_init_ns |
( |
dom_mouse_event * | evt, |
|
|
dom_string * | namespace, |
|
|
dom_string * | type, |
|
|
bool | bubble, |
|
|
bool | cancelable, |
|
|
struct dom_abstract_view * | view, |
|
|
int32_t | detail, |
|
|
int32_t | screen_x, |
|
|
int32_t | screen_y, |
|
|
int32_t | client_x, |
|
|
int32_t | client_y, |
|
|
bool | ctrl, |
|
|
bool | alt, |
|
|
bool | shift, |
|
|
bool | meta, |
|
|
unsigned short | button, |
|
|
dom_event_target * | et ) |
Initialise the event with namespace
- Parameters
-
evt | The Event object |
namespace | The namespace of this event |
type | The event's type |
bubble | Whether this is a bubbling event |
cancelable | Whether this is a cancelable event |
view | The AbstractView associated with this event |
detail | The detail information of this mouse event |
screen_x | The x position of the mouse pointer in screen |
screen_y | The y position of the mouse pointer in screen |
client_x | The x position of the mouse pointer in client window |
client_y | The y position of the mouse pointer in client window |
alt | The state of Alt key, true for pressed, false otherwise |
shift | The state of Shift key, true for pressed, false otherwise |
mata | The state of Meta key, true for pressed, false otherwise |
button | The mouse button pressed |
et | The related target of this event, may be NULL |
- Returns
- DOM_NO_ERR on success, appropriate dom_exception on failure.
◆ _dom_mouse_event_initialise()