static void _create_paired_device_cb(void *data, DBusMessage *msg, DBusError *err) { e_dbus_object_interface_detach(_msgbus_data->obj, iface); e_dbus_object_free(_msgbus_data->obj); e_dbus_interface_unref(iface); _method_success_check(data, msg, err); }
static void _e_fileman_dbus_daemon_free(E_Fileman_DBus_Daemon *d) { if (d->pending.request_name) dbus_pending_call_cancel(d->pending.request_name); if (d->obj) { e_dbus_object_interface_detach(d->obj, d->iface); e_dbus_object_free(d->obj); } if (d->iface) e_dbus_interface_unref(d->iface); if (d->conn) e_dbus_connection_close(d->conn); free(d); }
/* externally accessible functions */ EINTERN int e_msgbus_init(void) { E_DBus_Interface *iface; _e_msgbus_data = E_NEW(E_Msgbus_Data, 1); e_dbus_init(); #ifdef HAVE_HAL e_hal_init(); #endif _e_msgbus_data->conn = e_dbus_bus_get(DBUS_BUS_SESSION); if (!_e_msgbus_data->conn) { WRN("Cannot get DBUS_BUS_SESSION"); return 0; } e_dbus_request_name(_e_msgbus_data->conn, "org.enform.wm.service", 0, _e_msgbus_request_name_cb, NULL); _e_msgbus_data->obj = e_dbus_object_add(_e_msgbus_data->conn, "/org/enform/wm/RemoteObject", NULL); iface = e_dbus_interface_new("org.enform.wm.Core"); if (!iface) { WRN("Cannot add org.enform.wm.Core interface"); return 0; } e_dbus_object_interface_attach(_e_msgbus_data->obj, iface); e_dbus_interface_unref(iface); /* Hardcore methods */ e_dbus_interface_method_add(iface, "Restart", "", "", _e_msgbus_core_restart_cb); e_dbus_interface_method_add(iface, "Shutdown", "", "", _e_msgbus_core_shutdown_cb); iface = e_dbus_interface_new("org.enform.wm.Module"); if (!iface) { WRN("Cannot add org.enform.wm.Module interface"); return 0; } e_dbus_object_interface_attach(_e_msgbus_data->obj, iface); e_dbus_interface_unref(iface); /* Module methods */ e_dbus_interface_method_add(iface, "Load", "s", "", _e_msgbus_module_load_cb); e_dbus_interface_method_add(iface, "Unload", "s", "", _e_msgbus_module_unload_cb); e_dbus_interface_method_add(iface, "Enable", "s", "", _e_msgbus_module_enable_cb); e_dbus_interface_method_add(iface, "Disable", "s", "", _e_msgbus_module_disable_cb); e_dbus_interface_method_add(iface, "List", "", "a(si)", _e_msgbus_module_list_cb); iface = e_dbus_interface_new("org.enform.wm.Profile"); if (!iface) { WRN("Cannot add org.enform.wm.Profile interface"); return 0; } e_dbus_object_interface_attach(_e_msgbus_data->obj, iface); e_dbus_interface_unref(iface); /* Profile methods */ e_dbus_interface_method_add(iface, "Set", "s", "", _e_msgbus_profile_set_cb); e_dbus_interface_method_add(iface, "Get", "", "s", _e_msgbus_profile_get_cb); e_dbus_interface_method_add(iface, "List", "", "as", _e_msgbus_profile_list_cb); e_dbus_interface_method_add(iface, "Add", "s", "", _e_msgbus_profile_add_cb); e_dbus_interface_method_add(iface, "Delete", "s", "", _e_msgbus_profile_delete_cb); iface = e_dbus_interface_new("org.enform.wm.Window"); if (!iface) { WRN("Cannot add org.enform.wm.Window interface"); return 0; } e_dbus_object_interface_attach(_e_msgbus_data->obj, iface); e_dbus_interface_unref(iface); /* Profile methods */ e_dbus_interface_method_add(iface, "List", "", "a(si)", _e_msgbus_window_list_cb); e_dbus_interface_method_add(iface, "Close", "i", "", _e_msgbus_window_close_cb); e_dbus_interface_method_add(iface, "Kill", "i", "", _e_msgbus_window_kill_cb); e_dbus_interface_method_add(iface, "Focus", "i", "", _e_msgbus_window_focus_cb); e_dbus_interface_method_add(iface, "Iconify", "i", "", _e_msgbus_window_iconify_cb); e_dbus_interface_method_add(iface, "Uniconify", "i", "", _e_msgbus_window_uniconify_cb); e_dbus_interface_method_add(iface, "Maximize", "i", "", _e_msgbus_window_maximize_cb); e_dbus_interface_method_add(iface, "Unmaximize", "i", "", _e_msgbus_window_unmaximize_cb); return 1; }
/* externally accessible functions */ EINTERN int e_msgbus_init(void) { E_DBus_Interface *iface; _e_msgbus_data = E_NEW(E_Msgbus_Data, 1); e_dbus_init(); #ifdef HAVE_HAL e_hal_init(); #endif _e_msgbus_data->conn = e_dbus_bus_get(DBUS_BUS_SESSION); if (!_e_msgbus_data->conn) { printf("WARNING: Cannot get DBUS_BUS_SESSION\n"); return 0; } e_dbus_request_name(_e_msgbus_data->conn, "org.enlightenment.wm.service", 0, _e_msgbus_request_name_cb, NULL); _e_msgbus_data->obj = e_dbus_object_add(_e_msgbus_data->conn, "/org/enlightenment/wm/RemoteObject", NULL); iface = e_dbus_interface_new("org.enlightenment.wm.Core"); if (!iface) { printf("WARNING: Cannot add org.enlightenment.wm.Core interface\n"); return 0; } e_dbus_object_interface_attach(_e_msgbus_data->obj, iface); e_dbus_interface_unref(iface); /* Hardcore methods */ e_dbus_interface_method_add(iface, "Restart", "", "", _e_msgbus_core_restart_cb); e_dbus_interface_method_add(iface, "Shutdown", "", "", _e_msgbus_core_shutdown_cb); iface = e_dbus_interface_new("org.enlightenment.wm.Module"); if (!iface) { printf("WARNING: Cannot add org.enlightenment.wm.Module interface\n"); return 0; } e_dbus_object_interface_attach(_e_msgbus_data->obj, iface); e_dbus_interface_unref(iface); /* Module methods */ e_dbus_interface_method_add(iface, "Load", "s", "", _e_msgbus_module_load_cb); e_dbus_interface_method_add(iface, "Unload", "s", "", _e_msgbus_module_unload_cb); e_dbus_interface_method_add(iface, "Enable", "s", "", _e_msgbus_module_enable_cb); e_dbus_interface_method_add(iface, "Disable", "s", "", _e_msgbus_module_disable_cb); e_dbus_interface_method_add(iface, "List", "", "a(si)", _e_msgbus_module_list_cb); iface = e_dbus_interface_new("org.enlightenment.wm.Profile"); if (!iface) { printf("WARNING: Cannot add org.enlightenment.wm.Profile interface\n"); return 0; } e_dbus_object_interface_attach(_e_msgbus_data->obj, iface); e_dbus_interface_unref(iface); /* Profile methods */ e_dbus_interface_method_add(iface, "Set", "s", "", _e_msgbus_profile_set_cb); e_dbus_interface_method_add(iface, "Get", "", "s", _e_msgbus_profile_get_cb); e_dbus_interface_method_add(iface, "List", "", "as", _e_msgbus_profile_list_cb); e_dbus_interface_method_add(iface, "Add", "s", "", _e_msgbus_profile_add_cb); e_dbus_interface_method_add(iface, "Delete", "s", "", _e_msgbus_profile_delete_cb); return 1; }