Ecore_FB - Frame buffer convenience functions.
Ecore

Functions used to set up and shut down the Ecore_Framebuffer functions. More...

## Topics

| Framebuffer Calibration Functions
| Functions that calibrate the screen.

## Macros

#define | EV_CNT (EV_MAX+1)

## Typedefs

typedef struct _Ecore_Fb_Input_Device | Ecore_Fb_Input_Device
| Input device handler.
typedef enum _Ecore_Fb_Input_Device_Cap | Ecore_Fb_Input_Device_Cap
| Device capabilities.

## Enumerations

enum | _Ecore_Fb_Input_Device_Cap { ECORE_FB_INPUT_DEVICE_CAP_NONE = 0x00000000 , ECORE_FB_INPUT_DEVICE_CAP_RELATIVE = 0x00000001 , ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE = 0x00000002 , ECORE_FB_INPUT_DEVICE_CAP_KEYS_OR_BUTTONS = 0x00000004 }
| Device capabilities.

## Functions

static void | nosigint (int val)
EAPI int | ecore_fb_init (const char *name)
| Initialize the Ecore_Fb library.
EAPI int | ecore_fb_shutdown (void)
| Shut down the Ecore_Fb library.
EAPI void | ecore_fb_size_get (int *w, int *h)
| Retrieve the width and height of the current frame buffer in pixels.
static void | _ecore_fb_size_get (const char *name, int *w, int *h)
EAPI void | ecore_fb_callback_gain_set (void(*func)(void *data), void *data)
| Set a callback called when a virtual terminal is gained.
EAPI void | ecore_fb_callback_lose_set (void(*func)(void *data), void *data)
| Set a callback called when a virtual terminal is lost.
EAPI Ecore_Fb_Input_Device * | ecore_fb_input_device_open (const char *dev)
| Open an input device.
EAPI void | ecore_fb_input_device_close (Ecore_Fb_Input_Device *dev)
| Close the given device.
EAPI void | ecore_fb_input_device_listen (Ecore_Fb_Input_Device *dev, Eina_Bool listen)
| Set the listen mode for an input device .
EAPI const char * | ecore_fb_input_device_name_get (Ecore_Fb_Input_Device *dev)
| Retrieve the name of the given device.
EAPI Ecore_Fb_Input_Device_Cap | ecore_fb_input_device_cap_get (Ecore_Fb_Input_Device *dev)
| Retrieve the capability of the given device.
EAPI void | ecore_fb_input_device_axis_size_set (Ecore_Fb_Input_Device *dev, int w, int h)
| Set the axis size of the given device.
EAPI void | ecore_fb_input_threshold_click_set (Ecore_Fb_Input_Device *dev, double threshold)
EAPI double | ecore_fb_input_threshold_click_get (Ecore_Fb_Input_Device *dev)
EAPI void | ecore_fb_input_device_window_set (Ecore_Fb_Input_Device *dev, void *window)
| Associates an input device with the given Ecore_Evas wrapper/helper set of functions.
EAPI void | ecore_fb_touch_screen_calibrate_set (int xscale, int xtrans, int yscale, int ytrans, int xyswap)
| Calibrates the touschreen using the given parameters.
EAPI void | ecore_fb_touch_screen_calibrate_get (int *xscale, int *xtrans, int *yscale, int *ytrans, int *xyswap)
| Retrieves the calibration parameters of the touchscreen.
void | ecore_fb_input_device_threshold_click_set (Ecore_Fb_Input_Device *dev, double threshold)
| Set the threshold of mouse clicks of the given device.
double | ecore_fb_input_device_threshold_click_get (Ecore_Fb_Input_Device *dev)
| Get the threshold of mouse clicks of the given device.

## Variables

static sighandler_t | oldhand = NULL

## Detailed Description

Functions used to set up and shut down the Ecore_Framebuffer functions.

## Function Documentation

## ecore_fb_init()

EAPI int ecore_fb_init | ( | const char * | name | ) |

Initialize the Ecore_Fb library.

Parameters

  name | Device target name.

Returns
  1 or greater on success, 0 on error.

This function sets up all the Ecore_Fb library. It returns 0 on failure, otherwise it returns the number of times it has already been called.

