[vinagre: 13/22] Added VinagreProtocolExt proxy
- From: Jonh Wendell <jwendell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vinagre: 13/22] Added VinagreProtocolExt proxy
- Date: Fri, 30 Jul 2010 21:43:25 +0000 (UTC)
commit cb1f9abbf8dd50819109baa38838b790783a0063
Author: Jonh Wendell <jwendell gnome org>
Date: Fri Jul 30 16:15:14 2010 +0200
Added VinagreProtocolExt proxy
vinagre/Makefile.am | 3 +
vinagre/vinagre-protocol-ext.c | 191 ++++++++++++++++++++++++++++++++++++++++
vinagre/vinagre-protocol-ext.h | 60 +++++++++++++
3 files changed, 254 insertions(+), 0 deletions(-)
---
diff --git a/vinagre/Makefile.am b/vinagre/Makefile.am
index 7a04eac..2c3dc98 100644
--- a/vinagre/Makefile.am
+++ b/vinagre/Makefile.am
@@ -46,6 +46,7 @@ INST_H_FILES = \
vinagre-ssh.h \
vinagre-cache-prefs.h \
vinagre-protocol.h \
+ vinagre-protocol-ext.h \
$(NULL)
headerdir = $(prefix)/include/vinagre- VINAGRE_API_VERSION@/vinagre
@@ -79,6 +80,7 @@ handwritten_sources = \
vinagre-ssh.c \
vinagre-cache-prefs.c \
vinagre-protocol.c \
+ vinagre-protocol-ext.c \
$(NULL)
libvinagre_la_SOURCES = \
@@ -174,6 +176,7 @@ vinagre_applet_SOURCES = \
vinagre-ssh.h vinagre-ssh.c \
vinagre-cache-prefs.h vinagre-cache-prefs.c \
vinagre-protocol.h vinagre-protocol.c \
+ vinagre-protocol-ext.h vinagre-protocol-ext.c \
$(NULL)
if AVAHI
diff --git a/vinagre/vinagre-protocol-ext.c b/vinagre/vinagre-protocol-ext.c
new file mode 100644
index 0000000..5838862
--- /dev/null
+++ b/vinagre/vinagre-protocol-ext.c
@@ -0,0 +1,191 @@
+/*
+ * vinagre-protocol-ext.c
+ * This file is part of vinagre
+ *
+ * Copyright (C) 2010 Jonh Wendell <wendell bani com br>
+ *
+ * vinagre-protocol.c is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * vinagre-protocol.h is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "vinagre-protocol-ext.h"
+
+const gchar *
+vinagre_protocol_ext_get_protocol (VinagreProtocolExt *protocol)
+{
+ const gchar *result = NULL;
+
+// g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "get_protocol", &result);
+
+ return result;
+}
+
+gchar **
+vinagre_protocol_ext_get_public_description (VinagreProtocolExt *protocol)
+{
+ gchar **result = NULL;
+
+// g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "get_public_description", &result);
+
+ return result;
+}
+
+gint
+vinagre_protocol_ext_get_default_port (VinagreProtocolExt *protocol)
+{
+ gint result = 0;
+
+// g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "get_default_port", &result);
+
+ return result;
+}
+
+const gchar *
+vinagre_protocol_ext_get_mdns_service (VinagreProtocolExt *protocol)
+{
+ const gchar *result = NULL;
+
+// g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "get_mdns_service", &result);
+
+ return result;
+}
+
+GSList *
+vinagre_protocol_ext_get_context_groups (VinagreProtocolExt *protocol)
+{
+ GSList *result = NULL;
+
+// g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "get_context_groups", &result);
+
+ return result;
+}
+
+GtkFileFilter *
+vinagre_protocol_ext_get_file_filter (VinagreProtocolExt *protocol)
+{
+ GtkFileFilter *result = NULL;
+
+// g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "get_file_filter", &result);
+
+ return result;
+}
+
+GtkWidget *
+vinagre_protocol_ext_new_tab (VinagreProtocolExt *protocol,
+ VinagreConnection *conn,
+ VinagreWindow *window)
+{
+ GtkWidget *result = NULL;
+
+// g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "new_tab", conn, window, &result);
+
+ return result;
+}
+
+VinagreConnection *
+vinagre_protocol_ext_new_connection (VinagreProtocolExt *protocol)
+{
+ VinagreConnection *result = NULL;
+
+ //g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "new_connection", &result);
+
+ return result;
+}
+
+VinagreConnection *
+vinagre_protocol_ext_new_connection_from_file (VinagreProtocolExt *protocol,
+ const gchar *data,
+ gboolean use_bookmarks,
+ gchar **error_msg)
+{
+ VinagreConnection *result = NULL;
+
+ //g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "new_connection_from_file", data, use_bookmarks, error_msg, &result);
+
+ return result;
+}
+
+/**
+ * vinagre_protocol_ext_get_connect_widget:
+ *
+ * @protocol: a protocol
+ * @initial_settings: (allow-none): bla bla
+ * @returns: (allow-none): a widget
+ */
+GtkWidget *
+vinagre_protocol_ext_get_connect_widget (VinagreProtocolExt *protocol,
+ VinagreConnection *initial_settings)
+{
+ GtkWidget *result = NULL;
+
+ //g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "get_connect_widget", initial_settings, &result);
+
+ return result;
+}
+
+void
+vinagre_protocol_ext_parse_mdns_dialog (VinagreProtocolExt *protocol,
+ GtkWidget *connect_widget,
+ GtkWidget *dialog)
+{
+ //g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "parse_mdns_dialog", connect_widget, dialog);
+}
+
+const gchar *
+vinagre_protocol_ext_get_icon_name (VinagreProtocolExt *protocol)
+{
+ const gchar *result = NULL;
+
+ //g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "get_icon_name", &result);
+
+ return result;
+}
+
+GdkPixbuf *
+vinagre_protocol_ext_get_icon (VinagreProtocolExt *protocol,
+ gint size)
+{
+ GdkPixbuf *result = NULL;
+
+ //g_return_if_fail (peas_extension_get_type (protocol) != VINAGRE_TYPE_PROTOCOL);
+
+ peas_extension_call (protocol, "get_icon", size, &result);
+
+ return result;
+}
+
+/* vim: set ts=8: */
diff --git a/vinagre/vinagre-protocol-ext.h b/vinagre/vinagre-protocol-ext.h
new file mode 100644
index 0000000..d9014e4
--- /dev/null
+++ b/vinagre/vinagre-protocol-ext.h
@@ -0,0 +1,60 @@
+/*
+ * vinagre-protocol-ext.h
+ * This file is part of vinagre
+ *
+ * Copyright (C) 2010 Jonh Wendell <wendell bani com br>
+ *
+ * vinagre-protocol.h is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * vinagre-protocol.h is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __VINAGRE_PROTOCOL_EXT_H__
+#define __VINAGRE_PROTOCOL_EXT_H__
+
+#include <glib-object.h>
+#include <libpeas/peas.h>
+#include "vinagre-window.h"
+
+typedef PeasExtension VinagreProtocolExt;
+
+G_BEGIN_DECLS
+
+void vinagre_protocol_ext_parse_mdns_dialog (VinagreProtocolExt *protocol,
+ GtkWidget *connect_widget,
+ GtkWidget *dialog);
+GSList * vinagre_protocol_ext_get_context_groups (VinagreProtocolExt *protocol);
+const gchar * vinagre_protocol_ext_get_protocol (VinagreProtocolExt *protocol);
+gchar ** vinagre_protocol_ext_get_public_description (VinagreProtocolExt *protocol);
+gint vinagre_protocol_ext_get_default_port (VinagreProtocolExt *protocol);
+VinagreConnection * vinagre_protocol_ext_new_connection (VinagreProtocolExt *protocol);
+VinagreConnection * vinagre_protocol_ext_new_connection_from_file (VinagreProtocolExt *protocol,
+ const gchar *data,
+ gboolean use_bookmarks,
+ gchar **error_msg);
+const gchar * vinagre_protocol_ext_get_mdns_service (VinagreProtocolExt *protocol);
+GtkWidget * vinagre_protocol_ext_new_tab (VinagreProtocolExt *protocol,
+ VinagreConnection *conn,
+ VinagreWindow *window);
+GtkWidget * vinagre_protocol_ext_get_connect_widget (VinagreProtocolExt *protocol,
+ VinagreConnection *initial_settings);
+GtkFileFilter * vinagre_protocol_ext_get_file_filter (VinagreProtocolExt *protocol);
+
+GdkPixbuf * vinagre_protocol_ext_get_icon (VinagreProtocolExt *protocol,
+ gint size);
+const gchar * vinagre_protocol_ext_get_icon_name (VinagreProtocolExt *protocol);
+
+G_END_DECLS
+
+#endif /* __VINAGRE_PROTOCOL_EXT_H__ */
+
+/* vim: set ts=8: */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]