diff options
author | Ramiro Estrugo <ramiro@src.gnome.org> | 1997-01-02 07:41:27 +0000 |
---|---|---|
committer | Ramiro Estrugo <ramiro@src.gnome.org> | 1997-01-02 07:41:27 +0000 |
commit | d2ac36ca1c0bf84ecc5b7176b9b0ea238c197a1f (patch) | |
tree | 6a0949d18512a4a04ac4a77f581746926c123d69 | |
parent | 6d37f74e4afb9f4a063848714fdef8bae98389b3 (diff) | |
download | nautilus-d2ac36ca1c0bf84ecc5b7176b9b0ea238c197a1f.tar.gz |
Damn, forgot to commit these 2 in the last checkin.
* libnautilus-extensions/nautilus-horizontal-splitter.c:
(nautilus_horizontal_splitter_initialize_class),
(nautilus_horizontal_splitter_initialize),
(nautilus_horizontal_splitter_destroy),
(nautilus_horizontal_splitter_draw),
(nautilus_horizontal_splitter_new):
* libnautilus-extensions/nautilus-horizontal-splitter.h:
Damn, forgot to commit these 2 in the last checkin.
-rw-r--r-- | libnautilus-extensions/nautilus-horizontal-splitter.c | 161 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-horizontal-splitter.h | 65 | ||||
-rw-r--r-- | libnautilus-private/nautilus-horizontal-splitter.c | 161 | ||||
-rw-r--r-- | libnautilus-private/nautilus-horizontal-splitter.h | 65 |
4 files changed, 452 insertions, 0 deletions
diff --git a/libnautilus-extensions/nautilus-horizontal-splitter.c b/libnautilus-extensions/nautilus-horizontal-splitter.c new file mode 100644 index 000000000..894a074a6 --- /dev/null +++ b/libnautilus-extensions/nautilus-horizontal-splitter.c @@ -0,0 +1,161 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* nautilus-horizontal-splitter.c - A horizontal splitter with a semi gradient look + + Copyright (C) 1999, 2000 Eazel, Inc. + + The Gnome Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The Gnome Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Gnome Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + Authors: Ramiro Estrugo <ramiro@eazel.com> +*/ + +#include <config.h> + +#include "nautilus-horizontal-splitter.h" +#include "nautilus-gtk-macros.h" + +struct _NautilusHorizontalSplitterDetail +{ + gint fixme; +}; + +/* NautilusHorizontalSplitterClass methods */ +static void nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass *horizontal_splitter_class); +static void nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_splitter); + + + +/* GtkObjectClass methods */ +static void nautilus_horizontal_splitter_destroy (GtkObject *object); + + +/* GtkWidgetClass methods */ +static void nautilus_horizontal_splitter_draw (GtkWidget *widget, + GdkRectangle *area); + +NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusHorizontalSplitter, + nautilus_horizontal_splitter, + E_TYPE_HPANED); + +/* GtkObjectClass methods */ +static void +nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass *horizontal_splitter_class) +{ + GtkObjectClass *object_class; + GtkWidgetClass *widget_class; + + object_class = GTK_OBJECT_CLASS (horizontal_splitter_class); + widget_class = GTK_WIDGET_CLASS (horizontal_splitter_class); + + /* GtkObjectClass */ + object_class->destroy = nautilus_horizontal_splitter_destroy; + + /* GtkWidgetClass */ + widget_class->draw = nautilus_horizontal_splitter_draw; +} + +static void +nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_splitter) +{ + horizontal_splitter->detail = g_new (NautilusHorizontalSplitterDetail, 1); + + horizontal_splitter->detail->fixme = 666; + + e_paned_set_handle_size (E_PANED (horizontal_splitter), 7); +} + +/* GtkObjectClass methods */ +static void +nautilus_horizontal_splitter_destroy(GtkObject *object) +{ + NautilusHorizontalSplitter *horizontal_splitter; + + g_return_if_fail (object != NULL); + g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (object)); + + horizontal_splitter = NAUTILUS_HORIZONTAL_SPLITTER (object); + + g_free (horizontal_splitter->detail); + + /* Chain */ + NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object)); +} + +/* GtkWidgetClass methods */ +static void +nautilus_horizontal_splitter_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); + } + } +} + +/* NautilusHorizontalSplitter public methods */ +GtkWidget* +nautilus_horizontal_splitter_new (void) +{ + NautilusHorizontalSplitter *horizontal_splitter; + + horizontal_splitter = gtk_type_new (nautilus_horizontal_splitter_get_type ()); + + return GTK_WIDGET (horizontal_splitter); +} diff --git a/libnautilus-extensions/nautilus-horizontal-splitter.h b/libnautilus-extensions/nautilus-horizontal-splitter.h new file mode 100644 index 000000000..e74b452d9 --- /dev/null +++ b/libnautilus-extensions/nautilus-horizontal-splitter.h @@ -0,0 +1,65 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* nautilus-horizontal-splitter.h - A horizontal splitter with a semi gradient look + + Copyright (C) 1999, 2000 Eazel, Inc. + + The Gnome Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The Gnome Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Gnome Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + Authors: Ramiro Estrugo <ramiro@eazel.com> +*/ + +#ifndef NAUTILUS_HORIZONTAL_SPLITTER_H +#define NAUTILUS_HORIZONTAL_SPLITTER_H + +#include <gnome.h> +#include <widgets/e-paned/e-hpaned.h> + +BEGIN_GNOME_DECLS + +#define NAUTILUS_TYPE_HORIZONTAL_SPLITTER (nautilus_horizontal_splitter_get_type ()) +#define NAUTILUS_HORIZONTAL_SPLITTER(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_HORIZONTAL_SPLITTER, NautilusHorizontalSplitter)) +#define NAUTILUS_HORIZONTAL_SPLITTER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_HORIZONTAL_SPLITTER, NautilusHorizontalSplitterClass)) +#define NAUTILUS_IS_HORIZONTAL_SPLITTER(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_HORIZONTAL_SPLITTER)) +#define NAUTILUS_IS_HORIZONTAL_SPLITTER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_HORIZONTAL_SPLITTER)) + +typedef struct _NautilusHorizontalSplitter NautilusHorizontalSplitter; +typedef struct _NautilusHorizontalSplitterClass NautilusHorizontalSplitterClass; +typedef struct _NautilusHorizontalSplitterDetail NautilusHorizontalSplitterDetail; + +struct _NautilusHorizontalSplitter +{ + /* Super Class */ + EHPaned hpaned; + + /* Private stuff */ + NautilusHorizontalSplitterDetail *detail; +}; + +struct _NautilusHorizontalSplitterClass +{ + EHPanedClass parent_class; +}; + +/* NautilusHorizontalSplitter public methods */ +GtkType nautilus_horizontal_splitter_get_type (void); +GtkWidget* nautilus_horizontal_splitter_new (void); + +BEGIN_GNOME_DECLS + +#endif /* NAUTILUS_HORIZONTAL_SPLITTER_H */ + + diff --git a/libnautilus-private/nautilus-horizontal-splitter.c b/libnautilus-private/nautilus-horizontal-splitter.c new file mode 100644 index 000000000..894a074a6 --- /dev/null +++ b/libnautilus-private/nautilus-horizontal-splitter.c @@ -0,0 +1,161 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* nautilus-horizontal-splitter.c - A horizontal splitter with a semi gradient look + + Copyright (C) 1999, 2000 Eazel, Inc. + + The Gnome Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The Gnome Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Gnome Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + Authors: Ramiro Estrugo <ramiro@eazel.com> +*/ + +#include <config.h> + +#include "nautilus-horizontal-splitter.h" +#include "nautilus-gtk-macros.h" + +struct _NautilusHorizontalSplitterDetail +{ + gint fixme; +}; + +/* NautilusHorizontalSplitterClass methods */ +static void nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass *horizontal_splitter_class); +static void nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_splitter); + + + +/* GtkObjectClass methods */ +static void nautilus_horizontal_splitter_destroy (GtkObject *object); + + +/* GtkWidgetClass methods */ +static void nautilus_horizontal_splitter_draw (GtkWidget *widget, + GdkRectangle *area); + +NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusHorizontalSplitter, + nautilus_horizontal_splitter, + E_TYPE_HPANED); + +/* GtkObjectClass methods */ +static void +nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass *horizontal_splitter_class) +{ + GtkObjectClass *object_class; + GtkWidgetClass *widget_class; + + object_class = GTK_OBJECT_CLASS (horizontal_splitter_class); + widget_class = GTK_WIDGET_CLASS (horizontal_splitter_class); + + /* GtkObjectClass */ + object_class->destroy = nautilus_horizontal_splitter_destroy; + + /* GtkWidgetClass */ + widget_class->draw = nautilus_horizontal_splitter_draw; +} + +static void +nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_splitter) +{ + horizontal_splitter->detail = g_new (NautilusHorizontalSplitterDetail, 1); + + horizontal_splitter->detail->fixme = 666; + + e_paned_set_handle_size (E_PANED (horizontal_splitter), 7); +} + +/* GtkObjectClass methods */ +static void +nautilus_horizontal_splitter_destroy(GtkObject *object) +{ + NautilusHorizontalSplitter *horizontal_splitter; + + g_return_if_fail (object != NULL); + g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (object)); + + horizontal_splitter = NAUTILUS_HORIZONTAL_SPLITTER (object); + + g_free (horizontal_splitter->detail); + + /* Chain */ + NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object)); +} + +/* GtkWidgetClass methods */ +static void +nautilus_horizontal_splitter_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); + } + } +} + +/* NautilusHorizontalSplitter public methods */ +GtkWidget* +nautilus_horizontal_splitter_new (void) +{ + NautilusHorizontalSplitter *horizontal_splitter; + + horizontal_splitter = gtk_type_new (nautilus_horizontal_splitter_get_type ()); + + return GTK_WIDGET (horizontal_splitter); +} diff --git a/libnautilus-private/nautilus-horizontal-splitter.h b/libnautilus-private/nautilus-horizontal-splitter.h new file mode 100644 index 000000000..e74b452d9 --- /dev/null +++ b/libnautilus-private/nautilus-horizontal-splitter.h @@ -0,0 +1,65 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* nautilus-horizontal-splitter.h - A horizontal splitter with a semi gradient look + + Copyright (C) 1999, 2000 Eazel, Inc. + + The Gnome Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The Gnome Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Gnome Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + Authors: Ramiro Estrugo <ramiro@eazel.com> +*/ + +#ifndef NAUTILUS_HORIZONTAL_SPLITTER_H +#define NAUTILUS_HORIZONTAL_SPLITTER_H + +#include <gnome.h> +#include <widgets/e-paned/e-hpaned.h> + +BEGIN_GNOME_DECLS + +#define NAUTILUS_TYPE_HORIZONTAL_SPLITTER (nautilus_horizontal_splitter_get_type ()) +#define NAUTILUS_HORIZONTAL_SPLITTER(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_HORIZONTAL_SPLITTER, NautilusHorizontalSplitter)) +#define NAUTILUS_HORIZONTAL_SPLITTER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_HORIZONTAL_SPLITTER, NautilusHorizontalSplitterClass)) +#define NAUTILUS_IS_HORIZONTAL_SPLITTER(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_HORIZONTAL_SPLITTER)) +#define NAUTILUS_IS_HORIZONTAL_SPLITTER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_HORIZONTAL_SPLITTER)) + +typedef struct _NautilusHorizontalSplitter NautilusHorizontalSplitter; +typedef struct _NautilusHorizontalSplitterClass NautilusHorizontalSplitterClass; +typedef struct _NautilusHorizontalSplitterDetail NautilusHorizontalSplitterDetail; + +struct _NautilusHorizontalSplitter +{ + /* Super Class */ + EHPaned hpaned; + + /* Private stuff */ + NautilusHorizontalSplitterDetail *detail; +}; + +struct _NautilusHorizontalSplitterClass +{ + EHPanedClass parent_class; +}; + +/* NautilusHorizontalSplitter public methods */ +GtkType nautilus_horizontal_splitter_get_type (void); +GtkWidget* nautilus_horizontal_splitter_new (void); + +BEGIN_GNOME_DECLS + +#endif /* NAUTILUS_HORIZONTAL_SPLITTER_H */ + + |