When Ecore_Fb is not used anymore, call ecore_fb_shutdown() to shut down the Ecore_Fb library.

## ecore_fb_shutdown()

EAPI int ecore_fb_shutdown | ( | void |  | ) |

Shut down the Ecore_Fb library.

Returns
  0 when the library is completely shut down, 1 or greater otherwise.

This function shuts down the Ecore_Fb library. It returns 0 when it has been called the same number of times than ecore_fb_init().

## ecore_fb_size_get()

EAPI void ecore_fb_size_get | ( | int * | w,
|  | int * | h )

Retrieve the width and height of the current frame buffer in pixels.

Parameters

  w | Pointer to an integer in which to store the width.
  h | Pointer to an interge in which to store the height.

This function retrieves the size of the current frame buffer in pixels. `w` and `h` can be buffers that will be filled with the corresponding values. If one of them is `NULL`, nothing will be done for that parameter.

## ecore_fb_callback_gain_set()

void ecore_fb_callback_gain_set | ( | void(* | func )(void *data),
|  | void * | data )

Set a callback called when a virtual terminal is gained.

Parameters

  func | The callback called when vt is gained.
  data | The data to pass to the callback.

This function sets the callback `func` which will be called when a virtual terminal is gained (for example you press Ctrl-Alt-F1 to go to vt1 and your app was using vt1). `data` will be pass to `func` if the callback is called.

## ecore_fb_callback_lose_set()

void ecore_fb_callback_lose_set | ( | void(* | func )(void *data),
|  | void * | data )

Set a callback called when a virtual terminal is lost.

Parameters

  func | The callback called when vt is lost.
  data | The data to pass to the callback.

This function sets the callback `func` which will be called when a virtual terminal is lost (someone wants the vt from you and you want to give up that vt). `data` will be pass to `func` if the callback is called.

## ecore_fb_input_device_open()

Ecore_Fb_Input_Device * ecore_fb_input_device_open | ( | const char * | dev | ) |

Open an input device.

Parameters

  dev | The device to open.

Returns
  The Ecore_Fb_Input_Device object that has been opened.

This function opens the input device named `dev` and returns the object for it, or returns `NULL` on failure.

References eina_list_append().

## ecore_fb_input_device_close()

void ecore_fb_input_device_close | ( | Ecore_Fb_Input_Device * | dev | ) |

Close the given device.

Parameters

  dev | The device to close

This function closes the device `dev`. If `dev` is `NULL`, this function does nothing.

References eina_list_remove().

## ecore_fb_input_device_listen()

void ecore_fb_input_device_listen | ( | Ecore_Fb_Input_Device * | dev,
|  | Eina_Bool | listen )

Set the listen mode for an input device .

Parameters

  dev | The device to set the mode of.
  listen | `EINA_FALSE` to disable listening mode, `EINA_TRUE` to enable it.

This function enables or disables listening on the input device `dev`. If `listen` is `EINA_FALSE`, listening mode is disabled, if it is `EINA_TRUE`, it is enabled.

References ECORE_FD_READ, and ecore_main_fd_handler_add().

## ecore_fb_input_device_name_get()

const char * ecore_fb_input_device_name_get | ( | Ecore_Fb_Input_Device * | dev | ) |

Retrieve the name of the given device.

Parameters

  dev | The device to get the name from.

Returns
  The name of the device.

This function returns the name of the device `dev`. If `dev` is `NULL`, this function returns `NULL`.

## ecore_fb_input_device_cap_get()

Ecore_Fb_Input_Device_Cap ecore_fb_input_device_cap_get | ( | Ecore_Fb_Input_Device * | dev | ) |

Retrieve the capability of the given device.

Parameters

  dev | The device to get the name from.

Returns
  The capability of the device.

This function returns the capability of the device `dev`. If `dev` is `NULL`, this function returns ECORE_FB_INPUT_DEVICE_CAP_NONE.

## ecore_fb_input_device_axis_size_set()

void ecore_fb_input_device_axis_size_set | ( | Ecore_Fb_Input_Device * | dev,
|  | int | w,
|  | int | h )

Set the axis size of the given device.

