From b979f2da27f2ee87edf75a741adfaba2fa6ff5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Mon, 27 Jun 2011 11:07:31 +0000 Subject: From bug 6057: Lua API: add support to temporary color filters (10 color slots) svn path=/trunk/; revision=37801 --- epan/wslua/wslua_gui.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'epan/wslua') diff --git a/epan/wslua/wslua_gui.c b/epan/wslua/wslua_gui.c index 530dfba88c..dfd4ace889 100644 --- a/epan/wslua/wslua_gui.c +++ b/epan/wslua/wslua_gui.c @@ -801,6 +801,25 @@ WSLUA_FUNCTION wslua_set_filter(lua_State* L) { /* Set the main filter text */ return 0; } +WSLUA_FUNCTION wslua_set_color_filter_slot(lua_State* L) { /* Set color of the current packet */ +#define WSLUA_ARG_set_color_filter_slot_ROW 1 /* The row count in tmp filter list */ +#define WSLUA_ARG_set_color_filter_slot_TEXT 2 /* Filter */ + guint8 row = luaL_checkint(L,WSLUA_ARG_set_color_filter_slot_ROW); + const gchar* filter_str = luaL_checkstring(L,WSLUA_ARG_set_color_filter_slot_TEXT); + + if (!ops->set_color_filter_slot) { + WSLUA_ERROR(set_color_filter_slot, "GUI not available"); + } + + if (!filter_str) { + WSLUA_ARG_ERROR(set_color_filter_slot,TEXT,"Must be a string"); + } + + ops->set_color_filter_slot(row, filter_str); + + return 0; +} + WSLUA_FUNCTION wslua_apply_filter(lua_State* L) { /* Apply the filter in the main filter box */ if (!ops->apply_filter) { WSLUA_ERROR(apply_filter, "GUI not available"); -- cgit v1.2.3