diff options
author | Darin Adler <darin@src.gnome.org> | 2001-10-31 00:31:00 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-10-31 00:31:00 +0000 |
commit | 74e78f43fe12ab51c6de68561b9fad1df8877d74 (patch) | |
tree | 5e732b70ea37e7ecacea9f7d2351e189be8c887f /cut-n-paste-code | |
parent | 19dcc4ea40a3d824977a7808662ee3a60a35e513 (diff) | |
download | nautilus-74e78f43fe12ab51c6de68561b9fad1df8877d74.tar.gz |
cut-n-paste-code now compiles, and we are a hair's breadth away from
* Lots of files:
cut-n-paste-code now compiles, and we are a hair's breadth
away from linking -- so far from running, though
Diffstat (limited to 'cut-n-paste-code')
-rw-r--r-- | cut-n-paste-code/widgets/e-paned/Makefile.am | 4 | ||||
-rw-r--r-- | cut-n-paste-code/widgets/e-paned/e-hpaned.c | 56 | ||||
-rw-r--r-- | cut-n-paste-code/widgets/e-paned/e-paned.c | 2 | ||||
-rw-r--r-- | cut-n-paste-code/widgets/e-paned/e-vpaned.c | 56 | ||||
-rw-r--r-- | cut-n-paste-code/widgets/gimphwrapbox/Makefile.am | 4 | ||||
-rw-r--r-- | cut-n-paste-code/widgets/gimphwrapbox/gtkhwrapbox.c | 3 | ||||
-rw-r--r-- | cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.c | 130 | ||||
-rw-r--r-- | cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.h | 3 |
8 files changed, 6 insertions, 252 deletions
diff --git a/cut-n-paste-code/widgets/e-paned/Makefile.am b/cut-n-paste-code/widgets/e-paned/Makefile.am index d016f8ff7..b2595586c 100644 --- a/cut-n-paste-code/widgets/e-paned/Makefile.am +++ b/cut-n-paste-code/widgets/e-paned/Makefile.am @@ -2,9 +2,7 @@ NULL= noinst_LTLIBRARIES = libe-paned.la -INCLUDES = \ - $(GNOMEUI_CFLAGS) \ - $(NULL) +INCLUDES = $(E_PANED_CFLAGS) libe_paned_la_SOURCES = \ e-hpaned.c \ diff --git a/cut-n-paste-code/widgets/e-paned/e-hpaned.c b/cut-n-paste-code/widgets/e-paned/e-hpaned.c index 80745459b..f6655cc01 100644 --- a/cut-n-paste-code/widgets/e-paned/e-hpaned.c +++ b/cut-n-paste-code/widgets/e-paned/e-hpaned.c @@ -40,8 +40,6 @@ static void e_hpaned_size_request (GtkWidget *widget, GtkRequisition *requisition); static void e_hpaned_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static void e_hpaned_draw (GtkWidget *widget, - GdkRectangle *area); static void e_hpaned_xor_line (EPaned *paned); static gboolean e_hpaned_button_press (GtkWidget *widget, GdkEventButton *event); @@ -87,7 +85,6 @@ e_hpaned_class_init (EHPanedClass *klass) widget_class->size_request = e_hpaned_size_request; widget_class->size_allocate = e_hpaned_size_allocate; - widget_class->draw = e_hpaned_draw; widget_class->button_press_event = e_hpaned_button_press; widget_class->button_release_event = e_hpaned_button_release; widget_class->motion_notify_event = e_hpaned_motion; @@ -252,59 +249,6 @@ e_hpaned_size_allocate (GtkWidget *widget, } static void -e_hpaned_draw (GtkWidget *widget, - GdkRectangle *area) -{ - EPaned *paned; - GdkRectangle handle_area, child_area; - guint16 border_width; - - g_return_if_fail (widget != NULL); - g_return_if_fail (E_IS_PANED (widget)); - - if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget)) - { - paned = E_PANED (widget); - border_width = GTK_CONTAINER (paned)->border_width; - - gdk_window_clear_area (widget->window, - area->x, area->y, area->width, - area->height); - - if (e_paned_handle_shown(paned)) - { - handle_area.x = paned->handle_xpos; - handle_area.y = paned->handle_ypos; - handle_area.width = paned->handle_size; - handle_area.height = paned->handle_height; - - if (gdk_rectangle_intersect (&handle_area, area, &child_area)) - { - child_area.x -= paned->handle_xpos; - child_area.y -= paned->handle_ypos; - - gtk_paint_handle (widget->style, - paned->handle, - GTK_STATE_NORMAL, - GTK_SHADOW_NONE, - &child_area, - widget, - "paned", - 0, 0, -1, -1, - GTK_ORIENTATION_VERTICAL); - - } - } - /* Redraw the children - */ - if (paned->child1 && gtk_widget_intersect (paned->child1, area, &child_area)) - gtk_widget_draw(paned->child1, &child_area); - if (paned->child2 && gtk_widget_intersect(paned->child2, area, &child_area)) - gtk_widget_draw(paned->child2, &child_area); - } -} - -static void e_hpaned_xor_line (EPaned *paned) { GtkWidget *widget; diff --git a/cut-n-paste-code/widgets/e-paned/e-paned.c b/cut-n-paste-code/widgets/e-paned/e-paned.c index bedca3cca..770bed830 100644 --- a/cut-n-paste-code/widgets/e-paned/e-paned.c +++ b/cut-n-paste-code/widgets/e-paned/e-paned.c @@ -616,7 +616,7 @@ e_paned_compute_position(EPaned *paned, gboolean e_paned_handle_shown(EPaned *paned) { - EPanedClass *klass = E_PANED_CLASS(GTK_OBJECT(paned)->klass); + EPanedClass *klass = E_PANED_CLASS(G_OBJECT_CLASS(paned)); if (klass->handle_shown) return (*klass->handle_shown)(paned); else diff --git a/cut-n-paste-code/widgets/e-paned/e-vpaned.c b/cut-n-paste-code/widgets/e-paned/e-vpaned.c index 2b99334b5..37cf70713 100644 --- a/cut-n-paste-code/widgets/e-paned/e-vpaned.c +++ b/cut-n-paste-code/widgets/e-paned/e-vpaned.c @@ -40,8 +40,6 @@ static void e_vpaned_size_request (GtkWidget *widget, GtkRequisition *requisition); static void e_vpaned_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static void e_vpaned_draw (GtkWidget *widget, - GdkRectangle *area); static void e_vpaned_xor_line (EPaned *paned); static gboolean e_vpaned_button_press (GtkWidget *widget, GdkEventButton *event); @@ -87,7 +85,6 @@ e_vpaned_class_init (EVPanedClass *klass) widget_class->size_request = e_vpaned_size_request; widget_class->size_allocate = e_vpaned_size_allocate; - widget_class->draw = e_vpaned_draw; widget_class->button_press_event = e_vpaned_button_press; widget_class->button_release_event = e_vpaned_button_release; widget_class->motion_notify_event = e_vpaned_motion; @@ -251,59 +248,6 @@ e_vpaned_size_allocate (GtkWidget *widget, } static void -e_vpaned_draw (GtkWidget *widget, - GdkRectangle *area) -{ - EPaned *paned; - GdkRectangle handle_area, child_area; - guint16 border_width; - - g_return_if_fail (widget != NULL); - g_return_if_fail (E_IS_PANED (widget)); - - if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget)) - { - paned = E_PANED (widget); - border_width = GTK_CONTAINER (paned)->border_width; - - gdk_window_clear_area (widget->window, - area->x, area->y, area->width, - area->height); - - if (e_paned_handle_shown(paned)) - { - handle_area.x = paned->handle_xpos; - handle_area.y = paned->handle_ypos; - handle_area.width = paned->handle_width; - handle_area.height = paned->handle_size; - - if (gdk_rectangle_intersect (&handle_area, area, &child_area)) - { - child_area.x -= paned->handle_xpos; - child_area.y -= paned->handle_ypos; - - gtk_paint_handle (widget->style, - paned->handle, - GTK_STATE_NORMAL, - GTK_SHADOW_NONE, - &child_area, - widget, - "paned", - 0, 0, -1, -1, - GTK_ORIENTATION_HORIZONTAL); - - } - } - /* Redraw the children - */ - if (paned->child1 && gtk_widget_intersect (paned->child1, area, &child_area)) - gtk_widget_draw (paned->child1, &child_area); - if (paned->child2 && gtk_widget_intersect (paned->child2, area, &child_area)) - gtk_widget_draw (paned->child2, &child_area); - } -} - -static void e_vpaned_xor_line (EPaned *paned) { GtkWidget *widget; diff --git a/cut-n-paste-code/widgets/gimphwrapbox/Makefile.am b/cut-n-paste-code/widgets/gimphwrapbox/Makefile.am index 1c67601d8..435529fac 100644 --- a/cut-n-paste-code/widgets/gimphwrapbox/Makefile.am +++ b/cut-n-paste-code/widgets/gimphwrapbox/Makefile.am @@ -2,9 +2,7 @@ NULL= noinst_LTLIBRARIES = libgtkhwrapbox.la -INCLUDES = \ - $(GNOMEUI_CFLAGS) \ - $(NULL) +INCLUDES = $(GIMPHWRAPBOX_CFLAGS) libgtkhwrapbox_la_SOURCES = \ gtkhwrapbox.c \ diff --git a/cut-n-paste-code/widgets/gimphwrapbox/gtkhwrapbox.c b/cut-n-paste-code/widgets/gimphwrapbox/gtkhwrapbox.c index cf442f4f2..b904efc23 100644 --- a/cut-n-paste-code/widgets/gimphwrapbox/gtkhwrapbox.c +++ b/cut-n-paste-code/widgets/gimphwrapbox/gtkhwrapbox.c @@ -505,7 +505,8 @@ layout_rows (GtkWrapBox *wbox, gfloat shrink_height; guint children_per_line; Line *line_list = NULL; - guint total_height = 0, n_expand_lines = 0, n_lines = 0; + int total_height = 0; + guint n_expand_lines = 0, n_lines = 0; next_child = wbox->children; slist = GTK_WRAP_BOX_GET_CLASS (wbox)->rlist_line_children (wbox, diff --git a/cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.c b/cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.c index d36b8d6bc..9356f1b94 100644 --- a/cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.c +++ b/cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.c @@ -63,18 +63,8 @@ static void gtk_wrap_box_get_arg (GtkObject *object, static void gtk_wrap_box_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gtk_wrap_box_set_child_arg (GtkContainer *container, - GtkWidget *child, - GtkArg *arg, - guint arg_id); -static void gtk_wrap_box_get_child_arg (GtkContainer *container, - GtkWidget *child, - GtkArg *arg, - guint arg_id); static void gtk_wrap_box_map (GtkWidget *widget); static void gtk_wrap_box_unmap (GtkWidget *widget); -static void gtk_wrap_box_draw (GtkWidget *widget, - GdkRectangle *area); static gint gtk_wrap_box_expose (GtkWidget *widget, GdkEventExpose *event); static void gtk_wrap_box_add (GtkContainer *container, @@ -136,15 +126,12 @@ gtk_wrap_box_class_init (GtkWrapBoxClass *class) widget_class->map = gtk_wrap_box_map; widget_class->unmap = gtk_wrap_box_unmap; - widget_class->draw = gtk_wrap_box_draw; widget_class->expose_event = gtk_wrap_box_expose; container_class->add = gtk_wrap_box_add; container_class->remove = gtk_wrap_box_remove; container_class->forall = gtk_wrap_box_forall; container_class->child_type = gtk_wrap_box_child_type; - container_class->set_child_arg = gtk_wrap_box_set_child_arg; - container_class->get_child_arg = gtk_wrap_box_get_child_arg; class->rlist_line_children = NULL; @@ -164,18 +151,6 @@ gtk_wrap_box_class_init (GtkWrapBoxClass *class) GTK_TYPE_FLOAT, GTK_ARG_READABLE, ARG_CURRENT_RATIO); gtk_object_add_arg_type ("GtkWrapBox::max_children_per_line", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_CHILD_LIMIT); - gtk_container_add_child_arg_type ("GtkWrapBox::position", - GTK_TYPE_INT, GTK_ARG_READWRITE, CHILD_ARG_POSITION); - gtk_container_add_child_arg_type ("GtkWrapBox::hexpand", - GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_HEXPAND); - gtk_container_add_child_arg_type ("GtkWrapBox::hfill", - GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_HFILL); - gtk_container_add_child_arg_type ("GtkWrapBox::vexpand", - GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_VEXPAND); - gtk_container_add_child_arg_type ("GtkWrapBox::vfill", - GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_VFILL); - gtk_container_add_child_arg_type ("GtkWrapBox::forcebreak", - GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_FORCED_BREAK); signals[NEED_REALLOCATION] = g_signal_new ("need_reallocation", @@ -282,96 +257,6 @@ gtk_wrap_box_get_arg (GtkObject *object, } } -static void -gtk_wrap_box_set_child_arg (GtkContainer *container, - GtkWidget *child, - GtkArg *arg, - guint arg_id) -{ - GtkWrapBox *wbox = GTK_WRAP_BOX (container); - gboolean hexpand = FALSE, hfill = FALSE, vexpand = FALSE, vfill = FALSE; - - if (arg_id != CHILD_ARG_POSITION) - gtk_wrap_box_query_child_packing (wbox, child, &hexpand, &hfill, &vexpand, &vfill); - - switch (arg_id) - { - case CHILD_ARG_POSITION: - gtk_wrap_box_reorder_child (wbox, child, GTK_VALUE_INT (*arg)); - break; - case CHILD_ARG_HEXPAND: - gtk_wrap_box_set_child_packing (wbox, child, - GTK_VALUE_BOOL (*arg), hfill, - vexpand, vfill); - break; - case CHILD_ARG_HFILL: - gtk_wrap_box_set_child_packing (wbox, child, - hexpand, GTK_VALUE_BOOL (*arg), - vexpand, vfill); - break; - case CHILD_ARG_VEXPAND: - gtk_wrap_box_set_child_packing (wbox, child, - hexpand, hfill, - GTK_VALUE_BOOL (*arg), vfill); - break; - case CHILD_ARG_VFILL: - gtk_wrap_box_set_child_packing (wbox, child, - hexpand, hfill, - vexpand, GTK_VALUE_BOOL (*arg)); - break; - case CHILD_ARG_FORCED_BREAK: - gtk_wrap_box_set_child_forced_break (wbox, child, - GTK_VALUE_BOOL (*arg)); - break; - default: - break; - } -} - -static void -gtk_wrap_box_get_child_arg (GtkContainer *container, - GtkWidget *child, - GtkArg *arg, - guint arg_id) -{ - GtkWrapBox *wbox = GTK_WRAP_BOX (container); - gboolean hexpand = FALSE, hfill = FALSE, vexpand = FALSE, vfill = FALSE; - - if (arg_id != CHILD_ARG_POSITION) - gtk_wrap_box_query_child_packing (wbox, child, &hexpand, &hfill, &vexpand, &vfill); - - switch (arg_id) - { - GtkWrapBoxChild *child_info; - case CHILD_ARG_POSITION: - GTK_VALUE_INT (*arg) = 0; - for (child_info = wbox->children; child_info; child_info = child_info->next) - { - if (child_info->widget == child) - break; - GTK_VALUE_INT (*arg)++; - } - if (!child_info) - GTK_VALUE_INT (*arg) = -1; - break; - case CHILD_ARG_HEXPAND: - GTK_VALUE_BOOL (*arg) = hexpand; - break; - case CHILD_ARG_HFILL: - GTK_VALUE_BOOL (*arg) = hfill; - break; - case CHILD_ARG_VEXPAND: - GTK_VALUE_BOOL (*arg) = vexpand; - break; - case CHILD_ARG_VFILL: - GTK_VALUE_BOOL (*arg) = vfill; - break; - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - static GtkType gtk_wrap_box_child_type (GtkContainer *container) { @@ -749,21 +634,6 @@ gtk_wrap_box_unmap (GtkWidget *widget) gtk_widget_unmap (child->widget); } -static void -gtk_wrap_box_draw (GtkWidget *widget, - GdkRectangle *area) -{ - GtkWrapBox *wbox = GTK_WRAP_BOX (widget); - GtkWrapBoxChild *child; - GdkRectangle child_area; - - if (GTK_WIDGET_DRAWABLE (widget)) - for (child = wbox->children; child; child = child->next) - if (GTK_WIDGET_DRAWABLE (child->widget) && - gtk_widget_intersect (child->widget, area, &child_area)) - gtk_widget_draw (child->widget, &child_area); -} - static gint gtk_wrap_box_expose (GtkWidget *widget, GdkEventExpose *event) diff --git a/cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.h b/cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.h index 85f392949..869a41b27 100644 --- a/cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.h +++ b/cut-n-paste-code/widgets/gimphwrapbox/gtkwrapbox.h @@ -23,7 +23,6 @@ #define __GTK_WRAP_BOX_H__ -#include <gdk/gdk.h> #include <gtk/gtkcontainer.h> @@ -38,7 +37,7 @@ extern "C" { #define GTK_WRAP_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_WRAP_BOX, GtkWrapBoxClass)) #define GTK_IS_WRAP_BOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_WRAP_BOX)) #define GTK_IS_WRAP_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WRAP_BOX)) -#define GTK_WRAP_BOX_GET_CLASS(obj) (GTK_WRAP_BOX_CLASS (((GtkObject*) (obj))->klass)) +#define GTK_WRAP_BOX_GET_CLASS(obj) (GTK_WRAP_BOX_CLASS (G_OBJECT_GET_CLASS (obj))) /* --- typedefs --- */ |