Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

etk_utils.h File Reference


Detailed Description


Defines

#define _(string)   gettext(string)
#define ETK_MAX(v1, v2)   (((v1) > (v2)) ? (v1) : (v2))
#define ETK_MIN(v1, v2)   (((v1) < (v2)) ? (v1) : (v2))
#define ETK_CLAMP(value, left, right)   ((value) < (left) ? (left) : ((value) > (right) ? (right) : (value)))
#define ETK_ROUND(a)   ((a < 0.0) ? (int)(floor(a - 0.5)) : (int)(floor(a + 0.5)))
#define ETK_INSIDE(x, y, xx, yy, ww, hh)   (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && ((x) >= (xx)) && ((y) >= (yy)))
#define ETK_WARNING(format,...)   fprintf(stderr, "[Etk-Warning] (%s:%d - %s()):\n" format "\n\n", __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__)

Functions

Etk_Bool etk_callback_set_null (void *data)
 A utility function to use as a swapped callback. It sets to NULL the pointer located at the adress stored in data.
For example, if you want to set "pointer" to NULL when "button" is clicked, you can do:
etk_signal_connect_swapped(ETK_OBJECT(button), "clicked", ETK_CALLBACK(etk_callback_set_null), &pointer);.
unsigned int etk_current_time_get ()
 Gets the current time, in milliseconds.