Ecore_FB - Frame buffer convenience functions.

Modules | Macros | Typedefs | Enumerations | Functions | Variables
Ecore_FB - Frame buffer convenience functions.
Ecore

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

## Modules
| 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. More...
EAPI int | ecore_fb_shutdown (void)
| Shut down the Ecore_Fb library. More...
EAPI void | ecore_fb_size_get (int *w, int *h)
| Retrieve the width and height of the current frame buffer in pixels. More...
static void | _ecore_fb_size_get (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. More...
EAPI void | ecore_fb_callback_lose_set (void(*func)(void *data), void *data)
| Set a callback called when a virtual terminal is lost. More...
EAPI Ecore_Fb_Input_Device * | ecore_fb_input_device_open (const char *dev)
| Open an input device. More...
EAPI void | ecore_fb_input_device_close (Ecore_Fb_Input_Device *dev)
| Close the given device. More...
EAPI void | ecore_fb_input_device_listen (Ecore_Fb_Input_Device *dev, Eina_Bool listen)
| Set the listen mode for an input device . More...
EAPI const char * | ecore_fb_input_device_name_get (Ecore_Fb_Input_Device *dev)
| Retrieve the name of the given device. More...
EAPI Ecore_Fb_Input_Device_Cap | ecore_fb_input_device_cap_get (Ecore_Fb_Input_Device *dev)
| Retrieve the capability of the given device. More...
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. More...
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. More...
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. More...
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. More...
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. More...
double | ecore_fb_input_device_threshold_click_get (Ecore_Fb_Input_Device *dev)
| Get the threshold of mouse clicks of the given device. More...

## 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()

EAPI void ecore_fb_callback_gain_set | ( | void(*)(void *data) | func,
|  | 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()

EAPI void ecore_fb_callback_lose_set | ( | void(*)(void *data) | func,
|  | 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.

## ◆ 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);

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.

References ecore_event_add(), ecore_loop_time_get(), EINA_UNUSED, _Ecore_Event_Mouse_Move::event_window, _Ecore_Event_Mouse_Move::root, _Ecore_Event_Mouse_Move::root_window, _Ecore_Event_Mouse_Move::same_screen, _Ecore_Event_Mouse_Move::timestamp, _Ecore_Event_Mouse_Move::window, _Ecore_Event_Mouse_Move::x, and _Ecore_Event_Mouse_Move::y.

## ◆ 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.

## ◆ 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.