[gtkhtml] Add gtk_html_unselect_all() for clearing selections.
- From: Matthew Barnes <mbarnes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtkhtml] Add gtk_html_unselect_all() for clearing selections.
- Date: Thu, 12 Nov 2009 21:09:04 +0000 (UTC)
commit 7c293bcb2a018b777b005a4a6da676f1bf9596e4
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Nov 12 16:07:18 2009 -0500
Add gtk_html_unselect_all() for clearing selections.
Also adds the corresponding command: "unselect-all"
gtkhtml/gtkhtml-enums.h | 4 +++-
gtkhtml/gtkhtml-properties.c | 1 +
gtkhtml/gtkhtml.c | 17 ++++++++++++++++-
gtkhtml/gtkhtml.h | 1 +
4 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/gtkhtml/gtkhtml-enums.h b/gtkhtml/gtkhtml-enums.h
index 5e09d85..92d4c0f 100644
--- a/gtkhtml/gtkhtml-enums.h
+++ b/gtkhtml/gtkhtml-enums.h
@@ -228,7 +228,9 @@ typedef enum {
GTK_HTML_COMMAND_IS_SELECTION_ACTIVE,
GTK_HTML_COMMAND_SCROLL_FORWARD,
- GTK_HTML_COMMAND_SCROLL_BACKWARD
+ GTK_HTML_COMMAND_SCROLL_BACKWARD,
+
+ GTK_HTML_COMMAND_UNSELECT_ALL
} GtkHTMLCommandType;
typedef enum {
diff --git a/gtkhtml/gtkhtml-properties.c b/gtkhtml/gtkhtml-properties.c
index 6f30f8b..e5dd39c 100644
--- a/gtkhtml/gtkhtml-properties.c
+++ b/gtkhtml/gtkhtml-properties.c
@@ -294,6 +294,7 @@ static GEnumValue _gtk_html_command_values[] = {
{ GTK_HTML_COMMAND_IS_SELECTION_ACTIVE, "GTK_HTML_COMMAND_IS_SELECTION_ACTIVE", "is-selection-active" },
{ GTK_HTML_COMMAND_SCROLL_FORWARD, "GTK_HTML_COMMAND_SCROLL_FORWARD", "scroll-forward" },
{ GTK_HTML_COMMAND_SCROLL_BACKWARD, "GTK_HTML_COMMAND_SCROLL_BACKWARD", "scroll-backward" },
+ { GTK_HTML_COMMAND_UNSELECT_ALL, "GTK_HTML_COMMAND_UNSELECT_ALL", "unselect-all" },
{ 0, NULL, NULL }
};
diff --git a/gtkhtml/gtkhtml.c b/gtkhtml/gtkhtml.c
index aad99da..87cb5ba 100644
--- a/gtkhtml/gtkhtml.c
+++ b/gtkhtml/gtkhtml.c
@@ -5165,10 +5165,12 @@ command (GtkHTML *html, GtkHTMLCommandType com_type)
case GTK_HTML_COMMAND_UNBLOCK_SELECTION:
html_engine_unblock_selection (html->engine);
break;
-
case GTK_HTML_COMMAND_IS_SELECTION_ACTIVE:
rv = html_engine_is_selection_active (html->engine);
break;
+ case GTK_HTML_COMMAND_UNSELECT_ALL:
+ gtk_html_unselect_all (html);
+ break;
default:
rv = FALSE;
@@ -5930,6 +5932,19 @@ gtk_html_select_all (GtkHTML *html)
}
void
+gtk_html_unselect_all (GtkHTML *html)
+{
+ HTMLEngine *e;
+
+ e = html->engine;
+
+ html_engine_unselect_all (e);
+
+ html_engine_update_selection_active_state (html->engine, html->priv->event_time);
+ update_primary_selection (html);
+}
+
+void
gtk_html_api_set_language (GtkHTML *html)
{
g_return_if_fail (GTK_IS_HTML (html));
diff --git a/gtkhtml/gtkhtml.h b/gtkhtml/gtkhtml.h
index 9f2c5d3..c400629 100644
--- a/gtkhtml/gtkhtml.h
+++ b/gtkhtml/gtkhtml.h
@@ -154,6 +154,7 @@ void gtk_html_select_line (GtkHTML
void gtk_html_select_paragraph (GtkHTML *html);
void gtk_html_select_paragraph_extended (GtkHTML *html);
void gtk_html_select_all (GtkHTML *html);
+void gtk_html_unselect_all (GtkHTML *html);
/* Loading. */
GtkHTMLStream *gtk_html_begin (GtkHTML *html);
GtkHTMLStream *gtk_html_begin_full (GtkHTML *html,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]