Merge pull request #2660 from psychon/selection_setup
Move setup of selection() to selection.c
This commit is contained in:
commit
c3a8ba7065
6
luaa.c
6
luaa.c
|
@ -385,9 +385,6 @@ luaA_fixups(lua_State *L)
|
|||
/* replace type */
|
||||
lua_pushcfunction(L, luaAe_type);
|
||||
lua_setglobal(L, "type");
|
||||
/* set selection */
|
||||
lua_pushcfunction(L, luaA_selection_get);
|
||||
lua_setglobal(L, "selection");
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
@ -1043,6 +1040,9 @@ luaA_init(xdgHandle* xdg, string_array_t *searchpath)
|
|||
/* Export selection watcher */
|
||||
selection_watcher_class_setup(L);
|
||||
|
||||
/* Setup the selection interface */
|
||||
selection_setup(L);
|
||||
|
||||
/* add Lua search paths */
|
||||
lua_getglobal(L, "package");
|
||||
if (LUA_TTABLE != lua_type(L, 1))
|
||||
|
|
|
@ -49,7 +49,7 @@ static xcb_window_t selection_window = XCB_NONE;
|
|||
* \luastack
|
||||
* \lreturn A string with the current X selection buffer.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
luaA_selection_get(lua_State *L)
|
||||
{
|
||||
if(selection_window == XCB_NONE)
|
||||
|
@ -132,4 +132,11 @@ luaA_selection_get(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
selection_setup(lua_State *L)
|
||||
{
|
||||
lua_pushcfunction(L, luaA_selection_get);
|
||||
lua_setglobal(L, "selection");
|
||||
}
|
||||
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <lua.h>
|
||||
|
||||
int luaA_selection_get(lua_State *);
|
||||
void selection_setup(lua_State *);
|
||||
|
||||
#endif
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
Loading…
Reference in New Issue