[vinagre] Moved drag&drop stuff to its own .h file.
- From: Jonh Wendell <jwendell src gnome org>
- To: svn-commits-list gnome org
- Subject: [vinagre] Moved drag&drop stuff to its own .h file.
- Date: Mon, 27 Jul 2009 14:28:05 +0000 (UTC)
commit 18b2ebc56bc2b215995b61ec2958fa6c9db93d19
Author: Jonh Wendell <jwendell gnome org>
Date: Mon Jul 27 11:25:06 2009 -0300
Moved drag&drop stuff to its own .h file.
Also updated some files according. This avoids a compiler warning.
plugins/dummy/vinagre-dummy-plugin.c | 1 -
plugins/vnc/vinagre-vnc-plugin.c | 8 ++++----
vinagre/Makefile.am | 1 +
vinagre/vinagre-dnd.h | 30 ++++++++++++++++++++++++++++++
vinagre/vinagre-fav.c | 3 ++-
vinagre/vinagre-notebook.c | 3 ++-
vinagre/vinagre-utils.h | 11 -----------
7 files changed, 39 insertions(+), 18 deletions(-)
---
diff --git a/plugins/dummy/vinagre-dummy-plugin.c b/plugins/dummy/vinagre-dummy-plugin.c
index 6173d84..3b58090 100644
--- a/plugins/dummy/vinagre-dummy-plugin.c
+++ b/plugins/dummy/vinagre-dummy-plugin.c
@@ -27,7 +27,6 @@
#include <gmodule.h>
#include <vinagre/vinagre-debug.h>
-#include <vinagre/vinagre-utils.h>
#include "vinagre-dummy-plugin.h"
diff --git a/plugins/vnc/vinagre-vnc-plugin.c b/plugins/vnc/vinagre-vnc-plugin.c
index 1f7f4ff..b7d3bff 100644
--- a/plugins/vnc/vinagre-vnc-plugin.c
+++ b/plugins/vnc/vinagre-vnc-plugin.c
@@ -22,10 +22,6 @@
#include <config.h>
#endif
-#include "vinagre-vnc-plugin.h"
-#include "vinagre-vnc-connection.h"
-#include "vinagre-vnc-tab.h"
-
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gmodule.h>
@@ -34,6 +30,10 @@
#include <vinagre/vinagre-debug.h>
#include <vinagre/vinagre-utils.h>
+#include "vinagre-vnc-plugin.h"
+#include "vinagre-vnc-connection.h"
+#include "vinagre-vnc-tab.h"
+
#define VINAGRE_VNC_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), VINAGRE_TYPE_VNC_PLUGIN, VinagreVncPluginPrivate))
VINAGRE_PLUGIN_REGISTER_TYPE(VinagreVncPlugin, vinagre_vnc_plugin)
diff --git a/vinagre/Makefile.am b/vinagre/Makefile.am
index a6a6d6f..ce55b18 100644
--- a/vinagre/Makefile.am
+++ b/vinagre/Makefile.am
@@ -48,6 +48,7 @@ INST_H_FILES = \
vinagre-ui.h \
vinagre-utils.h \
vinagre-window.h \
+ vinagre-dnd.h \
$(NULL)
headerdir = $(prefix)/include/vinagre- VINAGRE_API_VERSION@/vinagre
diff --git a/vinagre/vinagre-dnd.h b/vinagre/vinagre-dnd.h
new file mode 100644
index 0000000..1224204
--- /dev/null
+++ b/vinagre/vinagre-dnd.h
@@ -0,0 +1,30 @@
+/*
+ * vinagre-dnd.h
+ * This file is part of vinagre
+ *
+ * Copyright (C) 2009 - Jonh Wendell <wendell bani com br>
+ *
+ * This program 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.
+ *
+ * This program 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/>.
+ */
+
+typedef enum {
+ TARGET_VINAGRE,
+ TARGET_STRING
+} VinagreDndType;
+
+static GtkTargetEntry vinagre_target_list[] = {
+ { "VINAGRE", 0, TARGET_VINAGRE },
+ { "text/plain", 0, TARGET_STRING }
+};
+
diff --git a/vinagre/vinagre-fav.c b/vinagre/vinagre-fav.c
index ae49332..1878c2f 100644
--- a/vinagre/vinagre-fav.c
+++ b/vinagre/vinagre-fav.c
@@ -25,6 +25,7 @@
#include <glib/gi18n.h>
#include "vinagre-fav.h"
#include "vinagre-utils.h"
+#include "vinagre-dnd.h"
#include "vinagre-bookmarks.h"
#include "vinagre-window-private.h"
#include "vinagre-bookmarks-entry.h"
@@ -730,7 +731,7 @@ vinagre_fav_init (VinagreFav *fav)
gtk_drag_dest_set (fav->priv->tree,
GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT,
vinagre_target_list,
- vinagre_n_targets,
+ G_N_ELEMENTS (vinagre_target_list),
GDK_ACTION_COPY);
g_signal_connect (fav->priv->tree,
diff --git a/vinagre/vinagre-notebook.c b/vinagre/vinagre-notebook.c
index 2b2f287..3378328 100644
--- a/vinagre/vinagre-notebook.c
+++ b/vinagre/vinagre-notebook.c
@@ -26,6 +26,7 @@
#include "vinagre-notebook.h"
#include "vinagre-utils.h"
+#include "vinagre-dnd.h"
#include "vinagre-prefs.h"
#define VINAGRE_NOTEBOOK_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), VINAGRE_TYPE_NOTEBOOK, VinagreNotebookPrivate))
@@ -520,7 +521,7 @@ build_tab_label (VinagreNotebook *nb,
gtk_drag_source_set ( GTK_WIDGET (hbox),
GDK_BUTTON1_MASK,
vinagre_target_list,
- vinagre_n_targets,
+ G_N_ELEMENTS (vinagre_target_list),
GDK_ACTION_COPY );
g_signal_connect (hbox,
"drag-data-get",
diff --git a/vinagre/vinagre-utils.h b/vinagre/vinagre-utils.h
index e10126f..9c91590 100644
--- a/vinagre/vinagre-utils.h
+++ b/vinagre/vinagre-utils.h
@@ -29,17 +29,6 @@
#define GPOINTER_TO_BOOLEAN(i) ((gboolean) ((((gint)(i)) == 2) ? TRUE : FALSE))
#define IS_VALID_BOOLEAN(v) (((v == TRUE) || (v == FALSE)) ? TRUE : FALSE)
-enum {
- TARGET_VINAGRE,
- TARGET_STRING
-};
-
-static GtkTargetEntry vinagre_target_list[] = {
- { "VINAGRE", 0, TARGET_VINAGRE },
- { "text/plain", 0, TARGET_STRING }
-};
-static guint vinagre_n_targets = G_N_ELEMENTS (vinagre_target_list);
-
enum { VINAGRE_ALL_WORKSPACES = 0xffffffff };
GtkWidget *vinagre_utils_create_small_close_button (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]