Commit e0fb7a86 authored by Benjamin Otte's avatar Benjamin Otte

gtk: Remove GtkRuler

It is really bad code, mostly unused and no one stepped up to fix it.

Note that Gtk developers do not object to a ruler widget in priciple,
just to the current implementation. If someone wants to propose a sane
version, please don't hesitate.

https://bugzilla.gnome.org/show_bug.cgi?id=613942
parent c5e25b15
......@@ -1558,22 +1558,6 @@ GTK_HPANED_GET_CLASS
gtk_hpaned_get_type
</SECTION>
<SECTION>
<FILE>gtkhruler</FILE>
<TITLE>GtkHRuler</TITLE>
GtkHRuler
gtk_hruler_new
<SUBSECTION Standard>
GTK_HRULER
GTK_IS_HRULER
GTK_TYPE_HRULER
GTK_HRULER_CLASS
GTK_IS_HRULER_CLASS
GTK_HRULER_GET_CLASS
<SUBSECTION Private>
gtk_hruler_get_type
</SECTION>
<SECTION>
<FILE>gtkhscale</FILE>
<TITLE>GtkHScale</TITLE>
......@@ -2711,28 +2695,6 @@ GtkRecentActionPrivate
gtk_recent_action_get_type
</SECTION>
<SECTION>
<FILE>gtkruler</FILE>
<TITLE>GtkRuler</TITLE>
GtkRuler
GtkRulerMetric
gtk_ruler_new
gtk_ruler_set_metric
gtk_ruler_set_range
gtk_ruler_get_metric
gtk_ruler_get_range
<SUBSECTION Standard>
GTK_RULER
GTK_IS_RULER
GTK_TYPE_RULER
GTK_RULER_CLASS
GTK_IS_RULER_CLASS
GTK_RULER_GET_CLASS
<SUBSECTION Private>
GtkRulerPrivate
gtk_ruler_get_type
</SECTION>
<SECTION>
<FILE>gtkscale</FILE>
<TITLE>GtkScale</TITLE>
......@@ -4746,22 +4708,6 @@ gtk_vpaned_get_type
GtkPanedPrivate
</SECTION>
<SECTION>
<FILE>gtkvruler</FILE>
<TITLE>GtkVRuler</TITLE>
GtkVRuler
gtk_vruler_new
<SUBSECTION Standard>
GTK_VRULER
GTK_IS_VRULER
GTK_TYPE_VRULER
GTK_VRULER_CLASS
GTK_IS_VRULER_CLASS
GTK_VRULER_GET_CLASS
<SUBSECTION Private>
gtk_vruler_get_type
</SECTION>
<SECTION>
<FILE>gtkvscale</FILE>
<TITLE>GtkVScale</TITLE>
......@@ -5589,7 +5535,6 @@ GtkExpanderStyle
GtkIMPreeditStyle
GtkIMStatusStyle
GtkJustification
GtkMetricType
GtkMovementStep
GtkOrientation
GtkPackType
......
......@@ -155,15 +155,6 @@ Used for justifying the text inside a #GtkLabel widget. (See also
@GTK_JUSTIFY_CENTER: The text is placed in the center of the label.
@GTK_JUSTIFY_FILL: The text is placed is distributed across the label.
<!-- ##### ENUM GtkMetricType ##### -->
<para>
Used to indicate which metric is used by a #GtkRuler.
</para>
@GTK_PIXELS: Pixels.
@GTK_INCHES: Inches.
@GTK_CENTIMETERS: Centimeters.
<!-- ##### ENUM GtkMovementStep ##### -->
<para>
......
......@@ -214,7 +214,6 @@ gtk_public_h_sources = \
gtkhbbox.h \
gtkhbox.h \
gtkhpaned.h \
gtkhruler.h \
gtkhscale.h \
gtkhscrollbar.h \
gtkhseparator.h \
......@@ -269,7 +268,6 @@ gtk_public_h_sources = \
gtkrecentchooserwidget.h \
gtkrecentfilter.h \
gtkrecentmanager.h \
gtkruler.h \
gtkscale.h \
gtkscalebutton.h \
gtkscrollable.h \
......@@ -328,7 +326,6 @@ gtk_public_h_sources = \
gtkviewport.h \
gtkvolumebutton.h \
gtkvpaned.h \
gtkvruler.h \
gtkvscale.h \
gtkvscrollbar.h \
gtkvseparator.h \
......@@ -479,7 +476,6 @@ gtk_base_c_sources = \
gtkhbbox.c \
gtkhbox.c \
gtkhpaned.c \
gtkhruler.c \
gtkhscale.c \
gtkhscrollbar.c \
gtkhseparator.c \
......@@ -545,7 +541,6 @@ gtk_base_c_sources = \
gtkrecentchooser.c \
gtkrecentfilter.c \
gtkrecentmanager.c \
gtkruler.c \
gtkscale.c \
gtkscalebutton.c \
gtkscrollable.c \
......@@ -613,7 +608,6 @@ gtk_base_c_sources = \
gtkvolumebutton.c \
gtkviewport.c \
gtkvpaned.c \
gtkvruler.c \
gtkvscale.c \
gtkvscrollbar.c \
gtkvseparator.c \
......
......@@ -98,7 +98,6 @@
#include <gtk/gtkhbbox.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkhpaned.h>
#include <gtk/gtkhruler.h>
#include <gtk/gtkhscale.h>
#include <gtk/gtkhscrollbar.h>
#include <gtk/gtkhseparator.h>
......@@ -152,7 +151,6 @@
#include <gtk/gtkrecentchooserwidget.h>
#include <gtk/gtkrecentfilter.h>
#include <gtk/gtkrecentmanager.h>
#include <gtk/gtkruler.h>
#include <gtk/gtkscale.h>
#include <gtk/gtkscalebutton.h>
#include <gtk/gtkscrollable.h>
......@@ -211,7 +209,6 @@
#include <gtk/gtkviewport.h>
#include <gtk/gtkvolumebutton.h>
#include <gtk/gtkvpaned.h>
#include <gtk/gtkvruler.h>
#include <gtk/gtkvscale.h>
#include <gtk/gtkvscrollbar.h>
#include <gtk/gtkvseparator.h>
......
......@@ -964,8 +964,6 @@ gtk_hbutton_box_get_type G_GNUC_CONST
gtk_hbutton_box_new
gtk_hpaned_get_type G_GNUC_CONST
gtk_hpaned_new
gtk_hruler_get_type G_GNUC_CONST
gtk_hruler_new
gtk_hscale_get_type G_GNUC_CONST
gtk_hscale_new
gtk_hscale_new_with_range
......@@ -2029,12 +2027,6 @@ gtk_requisition_new G_GNUC_MALLOC
gtk_resize_mode_get_type G_GNUC_CONST
gtk_response_type_get_type G_GNUC_CONST
gtk_rgb_to_hsv
gtk_ruler_get_metric
gtk_ruler_get_range
gtk_ruler_get_type G_GNUC_CONST
gtk_ruler_new
gtk_ruler_set_metric
gtk_ruler_set_range
gtk_scale_add_mark
gtk_scale_button_get_adjustment
gtk_scale_button_get_minus_button
......@@ -3113,8 +3105,6 @@ gtk_volume_button_get_type G_GNUC_CONST
gtk_volume_button_new
gtk_vpaned_get_type G_GNUC_CONST
gtk_vpaned_new
gtk_vruler_get_type G_GNUC_CONST
gtk_vruler_new
gtk_vscale_get_type G_GNUC_CONST
gtk_vscale_new
gtk_vscale_new_with_range
......
......@@ -208,13 +208,6 @@ typedef enum
GTK_MESSAGE_OTHER
} GtkMessageType;
typedef enum
{
GTK_PIXELS,
GTK_INCHES,
GTK_CENTIMETERS
} GtkMetricType;
/**
* GtkMovementStep:
* @GTK_MOVEMENT_LOGICAL_POSITIONS: Move forward or back by graphemes
......
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include "gtkhruler.h"
#include "gtkorientable.h"
G_DEFINE_TYPE (GtkHRuler, gtk_hruler, GTK_TYPE_RULER)
static void
gtk_hruler_class_init (GtkHRulerClass *klass)
{
}
static void
gtk_hruler_init (GtkHRuler *hruler)
{
gtk_orientable_set_orientation (GTK_ORIENTABLE (hruler),
GTK_ORIENTATION_HORIZONTAL);
}
GtkWidget *
gtk_hruler_new (void)
{
return g_object_new (GTK_TYPE_HRULER, NULL);
}
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/*
* NOTE this widget is considered too specialized/little-used for
* GTK+, and will in the future be moved to some other package. If
* your application needs this widget, feel free to use it, as the
* widget does work and is useful in some applications; it's just not
* of general interest. However, we are not accepting new features for
* the widget, and it will eventually move out of the GTK+
* distribution.
*/
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#ifndef __GTK_HRULER_H__
#define __GTK_HRULER_H__
#include <gtk/gtkruler.h>
G_BEGIN_DECLS
#define GTK_TYPE_HRULER (gtk_hruler_get_type ())
#define GTK_HRULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HRULER, GtkHRuler))
#define GTK_HRULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HRULER, GtkHRulerClass))
#define GTK_IS_HRULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HRULER))
#define GTK_IS_HRULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HRULER))
#define GTK_HRULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HRULER, GtkHRulerClass))
typedef struct _GtkHRuler GtkHRuler;
typedef struct _GtkHRulerClass GtkHRulerClass;
struct _GtkHRuler
{
GtkRuler ruler;
};
struct _GtkHRulerClass
{
GtkRulerClass parent_class;
};
GType gtk_hruler_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_hruler_new (void);
G_END_DECLS
#endif /* __GTK_HRULER_H__ */
This diff is collapsed.
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/*
* NOTE this widget is considered too specialized/little-used for
* GTK+, and will in the future be moved to some other package. If
* your application needs this widget, feel free to use it, as the
* widget does work and is useful in some applications; it's just not
* of general interest. However, we are not accepting new features for
* the widget, and it will eventually move out of the GTK+
* distribution.
*/
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#ifndef __GTK_RULER_H__
#define __GTK_RULER_H__
#include <gtk/gtkwidget.h>
G_BEGIN_DECLS
#define GTK_TYPE_RULER (gtk_ruler_get_type ())
#define GTK_RULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RULER, GtkRuler))
#define GTK_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RULER, GtkRulerClass))
#define GTK_IS_RULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RULER))
#define GTK_IS_RULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RULER))
#define GTK_RULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RULER, GtkRulerClass))
typedef struct _GtkRuler GtkRuler;
typedef struct _GtkRulerPrivate GtkRulerPrivate;
typedef struct _GtkRulerClass GtkRulerClass;
typedef struct _GtkRulerMetric GtkRulerMetric;
/* All distances below are in 1/72nd's of an inch. (According to
* Adobe that's a point, but points are really 1/72.27 in.)
*/
struct _GtkRuler
{
GtkWidget widget;
/*< private >*/
GtkRulerPrivate *priv;
};
struct _GtkRulerClass
{
GtkWidgetClass parent_class;
void (* draw_ticks) (GtkRuler *ruler,
cairo_t *cr);
void (* draw_pos) (GtkRuler *ruler,
cairo_t *cr);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
};
struct _GtkRulerMetric
{
gchar *metric_name;
gchar *abbrev;
/* This should be points_per_unit. This is the size of the unit
* in 1/72nd's of an inch and has nothing to do with screen pixels */
gdouble pixels_per_unit;
gdouble ruler_scale[10];
gint subdivide[5]; /* five possible modes of subdivision */
};
GType gtk_ruler_get_type (void) G_GNUC_CONST;
GtkWidget * gtk_ruler_new (GtkOrientation orientation);
void gtk_ruler_set_metric (GtkRuler *ruler,
GtkMetricType metric);
GtkMetricType gtk_ruler_get_metric (GtkRuler *ruler);
void gtk_ruler_set_range (GtkRuler *ruler,
gdouble lower,
gdouble upper,
gdouble position,
gdouble max_size);
void gtk_ruler_get_range (GtkRuler *ruler,
gdouble *lower,
gdouble *upper,
gdouble *position,
gdouble *max_size);
G_END_DECLS
#endif /* __GTK_RULER_H__ */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include "gtkorientable.h"
#include "gtkvruler.h"
/**
* SECTION:gtkvruler
* @Short_description: A vertical ruler
* @Title: GtkVRuler
*
* <note>
* This widget is considered too specialized/little-used for
* GTK+, and will in the future be moved to some other package. If
* your application needs this widget, feel free to use it, as the
* widget does work and is useful in some applications; it's just not
* of general interest. However, we are not accepting new features for
* the widget, and it will eventually move out of the GTK+
* distribution.
* </note>
*
* The VRuler widget is a widget arranged vertically creating a ruler that is
* utilized around other widgets such as a text widget. The ruler is used to show
* the location of the mouse on the window and to show the size of the window in
* specified units. The available units of measurement are GTK_PIXELS, GTK_INCHES
* and GTK_CENTIMETERS. GTK_PIXELS is the default unit of measurement.
*/
G_DEFINE_TYPE (GtkVRuler, gtk_vruler, GTK_TYPE_RULER)
static void
gtk_vruler_class_init (GtkVRulerClass *klass)
{
}
static void
gtk_vruler_init (GtkVRuler *vruler)
{
gtk_orientable_set_orientation (GTK_ORIENTABLE (vruler),
GTK_ORIENTATION_VERTICAL);
}
/**
* gtk_vruler_new:
*
* Creates a new vertical ruler
*
* Returns: a new #GtkVRuler.
*/
GtkWidget *
gtk_vruler_new (void)
{
return g_object_new (GTK_TYPE_VRULER, NULL);
}
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/*
* NOTE this widget is considered too specialized/little-used for
* GTK+, and will in the future be moved to some other package. If
* your application needs this widget, feel free to use it, as the
* widget does work and is useful in some applications; it's just not
* of general interest. However, we are not accepting new features for
* the widget, and it will eventually move out of the GTK+
* distribution.
*/
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#ifndef __GTK_VRULER_H__
#define __GTK_VRULER_H__
#include <gtk/gtkruler.h>
G_BEGIN_DECLS
#define GTK_TYPE_VRULER (gtk_vruler_get_type ())
#define GTK_VRULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VRULER, GtkVRuler))
#define GTK_VRULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_VRULER, GtkVRulerClass))
#define GTK_IS_VRULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VRULER))
#define GTK_IS_VRULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VRULER))
#define GTK_VRULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VRULER, GtkVRulerClass))
typedef struct _GtkVRuler GtkVRuler;
typedef struct _GtkVRulerClass GtkVRulerClass;
struct _GtkVRuler
{
GtkRuler ruler;
};
struct _GtkVRulerClass
{
GtkRulerClass parent_class;
};
GType gtk_vruler_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_vruler_new (void);
G_END_DECLS
#endif /* __GTK_VRULER_H__ */
......@@ -248,7 +248,6 @@ gtk_OBJECTS = \
gtkhbbox.obj \
gtkhbox.obj \
gtkhpaned.obj \
gtkhruler.obj \
gtkhscale.obj \
gtkhscrollbar.obj \
gtkhseparator.obj \
......@@ -305,7 +304,6 @@ gtk_OBJECTS = \
gtkrange.obj \
gtkrbtree.obj \
gtkrc.obj \
gtkruler.obj \
gtkscale.obj \
gtkscalebutton.obj \
gtkscrollbar.obj \
......@@ -347,7 +345,6 @@ gtk_OBJECTS = \
gtkviewport.obj \
gtkvolumebutton.obj \
gtkvpaned.obj \
gtkvruler.obj \
gtkvscale.obj \
gtkvscrollbar.obj \
gtkvseparator.obj \
......@@ -433,7 +430,6 @@ gtk_public_h_sources = \
gtkhbbox.h \
gtkhbox.h \
gtkhpaned.h \
gtkhruler.h \
gtkhscale.h \
gtkhscrollbar.h \
gtkhseparator.h \
......@@ -496,7 +492,6 @@ gtk_public_h_sources = \
gtkrecentchooserwidget.h \
gtkrecentfilter.h \
gtkrecentmanager.h \
gtkruler.h \
gtkscale.h \
gtkscalebutton.h \
gtkscrollbar.h \
......@@ -555,7 +550,6 @@ gtk_public_h_sources = \
gtkviewport.h \
gtkvolumebutton.h \
gtkvpaned.h \
gtkvruler.h \
gtkvscale.h \
gtkvscrollbar.h \
gtkvseparator.h \
......
......@@ -722,7 +722,6 @@ test_types (void)
" <object class=\"GtkHButtonBox\" id=\"hbuttonbox\"/>"
" <object class=\"GtkHBox\" id=\"hbox\"/>"
" <object class=\"GtkHPaned\" id=\"hpaned\"/>"
" <object class=\"GtkHRuler\" id=\"hruler\"/>"
" <object class=\"GtkHScale\" id=\"hscale\"/>"
" <object class=\"GtkHScrollbar\" id=\"hscrollbar\"/>"
" <object class=\"GtkHSeparator\" id=\"hseparator\"/>"
......@@ -749,7 +748,6 @@ test_types (void)
" <object class=\"GtkVScrollbar\" id=\"vscrollbar\"/>"
" <object class=\"GtkVSeparator\" id=\"vseparator\"/>"
" <object class=\"GtkViewport\" id=\"viewport\"/>"
" <object class=\"GtkVRuler\" id=\"vruler\"/>"
" <object class=\"GtkVPaned\" id=\"vpaned\"/>"
" <object class=\"GtkVScale\" id=\"vscale\"/>"
" <object class=\"GtkWindow\" id=\"window\"/>"
......
......@@ -5910,74 +5910,6 @@ create_range_controls (GtkWidget *widget)
gtk_widget_destroy (window);
}
/*
* GtkRulers
*/
void
create_rulers (GtkWidget *widget)
{
static GtkWidget *window = NULL;
GtkWidget *table;
GtkWidget *ruler;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (widget));
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
gtk_window_set_title (GTK_WINDOW (window), "rulers");
gtk_widget_set_size_request (window, 300, 300);
gtk_widget_set_events (window,
GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_MASK);
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
table = gtk_table_new (2, 2, FALSE);
gtk_container_add (GTK_CONTAINER (window), table);
gtk_widget_show (table);
ruler = gtk_ruler_new (GTK_ORIENTATION_HORIZONTAL);
gtk_ruler_set_metric (GTK_RULER (ruler), GTK_CENTIMETERS);
gtk_ruler_set_range (GTK_RULER (ruler), 100, 0, 0, 20);
g_signal_connect_swapped (window,
"motion_notify_event",
G_CALLBACK (GTK_WIDGET_GET_CLASS (ruler)->motion_notify_event),
ruler);
gtk_table_attach (GTK_TABLE (table), ruler, 1, 2, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (ruler);
ruler = gtk_ruler_new (GTK_ORIENTATION_VERTICAL);
gtk_ruler_set_range (GTK_RULER (ruler), 5, 15, 0, 20);
g_signal_connect_swapped (window,
"motion_notify_event",
G_CALLBACK (GTK_WIDGET_GET_CLASS (ruler)->motion_notify_event),
ruler);
gtk_table_attach (GTK_TABLE (table), ruler, 0, 1, 1, 2,
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (ruler);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
}
struct {
GdkColor color;
gchar *name;
......@@ -10016,7 +9948,6 @@ struct {
{ "resize grips", create_resize_grips },
{ "rotated label", create_rotated_label },
{ "rotated text", create_rotated_text },
{ "rulers", create_rulers },
{ "saved position", create_saved_position },
{ "scrolled windows", create_scrolled_windows },
{ "shapes", create_shapes },
......