From 231436d9e3e132d6b0fd790feb84133ea4f47665 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 4 Jun 2016 17:57:08 +0200 Subject: [PATCH] C: Remove unneeded calls to signal_add() Signed-off-by: Uli Schlachter --- common/luaclass.c | 2 -- common/signal.h | 5 ---- dbus.c | 3 --- luaa.c | 13 ---------- objects/button.c | 5 ---- objects/client.c | 63 ---------------------------------------------- objects/drawable.c | 12 --------- objects/drawin.c | 12 --------- objects/key.c | 5 ---- objects/screen.c | 7 ------ objects/tag.c | 7 ------ objects/window.c | 7 ------ property.c | 7 ------ spawn.c | 6 ----- 14 files changed, 154 deletions(-) diff --git a/common/luaclass.c b/common/luaclass.c index fa234cdc..f5a40c29 100644 --- a/common/luaclass.c +++ b/common/luaclass.c @@ -254,8 +254,6 @@ luaA_class_setup(lua_State *L, lua_class_t *class, class->index_miss_handler = LUA_REFNIL; class->newindex_miss_handler = LUA_REFNIL; - signal_add(&class->signals, "new"); - lua_class_array_append(&luaA_classes, class); } diff --git a/common/signal.h b/common/signal.h index 22dc7cb4..f2b15839 100644 --- a/common/signal.h +++ b/common/signal.h @@ -54,11 +54,6 @@ signal_array_getbyid(signal_array_t *arr, unsigned long id) return signal_array_lookup(arr, &sig); } -static inline void -signal_add(signal_array_t *arr, const char *name) -{ -} - /** Connect a signal inside a signal array. * You are in charge of reference counting. * \param arr The signal array. diff --git a/dbus.c b/dbus.c index b6874169..4e796139 100644 --- a/dbus.c +++ b/dbus.c @@ -773,10 +773,7 @@ luaA_dbus_connect_signal(lua_State *L) if(sig) luaA_warn(L, "cannot add signal %s on D-Bus, already existing", name); else - { - signal_add(&dbus_signals, name); signal_connect(&dbus_signals, name, luaA_object_ref(L, 2)); - } return 0; } diff --git a/luaa.c b/luaa.c index 27238b78..37ef6e81 100644 --- a/luaa.c +++ b/luaa.c @@ -723,19 +723,6 @@ luaA_init(xdgHandle* xdg) lua_getfield(L, 1, "loaded"); lua_pop(L, 2); /* pop "package" and "package.loaded" */ - - signal_add(&global_signals, "debug::error"); - signal_add(&global_signals, "debug::deprecation"); - signal_add(&global_signals, "debug::index::miss"); - signal_add(&global_signals, "debug::newindex::miss"); - signal_add(&global_signals, "systray::update"); - signal_add(&global_signals, "wallpaper_changed"); - signal_add(&global_signals, "xkb::map_changed"); - signal_add(&global_signals, "xkb::group_changed"); - signal_add(&global_signals, "refresh"); - signal_add(&global_signals, "startup"); - signal_add(&global_signals, "exit"); - signal_add(&global_signals, "screen::change"); } static void diff --git a/objects/button.c b/objects/button.c index ce45a2f9..84fc7384 100644 --- a/objects/button.c +++ b/objects/button.c @@ -178,11 +178,6 @@ button_class_setup(lua_State *L) (lua_class_propfunc_t) luaA_button_set_modifiers, (lua_class_propfunc_t) luaA_button_get_modifiers, (lua_class_propfunc_t) luaA_button_set_modifiers); - - signal_add(&button_class.signals, "press"); - signal_add(&button_class.signals, "property::button"); - signal_add(&button_class.signals, "property::modifiers"); - signal_add(&button_class.signals, "release"); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/objects/client.c b/objects/client.c index f9c92e2e..bb11ba17 100644 --- a/objects/client.c +++ b/objects/client.c @@ -3429,69 +3429,6 @@ client_class_setup(lua_State *L) NULL, (lua_class_propfunc_t) luaA_client_get_first_tag, NULL); - - signal_add(&client_class.signals, "focus"); - signal_add(&client_class.signals, "list"); - signal_add(&client_class.signals, "swapped"); - signal_add(&client_class.signals, "manage"); - signal_add(&client_class.signals, "button::press"); - signal_add(&client_class.signals, "button::release"); - signal_add(&client_class.signals, "mouse::enter"); - signal_add(&client_class.signals, "mouse::leave"); - signal_add(&client_class.signals, "mouse::move"); - signal_add(&client_class.signals, "property::above"); - signal_add(&client_class.signals, "property::below"); - signal_add(&client_class.signals, "property::class"); - signal_add(&client_class.signals, "property::focusable"); - signal_add(&client_class.signals, "property::fullscreen"); - signal_add(&client_class.signals, "property::geometry"); - signal_add(&client_class.signals, "property::group_window"); - signal_add(&client_class.signals, "property::height"); - signal_add(&client_class.signals, "property::hidden"); - signal_add(&client_class.signals, "property::icon"); - signal_add(&client_class.signals, "property::icon_name"); - signal_add(&client_class.signals, "property::instance"); - signal_add(&client_class.signals, "property::keys"); - signal_add(&client_class.signals, "property::machine"); - signal_add(&client_class.signals, "property::maximized"); - signal_add(&client_class.signals, "property::maximized_horizontal"); - signal_add(&client_class.signals, "property::maximized_vertical"); - signal_add(&client_class.signals, "property::minimized"); - signal_add(&client_class.signals, "property::modal"); - signal_add(&client_class.signals, "property::name"); - signal_add(&client_class.signals, "property::ontop"); - signal_add(&client_class.signals, "property::pid"); - signal_add(&client_class.signals, "property::role"); - signal_add(&client_class.signals, "property::screen"); - signal_add(&client_class.signals, "property::shape_bounding"); - signal_add(&client_class.signals, "property::shape_client_bounding"); - signal_add(&client_class.signals, "property::shape_client_clip"); - signal_add(&client_class.signals, "property::shape_clip"); - signal_add(&client_class.signals, "property::size_hints_honor"); - signal_add(&client_class.signals, "property::skip_taskbar"); - signal_add(&client_class.signals, "property::sticky"); - signal_add(&client_class.signals, "property::struts"); - signal_add(&client_class.signals, "property::titlebar_bottom"); - signal_add(&client_class.signals, "property::titlebar_left"); - signal_add(&client_class.signals, "property::titlebar_right"); - signal_add(&client_class.signals, "property::titlebar_top"); - signal_add(&client_class.signals, "property::transient_for"); - signal_add(&client_class.signals, "property::type"); - signal_add(&client_class.signals, "property::urgent"); - signal_add(&client_class.signals, "property::width"); - signal_add(&client_class.signals, "property::window"); - signal_add(&client_class.signals, "property::x"); - signal_add(&client_class.signals, "property::y"); - signal_add(&client_class.signals, "request::activate"); - signal_add(&client_class.signals, "request::geometry"); - signal_add(&client_class.signals, "request::tag"); - signal_add(&client_class.signals, "request::urgent"); - signal_add(&client_class.signals, "tagged"); - signal_add(&client_class.signals, "unfocus"); - signal_add(&client_class.signals, "unmanage"); - signal_add(&client_class.signals, "untagged"); - signal_add(&client_class.signals, "raised"); - signal_add(&client_class.signals, "lowered"); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/objects/drawable.c b/objects/drawable.c index 63fb36c0..d1755a31 100644 --- a/objects/drawable.c +++ b/objects/drawable.c @@ -240,18 +240,6 @@ drawable_class_setup(lua_State *L) NULL, (lua_class_propfunc_t) luaA_drawable_get_surface, NULL); - - signal_add(&drawable_class.signals, "button::press"); - signal_add(&drawable_class.signals, "button::release"); - signal_add(&drawable_class.signals, "mouse::enter"); - signal_add(&drawable_class.signals, "mouse::leave"); - signal_add(&drawable_class.signals, "mouse::move"); - signal_add(&drawable_class.signals, "property::geometry"); - signal_add(&drawable_class.signals, "property::height"); - signal_add(&drawable_class.signals, "property::width"); - signal_add(&drawable_class.signals, "property::x"); - signal_add(&drawable_class.signals, "property::y"); - signal_add(&drawable_class.signals, "property::surface"); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/objects/drawin.c b/objects/drawin.c index c314aac8..09056b7f 100644 --- a/objects/drawin.c +++ b/objects/drawin.c @@ -759,18 +759,6 @@ drawin_class_setup(lua_State *L) (lua_class_propfunc_t) luaA_drawin_set_shape_clip, (lua_class_propfunc_t) luaA_drawin_get_shape_clip, (lua_class_propfunc_t) luaA_drawin_set_shape_clip); - - signal_add(&drawin_class.signals, "property::geometry"); - signal_add(&drawin_class.signals, "property::shape_bounding"); - signal_add(&drawin_class.signals, "property::shape_clip"); - signal_add(&drawin_class.signals, "property::border_width"); - signal_add(&drawin_class.signals, "property::cursor"); - signal_add(&drawin_class.signals, "property::height"); - signal_add(&drawin_class.signals, "property::ontop"); - signal_add(&drawin_class.signals, "property::visible"); - signal_add(&drawin_class.signals, "property::width"); - signal_add(&drawin_class.signals, "property::x"); - signal_add(&drawin_class.signals, "property::y"); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/objects/key.c b/objects/key.c index c3af2c09..01774a46 100644 --- a/objects/key.c +++ b/objects/key.c @@ -373,11 +373,6 @@ key_class_setup(lua_State *L) (lua_class_propfunc_t) luaA_key_set_modifiers, (lua_class_propfunc_t) luaA_key_get_modifiers, (lua_class_propfunc_t) luaA_key_set_modifiers); - - signal_add(&key_class.signals, "press"); - signal_add(&key_class.signals, "property::key"); - signal_add(&key_class.signals, "property::modifiers"); - signal_add(&key_class.signals, "release"); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/objects/screen.c b/objects/screen.c index 6771a267..cefca8b1 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -1128,13 +1128,6 @@ screen_class_setup(lua_State *L) NULL, (lua_class_propfunc_t) luaA_screen_get_workarea, NULL); - - signal_add(&screen_class.signals, "property::workarea"); - signal_add(&screen_class.signals, "property::geometry"); - signal_add(&screen_class.signals, "property::outputs"); - signal_add(&screen_class.signals, "primary_changed"); - signal_add(&screen_class.signals, "added"); - signal_add(&screen_class.signals, "removed"); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/objects/tag.c b/objects/tag.c index 8e8fab3f..ce1149b3 100644 --- a/objects/tag.c +++ b/objects/tag.c @@ -425,13 +425,6 @@ tag_class_setup(lua_State *L) (lua_class_propfunc_t) luaA_tag_set_activated, (lua_class_propfunc_t) luaA_tag_get_activated, (lua_class_propfunc_t) luaA_tag_set_activated); - - signal_add(&tag_class.signals, "property::name"); - signal_add(&tag_class.signals, "property::selected"); - signal_add(&tag_class.signals, "property::activated"); - signal_add(&tag_class.signals, "request::select"); - signal_add(&tag_class.signals, "tagged"); - signal_add(&tag_class.signals, "untagged"); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/objects/window.c b/objects/window.c index 3ddeb82e..a39bf91a 100644 --- a/objects/window.c +++ b/objects/window.c @@ -543,13 +543,6 @@ window_class_setup(lua_State *L) (lua_class_propfunc_t) luaA_window_set_border_width, (lua_class_propfunc_t) luaA_window_get_border_width, (lua_class_propfunc_t) luaA_window_set_border_width); - - signal_add(&window_class.signals, "property::border_color"); - signal_add(&window_class.signals, "property::border_width"); - signal_add(&window_class.signals, "property::buttons"); - signal_add(&window_class.signals, "property::opacity"); - signal_add(&window_class.signals, "property::struts"); - signal_add(&window_class.signals, "property::type"); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/property.c b/property.c index deec41c2..de000d77 100644 --- a/property.c +++ b/property.c @@ -530,15 +530,8 @@ luaA_register_xproperty(lua_State *L) } else { - buffer_t buf; - buffer_inita(&buf, a_strlen(name) + a_strlen("xproperty::") + 1); - buffer_addf(&buf, "xproperty::%s", name); - property.name = a_strdup(name); xproperty_array_insert(&globalconf.xproperties, property); - signal_add(&window_class.signals, buf.s); - signal_add(&global_signals, buf.s); - buffer_wipe(&buf); } return 0; diff --git a/spawn.c b/spawn.c index b7863e5f..40e9ef8c 100644 --- a/spawn.c +++ b/spawn.c @@ -265,12 +265,6 @@ spawn_init(void) globalconf.default_screen, spawn_monitor_event, NULL, NULL); - - signal_add(&global_signals, "spawn::canceled"); - signal_add(&global_signals, "spawn::change"); - signal_add(&global_signals, "spawn::completed"); - signal_add(&global_signals, "spawn::initiated"); - signal_add(&global_signals, "spawn::timeout"); } static gboolean