forked from enlightenment/efl
parent
eeb330adc3
commit
9243d767a7
|
@ -57,7 +57,7 @@ The Ecore library provides the following modules:
|
|||
@li @link Ecore.h Ecore - Main Loop and Job Functions. @endlink
|
||||
@li @ref Ecore_Con_Group
|
||||
@li @link Ecore_Evas.h Ecore_Evas - Evas convenience functions. @endlink
|
||||
@li @link Ecore_Fb.h Ecore_FB - Frame buffer convenience functions. @endlink
|
||||
@li @ref Ecore_FB_Group
|
||||
@li @link Ecore_Ipc.h Ecore_IPC - Inter Process Communication functions. @endlink
|
||||
@li @link Ecore_X.h Ecore_X - X Windows System wrapper. @endlink
|
||||
@li @ref Ecore_Win32_Group
|
||||
|
|
|
@ -17,11 +17,6 @@
|
|||
# define EAPI
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Ecore frame buffer system functions.
|
||||
*/
|
||||
|
||||
/* FIXME:
|
||||
* maybe a new module?
|
||||
* - code to get battery info
|
||||
|
@ -38,9 +33,24 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _Ecore_Fb_Input_Device Ecore_Fb_Input_Device; /* an input device handler */
|
||||
/**
|
||||
* @defgroup Ecore_FB_Group Ecore_FB - Frame buffer convenience functions.
|
||||
*
|
||||
* Functions used to set up and shut down the Ecore_Framebuffer functions.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* device capabilities */
|
||||
/**
|
||||
* @typedef Ecore_Fb_Input_Device
|
||||
* Input device handler.
|
||||
*/
|
||||
typedef struct _Ecore_Fb_Input_Device Ecore_Fb_Input_Device;
|
||||
|
||||
/**
|
||||
* @enum _Ecore_Fb_Input_Device_Cap
|
||||
* Device capabilities.
|
||||
*/
|
||||
enum _Ecore_Fb_Input_Device_Cap
|
||||
{
|
||||
ECORE_FB_INPUT_DEVICE_CAP_NONE = 0x00000000,
|
||||
|
@ -48,6 +58,11 @@ enum _Ecore_Fb_Input_Device_Cap
|
|||
ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE = 0x00000002,
|
||||
ECORE_FB_INPUT_DEVICE_CAP_KEYS_OR_BUTTONS = 0x00000004
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef Ecore_Fb_Input_Device_Cap
|
||||
* Device capabilities.
|
||||
*/
|
||||
typedef enum _Ecore_Fb_Input_Device_Cap Ecore_Fb_Input_Device_Cap;
|
||||
|
||||
EAPI extern int ECORE_FB_EVENT_KEY_DOWN; /**< FB Key Down event */
|
||||
|
@ -64,7 +79,11 @@ typedef struct _Ecore_Fb_Event_Mouse_Button_Up Ecore_Fb_Event_Mouse_Button_Up;
|
|||
typedef struct _Ecore_Fb_Event_Mouse_Move Ecore_Fb_Event_Mouse_Move; /**< FB Mouse Move event */
|
||||
typedef struct _Ecore_Fb_Event_Mouse_Wheel Ecore_Fb_Event_Mouse_Wheel; /**< FB Mouse Wheel event */
|
||||
|
||||
struct _Ecore_Fb_Event_Key_Down /** FB Key Down event */
|
||||
/**
|
||||
* @struct _Ecore_Fb_Event_Key_Down
|
||||
* Framebuffer Key Down event.
|
||||
*/
|
||||
struct _Ecore_Fb_Event_Key_Down
|
||||
{
|
||||
Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
|
||||
char *keyname; /**< The name of the key that was pressed */
|
||||
|
@ -72,7 +91,11 @@ struct _Ecore_Fb_Event_Key_Down /** FB Key Down event */
|
|||
char *key_compose; /**< The UTF-8 string conversion if any */
|
||||
};
|
||||
|
||||
struct _Ecore_Fb_Event_Key_Up /** FB Key Up event */
|
||||
/**
|
||||
* @struct _Ecore_Fb_Event_Key_Up
|
||||
* Framebuffer Key Up event.
|
||||
*/
|
||||
struct _Ecore_Fb_Event_Key_Up
|
||||
{
|
||||
Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
|
||||
char *keyname; /**< The name of the key that was released */
|
||||
|
@ -80,7 +103,11 @@ struct _Ecore_Fb_Event_Key_Up /** FB Key Up event */
|
|||
char *key_compose; /**< The UTF-8 string conversion if any */
|
||||
};
|
||||
|
||||
struct _Ecore_Fb_Event_Mouse_Button_Down /** FB Mouse Down event */
|
||||
/**
|
||||
* @struct _Ecore_Fb_Event_Mouse_Button_Down
|
||||
* Framebuffer Mouse Down event.
|
||||
*/
|
||||
struct _Ecore_Fb_Event_Mouse_Button_Down
|
||||
{
|
||||
Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
|
||||
int button; /**< Mouse button that was pressed (1 - 32) */
|
||||
|
@ -90,7 +117,11 @@ struct _Ecore_Fb_Event_Mouse_Button_Down /** FB Mouse Down event */
|
|||
int triple_click : 1; /**< Set if click was a triple click */
|
||||
};
|
||||
|
||||
struct _Ecore_Fb_Event_Mouse_Button_Up /** FB Mouse Up event */
|
||||
/**
|
||||
* @struct _Ecore_Fb_Event_Mouse_Button_Up
|
||||
* Framebuffer Mouse Up event.
|
||||
*/
|
||||
struct _Ecore_Fb_Event_Mouse_Button_Up
|
||||
{
|
||||
Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
|
||||
int button; /**< Mouse button that was released (1 - 32) */
|
||||
|
@ -100,14 +131,22 @@ struct _Ecore_Fb_Event_Mouse_Button_Up /** FB Mouse Up event */
|
|||
int triple_click : 1; /**< Set if click was a triple click */
|
||||
};
|
||||
|
||||
struct _Ecore_Fb_Event_Mouse_Move /** FB Mouse Move event */
|
||||
/**
|
||||
* @struct _Ecore_Fb_Event_Mouse_Move
|
||||
* Framebuffer Mouse Move event.
|
||||
*/
|
||||
struct _Ecore_Fb_Event_Mouse_Move
|
||||
{
|
||||
Ecore_Fb_Input_Device *dev; /**< The device associated with the event */
|
||||
int x; /**< Mouse co-ordinates where the mouse cursor moved to */
|
||||
int y; /**< Mouse co-ordinates where the mouse cursor moved to */
|
||||
};
|
||||
|
||||
struct _Ecore_Fb_Event_Mouse_Wheel /** FB Mouse Wheel event */
|
||||
/**
|
||||
* @struct _Ecore_Fb_Event_Mouse_Wheel
|
||||
* Framebuffer Mouse Wheel event.
|
||||
*/
|
||||
struct _Ecore_Fb_Event_Mouse_Wheel
|
||||
{
|
||||
Ecore_Fb_Input_Device *dev;
|
||||
int x,y;
|
||||
|
@ -130,6 +169,7 @@ EAPI void ecore_fb_input_threshold_click_set(Ecore_Fb_Input
|
|||
EAPI double ecore_fb_input_threshold_click_get(Ecore_Fb_Input_Device *dev);
|
||||
|
||||
/* ecore_fb.c */
|
||||
|
||||
EAPI int ecore_fb_init(const char *name);
|
||||
EAPI int ecore_fb_shutdown(void);
|
||||
EAPI void ecore_fb_size_get(int *w, int *h);
|
||||
|
@ -137,6 +177,10 @@ EAPI void ecore_fb_size_get(int *w, int *h);
|
|||
EAPI void ecore_fb_touch_screen_calibrate_set(int xscale, int xtrans, int yscale, int ytrans, int xyswap);
|
||||
EAPI void ecore_fb_touch_screen_calibrate_get(int *xscale, int *xtrans, int *yscale, int *ytrans, int *xyswap);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -19,17 +19,23 @@ static int _ecore_fb_console_w = 0;
|
|||
static int _ecore_fb_console_h = 0;
|
||||
|
||||
/**
|
||||
* @defgroup Ecore_FB_Library_Group Framebuffer Library Functions
|
||||
* @addtogroup Ecore_FB_Group Ecore_FB - Frame buffer convenience functions.
|
||||
*
|
||||
* Functions used to set up and shut down the Ecore_Framebuffer functions.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sets up the Ecore_Fb library.
|
||||
* @param name device target name
|
||||
* @return @c 0 on failure. Otherwise, the number of times the library has
|
||||
* been initialised without being shut down.
|
||||
* @ingroup Ecore_FB_Library_Group
|
||||
* @brief Initialize the Ecore_Fb library.
|
||||
*
|
||||
* @param name Device target name.
|
||||
* @return 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.
|
||||
*/
|
||||
EAPI int
|
||||
ecore_fb_init(const char *name __UNUSED__)
|
||||
|
@ -52,10 +58,13 @@ ecore_fb_init(const char *name __UNUSED__)
|
|||
}
|
||||
|
||||
/**
|
||||
* Shuts down the Ecore_Fb library.
|
||||
* @return @c The number of times the system has been initialised without
|
||||
* being shut down.
|
||||
* @ingroup Ecore_FB_Library_Group
|
||||
* @brief Shut down the Ecore_Fb library.
|
||||
*
|
||||
* @return 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().
|
||||
*/
|
||||
EAPI int
|
||||
ecore_fb_shutdown(void)
|
||||
|
@ -70,9 +79,16 @@ ecore_fb_shutdown(void)
|
|||
|
||||
|
||||
/**
|
||||
* Retrieves the width and height of the current frame buffer in pixels.
|
||||
* @brief Retrieve the width and height of the current frame buffer in
|
||||
* pixels.
|
||||
*
|
||||
* @param w Pointer to an integer in which to store the width.
|
||||
* @param h Pointer to an interge in which to store the height.
|
||||
*
|
||||
* This function retrieves the size of the current frame buffer in
|
||||
* pixels. @p w and @p h can be buffers that will be filled with the
|
||||
* corresponding values. If one of them is @c NULL, nothing will be
|
||||
* done for that parameter.
|
||||
*/
|
||||
EAPI void
|
||||
ecore_fb_size_get(int *w, int *h)
|
||||
|
@ -105,3 +121,7 @@ _ecore_fb_size_get(int *w, int *h)
|
|||
if (w) *w = fb_var.xres;
|
||||
if (h) *h = fb_var.yres;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -364,10 +364,20 @@ _ecore_fb_li_device_fd_callback(void *data, Ecore_Fd_Handler *fdh __UNUSED__)
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the listen mode for an input device
|
||||
* @param dev The device to set the mode of
|
||||
* @param listen The mode of listening (EINA_FALSE for off, EINA_TRUE for on)
|
||||
* This enables or disables listening on an input device.
|
||||
* @addtogroup Ecore_FB_Group Ecore_FB - Frame buffer convenience functions.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Set the listen mode for an input device .
|
||||
*
|
||||
* @param dev The device to set the mode of.
|
||||
* @param listen EINA_FALSE to disable listening mode, EINA_TRUE to enable it.
|
||||
*
|
||||
* This function enables or disables listening on the input device @p
|
||||
* dev. If @p listen is #EINA_FALSE, listening mode is disabled, if it
|
||||
* is #EINA_TRUE, it is enabled.
|
||||
*/
|
||||
EAPI void
|
||||
ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, Eina_Bool listen)
|
||||
|
@ -388,11 +398,14 @@ ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, Eina_Bool listen)
|
|||
# define EV_CNT (EV_MAX+1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* @brief Opens an input device
|
||||
* @param dev The device to open
|
||||
* @return The @ref Ecore_Fb_Input_Device object that has been opened
|
||||
* This opens an input device and returns the object for it, or returns NULL on failure.
|
||||
/**
|
||||
* @brief Open an input device.
|
||||
*
|
||||
* @param dev The device to open.
|
||||
* @return The @ref Ecore_Fb_Input_Device object that has been opened.
|
||||
*
|
||||
* This function opens the input device named @p dev and returns the
|
||||
* object for it, or returns @c NULL on failure.
|
||||
*/
|
||||
EAPI Ecore_Fb_Input_Device *
|
||||
ecore_fb_input_device_open(const char *dev)
|
||||
|
@ -468,9 +481,18 @@ error_open:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Close the given device.
|
||||
*
|
||||
* @param dev The device to close
|
||||
*
|
||||
* This function closes the device @p dev. If @p dev is @c NULL, this
|
||||
* function does nothing.
|
||||
*/
|
||||
EAPI void
|
||||
ecore_fb_input_device_close(Ecore_Fb_Input_Device *dev)
|
||||
{
|
||||
if (!fd) return;
|
||||
/* close the fd */
|
||||
close(dev->fd);
|
||||
/* remove the element from the list */
|
||||
|
@ -479,11 +501,17 @@ ecore_fb_input_device_close(Ecore_Fb_Input_Device *dev)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* If the device is a relative input device,
|
||||
* we must set a width and height for it. If its
|
||||
* absolute set the ioctl correctly, if not, unsupported
|
||||
* device
|
||||
/**
|
||||
* @brief Set the axis size of the given device.
|
||||
*
|
||||
* @param dev The device to set the axis size to.
|
||||
* @param w The width of the axis.
|
||||
* @param h The height of the axis.
|
||||
*
|
||||
* This function sets set the width @p w and height @p h of the axis
|
||||
* of device @p dev. If @p 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.
|
||||
*/
|
||||
EAPI void
|
||||
ecore_fb_input_device_axis_size_set(Ecore_Fb_Input_Device *dev, int w, int h)
|
||||
|
@ -517,7 +545,15 @@ ecore_fb_input_device_axis_size_set(Ecore_Fb_Input_Device *dev, int w, int h)
|
|||
dev->mouse.h = h;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Retrieve the name of the given device.
|
||||
*
|
||||
* @param dev The device to get the name from.
|
||||
* @return The name of the device.
|
||||
*
|
||||
* This function returns the name of the device @p dev. If @p dev is
|
||||
* @c NULL, this function returns @c NULL.
|
||||
*/
|
||||
EAPI const char *
|
||||
ecore_fb_input_device_name_get(Ecore_Fb_Input_Device *dev)
|
||||
{
|
||||
|
@ -525,6 +561,15 @@ ecore_fb_input_device_name_get(Ecore_Fb_Input_Device *dev)
|
|||
return dev->info.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieve the capability of the given device.
|
||||
*
|
||||
* @param dev The device to get the name from.
|
||||
* @return The capability of the device.
|
||||
*
|
||||
* This function returns the capability of the device @p dev. If @p dev is
|
||||
* @c NULL, this function returns #ECORE_FB_INPUT_DEVICE_CAP_NONE.
|
||||
*/
|
||||
EAPI Ecore_Fb_Input_Device_Cap
|
||||
ecore_fb_input_device_cap_get(Ecore_Fb_Input_Device *dev)
|
||||
{
|
||||
|
@ -532,6 +577,16 @@ ecore_fb_input_device_cap_get(Ecore_Fb_Input_Device *dev)
|
|||
return dev->info.cap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the threshold of mouse clicks of the given device.
|
||||
*
|
||||
* @param dev The device to set the threshodl mouse click to.
|
||||
* @param threshold The threshold value.
|
||||
*
|
||||
* This function sets the threshold of mouse clicks of the device
|
||||
* @p dev to @p threshold. If @p dev is @c NULL, this function does
|
||||
* nothing.
|
||||
*/
|
||||
EAPI void
|
||||
ecore_fb_input_device_threshold_click_set(Ecore_Fb_Input_Device *dev, double threshold)
|
||||
{
|
||||
|
@ -540,9 +595,22 @@ ecore_fb_input_device_threshold_click_set(Ecore_Fb_Input_Device *dev, double thr
|
|||
dev->mouse.threshold = threshold;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the threshold of mouse clicks of the given device.
|
||||
*
|
||||
* @param dev The device to set the threshodl mouse click from.
|
||||
* @return The threshold value.
|
||||
*
|
||||
* This function returns the threshold of mouse clicks of the device
|
||||
* @p dev. If @p dev is @c NULL, this function returns 0.0.
|
||||
*/
|
||||
EAPI double
|
||||
ecore_fb_input_device_threshold_click_get(Ecore_Fb_Input_Device *dev)
|
||||
{
|
||||
if (!dev) return 0;
|
||||
return dev->mouse.threshold;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -219,10 +219,21 @@ ecore_fb_vt_shutdown(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
* @addtogroup Ecore_FB_Group Ecore_FB - Frame buffer convenience functions.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
* @todo Documentation: Find out what this does.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Set a callback called when a virtual terminal is gained.
|
||||
*
|
||||
* @param func The callback called when vt is gained.
|
||||
* @param data The data to pass to the callback.
|
||||
*
|
||||
* This function sets the callback @p 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). @p data will be pass to @p func if
|
||||
* the callback is called.
|
||||
*/
|
||||
EAPI void
|
||||
ecore_fb_callback_gain_set(void (*func) (void *data), void *data)
|
||||
|
@ -232,10 +243,15 @@ ecore_fb_callback_gain_set(void (*func) (void *data), void *data)
|
|||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
* @brief Set a callback called when a virtual terminal is lost.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
* @todo Documentation: Find out what this does.
|
||||
* @param func The callback called when vt is lost.
|
||||
* @param data The data to pass to the callback.
|
||||
*
|
||||
* This function sets the callback @p func which will be called when a
|
||||
* virtual terminal is lost (someone wants the tv from you and you
|
||||
* want to give up that vt). @p data will be pass to @p func if the
|
||||
* callback is called.
|
||||
*/
|
||||
EAPI void
|
||||
ecore_fb_callback_lose_set(void (*func) (void *data), void *data)
|
||||
|
@ -244,6 +260,11 @@ ecore_fb_callback_lose_set(void (*func) (void *data), void *data)
|
|||
_ecore_fb_func_fb_lost_data = data;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
typedef struct _Ecore_Fb_Filter_Data Ecore_Fb_Filter_Data;
|
||||
|
||||
struct _Ecore_Fb_Filter_Data
|
||||
|
|
Loading…
Reference in New Issue