[Glade-devel] [patch, glade3] rm glade-project-window.h from clipboard view
- From: pborelli katamail com (paolo borelli)
- Subject: [Glade-devel] [patch, glade3] rm glade-project-window.h from clipboard view
- Date: 17 May 2003 16:11:14 +0200
--=-WgBgJ3cTUzIiILhXnp+Y
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi!
Removing glade-project-window.h from clipboard view is way easier:
just a matter of deleting the include ;)
In the attached patch, together with the deletion of the include, the
usual bunch of janitorial cleanups (whitespaces, moving GType
boilerplate code at the top as we do in the other files, and replacing
the deprecated gtk_widget_set_usize with gtk_window_set_default_size)
ciao
paolo
--=-WgBgJ3cTUzIiILhXnp+Y
Content-Disposition: attachment; filename=clipb-view-cleanup.patch
Content-Type: text/x-patch; name=clipb-view-cleanup.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit
diff -upr gnome2/glade3/ChangeLog glade3/ChangeLog
--- gnome2/glade3/ChangeLog 2003-05-17 14:52:54.000000000 +0200
+++ glade3/ChangeLog 2003-05-17 15:53:17.000000000 +0200
@@ -1,5 +1,10 @@
2003-05-17 Paolo Borelli <pborelli katamail com>
+ * src/glade-clipboard-view.[ch]: do not include
+ glade-project-window.h and some minor cleanups
+
+2003-05-17 Paolo Borelli <pborelli katamail com>
+
* src/glade-clipboard.c: no need to call glade_editor_select_widget,
as it is already called when the selection_changed signal is
emitted. Move gpw->active_placeholder = NULL in the signal handler
diff -upr gnome2/glade3/src/glade-clipboard-view.c glade3/src/glade-clipboard-view.c
--- gnome2/glade3/src/glade-clipboard-view.c 2003-05-02 09:08:42.000000000 +0200
+++ glade3/src/glade-clipboard-view.c 2003-05-17 15:50:12.000000000 +0200
@@ -22,18 +22,60 @@
* USA.
*/
-#include <glib.h>
-#include <gtk/gtk.h>
#include "glade.h"
#include "glade-clipboard.h"
#include "glade-clipboard-view.h"
#include "glade-widget.h"
#include "glade-widget-class.h"
-#include "glade-project-window.h"
+
+
+static void
+glade_clipboard_view_class_init (GladeClipboardViewClass *class)
+{
+
+}
static void
-glade_clipboard_view_selection_changed_cb (GtkTreeSelection * sel,
- GladeClipboardView * view)
+glade_clipboard_view_init (GladeClipboardView *view)
+{
+ view->widget = NULL;
+ view->clipboard = NULL;
+ view->model = NULL;
+}
+
+/**
+ * glade_clipboard_view_get_type:
+ *
+ * Creates the typecode for the GladeClipboardView Widget type.
+ *
+ * Return value: the typecode for the GladeClipboardView widget type.
+ **/
+GtkType
+glade_clipboard_view_get_type ()
+{
+ static GtkType type = 0;
+
+ if (!type) {
+ static const GtkTypeInfo info = {
+ "GladeClipboardView",
+ sizeof (GladeClipboardView),
+ sizeof (GladeClipboardViewClass),
+ (GtkClassInitFunc) glade_clipboard_view_class_init,
+ (GtkObjectInitFunc) glade_clipboard_view_init,
+ /* reserved 1 */ NULL,
+ /* reserved 2 */ NULL,
+ (GtkClassInitFunc) NULL
+ };
+
+ type = gtk_type_unique (gtk_window_get_type (), &info);
+ }
+
+ return type;
+}
+
+static void
+glade_clipboard_view_selection_changed_cb (GtkTreeSelection *sel,
+ GladeClipboardView *view)
{
GtkTreeIter iter;
GladeWidget *widget;
@@ -42,6 +84,7 @@ glade_clipboard_view_selection_changed_c
model = GTK_TREE_MODEL (view->model);
if (!gtk_tree_selection_get_selected (sel, &model, &iter))
return;
+
gtk_tree_model_get (model, &iter, 0, &widget, -1);
if (widget)
@@ -49,10 +92,11 @@ glade_clipboard_view_selection_changed_c
}
static void
-glade_clipboard_view_cell_function (GtkTreeViewColumn * tree_column,
- GtkCellRenderer * cell,
- GtkTreeModel * tree_model,
- GtkTreeIter * iter, gpointer data)
+glade_clipboard_view_cell_function (GtkTreeViewColumn *tree_column,
+ GtkCellRenderer *cell,
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ gpointer data)
{
GladeWidget *widget;
@@ -65,9 +109,9 @@ glade_clipboard_view_cell_function (GtkT
}
static void
-glade_clipboard_view_populate_model_real (GtkTreeStore * model,
- GList * widgets,
- GtkTreeIter * parent_iter,
+glade_clipboard_view_populate_model_real (GtkTreeStore *model,
+ GList *widgets,
+ GtkTreeIter *parent_iter,
gboolean add_childs)
{
GladeWidget *widget;
@@ -92,7 +136,7 @@ glade_clipboard_view_populate_model_real
}
static void
-glade_clipboard_view_populate_model (GladeClipboardView * view)
+glade_clipboard_view_populate_model (GladeClipboardView *view)
{
GList *list;
@@ -105,7 +149,7 @@ glade_clipboard_view_populate_model (Gla
}
static void
-glade_clipboard_view_create_tree_view (GladeClipboardView * view)
+glade_clipboard_view_create_tree_view (GladeClipboardView *view)
{
GtkTreeSelection *sel;
GtkCellRenderer *cell;
@@ -115,9 +159,8 @@ glade_clipboard_view_create_tree_view (G
gtk_tree_view_new_with_model (GTK_TREE_MODEL (view->model));
cell = gtk_cell_renderer_text_new ();
- col =
- gtk_tree_view_column_new_with_attributes (_("Widget"), cell,
- NULL);
+ col = gtk_tree_view_column_new_with_attributes (_("Widget"),
+ cell, NULL);
gtk_tree_view_column_set_cell_data_func (col, cell,
glade_clipboard_view_cell_function,
NULL, NULL);
@@ -127,13 +170,10 @@ glade_clipboard_view_create_tree_view (G
g_signal_connect_data (G_OBJECT (sel), "changed",
G_CALLBACK (glade_clipboard_view_selection_changed_cb),
view, NULL, 0);
-
- gtk_widget_set_usize (view->widget, 272, 130);
- gtk_widget_show (view->widget);
}
static void
-glade_clipboard_view_construct (GladeClipboardView * view)
+glade_clipboard_view_construct (GladeClipboardView *view)
{
GtkWidget *scrolled_window;
@@ -141,61 +181,17 @@ glade_clipboard_view_construct (GladeCli
glade_clipboard_view_create_tree_view (view);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_set_usize (scrolled_window, 272, 130);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW
(scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- gtk_widget_set_usize (scrolled_window, 272, 130);
gtk_container_add (GTK_CONTAINER (scrolled_window), view->widget);
gtk_container_add (GTK_CONTAINER (view), scrolled_window);
- gtk_widget_show (scrolled_window);
- return;
-}
-
-static void
-glade_clipboard_view_class_init (GladeClipboardViewClass * klass)
-{
-
-}
-
-static void
-glade_clipboard_view_init (GladeClipboardView * view)
-{
- view->widget = NULL;
- view->clipboard = NULL;
- view->model = NULL;
-}
-
-/**
- * glade_clipboard_view_get_type:
- *
- * Creates the typecode for the GladeClipboardView Widget type.
- *
- * Return value: the typecode for the GladeClipboardView widget type.
- **/
-GtkType
-glade_clipboard_view_get_type ()
-{
- static GtkType type = 0;
-
- if (!type) {
- static const GtkTypeInfo info = {
- "GladeClipboardView",
- sizeof (GladeClipboardView),
- sizeof (GladeClipboardViewClass),
- (GtkClassInitFunc) glade_clipboard_view_class_init,
- (GtkObjectInitFunc) glade_clipboard_view_init,
- /* reserved 1 */ NULL,
- /* reserved 2 */ NULL,
- (GtkClassInitFunc) NULL
- };
+ gtk_window_set_default_size (GTK_WINDOW (view), 272, 130);
+ gtk_widget_show_all (scrolled_window);
- type = gtk_type_unique (gtk_window_get_type (), &info);
- }
-
- return type;
+ return;
}
/**
@@ -206,7 +202,7 @@ glade_clipboard_view_get_type ()
* Return Value: a #GtkWidget.
**/
GtkWidget *
-glade_clipboard_view_new (GladeClipboard * clipboard)
+glade_clipboard_view_new (GladeClipboard *clipboard)
{
GladeClipboardView *view;
@@ -220,7 +216,7 @@ glade_clipboard_view_new (GladeClipboard
}
void
-glade_clipboard_view_add (GladeClipboardView * view, GladeWidget * widget)
+glade_clipboard_view_add (GladeClipboardView *view, GladeWidget *widget)
{
GtkTreeIter iter;
@@ -232,8 +228,8 @@ glade_clipboard_view_add (GladeClipboard
}
void
-glade_clipboard_view_remove (GladeClipboardView * view,
- GladeWidget * widget)
+glade_clipboard_view_remove (GladeClipboardView *view,
+ GladeWidget *widget)
{
GtkTreeIter iter;
GtkTreeModel *model;
@@ -253,3 +249,4 @@ glade_clipboard_view_remove (GladeClipbo
gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
}
+
diff -upr gnome2/glade3/src/glade-clipboard-view.h glade3/src/glade-clipboard-view.h
--- gnome2/glade3/src/glade-clipboard-view.h 2002-03-18 09:39:43.000000000 +0100
+++ glade3/src/glade-clipboard-view.h 2003-05-17 15:22:17.000000000 +0200
@@ -1,10 +1,14 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef __GLADE_CLIPBOARD_VIEW_H__
#define __GLADE_CLIPBOARD_VIEW_H__
G_BEGIN_DECLS
-#define GLADE_CLIPBOARD_VIEW(obj) (GTK_CHECK_CAST (obj, glade_clipboard_view_get_type (),
GladeClipboardView))
+
+
+#define GLADE_CLIPBOARD_VIEW(obj) (GTK_CHECK_CAST (obj, glade_clipboard_view_get_type (),
GladeClipboardView))
#define GLADE_CLIPBOARD_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, glade_clipboard_view_get_type (),
GladeClipboardViewClass))
-#define GLADE_IS_CLIPBOARD_VIEW(obj) (GTK_CHECK_TYPE (obj, glade_clipboard_view_get_type ()))
+#define GLADE_IS_CLIPBOARD_VIEW(obj) (GTK_CHECK_TYPE (obj, glade_clipboard_view_get_type ()))
+
typedef struct _GladeClipboardView GladeClipboardView;
typedef struct _GladeClipboardViewClass GladeClipboardViewClass;
@@ -21,12 +25,15 @@ struct _GladeClipboardViewClass {
};
GtkType glade_clipboard_view_get_type ();
-GtkWidget *glade_clipboard_view_new (GladeClipboard * clipboard);
-void glade_clipboard_view_add (GladeClipboardView * view,
- GladeWidget * widget);
-void glade_clipboard_view_remove (GladeClipboardView * view,
- GladeWidget * widget);
+GtkWidget *glade_clipboard_view_new (GladeClipboard *clipboard);
+
+void glade_clipboard_view_add (GladeClipboardView *view,
+ GladeWidget *widget);
+
+void glade_clipboard_view_remove (GladeClipboardView *view,
+ GladeWidget *widget);
+
G_END_DECLS
#endif /* __GLADE_CLIPBOARD_VIEW_H__ */
--=-WgBgJ3cTUzIiILhXnp+Y--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]