2 * widgets/common.h - common widget functions or callbacks
4 * Copyright (C) 2010 Mason Larobina <mason.larobina@gmail.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef LUAKIT_WIDGETS_COMMON_H
22 #define LUAKIT_WIDGETS_COMMON_H
26 #define LUAKIT_WIDGET_INDEX_COMMON \
28 lua_pushcfunction(L, luaH_widget_show); \
31 lua_pushcfunction(L, luaH_widget_hide); \
34 lua_pushcfunction(L, luaH_widget_focus); \
37 lua_pushcfunction(L, luaH_widget_destroy); \
40 #define LUAKIT_WIDGET_BIN_INDEX_COMMON \
41 case L_TK_SET_CHILD: \
42 lua_pushcfunction(L, luaH_widget_set_child); \
44 case L_TK_GET_CHILD: \
45 lua_pushcfunction(L, luaH_widget_get_child); \
48 gboolean
button_release_cb(GtkWidget
*, GdkEventButton
*, widget_t
*);
49 gboolean
focus_cb(GtkWidget
*, GdkEventFocus
*, widget_t
*);
50 gboolean
key_press_cb(GtkWidget
*, GdkEventKey
*, widget_t
*);
51 gboolean
key_release_cb(GtkWidget
*, GdkEventKey
*, widget_t
*);
54 gint
luaH_widget_destroy(lua_State
*);
55 gint
luaH_widget_focus(lua_State
*);
56 gint
luaH_widget_get_child(lua_State
*);
57 gint
luaH_widget_hide(lua_State
*);
58 gint
luaH_widget_set_child(lua_State
*);
59 gint
luaH_widget_show(lua_State
*);
61 void add_cb(GtkContainer
*, GtkWidget
*, widget_t
*);
62 void parent_set_cb(GtkWidget
*, GtkObject
*, widget_t
*);
63 void remove_cb(GtkContainer
*, GtkWidget
*, widget_t
*);
64 void widget_destructor(widget_t
*);
68 // vim: ft=c:et:sw=4:ts=8:sts=4:tw=80