[anjuta/git-shell: 13/373] libanjuta: Stub AnjutaDropEntry



commit 82e45d7eb28f8d3f1fc4c0c3c6367bb1db289fb0
Author: James Liggett <jrliggett cox net>
Date:   Fri Feb 12 00:26:07 2010 -0800

    libanjuta: Stub AnjutaDropEntry
    
    This GtkEntry subclass will act as a DnD target in Git Shell, allowing the user
    to choose between typing a revision, or dragging one from a view.

 libanjuta/Makefile.am         |    4 ++-
 libanjuta/anjuta-drop-entry.c |   64 +++++++++++++++++++++++++++++++++++++++++
 libanjuta/anjuta-drop-entry.h |   56 +++++++++++++++++++++++++++++++++++
 3 files changed, 123 insertions(+), 1 deletions(-)
---
diff --git a/libanjuta/Makefile.am b/libanjuta/Makefile.am
index 15994d5..5a9ebf8 100644
--- a/libanjuta/Makefile.am
+++ b/libanjuta/Makefile.am
@@ -83,7 +83,9 @@ libanjuta_la_SOURCES= \
 	anjuta-command-queue.c \
 	anjuta-command-queue.h \
 	anjuta-project.c \
-	anjuta-project.h
+	anjuta-project.h \
+	anjuta-drop-entry.h \
+	anjuta-drop-entry.c
 
 
 if HAVE_PLUGIN_GLADE
diff --git a/libanjuta/anjuta-drop-entry.c b/libanjuta/anjuta-drop-entry.c
new file mode 100644
index 0000000..5d9c64e
--- /dev/null
+++ b/libanjuta/anjuta-drop-entry.c
@@ -0,0 +1,64 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2010 <jrliggett cox net>
+ * 
+ * anjuta 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 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * anjuta 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 "anjuta-drop-entry.h"
+
+struct _AnjutaDropEntryPriv
+{
+};
+
+G_DEFINE_TYPE (AnjutaDropEntry, anjuta_drop_entry, GTK_TYPE_ENTRY);
+
+static void
+anjuta_drop_entry_init (AnjutaDropEntry *self)
+{
+	self->priv = g_new0 (AnjutaDropEntryPriv, 1);
+}
+
+static void
+anjuta_drop_entry_finalize (GObject *object)
+{
+	AnjutaDropEntry *self;
+
+	self = ANJUTA_DROP_ENTRY (object);
+
+	g_free (self->priv);
+
+	G_OBJECT_CLASS (anjuta_drop_entry_parent_class)->finalize (object);
+}
+
+static void
+anjuta_drop_entry_class_init (AnjutaDropEntryClass *klass)
+{
+	GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+/* May need this later */
+#if 0
+	GtkEntryClass* parent_class = GTK_ENTRY_CLASS (klass);
+#endif
+
+	object_class->finalize = anjuta_drop_entry_finalize;
+}
+
+
+GtkWidget *
+anjuta_drop_entry_new (void)
+{
+	return g_object_new (ANJUTA_TYPE_DROP_ENTRY, NULL);
+}
diff --git a/libanjuta/anjuta-drop-entry.h b/libanjuta/anjuta-drop-entry.h
new file mode 100644
index 0000000..8966536
--- /dev/null
+++ b/libanjuta/anjuta-drop-entry.h
@@ -0,0 +1,56 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2010 <jrliggett cox net>
+ * 
+ * anjuta 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 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * anjuta 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 _ANJUTA_DROP_ENTRY_H_
+#define _ANJUTA_DROP_ENTRY_H_
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define ANJUTA_TYPE_DROP_ENTRY             (anjuta_drop_entry_get_type ())
+#define ANJUTA_DROP_ENTRY(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_DROP_ENTRY, AnjutaDropEntry))
+#define ANJUTA_DROP_ENTRY_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_DROP_ENTRY, AnjutaDropEntryClass))
+#define ANJUTA_IS_DROP_ENTRY(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_DROP_ENTRY))
+#define ANJUTA_IS_DROP_ENTRY_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_DROP_ENTRY))
+#define ANJUTA_DROP_ENTRY_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_DROP_ENTRY, AnjutaDropEntryClass))
+
+typedef struct _AnjutaDropEntryClass AnjutaDropEntryClass;
+typedef struct _AnjutaDropEntry AnjutaDropEntry;
+typedef struct _AnjutaDropEntryPriv AnjutaDropEntryPriv;
+
+struct _AnjutaDropEntryClass
+{
+	GtkEntryClass parent_class;
+};
+
+struct _AnjutaDropEntry
+{
+	GtkEntry parent_instance;
+
+	AnjutaDropEntryPriv *priv;
+};
+
+GType anjuta_drop_entry_get_type (void) G_GNUC_CONST;
+GtkWidget *anjuta_drop_entry_new (void);
+
+G_END_DECLS
+
+#endif /* _ANJUTA_DROP_ENTRY_H_ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]