static Eina_List *handlers;
static Eldbus_Connection *conn;
static Ecore_Event_Handler *dbus_init_done_handler;
+static Ecore_Event_Handler *quickpanel_handler;
EAPI E_Module_Api e_modapi =
{
[BACK_BUTTON_UP_SIGNAL] = {"BackButtonUp", 0, 0},
[MENU_MOUSE_DOWN_SIGNAL] = {"MenuMouseDown", ELDBUS_ARGS({"i", "x"}, {"i", "y"}), 0},
[MENU_MOUSE_UP_SIGNAL] = {"MenuMouseUp", ELDBUS_ARGS({"i", "x"}, {"i", "y"}), 0},
+ [QUICKPANEL_CHANGED_SIGNAL] = {"QuickpanelChanged", ELDBUS_ARGS({"u", "type"}, {"u", "state"}), 0},
{ }
};
}
}
+static Eina_Bool
+_quickpanel_state_changed(void *data, int type, void *event)
+{
+ E_Client *ec;
+ unsigned int visible_state;
+ E_Service_Quickpanel_Type qp_type;
+ E_Event_Client_Property *ev = event;
+
+ if (!ev) return ECORE_CALLBACK_PASS_ON;
+
+ /* event info
+ - ec : quickpanel service ec
+ - property : visible state (0 is hidden, 1 is shown)
+ */
+ ec = ev->ec;
+ visible_state = ev->property; // 0: hidden, 1: shown
+
+ qp_type = e_policy_quickpanel_type_get(ec);
+ /* type info
+ - E_SERVICE_QUICKPANEL_TYPE_SYSTEM_DEFAULT : quickpanel
+ - E_SERVICE_QUICKPANEL_TYPE_CONTEXT_MENU : inside ???
+ - E_SERVICE_QUICKPANEL_TYPE_APPS_MENU : apps menu
+ */
+
+ eldbus_service_signal_emit(g_context->iface, QUICKPANEL_CHANGED_SIGNAL, qp_type,
+ visible_state);
+
+ return ECORE_CALLBACK_PASS_ON;
+
+}
+
+int _e_mod_quickpanel_handler_init(void)
+{
+ DEBUG("quickpanel handler init");
+ quickpanel_handler = ecore_event_handler_add(E_EVENT_POLICY_QUICKPANEL_VISIBLE_STATE_CHANGE,
+ _quickpanel_state_changed, NULL);
+
+ if (!dbus_init_done_handler) return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
+void _e_mod_quickpanel_handler_shutdown()
+{
+ DEBUG("quickpanel handler shutdown");
+ E_FREE_FUNC(quickpanel_handler, ecore_event_handler_del);
+}
+
EAPI void *
e_modapi_init(E_Module *m)
{
return NULL;
}
+ if (!_e_mod_quickpanel_handler_init())
+ {
+ ERROR("quickpanel handler initialization failed.");
+ _e_mod_atspi_dbus_shutdown();
+ _e_mod_log_shutdown();
+ return NULL;
+ }
+
if (!_e_mod_atspi_vconf_init())
{
ERROR("AT-SPI vconf initialization failed.");
+ _e_mod_quickpanel_handler_shutdown();
_e_mod_atspi_dbus_shutdown();
_e_mod_log_shutdown();
return NULL;
{
e_accessibility_conf_shutdown();
_e_mod_atspi_vconf_shutdown();
+ _e_mod_quickpanel_handler_shutdown();
_e_mod_atspi_dbus_shutdown();
_e_mod_log_shutdown();
return 1;