aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2010-03-04 23:37:48 +0800
committerXavier Claessens <xclaesse@gmail.com>2010-03-04 23:37:48 +0800
commit56872bd8f7c14cdb9a6cd303db3d21b008a6f07a (patch)
tree37062b06b4a0ff9f69d27cd6d11d1762f42d3324
parent3b09acab5942361ac9ab12dc0a3bbbd10ffa42d7 (diff)
parent7c9a7e0a126322fea64c7a4dfcd455400cafcbe8 (diff)
downloadgsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.gz
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.bz2
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.lz
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.xz
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.tar.zst
gsoc2013-empathy-56872bd8f7c14cdb9a6cd303db3d21b008a6f07a.zip
Merge branch 'clickable-link'
-rw-r--r--libempathy-gtk/Makefile.am2
-rw-r--r--libempathy-gtk/empathy-chat-text-view.c1
-rw-r--r--libempathy-gtk/empathy-chat.c8
-rw-r--r--libempathy-gtk/empathy-contact-widget.c11
-rw-r--r--libempathy-gtk/empathy-string-parser.c209
-rw-r--r--libempathy-gtk/empathy-string-parser.h92
-rw-r--r--libempathy-gtk/empathy-theme-adium.c47
-rw-r--r--libempathy-gtk/empathy-ui-utils.c140
-rw-r--r--libempathy-gtk/empathy-ui-utils.h61
9 files changed, 332 insertions, 239 deletions
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index c9736ac43..6ec319e1c 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -65,6 +65,7 @@ libempathy_gtk_handwritten_source = \
empathy-sound.c \
empathy-spell.c \
empathy-status-preset-dialog.c \
+ empathy-string-parser.c \
empathy-theme-boxes.c \
empathy-theme-irc.c \
empathy-theme-manager.c \
@@ -111,6 +112,7 @@ libempathy_gtk_headers = \
empathy-sound.h \
empathy-spell.h \
empathy-status-preset-dialog.h \
+ empathy-string-parser.h \
empathy-theme-boxes.h \
empathy-theme-irc.h \
empathy-theme-manager.h \
diff --git a/libempathy-gtk/empathy-chat-text-view.c b/libempathy-gtk/empathy-chat-text-view.c
index 07f8f6cb9..7f16ab9a3 100644
--- a/libempathy-gtk/empathy-chat-text-view.c
+++ b/libempathy-gtk/empathy-chat-text-view.c
@@ -42,6 +42,7 @@
#include "empathy-conf.h"
#include "empathy-ui-utils.h"
#include "empathy-smiley-manager.h"
+#include "empathy-string-parser.h"
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
#include <libempathy/empathy-debug.h>
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index bec1d7704..4db9e455c 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -56,6 +56,7 @@
#include "empathy-theme-manager.h"
#include "empathy-smiley-manager.h"
#include "empathy-ui-utils.h"
+#include "empathy-string-parser.h"
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
#include <libempathy/empathy-debug.h>
@@ -1212,7 +1213,12 @@ chat_property_changed_cb (EmpathyTpChat *tp_chat,
if (EMP_STR_EMPTY (priv->subject)) {
gtk_widget_hide (priv->hbox_topic);
} else {
- gtk_label_set_text (GTK_LABEL (priv->label_topic), priv->subject);
+ gchar *markup_text;
+
+ markup_text = empathy_add_link_markup (priv->subject);
+ gtk_label_set_markup (GTK_LABEL (priv->label_topic), markup_text);
+ g_free (markup_text);
+
gtk_widget_show (priv->hbox_topic);
}
if (priv->block_events_timeout_id == 0) {
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 9cb493fbe..75f244698 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -47,6 +47,7 @@
#include "empathy-avatar-chooser.h"
#include "empathy-avatar-image.h"
#include "empathy-ui-utils.h"
+#include "empathy-string-parser.h"
#include "empathy-kludge-label.h"
#define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
@@ -948,8 +949,14 @@ contact_widget_name_notify_cb (EmpathyContactWidget *information)
static void
contact_widget_presence_notify_cb (EmpathyContactWidget *information)
{
- gtk_label_set_text (GTK_LABEL (information->label_status),
- empathy_contact_get_status (information->contact));
+ const gchar *status;
+ gchar *markup_text;
+
+ status = empathy_contact_get_status (information->contact);
+ markup_text = empathy_add_link_markup (status);
+ gtk_label_set_markup (GTK_LABEL (information->label_status), markup_text);
+ g_free (markup_text);
+
gtk_image_set_from_icon_name (GTK_IMAGE (information->image_state),
empathy_icon_name_for_contact (information->contact),
GTK_ICON_SIZE_BUTTON);
diff --git a/libempathy-gtk/empathy-string-parser.c b/libempathy-gtk/empathy-string-parser.c
new file mode 100644
index 000000000..fa56a2d42
--- /dev/null
+++ b/libempathy-gtk/empathy-string-parser.c
@@ -0,0 +1,209 @@
+/*
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * 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.1 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Authors: Xavier Claessens <xclaesse@gmail.com>
+ */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "empathy-string-parser.h"
+#include "empathy-smiley-manager.h"
+#include "empathy-ui-utils.h"
+
+#define SCHEMES "([a-zA-Z\\+]+)"
+#define INVALID_CHARS "\\s\"'"
+#define INVALID_CHARS_EXT INVALID_CHARS "\\[\\]<>(){},;:?"
+#define BODY "([^"INVALID_CHARS"]+)"
+#define BODY_END "([^"INVALID_CHARS"]*)[^"INVALID_CHARS_EXT".]"
+#define BODY_STRICT "([^"INVALID_CHARS_EXT"]+)"
+#define URI_REGEX "("SCHEMES"://"BODY_END")" \
+ "|((www|ftp)\\."BODY_END")" \
+ "|((mailto:)?"BODY_STRICT"@"BODY"\\."BODY_END")"
+
+static GRegex *
+uri_regex_dup_singleton (void)
+{
+ static GRegex *uri_regex = NULL;
+
+ /* We intentionally leak the regex so it's not recomputed */
+ if (!uri_regex) {
+ uri_regex = g_regex_new (URI_REGEX, 0, 0, NULL);
+ }
+
+ return g_regex_ref (uri_regex);
+}
+
+void
+empathy_string_parser_substr (const gchar *text,
+ gssize len,
+ EmpathyStringParser *parsers,
+ gpointer user_data)
+{
+ if (parsers != NULL && parsers[0].match_func != NULL) {
+ parsers[0].match_func (text, len,
+ parsers[0].replace_func, parsers + 1,
+ user_data);
+ }
+}
+
+void
+empathy_string_match_link (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data)
+{
+ GRegex *uri_regex;
+ GMatchInfo *match_info;
+ gboolean match;
+ gint last = 0;
+
+ uri_regex = uri_regex_dup_singleton ();
+ match = g_regex_match_full (uri_regex, text, len, 0, 0, &match_info, NULL);
+ if (match) {
+ gint s = 0, e = 0;
+
+ do {
+ g_match_info_fetch_pos (match_info, 0, &s, &e);
+
+ if (s > last) {
+ /* Append the text between last link (or the
+ * start of the message) and this link */
+ empathy_string_parser_substr (text + last,
+ s - last,
+ sub_parsers,
+ user_data);
+ }
+
+ replace_func (text + s, e - s, NULL, user_data);
+
+ last = e;
+ } while (g_match_info_next (match_info, NULL));
+ }
+
+ empathy_string_parser_substr (text + last, len - last,
+ sub_parsers, user_data);
+
+ g_match_info_free (match_info);
+ g_regex_unref (uri_regex);
+}
+
+void
+empathy_string_match_smiley (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data)
+{
+ guint last = 0;
+ EmpathySmileyManager *smiley_manager;
+ GSList *hits, *l;
+
+ smiley_manager = empathy_smiley_manager_dup_singleton ();
+ hits = empathy_smiley_manager_parse_len (smiley_manager, text, len);
+
+ for (l = hits; l; l = l->next) {
+ EmpathySmileyHit *hit = l->data;
+
+ if (hit->start > last) {
+ /* Append the text between last smiley (or the
+ * start of the message) and this smiley */
+ empathy_string_parser_substr (text + last,
+ hit->start - last,
+ sub_parsers, user_data);
+ }
+
+ replace_func (text + hit->start, hit->end - hit->start,
+ hit, user_data);
+
+ last = hit->end;
+
+ empathy_smiley_hit_free (hit);
+ }
+ g_slist_free (hits);
+ g_object_unref (smiley_manager);
+
+ empathy_string_parser_substr (text + last, len - last,
+ sub_parsers, user_data);
+}
+
+void
+empathy_string_match_all (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data)
+{
+ replace_func (text, len, NULL, user_data);
+}
+
+void
+empathy_string_replace_link (const gchar *text,
+ gssize len,
+ gpointer match_data,
+ gpointer user_data)
+{
+ GString *string = user_data;
+ gchar *real_url;
+ gchar *escaped;
+
+ real_url = empathy_make_absolute_url_len (text, len);
+
+ /* The thing we are making a link of may contain
+ * characters which need escaping */
+ escaped = g_markup_escape_text (text, len);
+
+ /* Append the link inside <a href=""></a> tag */
+ g_string_append_printf (string, "<a href=\"%s\">%s</a>",
+ real_url, escaped);
+
+ g_free (real_url);
+ g_free (escaped);
+}
+
+void
+empathy_string_replace_escaped (const gchar *text,
+ gssize len,
+ gpointer match_data,
+ gpointer user_data)
+{
+ GString *string = user_data;
+ gchar *escaped;
+
+ escaped = g_markup_escape_text (text, len);
+ g_string_append (string, escaped);
+ g_free (escaped);
+}
+
+gchar *
+empathy_add_link_markup (const gchar *text)
+{
+ EmpathyStringParser parsers[] = {
+ {empathy_string_match_link, empathy_string_replace_link},
+ {empathy_string_match_all, empathy_string_replace_escaped},
+ {NULL, NULL}
+ };
+ GString *string;
+
+ string = g_string_sized_new (strlen (text));
+ empathy_string_parser_substr (text, -1, parsers, string);
+
+ return g_string_free (string, FALSE);
+}
+
diff --git a/libempathy-gtk/empathy-string-parser.h b/libempathy-gtk/empathy-string-parser.h
new file mode 100644
index 000000000..78a822652
--- /dev/null
+++ b/libempathy-gtk/empathy-string-parser.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * 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.1 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Authors: Xavier Claessens <xclaesse@gmail.com>
+ */
+
+#ifndef __EMPATHY_STRING_PARSER_H__
+#define __EMPATHY_STRING_PARSER_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef struct _EmpathyStringParser EmpathyStringParser;
+
+typedef void (*EmpathyStringReplace) (const gchar *text,
+ gssize len,
+ gpointer match_data,
+ gpointer user_data);
+typedef void (*EmpathyStringMatch) (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data);
+
+struct _EmpathyStringParser {
+ EmpathyStringMatch match_func;
+ EmpathyStringReplace replace_func;
+};
+
+void
+empathy_string_parser_substr (const gchar *text,
+ gssize len,
+ EmpathyStringParser *parsers,
+ gpointer user_data);
+
+void
+empathy_string_match_link (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data);
+
+void
+empathy_string_match_smiley (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data);
+
+void
+empathy_string_match_all (const gchar *text,
+ gssize len,
+ EmpathyStringReplace replace_func,
+ EmpathyStringParser *sub_parsers,
+ gpointer user_data);
+
+/* Replace functions assume user_data is a GString */
+void
+empathy_string_replace_link (const gchar *text,
+ gssize len,
+ gpointer match_data,
+ gpointer user_data);
+
+void
+empathy_string_replace_escaped (const gchar *text,
+ gssize len,
+ gpointer match_data,
+ gpointer user_data);
+
+/* Returns a new string with <a> html tag around links, and escape the rest.
+ * To be used with gtk_label_set_markup() for example */
+gchar *
+empathy_add_link_markup (const gchar *text);
+
+G_END_DECLS
+
+#endif /* __EMPATHY_STRING_PARSER_H__ */
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 5c67af857..7736be270 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -40,6 +40,7 @@
#include "empathy-conf.h"
#include "empathy-ui-utils.h"
#include "empathy-plist.h"
+#include "empathy-string-parser.h"
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
#include <libempathy/empathy-debug.h>
@@ -221,30 +222,6 @@ theme_adium_match_newline (const gchar *text,
}
static void
-theme_adium_replace_link (const gchar *text,
- gssize len,
- gpointer match_data,
- gpointer user_data)
-{
- GString *string = user_data;
- gchar *real_url;
- gchar *escaped;
-
- real_url = empathy_make_absolute_url_len (text, len);
-
- /* The thing we are making a link of may contain
- * characters which need escaping */
- escaped = g_markup_escape_text (text, len);
-
- /* Append the link inside <a href=""></a> tag */
- g_string_append_printf (string, "<a href=\"%s\">%s</a>",
- real_url, escaped);
-
- g_free (real_url);
- g_free (escaped);
-}
-
-static void
theme_adium_replace_smiley (const gchar *text,
gssize len,
gpointer match_data,
@@ -259,32 +236,18 @@ theme_adium_replace_smiley (const gchar *text,
hit->path, (int)len, text, (int)len, text);
}
-static void
-theme_adium_replace_escaped (const gchar *text,
- gssize len,
- gpointer match_data,
- gpointer user_data)
-{
- GString *string = user_data;
- gchar *escaped;
-
- escaped = g_markup_escape_text (text, len);
- g_string_append (string, escaped);
- g_free (escaped);
-}
-
static EmpathyStringParser string_parsers[] = {
- {empathy_string_match_link, theme_adium_replace_link},
+ {empathy_string_match_link, empathy_string_replace_link},
{theme_adium_match_newline, NULL},
- {empathy_string_match_all, theme_adium_replace_escaped},
+ {empathy_string_match_all, empathy_string_replace_escaped},
{NULL, NULL}
};
static EmpathyStringParser string_parsers_with_smiley[] = {
- {empathy_string_match_link, theme_adium_replace_link},
+ {empathy_string_match_link, empathy_string_replace_link},
{empathy_string_match_smiley, theme_adium_replace_smiley},
{theme_adium_match_newline, NULL},
- {empathy_string_match_all, theme_adium_replace_escaped},
+ {empathy_string_match_all, empathy_string_replace_escaped},
{NULL, NULL}
};
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index dcba5fe23..d6e9ffeef 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -50,16 +50,6 @@
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-ft-factory.h>
-#define SCHEMES "([a-zA-Z\\+]+)"
-#define INVALID_CHARS "\\s\"'"
-#define INVALID_CHARS_EXT INVALID_CHARS "\\[\\]<>(){},;:?"
-#define BODY "([^"INVALID_CHARS"]+)"
-#define BODY_END "([^"INVALID_CHARS"]*)[^"INVALID_CHARS_EXT".]"
-#define BODY_STRICT "([^"INVALID_CHARS_EXT"]+)"
-#define URI_REGEX "("SCHEMES"://"BODY_END")" \
- "|((www|ftp)\\."BODY_END")" \
- "|((mailto:)?"BODY_STRICT"@"BODY"\\."BODY_END")"
-
void
empathy_gtk_init (void)
{
@@ -75,19 +65,6 @@ empathy_gtk_init (void)
initialized = TRUE;
}
-GRegex *
-empathy_uri_regex_dup_singleton (void)
-{
- static GRegex *uri_regex = NULL;
-
- /* We intentionally leak the regex so it's not recomputed */
- if (!uri_regex) {
- uri_regex = g_regex_new (URI_REGEX, 0, 0, NULL);
- }
-
- return g_regex_ref (uri_regex);
-}
-
static GtkBuilder *
builder_get_file_valist (const gchar *filename,
const gchar *first_object,
@@ -1555,19 +1532,6 @@ empathy_link_button_new (const gchar *url,
}
void
-empathy_toggle_button_set_state_quietly (GtkWidget *widget,
- GCallback callback,
- gpointer user_data,
- gboolean active)
-{
- g_return_if_fail (GTK_IS_TOGGLE_BUTTON (widget));
-
- g_signal_handlers_block_by_func (widget, callback, user_data);
- g_object_set (widget, "active", active, NULL);
- g_signal_handlers_unblock_by_func (widget, callback, user_data);
-}
-
-void
empathy_send_file (EmpathyContact *contact, GFile *file)
{
EmpathyFTFactory *factory;
@@ -1726,107 +1690,3 @@ empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler)
gtk_widget_show (widget);
}
-void
-empathy_string_parser_substr (const gchar *text,
- gssize len,
- EmpathyStringParser *parsers,
- gpointer user_data)
-{
- if (parsers != NULL && parsers[0].match_func != NULL) {
- parsers[0].match_func (text, len,
- parsers[0].replace_func, parsers + 1,
- user_data);
- }
-}
-
-void
-empathy_string_match_link (const gchar *text,
- gssize len,
- EmpathyStringReplace replace_func,
- EmpathyStringParser *sub_parsers,
- gpointer user_data)
-{
- GRegex *uri_regex;
- GMatchInfo *match_info;
- gboolean match;
- gint last = 0;
-
- uri_regex = empathy_uri_regex_dup_singleton ();
- match = g_regex_match_full (uri_regex, text, len, 0, 0, &match_info, NULL);
- if (match) {
- gint s = 0, e = 0;
-
- do {
- g_match_info_fetch_pos (match_info, 0, &s, &e);
-
- if (s > last) {
- /* Append the text between last link (or the
- * start of the message) and this link */
- empathy_string_parser_substr (text + last,
- s - last,
- sub_parsers,
- user_data);
- }
-
- replace_func (text + s, e - s, NULL, user_data);
-
- last = e;
- } while (g_match_info_next (match_info, NULL));
- }
-
- empathy_string_parser_substr (text + last, len - last,
- sub_parsers, user_data);
-
- g_match_info_free (match_info);
- g_regex_unref (uri_regex);
-}
-
-void
-empathy_string_match_smiley (const gchar *text,
- gssize len,
- EmpathyStringReplace replace_func,
- EmpathyStringParser *sub_parsers,
- gpointer user_data)
-{
- guint last = 0;
- EmpathySmileyManager *smiley_manager;
- GSList *hits, *l;
-
- smiley_manager = empathy_smiley_manager_dup_singleton ();
- hits = empathy_smiley_manager_parse_len (smiley_manager, text, len);
-
- for (l = hits; l; l = l->next) {
- EmpathySmileyHit *hit = l->data;
-
- if (hit->start > last) {
- /* Append the text between last smiley (or the
- * start of the message) and this smiley */
- empathy_string_parser_substr (text + last,
- hit->start - last,
- sub_parsers, user_data);
- }
-
- replace_func (text + hit->start, hit->end - hit->start,
- hit, user_data);
-
- last = hit->end;
-
- empathy_smiley_hit_free (hit);
- }
- g_slist_free (hits);
- g_object_unref (smiley_manager);
-
- empathy_string_parser_substr (text + last, len - last,
- sub_parsers, user_data);
-}
-
-void
-empathy_string_match_all (const gchar *text,
- gssize len,
- EmpathyStringReplace replace_func,
- EmpathyStringParser *sub_parsers,
- gpointer user_data)
-{
- replace_func (text, len, NULL, user_data);
-}
-
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h
index 925ecc5cb..38732c7f9 100644
--- a/libempathy-gtk/empathy-ui-utils.h
+++ b/libempathy-gtk/empathy-ui-utils.h
@@ -47,7 +47,6 @@ G_BEGIN_DECLS
(y) < gdk_screen_height ())
void empathy_gtk_init (void);
-GRegex * empathy_uri_regex_dup_singleton (void);
/* Glade */
GtkBuilder * empathy_builder_get_file (const gchar *filename,
@@ -110,15 +109,18 @@ void empathy_window_present (GtkWindow *windo
void empathy_window_iconify (GtkWindow *window,
GtkStatusIcon *status_icon);
GtkWindow * empathy_get_toplevel_window (GtkWidget *widget);
+
+/* URL */
+gchar * empathy_make_absolute_url (const gchar *url);
+
+gchar * empathy_make_absolute_url_len (const gchar *url,
+ guint len);
void empathy_url_show (GtkWidget *parent,
const char *url);
-void empathy_toggle_button_set_state_quietly (GtkWidget *widget,
- GCallback callback,
- gpointer user_data,
- gboolean active);
GtkWidget * empathy_link_button_new (const gchar *url,
const gchar *title);
+/* File transfer */
void empathy_send_file (EmpathyContact *contact,
GFile *file);
void empathy_send_file_from_uri_list (EmpathyContact *contact,
@@ -126,55 +128,6 @@ void empathy_send_file_from_uri_list (EmpathyContact *conta
void empathy_send_file_with_file_chooser (EmpathyContact *contact);
void empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler);
-gchar * empathy_make_absolute_url (const gchar *url);
-gchar * empathy_make_absolute_url_len (const gchar *url,
- guint len);
-
-/* String parser */
-typedef struct _EmpathyStringParser EmpathyStringParser;
-
-typedef void (*EmpathyStringReplace) (const gchar *text,
- gssize len,
- gpointer match_data,
- gpointer user_data);
-typedef void (*EmpathyStringMatch) (const gchar *text,
- gssize len,
- EmpathyStringReplace replace_func,
- EmpathyStringParser *sub_parsers,
- gpointer user_data);
-
-struct _EmpathyStringParser {
- EmpathyStringMatch match_func;
- EmpathyStringReplace replace_func;
-};
-
-void
-empathy_string_parser_substr (const gchar *text,
- gssize len,
- EmpathyStringParser *parsers,
- gpointer user_data);
-
-void
-empathy_string_match_link (const gchar *text,
- gssize len,
- EmpathyStringReplace replace_func,
- EmpathyStringParser *sub_parsers,
- gpointer user_data);
-
-void
-empathy_string_match_smiley (const gchar *text,
- gssize len,
- EmpathyStringReplace replace_func,
- EmpathyStringParser *sub_parsers,
- gpointer user_data);
-
-void
-empathy_string_match_all (const gchar *text,
- gssize len,
- EmpathyStringReplace replace_func,
- EmpathyStringParser *sub_parsers,
- gpointer user_data);
-
G_END_DECLS
#endif /* __EMPATHY_UI_UTILS_H__ */