Parameters

  dev | The device to set the axis size to.
  w | The width of the axis.
  h | The height of the axis.

This function sets set the width `w` and height `h` of the axis of device `dev`. If `dev` is a relative input device, a width and height must set for it. If its absolute set the ioctl correctly, if not, unsupported device.

## ecore_fb_input_device_window_set()

void ecore_fb_input_device_window_set | ( | Ecore_Fb_Input_Device * | dev,
|  | void * | window )

Associates an input device with the given Ecore_Evas wrapper/helper set of functions.

Parameters

  dev | The input being associated with an Ecore_Evas wrapper/helper set of functions (not `NULL`).
  window | The window which this input is being associated to. `NULL` will remove any previous association.

Events generated by this device will have a pointer to `window`. If this `window` is registered with ecore_event_window_register() or ecore_evas_input_event_register(), respective evas events will be delivered by the ecore_input_evas system. An example can be seen in the following code:

Ecore_Evas *ee = ecore_evas_new(NULL, 0, 0, 800, 600, NULL);
ecore_evas_input_event_register(ee);
device = ecore_fb_input_device_open(device_path);
if (device)
ecore_fb_input_device_window_set(device, ee);
ecore_evas_input_event_register
EAPI void ecore_evas_input_event_register(Ecore_Evas *ee)
Registers an Ecore_Evas to receive events through ecore_input_evas.
Definition ecore_evas.c:3862
ecore_evas_new
EAPI Ecore_Evas * ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options)
Creates a new Ecore_Evas based on engine name and common parameters.
Definition ecore_evas.c:1053
ecore_fb_input_device_open
EAPI Ecore_Fb_Input_Device * ecore_fb_input_device_open(const char *dev)
Open an input device.
Definition ecore_fb_li.c:527
ecore_fb_input_device_window_set
EAPI void ecore_fb_input_device_window_set(Ecore_Fb_Input_Device *dev, void *window)
Associates an input device with the given Ecore_Evas wrapper/helper set of functions.
Definition ecore_fb_li.c:510

On the previous code, all input captured on the mentioned device will be delivered to the `Ecore_Evas` `ee`.

Since
  1.1

## ecore_fb_touch_screen_calibrate_set()

EAPI void ecore_fb_touch_screen_calibrate_set | ( | int | xscale,
|  | int | xtrans,
|  | int | yscale,
|  | int | ytrans,
|  | int | xyswap )

Calibrates the touschreen using the given parameters.

Parameters

  xscale | X scaling, where 256 = 1.0
  xtrans | X translation.
  yscale | Y scaling.
  ytrans | Y translation.
  xyswap | Swap X & Y flag.

## ecore_fb_touch_screen_calibrate_get()

EAPI void ecore_fb_touch_screen_calibrate_get | ( | int * | xscale,
|  | int * | xtrans,
|  | int * | yscale,
|  | int * | ytrans,
|  | int * | xyswap )

Retrieves the calibration parameters of the touchscreen.

Parameters

  xscale | Pointer to an integer in which to store the X scaling. Note that 256 = 1.0.
  xtrans | Pointer to an integer in which to store the X translation.
  yscale | Pointer to an integer in which to store the Y scaling.
  ytrans | Pointer to an integer in which to store the Y translation.
  xyswap | Pointer to an integer in which to store the Swap X & Y flag.

## ecore_fb_input_device_threshold_click_set()

void ecore_fb_input_device_threshold_click_set | ( | Ecore_Fb_Input_Device * | dev,
|  | double | threshold )

Set the threshold of mouse clicks of the given device.

Parameters

  dev | The device to set the threshodl mouse click to.
  threshold | The threshold value.

This function sets the threshold of mouse clicks of the device `dev` to `threshold`. If `dev` is `NULL`, this function does nothing.

References EINA_DBL_EQ.

## ecore_fb_input_device_threshold_click_get()

double ecore_fb_input_device_threshold_click_get | ( | Ecore_Fb_Input_Device * | dev | ) |

Get the threshold of mouse clicks of the given device.

Parameters

  dev | The device to set the threshodl mouse click from.

Returns
  The threshold value.

This function returns the threshold of mouse clicks of the device `dev`. If `dev` is `NULL`, this function returns 0.0.