|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
|
|
|
|
|
#include <Ecore_Getopt.h> |
|
|
|
|
#include <Ecore_File.h> |
|
|
|
|
#include <EDBus.h> |
|
|
|
|
#include <Eldbus.h> |
|
|
|
|
#include <stdlib.h> |
|
|
|
|
#include "gettext.h" |
|
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ struct Cursor {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
struct Eve_DBus_Request_Name_Response { |
|
|
|
|
EDBus_Connection *conn; |
|
|
|
|
Eldbus_Connection *conn; |
|
|
|
|
const char *url; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -375,15 +375,15 @@ static const Ecore_Getopt options = {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static EDBus_Message * |
|
|
|
|
_cb_dbus_open_url(const EDBus_Service_Interface *iface __UNUSED__, |
|
|
|
|
const EDBus_Message *msg) |
|
|
|
|
static Eldbus_Message * |
|
|
|
|
_cb_dbus_open_url(const Eldbus_Service_Interface *iface __UNUSED__, |
|
|
|
|
const Eldbus_Message *msg) |
|
|
|
|
{ |
|
|
|
|
Browser_Window *win = eina_list_data_get(app.windows); |
|
|
|
|
char *tmp_uri; |
|
|
|
|
char *uri; |
|
|
|
|
|
|
|
|
|
if (!edbus_message_arguments_get(msg, "s", &tmp_uri)) |
|
|
|
|
if (!eldbus_message_arguments_get(msg, "s", &tmp_uri)) |
|
|
|
|
goto end; |
|
|
|
|
|
|
|
|
|
if ((uri = uri_sanitize(tmp_uri))) |
|
|
|
@ -393,52 +393,52 @@ _cb_dbus_open_url(const EDBus_Service_Interface *iface __UNUSED__,
|
|
|
|
|
free(uri); |
|
|
|
|
} |
|
|
|
|
end: |
|
|
|
|
return edbus_message_method_return_new(msg); |
|
|
|
|
return eldbus_message_method_return_new(msg); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static const EDBus_Method methods[] = { |
|
|
|
|
{ "open_url", EDBUS_ARGS({"s", "url"}), NULL, _cb_dbus_open_url }, |
|
|
|
|
static const Eldbus_Method methods[] = { |
|
|
|
|
{ "open_url", ELDBUS_ARGS({"s", "url"}), NULL, _cb_dbus_open_url }, |
|
|
|
|
{ } |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const EDBus_Service_Interface_Desc desc = { |
|
|
|
|
static const Eldbus_Service_Interface_Desc desc = { |
|
|
|
|
"org.enlightenment.eve", methods |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
_cb_dbus_request_name(void *data, const EDBus_Message *msg, |
|
|
|
|
EDBus_Pending *pending) |
|
|
|
|
_cb_dbus_request_name(void *data, const Eldbus_Message *msg, |
|
|
|
|
Eldbus_Pending *pending) |
|
|
|
|
{ |
|
|
|
|
struct Eve_DBus_Request_Name_Response *response = data; |
|
|
|
|
unsigned ret; |
|
|
|
|
|
|
|
|
|
if (edbus_message_error_get(msg, NULL, NULL)) |
|
|
|
|
if (eldbus_message_error_get(msg, NULL, NULL)) |
|
|
|
|
goto cleanup; |
|
|
|
|
|
|
|
|
|
if (!edbus_message_arguments_get(msg, "u", &ret)) |
|
|
|
|
if (!eldbus_message_arguments_get(msg, "u", &ret)) |
|
|
|
|
goto cleanup; |
|
|
|
|
|
|
|
|
|
switch (ret) { |
|
|
|
|
case EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER: |
|
|
|
|
case EDBUS_NAME_REQUEST_REPLY_ALREADY_OWNER: |
|
|
|
|
case ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER: |
|
|
|
|
case ELDBUS_NAME_REQUEST_REPLY_ALREADY_OWNER: |
|
|
|
|
{ |
|
|
|
|
edbus_service_interface_register(response->conn, |
|
|
|
|
eldbus_service_interface_register(response->conn, |
|
|
|
|
"/org/enlightenment/eve", &desc); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case EDBUS_NAME_REQUEST_REPLY_IN_QUEUE: |
|
|
|
|
case EDBUS_NAME_REQUEST_REPLY_EXISTS: |
|
|
|
|
case ELDBUS_NAME_REQUEST_REPLY_IN_QUEUE: |
|
|
|
|
case ELDBUS_NAME_REQUEST_REPLY_EXISTS: |
|
|
|
|
{ |
|
|
|
|
EDBus_Message *open_url; |
|
|
|
|
Eldbus_Message *open_url; |
|
|
|
|
|
|
|
|
|
ERR("eve is already running. Opening %s there and exiting", |
|
|
|
|
response->url); |
|
|
|
|
open_url = edbus_message_method_call_new("org.enlightenment.eve", |
|
|
|
|
open_url = eldbus_message_method_call_new("org.enlightenment.eve", |
|
|
|
|
"/org/enlightenment/eve", |
|
|
|
|
"org.enlightenment.eve", |
|
|
|
|
"open_url"); |
|
|
|
|
edbus_message_arguments_append(open_url, "s", response->url); |
|
|
|
|
edbus_connection_send(response->conn, open_url, NULL, NULL, -1); |
|
|
|
|
eldbus_message_arguments_append(open_url, "s", response->url); |
|
|
|
|
eldbus_connection_send(response->conn, open_url, NULL, NULL, -1); |
|
|
|
|
} |
|
|
|
|
elm_exit(); |
|
|
|
|
} |
|
|
|
@ -633,7 +633,7 @@ elm_main(int argc, char **argv)
|
|
|
|
|
const char *user_agent_str; |
|
|
|
|
char *backing_store_option = NULL; |
|
|
|
|
Backing_Store backing_store_enum; |
|
|
|
|
EDBus_Connection *conn = NULL; |
|
|
|
|
Eldbus_Connection *conn = NULL; |
|
|
|
|
size_t dirlen; |
|
|
|
|
Ecore_Timer *session_save_timer = NULL; |
|
|
|
|
|
|
|
|
@ -718,7 +718,7 @@ elm_main(int argc, char **argv)
|
|
|
|
|
elm_theme_extension_add(NULL, PACKAGE_DATA_DIR "/default.edj"); |
|
|
|
|
ewk_init(); |
|
|
|
|
eve_state_init(); |
|
|
|
|
edbus_init(); |
|
|
|
|
eldbus_init(); |
|
|
|
|
|
|
|
|
|
home = getenv("HOME"); |
|
|
|
|
if (!home || !home[0]) |
|
|
|
@ -872,7 +872,7 @@ elm_main(int argc, char **argv)
|
|
|
|
|
else |
|
|
|
|
url = config_home_page_get(config); |
|
|
|
|
|
|
|
|
|
conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION); |
|
|
|
|
conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION); |
|
|
|
|
if (conn) |
|
|
|
|
{ |
|
|
|
|
struct Eve_DBus_Request_Name_Response *response = calloc(1, sizeof(*response)); |
|
|
|
@ -881,7 +881,7 @@ elm_main(int argc, char **argv)
|
|
|
|
|
response->conn = conn; |
|
|
|
|
response->url = url; |
|
|
|
|
|
|
|
|
|
edbus_name_request(conn, "org.enlightenment.eve", 0, |
|
|
|
|
eldbus_name_request(conn, "org.enlightenment.eve", 0, |
|
|
|
|
_cb_dbus_request_name, response); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -912,7 +912,7 @@ end_fav:
|
|
|
|
|
_cb_session_save(session); |
|
|
|
|
session_free(session); |
|
|
|
|
end_session: |
|
|
|
|
if (conn) edbus_connection_unref(conn); |
|
|
|
|
if (conn) eldbus_connection_unref(conn); |
|
|
|
|
if (session_save_timer) ecore_timer_del(session_save_timer); |
|
|
|
|
|
|
|
|
|
eina_log_domain_unregister(_log_domain); |
|
|
|
@ -920,7 +920,7 @@ end_session:
|
|
|
|
|
elm_shutdown(); |
|
|
|
|
ewk_shutdown(); |
|
|
|
|
eve_state_shutdown(); |
|
|
|
|
edbus_shutdown(); |
|
|
|
|
eldbus_shutdown(); |
|
|
|
|
return r; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|