lua: rename luaA_function to luaA_ref

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-11 10:12:12 +02:00
parent 0397854775
commit 9f503e5a13
5 changed files with 18 additions and 18 deletions

View File

@ -36,7 +36,7 @@ typedef struct keybinding_t
/** Keycode */ /** Keycode */
xcb_keycode_t keycode; xcb_keycode_t keycode;
/** Lua function to execute. */ /** Lua function to execute. */
luaA_function fct; luaA_ref fct;
} keybinding_t; } keybinding_t;
keybinding_t *keybinding_find(const xcb_key_press_event_t *); keybinding_t *keybinding_find(const xcb_key_press_event_t *);

8
lua.h
View File

@ -37,7 +37,7 @@ typedef enum
} awesome_type_t; } awesome_type_t;
/** Type for Lua function */ /** Type for Lua function */
typedef int luaA_function; typedef int luaA_ref;
#define DO_LUA_NEW(decl, type, prefix, lua_type, type_ref) \ #define DO_LUA_NEW(decl, type, prefix, lua_type, type_ref) \
decl int \ decl int \
@ -178,13 +178,13 @@ luaA_usemetatable(lua_State *L, int idxobj, int idxfield)
/** Register a function. /** Register a function.
* \param L The Lua stack. * \param L The Lua stack.
* \param fct A luaA_function address: it will be filled with the luaA_function * \param fct A luaA_ref address: it will be filled with the luaA_ref
* registered. If the adresse point to an already registered function, it will * registered. If the adresse point to an already registered function, it will
* be unregistered. * be unregistered.
* \return Always 0. * \return Always 0.
*/ */
static inline int static inline int
luaA_registerfct(lua_State *L, luaA_function *fct) luaA_registerfct(lua_State *L, luaA_ref *fct)
{ {
luaA_checkfunction(L, -1); luaA_checkfunction(L, -1);
if(*fct != LUA_REFNIL) if(*fct != LUA_REFNIL)
@ -201,7 +201,7 @@ luaA_registerfct(lua_State *L, luaA_function *fct)
* \return True on no error, false otherwise. * \return True on no error, false otherwise.
*/ */
static inline bool static inline bool
luaA_dofunction(lua_State *L, luaA_function f, int nargs, int nret) luaA_dofunction(lua_State *L, luaA_ref f, int nargs, int nret)
{ {
if(f != LUA_REFNIL) if(f != LUA_REFNIL)
{ {

View File

@ -78,7 +78,7 @@ struct button_t
/** Mouse button number */ /** Mouse button number */
unsigned int button; unsigned int button;
/** Lua function to execute. */ /** Lua function to execute. */
luaA_function fct; luaA_ref fct;
/** Next and previous buttons */ /** Next and previous buttons */
button_t *prev, *next; button_t *prev, *next;
}; };
@ -429,30 +429,30 @@ struct awesome_t
struct struct
{ {
/** Command to execute when spawning a new client */ /** Command to execute when spawning a new client */
luaA_function manage; luaA_ref manage;
/** Command to execute when unmanaging client */ /** Command to execute when unmanaging client */
luaA_function unmanage; luaA_ref unmanage;
/** Command to execute when giving focus to a client */ /** Command to execute when giving focus to a client */
luaA_function focus; luaA_ref focus;
/** Command to execute when removing focus to a client */ /** Command to execute when removing focus to a client */
luaA_function unfocus; luaA_ref unfocus;
/** Command to run when mouse is over */ /** Command to run when mouse is over */
luaA_function mouseover; luaA_ref mouseover;
/** Command to run on arrange */ /** Command to run on arrange */
luaA_function arrange; luaA_ref arrange;
/** Command to run on title change */ /** Command to run on title change */
luaA_function titleupdate; luaA_ref titleupdate;
/** Command to run on urgent flag */ /** Command to run on urgent flag */
luaA_function urgent; luaA_ref urgent;
/** Command to run on time */ /** Command to run on time */
luaA_function timer; luaA_ref timer;
} hooks; } hooks;
/** The event loop */ /** The event loop */
struct ev_loop *loop; struct ev_loop *loop;
/** The timeout after which we need to stop select() */ /** The timeout after which we need to stop select() */
struct ev_timer timer; struct ev_timer timer;
/** The key grabber function */ /** The key grabber function */
luaA_function keygrabber; luaA_ref keygrabber;
/** Focused screen */ /** Focused screen */
screen_t *screen_focus; screen_t *screen_focus;
}; };

View File

@ -54,7 +54,7 @@ DO_SLIST(taglist_drawn_area_t, taglist_drawn_area, taglist_drawn_area_delete);
typedef struct typedef struct
{ {
taglist_drawn_area_t *drawn_area; taglist_drawn_area_t *drawn_area;
luaA_function label; luaA_ref label;
} taglist_data_t; } taglist_data_t;
static taglist_drawn_area_t * static taglist_drawn_area_t *

View File

@ -77,7 +77,7 @@ DO_SLIST(tasklist_object_data_t, tasklist_object_data, tasklist_object_data_dele
typedef struct typedef struct
{ {
bool show_icons; bool show_icons;
luaA_function label; luaA_ref label;
tasklist_object_data_t *objects_data; tasklist_object_data_t *objects_data;
} tasklist_data_t; } tasklist_data_t;