#include "gtkscrollable.h"
#include "gtktypebuiltins.h"
+#include "a11y/gtktextviewaccessible.h"
/**
* SECTION:gtktextview
GdkDevice *dnd_device;
gulong selection_drag_handler;
- guint scroll_timeout;
GtkTextWindow *text_window;
GtkTextWindow *left_window;
GtkTextMark *first_para_mark; /* Mark at the beginning of the first onscreen paragraph */
gint first_para_pixels; /* Offset of top of screen in the first onscreen paragraph */
- GtkTextMark *dnd_mark;
guint blink_timeout;
+ guint scroll_timeout;
guint first_validate_idle; /* Idle to revalidate onscreen portion, runs before resize */
guint incremental_validate_idle; /* Idle to revalidate offscreen portions, runs after redraw */
+ gint pending_place_cursor_button;
+
+ GtkTextMark *dnd_mark;
+
GtkIMContext *im_context;
GtkWidget *popup_menu;
GtkTextPendingScroll *pending_scroll;
- gint pending_place_cursor_button;
-
/* Default style settings */
gint pixels_above_lines;
gint pixels_below_lines;
guint overwrite_mode : 1;
guint cursor_visible : 1;
- /* if we have reset the IM since the last character entered */
+ /* if we have reset the IM since the last character entered */
guint need_im_reset : 1;
guint accepts_tab : 1;
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
g_type_class_add_private (gobject_class, sizeof (GtkTextViewPrivate));
+
+ gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_TEXT_VIEW_ACCESSIBLE);
}
static void
text_window_realize (priv->bottom_window, widget);
gtk_text_view_ensure_layout (text_view);
+ gtk_text_view_invalidate (text_view);
if (priv->buffer)
{
if (priv->bottom_window)
text_window_unrealize (priv->bottom_window);
- gtk_text_view_destroy_layout (text_view);
-
GTK_WIDGET_CLASS (gtk_text_view_parent_class)->unrealize (widget);
}
tmp_list = g_slist_next (tmp_list);
}
-
- gtk_text_view_invalidate (text_view);
}
}
* into widget->allocation if the widget is not realized.
* FIXME someone figure out why this was.
*/
+ gtk_widget_get_allocation (widget, &allocation);
+
if (!gtk_widget_get_realized (widget))
{
if (gtk_widget_get_visible (widget))
adjust_allocation_recurse (widget, &scroll_data);
}
-
+
static void
gtk_text_view_value_changed (GtkAdjustment *adjustment,
GtkTextView *text_view)
gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), menuitem);
menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_SELECT_ALL, NULL);
+ gtk_widget_set_sensitive (menuitem,
+ gtk_text_buffer_get_char_count (priv->buffer) > 0);
g_signal_connect (menuitem, "activate",
G_CALLBACK (select_all_cb), text_view);
gtk_widget_show (menuitem);