Pointer (Mouse) Functions

Functions that deal with the status of the pointer (mouse cursor). More...

Functions

void evas_pointer_output_xy_get (const Evas *e, int *x, int *y)
 This function returns the current known pointer co-ordinates. More...
 
void evas_pointer_canvas_xy_get (const Evas *e, Evas_Coord *x, Evas_Coord *y)
 This function returns the current known pointer co-ordinates. More...
 
int evas_pointer_button_down_mask_get (const Evas *e)
 Returns a bitmask with the mouse buttons currently pressed, set to 1. More...
 
Eina_Bool evas_pointer_inside_get (const Evas *e)
 Returns whether the mouse pointer is logically inside the canvas. More...
 
#define evas_canvas_pointer_output_xy_get(x, y)   EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_POINTER_OUTPUT_XY_GET), EO_TYPECHECK(int *, x), EO_TYPECHECK(int *, y)
 
#define evas_canvas_pointer_canvas_xy_get(x, y)   EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_POINTER_CANVAS_XY_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
 
#define evas_canvas_pointer_button_down_mask_get(ret)   EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_POINTER_BUTTON_DOWN_MASK_GET), EO_TYPECHECK(int *, ret)
 
#define evas_canvas_pointer_inside_get(ret)   EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_POINTER_INSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret)
 
#define evas_canvas_sync()   EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_SYNC)
 

Detailed Description

Functions that deal with the status of the pointer (mouse cursor).

Macro Definition Documentation

§ evas_canvas_pointer_output_xy_get

#define evas_canvas_pointer_output_xy_get (   x,
 
)    EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_POINTER_OUTPUT_XY_GET), EO_TYPECHECK(int *, x), EO_TYPECHECK(int *, y)
Since
1.8

This function returns the current known pointer co-ordinates

Parameters
[out]x
[out]y
See also
evas_pointer_output_xy_get

Referenced by evas_pointer_output_xy_get().

§ evas_canvas_pointer_canvas_xy_get

#define evas_canvas_pointer_canvas_xy_get (   x,
 
)    EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_POINTER_CANVAS_XY_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
Since
1.8

This function returns the current known pointer co-ordinates

Parameters
[out]x
[out]y
See also
evas_pointer_canvas_xy_get

Referenced by evas_pointer_canvas_xy_get().

§ evas_canvas_pointer_button_down_mask_get

#define evas_canvas_pointer_button_down_mask_get (   ret)    EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_POINTER_BUTTON_DOWN_MASK_GET), EO_TYPECHECK(int *, ret)
Since
1.8

Returns a bitmask with the mouse buttons currently pressed, set to 1

Parameters
[out]ret
See also
evas_pointer_button_down_mask_get

Referenced by evas_pointer_button_down_mask_get().

§ evas_canvas_pointer_inside_get

#define evas_canvas_pointer_inside_get (   ret)    EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_POINTER_INSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret)
Since
1.8

Returns whether the mouse pointer is logically inside the canvas

Parameters
[out]ret
See also
evas_pointer_inside_get

Referenced by evas_pointer_inside_get().

§ evas_canvas_sync

#define evas_canvas_sync ( )    EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_SYNC)
Since
1.8

No description supplied by the EAPI.

Referenced by evas_render_idle_flush().

Function Documentation

§ evas_pointer_output_xy_get()

void evas_pointer_output_xy_get ( const Evas e,
int *  x,
int *  y 
)

This function returns the current known pointer co-ordinates.

Parameters
eThe pointer to the Evas Canvas
xThe pointer to an integer to be filled in
yThe pointer to an integer to be filled in

This function returns the current known screen/output co-ordinates of the mouse pointer and sets the contents of the integers pointed to by x and y to contain these co-ordinates. If e is not a valid canvas the results of this function are undefined.

Example:

extern Evas *evas;
int mouse_x, mouse_y;
evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);

References EAPI, EINA_UNUSED, and evas_canvas_pointer_output_xy_get.

§ evas_pointer_canvas_xy_get()

void evas_pointer_canvas_xy_get ( const Evas e,
Evas_Coord *  x,
Evas_Coord *  y 
)

This function returns the current known pointer co-ordinates.

Parameters
eThe pointer to the Evas Canvas
xThe pointer to a Evas_Coord to be filled in
yThe pointer to a Evas_Coord to be filled in

This function returns the current known canvas unit co-ordinates of the mouse pointer and sets the contents of the Evas_Coords pointed to by x and y to contain these co-ordinates. If e is not a valid canvas the results of this function are undefined.

Example:

extern Evas *evas;
Evas_Coord mouse_x, mouse_y;
evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y);
printf("Mouse is at canvas position %d, %d\n", mouse_x, mouse_y);

References EAPI, EINA_UNUSED, and evas_canvas_pointer_canvas_xy_get.

§ evas_pointer_button_down_mask_get()

int evas_pointer_button_down_mask_get ( const Evas e)

Returns a bitmask with the mouse buttons currently pressed, set to 1.

Parameters
eThe pointer to the Evas Canvas
Returns
A bitmask of the currently depressed buttons on the canvas

Calling this function will return a 32-bit integer with the appropriate bits set to 1 that correspond to a mouse button being depressed. This limits Evas to a mouse devices with a maximum of 32 buttons, but that is generally in excess of any host system's pointing device abilities.

A canvas by default begins with no mouse buttons being pressed and only calls to evas_event_feed_mouse_down(), evas_event_feed_mouse_down_data(), evas_event_feed_mouse_up() and evas_event_feed_mouse_up_data() will alter that.

The least significant bit corresponds to the first mouse button (button 1) and the most significant bit corresponds to the last mouse button (button 32).

If e is not a valid canvas, the return value is undefined.

Example:

extern Evas *evas;
int button_mask, i;
printf("Buttons currently pressed:\n");
for (i = 0; i < 32; i++)
{
if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1);
}

References EAPI, EINA_UNUSED, and evas_canvas_pointer_button_down_mask_get.

§ evas_pointer_inside_get()

Eina_Bool evas_pointer_inside_get ( const Evas e)

Returns whether the mouse pointer is logically inside the canvas.

Parameters
eThe pointer to the Evas Canvas
Returns
An integer that is 1 if the mouse is inside the canvas, 0 otherwise

When this function is called it will return a value of either 0 or 1, depending on if evas_event_feed_mouse_in(), evas_event_feed_mouse_in_data(), or evas_event_feed_mouse_out(), evas_event_feed_mouse_out_data() have been called to feed in a mouse enter event into the canvas.

A return value of 1 indicates the mouse is logically inside the canvas, and 0 implies it is logically outside the canvas.

A canvas begins with the mouse being assumed outside (0).

If e is not a valid canvas, the return value is undefined.

Example:

extern Evas *evas;
if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n");
else printf("Mouse is out!\n");

References EAPI, EINA_FALSE, EINA_UNUSED, and evas_canvas_pointer_inside_get.