Commit 85735ec7 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

Set up infrastructure to deal with lots of scrolling child windows, and

2000-09-28  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c: Set up infrastructure to deal with lots of
	scrolling child windows, and draw focus rectangle properly.

	(gtk_text_view_buffer_to_window_coords):
	Coordinate transformation to deal with all these freaking windows
	and offsets
	(gtk_text_view_window_to_buffer_coords): transform the other way

	* gtk/testtext.c (create_buffer): Update to match Pango API change

	* gtk/gtktexttagtable.c (gtk_text_tag_table_foreach): Go over the
	anonymous tags
	(foreach_unref): don't emit remove signal from finalize, just
	set tag's parent to NULL
parent 3e6e7b94
2000-09-28 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Set up infrastructure to deal with lots of
scrolling child windows, and draw focus rectangle properly.
(gtk_text_view_buffer_to_window_coords):
Coordinate transformation to deal with all these freaking windows
and offsets
(gtk_text_view_window_to_buffer_coords): transform the other way
* gtk/testtext.c (create_buffer): Update to match Pango API change
* gtk/gtktexttagtable.c (gtk_text_tag_table_foreach): Go over the
anonymous tags
(foreach_unref): don't emit remove signal from finalize, just
set tag's parent to NULL
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_clear): remove
......@@ -68,10 +85,8 @@
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Draw the focus, and leave space to do so.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttypes.c: Remove Latin1 conversion stuff
......
2000-09-28 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Set up infrastructure to deal with lots of
scrolling child windows, and draw focus rectangle properly.
(gtk_text_view_buffer_to_window_coords):
Coordinate transformation to deal with all these freaking windows
and offsets
(gtk_text_view_window_to_buffer_coords): transform the other way
* gtk/testtext.c (create_buffer): Update to match Pango API change
* gtk/gtktexttagtable.c (gtk_text_tag_table_foreach): Go over the
anonymous tags
(foreach_unref): don't emit remove signal from finalize, just
set tag's parent to NULL
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_clear): remove
......@@ -68,10 +85,8 @@
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Draw the focus, and leave space to do so.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttypes.c: Remove Latin1 conversion stuff
......
2000-09-28 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Set up infrastructure to deal with lots of
scrolling child windows, and draw focus rectangle properly.
(gtk_text_view_buffer_to_window_coords):
Coordinate transformation to deal with all these freaking windows
and offsets
(gtk_text_view_window_to_buffer_coords): transform the other way
* gtk/testtext.c (create_buffer): Update to match Pango API change
* gtk/gtktexttagtable.c (gtk_text_tag_table_foreach): Go over the
anonymous tags
(foreach_unref): don't emit remove signal from finalize, just
set tag's parent to NULL
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_clear): remove
......@@ -68,10 +85,8 @@
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Draw the focus, and leave space to do so.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttypes.c: Remove Latin1 conversion stuff
......
2000-09-28 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Set up infrastructure to deal with lots of
scrolling child windows, and draw focus rectangle properly.
(gtk_text_view_buffer_to_window_coords):
Coordinate transformation to deal with all these freaking windows
and offsets
(gtk_text_view_window_to_buffer_coords): transform the other way
* gtk/testtext.c (create_buffer): Update to match Pango API change
* gtk/gtktexttagtable.c (gtk_text_tag_table_foreach): Go over the
anonymous tags
(foreach_unref): don't emit remove signal from finalize, just
set tag's parent to NULL
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_clear): remove
......@@ -68,10 +85,8 @@
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Draw the focus, and leave space to do so.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttypes.c: Remove Latin1 conversion stuff
......
2000-09-28 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Set up infrastructure to deal with lots of
scrolling child windows, and draw focus rectangle properly.
(gtk_text_view_buffer_to_window_coords):
Coordinate transformation to deal with all these freaking windows
and offsets
(gtk_text_view_window_to_buffer_coords): transform the other way
* gtk/testtext.c (create_buffer): Update to match Pango API change
* gtk/gtktexttagtable.c (gtk_text_tag_table_foreach): Go over the
anonymous tags
(foreach_unref): don't emit remove signal from finalize, just
set tag's parent to NULL
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_clear): remove
......@@ -68,10 +85,8 @@
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Draw the focus, and leave space to do so.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttypes.c: Remove Latin1 conversion stuff
......
2000-09-28 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Set up infrastructure to deal with lots of
scrolling child windows, and draw focus rectangle properly.
(gtk_text_view_buffer_to_window_coords):
Coordinate transformation to deal with all these freaking windows
and offsets
(gtk_text_view_window_to_buffer_coords): transform the other way
* gtk/testtext.c (create_buffer): Update to match Pango API change
* gtk/gtktexttagtable.c (gtk_text_tag_table_foreach): Go over the
anonymous tags
(foreach_unref): don't emit remove signal from finalize, just
set tag's parent to NULL
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_clear): remove
......@@ -68,10 +85,8 @@
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Draw the focus, and leave space to do so.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttypes.c: Remove Latin1 conversion stuff
......
2000-09-28 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Set up infrastructure to deal with lots of
scrolling child windows, and draw focus rectangle properly.
(gtk_text_view_buffer_to_window_coords):
Coordinate transformation to deal with all these freaking windows
and offsets
(gtk_text_view_window_to_buffer_coords): transform the other way
* gtk/testtext.c (create_buffer): Update to match Pango API change
* gtk/gtktexttagtable.c (gtk_text_tag_table_foreach): Go over the
anonymous tags
(foreach_unref): don't emit remove signal from finalize, just
set tag's parent to NULL
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_clear): remove
......@@ -68,10 +85,8 @@
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c: Draw the focus, and leave space to do so.
2000-09-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttypes.c: Remove Latin1 conversion stuff
......
......@@ -128,6 +128,11 @@ gtk_text_tag_table_destroy (GtkObject *object)
static void
foreach_unref (GtkTextTag *tag, gpointer data)
{
/* We don't want to emit the remove signal here; so we just unparent
* and unref the tag.
*/
tag->table = NULL;
g_object_unref (G_OBJECT (tag));
}
......@@ -140,7 +145,7 @@ gtk_text_tag_table_finalize (GObject *object)
gtk_text_tag_table_foreach (table, foreach_unref, NULL);
g_hash_table_destroy(table->hash);
g_hash_table_destroy (table->hash);
g_slist_free (table->anonymous);
(* G_OBJECT_CLASS(parent_class)->finalize) (object);
......@@ -259,9 +264,21 @@ hash_foreach (gpointer key, gpointer value, gpointer data)
{
struct ForeachData *fd = data;
g_return_if_fail (GTK_IS_TEXT_TAG (value));
(* fd->func) (value, fd->data);
}
static void
list_foreach (gpointer data, gpointer user_data)
{
struct ForeachData *fd = user_data;
g_return_if_fail (GTK_IS_TEXT_TAG (data));
(* fd->func) (data, fd->data);
}
void
gtk_text_tag_table_foreach(GtkTextTagTable *table,
GtkTextTagTableForeach func,
......@@ -276,6 +293,7 @@ gtk_text_tag_table_foreach(GtkTextTagTable *table,
d.data = data;
g_hash_table_foreach(table->hash, hash_foreach, &d);
g_slist_foreach (table->anonymous, list_foreach, &d);
}
guint
......
This diff is collapsed.
......@@ -16,9 +16,22 @@ extern "C" {
#define GTK_IS_TEXT_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_VIEW))
#define GTK_TEXT_VIEW_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TEXT_VIEW, GtkTextViewClass))
typedef enum
{
GTK_TEXT_WINDOW_WIDGET,
GTK_TEXT_WINDOW_TEXT,
GTK_TEXT_WINDOW_LEFT,
GTK_TEXT_WINDOW_RIGHT,
GTK_TEXT_WINDOW_TOP,
GTK_TEXT_WINDOW_BOTTOM
} GtkTextWindowType;
typedef struct _GtkTextView GtkTextView;
typedef struct _GtkTextViewClass GtkTextViewClass;
/* Internal private type. */
typedef struct _GtkTextWindow GtkTextWindow;
struct _GtkTextView {
GtkContainer parent_instance;
......@@ -37,7 +50,12 @@ struct _GtkTextView {
gboolean cursor_visible;
GdkWindow *bin_window;
GtkTextWindow *text_window;
GtkTextWindow *left_window;
GtkTextWindow *right_window;
GtkTextWindow *top_window;
GtkTextWindow *bottom_window;
GtkAdjustment *hadjustment;
GtkAdjustment *vadjustment;
......@@ -99,10 +117,6 @@ GtkWidget * gtk_text_view_new_with_buffer (GtkTextBuffer *buffer);
void gtk_text_view_set_buffer (GtkTextView *text_view,
GtkTextBuffer *buffer);
GtkTextBuffer *gtk_text_view_get_buffer (GtkTextView *text_view);
void gtk_text_view_get_iter_at_pixel (GtkTextView *text_view,
GtkTextIter *iter,
gint x,
gint y);
gboolean gtk_text_view_scroll_to_mark (GtkTextView *text_view,
GtkTextMark *mark,
gint mark_within_margin);
......@@ -127,6 +141,42 @@ gboolean gtk_text_view_get_cursor_visible (GtkTextView *text_view);
void gtk_text_view_get_iter_location (GtkTextView *text_view,
const GtkTextIter *iter,
GdkRectangle *location);
void gtk_text_view_get_iter_at_location (GtkTextView *text_view,
GtkTextIter *iter,
gint x,
gint y);
void gtk_text_view_buffer_to_window_coords (GtkTextView *text_view,
GtkTextWindowType win,
gint buffer_x,
gint buffer_y,
gint *window_x,
gint *window_y);
void gtk_text_view_window_to_buffer_coords (GtkTextView *text_view,
GtkTextWindowType win,
gint window_x,
gint window_y,
gint *buffer_x,
gint *buffer_y);
GdkWindow* gtk_text_view_get_window (GtkTextView *text_view,
GtkTextWindowType win);
GtkTextWindowType gtk_text_view_get_window_type (GtkTextView *text_view,
GdkWindow *window);
void gtk_text_view_set_left_window_width (GtkTextView *text_view,
gint width);
void gtk_text_view_set_right_window_width (GtkTextView *text_view,
gint width);
void gtk_text_view_set_top_window_height (GtkTextView *text_view,
gint height);
void gtk_text_view_set_bottom_window_height (GtkTextView *text_view,
gint height);
void gtk_text_view_set_text_window_size (GtkTextView *text_view,
gint width,
gint height);
#ifdef __cplusplus
}
......
......@@ -1239,12 +1239,12 @@ create_buffer (void)
gtk_object_set (GTK_OBJECT (buffer->found_text_tag),
"foreground", "red", NULL);
tabs = pango_tab_array_new_with_defaults (4,
TRUE,
PANGO_TAB_LEFT, 10,
PANGO_TAB_LEFT, 30,
PANGO_TAB_LEFT, 60,
PANGO_TAB_LEFT, 120);
tabs = pango_tab_array_new_with_positions (4,
TRUE,
PANGO_TAB_LEFT, 10,
PANGO_TAB_LEFT, 30,
PANGO_TAB_LEFT, 60,
PANGO_TAB_LEFT, 120);
buffer->custom_tabs_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL);
gtk_object_set (GTK_OBJECT (buffer->custom_tabs_tag),
......
......@@ -1239,12 +1239,12 @@ create_buffer (void)
gtk_object_set (GTK_OBJECT (buffer->found_text_tag),
"foreground", "red", NULL);
tabs = pango_tab_array_new_with_defaults (4,
TRUE,
PANGO_TAB_LEFT, 10,
PANGO_TAB_LEFT, 30,
PANGO_TAB_LEFT, 60,
PANGO_TAB_LEFT, 120);
tabs = pango_tab_array_new_with_positions (4,
TRUE,
PANGO_TAB_LEFT, 10,
PANGO_TAB_LEFT, 30,
PANGO_TAB_LEFT, 60,
PANGO_TAB_LEFT, 120);
buffer->custom_tabs_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL);
gtk_object_set (GTK_OBJECT (buffer->custom_tabs_tag),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment