diff options
author | Ankit Vani <a@nevitus.org> | 2014-02-10 01:40:39 +0530 |
---|---|---|
committer | Ankit Vani <a@nevitus.org> | 2014-02-10 01:40:39 +0530 |
commit | 042affac48c6ac440c10059e8e44099b69e6fa79 (patch) | |
tree | 7b2e4a39794f0fba90bf8985038ad63aa9e1c242 | |
parent | fb3b6d70be9f1d0e0f623fc8249bde9749918ef6 (diff) | |
download | pidgin-042affac48c6ac440c10059e8e44099b69e6fa79.tar.gz |
Fixed namespace issues in Pidgin.
Renamed:
'pidgin_blist_sort_method' to '_PidginBlistSortMethod'
'DndHintPosition' to 'PidginDndHintPosition'
'dnd_hints_hide_all' to 'pidgin_dnd_hints_hide_all'
'dnd_hints_hide' to 'pidgin_dnd_hints_hide'
'dnd_hints_show_relative' to 'pidgin_dnd_hints_show_relative'
'dnd_hints_show' to 'pidgin_dnd_hints_show'
'DndHintWindowId' to 'PidginDndHintWindowId'
'NUM_NICK_SEED_COLORS' to 'PIDGIN_NUM_NICK_SEED_COLORS'
'smiley_list' to 'PidginSmileyList'
'smiley_theme' to 'PidginSmileyTheme'
'GtkWebView*' to 'PidginWebView*'
'gtk_webview_*' to 'pidgin_webview_*'
'DEFAULT_FONT_FACE' to 'PIDGIN_DEFAULT_FONT_FACE'
'BRUSH_STATE_DOWN' to 'PIDGIN_BRUSH_STATE_DOWN'
'BRUSH_STATE_MOTION' to 'PIDGIN_BRUSH_STATE_MOTION'
'BRUSH_STATE_UP' to 'PIDGIN_BRUSH_STATE_UP'
'FULL_CIRCLE_DEGREES' to 'PIDGIN_FULL_CIRCLE_DEGREES'
'PALETTE_NUM_COLORS' to 'PIDGIN_PALETTE_NUM_COLORS'
'smiley_parse_markup' to 'pidgin_smiley_parse_markup'
33 files changed, 1205 insertions, 1191 deletions
diff --git a/ChangeLog.API b/ChangeLog.API index 3314a169da..acc0b2b4d9 100644 --- a/ChangeLog.API +++ b/ChangeLog.API @@ -441,8 +441,22 @@ version 3.0.0 (??/??/????): Changed: * gtkft.h file renamed to gtkxfer.h + * pidgin_blist_sort_method renamed to _PidginBlistSortMethod + * BRUSH_STATE_DOWN renamed to PIDGIN_BRUSH_STATE_DOWN + * BRUSH_STATE_MOTION renamed to PIDGIN_BRUSH_STATE_MOTION + * BRUSH_STATE_UP renamed to PIDGIN_BRUSH_STATE_UP + * DEFAULT_FONT_FACE renamed to PIDGIN_DEFAULT_FONT_FACE + * DndHintPosition renamed to PidginDndHintPosition + * DndHintWindowId renamed to PidginDndHintWindowId + * dnd_* functions renamed to pidgin_dnd_* + * FULL_CIRCLE_DEGREES renamed to PIDGIN_FULL_CIRCLE_DEGREES + * NUM_NICK_SEED_COLORS renamed to PIDGIN_NUM_NICK_SEED_COLORS + * PALETTE_NUM_COLORS renamed to PIDGIN_PALETTE_NUM_COLORS * pidgin_setup_screenname_autocomplete now takes a filter function and its data as final two arguments + * smiley_list renamed to PidginSmileyList + * smiley_parse_markup renamed to pidgin_smiley_parse_markup + * smiley_theme renamed to PidginSmileyTheme Removed: * GtkIMHtml.clipboard_html_string diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index 88ede7740c..28026413f0 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -141,7 +141,7 @@ static gboolean gtk_blist_focused = FALSE; static gboolean editing_blist = FALSE; static GList *pidgin_blist_sort_methods = NULL; -static struct pidgin_blist_sort_method *current_sort_method = NULL; +static struct _PidginBlistSortMethod *current_sort_method = NULL; static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); static void sort_method_alphabetical(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); @@ -7785,13 +7785,13 @@ GList *pidgin_blist_get_sort_methods() void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func) { - struct pidgin_blist_sort_method *method; + struct _PidginBlistSortMethod *method; g_return_if_fail(id != NULL); g_return_if_fail(name != NULL); g_return_if_fail(func != NULL); - method = g_new0(struct pidgin_blist_sort_method, 1); + method = g_new0(struct _PidginBlistSortMethod, 1); method->id = g_strdup(id); method->name = g_strdup(name); method->func = func; @@ -7806,7 +7806,7 @@ void pidgin_blist_sort_method_unreg(const char *id) g_return_if_fail(id != NULL); while(l) { - struct pidgin_blist_sort_method *method = l->data; + struct _PidginBlistSortMethod *method = l->data; if(!strcmp(method->id, id)) { pidgin_blist_sort_methods = g_list_delete_link(pidgin_blist_sort_methods, l); g_free(method->id); @@ -7825,7 +7825,7 @@ void pidgin_blist_sort_method_set(const char *id){ if(!id) id = "none"; - while (l && strcmp(((struct pidgin_blist_sort_method*)l->data)->id, id)) + while (l && strcmp(((struct _PidginBlistSortMethod*)l->data)->id, id)) l = l->next; if (l) { diff --git a/pidgin/gtkblist.h b/pidgin/gtkblist.h index 899ffe55c6..fea1ebe373 100644 --- a/pidgin/gtkblist.h +++ b/pidgin/gtkblist.h @@ -327,13 +327,13 @@ typedef void (*pidgin_blist_sort_function)(PurpleBlistNode *new, PurpleBuddyList */ GList *pidgin_blist_get_sort_methods(void); -struct pidgin_blist_sort_method { +struct _PidginBlistSortMethod { char *id; char *name; pidgin_blist_sort_function func; }; -typedef struct pidgin_blist_sort_method PidginBlistSortMethod; +typedef struct _PidginBlistSortMethod PidginBlistSortMethod; /** * pidgin_blist_sort_method_reg: diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c index 8b359a50e7..c295adec03 100644 --- a/pidgin/gtkconv.c +++ b/pidgin/gtkconv.c @@ -309,28 +309,28 @@ static void default_formatize(PidginConversation *c) { PurpleConversation *conv = c->active_conv; - gtk_webview_setup_entry(GTK_WEBVIEW(c->entry), purple_conversation_get_features(conv)); + pidgin_webview_setup_entry(PIDGIN_WEBVIEW(c->entry), purple_conversation_get_features(conv)); } static void conversation_entry_clear(PidginConversation *gtkconv) { - GtkWebView *webview = GTK_WEBVIEW(gtkconv->entry); + PidginWebView *webview = PIDGIN_WEBVIEW(gtkconv->entry); //XXX: hotfix for not focused entry after sending a message - //gtk_webview_load_html_string(webview, ""); - gtk_webview_load_html_string_with_selection(webview, "<div id='caret'></div>"); + //pidgin_webview_load_html_string(webview, ""); + pidgin_webview_load_html_string_with_selection(webview, "<div id='caret'></div>"); #if 0 /* TODO WebKit */ gtk_source_undo_manager_begin_not_undoable_action(webview->undo_manager); - gtk_webview_clear(webview); + pidgin_webview_clear(webview); gtk_source_undo_manager_end_not_undoable_action(webview->undo_manager); #endif } static void -clear_formatting_cb(GtkWebView *webview, PidginConversation *gtkconv) +clear_formatting_cb(PidginWebView *webview, PidginConversation *gtkconv) { default_formatize(gtkconv); } @@ -519,13 +519,13 @@ check_for_and_do_command(PurpleConversation *conv) gtkconv = PIDGIN_CONVERSATION(conv); prefix = pidgin_get_cmd_prefix(); - cmd = gtk_webview_get_body_text(GTK_WEBVIEW(gtkconv->entry)); + cmd = pidgin_webview_get_body_text(PIDGIN_WEBVIEW(gtkconv->entry)); if (cmd && purple_str_has_prefix(cmd, prefix)) { PurpleCmdStatus status; char *error, *cmdline, *markup, *send_history; - send_history = gtk_webview_get_body_html(GTK_WEBVIEW(gtkconv->entry)); + send_history = pidgin_webview_get_body_html(PIDGIN_WEBVIEW(gtkconv->entry)); send_history_add(gtkconv, send_history); g_free(send_history); @@ -539,7 +539,7 @@ check_for_and_do_command(PurpleConversation *conv) } /* TODO WebKit: Cut out prefix for markup... */ - markup = gtk_webview_get_body_html(GTK_WEBVIEW(gtkconv->entry)); + markup = pidgin_webview_get_body_html(PIDGIN_WEBVIEW(gtkconv->entry)); status = purple_cmd_do_command(conv, cmdline, markup, &error); g_free(markup); @@ -628,8 +628,8 @@ send_cb(GtkWidget *widget, PidginConversation *gtkconv) if (!purple_account_is_connected(account)) return; - buf = gtk_webview_get_body_html(GTK_WEBVIEW(gtkconv->entry)); - clean = gtk_webview_get_body_text(GTK_WEBVIEW(gtkconv->entry)); + buf = pidgin_webview_get_body_html(PIDGIN_WEBVIEW(gtkconv->entry)); + clean = pidgin_webview_get_body_text(PIDGIN_WEBVIEW(gtkconv->entry)); gtk_widget_grab_focus(gtkconv->entry); @@ -644,7 +644,7 @@ send_cb(GtkWidget *widget, PidginConversation *gtkconv) #if 0 /* TODO WebKit: Image stuff... */ /* XXX: is there a better way to tell if the message has images? */ - if (GTK_WEBVIEW(gtkconv->entry)->im_images != NULL) + if (PIDGIN_WEBVIEW(gtkconv->entry)->im_images != NULL) flags |= PURPLE_MESSAGE_IMAGES; #endif @@ -655,7 +655,7 @@ send_cb(GtkWidget *widget, PidginConversation *gtkconv) char **bufs; int i; - bufs = gtk_webview_get_markup_lines(GTK_WEBVIEW(gtkconv->entry)); + bufs = pidgin_webview_get_markup_lines(PIDGIN_WEBVIEW(gtkconv->entry)); for (i = 0; bufs[i]; i++) { send_history_add(gtkconv, bufs[i]); purple_conversation_send_with_flags(conv, bufs[i], flags); @@ -1046,7 +1046,7 @@ static void savelog_writefile_cb(void *user_data, const char *filename) { PurpleConversation *conv = (PurpleConversation *)user_data; - GtkWebView *webview; + PidginWebView *webview; FILE *fp; const char *name; gchar *text; @@ -1058,21 +1058,21 @@ savelog_writefile_cb(void *user_data, const char *filename) return; } - webview = GTK_WEBVIEW(PIDGIN_CONVERSATION(conv)->webview); + webview = PIDGIN_WEBVIEW(PIDGIN_CONVERSATION(conv)->webview); name = purple_conversation_get_name(conv); fprintf(fp, "<html>\n"); fprintf(fp, "<head>\n"); fprintf(fp, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n"); fprintf(fp, "<title>%s</title>\n", name); - text = gtk_webview_get_head_html(webview); + text = pidgin_webview_get_head_html(webview); fprintf(fp, "%s", text); g_free(text); fprintf(fp, "</head>\n"); fprintf(fp, "<body>\n"); fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name); - text = gtk_webview_get_body_html(webview); + text = pidgin_webview_get_body_html(webview); fprintf(fp, "%s", text); g_free(text); fprintf(fp, "\n</body>\n"); @@ -1246,12 +1246,12 @@ menu_insert_link_cb(GtkAction *action, gpointer data) { PidginWindow *win = data; PidginConversation *gtkconv; - GtkWebView *entry; + PidginWebView *entry; gtkconv = pidgin_conv_window_get_active_gtkconv(win); - entry = GTK_WEBVIEW(gtkconv->entry); + entry = PIDGIN_WEBVIEW(gtkconv->entry); - gtk_webview_activate_toolbar(entry, GTK_WEBVIEW_ACTION_LINK); + pidgin_webview_activate_toolbar(entry, PIDGIN_WEBVIEW_ACTION_LINK); } static void @@ -1259,12 +1259,12 @@ menu_insert_image_cb(GtkAction *action, gpointer data) { PidginWindow *win = data; PidginConversation *gtkconv; - GtkWebView *entry; + PidginWebView *entry; gtkconv = pidgin_conv_window_get_active_gtkconv(win); - entry = GTK_WEBVIEW(gtkconv->entry); + entry = PIDGIN_WEBVIEW(gtkconv->entry); - gtk_webview_activate_toolbar(entry, GTK_WEBVIEW_ACTION_IMAGE); + pidgin_webview_activate_toolbar(entry, PIDGIN_WEBVIEW_ACTION_IMAGE); } static void @@ -1946,7 +1946,7 @@ update_typing_inserting(PidginConversation *gtkconv) g_return_if_fail(gtkconv != NULL); - text = gtk_webview_get_body_text(GTK_WEBVIEW(gtkconv->entry)); + text = pidgin_webview_get_body_text(PIDGIN_WEBVIEW(gtkconv->entry)); got_typing_keypress(gtkconv, text[0] == '\0' || !strcmp(text, "\n")); @@ -1957,7 +1957,7 @@ static gboolean update_typing_deleting_cb(PidginConversation *gtkconv) { PurpleIMConversation *im = PURPLE_IM_CONVERSATION(gtkconv->active_conv); - gchar *text = gtk_webview_get_body_text(GTK_WEBVIEW(gtkconv->entry)); + gchar *text = pidgin_webview_get_body_text(PIDGIN_WEBVIEW(gtkconv->entry)); if (!*text || !strcmp(text, "\n")) { /* We deleted all the text, so turn off typing. */ @@ -1983,7 +1983,7 @@ update_typing_deleting(PidginConversation *gtkconv) g_return_if_fail(gtkconv != NULL); - text = gtk_webview_get_body_text(GTK_WEBVIEW(gtkconv->entry)); + text = pidgin_webview_get_body_text(PIDGIN_WEBVIEW(gtkconv->entry)); if (*text && strcmp(text, "\n")) purple_timeout_add(0, (GSourceFunc)update_typing_deleting_cb, gtkconv); @@ -2116,7 +2116,7 @@ entry_key_press_cb(GtkWidget *entry, GdkEventKey *event, gpointer data) g_free(gtkconv->send_history->data); gtkconv->send_history->data = - gtk_webview_get_body_html(GTK_WEBVIEW(gtkconv->entry)); + pidgin_webview_get_body_html(PIDGIN_WEBVIEW(gtkconv->entry)); } if (gtkconv->send_history->next && gtkconv->send_history->next->data) { @@ -2134,13 +2134,13 @@ entry_key_press_cb(GtkWidget *entry, GdkEventKey *event, gpointer data) g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gtkconv); /* Clear the formatting. */ - gtk_webview_clear_formatting(GTK_WEBVIEW(gtkconv->entry)); + pidgin_webview_clear_formatting(PIDGIN_WEBVIEW(gtkconv->entry)); /* Unblock the signal. */ g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gtkconv); g_object_unref(object); - gtk_webview_load_html_string(GTK_WEBVIEW(gtkconv->entry), + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(gtkconv->entry), gtkconv->send_history->data); /* this is mainly just a hack so the formatting at the * cursor gets picked up. */ @@ -2176,13 +2176,13 @@ entry_key_press_cb(GtkWidget *entry, GdkEventKey *event, gpointer data) g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gtkconv); /* Clear the formatting. */ - gtk_webview_clear_formatting(GTK_WEBVIEW(gtkconv->entry)); + pidgin_webview_clear_formatting(PIDGIN_WEBVIEW(gtkconv->entry)); /* Unblock the signal. */ g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gtkconv); g_object_unref(object); - gtk_webview_load_html_string(GTK_WEBVIEW(gtkconv->entry), + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(gtkconv->entry), gtkconv->send_history->data); /* this is mainly just a hack so the formatting at the * cursor gets picked up. */ @@ -2227,13 +2227,13 @@ entry_key_press_cb(GtkWidget *entry, GdkEventKey *event, gpointer data) case GDK_KEY_Page_Up: case GDK_KEY_KP_Page_Up: - gtk_webview_page_up(GTK_WEBVIEW(gtkconv->webview)); + pidgin_webview_page_up(PIDGIN_WEBVIEW(gtkconv->webview)); return TRUE; break; case GDK_KEY_Page_Down: case GDK_KEY_KP_Page_Down: - gtk_webview_page_down(GTK_WEBVIEW(gtkconv->webview)); + pidgin_webview_page_down(PIDGIN_WEBVIEW(gtkconv->webview)); return TRUE; break; @@ -2338,7 +2338,7 @@ pidgin_conv_switch_active_conversation(PurpleConversation *conv) { PidginConversation *gtkconv; PurpleConversation *old_conv; - GtkWebView *entry; + PidginWebView *entry; const char *protocol_name; PurpleConnectionFlags features; @@ -2359,14 +2359,14 @@ pidgin_conv_switch_active_conversation(PurpleConversation *conv) purple_conversation_set_logging(conv, gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(gtkconv->win->menu->logging))); - entry = GTK_WEBVIEW(gtkconv->entry); + entry = PIDGIN_WEBVIEW(gtkconv->entry); protocol_name = purple_account_get_protocol_name(purple_conversation_get_account(conv)); - gtk_webview_set_protocol_name(entry, protocol_name); - gtk_webview_set_protocol_name(GTK_WEBVIEW(gtkconv->webview), protocol_name); + pidgin_webview_set_protocol_name(entry, protocol_name); + pidgin_webview_set_protocol_name(PIDGIN_WEBVIEW(gtkconv->webview), protocol_name); features = purple_conversation_get_features(conv); if (!(features & PURPLE_CONNECTION_FLAG_HTML)) - gtk_webview_clear_formatting(GTK_WEBVIEW(gtkconv->entry)); + pidgin_webview_clear_formatting(PIDGIN_WEBVIEW(gtkconv->entry)); else if (features & PURPLE_CONNECTION_FLAG_FORMATTING_WBFO && !(purple_conversation_get_features(old_conv) & PURPLE_CONNECTION_FLAG_FORMATTING_WBFO)) { @@ -2380,52 +2380,52 @@ pidgin_conv_switch_active_conversation(PurpleConversation *conv) gboolean italic; gboolean underline; gboolean strike; - char *fontface = gtk_webview_get_current_fontface(entry); - char *forecolor = gtk_webview_get_current_forecolor(entry); - char *backcolor = gtk_webview_get_current_backcolor(entry); + char *fontface = pidgin_webview_get_current_fontface(entry); + char *forecolor = pidgin_webview_get_current_forecolor(entry); + char *backcolor = pidgin_webview_get_current_backcolor(entry); #if 0 /* TODO WebKit: Do we need this again? */ - char *background = gtk_webview_get_current_background(entry); + char *background = pidgin_webview_get_current_background(entry); #endif - gint fontsize = gtk_webview_get_current_fontsize(entry); + gint fontsize = pidgin_webview_get_current_fontsize(entry); gboolean bold2; gboolean italic2; gboolean underline2; gboolean strike2; - gtk_webview_get_current_format(entry, &bold, &italic, &underline, &strike); + pidgin_webview_get_current_format(entry, &bold, &italic, &underline, &strike); /* Clear existing formatting */ - gtk_webview_clear_formatting(entry); + pidgin_webview_clear_formatting(entry); /* Apply saved formatting to the whole buffer. */ - gtk_webview_get_current_format(entry, &bold2, &italic2, &underline2, &strike2); + pidgin_webview_get_current_format(entry, &bold2, &italic2, &underline2, &strike2); if (bold != bold2) - gtk_webview_toggle_bold(entry); + pidgin_webview_toggle_bold(entry); if (italic != italic2) - gtk_webview_toggle_italic(entry); + pidgin_webview_toggle_italic(entry); if (underline != underline2) - gtk_webview_toggle_underline(entry); + pidgin_webview_toggle_underline(entry); if (strike != strike2) - gtk_webview_toggle_strike(entry); + pidgin_webview_toggle_strike(entry); - gtk_webview_toggle_fontface(entry, fontface); + pidgin_webview_toggle_fontface(entry, fontface); if (!(features & PURPLE_CONNECTION_FLAG_NO_FONTSIZE)) - gtk_webview_font_set_size(entry, fontsize); + pidgin_webview_font_set_size(entry, fontsize); - gtk_webview_toggle_forecolor(entry, forecolor); + pidgin_webview_toggle_forecolor(entry, forecolor); if (!(features & PURPLE_CONNECTION_FLAG_NO_BGCOLOR)) { - gtk_webview_toggle_backcolor(entry, backcolor); + pidgin_webview_toggle_backcolor(entry, backcolor); #if 0 - gtk_webview_toggle_background(entry, background); + pidgin_webview_toggle_background(entry, background); #endif } @@ -2440,9 +2440,9 @@ pidgin_conv_switch_active_conversation(PurpleConversation *conv) { /* This is done in default_formatize, which is called from clear_formatting_cb, * which is (obviously) a clear_formatting signal handler. However, if we're - * here, we didn't call gtk_webview_clear_formatting() (because we want to + * here, we didn't call pidgin_webview_clear_formatting() (because we want to * preserve the formatting exactly as it is), so we have to do this now. */ - gtk_webview_set_whole_buffer_formatting_only(entry, + pidgin_webview_set_whole_buffer_formatting_only(entry, (features & PURPLE_CONNECTION_FLAG_FORMATTING_WBFO)); } @@ -4479,7 +4479,7 @@ tab_complete(PurpleConversation *conv) gsize entered_chars = 0; gtkconv = PIDGIN_CONVERSATION(conv); - gtk_webview_get_caret(GTK_WEBVIEW(gtkconv->entry), &container, &caret); + pidgin_webview_get_caret(PIDGIN_WEBVIEW(gtkconv->entry), &container, &caret); /* if there's nothing there just return */ if (caret <= 0) @@ -4602,7 +4602,7 @@ tab_complete(PurpleConversation *conv) modified = g_strdup_printf("%s%s", tmp, sub2); webkit_dom_node_set_node_value(container, modified, NULL); - gtk_webview_set_caret(GTK_WEBVIEW(gtkconv->entry), container, + pidgin_webview_set_caret(PIDGIN_WEBVIEW(gtkconv->entry), container, g_utf8_strlen(tmp, -1)); g_free(tmp); g_free(modified); @@ -4610,7 +4610,7 @@ tab_complete(PurpleConversation *conv) else { modified = g_strdup_printf("%s%s%s", sub1, (char *)matches->data, sub2); webkit_dom_node_set_node_value(container, modified, NULL); - gtk_webview_set_caret(GTK_WEBVIEW(gtkconv->entry), container, + pidgin_webview_set_caret(PIDGIN_WEBVIEW(gtkconv->entry), container, word_start + g_utf8_strlen(matches->data, -1) + colon); g_free(modified); } @@ -4638,7 +4638,7 @@ tab_complete(PurpleConversation *conv) modified = g_strdup_printf("%s%s%s", sub1, partial, sub2); webkit_dom_node_set_node_value(container, modified, NULL); - gtk_webview_set_caret(GTK_WEBVIEW(gtkconv->entry), container, + pidgin_webview_set_caret(PIDGIN_WEBVIEW(gtkconv->entry), container, word_start + g_utf8_strlen(partial, -1) + colon); g_free(addthis); g_free(modified); @@ -4911,7 +4911,7 @@ buddy_removed_cb(PurpleBlistNode *node, PurpleChatConversation *chat) } static void -entry_popup_menu_cb(GtkWebView *webview, GtkMenu *menu, gpointer data) +entry_popup_menu_cb(PidginWebView *webview, GtkMenu *menu, gpointer data) { GtkWidget *menuitem; PidginConversation *gtkconv = data; @@ -4923,7 +4923,7 @@ entry_popup_menu_cb(GtkWebView *webview, GtkMenu *menu, gpointer data) menuitem = pidgin_new_item_from_stock(NULL, _("_Send"), NULL, G_CALLBACK(send_cb), gtkconv, 0, 0, NULL); - tmp = gtk_webview_get_body_text(webview); + tmp = pidgin_webview_get_body_text(webview); if (!tmp || !*tmp) gtk_widget_set_sensitive(menuitem, FALSE); g_free(tmp); @@ -5447,7 +5447,7 @@ set_theme_webkit_settings(WebKitWebView *webview, PidginConvTheme *theme) const gchar *font_family = g_value_get_string(val); #ifdef _WIN32 /* XXX: a hack for not converting backslash to yen sign. - * See gtkwebview.c: gtk_webview_new. + * See gtkwebview.c: pidgin_webview_new. */ if (g_ascii_strcasecmp(font_family, "sans-serif") == 0) font_family = NULL; @@ -5475,7 +5475,7 @@ conv_variant_changed_cb(GObject *gobject, GParamSpec *pspec, gpointer user_data) path = pidgin_conversation_theme_get_css_path(PIDGIN_CONV_THEME(gobject)); js = g_strdup_printf("setStylesheet(\"mainStyle\", \"file://%s\");", path); g_free(path); - gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), js); + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(gtkconv->webview), js); g_free(js); } @@ -5505,7 +5505,7 @@ load_conv_theme(PidginConversation *gtkconv) "text/html", "UTF-8", baseuri); if (PURPLE_IS_CHAT_CONVERSATION(gtkconv->active_conv)) - gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(gtkconv->webview), "document.getElementById('Chat').className = 'groupchat'"); g_signal_connect(G_OBJECT(gtkconv->theme), "notify::variant", @@ -5662,7 +5662,7 @@ setup_common_pane(PidginConversation *gtkconv) gtk_widget_show(frame); gtk_widget_set_name(gtkconv->entry, "pidgin_conv_entry"); - gtk_webview_set_protocol_name(GTK_WEBVIEW(gtkconv->entry), + pidgin_webview_set_protocol_name(PIDGIN_WEBVIEW(gtkconv->entry), purple_account_get_protocol_name(purple_conversation_get_account(conv))); g_signal_connect(G_OBJECT(gtkconv->entry), "populate-popup", @@ -6033,9 +6033,9 @@ private_gtkconv_new(PurpleConversation *conv, gboolean hidden) } if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar")) - gtk_webview_show_toolbar(GTK_WEBVIEW(gtkconv->entry)); + pidgin_webview_show_toolbar(PIDGIN_WEBVIEW(gtkconv->entry)); else - gtk_webview_hide_toolbar(GTK_WEBVIEW(gtkconv->entry)); + pidgin_webview_hide_toolbar(PIDGIN_WEBVIEW(gtkconv->entry)); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) gtk_widget_show(gtkconv->infopane_hbox); @@ -6659,13 +6659,13 @@ pidgin_conv_write_conv(PurpleConversation *conv, const char *name, const char *a gtkconv->last_flags = flags; gtkconv->last_conversed = conv; - smileyed = smiley_parse_markup(displaying, purple_account_get_protocol_id(account)); + smileyed = pidgin_smiley_parse_markup(displaying, purple_account_get_protocol_id(account)); msg = replace_message_tokens(message_html, conv, name, alias, smileyed, flags, mtime); - escape = gtk_webview_quote_js_string(msg ? msg : ""); + escape = pidgin_webview_quote_js_string(msg ? msg : ""); script = g_strdup_printf("%s(%s)", func, escape); purple_debug_info("webkit", "JS: %s\n", script); - gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), script); + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(gtkconv->webview), script); g_free(script); g_free(smileyed); @@ -6674,8 +6674,8 @@ pidgin_conv_write_conv(PurpleConversation *conv, const char *name, const char *a #if 0 /* if the buffer is not empty add a <br> */ - if (!gtk_webview_is_empty(GTK_WEBVIEW(gtkconv->webview))) - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), "<br />"); + if (!pidgin_webview_is_empty(PIDGIN_WEBVIEW(gtkconv->webview))) + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), "<br />"); /* First message in a conversation. */ if (gtkconv->newday == 0) @@ -6731,27 +6731,27 @@ pidgin_conv_write_conv(PurpleConversation *conv, const char *name, const char *a /* TODO: These colors should not be hardcoded so log.c can use them */ if (flags & PURPLE_MESSAGE_RAW) { - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), message); + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), message); } else if (flags & PURPLE_MESSAGE_SYSTEM) { g_snprintf(buf2, sizeof(buf2), "<font %s><font size=\"2\"><span class='timestamp'>%s</span></font><b>%s</b></font>", sml_attrib ? sml_attrib : "", mdate, displaying); - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), buf2); + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), buf2); } else if (flags & PURPLE_MESSAGE_ERROR) { g_snprintf(buf2, sizeof(buf2), "<font color=\"#ff0000\"><font %s><font size=\"2\"><span class='timestamp'>%s</span> </font><b>%s</b></font></font>", sml_attrib ? sml_attrib : "", mdate, displaying); - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), buf2); + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), buf2); } else if (flags & PURPLE_MESSAGE_NO_LOG) { g_snprintf(buf2, BUF_LONG, "<b><font %s color=\"#777777\">%s</font></b>", sml_attrib ? sml_attrib : "", displaying); - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), buf2); + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), buf2); } else { char *new_message = g_memdup(displaying, length); char *alias_escaped = (alias ? g_markup_escape_text(alias, strlen(alias)) : g_strdup("")); @@ -6838,11 +6838,11 @@ pidgin_conv_write_conv(PurpleConversation *conv, const char *name, const char *a /* const char *color = get_text_tag_color(tag); */ g_snprintf(buf2, BUF_LONG, "<FONT %s%s%s SIZE=\"2\"><!--%s --></FONT>", color ? "COLOR=\"" : "", color ? color : "", color ? "\"" : "", mdate); - gtk_webview_append_html (GTK_WEBVIEW(gtkconv->webview), buf2); + pidgin_webview_append_html (PIDGIN_WEBVIEW(gtkconv->webview), buf2); } #endif /* if 0 */ g_snprintf(buf2, BUF_LONG, "<font %s>%s</font> ", sml_attrib ? sml_attrib : "", str); - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), buf2); + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), buf2); g_free(str); @@ -6854,7 +6854,7 @@ pidgin_conv_write_conv(PurpleConversation *conv, const char *name, const char *a } else with_font_tag = g_memdup(new_message, length); - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), with_font_tag); g_free(with_font_tag); @@ -7152,25 +7152,25 @@ pidgin_conv_has_focus(PurpleConversation *conv) } static gboolean -add_custom_smiley_for_webview(GtkWebView *webview, const char *sml, const char *smile) +add_custom_smiley_for_webview(PidginWebView *webview, const char *sml, const char *smile) { - GtkWebViewSmiley *smiley; + PidginWebViewSmiley *smiley; - smiley = gtk_webview_smiley_find(webview, sml, smile); + smiley = pidgin_webview_smiley_find(webview, sml, smile); if (smiley) { - if (!(gtk_webview_smiley_get_flags(smiley) & GTK_WEBVIEW_SMILEY_CUSTOM)) + if (!(pidgin_webview_smiley_get_flags(smiley) & PIDGIN_WEBVIEW_SMILEY_CUSTOM)) return FALSE; - gtk_webview_smiley_reload(smiley); + pidgin_webview_smiley_reload(smiley); return TRUE; } - smiley = gtk_webview_smiley_create(NULL, smile, FALSE, - GTK_WEBVIEW_SMILEY_CUSTOM); - gtk_webview_associate_smiley(webview, sml, smiley); + smiley = pidgin_webview_smiley_create(NULL, smile, FALSE, + PIDGIN_WEBVIEW_SMILEY_CUSTOM); + pidgin_webview_associate_smiley(webview, sml, smiley); g_signal_connect_swapped(webview, "destroy", - G_CALLBACK(gtk_webview_smiley_destroy), smiley); + G_CALLBACK(pidgin_webview_smiley_destroy), smiley); return TRUE; } @@ -7179,7 +7179,7 @@ static gboolean pidgin_conv_custom_smiley_add(PurpleConversation *conv, const char *smile, gboolean remote) { PidginConversation *gtkconv; - struct smiley_list *list; + struct PidginSmileyList *list; const char *sml = NULL, *conv_sml; if (!conv || !smile || !*smile) { @@ -7195,18 +7195,18 @@ pidgin_conv_custom_smiley_add(PurpleConversation *conv, const char *smile, gbool conv_sml = purple_account_get_protocol_name(purple_conversation_get_account(conv)); gtkconv = PIDGIN_CONVERSATION(conv); - for (list = (struct smiley_list *)current_smiley_theme->list; list; list = list->next) { + for (list = (struct PidginSmileyList *)current_smiley_theme->list; list; list = list->next) { if (!strcmp(list->sml, conv_sml)) { sml = list->sml; break; } } - if (!add_custom_smiley_for_webview(GTK_WEBVIEW(gtkconv->webview), sml, smile)) + if (!add_custom_smiley_for_webview(PIDGIN_WEBVIEW(gtkconv->webview), sml, smile)) return FALSE; if (!remote) /* If it's a local custom smiley, then add it for the entry */ - if (!add_custom_smiley_for_webview(GTK_WEBVIEW(gtkconv->entry), sml, smile)) + if (!add_custom_smiley_for_webview(PIDGIN_WEBVIEW(gtkconv->entry), sml, smile)) return FALSE; return TRUE; @@ -7304,7 +7304,7 @@ pidgin_conv_send_confirm(PurpleConversation *conv, const char *message) { PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), message); + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), message); } /* @@ -7320,7 +7320,7 @@ gray_stuff_out(PidginConversation *gtkconv) PurpleConnection *gc; PurplePluginProtocolInfo *prpl_info = NULL; GdkPixbuf *window_icon = NULL; - GtkWebViewButtons buttons; + PidginWebViewButtons buttons; PurpleAccount *account; win = pidgin_conv_get_window(gtkconv); @@ -7411,18 +7411,18 @@ gray_stuff_out(PidginConversation *gtkconv) /* Deal with the toolbar */ if (features & PURPLE_CONNECTION_FLAG_HTML) { - buttons = GTK_WEBVIEW_ALL; /* Everything on */ + buttons = PIDGIN_WEBVIEW_ALL; /* Everything on */ if (features & PURPLE_CONNECTION_FLAG_NO_BGCOLOR) - buttons &= ~GTK_WEBVIEW_BACKCOLOR; + buttons &= ~PIDGIN_WEBVIEW_BACKCOLOR; if (features & PURPLE_CONNECTION_FLAG_NO_FONTSIZE) { - buttons &= ~GTK_WEBVIEW_GROW; - buttons &= ~GTK_WEBVIEW_SHRINK; + buttons &= ~PIDGIN_WEBVIEW_GROW; + buttons &= ~PIDGIN_WEBVIEW_SHRINK; } if (features & PURPLE_CONNECTION_FLAG_NO_URLDESC) - buttons &= ~GTK_WEBVIEW_LINKDESC; + buttons &= ~PIDGIN_WEBVIEW_LINKDESC; } else { - buttons = GTK_WEBVIEW_SMILEY | GTK_WEBVIEW_IMAGE; + buttons = PIDGIN_WEBVIEW_SMILEY | PIDGIN_WEBVIEW_IMAGE; } if (!(prpl_info->options & OPT_PROTO_IM_IMAGE) @@ -7432,16 +7432,16 @@ gray_stuff_out(PidginConversation *gtkconv) } if (features & PURPLE_CONNECTION_FLAG_NO_IMAGES) - buttons &= ~GTK_WEBVIEW_IMAGE; + buttons &= ~PIDGIN_WEBVIEW_IMAGE; if (features & PURPLE_CONNECTION_FLAG_ALLOW_CUSTOM_SMILEY) - buttons |= GTK_WEBVIEW_CUSTOM_SMILEY; + buttons |= PIDGIN_WEBVIEW_CUSTOM_SMILEY; else - buttons &= ~GTK_WEBVIEW_CUSTOM_SMILEY; + buttons &= ~PIDGIN_WEBVIEW_CUSTOM_SMILEY; - gtk_webview_set_format_functions(GTK_WEBVIEW(gtkconv->entry), buttons); + pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(gtkconv->entry), buttons); if (account != NULL) - gtk_webview_set_protocol_name(GTK_WEBVIEW(gtkconv->entry), purple_account_get_protocol_id(account)); + pidgin_webview_set_protocol_name(PIDGIN_WEBVIEW(gtkconv->entry), purple_account_get_protocol_id(account)); /* Deal with menu items */ gtk_action_set_sensitive(win->menu->view_log, TRUE); @@ -8125,7 +8125,7 @@ spellcheck_pref_cb(const char *name, PurplePrefType type, gtkconv = PIDGIN_CONVERSATION(conv); - pidgin_webview_set_spellcheck(GTK_WEBVIEW(gtkconv->entry), + pidgin_webview_set_spellcheck(PIDGIN_WEBVIEW(gtkconv->entry), (gboolean)GPOINTER_TO_INT(value)); } } @@ -8173,9 +8173,9 @@ show_formatting_toolbar_pref_cb(const char *name, PurplePrefType type, (gboolean)GPOINTER_TO_INT(value)); if ((gboolean)GPOINTER_TO_INT(value)) - gtk_webview_show_toolbar(GTK_WEBVIEW(gtkconv->entry)); + pidgin_webview_show_toolbar(PIDGIN_WEBVIEW(gtkconv->entry)); else - gtk_webview_hide_toolbar(GTK_WEBVIEW(gtkconv->entry)); + pidgin_webview_hide_toolbar(PIDGIN_WEBVIEW(gtkconv->entry)); g_idle_add((GSourceFunc)resize_webview_cb, gtkconv); } @@ -8540,7 +8540,7 @@ static gboolean add_message_history_to_gtkconv(gpointer data) { PidginConversation *gtkconv = data; - GtkWebView *webview = GTK_WEBVIEW(gtkconv->webview); + PidginWebView *webview = PIDGIN_WEBVIEW(gtkconv->webview); int count = 0; int timer = gtkconv->attach_timer; time_t when = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gtkconv->entry), "attach-start-time")); @@ -8550,8 +8550,8 @@ add_message_history_to_gtkconv(gpointer data) while (gtkconv->attach_current && count < 100) { /* XXX: 100 is a random value here */ PurpleConversationMessage *msg = gtkconv->attach_current->data; if (!im && when && when < purple_conversation_message_get_timestamp(msg)) { - gtk_webview_append_html(webview, "<BR><HR>"); - gtk_webview_scroll_to_end(webview, TRUE); + pidgin_webview_append_html(webview, "<BR><HR>"); + pidgin_webview_scroll_to_end(webview, TRUE); g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL); } pidgin_conv_write_conv( @@ -8598,8 +8598,8 @@ add_message_history_to_gtkconv(gpointer data) purple_conversation_message_get_flags(msg), purple_conversation_message_get_timestamp(msg)); } - gtk_webview_append_html(webview, "<BR><HR>"); - gtk_webview_scroll_to_end(webview, TRUE); + pidgin_webview_append_html(webview, "<BR><HR>"); + pidgin_webview_scroll_to_end(webview, TRUE); g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL); } @@ -9331,7 +9331,7 @@ notebook_motion_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win) dest_win = pidgin_conv_window_get_at_event((GdkEvent *)e); if (dest_win == NULL) { - dnd_hints_hide_all(); + pidgin_pidgin_dnd_hints_hide_all(); return TRUE; } @@ -9357,23 +9357,23 @@ notebook_motion_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win) if (gtk_notebook_get_show_tabs(dest_notebook) == FALSE && win == dest_win) { /* dragging a tab from a single-tabbed window over its own window */ - dnd_hints_hide_all(); + pidgin_pidgin_dnd_hints_hide_all(); return TRUE; } else if (horiz_tabs) { if (((gpointer)win == (gpointer)dest_win && win->drag_tab < page_num) || to_right) { - dnd_hints_show_relative(HINT_ARROW_DOWN, tab, HINT_POSITION_RIGHT, HINT_POSITION_TOP); - dnd_hints_show_relative(HINT_ARROW_UP, tab, HINT_POSITION_RIGHT, HINT_POSITION_BOTTOM); + pidgin_pidgin_dnd_hints_show_relative(HINT_ARROW_DOWN, tab, HINT_POSITION_RIGHT, HINT_POSITION_TOP); + pidgin_pidgin_dnd_hints_show_relative(HINT_ARROW_UP, tab, HINT_POSITION_RIGHT, HINT_POSITION_BOTTOM); } else { - dnd_hints_show_relative(HINT_ARROW_DOWN, tab, HINT_POSITION_LEFT, HINT_POSITION_TOP); - dnd_hints_show_relative(HINT_ARROW_UP, tab, HINT_POSITION_LEFT, HINT_POSITION_BOTTOM); + pidgin_pidgin_dnd_hints_show_relative(HINT_ARROW_DOWN, tab, HINT_POSITION_LEFT, HINT_POSITION_TOP); + pidgin_pidgin_dnd_hints_show_relative(HINT_ARROW_UP, tab, HINT_POSITION_LEFT, HINT_POSITION_BOTTOM); } } else { if (((gpointer)win == (gpointer)dest_win && win->drag_tab < page_num) || to_right) { - dnd_hints_show_relative(HINT_ARROW_RIGHT, tab, HINT_POSITION_LEFT, HINT_POSITION_BOTTOM); - dnd_hints_show_relative(HINT_ARROW_LEFT, tab, HINT_POSITION_RIGHT, HINT_POSITION_BOTTOM); + pidgin_pidgin_dnd_hints_show_relative(HINT_ARROW_RIGHT, tab, HINT_POSITION_LEFT, HINT_POSITION_BOTTOM); + pidgin_pidgin_dnd_hints_show_relative(HINT_ARROW_LEFT, tab, HINT_POSITION_RIGHT, HINT_POSITION_BOTTOM); } else { - dnd_hints_show_relative(HINT_ARROW_RIGHT, tab, HINT_POSITION_LEFT, HINT_POSITION_TOP); - dnd_hints_show_relative(HINT_ARROW_LEFT, tab, HINT_POSITION_RIGHT, HINT_POSITION_TOP); + pidgin_pidgin_dnd_hints_show_relative(HINT_ARROW_RIGHT, tab, HINT_POSITION_LEFT, HINT_POSITION_TOP); + pidgin_pidgin_dnd_hints_show_relative(HINT_ARROW_LEFT, tab, HINT_POSITION_RIGHT, HINT_POSITION_TOP); } } } @@ -9622,7 +9622,7 @@ notebook_release_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win) win->in_drag = FALSE; - dnd_hints_hide_all(); + pidgin_pidgin_dnd_hints_hide_all(); dest_win = pidgin_conv_window_get_at_event((GdkEvent *)e); @@ -11273,7 +11273,7 @@ generate_nick_colors(guint numcolors, GdkColor background) * list. only some of them will differ from the background color though. lets see if we can find * numcolors of them that do */ - while (i < numcolors && j < NUM_NICK_SEED_COLORS && time(NULL) < breakout_time) + while (i < numcolors && j < PIDGIN_NUM_NICK_SEED_COLORS && time(NULL) < breakout_time) { GdkColor color = nick_seed_colors[j]; diff --git a/pidgin/gtkdebug.c b/pidgin/gtkdebug.c index df3a2bf89b..cefa5d0f34 100644 --- a/pidgin/gtkdebug.c +++ b/pidgin/gtkdebug.c @@ -107,7 +107,7 @@ save_writefile_cb(void *user_data, const char *filename) return; } - tmp = gtk_webview_get_body_text(GTK_WEBVIEW(win->text)); + tmp = pidgin_webview_get_body_text(PIDGIN_WEBVIEW(win->text)); fprintf(fp, "Pidgin Debug Log : %s\n", purple_date_format_full(NULL)); fprintf(fp, "%s", tmp); g_free(tmp); @@ -125,7 +125,7 @@ save_cb(GtkWidget *w, DebugWindow *win) static void clear_cb(GtkWidget *w, DebugWindow *win) { - gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), "clear();"); + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(win->text), "clear();"); } static void @@ -134,9 +134,9 @@ pause_cb(GtkWidget *w, DebugWindow *win) win->paused = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(w)); if (win->paused) - gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), "pauseOutput();"); + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(win->text), "pauseOutput();"); else - gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), "resumeOutput();"); + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(win->text), "resumeOutput();"); } /****************************************************************************** @@ -185,7 +185,7 @@ regex_change_color(GtkWidget *w, gboolean success) { static void regex_toggle_filter(DebugWindow *win, gboolean filter) { - gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), "regex.clear();"); + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(win->text), "regex.clear();"); if (filter) { const char *text; @@ -193,12 +193,12 @@ regex_toggle_filter(DebugWindow *win, gboolean filter) char *script; text = gtk_entry_get_text(GTK_ENTRY(win->expression)); - regex = gtk_webview_quote_js_string(text); + regex = pidgin_webview_quote_js_string(text); script = g_strdup_printf("regex.filterAll(%s, %s, %s);", regex, win->invert ? "true" : "false", win->highlight ? "true" : "false"); - gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), script); + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(win->text), script); g_free(script); g_free(regex); } @@ -361,7 +361,7 @@ filter_level_pref_changed(const char *name, PurplePrefType type, gconstpointer v gtk_combo_box_set_active(GTK_COMBO_BOX(win->filterlevel), level); tmp = g_strdup_printf("setFilterLevel('%d');", level); - gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), tmp); + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(win->text), tmp); g_free(tmp); } @@ -599,9 +599,9 @@ debug_window_new(void) /* Add the gtkwebview */ frame = pidgin_create_webview(FALSE, &win->text, NULL); - gtk_webview_set_format_functions(GTK_WEBVIEW(win->text), - GTK_WEBVIEW_ALL ^ GTK_WEBVIEW_SMILEY ^ GTK_WEBVIEW_IMAGE); - gtk_webview_load_html_string(GTK_WEBVIEW(win->text), gtkdebug_html); + pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(win->text), + PIDGIN_WEBVIEW_ALL ^ PIDGIN_WEBVIEW_SMILEY ^ PIDGIN_WEBVIEW_IMAGE); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(win->text), gtkdebug_html); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); gtk_widget_show(frame); @@ -792,7 +792,7 @@ pidgin_debug_print(PurpleDebugLevel level, const char *category, level, mdate, category ? category : "", esc_s); g_free(esc_s); - gtk_webview_safe_execute_script(GTK_WEBVIEW(debug_win->text), js); + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(debug_win->text), js); g_free(js); } diff --git a/pidgin/gtkdialogs.c b/pidgin/gtkdialogs.c index 9695748c5e..691bf0a258 100644 --- a/pidgin/gtkdialogs.c +++ b/pidgin/gtkdialogs.c @@ -478,10 +478,10 @@ pidgin_build_help_dialog(const char *title, const char *role, GString *string) gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0); frame = pidgin_create_webview(FALSE, &webview, NULL); - gtk_webview_set_format_functions(GTK_WEBVIEW(webview), GTK_WEBVIEW_ALL ^ GTK_WEBVIEW_SMILEY); + pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(webview), PIDGIN_WEBVIEW_ALL ^ PIDGIN_WEBVIEW_SMILEY); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); - gtk_webview_append_html(GTK_WEBVIEW(webview), string->str); + pidgin_webview_append_html(PIDGIN_WEBVIEW(webview), string->str); button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE, G_CALLBACK(destroy_win), win); diff --git a/pidgin/gtkdnd-hints.c b/pidgin/gtkdnd-hints.c index a7cf040729..f9f724fead 100644 --- a/pidgin/gtkdnd-hints.c +++ b/pidgin/gtkdnd-hints.c @@ -40,7 +40,7 @@ typedef struct } HintWindowInfo; /* - * Info about each hint widget. See DndHintWindowId enum. + * Info about each hint widget. See PidginDndHintWindowId enum. */ static HintWindowInfo hint_windows[] = { { NULL, "arrow-up.xpm", -13/2, 0 }, @@ -189,16 +189,16 @@ dnd_hints_init(void) } void -dnd_hints_hide_all(void) +pidgin_pidgin_dnd_hints_hide_all(void) { gint i; for (i = 0; hint_windows[i].filename != NULL; i++) - dnd_hints_hide(i); + pidgin_dnd_hints_hide(i); } void -dnd_hints_hide(DndHintWindowId i) +pidgin_dnd_hints_hide(PidginDndHintWindowId i) { GtkWidget *w = hint_windows[i].widget; @@ -207,7 +207,7 @@ dnd_hints_hide(DndHintWindowId i) } void -dnd_hints_show(DndHintWindowId id, gint x, gint y) +pidgin_dnd_hints_show(PidginDndHintWindowId id, gint x, gint y) { GtkWidget *w; @@ -224,8 +224,8 @@ dnd_hints_show(DndHintWindowId id, gint x, gint y) } void -dnd_hints_show_relative(DndHintWindowId id, GtkWidget *widget, - DndHintPosition horiz, DndHintPosition vert) +pidgin_pidgin_dnd_hints_show_relative(PidginDndHintWindowId id, GtkWidget *widget, + PidginDndHintPosition horiz, PidginDndHintPosition vert) { gint x1, x2, y1, y2; gint x = 0, y = 0; @@ -244,7 +244,7 @@ dnd_hints_show_relative(DndHintWindowId id, GtkWidget *widget, case HINT_POSITION_CENTER: x = (x1 + x2) / 2; break; default: /* should not happen */ - g_warning("Invalid parameter to dnd_hints_show_relative"); + g_warning("Invalid parameter to pidgin_pidgin_dnd_hints_show_relative"); break; } @@ -255,10 +255,10 @@ dnd_hints_show_relative(DndHintWindowId id, GtkWidget *widget, case HINT_POSITION_CENTER: y = (y1 + y2) / 2; break; default: /* should not happen */ - g_warning("Invalid parameter to dnd_hints_show_relative"); + g_warning("Invalid parameter to pidgin_pidgin_dnd_hints_show_relative"); break; } - dnd_hints_show(id, x, y); + pidgin_dnd_hints_show(id, x, y); } diff --git a/pidgin/gtkdnd-hints.h b/pidgin/gtkdnd-hints.h index 7101236b29..41094897a1 100644 --- a/pidgin/gtkdnd-hints.h +++ b/pidgin/gtkdnd-hints.h @@ -30,7 +30,7 @@ #include <gtk/gtk.h> /** - * DndHintWindowId: + * PidginDndHintWindowId: * @HINT_ARROW_UP: Up arrow. * @HINT_ARROW_DOWN: Down arrow. * @HINT_ARROW_LEFT: Left arrow. @@ -45,10 +45,10 @@ typedef enum HINT_ARROW_LEFT, HINT_ARROW_RIGHT -} DndHintWindowId; +} PidginDndHintWindowId; /** - * DndHintPosition: + * PidginDndHintPosition: * @HINT_POSITION_RIGHT: Position to the right of a tab. * @HINT_POSITION_LEFT: Position to the left of a tab. * @HINT_POSITION_TOP: Position above a tab. @@ -65,37 +65,37 @@ typedef enum { HINT_POSITION_BOTTOM, HINT_POSITION_CENTER -} DndHintPosition; +} PidginDndHintPosition; G_BEGIN_DECLS /** - * dnd_hints_show: + * pidgin_dnd_hints_show: * @id: The ID of the hint to show. * @x: The X location to show it at. * @y: The Y location to show it at. * * Shows a drag-and-drop hint at the specified location. */ -void dnd_hints_show(DndHintWindowId id, gint x, gint y); +void pidgin_dnd_hints_show(PidginDndHintWindowId id, gint x, gint y); /** - * dnd_hints_hide: + * pidgin_dnd_hints_hide: * @id: The ID of the hint to hide. * * Hides the specified drag-and-drop hint. */ -void dnd_hints_hide(DndHintWindowId id); +void pidgin_dnd_hints_hide(PidginDndHintWindowId id); /** - * dnd_hints_hide_all: + * pidgin_pidgin_dnd_hints_hide_all: * * Hides all drag-and-drop hints. */ -void dnd_hints_hide_all(void); +void pidgin_pidgin_dnd_hints_hide_all(void); /** - * dnd_hints_show_relative: + * pidgin_pidgin_dnd_hints_show_relative: * @id: The ID of the hint. * @widget: The widget that the hint is relative to. * @horiz: The horizontal relative position. @@ -103,8 +103,8 @@ void dnd_hints_hide_all(void); * * Shows a drag-and-drop hint relative to a widget. */ -void dnd_hints_show_relative(DndHintWindowId id, GtkWidget *widget, - DndHintPosition horiz, DndHintPosition vert); +void pidgin_pidgin_dnd_hints_show_relative(PidginDndHintWindowId id, GtkWidget *widget, + PidginDndHintPosition horiz, PidginDndHintPosition vert); G_END_DECLS diff --git a/pidgin/gtknickcolors.h b/pidgin/gtknickcolors.h index 5adce22b50..26991c2d22 100644 --- a/pidgin/gtknickcolors.h +++ b/pidgin/gtknickcolors.h @@ -54,6 +54,6 @@ static const GdkColor nick_seed_colors[] = { {0, 11822, 13364, 13878} /* Aluminium #6*/ }; -#define NUM_NICK_SEED_COLORS (sizeof(nick_seed_colors) / sizeof(nick_seed_colors[0])) +#define PIDGIN_NUM_NICK_SEED_COLORS (sizeof(nick_seed_colors) / sizeof(nick_seed_colors[0])) #endif diff --git a/pidgin/gtknotify.c b/pidgin/gtknotify.c index c825f12b45..6860fee612 100644 --- a/pidgin/gtknotify.c +++ b/pidgin/gtknotify.c @@ -935,7 +935,7 @@ pidgin_notify_formatted(const char *title, const char *primary, /* Make sure URLs are clickable */ linked_text = purple_markup_linkify(text); - gtk_webview_load_html_string(GTK_WEBVIEW(web_view), linked_text); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(web_view), linked_text); g_free(linked_text); g_object_set_data(G_OBJECT(window), "webview-widget", web_view); @@ -1195,7 +1195,7 @@ pidgin_notify_userinfo(PurpleConnection *gc, const char *who, if (pinfo != NULL) { GtkWidget *webview = g_object_get_data(G_OBJECT(pinfo->window), "webview-widget"); char *linked_text = purple_markup_linkify(info); - gtk_webview_load_html_string(GTK_WEBVIEW(webview), linked_text); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(webview), linked_text); g_free(linked_text); g_free(key); ui_handle = pinfo->window; diff --git a/pidgin/gtkpluginpref.c b/pidgin/gtkpluginpref.c index b5b9b1c19b..afaef9de6f 100644 --- a/pidgin/gtkpluginpref.c +++ b/pidgin/gtkpluginpref.c @@ -43,7 +43,7 @@ entry_cb(GtkWidget *entry, gpointer data) { static void -webview_cb(GtkWebView *webview, gpointer data) +webview_cb(PidginWebView *webview, gpointer data) { char *pref; char *text; @@ -51,7 +51,7 @@ webview_cb(GtkWebView *webview, gpointer data) pref = g_object_get_data(G_OBJECT(webview), "pref-key"); g_return_if_fail(pref); - text = gtk_webview_get_body_html(webview); + text = pidgin_webview_get_body_html(webview); purple_prefs_set_string(pref, text); g_free(text); } @@ -127,15 +127,15 @@ make_string_pref(GtkWidget *parent, PurplePluginPref *pref, GtkSizeGroup *sg) { frame = pidgin_create_webview(TRUE, &webview, NULL); } else { frame = pidgin_create_webview(FALSE, &webview, NULL); - gtk_webview_set_format_functions(GTK_WEBVIEW(webview), 0); + pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(webview), 0); } if (format & PURPLE_STRING_FORMAT_TYPE_MULTILINE) { gchar *tmp = purple_strreplace(purple_prefs_get_string(pref_name), "\n", "<br>"); - gtk_webview_append_html(GTK_WEBVIEW(webview), tmp); + pidgin_webview_append_html(PIDGIN_WEBVIEW(webview), tmp); g_free(tmp); } else - gtk_webview_append_html(GTK_WEBVIEW(webview), purple_prefs_get_string(pref_name)); + pidgin_webview_append_html(PIDGIN_WEBVIEW(webview), purple_prefs_get_string(pref_name)); gtk_label_set_mnemonic_widget(GTK_LABEL(gtk_label), webview); gtk_widget_show_all(frame); g_object_set_data(G_OBJECT(webview), "pref-key", (gpointer)pref_name); diff --git a/pidgin/gtkpounce.c b/pidgin/gtkpounce.c index ac46b805b1..c7493b616f 100644 --- a/pidgin/gtkpounce.c +++ b/pidgin/gtkpounce.c @@ -299,7 +299,7 @@ save_pounce_cb(GtkWidget *w, PidginPounceDialog *dialog) events |= PURPLE_POUNCE_MESSAGE_RECEIVED; /* Data fields */ - message = gtk_webview_get_body_html(GTK_WEBVIEW(dialog->send_msg_entry)); + message = pidgin_webview_get_body_html(PIDGIN_WEBVIEW(dialog->send_msg_entry)); command = gtk_entry_get_text(GTK_ENTRY(dialog->exec_cmd_entry)); sound = gtk_entry_get_text(GTK_ENTRY(dialog->play_sound_entry)); reason = gtk_entry_get_text(GTK_ENTRY(dialog->popup_entry)); @@ -485,7 +485,7 @@ static void reset_send_msg_entry(PidginPounceDialog *dialog, GtkWidget *dontcare) { PurpleAccount *account = pidgin_account_option_menu_get_selected(dialog->account_menu); - gtk_webview_setup_entry(GTK_WEBVIEW(dialog->send_msg_entry), + pidgin_webview_setup_entry(PIDGIN_WEBVIEW(dialog->send_msg_entry), (account && purple_account_get_connection(account)) ? purple_connection_get_flags(purple_account_get_connection(account)) : PURPLE_CONNECTION_FLAG_HTML); } @@ -938,7 +938,7 @@ pidgin_pounce_editor_show(PurpleAccount *account, const char *name, "send-message", "message")) != NULL) { - gtk_webview_append_html(GTK_WEBVIEW(dialog->send_msg_entry), value); + pidgin_webview_append_html(PIDGIN_WEBVIEW(dialog->send_msg_entry), value); } if ((value = purple_pounce_action_get_attribute(cur_pounce, diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c index b7928a182a..b861dc71c9 100644 --- a/pidgin/gtkprefs.c +++ b/pidgin/gtkprefs.c @@ -591,7 +591,7 @@ smileys_refresh_theme_list(void) return; while (themes) { - struct smiley_theme *theme = themes->data; + struct PidginSmileyTheme *theme = themes->data; char *description = get_theme_markup(_(theme->name), FALSE, _(theme->author), _(theme->desc)); gtk_list_store_append(prefs_smiley_themes, &iter); @@ -1533,30 +1533,30 @@ theme_page(void) } static void -formatting_toggle_cb(GtkWebView *webview, GtkWebViewButtons buttons, void *data) +formatting_toggle_cb(PidginWebView *webview, PidginWebViewButtons buttons, void *data) { gboolean bold, italic, uline, strike; - gtk_webview_get_current_format(webview, &bold, &italic, &uline, &strike); + pidgin_webview_get_current_format(webview, &bold, &italic, &uline, &strike); - if (buttons & GTK_WEBVIEW_BOLD) + if (buttons & PIDGIN_WEBVIEW_BOLD) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", bold); - if (buttons & GTK_WEBVIEW_ITALIC) + if (buttons & PIDGIN_WEBVIEW_ITALIC) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", italic); - if (buttons & GTK_WEBVIEW_UNDERLINE) + if (buttons & PIDGIN_WEBVIEW_UNDERLINE) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", uline); - if (buttons & GTK_WEBVIEW_STRIKE) + if (buttons & PIDGIN_WEBVIEW_STRIKE) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike", strike); - if (buttons & GTK_WEBVIEW_GROW || buttons & GTK_WEBVIEW_SHRINK) + if (buttons & PIDGIN_WEBVIEW_GROW || buttons & PIDGIN_WEBVIEW_SHRINK) purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", - gtk_webview_get_current_fontsize(webview)); - if (buttons & GTK_WEBVIEW_FACE) { - char *face = gtk_webview_get_current_fontface(webview); + pidgin_webview_get_current_fontsize(webview)); + if (buttons & PIDGIN_WEBVIEW_FACE) { + char *face = pidgin_webview_get_current_fontface(webview); if (face) purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face); @@ -1566,8 +1566,8 @@ formatting_toggle_cb(GtkWebView *webview, GtkWebViewButtons buttons, void *data) g_free(face); } - if (buttons & GTK_WEBVIEW_FORECOLOR) { - char *color = gtk_webview_get_current_forecolor(webview); + if (buttons & PIDGIN_WEBVIEW_FORECOLOR) { + char *color = pidgin_webview_get_current_forecolor(webview); if (color) purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color); @@ -1577,8 +1577,8 @@ formatting_toggle_cb(GtkWebView *webview, GtkWebViewButtons buttons, void *data) g_free(color); } - if (buttons & GTK_WEBVIEW_BACKCOLOR) { - char *color = gtk_webview_get_current_backcolor(webview); + if (buttons & PIDGIN_WEBVIEW_BACKCOLOR) { + char *color = pidgin_webview_get_current_backcolor(webview); if (color) purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color); @@ -1590,7 +1590,7 @@ formatting_toggle_cb(GtkWebView *webview, GtkWebViewButtons buttons, void *data) } static void -formatting_clear_cb(GtkWebView *webview, void *data) +formatting_clear_cb(PidginWebView *webview, void *data) { purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); @@ -1933,26 +1933,26 @@ conv_page(void) gtk_widget_show(frame); gtk_widget_set_name(webview, "pidgin_prefs_font_webview"); gtk_widget_set_size_request(frame, 450, -1); - gtk_webview_set_whole_buffer_formatting_only(GTK_WEBVIEW(webview), TRUE); - gtk_webview_set_format_functions(GTK_WEBVIEW(webview), - GTK_WEBVIEW_BOLD | - GTK_WEBVIEW_ITALIC | - GTK_WEBVIEW_UNDERLINE | - GTK_WEBVIEW_STRIKE | - GTK_WEBVIEW_GROW | - GTK_WEBVIEW_SHRINK | - GTK_WEBVIEW_FACE | - GTK_WEBVIEW_FORECOLOR | - GTK_WEBVIEW_BACKCOLOR); - - gtk_webview_append_html(GTK_WEBVIEW(webview), + pidgin_webview_set_whole_buffer_formatting_only(PIDGIN_WEBVIEW(webview), TRUE); + pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(webview), + PIDGIN_WEBVIEW_BOLD | + PIDGIN_WEBVIEW_ITALIC | + PIDGIN_WEBVIEW_UNDERLINE | + PIDGIN_WEBVIEW_STRIKE | + PIDGIN_WEBVIEW_GROW | + PIDGIN_WEBVIEW_SHRINK | + PIDGIN_WEBVIEW_FACE | + PIDGIN_WEBVIEW_FORECOLOR | + PIDGIN_WEBVIEW_BACKCOLOR); + + pidgin_webview_append_html(PIDGIN_WEBVIEW(webview), _("This is how your outgoing message text will " "appear when you use protocols that support " "formatting.")); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); - gtk_webview_setup_entry(GTK_WEBVIEW(webview), + pidgin_webview_setup_entry(PIDGIN_WEBVIEW(webview), PURPLE_CONNECTION_FLAG_HTML | PURPLE_CONNECTION_FLAG_FORMATTING_WBFO); @@ -4205,7 +4205,7 @@ smiley_theme_pref_cb(const char *name, PurplePrefType type, GSList *themes; for (themes = smiley_themes; themes; themes = themes->next) { - struct smiley_theme *smile = themes->data; + struct PidginSmileyTheme *smile = themes->data; if (smile->name && strcmp(themename, smile->name) == 0) { pidgin_themes_load_smiley_theme(smile->path, TRUE); break; diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c index b310054d40..c0eff7d5f8 100644 --- a/pidgin/gtkrequest.c +++ b/pidgin/gtkrequest.c @@ -150,7 +150,7 @@ input_response_cb(GtkDialog *dialog, gint id, PidginRequestData *data) gtk_text_buffer_get_end_iter(buffer, &end_iter); if ((data->u.input.hint != NULL) && (!strcmp(data->u.input.hint, "html"))) - multiline_value = gtk_webview_get_body_html(GTK_WEBVIEW(data->u.input.entry)); + multiline_value = pidgin_webview_get_body_html(PIDGIN_WEBVIEW(data->u.input.entry)); else multiline_value = gtk_text_buffer_get_text(buffer, &start_iter, &end_iter, FALSE); @@ -614,7 +614,7 @@ pidgin_request_input(const char *title, const char *primary, gtk_widget_set_size_request(entry, 320, 130); gtk_widget_set_name(entry, "pidgin_request_webview"); if (default_value != NULL) - gtk_webview_append_html(GTK_WEBVIEW(entry), default_value); + pidgin_webview_append_html(PIDGIN_WEBVIEW(entry), default_value); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); gtk_widget_show(frame); } diff --git a/pidgin/gtksavedstatuses.c b/pidgin/gtksavedstatuses.c index 1a15e608ed..53fe32dcd7 100644 --- a/pidgin/gtksavedstatuses.c +++ b/pidgin/gtksavedstatuses.c @@ -114,7 +114,7 @@ typedef struct gchar *original_title; GtkEntry *title; GtkComboBox *type; - GtkWebView *message; + PidginWebView *message; } StatusEditor; typedef struct @@ -125,7 +125,7 @@ typedef struct GtkWidget *window; GtkListStore *model; GtkComboBox *box; - GtkWebView *message; + PidginWebView *message; } SubStatusEditor; static StatusWindow *status_window = NULL; @@ -726,7 +726,7 @@ status_editor_ok_cb(GtkButton *button, gpointer user_data) } type = gtk_combo_box_get_active(dialog->type) + (PURPLE_STATUS_UNSET + 1); - message = gtk_webview_get_body_html(dialog->message); + message = pidgin_webview_get_body_html(dialog->message); unformatted = purple_markup_strip_html(message); /* @@ -1142,7 +1142,7 @@ pidgin_status_editor_show(gboolean edit, PurpleSavedStatus *saved_status) /* Status message */ frame = pidgin_create_webview(TRUE, &text, NULL); - dialog->message = GTK_WEBVIEW(text); + dialog->message = PIDGIN_WEBVIEW(text); hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Message:"), sg, frame, TRUE, NULL); gtk_container_child_set(GTK_CONTAINER(vbox), hbox, "expand", TRUE, "fill", TRUE, NULL); focus_chain = g_list_prepend(focus_chain, dialog->message); @@ -1150,7 +1150,7 @@ pidgin_status_editor_show(gboolean edit, PurpleSavedStatus *saved_status) g_list_free(focus_chain); if ((saved_status != NULL) && (purple_savedstatus_get_message(saved_status) != NULL)) - gtk_webview_append_html(GTK_WEBVIEW(text), + pidgin_webview_append_html(PIDGIN_WEBVIEW(text), purple_savedstatus_get_message(saved_status)); /* Different status message expander */ @@ -1337,7 +1337,7 @@ substatus_editor_ok_cb(GtkButton *button, gpointer user_data) -1); type = purple_account_get_status_type(dialog->account, id); if (purple_status_type_get_attr(type, "message") != NULL) - message = gtk_webview_get_body_html(GTK_WEBVIEW(dialog->message)); + message = pidgin_webview_get_body_html(PIDGIN_WEBVIEW(dialog->message)); name = purple_status_type_get_name(type); stock = get_stock_icon_from_primitive(purple_status_type_get_primitive(type)); @@ -1457,7 +1457,7 @@ edit_substatus(StatusEditor *status_editor, PurpleAccount *account) gtk_size_group_add_widget(sg, label); frame = pidgin_create_webview(TRUE, &text, NULL); - dialog->message = GTK_WEBVIEW(text); + dialog->message = PIDGIN_WEBVIEW(text); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0); /* Cancel button */ @@ -1492,7 +1492,7 @@ edit_substatus(StatusEditor *status_editor, PurpleAccount *account) /* TODO: Else get the generic status type from our parent */ if (message) - gtk_webview_append_html(dialog->message, message); + pidgin_webview_append_html(dialog->message, message); for (list = purple_account_get_status_types(account); list; list = list->next) { diff --git a/pidgin/gtksmiley.c b/pidgin/gtksmiley.c index 0f2c8a8cfb..2f8cd859a3 100644 --- a/pidgin/gtksmiley.c +++ b/pidgin/gtksmiley.c @@ -83,20 +83,20 @@ pidgin_smiley_destroy(PidginSmiley *smiley) } /****************************************************************************** - * GtkWebViewSmileys stuff + * PidginWebViewSmileys stuff *****************************************************************************/ /* Perhaps these should be in gtkwebview.c instead. -- sadrul */ -static void add_gtkwebview_to_list(GtkWebViewSmiley *gtksmiley) +static void add_gtkwebview_to_list(PidginWebViewSmiley *gtksmiley) { gtk_smileys = g_slist_prepend(gtk_smileys, gtksmiley); purple_debug_info("gtksmiley", "adding %s to gtk_smileys", - gtk_webview_smiley_get_smile(gtksmiley)); + pidgin_webview_smiley_get_smile(gtksmiley)); } static void shortcut_changed_cb(PurpleSmiley *smiley, gpointer dontcare, - GtkWebViewSmiley *gtksmiley) + PidginWebViewSmiley *gtksmiley) { #if 0 g_free(gtksmiley->smile); @@ -108,7 +108,7 @@ shortcut_changed_cb(PurpleSmiley *smiley, gpointer dontcare, static void image_changed_cb(PurpleSmiley *smiley, gpointer dontcare, - GtkWebViewSmiley *gtksmiley) + PidginWebViewSmiley *gtksmiley) { #if 0 const char *file; @@ -117,15 +117,15 @@ image_changed_cb(PurpleSmiley *smiley, gpointer dontcare, file = purple_imgstore_get_filename(purple_smiley_get_stored_image(smiley)); gtksmiley->file = g_build_filename(purple_smileys_get_storing_dir(), file, NULL); - gtk_webview_smiley_reload(gtksmiley); + pidgin_webview_smiley_reload(gtksmiley); #else purple_debug_fatal("gtksmiley", "image_changed_cb not implemented"); #endif } -static GtkWebViewSmiley *smiley_purple_to_gtkwebview(PurpleSmiley *smiley) +static PidginWebViewSmiley *smiley_purple_to_gtkwebview(PurpleSmiley *smiley) { - GtkWebViewSmiley *gtksmiley; + PidginWebViewSmiley *gtksmiley; gchar *filename; const gchar *file; @@ -133,12 +133,12 @@ static GtkWebViewSmiley *smiley_purple_to_gtkwebview(PurpleSmiley *smiley) filename = g_build_filename(purple_smileys_get_storing_dir(), file, NULL); - gtksmiley = gtk_webview_smiley_create(filename, + gtksmiley = pidgin_webview_smiley_create(filename, purple_smiley_get_shortcut(smiley), FALSE, - GTK_WEBVIEW_SMILEY_CUSTOM); + PIDGIN_WEBVIEW_SMILEY_CUSTOM); g_free(filename); - /* Make sure the shortcut for the GtkWebViewSmiley is updated with + /* Make sure the shortcut for the PidginWebViewSmiley is updated with * the PurpleSmiley */ g_signal_connect(G_OBJECT(smiley), "notify::shortcut", G_CALLBACK(shortcut_changed_cb), gtksmiley); @@ -153,7 +153,7 @@ static GtkWebViewSmiley *smiley_purple_to_gtkwebview(PurpleSmiley *smiley) void pidgin_smiley_del_from_list(PurpleSmiley *smiley) { GSList *list = NULL; - GtkWebViewSmiley *gtksmiley; + PidginWebViewSmiley *gtksmiley; if (gtk_smileys == NULL) return; @@ -161,15 +161,15 @@ void pidgin_smiley_del_from_list(PurpleSmiley *smiley) list = gtk_smileys; for (; list; list = list->next) { - gtksmiley = (GtkWebViewSmiley*)list->data; + gtksmiley = (PidginWebViewSmiley*)list->data; - if (strcmp(gtk_webview_smiley_get_smile(gtksmiley), + if (strcmp(pidgin_webview_smiley_get_smile(gtksmiley), purple_smiley_get_shortcut(smiley))) { continue; } - gtk_webview_smiley_destroy(gtksmiley); + pidgin_webview_smiley_destroy(gtksmiley); g_signal_handlers_disconnect_matched(G_OBJECT(smiley), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gtksmiley); break; @@ -181,7 +181,7 @@ void pidgin_smiley_del_from_list(PurpleSmiley *smiley) void pidgin_smiley_add_to_list(PurpleSmiley *smiley) { - GtkWebViewSmiley *gtksmiley; + PidginWebViewSmiley *gtksmiley; gtksmiley = smiley_purple_to_gtkwebview(smiley); add_gtkwebview_to_list(gtksmiley); @@ -208,7 +208,7 @@ void pidgin_smileys_init(void) void pidgin_smileys_uninit(void) { GSList *list; - GtkWebViewSmiley *gtksmiley; + PidginWebViewSmiley *gtksmiley; list = gtk_smileys; @@ -216,8 +216,8 @@ void pidgin_smileys_uninit(void) return; for (; list; list = g_slist_delete_link(list, list)) { - gtksmiley = (GtkWebViewSmiley*)list->data; - gtk_webview_smiley_destroy(gtksmiley); + gtksmiley = (PidginWebViewSmiley*)list->data; + pidgin_webview_smiley_destroy(gtksmiley); } gtk_smileys = NULL; diff --git a/pidgin/gtksmiley.h b/pidgin/gtksmiley.h index f7e5026ae1..c36b08987d 100644 --- a/pidgin/gtksmiley.h +++ b/pidgin/gtksmiley.h @@ -38,7 +38,7 @@ G_BEGIN_DECLS * pidgin_smiley_add_to_list: * @smiley: The smiley to be added. * - * Add a PurpleSmiley to the GtkWebViewSmiley's list to be able to use it + * Add a PurpleSmiley to the PidginWebViewSmiley's list to be able to use it * in pidgin */ void pidgin_smiley_add_to_list(PurpleSmiley *smiley); @@ -47,30 +47,30 @@ void pidgin_smiley_add_to_list(PurpleSmiley *smiley); * pidgin_smiley_del_from_list: * @smiley: The smiley to be deleted. * - * Delete a PurpleSmiley from the GtkWebViewSmiley's list + * Delete a PurpleSmiley from the PidginWebViewSmiley's list */ void pidgin_smiley_del_from_list(PurpleSmiley *smiley); /** * pidgin_smileys_init: * - * Load the GtkWebViewSmiley list + * Load the PidginWebViewSmiley list */ void pidgin_smileys_init(void); /** * pidgin_smileys_uninit: * - * Uninit the GtkWebViewSmiley list + * Uninit the PidginWebViewSmiley list */ void pidgin_smileys_uninit(void); /** * pidgin_smileys_get_all: * - * Returns a GSList with the GtkWebViewSmiley of each custom smiley + * Returns a GSList with the PidginWebViewSmiley of each custom smiley * - * Returns: (transfer none): A GtkWebViewSmiley list + * Returns: (transfer none): A PidginWebViewSmiley list */ GSList *pidgin_smileys_get_all(void); diff --git a/pidgin/gtkstatusbox.c b/pidgin/gtkstatusbox.c index 6234a3f149..a087ad68db 100644 --- a/pidgin/gtkstatusbox.c +++ b/pidgin/gtkstatusbox.c @@ -60,8 +60,8 @@ /* Timeout for typing notifications in seconds */ #define TYPING_TIMEOUT 4 -static void webview_changed_cb(GtkWebView *webview, void *data); -static void webview_format_changed_cb(GtkWebView *webview, GtkWebViewButtons buttons, void *data); +static void webview_changed_cb(PidginWebView *webview, void *data); +static void webview_format_changed_cb(PidginWebView *webview, PidginWebViewButtons buttons, void *data); static void remove_typing_cb(PidginStatusBox *box); static void update_size (PidginStatusBox *box); static gint get_statusbox_index(PidginStatusBox *box, PurpleSavedStatus *saved_status); @@ -264,8 +264,8 @@ update_to_reflect_account_status(PidginStatusBox *status_box, PurpleAccount *acc #if 0 /* TODO WebKit: Doesn't do this? */ - gtk_webview_set_populate_primary_clipboard( - GTK_WEBVIEW(status_box->webview), TRUE); + pidgin_webview_set_populate_primary_clipboard( + PIDGIN_WEBVIEW(status_box->webview), TRUE); #endif if (status_no != -1) { @@ -288,7 +288,7 @@ update_to_reflect_account_status(PidginStatusBox *status_box, PurpleAccount *acc { gtk_widget_show_all(status_box->vbox); status_box->webview_visible = TRUE; - gtk_webview_load_html_string(GTK_WEBVIEW(status_box->webview), message); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(status_box->webview), message); } gtk_widget_set_sensitive(GTK_WIDGET(status_box), TRUE); pidgin_status_box_refresh(status_box); @@ -878,8 +878,8 @@ status_menu_refresh_iter(PidginStatusBox *status_box, gboolean status_changed) */ gtk_widget_set_sensitive(GTK_WIDGET(status_box->webview), FALSE); - gtk_webview_load_html_string(GTK_WEBVIEW(status_box->webview), ""); - gtk_webview_clear_formatting(GTK_WEBVIEW(status_box->webview)); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(status_box->webview), ""); + pidgin_webview_clear_formatting(PIDGIN_WEBVIEW(status_box->webview)); if (!purple_savedstatus_is_transient(saved_status) || !message || !*message) { @@ -891,7 +891,7 @@ status_menu_refresh_iter(PidginStatusBox *status_box, gboolean status_changed) status_box->webview_visible = TRUE; gtk_widget_show_all(status_box->vbox); - gtk_webview_load_html_string(GTK_WEBVIEW(status_box->webview), message); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(status_box->webview), message); } gtk_widget_set_sensitive(GTK_WIDGET(status_box->webview), TRUE); @@ -1072,19 +1072,19 @@ pidgin_status_box_regenerate(PidginStatusBox *status_box, gboolean status_change } static gboolean -combo_box_scroll_event_cb(GtkWidget *w, GdkEventScroll *event, GtkWebView *webview) +combo_box_scroll_event_cb(GtkWidget *w, GdkEventScroll *event, PidginWebView *webview) { pidgin_status_box_popup(PIDGIN_STATUS_BOX(w), (GdkEvent *)event); return TRUE; } static gboolean -webview_scroll_event_cb(GtkWidget *w, GdkEventScroll *event, GtkWebView *webview) +webview_scroll_event_cb(GtkWidget *w, GdkEventScroll *event, PidginWebView *webview) { if (event->direction == GDK_SCROLL_UP) - gtk_webview_page_up(webview); + pidgin_webview_page_up(webview); else if (event->direction == GDK_SCROLL_DOWN) - gtk_webview_page_down(webview); + pidgin_webview_page_down(webview); return TRUE; } @@ -1114,8 +1114,8 @@ webview_remove_focus(GtkWidget *w, GdkEventKey *event, PidginStatusBox *status_b status_box->typing = 0; #if 0 /* TODO WebKit: Doesn't do this? */ - gtk_webview_set_populate_primary_clipboard( - GTK_WEBVIEW(status_box->webview), TRUE); + pidgin_webview_set_populate_primary_clipboard( + PIDGIN_WEBVIEW(status_box->webview), TRUE); #endif if (status_box->account != NULL) update_to_reflect_account_status(status_box, status_box->account, @@ -1217,7 +1217,7 @@ spellcheck_prefs_cb(const char *name, PurplePrefType type, { PidginStatusBox *status_box = (PidginStatusBox *)data; - pidgin_webview_set_spellcheck(GTK_WEBVIEW(status_box->webview), + pidgin_webview_set_spellcheck(PIDGIN_WEBVIEW(status_box->webview), (gboolean)GPOINTER_TO_INT(value)); } @@ -1677,7 +1677,7 @@ treeview_key_press_event(GtkWidget *widget, } static void -webview_cursor_moved_cb(gpointer data, GtkWebView *webview) +webview_cursor_moved_cb(gpointer data, PidginWebView *webview) { /* Restart the typing timeout if arrow keys are pressed while editing the message */ PidginStatusBox *status_box = data; @@ -1832,7 +1832,7 @@ pidgin_status_box_init (PidginStatusBox *status_box) status_box->vbox = gtk_vbox_new(0, FALSE); status_box->sw = pidgin_create_webview(TRUE, &status_box->webview, NULL); - gtk_webview_hide_toolbar(GTK_WEBVIEW(status_box->webview)); + pidgin_webview_hide_toolbar(PIDGIN_WEBVIEW(status_box->webview)); #if 0 g_signal_connect(G_OBJECT(status_box->toggle_button), "button-press-event", @@ -1854,7 +1854,7 @@ pidgin_status_box_init (PidginStatusBox *status_box) G_CALLBACK(webview_remove_focus), status_box); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck")) - pidgin_webview_set_spellcheck(GTK_WEBVIEW(status_box->webview), TRUE); + pidgin_webview_set_spellcheck(PIDGIN_WEBVIEW(status_box->webview), TRUE); gtk_widget_set_parent(status_box->vbox, GTK_WIDGET(status_box)); gtk_widget_show_all(status_box->vbox); @@ -2634,8 +2634,8 @@ static void remove_typing_cb(PidginStatusBox *status_box) #if 0 /* TODO WebKit: Doesn't do this? */ - gtk_webview_set_populate_primary_clipboard( - GTK_WEBVIEW(status_box->webview), TRUE); + pidgin_webview_set_populate_primary_clipboard( + PIDGIN_WEBVIEW(status_box->webview), TRUE); #endif purple_timeout_remove(status_box->typing); @@ -2741,8 +2741,8 @@ static void pidgin_status_box_changed(PidginStatusBox *status_box) gtk_widget_grab_focus(status_box->webview); #if 0 /* TODO WebKit: Doesn't do this? */ - gtk_webview_set_populate_primary_clipboard( - GTK_WEBVIEW(status_box->webview), FALSE); + pidgin_webview_set_populate_primary_clipboard( + PIDGIN_WEBVIEW(status_box->webview), FALSE); #endif webkit_web_view_select_all(WEBKIT_WEB_VIEW(status_box->webview)); @@ -2783,7 +2783,7 @@ get_statusbox_index(PidginStatusBox *box, PurpleSavedStatus *saved_status) } static void -webview_changed_cb(GtkWebView *webview, void *data) +webview_changed_cb(PidginWebView *webview, void *data) { PidginStatusBox *status_box = (PidginStatusBox*)data; if (gtk_widget_get_sensitive(GTK_WIDGET(status_box))) @@ -2798,7 +2798,7 @@ webview_changed_cb(GtkWebView *webview, void *data) } static void -webview_format_changed_cb(GtkWebView *webview, GtkWebViewButtons buttons, void *data) +webview_format_changed_cb(PidginWebView *webview, PidginWebViewButtons buttons, void *data) { webview_changed_cb(NULL, data); } @@ -2806,7 +2806,7 @@ webview_format_changed_cb(GtkWebView *webview, GtkWebViewButtons buttons, void * char *pidgin_status_box_get_message(PidginStatusBox *status_box) { if (status_box->webview_visible) - return g_strstrip(gtk_webview_get_body_text(GTK_WEBVIEW(status_box->webview))); + return g_strstrip(pidgin_webview_get_body_text(PIDGIN_WEBVIEW(status_box->webview))); else return NULL; } diff --git a/pidgin/gtkthemes.c b/pidgin/gtkthemes.c index fe59248b4b..961bc4c0cb 100644 --- a/pidgin/gtkthemes.c +++ b/pidgin/gtkthemes.c @@ -35,9 +35,9 @@ #include "gtkwebview.h" GSList *smiley_themes = NULL; -struct smiley_theme *current_smiley_theme; +struct PidginSmileyTheme *current_smiley_theme; -static void pidgin_themes_destroy_smiley_theme_smileys(struct smiley_theme *theme); +static void pidgin_themes_destroy_smiley_theme_smileys(struct PidginSmileyTheme *theme); gboolean pidgin_themes_smileys_disabled() { @@ -48,7 +48,7 @@ gboolean pidgin_themes_smileys_disabled() } static void -pidgin_themes_destroy_smiley_theme(struct smiley_theme *theme) +pidgin_themes_destroy_smiley_theme(struct PidginSmileyTheme *theme) { pidgin_themes_destroy_smiley_theme_smileys(theme); @@ -89,7 +89,7 @@ void pidgin_themes_remove_smiley_theme(const char *file) if ((last_slash = g_strrstr(theme_dir, G_DIR_SEPARATOR_S)) != NULL) { GSList *iter = NULL; - struct smiley_theme *theme = NULL, *new_theme = NULL; + struct PidginSmileyTheme *theme = NULL, *new_theme = NULL; *last_slash = 0; @@ -98,13 +98,13 @@ void pidgin_themes_remove_smiley_theme(const char *file) /* Find theme in themes list and remove it */ for (iter = smiley_themes ; iter ; iter = iter->next) { - theme = ((struct smiley_theme *)(iter->data)); + theme = ((struct PidginSmileyTheme *)(iter->data)); if (!strcmp(theme->path, file)) break ; } if (iter) { if (theme == current_smiley_theme) { - new_theme = ((struct smiley_theme *)(NULL == iter->next ? (smiley_themes == iter ? NULL : smiley_themes->data) : iter->next->data)); + new_theme = ((struct PidginSmileyTheme *)(NULL == iter->next ? (smiley_themes == iter ? NULL : smiley_themes->data) : iter->next->data)); if (new_theme) purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", new_theme->name); else @@ -122,17 +122,17 @@ void pidgin_themes_remove_smiley_theme(const char *file) static void _pidgin_themes_smiley_themeize(GtkWidget *webview, gboolean custom) { - struct smiley_list *list; + struct PidginSmileyList *list; if (!current_smiley_theme) return; - gtk_webview_remove_smileys(GTK_WEBVIEW(webview)); + pidgin_webview_remove_smileys(PIDGIN_WEBVIEW(webview)); list = current_smiley_theme->list; while (list) { char *sml = !strcmp(list->sml, "default") ? NULL : list->sml; GSList *icons = list->smileys; while (icons) { - gtk_webview_associate_smiley(GTK_WEBVIEW(webview), sml, icons->data); + pidgin_webview_associate_smiley(PIDGIN_WEBVIEW(webview), sml, icons->data); icons = icons->next; } @@ -140,7 +140,7 @@ static void _pidgin_themes_smiley_themeize(GtkWidget *webview, gboolean custom) icons = pidgin_smileys_get_all(); while (icons) { - gtk_webview_associate_smiley(GTK_WEBVIEW(webview), sml, icons->data); + pidgin_webview_associate_smiley(PIDGIN_WEBVIEW(webview), sml, icons->data); icons = icons->next; } } @@ -162,14 +162,14 @@ pidgin_themes_smiley_themeize_custom(GtkWidget *webview) } static void -pidgin_themes_destroy_smiley_theme_smileys(struct smiley_theme *theme) +pidgin_themes_destroy_smiley_theme_smileys(struct PidginSmileyTheme *theme) { - struct smiley_list *wer; + struct PidginSmileyList *wer; for (wer = theme->list; wer != NULL; wer = theme->list) { while (wer->smileys) { - GtkWebViewSmiley *uio = wer->smileys->data; - gtk_webview_smiley_destroy(uio); + PidginWebViewSmiley *uio = wer->smileys->data; + pidgin_webview_smiley_destroy(uio); wer->smileys = g_slist_delete_link(wer->smileys, wer->smileys); } theme->list = wer->next; @@ -182,16 +182,16 @@ pidgin_themes_destroy_smiley_theme_smileys(struct smiley_theme *theme) static void pidgin_smiley_themes_remove_non_existing(void) { - static struct smiley_theme *theme = NULL; + static struct PidginSmileyTheme *theme = NULL; GSList *iter = NULL; if (!smiley_themes) return ; for (iter = smiley_themes ; iter ; iter = iter->next) { - theme = ((struct smiley_theme *)(iter->data)); + theme = ((struct PidginSmileyTheme *)(iter->data)); if (!g_file_test(theme->path, G_FILE_TEST_EXISTS)) { if (theme == current_smiley_theme) - current_smiley_theme = ((struct smiley_theme *)(NULL == iter->next ? NULL : iter->next->data)); + current_smiley_theme = ((struct PidginSmileyTheme *)(NULL == iter->next ? NULL : iter->next->data)); pidgin_themes_destroy_smiley_theme(theme); iter->data = NULL; } @@ -200,7 +200,7 @@ pidgin_smiley_themes_remove_non_existing(void) smiley_themes = g_slist_remove_all(smiley_themes, NULL); if (!current_smiley_theme && smiley_themes) { - struct smiley_theme *smile = g_slist_last(smiley_themes)->data; + struct PidginSmileyTheme *smile = g_slist_last(smiley_themes)->data; pidgin_themes_load_smiley_theme(smile->path, TRUE); } } @@ -211,8 +211,8 @@ void pidgin_themes_load_smiley_theme(const char *file, gboolean load) char buf[256]; char *i; gsize line_nbr = 0; - struct smiley_theme *theme=NULL; - struct smiley_list *list = NULL; + struct PidginSmileyTheme *theme=NULL; + struct PidginSmileyList *list = NULL; GSList *lst = smiley_themes; char *dirname; @@ -220,7 +220,7 @@ void pidgin_themes_load_smiley_theme(const char *file, gboolean load) return; while (lst) { - struct smiley_theme *thm = lst->data; + struct PidginSmileyTheme *thm = lst->data; if (!strcmp(thm->path, file)) { theme = thm; break; @@ -235,7 +235,7 @@ void pidgin_themes_load_smiley_theme(const char *file, gboolean load) } if (theme == NULL) { - theme = g_new0(struct smiley_theme, 1); + theme = g_new0(struct PidginSmileyTheme, 1); theme->path = g_strdup(file); smiley_themes = g_slist_prepend(smiley_themes, theme); } @@ -268,7 +268,7 @@ void pidgin_themes_load_smiley_theme(const char *file, gboolean load) i++; if (*i == '[' && strchr(i, ']') && load) { - struct smiley_list *child = g_new0(struct smiley_list, 1); + struct PidginSmileyList *child = g_new0(struct PidginSmileyList, 1); child->sml = g_strndup(i+1, strchr(i, ']') - i - 1); child->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); @@ -318,7 +318,7 @@ void pidgin_themes_load_smiley_theme(const char *file, gboolean load) if (!sfile) { sfile = g_build_filename(dirname, l, NULL); } else { - GtkWebViewSmiley *smiley = gtk_webview_smiley_create(sfile, l, hidden, 0); + PidginWebViewSmiley *smiley = pidgin_webview_smiley_create(sfile, l, hidden, 0); list->smileys = g_slist_prepend(list->smileys, smiley); g_hash_table_insert (list->files, g_strdup(l), g_strdup(sfile)); } @@ -403,14 +403,14 @@ void pidgin_themes_smiley_theme_probe() } if (!current_smiley_theme && smiley_themes) { - struct smiley_theme *smile = smiley_themes->data; + struct PidginSmileyTheme *smile = smiley_themes->data; pidgin_themes_load_smiley_theme(smile->path, TRUE); } } GSList *pidgin_themes_get_proto_smileys(const char *id) { PurplePlugin *proto; - struct smiley_list *list, *def; + struct PidginSmileyList *list, *def; if ((current_smiley_theme == NULL) || (current_smiley_theme->list == NULL)) return NULL; @@ -443,7 +443,7 @@ void pidgin_themes_init() pidgin_themes_smiley_theme_probe(); for (l = smiley_themes; l; l = l->next) { - struct smiley_theme *smile = l->data; + struct PidginSmileyTheme *smile = l->data; if (smile->name && strcmp(current_theme, smile->name) == 0) { pidgin_themes_load_smiley_theme(smile->path, TRUE); break; @@ -452,7 +452,7 @@ void pidgin_themes_init() /* If we still don't have a smiley theme, choose the first one */ if (!current_smiley_theme && smiley_themes) { - struct smiley_theme *smile = smiley_themes->data; + struct PidginSmileyTheme *smile = smiley_themes->data; pidgin_themes_load_smiley_theme(smile->path, TRUE); } } diff --git a/pidgin/gtkthemes.h b/pidgin/gtkthemes.h index bcb1700320..a94f0f518f 100644 --- a/pidgin/gtkthemes.h +++ b/pidgin/gtkthemes.h @@ -28,24 +28,24 @@ * @title: Smiley Theme API */ -struct smiley_list { +struct PidginSmileyList { char *sml; GSList *smileys; GHashTable *files; /* map from smiley shortcut to filename */ - struct smiley_list *next; + struct PidginSmileyList *next; }; -struct smiley_theme { +struct PidginSmileyTheme { char *path; char *name; char *desc; char *icon; char *author; - struct smiley_list *list; + struct PidginSmileyList *list; }; -extern struct smiley_theme *current_smiley_theme; +extern struct PidginSmileyTheme *current_smiley_theme; extern GSList *smiley_themes; G_BEGIN_DECLS diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c index 70ba7e418c..88cde5a191 100644 --- a/pidgin/gtkutils.c +++ b/pidgin/gtkutils.c @@ -90,7 +90,7 @@ url_clicked_idle_cb(gpointer data) } static gboolean -url_clicked_cb(GtkWebView *unused, const char *uri) +url_clicked_cb(PidginWebView *unused, const char *uri) { g_idle_add(url_clicked_idle_cb, g_strdup(uri)); return TRUE; @@ -227,7 +227,7 @@ pidgin_create_webview(gboolean editable, GtkWidget **webview_ret, GtkWidget **sw gtk_widget_show(vbox); if (editable) { - toolbar = gtk_webviewtoolbar_new(); + toolbar = pidgin_webviewtoolbar_new(); gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); gtk_widget_show(toolbar); @@ -238,22 +238,22 @@ pidgin_create_webview(gboolean editable, GtkWidget **webview_ret, GtkWidget **sw gtk_widget_show(sep); } - webview = gtk_webview_new(editable); + webview = pidgin_webview_new(editable); if (editable && purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck")) - pidgin_webview_set_spellcheck(GTK_WEBVIEW(webview), TRUE); + pidgin_webview_set_spellcheck(PIDGIN_WEBVIEW(webview), TRUE); gtk_widget_show(webview); if (editable) { - gtk_webviewtoolbar_attach(GTK_WEBVIEWTOOLBAR(toolbar), webview); - gtk_webviewtoolbar_associate_smileys(GTK_WEBVIEWTOOLBAR(toolbar), "default"); - gtk_webview_set_toolbar(GTK_WEBVIEW(webview), toolbar); + pidgin_webviewtoolbar_attach(PIDGIN_WEBVIEWTOOLBAR(toolbar), webview); + pidgin_webviewtoolbar_associate_smileys(PIDGIN_WEBVIEWTOOLBAR(toolbar), "default"); + pidgin_webview_set_toolbar(PIDGIN_WEBVIEW(webview), toolbar); } pidgin_setup_webview(webview); sw = pidgin_make_scrollable(webview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1); gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); - gtk_webview_set_vadjustment(GTK_WEBVIEW(webview), + pidgin_webview_set_vadjustment(PIDGIN_WEBVIEW(webview), gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw))); if (webview_ret != NULL) @@ -1406,7 +1406,7 @@ static void dnd_image_ok_callback(_DndData *data, int choice) shortname = shortname ? shortname + 1 : data->filename; id = purple_imgstore_new_with_id(filedata, size, shortname); - gtk_webview_insert_image(GTK_WEBVIEW(gtkconv->entry), id); + pidgin_webview_insert_image(PIDGIN_WEBVIEW(gtkconv->entry), id); purple_imgstore_unref_by_id(id); break; @@ -1567,7 +1567,7 @@ pidgin_dnd_file_manage(GtkSelectionData *sd, PurpleAccount *account, const char case PURPLE_DESKTOP_ITEM_TYPE_LINK: conv = PURPLE_CONVERSATION(purple_im_conversation_new(account, who)); gtkconv = PIDGIN_CONVERSATION(conv); - gtk_webview_insert_link(GTK_WEBVIEW(gtkconv->entry), + pidgin_webview_insert_link(PIDGIN_WEBVIEW(gtkconv->entry), purple_desktop_item_get_string(item, "URL"), itemname); break; @@ -3163,7 +3163,7 @@ url_copy(GtkWidget *w, gchar *url) } static gboolean -link_context_menu(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) +link_context_menu(PidginWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) { GtkWidget *img, *item; char *url; @@ -3175,7 +3175,7 @@ link_context_menu(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidg item = gtk_image_menu_item_new_with_mnemonic(_("_Open Link")); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img); g_signal_connect_swapped(G_OBJECT(item), "activate", - G_CALLBACK(gtk_webview_activate_anchor), link); + G_CALLBACK(pidgin_webview_activate_anchor), link); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); /* Copy Link Location */ @@ -3191,7 +3191,7 @@ link_context_menu(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidg } static gboolean -copy_email_address(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) +copy_email_address(PidginWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) { GtkWidget *img, *item; char *text; @@ -3224,7 +3224,7 @@ copy_email_address(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWid * from a link in an IM window with the leading "file://" removed. */ static void -open_file(GtkWebView *webview, const char *filename) +open_file(PidginWebView *webview, const char *filename) { /* Copied from gtkft.c:open_button_cb */ #ifdef _WIN32 @@ -3307,7 +3307,7 @@ open_file(GtkWebView *webview, const char *filename) #define FILELINKSIZE (sizeof("file://") - 1) static gboolean -file_clicked_cb(GtkWebView *webview, const char *uri) +file_clicked_cb(PidginWebView *webview, const char *uri) { /* Strip "file://" from the URI. */ open_file(webview, uri + FILELINKSIZE); @@ -3315,7 +3315,7 @@ file_clicked_cb(GtkWebView *webview, const char *uri) } static gboolean -open_containing_cb(GtkWebView *webview, const char *uri) +open_containing_cb(PidginWebView *webview, const char *uri) { char *dir = g_path_get_dirname(uri + FILELINKSIZE); open_file(webview, dir); @@ -3324,7 +3324,7 @@ open_containing_cb(GtkWebView *webview, const char *uri) } static gboolean -file_context_menu(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) +file_context_menu(PidginWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) { GtkWidget *img, *item; char *url; @@ -3336,7 +3336,7 @@ file_context_menu(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidg item = gtk_image_menu_item_new_with_mnemonic(_("_Open File")); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img); g_signal_connect_swapped(G_OBJECT(item), "activate", - G_CALLBACK(gtk_webview_activate_anchor), link); + G_CALLBACK(pidgin_webview_activate_anchor), link); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); /* Open Containing Directory */ @@ -3354,7 +3354,7 @@ file_context_menu(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidg #define AUDIOLINKSIZE (sizeof("audio://") - 1) static gboolean -audio_clicked_cb(GtkWebView *webview, const char *uri) +audio_clicked_cb(PidginWebView *webview, const char *uri) { PidginConversation *conv = g_object_get_data(G_OBJECT(webview), "gtkconv"); if (!conv) /* no playback in debug window */ @@ -3402,7 +3402,7 @@ save_file_cb(GtkWidget *item, const char *url) } static gboolean -audio_context_menu(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) +audio_context_menu(PidginWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) { GtkWidget *img, *item; char *url; @@ -3417,7 +3417,7 @@ audio_context_menu(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWid item = gtk_image_menu_item_new_with_mnemonic(_("_Play Sound")); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img); g_signal_connect_swapped(G_OBJECT(item), "activate", - G_CALLBACK(gtk_webview_activate_anchor), link); + G_CALLBACK(pidgin_webview_activate_anchor), link); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); /* Save File */ @@ -3437,7 +3437,7 @@ audio_context_menu(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWid /* XXX: The following two functions are for demonstration purposes only! */ static gboolean -open_dialog(GtkWebView *webview, const char *url) +open_dialog(PidginWebView *webview, const char *url) { const char *str; @@ -3457,7 +3457,7 @@ open_dialog(GtkWebView *webview, const char *url) } static gboolean -dummy(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) +dummy(PidginWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu) { return TRUE; } @@ -3522,7 +3522,7 @@ register_gnome_url_handlers(void) protocol = g_strdup_printf("%s:", start); registered_url_handlers = g_slist_prepend(registered_url_handlers, protocol); - gtk_webview_class_register_protocol(protocol, url_clicked_cb, link_context_menu); + pidgin_webview_class_register_protocol(protocol, url_clicked_cb, link_context_menu); } start = c + 1; } @@ -3555,7 +3555,7 @@ winpidgin_register_win32_url_handlers(void) g_free(utf8); registered_url_handlers = g_slist_prepend(registered_url_handlers, protocol); /* We still pass everything to the "http" "open" handler for security reasons */ - gtk_webview_class_register_protocol(protocol, url_clicked_cb, link_context_menu); + pidgin_webview_class_register_protocol(protocol, url_clicked_cb, link_context_menu); } RegCloseKey(reg_key); } @@ -3598,17 +3598,17 @@ pidgin_make_scrollable(GtkWidget *child, GtkPolicyType hscrollbar_policy, GtkPol void pidgin_utils_init(void) { - gtk_webview_class_register_protocol("http://", url_clicked_cb, link_context_menu); - gtk_webview_class_register_protocol("https://", url_clicked_cb, link_context_menu); - gtk_webview_class_register_protocol("ftp://", url_clicked_cb, link_context_menu); - gtk_webview_class_register_protocol("gopher://", url_clicked_cb, link_context_menu); - gtk_webview_class_register_protocol("mailto:", url_clicked_cb, copy_email_address); + pidgin_webview_class_register_protocol("http://", url_clicked_cb, link_context_menu); + pidgin_webview_class_register_protocol("https://", url_clicked_cb, link_context_menu); + pidgin_webview_class_register_protocol("ftp://", url_clicked_cb, link_context_menu); + pidgin_webview_class_register_protocol("gopher://", url_clicked_cb, link_context_menu); + pidgin_webview_class_register_protocol("mailto:", url_clicked_cb, copy_email_address); - gtk_webview_class_register_protocol("file://", file_clicked_cb, file_context_menu); - gtk_webview_class_register_protocol("audio://", audio_clicked_cb, audio_context_menu); + pidgin_webview_class_register_protocol("file://", file_clicked_cb, file_context_menu); + pidgin_webview_class_register_protocol("audio://", audio_clicked_cb, audio_context_menu); /* Example custom URL handler. */ - gtk_webview_class_register_protocol("open://", open_dialog, dummy); + pidgin_webview_class_register_protocol("open://", open_dialog, dummy); /* If we're under GNOME, try registering the system URL handlers. */ if (purple_running_gnome()) @@ -3635,7 +3635,7 @@ void pidgin_utils_init(void) void pidgin_utils_uninit(void) { - gtk_webview_class_register_protocol("open://", NULL, NULL); + pidgin_webview_class_register_protocol("open://", NULL, NULL); /* If we have GNOME handlers registered, unregister them. */ if (registered_url_handlers) @@ -3643,7 +3643,7 @@ void pidgin_utils_uninit(void) GSList *l; for (l = registered_url_handlers; l; l = l->next) { - gtk_webview_class_register_protocol((char *)l->data, NULL, NULL); + pidgin_webview_class_register_protocol((char *)l->data, NULL, NULL); g_free(l->data); } g_slist_free(registered_url_handlers); @@ -3651,12 +3651,12 @@ void pidgin_utils_uninit(void) return; } - gtk_webview_class_register_protocol("audio://", NULL, NULL); - gtk_webview_class_register_protocol("file://", NULL, NULL); + pidgin_webview_class_register_protocol("audio://", NULL, NULL); + pidgin_webview_class_register_protocol("file://", NULL, NULL); - gtk_webview_class_register_protocol("http://", NULL, NULL); - gtk_webview_class_register_protocol("https://", NULL, NULL); - gtk_webview_class_register_protocol("ftp://", NULL, NULL); - gtk_webview_class_register_protocol("mailto:", NULL, NULL); - gtk_webview_class_register_protocol("gopher://", NULL, NULL); + pidgin_webview_class_register_protocol("http://", NULL, NULL); + pidgin_webview_class_register_protocol("https://", NULL, NULL); + pidgin_webview_class_register_protocol("ftp://", NULL, NULL); + pidgin_webview_class_register_protocol("mailto:", NULL, NULL); + pidgin_webview_class_register_protocol("gopher://", NULL, NULL); } diff --git a/pidgin/gtkutils.h b/pidgin/gtkutils.h index 60dcd3f1dc..920b86da5f 100644 --- a/pidgin/gtkutils.h +++ b/pidgin/gtkutils.h @@ -101,7 +101,7 @@ void pidgin_setup_webview(GtkWidget *webview); * @sw_ret: This will be filled with a pointer to the scrolled window * widget which contains the webview. * - * Create an GtkWebView widget and associated GtkWebViewToolbar widget. This + * Create an PidginWebView widget and associated PidginWebViewToolbar widget. This * function puts both widgets in a nice GtkFrame. They're separated by an * attractive GtkSeparator. * diff --git a/pidgin/gtkwebview.c b/pidgin/gtkwebview.c index e994ed8959..6690b401b0 100644 --- a/pidgin/gtkwebview.c +++ b/pidgin/gtkwebview.c @@ -37,10 +37,10 @@ #define MAX_FONT_SIZE 7 #define MAX_SCROLL_TIME 0.4 /* seconds */ #define SCROLL_DELAY 33 /* milliseconds */ -#define GTK_WEBVIEW_MAX_PROCESS_TIME 100000 /* microseconds */ +#define PIDGIN_WEBVIEW_MAX_PROCESS_TIME 100000 /* microseconds */ -#define GTK_WEBVIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_TYPE_WEBVIEW, GtkWebViewPriv)) +#define PIDGIN_WEBVIEW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_TYPE_WEBVIEW, PidginWebViewPriv)) enum { LOAD_HTML, @@ -65,12 +65,12 @@ static guint signals[LAST_SIGNAL] = { 0 }; typedef struct { WebKitWebInspector *inspector; WebKitDOMNode *node; -} GtkWebViewInspectData; +} PidginWebViewInspectData; typedef struct { WebKitWebView *webview; gunichar ch; -} GtkWebViewInsertData; +} PidginWebViewInsertData; typedef struct { const char *label; @@ -81,19 +81,19 @@ typedef struct { char *name; int length; - gboolean (*activate)(GtkWebView *webview, const char *uri); - gboolean (*context_menu)(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu); -} GtkWebViewProtocol; + gboolean (*activate)(PidginWebView *webview, const char *uri); + gboolean (*context_menu)(PidginWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu); +} PidginWebViewProtocol; -struct _GtkWebViewSmiley { +struct _PidginWebViewSmiley { gchar *smile; gchar *file; GdkPixbufAnimation *icon; gboolean hidden; GdkPixbufLoader *loader; GSList *anchors; - GtkWebViewSmileyFlags flags; - GtkWebView *webview; + PidginWebViewSmileyFlags flags; + PidginWebView *webview; gpointer data; gsize datasize; }; @@ -102,10 +102,10 @@ typedef struct _GtkSmileyTree GtkSmileyTree; struct _GtkSmileyTree { GString *values; GtkSmileyTree **children; - GtkWebViewSmiley *image; + PidginWebViewSmiley *image; }; -typedef struct _GtkWebViewPriv { +typedef struct _PidginWebViewPriv { /* Processing queues */ gboolean is_loading; GQueue *load_queue; @@ -118,8 +118,8 @@ typedef struct _GtkWebViewPriv { GTimer *scroll_time; /* Format options */ - GtkWebViewButtons format_functions; - GtkWebViewToolbar *toolbar; + PidginWebViewButtons format_functions; + PidginWebViewToolbar *toolbar; struct { gboolean wbfo:1; /* Whole buffer formatting only. */ gboolean block_changed:1; @@ -133,7 +133,7 @@ typedef struct _GtkWebViewPriv { /* WebKit inspector */ WebKitWebView *inspector_view; GtkWindow *inspector_win; -} GtkWebViewPriv; +} PidginWebViewPriv; /****************************************************************************** * Globals @@ -146,24 +146,24 @@ static WebKitWebViewClass *parent_class = NULL; *****************************************************************************/ const char * -gtk_webview_get_protocol_name(GtkWebView *webview) +pidgin_webview_get_protocol_name(PidginWebView *webview) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_val_if_fail(webview != NULL, NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); return priv->protocol_name; } void -gtk_webview_set_protocol_name(GtkWebView *webview, const char *protocol_name) +pidgin_webview_set_protocol_name(PidginWebView *webview, const char *protocol_name) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); priv->protocol_name = g_strdup(protocol_name); } @@ -174,7 +174,7 @@ gtk_smiley_tree_new(void) } static void -gtk_smiley_tree_insert(GtkSmileyTree *tree, GtkWebViewSmiley *smiley) +gtk_smiley_tree_insert(GtkSmileyTree *tree, PidginWebViewSmiley *smiley) { GtkSmileyTree *t = tree; const char *x = smiley->smile; @@ -227,7 +227,7 @@ gtk_smiley_tree_destroy(GtkSmileyTree *tree) } static void -gtk_smiley_tree_remove(GtkSmileyTree *tree, GtkWebViewSmiley *smiley) +gtk_smiley_tree_remove(GtkSmileyTree *tree, PidginWebViewSmiley *smiley) { GtkSmileyTree *t = tree; const gchar *x = smiley->smile; @@ -288,7 +288,7 @@ gtk_smiley_tree_lookup(GtkSmileyTree *tree, const char *text) else if (*x == '<') /* Because we're all WYSIWYG now, a '<' char should * only appear as the start of a tag. Perhaps a * safer (but costlier) check would be to call - * gtk_webview_is_tag on it */ + * pidgin_webview_is_tag on it */ break; else { alen = 1; @@ -312,16 +312,16 @@ gtk_smiley_tree_lookup(GtkSmileyTree *tree, const char *text) #endif static void -gtk_webview_disassociate_smiley_foreach(gpointer key, gpointer value, +pidgin_webview_disassociate_smiley_foreach(gpointer key, gpointer value, gpointer user_data) { GtkSmileyTree *tree = (GtkSmileyTree *)value; - GtkWebViewSmiley *smiley = (GtkWebViewSmiley *)user_data; + PidginWebViewSmiley *smiley = (PidginWebViewSmiley *)user_data; gtk_smiley_tree_remove(tree, smiley); } static void -gtk_webview_disconnect_smiley(GtkWebView *webview, GtkWebViewSmiley *smiley) +pidgin_webview_disconnect_smiley(PidginWebView *webview, PidginWebViewSmiley *smiley) { smiley->webview = NULL; g_signal_handlers_disconnect_matched(webview, G_SIGNAL_MATCH_DATA, 0, 0, @@ -329,13 +329,13 @@ gtk_webview_disconnect_smiley(GtkWebView *webview, GtkWebViewSmiley *smiley) } static void -gtk_webview_disassociate_smiley(GtkWebViewSmiley *smiley) +pidgin_webview_disassociate_smiley(PidginWebViewSmiley *smiley) { if (smiley->webview) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(smiley->webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(smiley->webview); gtk_smiley_tree_remove(priv->default_smilies, smiley); g_hash_table_foreach(priv->smiley_data, - gtk_webview_disassociate_smiley_foreach, smiley); + pidgin_webview_disassociate_smiley_foreach, smiley); g_signal_handlers_disconnect_matched(smiley->webview, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, smiley); @@ -344,16 +344,16 @@ gtk_webview_disassociate_smiley(GtkWebViewSmiley *smiley) } void -gtk_webview_associate_smiley(GtkWebView *webview, const char *sml, - GtkWebViewSmiley *smiley) +pidgin_webview_associate_smiley(PidginWebView *webview, const char *sml, + PidginWebViewSmiley *smiley) { GtkSmileyTree *tree; - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); g_return_if_fail(GTK_IS_WEBVIEW(webview)); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); if (sml == NULL) tree = priv->default_smilies; @@ -375,12 +375,12 @@ gtk_webview_associate_smiley(GtkWebView *webview, const char *sml, /* connect destroy signal for the webview */ g_signal_connect(webview, "destroy", - G_CALLBACK(gtk_webview_disconnect_smiley), smiley); + G_CALLBACK(pidgin_webview_disconnect_smiley), smiley); } #if 0 static gboolean -gtk_webview_is_smiley(GtkWebViewPriv *priv, const char *sml, const char *text, +pidgin_webview_is_smiley(PidginWebViewPriv *priv, const char *sml, const char *text, int *len) { GtkSmileyTree *tree; @@ -399,8 +399,8 @@ gtk_webview_is_smiley(GtkWebViewPriv *priv, const char *sml, const char *text, } #endif -static GtkWebViewSmiley * -gtk_webview_smiley_get_from_tree(GtkSmileyTree *t, const char *text) +static PidginWebViewSmiley * +pidgin_webview_smiley_get_from_tree(GtkSmileyTree *t, const char *text) { const char *x = text; char *pos; @@ -423,30 +423,30 @@ gtk_webview_smiley_get_from_tree(GtkSmileyTree *t, const char *text) return t->image; } -GtkWebViewSmiley * -gtk_webview_smiley_find(GtkWebView *webview, const char *sml, const char *text) +PidginWebViewSmiley * +pidgin_webview_smiley_find(PidginWebView *webview, const char *sml, const char *text) { - GtkWebViewPriv *priv; - GtkWebViewSmiley *ret; + PidginWebViewPriv *priv; + PidginWebViewSmiley *ret; g_return_val_if_fail(webview != NULL, NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); /* Look for custom smileys first */ if (sml != NULL) { - ret = gtk_webview_smiley_get_from_tree(g_hash_table_lookup(priv->smiley_data, sml), text); + ret = pidgin_webview_smiley_get_from_tree(g_hash_table_lookup(priv->smiley_data, sml), text); if (ret != NULL) return ret; } /* Fall back to check for default smileys */ - return gtk_webview_smiley_get_from_tree(priv->default_smilies, text); + return pidgin_webview_smiley_get_from_tree(priv->default_smilies, text); } #if 0 static GdkPixbufAnimation * -gtk_smiley_get_image(GtkWebViewSmiley *smiley) +gtk_smiley_get_image(PidginWebViewSmiley *smiley) { if (!smiley->icon) { if (smiley->file) { @@ -465,9 +465,9 @@ gtk_smiley_get_image(GtkWebViewSmiley *smiley) static void gtk_custom_smiley_allocated(GdkPixbufLoader *loader, gpointer user_data) { - GtkWebViewSmiley *smiley; + PidginWebViewSmiley *smiley; - smiley = (GtkWebViewSmiley *)user_data; + smiley = (PidginWebViewSmiley *)user_data; smiley->icon = gdk_pixbuf_loader_get_animation(loader); if (smiley->icon) @@ -477,12 +477,12 @@ gtk_custom_smiley_allocated(GdkPixbufLoader *loader, gpointer user_data) static void gtk_custom_smiley_closed(GdkPixbufLoader *loader, gpointer user_data) { - GtkWebViewSmiley *smiley; + PidginWebViewSmiley *smiley; GtkWidget *icon = NULL; GtkTextChildAnchor *anchor = NULL; GSList *current = NULL; - smiley = (GtkWebViewSmiley *)user_data; + smiley = (PidginWebViewSmiley *)user_data; if (!smiley->webview) { g_object_unref(G_OBJECT(loader)); smiley->loader = NULL; @@ -549,22 +549,22 @@ gtk_custom_smiley_size_prepared(GdkPixbufLoader *loader, gint width, gint height gdk_pixbuf_loader_set_size(loader, width, height); } -GtkWebViewSmiley * -gtk_webview_smiley_create(const char *file, const char *shortcut, gboolean hide, - GtkWebViewSmileyFlags flags) +PidginWebViewSmiley * +pidgin_webview_smiley_create(const char *file, const char *shortcut, gboolean hide, + PidginWebViewSmileyFlags flags) { - GtkWebViewSmiley *smiley = g_new0(GtkWebViewSmiley, 1); + PidginWebViewSmiley *smiley = g_new0(PidginWebViewSmiley, 1); smiley->file = g_strdup(file); smiley->smile = g_strdup(shortcut); smiley->hidden = hide; smiley->flags = flags; smiley->webview = NULL; - gtk_webview_smiley_reload(smiley); + pidgin_webview_smiley_reload(smiley); return smiley; } void -gtk_webview_smiley_reload(GtkWebViewSmiley *smiley) +pidgin_webview_smiley_reload(PidginWebViewSmiley *smiley) { if (smiley->icon) g_object_unref(smiley->icon); @@ -592,33 +592,33 @@ gtk_webview_smiley_reload(GtkWebViewSmiley *smiley) } const char * -gtk_webview_smiley_get_smile(const GtkWebViewSmiley *smiley) +pidgin_webview_smiley_get_smile(const PidginWebViewSmiley *smiley) { return smiley->smile; } const char * -gtk_webview_smiley_get_file(const GtkWebViewSmiley *smiley) +pidgin_webview_smiley_get_file(const PidginWebViewSmiley *smiley) { return smiley->file; } gboolean -gtk_webview_smiley_get_hidden(const GtkWebViewSmiley *smiley) +pidgin_webview_smiley_get_hidden(const PidginWebViewSmiley *smiley) { return smiley->hidden; } -GtkWebViewSmileyFlags -gtk_webview_smiley_get_flags(const GtkWebViewSmiley *smiley) +PidginWebViewSmileyFlags +pidgin_webview_smiley_get_flags(const PidginWebViewSmiley *smiley) { return smiley->flags; } void -gtk_webview_smiley_destroy(GtkWebViewSmiley *smiley) +pidgin_webview_smiley_destroy(PidginWebViewSmiley *smiley) { - gtk_webview_disassociate_smiley(smiley); + pidgin_webview_disassociate_smiley(smiley); g_free(smiley->smile); g_free(smiley->file); if (smiley->icon) @@ -630,13 +630,13 @@ gtk_webview_smiley_destroy(GtkWebViewSmiley *smiley) } void -gtk_webview_remove_smileys(GtkWebView *webview) +pidgin_webview_remove_smileys(PidginWebView *webview) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); g_hash_table_destroy(priv->smiley_data); gtk_smiley_tree_destroy(priv->default_smilies); @@ -646,29 +646,29 @@ gtk_webview_remove_smileys(GtkWebView *webview) } void -gtk_webview_insert_smiley(GtkWebView *webview, const char *sml, +pidgin_webview_insert_smiley(PidginWebView *webview, const char *sml, const char *smiley) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; char *unescaped; - GtkWebViewSmiley *webview_smiley; + PidginWebViewSmiley *webview_smiley; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); unescaped = purple_unescape_html(smiley); - webview_smiley = gtk_webview_smiley_find(webview, sml, unescaped); + webview_smiley = pidgin_webview_smiley_find(webview, sml, unescaped); - if (priv->format_functions & GTK_WEBVIEW_SMILEY) { + if (priv->format_functions & PIDGIN_WEBVIEW_SMILEY) { char *tmp; /* TODO Better smiley insertion... */ tmp = g_strdup_printf("<img isEmoticon src='purple-smiley:%p' alt='%s'>", webview_smiley, smiley); - gtk_webview_append_html(webview, tmp); + pidgin_webview_append_html(webview, tmp); g_free(tmp); } else { - gtk_webview_append_html(webview, smiley); + pidgin_webview_append_html(webview, smiley); } g_free(unescaped); @@ -754,9 +754,9 @@ webview_resource_loading(WebKitWebView *webview, } static void -process_load_queue_element(GtkWebView *webview) +process_load_queue_element(PidginWebView *webview) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); int type; char *str; WebKitDOMDocument *doc; @@ -825,9 +825,9 @@ process_load_queue_element(GtkWebView *webview) } static gboolean -process_load_queue(GtkWebView *webview) +process_load_queue(PidginWebView *webview) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); gint64 start_time; if (priv->is_loading) { @@ -843,7 +843,7 @@ process_load_queue(GtkWebView *webview) while (!g_queue_is_empty(priv->load_queue)) { process_load_queue_element(webview); if (g_get_monotonic_time() - start_time > - GTK_WEBVIEW_MAX_PROCESS_TIME) + PIDGIN_WEBVIEW_MAX_PROCESS_TIME) break; } @@ -858,7 +858,7 @@ static void webview_load_started(WebKitWebView *webview, WebKitWebFrame *frame, gpointer userdata) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); /* is there a better way to test for is_loading? */ priv->is_loading = TRUE; @@ -868,7 +868,7 @@ static void webview_load_finished(WebKitWebView *webview, WebKitWebFrame *frame, gpointer userdata) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); priv->is_loading = FALSE; if (priv->loader == 0) @@ -876,13 +876,13 @@ webview_load_finished(WebKitWebView *webview, WebKitWebFrame *frame, } static void -webview_inspector_inspect_element(GtkWidget *item, GtkWebViewInspectData *data) +webview_inspector_inspect_element(GtkWidget *item, PidginWebViewInspectData *data) { webkit_web_inspector_inspect_node(data->inspector, data->node); } static void -webview_inspector_destroy(GtkWindow *window, GtkWebViewPriv *priv) +webview_inspector_destroy(GtkWindow *window, PidginWebViewPriv *priv) { g_return_if_fail(priv->inspector_win == window); @@ -894,7 +894,7 @@ static WebKitWebView * webview_inspector_create(WebKitWebInspector *inspector, WebKitWebView *webview, gpointer _unused) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); if (priv->inspector_view != NULL) return priv->inspector_view; @@ -916,19 +916,19 @@ webview_inspector_create(WebKitWebInspector *inspector, static gboolean webview_inspector_show(WebKitWebInspector *inspector, GtkWidget *webview) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); gtk_widget_show_all(GTK_WIDGET(priv->inspector_win)); return TRUE; } -static GtkWebViewProtocol * +static PidginWebViewProtocol * webview_find_protocol(const char *url, gboolean reverse) { - GtkWebViewClass *klass; + PidginWebViewClass *klass; GList *iter; - GtkWebViewProtocol *proto = NULL; + PidginWebViewProtocol *proto = NULL; gssize length = reverse ? (gssize)strlen(url) : -1; klass = g_type_class_ref(GTK_TYPE_WEBVIEW); @@ -959,10 +959,10 @@ webview_navigation_decision(WebKitWebView *webview, reason = webkit_web_navigation_action_get_reason(navigation_action); if (reason == WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) { - GtkWebViewProtocol *proto = webview_find_protocol(uri, FALSE); + PidginWebViewProtocol *proto = webview_find_protocol(uri, FALSE); if (proto) { /* XXX: Do something with the return value? */ - proto->activate(GTK_WEBVIEW(webview), uri); + proto->activate(PIDGIN_WEBVIEW(webview), uri); } webkit_web_policy_decision_ignore(policy_decision); } else if (reason == WEBKIT_WEB_NAVIGATION_REASON_OTHER) @@ -1015,15 +1015,15 @@ static const GtkUnicodeMenuEntry bidi_menu_entries[] = { }; static void -insert_control_character_cb(GtkMenuItem *item, GtkWebViewInsertData *data) +insert_control_character_cb(GtkMenuItem *item, PidginWebViewInsertData *data) { WebKitWebView *webview = data->webview; gunichar ch = data->ch; - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; WebKitDOMDocument *dom; char buf[6]; - priv = GTK_WEBVIEW_GET_PRIVATE(GTK_WEBVIEW(webview)); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(PIDGIN_WEBVIEW(webview)); dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(webview)); g_unichar_to_utf8(ch, buf); @@ -1052,10 +1052,10 @@ get_unicode_menu(WebKitWebView *webview) menu = gtk_menu_new(); for (i = 0; i < G_N_ELEMENTS(bidi_menu_entries); i++) { - GtkWebViewInsertData *data; + PidginWebViewInsertData *data; GtkWidget *item; - data = g_new0(GtkWebViewInsertData, 1); + data = g_new0(PidginWebViewInsertData, 1); data->webview = webview; data->ch = bidi_menu_entries[i].ch; @@ -1085,7 +1085,7 @@ do_popup_menu(WebKitWebView *webview, int button, int time, int context, if ((context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK) && !(context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION)) { - GtkWebViewProtocol *proto = NULL; + PidginWebViewProtocol *proto = NULL; GList *children; while (node && !WEBKIT_DOM_IS_HTML_ANCHOR_ELEMENT(node)) { @@ -1096,7 +1096,7 @@ do_popup_menu(WebKitWebView *webview, int button, int time, int context, proto = webview_find_protocol(uri, FALSE); if (proto && proto->context_menu) { - proto->context_menu(GTK_WEBVIEW(webview), + proto->context_menu(PIDGIN_WEBVIEW(webview), WEBKIT_DOM_HTML_ANCHOR_ELEMENT(node), menu); } @@ -1161,12 +1161,12 @@ do_popup_menu(WebKitWebView *webview, int button, int time, int context, { WebKitWebSettings *settings; GtkWidget *inspect; - GtkWebViewInspectData *data; + PidginWebViewInspectData *data; settings = webkit_web_view_get_settings(webview); g_object_set(G_OBJECT(settings), "enable-developer-extras", TRUE, NULL); - data = g_new0(GtkWebViewInspectData, 1); + data = g_new0(PidginWebViewInspectData, 1); data->inspector = webkit_web_view_get_inspector(webview); data->node = node; @@ -1270,7 +1270,7 @@ webview_button_pressed(WebKitWebView *webview, GdkEventButton *event) static gboolean smooth_scroll_cb(gpointer data) { - GtkWebViewPriv *priv = data; + PidginWebViewPriv *priv = data; GtkAdjustment *adj; gdouble max_val; gdouble scroll_val; @@ -1300,7 +1300,7 @@ smooth_scroll_cb(gpointer data) static gboolean scroll_idle_cb(gpointer data) { - GtkWebViewPriv *priv = data; + PidginWebViewPriv *priv = data; GtkAdjustment *adj = priv->vadj; gdouble max_val; @@ -1314,7 +1314,7 @@ scroll_idle_cb(gpointer data) } static void -emit_format_signal(GtkWebView *webview, GtkWebViewButtons buttons) +emit_format_signal(PidginWebView *webview, PidginWebViewButtons buttons) { g_object_ref(webview); g_signal_emit(webview, signals[TOGGLE_FORMAT], 0, buttons); @@ -1322,9 +1322,9 @@ emit_format_signal(GtkWebView *webview, GtkWebViewButtons buttons) } static void -do_formatting(GtkWebView *webview, const char *name, const char *value) +do_formatting(PidginWebView *webview, const char *name, const char *value) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); WebKitDOMDocument *dom; WebKitDOMDOMWindow *win; WebKitDOMDOMSelection *sel = NULL; @@ -1355,12 +1355,12 @@ do_formatting(GtkWebView *webview, const char *name, const char *value) } static void -webview_font_shrink(GtkWebView *webview) +webview_font_shrink(PidginWebView *webview) { gint fontsize; char *tmp; - fontsize = gtk_webview_get_current_fontsize(webview); + fontsize = pidgin_webview_get_current_fontsize(webview); fontsize = MAX(fontsize - 1, 1); tmp = g_strdup_printf("%d", fontsize); @@ -1369,12 +1369,12 @@ webview_font_shrink(GtkWebView *webview) } static void -webview_font_grow(GtkWebView *webview) +webview_font_grow(PidginWebView *webview) { gint fontsize; char *tmp; - fontsize = gtk_webview_get_current_fontsize(webview); + fontsize = pidgin_webview_get_current_fontsize(webview); fontsize = MIN(fontsize + 1, MAX_FONT_SIZE); tmp = g_strdup_printf("%d", fontsize); @@ -1383,7 +1383,7 @@ webview_font_grow(GtkWebView *webview) } static void -webview_clear_formatting(GtkWebView *webview) +webview_clear_formatting(PidginWebView *webview) { if (!webkit_web_view_get_editable(WEBKIT_WEB_VIEW(webview))) return; @@ -1394,29 +1394,29 @@ webview_clear_formatting(GtkWebView *webview) } static void -webview_toggle_format(GtkWebView *webview, GtkWebViewButtons buttons) +webview_toggle_format(PidginWebView *webview, PidginWebViewButtons buttons) { /* since this function is the handler for the formatting keystrokes, we need to check here that the formatting attempted is permitted */ - buttons &= gtk_webview_get_format_functions(webview); + buttons &= pidgin_webview_get_format_functions(webview); switch (buttons) { - case GTK_WEBVIEW_BOLD: + case PIDGIN_WEBVIEW_BOLD: do_formatting(webview, "bold", ""); break; - case GTK_WEBVIEW_ITALIC: + case PIDGIN_WEBVIEW_ITALIC: do_formatting(webview, "italic", ""); break; - case GTK_WEBVIEW_UNDERLINE: + case PIDGIN_WEBVIEW_UNDERLINE: do_formatting(webview, "underline", ""); break; - case GTK_WEBVIEW_STRIKE: + case PIDGIN_WEBVIEW_STRIKE: do_formatting(webview, "strikethrough", ""); break; - case GTK_WEBVIEW_SHRINK: + case PIDGIN_WEBVIEW_SHRINK: webview_font_shrink(webview); break; - case GTK_WEBVIEW_GROW: + case PIDGIN_WEBVIEW_GROW: webview_font_grow(webview); break; default: @@ -1425,9 +1425,9 @@ webview_toggle_format(GtkWebView *webview, GtkWebViewButtons buttons) } static void -editable_input_cb(GtkWebView *webview, gpointer data) +editable_input_cb(PidginWebView *webview, gpointer data) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); if (!priv->edit.block_changed && gtk_widget_is_sensitive(GTK_WIDGET(webview))) g_signal_emit(webview, signals[CHANGED], 0); } @@ -1437,13 +1437,13 @@ editable_input_cb(GtkWebView *webview, gpointer data) *****************************************************************************/ GtkWidget * -gtk_webview_new(gboolean editable) +pidgin_webview_new(gboolean editable) { GtkWidget *result; WebKitWebView *webview; WebKitWebSettings *settings; - result = g_object_new(gtk_webview_get_type(), NULL); + result = g_object_new(pidgin_webview_get_type(), NULL); webview = WEBKIT_WEB_VIEW(result); settings = webkit_web_view_get_settings(webview); @@ -1469,9 +1469,9 @@ gtk_webview_new(gboolean editable) } static void -gtk_webview_finalize(GObject *webview) +pidgin_webview_finalize(GObject *webview) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); gpointer temp; if (priv->inspector_win != NULL) @@ -1495,7 +1495,7 @@ gtk_webview_finalize(GObject *webview) } static void -gtk_webview_class_init(GtkWebViewClass *klass, gpointer userdata) +pidgin_webview_class_init(PidginWebViewClass *klass, gpointer userdata) { GObjectClass *gobject_class; GtkBindingSet *binding_set; @@ -1503,44 +1503,44 @@ gtk_webview_class_init(GtkWebViewClass *klass, gpointer userdata) parent_class = g_type_class_ref(webkit_web_view_get_type()); gobject_class = G_OBJECT_CLASS(klass); - g_type_class_add_private(klass, sizeof(GtkWebViewPriv)); + g_type_class_add_private(klass, sizeof(PidginWebViewPriv)); /* Signals */ signals[BUTTONS_UPDATE] = g_signal_new("allowed-formats-updated", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(GtkWebViewClass, buttons_update), + G_STRUCT_OFFSET(PidginWebViewClass, buttons_update), NULL, 0, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); signals[TOGGLE_FORMAT] = g_signal_new("format-toggled", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET(GtkWebViewClass, toggle_format), + G_STRUCT_OFFSET(PidginWebViewClass, toggle_format), NULL, 0, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); signals[CLEAR_FORMAT] = g_signal_new("format-cleared", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET(GtkWebViewClass, clear_format), + G_STRUCT_OFFSET(PidginWebViewClass, clear_format), NULL, 0, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[UPDATE_FORMAT] = g_signal_new("format-updated", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(GtkWebViewClass, update_format), + G_STRUCT_OFFSET(PidginWebViewClass, update_format), NULL, 0, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[CHANGED] = g_signal_new("changed", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(GtkWebViewClass, changed), + G_STRUCT_OFFSET(PidginWebViewClass, changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[HTML_APPENDED] = g_signal_new("html-appended", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET(GtkWebViewClass, html_appended), + G_STRUCT_OFFSET(PidginWebViewClass, html_appended), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, WEBKIT_TYPE_DOM_RANGE, @@ -1551,29 +1551,29 @@ gtk_webview_class_init(GtkWebViewClass *klass, gpointer userdata) klass->toggle_format = webview_toggle_format; klass->clear_format = webview_clear_formatting; - gobject_class->finalize = gtk_webview_finalize; + gobject_class->finalize = pidgin_webview_finalize; /* Key Bindings */ binding_set = gtk_binding_set_by_class(parent_class); gtk_binding_entry_add_signal(binding_set, GDK_KEY_b, GDK_CONTROL_MASK, "format-toggled", 1, G_TYPE_INT, - GTK_WEBVIEW_BOLD); + PIDGIN_WEBVIEW_BOLD); gtk_binding_entry_add_signal(binding_set, GDK_KEY_i, GDK_CONTROL_MASK, "format-toggled", 1, G_TYPE_INT, - GTK_WEBVIEW_ITALIC); + PIDGIN_WEBVIEW_ITALIC); gtk_binding_entry_add_signal(binding_set, GDK_KEY_u, GDK_CONTROL_MASK, "format-toggled", 1, G_TYPE_INT, - GTK_WEBVIEW_UNDERLINE); + PIDGIN_WEBVIEW_UNDERLINE); gtk_binding_entry_add_signal(binding_set, GDK_KEY_plus, GDK_CONTROL_MASK, "format-toggled", 1, G_TYPE_INT, - GTK_WEBVIEW_GROW); + PIDGIN_WEBVIEW_GROW); gtk_binding_entry_add_signal(binding_set, GDK_KEY_equal, GDK_CONTROL_MASK, "format-toggled", 1, G_TYPE_INT, - GTK_WEBVIEW_GROW); + PIDGIN_WEBVIEW_GROW); gtk_binding_entry_add_signal(binding_set, GDK_KEY_minus, GDK_CONTROL_MASK, "format-toggled", 1, G_TYPE_INT, - GTK_WEBVIEW_SHRINK); + PIDGIN_WEBVIEW_SHRINK); binding_set = gtk_binding_set_by_class(klass); gtk_binding_entry_add_signal(binding_set, GDK_KEY_r, GDK_CONTROL_MASK, @@ -1584,9 +1584,9 @@ gtk_webview_class_init(GtkWebViewClass *klass, gpointer userdata) } static void -gtk_webview_init(GtkWebView *webview, gpointer userdata) +pidgin_webview_init(PidginWebView *webview, gpointer userdata) { - GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); + PidginWebViewPriv *priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); WebKitWebInspector *inspector; priv->load_queue = g_queue_new(); @@ -1621,24 +1621,24 @@ gtk_webview_init(GtkWebView *webview, gpointer userdata) } GType -gtk_webview_get_type(void) +pidgin_webview_get_type(void) { static GType mview_type = 0; if (G_UNLIKELY(mview_type == 0)) { static const GTypeInfo mview_info = { - sizeof(GtkWebViewClass), + sizeof(PidginWebViewClass), NULL, NULL, - (GClassInitFunc)gtk_webview_class_init, + (GClassInitFunc)pidgin_webview_class_init, NULL, NULL, - sizeof(GtkWebView), + sizeof(PidginWebView), 0, - (GInstanceInitFunc)gtk_webview_init, + (GInstanceInitFunc)pidgin_webview_init, NULL }; mview_type = g_type_register_static(webkit_web_view_get_type(), - "GtkWebView", &mview_info, 0); + "PidginWebView", &mview_info, 0); } return mview_type; } @@ -1648,7 +1648,7 @@ gtk_webview_get_type(void) *****************************************************************************/ char * -gtk_webview_quote_js_string(const char *text) +pidgin_webview_quote_js_string(const char *text) { GString *str = g_string_new("\""); const char *cur = text; @@ -1678,13 +1678,13 @@ gtk_webview_quote_js_string(const char *text) } void -gtk_webview_safe_execute_script(GtkWebView *webview, const char *script) +pidgin_webview_safe_execute_script(PidginWebView *webview, const char *script) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); g_queue_push_tail(priv->load_queue, GINT_TO_POINTER(LOAD_JS)); g_queue_push_tail(priv->load_queue, g_strdup(script)); if (!priv->is_loading && priv->loader == 0) @@ -1692,7 +1692,7 @@ gtk_webview_safe_execute_script(GtkWebView *webview, const char *script) } void -gtk_webview_load_html_string(GtkWebView *webview, const char *html) +pidgin_webview_load_html_string(PidginWebView *webview, const char *html) { g_return_if_fail(webview != NULL); @@ -1701,12 +1701,12 @@ gtk_webview_load_html_string(GtkWebView *webview, const char *html) } void -gtk_webview_load_html_string_with_selection(GtkWebView *webview, const char *html) +pidgin_webview_load_html_string_with_selection(PidginWebView *webview, const char *html) { g_return_if_fail(webview != NULL); - gtk_webview_load_html_string(webview, html); - gtk_webview_safe_execute_script(webview, + pidgin_webview_load_html_string(webview, html); + pidgin_webview_safe_execute_script(webview, "var s = window.getSelection();" "var r = document.createRange();" "var n = document.getElementById('caret');" @@ -1720,13 +1720,13 @@ gtk_webview_load_html_string_with_selection(GtkWebView *webview, const char *htm } void -gtk_webview_append_html(GtkWebView *webview, const char *html) +pidgin_webview_append_html(PidginWebView *webview, const char *html) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); g_queue_push_tail(priv->load_queue, GINT_TO_POINTER(LOAD_HTML)); g_queue_push_tail(priv->load_queue, g_strdup(html)); if (!priv->is_loading && priv->loader == 0) @@ -1734,24 +1734,24 @@ gtk_webview_append_html(GtkWebView *webview, const char *html) } void -gtk_webview_set_vadjustment(GtkWebView *webview, GtkAdjustment *vadj) +pidgin_webview_set_vadjustment(PidginWebView *webview, GtkAdjustment *vadj) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); priv->vadj = vadj; } void -gtk_webview_scroll_to_end(GtkWebView *webview, gboolean smooth) +pidgin_webview_scroll_to_end(PidginWebView *webview, gboolean smooth) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); if (priv->scroll_time) g_timer_destroy(priv->scroll_time); if (priv->scroll_src) @@ -1766,37 +1766,37 @@ gtk_webview_scroll_to_end(GtkWebView *webview, gboolean smooth) } void -gtk_webview_set_autoscroll(GtkWebView *webview, gboolean scroll) +pidgin_webview_set_autoscroll(PidginWebView *webview, gboolean scroll) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); priv->autoscroll = scroll; } gboolean -gtk_webview_get_autoscroll(GtkWebView *webview) +pidgin_webview_get_autoscroll(PidginWebView *webview) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_val_if_fail(webview != NULL, FALSE); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); return priv->autoscroll; } void -gtk_webview_page_up(GtkWebView *webview) +pidgin_webview_page_up(PidginWebView *webview) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; GtkAdjustment *vadj; gdouble scroll_val; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); vadj = priv->vadj; scroll_val = gtk_adjustment_get_value(vadj) - gtk_adjustment_get_page_size(vadj); scroll_val = MAX(scroll_val, gtk_adjustment_get_lower(vadj)); @@ -1805,16 +1805,16 @@ gtk_webview_page_up(GtkWebView *webview) } void -gtk_webview_page_down(GtkWebView *webview) +pidgin_webview_page_down(PidginWebView *webview) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; GtkAdjustment *vadj; gdouble scroll_val; gdouble page_size; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); vadj = priv->vadj; page_size = gtk_adjustment_get_page_size(vadj); scroll_val = gtk_adjustment_get_value(vadj) + page_size; @@ -1824,43 +1824,43 @@ gtk_webview_page_down(GtkWebView *webview) } void -gtk_webview_setup_entry(GtkWebView *webview, PurpleConnectionFlags flags) +pidgin_webview_setup_entry(PidginWebView *webview, PurpleConnectionFlags flags) { - GtkWebViewButtons buttons; + PidginWebViewButtons buttons; g_return_if_fail(webview != NULL); if (flags & PURPLE_CONNECTION_FLAG_HTML) { gboolean bold, italic, underline, strike; - buttons = GTK_WEBVIEW_ALL; + buttons = PIDGIN_WEBVIEW_ALL; if (flags & PURPLE_CONNECTION_FLAG_NO_BGCOLOR) - buttons &= ~GTK_WEBVIEW_BACKCOLOR; + buttons &= ~PIDGIN_WEBVIEW_BACKCOLOR; if (flags & PURPLE_CONNECTION_FLAG_NO_FONTSIZE) { - buttons &= ~GTK_WEBVIEW_GROW; - buttons &= ~GTK_WEBVIEW_SHRINK; + buttons &= ~PIDGIN_WEBVIEW_GROW; + buttons &= ~PIDGIN_WEBVIEW_SHRINK; } if (flags & PURPLE_CONNECTION_FLAG_NO_URLDESC) - buttons &= ~GTK_WEBVIEW_LINKDESC; + buttons &= ~PIDGIN_WEBVIEW_LINKDESC; - gtk_webview_get_current_format(webview, &bold, &italic, &underline, &strike); + pidgin_webview_get_current_format(webview, &bold, &italic, &underline, &strike); - gtk_webview_set_format_functions(webview, GTK_WEBVIEW_ALL); + pidgin_webview_set_format_functions(webview, PIDGIN_WEBVIEW_ALL); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold") != bold) - gtk_webview_toggle_bold(webview); + pidgin_webview_toggle_bold(webview); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic") != italic) - gtk_webview_toggle_italic(webview); + pidgin_webview_toggle_italic(webview); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline") != underline) - gtk_webview_toggle_underline(webview); + pidgin_webview_toggle_underline(webview); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike") != strike) - gtk_webview_toggle_strike(webview); + pidgin_webview_toggle_strike(webview); - gtk_webview_toggle_fontface(webview, + pidgin_webview_toggle_fontface(webview, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/font_face")); if (!(flags & PURPLE_CONNECTION_FLAG_NO_FONTSIZE)) @@ -1869,41 +1869,41 @@ gtk_webview_setup_entry(GtkWebView *webview, PurpleConnectionFlags flags) /* 3 is the default. */ if (size != 3) - gtk_webview_font_set_size(webview, size); + pidgin_webview_font_set_size(webview, size); } - gtk_webview_toggle_forecolor(webview, + pidgin_webview_toggle_forecolor(webview, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor")); if (!(flags & PURPLE_CONNECTION_FLAG_NO_BGCOLOR)) { - gtk_webview_toggle_backcolor(webview, + pidgin_webview_toggle_backcolor(webview, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor")); } else { - gtk_webview_toggle_backcolor(webview, ""); + pidgin_webview_toggle_backcolor(webview, ""); } if (flags & PURPLE_CONNECTION_FLAG_FORMATTING_WBFO) - gtk_webview_set_whole_buffer_formatting_only(webview, TRUE); + pidgin_webview_set_whole_buffer_formatting_only(webview, TRUE); else - gtk_webview_set_whole_buffer_formatting_only(webview, FALSE); + pidgin_webview_set_whole_buffer_formatting_only(webview, FALSE); } else { - buttons = GTK_WEBVIEW_SMILEY | GTK_WEBVIEW_IMAGE; + buttons = PIDGIN_WEBVIEW_SMILEY | PIDGIN_WEBVIEW_IMAGE; webview_clear_formatting(webview); } if (flags & PURPLE_CONNECTION_FLAG_NO_IMAGES) - buttons &= ~GTK_WEBVIEW_IMAGE; + buttons &= ~PIDGIN_WEBVIEW_IMAGE; if (flags & PURPLE_CONNECTION_FLAG_ALLOW_CUSTOM_SMILEY) - buttons |= GTK_WEBVIEW_CUSTOM_SMILEY; + buttons |= PIDGIN_WEBVIEW_CUSTOM_SMILEY; else - buttons &= ~GTK_WEBVIEW_CUSTOM_SMILEY; + buttons &= ~PIDGIN_WEBVIEW_CUSTOM_SMILEY; - gtk_webview_set_format_functions(webview, buttons); + pidgin_webview_set_format_functions(webview, buttons); } void -pidgin_webview_set_spellcheck(GtkWebView *webview, gboolean enable) +pidgin_webview_set_spellcheck(PidginWebView *webview, gboolean enable) { WebKitWebSettings *settings; @@ -1915,25 +1915,25 @@ pidgin_webview_set_spellcheck(GtkWebView *webview, gboolean enable) } void -gtk_webview_set_whole_buffer_formatting_only(GtkWebView *webview, gboolean wbfo) +pidgin_webview_set_whole_buffer_formatting_only(PidginWebView *webview, gboolean wbfo) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); priv->edit.wbfo = wbfo; } void -gtk_webview_set_format_functions(GtkWebView *webview, GtkWebViewButtons buttons) +pidgin_webview_set_format_functions(PidginWebView *webview, PidginWebViewButtons buttons) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; GObject *object; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); object = g_object_ref(G_OBJECT(webview)); priv->format_functions = buttons; g_signal_emit(object, signals[BUTTONS_UPDATE], 0, buttons); @@ -1941,7 +1941,7 @@ gtk_webview_set_format_functions(GtkWebView *webview, GtkWebViewButtons buttons) } void -gtk_webview_activate_anchor(WebKitDOMHTMLAnchorElement *link) +pidgin_webview_activate_anchor(WebKitDOMHTMLAnchorElement *link) { WebKitDOMDocument *doc; WebKitDOMEvent *event; @@ -1953,12 +1953,12 @@ gtk_webview_activate_anchor(WebKitDOMHTMLAnchorElement *link) } gboolean -gtk_webview_class_register_protocol(const char *name, - gboolean (*activate)(GtkWebView *webview, const char *uri), - gboolean (*context_menu)(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu)) +pidgin_webview_class_register_protocol(const char *name, + gboolean (*activate)(PidginWebView *webview, const char *uri), + gboolean (*context_menu)(PidginWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu)) { - GtkWebViewClass *klass; - GtkWebViewProtocol *proto; + PidginWebViewClass *klass; + PidginWebViewProtocol *proto; g_return_val_if_fail(name, FALSE); @@ -1977,7 +1977,7 @@ gtk_webview_class_register_protocol(const char *name, return FALSE; } - proto = g_new0(GtkWebViewProtocol, 1); + proto = g_new0(PidginWebViewProtocol, 1); proto->name = g_strdup(name); proto->length = strlen(name); proto->activate = activate; @@ -1988,7 +1988,7 @@ gtk_webview_class_register_protocol(const char *name, } gchar * -gtk_webview_get_head_html(GtkWebView *webview) +pidgin_webview_get_head_html(PidginWebView *webview) { WebKitDOMDocument *doc; WebKitDOMHTMLHeadElement *head; @@ -2004,7 +2004,7 @@ gtk_webview_get_head_html(GtkWebView *webview) } gchar * -gtk_webview_get_body_html(GtkWebView *webview) +pidgin_webview_get_body_html(PidginWebView *webview) { WebKitDOMDocument *doc; WebKitDOMHTMLElement *body; @@ -2020,7 +2020,7 @@ gtk_webview_get_body_html(GtkWebView *webview) } gchar * -gtk_webview_get_body_text(GtkWebView *webview) +pidgin_webview_get_body_text(PidginWebView *webview) { WebKitDOMDocument *doc; WebKitDOMHTMLElement *body; @@ -2036,7 +2036,7 @@ gtk_webview_get_body_text(GtkWebView *webview) } gchar * -gtk_webview_get_selected_text(GtkWebView *webview) +pidgin_webview_get_selected_text(PidginWebView *webview) { WebKitDOMDocument *dom; WebKitDOMDOMWindow *win; @@ -2058,7 +2058,7 @@ gtk_webview_get_selected_text(GtkWebView *webview) } void -gtk_webview_get_caret(GtkWebView *webview, WebKitDOMNode **container_ret, +pidgin_webview_get_caret(PidginWebView *webview, WebKitDOMNode **container_ret, glong *pos_ret) { WebKitDOMDocument *dom; @@ -2096,7 +2096,7 @@ gtk_webview_get_caret(GtkWebView *webview, WebKitDOMNode **container_ret, } void -gtk_webview_set_caret(GtkWebView *webview, WebKitDOMNode *container, glong pos) +pidgin_webview_set_caret(PidginWebView *webview, WebKitDOMNode *container, glong pos) { WebKitDOMDocument *dom; WebKitDOMDOMWindow *win; @@ -2111,19 +2111,19 @@ gtk_webview_set_caret(GtkWebView *webview, WebKitDOMNode *container, glong pos) webkit_dom_dom_selection_set_position(sel, container, pos, NULL); } -GtkWebViewButtons -gtk_webview_get_format_functions(GtkWebView *webview) +PidginWebViewButtons +pidgin_webview_get_format_functions(PidginWebView *webview) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_val_if_fail(webview != NULL, 0); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); return priv->format_functions; } void -gtk_webview_get_current_format(GtkWebView *webview, gboolean *bold, +pidgin_webview_get_current_format(PidginWebView *webview, gboolean *bold, gboolean *italic, gboolean *underline, gboolean *strike) { @@ -2144,7 +2144,7 @@ gtk_webview_get_current_format(GtkWebView *webview, gboolean *bold, } char * -gtk_webview_get_current_fontface(GtkWebView *webview) +pidgin_webview_get_current_fontface(PidginWebView *webview) { WebKitDOMDocument *dom; @@ -2155,7 +2155,7 @@ gtk_webview_get_current_fontface(GtkWebView *webview) } char * -gtk_webview_get_current_forecolor(GtkWebView *webview) +pidgin_webview_get_current_forecolor(PidginWebView *webview) { WebKitDOMDocument *dom; @@ -2166,7 +2166,7 @@ gtk_webview_get_current_forecolor(GtkWebView *webview) } char * -gtk_webview_get_current_backcolor(GtkWebView *webview) +pidgin_webview_get_current_backcolor(PidginWebView *webview) { WebKitDOMDocument *dom; @@ -2177,7 +2177,7 @@ gtk_webview_get_current_backcolor(GtkWebView *webview) } gint -gtk_webview_get_current_fontsize(GtkWebView *webview) +pidgin_webview_get_current_fontsize(PidginWebView *webview) { WebKitDOMDocument *dom; gchar *text; @@ -2194,7 +2194,7 @@ gtk_webview_get_current_fontsize(GtkWebView *webview) } void -gtk_webview_clear_formatting(GtkWebView *webview) +pidgin_webview_clear_formatting(PidginWebView *webview) { GObject *object; @@ -2206,68 +2206,68 @@ gtk_webview_clear_formatting(GtkWebView *webview) } void -gtk_webview_toggle_bold(GtkWebView *webview) +pidgin_webview_toggle_bold(PidginWebView *webview) { g_return_if_fail(webview != NULL); - emit_format_signal(webview, GTK_WEBVIEW_BOLD); + emit_format_signal(webview, PIDGIN_WEBVIEW_BOLD); } void -gtk_webview_toggle_italic(GtkWebView *webview) +pidgin_webview_toggle_italic(PidginWebView *webview) { g_return_if_fail(webview != NULL); - emit_format_signal(webview, GTK_WEBVIEW_ITALIC); + emit_format_signal(webview, PIDGIN_WEBVIEW_ITALIC); } void -gtk_webview_toggle_underline(GtkWebView *webview) +pidgin_webview_toggle_underline(PidginWebView *webview) { g_return_if_fail(webview != NULL); - emit_format_signal(webview, GTK_WEBVIEW_UNDERLINE); + emit_format_signal(webview, PIDGIN_WEBVIEW_UNDERLINE); } void -gtk_webview_toggle_strike(GtkWebView *webview) +pidgin_webview_toggle_strike(PidginWebView *webview) { g_return_if_fail(webview != NULL); - emit_format_signal(webview, GTK_WEBVIEW_STRIKE); + emit_format_signal(webview, PIDGIN_WEBVIEW_STRIKE); } gboolean -gtk_webview_toggle_forecolor(GtkWebView *webview, const char *color) +pidgin_webview_toggle_forecolor(PidginWebView *webview, const char *color) { g_return_val_if_fail(webview != NULL, FALSE); do_formatting(webview, "foreColor", color); - emit_format_signal(webview, GTK_WEBVIEW_FORECOLOR); + emit_format_signal(webview, PIDGIN_WEBVIEW_FORECOLOR); return FALSE; } gboolean -gtk_webview_toggle_backcolor(GtkWebView *webview, const char *color) +pidgin_webview_toggle_backcolor(PidginWebView *webview, const char *color) { g_return_val_if_fail(webview != NULL, FALSE); do_formatting(webview, "backColor", color); - emit_format_signal(webview, GTK_WEBVIEW_BACKCOLOR); + emit_format_signal(webview, PIDGIN_WEBVIEW_BACKCOLOR); return FALSE; } gboolean -gtk_webview_toggle_fontface(GtkWebView *webview, const char *face) +pidgin_webview_toggle_fontface(PidginWebView *webview, const char *face) { g_return_val_if_fail(webview != NULL, FALSE); do_formatting(webview, "fontName", face); - emit_format_signal(webview, GTK_WEBVIEW_FACE); + emit_format_signal(webview, PIDGIN_WEBVIEW_FACE); return FALSE; } void -gtk_webview_font_set_size(GtkWebView *webview, gint size) +pidgin_webview_font_set_size(PidginWebView *webview, gint size) { char *tmp; @@ -2275,33 +2275,33 @@ gtk_webview_font_set_size(GtkWebView *webview, gint size) tmp = g_strdup_printf("%d", size); do_formatting(webview, "fontSize", tmp); - emit_format_signal(webview, GTK_WEBVIEW_SHRINK|GTK_WEBVIEW_GROW); + emit_format_signal(webview, PIDGIN_WEBVIEW_SHRINK|PIDGIN_WEBVIEW_GROW); g_free(tmp); } void -gtk_webview_font_shrink(GtkWebView *webview) +pidgin_webview_font_shrink(PidginWebView *webview) { g_return_if_fail(webview != NULL); - emit_format_signal(webview, GTK_WEBVIEW_SHRINK); + emit_format_signal(webview, PIDGIN_WEBVIEW_SHRINK); } void -gtk_webview_font_grow(GtkWebView *webview) +pidgin_webview_font_grow(PidginWebView *webview) { g_return_if_fail(webview != NULL); - emit_format_signal(webview, GTK_WEBVIEW_GROW); + emit_format_signal(webview, PIDGIN_WEBVIEW_GROW); } void -gtk_webview_insert_hr(GtkWebView *webview) +pidgin_webview_insert_hr(PidginWebView *webview) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; WebKitDOMDocument *dom; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(webview)); priv->edit.block_changed = TRUE; @@ -2310,15 +2310,15 @@ gtk_webview_insert_hr(GtkWebView *webview) } void -gtk_webview_insert_link(GtkWebView *webview, const char *url, const char *desc) +pidgin_webview_insert_link(PidginWebView *webview, const char *url, const char *desc) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; WebKitDOMDocument *dom; char *link; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(webview)); link = g_strdup_printf("<a href='%s'>%s</a>", url, desc ? desc : url); @@ -2329,15 +2329,15 @@ gtk_webview_insert_link(GtkWebView *webview, const char *url, const char *desc) } void -gtk_webview_insert_image(GtkWebView *webview, int id) +pidgin_webview_insert_image(PidginWebView *webview, int id) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; WebKitDOMDocument *dom; char *img; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(webview)); img = g_strdup_printf("<img src='" PURPLE_STORED_IMAGE_PROTOCOL "%d'/>", id); @@ -2349,52 +2349,52 @@ gtk_webview_insert_image(GtkWebView *webview, int id) } void -gtk_webview_set_toolbar(GtkWebView *webview, GtkWidget *toolbar) +pidgin_webview_set_toolbar(PidginWebView *webview, GtkWidget *toolbar) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); - priv->toolbar = GTK_WEBVIEWTOOLBAR(toolbar); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); + priv->toolbar = PIDGIN_WEBVIEWTOOLBAR(toolbar); } void -gtk_webview_show_toolbar(GtkWebView *webview) +pidgin_webview_show_toolbar(PidginWebView *webview) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); g_return_if_fail(priv->toolbar != NULL); gtk_widget_show(GTK_WIDGET(priv->toolbar)); } void -gtk_webview_hide_toolbar(GtkWebView *webview) +pidgin_webview_hide_toolbar(PidginWebView *webview) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); g_return_if_fail(priv->toolbar != NULL); gtk_widget_hide(GTK_WIDGET(priv->toolbar)); } void -gtk_webview_activate_toolbar(GtkWebView *webview, GtkWebViewAction action) +pidgin_webview_activate_toolbar(PidginWebView *webview, PidginWebViewAction action) { - GtkWebViewPriv *priv; + PidginWebViewPriv *priv; g_return_if_fail(webview != NULL); - priv = GTK_WEBVIEW_GET_PRIVATE(webview); + priv = PIDGIN_WEBVIEW_GET_PRIVATE(webview); g_return_if_fail(priv->toolbar != NULL); - gtk_webviewtoolbar_activate(priv->toolbar, action); + pidgin_webviewtoolbar_activate(priv->toolbar, action); } diff --git a/pidgin/gtkwebview.h b/pidgin/gtkwebview.h index e9a1c78c54..75c34bc307 100644 --- a/pidgin/gtkwebview.h +++ b/pidgin/gtkwebview.h @@ -35,123 +35,123 @@ #include <gtk/gtk.h> #include <webkit/webkit.h> -#define GTK_TYPE_WEBVIEW (gtk_webview_get_type()) -#define GTK_WEBVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_WEBVIEW, GtkWebView)) -#define GTK_WEBVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_WEBVIEW, GtkWebViewClass)) +#define GTK_TYPE_WEBVIEW (pidgin_webview_get_type()) +#define PIDGIN_WEBVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_WEBVIEW, PidginWebView)) +#define PIDGIN_WEBVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_WEBVIEW, PidginWebViewClass)) #define GTK_IS_WEBVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_WEBVIEW)) #define GTK_IS_WEBVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_WEBVIEW)) -#define GTK_WEBVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_WEBVIEW, GtkWebViewClass)) +#define PIDGIN_WEBVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_WEBVIEW, PidginWebViewClass)) typedef enum { - GTK_WEBVIEW_BOLD = 1 << 0, - GTK_WEBVIEW_ITALIC = 1 << 1, - GTK_WEBVIEW_UNDERLINE = 1 << 2, - GTK_WEBVIEW_GROW = 1 << 3, - GTK_WEBVIEW_SHRINK = 1 << 4, - GTK_WEBVIEW_FACE = 1 << 5, - GTK_WEBVIEW_FORECOLOR = 1 << 6, - GTK_WEBVIEW_BACKCOLOR = 1 << 7, - GTK_WEBVIEW_LINK = 1 << 8, - GTK_WEBVIEW_IMAGE = 1 << 9, - GTK_WEBVIEW_SMILEY = 1 << 10, - GTK_WEBVIEW_LINKDESC = 1 << 11, - GTK_WEBVIEW_STRIKE = 1 << 12, + PIDGIN_WEBVIEW_BOLD = 1 << 0, + PIDGIN_WEBVIEW_ITALIC = 1 << 1, + PIDGIN_WEBVIEW_UNDERLINE = 1 << 2, + PIDGIN_WEBVIEW_GROW = 1 << 3, + PIDGIN_WEBVIEW_SHRINK = 1 << 4, + PIDGIN_WEBVIEW_FACE = 1 << 5, + PIDGIN_WEBVIEW_FORECOLOR = 1 << 6, + PIDGIN_WEBVIEW_BACKCOLOR = 1 << 7, + PIDGIN_WEBVIEW_LINK = 1 << 8, + PIDGIN_WEBVIEW_IMAGE = 1 << 9, + PIDGIN_WEBVIEW_SMILEY = 1 << 10, + PIDGIN_WEBVIEW_LINKDESC = 1 << 11, + PIDGIN_WEBVIEW_STRIKE = 1 << 12, /** Show custom smileys when appropriate. */ - GTK_WEBVIEW_CUSTOM_SMILEY = 1 << 13, - GTK_WEBVIEW_ALL = -1 -} GtkWebViewButtons; + PIDGIN_WEBVIEW_CUSTOM_SMILEY = 1 << 13, + PIDGIN_WEBVIEW_ALL = -1 +} PidginWebViewButtons; typedef enum { - GTK_WEBVIEW_SMILEY_CUSTOM = 1 << 0 -} GtkWebViewSmileyFlags; + PIDGIN_WEBVIEW_SMILEY_CUSTOM = 1 << 0 +} PidginWebViewSmileyFlags; typedef enum { - GTK_WEBVIEW_ACTION_BOLD, - GTK_WEBVIEW_ACTION_ITALIC, - GTK_WEBVIEW_ACTION_UNDERLINE, - GTK_WEBVIEW_ACTION_STRIKE, - GTK_WEBVIEW_ACTION_LARGER, + PIDGIN_WEBVIEW_ACTION_BOLD, + PIDGIN_WEBVIEW_ACTION_ITALIC, + PIDGIN_WEBVIEW_ACTION_UNDERLINE, + PIDGIN_WEBVIEW_ACTION_STRIKE, + PIDGIN_WEBVIEW_ACTION_LARGER, #if 0 - GTK_WEBVIEW_ACTION_NORMAL, + PIDGIN_WEBVIEW_ACTION_NORMAL, #endif - GTK_WEBVIEW_ACTION_SMALLER, - GTK_WEBVIEW_ACTION_FONTFACE, - GTK_WEBVIEW_ACTION_FGCOLOR, - GTK_WEBVIEW_ACTION_BGCOLOR, - GTK_WEBVIEW_ACTION_CLEAR, - GTK_WEBVIEW_ACTION_IMAGE, - GTK_WEBVIEW_ACTION_LINK, - GTK_WEBVIEW_ACTION_HR, - GTK_WEBVIEW_ACTION_SMILEY, - GTK_WEBVIEW_ACTION_ATTENTION -} GtkWebViewAction; - -typedef struct _GtkWebView GtkWebView; -typedef struct _GtkWebViewClass GtkWebViewClass; -typedef struct _GtkWebViewSmiley GtkWebViewSmiley; - -struct _GtkWebView + PIDGIN_WEBVIEW_ACTION_SMALLER, + PIDGIN_WEBVIEW_ACTION_FONTFACE, + PIDGIN_WEBVIEW_ACTION_FGCOLOR, + PIDGIN_WEBVIEW_ACTION_BGCOLOR, + PIDGIN_WEBVIEW_ACTION_CLEAR, + PIDGIN_WEBVIEW_ACTION_IMAGE, + PIDGIN_WEBVIEW_ACTION_LINK, + PIDGIN_WEBVIEW_ACTION_HR, + PIDGIN_WEBVIEW_ACTION_SMILEY, + PIDGIN_WEBVIEW_ACTION_ATTENTION +} PidginWebViewAction; + +typedef struct _PidginWebView PidginWebView; +typedef struct _PidginWebViewClass PidginWebViewClass; +typedef struct _PidginWebViewSmiley PidginWebViewSmiley; + +struct _PidginWebView { WebKitWebView parent; }; -struct _GtkWebViewClass +struct _PidginWebViewClass { WebKitWebViewClass parent; GList *protocols; - void (*buttons_update)(GtkWebView *, GtkWebViewButtons); - void (*toggle_format)(GtkWebView *, GtkWebViewButtons); - void (*clear_format)(GtkWebView *); - void (*update_format)(GtkWebView *); - void (*changed)(GtkWebView *); - void (*html_appended)(GtkWebView *, WebKitDOMRange *); + void (*buttons_update)(PidginWebView *, PidginWebViewButtons); + void (*toggle_format)(PidginWebView *, PidginWebViewButtons); + void (*clear_format)(PidginWebView *); + void (*update_format)(PidginWebView *); + void (*changed)(PidginWebView *); + void (*html_appended)(PidginWebView *, WebKitDOMRange *); }; G_BEGIN_DECLS /** - * gtk_webview_get_type: + * pidgin_webview_get_type: * - * Returns the GType for a GtkWebView widget + * Returns the GType for a PidginWebView widget * - * Returns: The GType for GtkWebView widget + * Returns: The GType for PidginWebView widget */ -GType gtk_webview_get_type(void); +GType pidgin_webview_get_type(void); /** - * gtk_webview_new: - * @editable: Whether this GtkWebView will be user-editable + * pidgin_webview_new: + * @editable: Whether this PidginWebView will be user-editable * - * Create a new GtkWebView object + * Create a new PidginWebView object * - * Returns: A GtkWidget corresponding to the GtkWebView object + * Returns: A GtkWidget corresponding to the PidginWebView object */ -GtkWidget *gtk_webview_new(gboolean editable); +GtkWidget *pidgin_webview_new(gboolean editable); /** - * gtk_webview_append_html: - * @webview: The GtkWebView object + * pidgin_webview_append_html: + * @webview: The PidginWebView object * @markup: The html markup to append * * A very basic routine to append html, which can be considered * equivalent to a "document.write" using JavaScript. */ -void gtk_webview_append_html(GtkWebView *webview, const char *markup); +void pidgin_webview_append_html(PidginWebView *webview, const char *markup); /** - * gtk_webview_load_html_string: - * @webview: The GtkWebView object + * pidgin_webview_load_html_string: + * @webview: The PidginWebView object * @html: The HTML content to load * * Requests loading of the given content. */ -void gtk_webview_load_html_string(GtkWebView *webview, const char *html); +void pidgin_webview_load_html_string(PidginWebView *webview, const char *html); /** - * gtk_webview_load_html_string_with_selection: - * @webview: The GtkWebView object + * pidgin_webview_load_html_string_with_selection: + * @webview: The PidginWebView object * @html: The HTML content to load * * Requests loading of the given content and sets the selection. You must @@ -159,11 +159,11 @@ void gtk_webview_load_html_string(GtkWebView *webview, const char *html); * used to set the selection. This tag is then removed so that querying the * WebView's HTML contents will no longer return it. */ -void gtk_webview_load_html_string_with_selection(GtkWebView *webview, const char *html); +void pidgin_webview_load_html_string_with_selection(PidginWebView *webview, const char *html); /** - * gtk_webview_safe_execute_script: - * @webview: The GtkWebView object + * pidgin_webview_safe_execute_script: + * @webview: The PidginWebView object * @script: The script to execute * * Execute the JavaScript only after the webkit_webview_load_string @@ -172,10 +172,10 @@ void gtk_webview_load_html_string_with_selection(GtkWebView *webview, const char * conditions when calling JS functions immediately after opening the * page. */ -void gtk_webview_safe_execute_script(GtkWebView *webview, const char *script); +void pidgin_webview_safe_execute_script(PidginWebView *webview, const char *script); /** - * gtk_webview_quote_js_string: + * pidgin_webview_quote_js_string: * @str: The string to escape and quote * * A convenience routine to quote a string for use as a JavaScript @@ -183,114 +183,114 @@ void gtk_webview_safe_execute_script(GtkWebView *webview, const char *script); * * Returns: The quoted string */ -char *gtk_webview_quote_js_string(const char *str); +char *pidgin_webview_quote_js_string(const char *str); /** - * gtk_webview_set_vadjustment: - * @webview: The GtkWebView object + * pidgin_webview_set_vadjustment: + * @webview: The PidginWebView object * @vadj: The GtkAdjustment that control the webview * - * Set the vertical adjustment for the GtkWebView. + * Set the vertical adjustment for the PidginWebView. */ -void gtk_webview_set_vadjustment(GtkWebView *webview, GtkAdjustment *vadj); +void pidgin_webview_set_vadjustment(PidginWebView *webview, GtkAdjustment *vadj); /** - * gtk_webview_scroll_to_end: - * @webview: The GtkWebView object + * pidgin_webview_scroll_to_end: + * @webview: The PidginWebView object * @smooth: A boolean indicating if smooth scrolling should be used * * Scrolls the Webview to the end of its contents. */ -void gtk_webview_scroll_to_end(GtkWebView *webview, gboolean smooth); +void pidgin_webview_scroll_to_end(PidginWebView *webview, gboolean smooth); /** - * gtk_webview_set_autoscroll: - * @webview: The GtkWebView object + * pidgin_webview_set_autoscroll: + * @webview: The PidginWebView object * @scroll: Whether to automatically scroll * - * Set whether the GtkWebView stays at its end when HTML content is appended. If + * Set whether the PidginWebView stays at its end when HTML content is appended. If * not already at the end before appending, then scrolling will not occur. */ -void gtk_webview_set_autoscroll(GtkWebView *webview, gboolean scroll); +void pidgin_webview_set_autoscroll(PidginWebView *webview, gboolean scroll); /** - * gtk_webview_get_autoscroll: - * @webview: The GtkWebView object + * pidgin_webview_get_autoscroll: + * @webview: The PidginWebView object * - * Set whether the GtkWebView stays at its end when HTML content is appended. If + * Set whether the PidginWebView stays at its end when HTML content is appended. If * not already at the end before appending, then scrolling will not occur. * * Returns: Whether to automatically scroll */ -gboolean gtk_webview_get_autoscroll(GtkWebView *webview); +gboolean pidgin_webview_get_autoscroll(PidginWebView *webview); /** - * gtk_webview_page_up: - * @webview: The GtkWebView. + * pidgin_webview_page_up: + * @webview: The PidginWebView. * - * Scrolls a GtkWebView up by one page. + * Scrolls a PidginWebView up by one page. */ -void gtk_webview_page_up(GtkWebView *webview); +void pidgin_webview_page_up(PidginWebView *webview); /** - * gtk_webview_page_down: - * @webview: The GtkWebView. + * pidgin_webview_page_down: + * @webview: The PidginWebView. * - * Scrolls a GtkWebView down by one page. + * Scrolls a PidginWebView down by one page. */ -void gtk_webview_page_down(GtkWebView *webview); +void pidgin_webview_page_down(PidginWebView *webview); /** - * gtk_webview_setup_entry: - * @webview: The GtkWebView. + * pidgin_webview_setup_entry: + * @webview: The PidginWebView. * @flags: The connection flags describing the allowed formatting. * - * Setup formatting for a GtkWebView depending on the flags specified. + * Setup formatting for a PidginWebView depending on the flags specified. */ -void gtk_webview_setup_entry(GtkWebView *webview, PurpleConnectionFlags flags); +void pidgin_webview_setup_entry(PidginWebView *webview, PurpleConnectionFlags flags); /** * pidgin_webview_set_spellcheck: - * @webview: The GtkWebView. + * @webview: The PidginWebView. * @enable: Whether to enable or disable spell-checking. * - * Setup spell-checking on a GtkWebView. + * Setup spell-checking on a PidginWebView. */ -void pidgin_webview_set_spellcheck(GtkWebView *webview, gboolean enable); +void pidgin_webview_set_spellcheck(PidginWebView *webview, gboolean enable); /** - * gtk_webview_set_whole_buffer_formatting_only: - * @webview: The GtkWebView + * pidgin_webview_set_whole_buffer_formatting_only: + * @webview: The PidginWebView * @wbfo: %TRUE to enable the mode, or %FALSE otherwise. * - * Enables or disables whole buffer formatting only (wbfo) in a GtkWebView. + * Enables or disables whole buffer formatting only (wbfo) in a PidginWebView. * In this mode formatting options to the buffer take effect for the entire * buffer instead of specific text. */ -void gtk_webview_set_whole_buffer_formatting_only(GtkWebView *webview, +void pidgin_webview_set_whole_buffer_formatting_only(PidginWebView *webview, gboolean wbfo); /** - * gtk_webview_set_format_functions: - * @webview: The GtkWebView - * @buttons: A GtkWebViewButtons bitmask indicating which functions to use + * pidgin_webview_set_format_functions: + * @webview: The PidginWebView + * @buttons: A PidginWebViewButtons bitmask indicating which functions to use * - * Indicates which formatting functions to enable and disable in a GtkWebView. + * Indicates which formatting functions to enable and disable in a PidginWebView. */ -void gtk_webview_set_format_functions(GtkWebView *webview, - GtkWebViewButtons buttons); +void pidgin_webview_set_format_functions(PidginWebView *webview, + PidginWebViewButtons buttons); /** - * gtk_webview_activate_anchor: + * pidgin_webview_activate_anchor: * @link: The WebKitDOMHTMLAnchorElement object * * Activates a WebKitDOMHTMLAnchorElement object. This triggers the navigation * signals, and marks the link as visited (when possible). */ -void gtk_webview_activate_anchor(WebKitDOMHTMLAnchorElement *link); +void pidgin_webview_activate_anchor(WebKitDOMHTMLAnchorElement *link); /** - * gtk_webview_class_register_protocol: + * pidgin_webview_class_register_protocol: * @name: The name of the protocol (e.g. http://) * @activate: The callback to trigger when the protocol text is clicked. * Removes any current protocol definition if %NULL. The @@ -301,129 +301,129 @@ void gtk_webview_activate_anchor(WebKitDOMHTMLAnchorElement *link); * %TRUE if the request for context menu was processed * successfully, %FALSE otherwise. * - * Register a protocol with the GtkWebView widget. Registering a protocol would + * Register a protocol with the PidginWebView widget. Registering a protocol would * allow certain text to be clickable. * * Returns: %TRUE if the protocol was successfully registered * (or unregistered, when \a activate is %NULL) */ -gboolean gtk_webview_class_register_protocol(const char *name, - gboolean (*activate)(GtkWebView *webview, const char *uri), - gboolean (*context_menu)(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu)); +gboolean pidgin_webview_class_register_protocol(const char *name, + gboolean (*activate)(PidginWebView *webview, const char *uri), + gboolean (*context_menu)(PidginWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu)); /** - * gtk_webview_get_format_functions: - * @webview: The GtkWebView + * pidgin_webview_get_format_functions: + * @webview: The PidginWebView * - * Returns which formatting functions are enabled in a GtkWebView. + * Returns which formatting functions are enabled in a PidginWebView. * - * Returns: A GtkWebViewButtons bitmask indicating which functions to are enabled + * Returns: A PidginWebViewButtons bitmask indicating which functions to are enabled */ -GtkWebViewButtons gtk_webview_get_format_functions(GtkWebView *webview); +PidginWebViewButtons pidgin_webview_get_format_functions(PidginWebView *webview); /** - * gtk_webview_get_current_format: - * @webview: The GtkWebView + * pidgin_webview_get_current_format: + * @webview: The PidginWebView * @bold: The boolean to set for bold or %NULL. * @italic: The boolean to set for italic or %NULL. * @underline: The boolean to set for underline or %NULL. * @strikethrough: The boolean to set for strikethrough or %NULL. * * Sets each boolean to %TRUE or %FALSE to indicate if that formatting - * option is enabled at the current position in a GtkWebView. + * option is enabled at the current position in a PidginWebView. */ -void gtk_webview_get_current_format(GtkWebView *webview, gboolean *bold, +void pidgin_webview_get_current_format(PidginWebView *webview, gboolean *bold, gboolean *italic, gboolean *underline, gboolean *strikethrough); /** - * gtk_webview_get_current_fontface: - * @webview: The GtkWebView + * pidgin_webview_get_current_fontface: + * @webview: The PidginWebView * * Returns a string containing the selected font face at the current position - * in a GtkWebView. + * in a PidginWebView. * * Returns: A string containing the font face or %NULL if none is set. */ -char *gtk_webview_get_current_fontface(GtkWebView *webview); +char *pidgin_webview_get_current_fontface(PidginWebView *webview); /** - * gtk_webview_get_current_forecolor: - * @webview: The GtkWebView + * pidgin_webview_get_current_forecolor: + * @webview: The PidginWebView * * Returns a string containing the selected foreground color at the current - * position in a GtkWebView. + * position in a PidginWebView. * * Returns: A string containing the foreground color or %NULL if none is set. */ -char *gtk_webview_get_current_forecolor(GtkWebView *webview); +char *pidgin_webview_get_current_forecolor(PidginWebView *webview); /** - * gtk_webview_get_current_backcolor: - * @webview: The GtkWebView + * pidgin_webview_get_current_backcolor: + * @webview: The PidginWebView * * Returns a string containing the selected font background color at the current - * position in a GtkWebView. + * position in a PidginWebView. * * Returns: A string containing the background color or %NULL if none is set. */ -char *gtk_webview_get_current_backcolor(GtkWebView *webview); +char *pidgin_webview_get_current_backcolor(PidginWebView *webview); /** - * gtk_webview_get_current_fontsize: - * @webview: The GtkWebView + * pidgin_webview_get_current_fontsize: + * @webview: The PidginWebView * * Returns a integer containing the selected HTML font size at the current - * position in a GtkWebView. + * position in a PidginWebView. * * Returns: The HTML font size. */ -gint gtk_webview_get_current_fontsize(GtkWebView *webview); +gint pidgin_webview_get_current_fontsize(PidginWebView *webview); /** - * gtk_webview_get_head_html: - * @webview: The GtkWebView + * pidgin_webview_get_head_html: + * @webview: The PidginWebView * - * Gets the content of the head element of a GtkWebView as HTML. + * Gets the content of the head element of a PidginWebView as HTML. * * Returns: The HTML from the head element. */ -gchar *gtk_webview_get_head_html(GtkWebView *webview); +gchar *pidgin_webview_get_head_html(PidginWebView *webview); /** - * gtk_webview_get_body_html: - * @webview: The GtkWebView + * pidgin_webview_get_body_html: + * @webview: The PidginWebView * - * Gets the HTML content of a GtkWebView. + * Gets the HTML content of a PidginWebView. * * Returns: The HTML that is currently displayed. */ -gchar *gtk_webview_get_body_html(GtkWebView *webview); +gchar *pidgin_webview_get_body_html(PidginWebView *webview); /** - * gtk_webview_get_body_text: - * @webview: The GtkWebView + * pidgin_webview_get_body_text: + * @webview: The PidginWebView * - * Gets the text content of a GtkWebView. + * Gets the text content of a PidginWebView. * * Returns: The HTML-free text that is currently displayed. */ -gchar *gtk_webview_get_body_text(GtkWebView *webview); +gchar *pidgin_webview_get_body_text(PidginWebView *webview); /** - * gtk_webview_get_selected_text: - * @webview: The GtkWebView + * pidgin_webview_get_selected_text: + * @webview: The PidginWebView * - * Gets the selected text of a GtkWebView. + * Gets the selected text of a PidginWebView. * * Returns: The HTML-free text that is currently selected, or NULL if nothing is * currently selected. */ -gchar *gtk_webview_get_selected_text(GtkWebView *webview); +gchar *pidgin_webview_get_selected_text(PidginWebView *webview); /** - * gtk_webview_get_caret: - * @webview: The GtkWebView + * pidgin_webview_get_caret: + * @webview: The PidginWebView * @container_ret: A pointer to a pointer to a WebKitDOMNode. This pointer * will be set to the container the caret is in. Set to * %NULL if a range is selected. @@ -432,312 +432,312 @@ gchar *gtk_webview_get_selected_text(GtkWebView *webview); * range is selected. * * Gets the container of the caret, along with its position in the container - * from a GtkWebView. + * from a PidginWebView. */ -void gtk_webview_get_caret(GtkWebView *webview, WebKitDOMNode **container_ret, +void pidgin_webview_get_caret(PidginWebView *webview, WebKitDOMNode **container_ret, glong *pos_ret); /** - * gtk_webview_set_caret: - * @webview: The GtkWebView + * pidgin_webview_set_caret: + * @webview: The PidginWebView * @container: The WebKitDOMNode to set the caret in * @pos: The position of the caret in the container * - * Sets the caret position in container, in a GtkWebView. + * Sets the caret position in container, in a PidginWebView. */ -void gtk_webview_set_caret(GtkWebView *webview, WebKitDOMNode *container, +void pidgin_webview_set_caret(PidginWebView *webview, WebKitDOMNode *container, glong pos); /** - * gtk_webview_clear_formatting: - * @webview: The GtkWebView + * pidgin_webview_clear_formatting: + * @webview: The PidginWebView * - * Clear all the formatting on a GtkWebView. + * Clear all the formatting on a PidginWebView. */ -void gtk_webview_clear_formatting(GtkWebView *webview); +void pidgin_webview_clear_formatting(PidginWebView *webview); /** - * gtk_webview_toggle_bold: - * @webview: The GtkWebView + * pidgin_webview_toggle_bold: + * @webview: The PidginWebView * - * Toggles bold at the cursor location or selection in a GtkWebView. + * Toggles bold at the cursor location or selection in a PidginWebView. */ -void gtk_webview_toggle_bold(GtkWebView *webview); +void pidgin_webview_toggle_bold(PidginWebView *webview); /** - * gtk_webview_toggle_italic: - * @webview: The GtkWebView + * pidgin_webview_toggle_italic: + * @webview: The PidginWebView * - * Toggles italic at the cursor location or selection in a GtkWebView. + * Toggles italic at the cursor location or selection in a PidginWebView. */ -void gtk_webview_toggle_italic(GtkWebView *webview); +void pidgin_webview_toggle_italic(PidginWebView *webview); /** - * gtk_webview_toggle_underline: - * @webview: The GtkWebView + * pidgin_webview_toggle_underline: + * @webview: The PidginWebView * - * Toggles underline at the cursor location or selection in a GtkWebView. + * Toggles underline at the cursor location or selection in a PidginWebView. */ -void gtk_webview_toggle_underline(GtkWebView *webview); +void pidgin_webview_toggle_underline(PidginWebView *webview); /** - * gtk_webview_toggle_strike: - * @webview: The GtkWebView + * pidgin_webview_toggle_strike: + * @webview: The PidginWebView * - * Toggles strikethrough at the cursor location or selection in a GtkWebView. + * Toggles strikethrough at the cursor location or selection in a PidginWebView. */ -void gtk_webview_toggle_strike(GtkWebView *webview); +void pidgin_webview_toggle_strike(PidginWebView *webview); /** - * gtk_webview_toggle_forecolor: - * @webview: The GtkWebView + * pidgin_webview_toggle_forecolor: + * @webview: The PidginWebView * @color: The HTML-style color, or %NULL or "" to clear the color. * * Toggles a foreground color at the current location or selection in a - * GtkWebView. + * PidginWebView. * * Returns: %TRUE if a color was set, or %FALSE if it was cleared. */ -gboolean gtk_webview_toggle_forecolor(GtkWebView *webview, const char *color); +gboolean pidgin_webview_toggle_forecolor(PidginWebView *webview, const char *color); /** - * gtk_webview_toggle_backcolor: - * @webview: The GtkWebView + * pidgin_webview_toggle_backcolor: + * @webview: The PidginWebView * @color: The HTML-style color, or %NULL or "" to clear the color. * * Toggles a background color at the current location or selection in a - * GtkWebView. + * PidginWebView. * * Returns: %TRUE if a color was set, or %FALSE if it was cleared. */ -gboolean gtk_webview_toggle_backcolor(GtkWebView *webview, const char *color); +gboolean pidgin_webview_toggle_backcolor(PidginWebView *webview, const char *color); /** - * gtk_webview_toggle_fontface: - * @webview: The GtkWebView + * pidgin_webview_toggle_fontface: + * @webview: The PidginWebView * @face: The font face name, or %NULL or "" to clear the font. * - * Toggles a font face at the current location or selection in a GtkWebView. + * Toggles a font face at the current location or selection in a PidginWebView. * * Returns: %TRUE if a font name was set, or %FALSE if it was cleared. */ -gboolean gtk_webview_toggle_fontface(GtkWebView *webview, const char *face); +gboolean pidgin_webview_toggle_fontface(PidginWebView *webview, const char *face); /** - * gtk_webview_font_set_size: - * @webview: The GtkWebView + * pidgin_webview_font_set_size: + * @webview: The PidginWebView * @size: The HTML font size to use. * - * Sets the font size at the current location or selection in a GtkWebView. + * Sets the font size at the current location or selection in a PidginWebView. */ -void gtk_webview_font_set_size(GtkWebView *webview, gint size); +void pidgin_webview_font_set_size(PidginWebView *webview, gint size); /** - * gtk_webview_font_shrink: - * @webview: The GtkWebView + * pidgin_webview_font_shrink: + * @webview: The PidginWebView * * Decreases the font size by 1 at the current location or selection in a - * GtkWebView. + * PidginWebView. */ -void gtk_webview_font_shrink(GtkWebView *webview); +void pidgin_webview_font_shrink(PidginWebView *webview); /** - * gtk_webview_font_grow: - * @webview: The GtkWebView + * pidgin_webview_font_grow: + * @webview: The PidginWebView * * Increases the font size by 1 at the current location or selection in a - * GtkWebView. + * PidginWebView. */ -void gtk_webview_font_grow(GtkWebView *webview); +void pidgin_webview_font_grow(PidginWebView *webview); /** - * gtk_webview_insert_hr: - * @webview: The GtkWebView + * pidgin_webview_insert_hr: + * @webview: The PidginWebView * * Inserts a horizontal rule at the current location or selection in a - * GtkWebView. + * PidginWebView. */ -void gtk_webview_insert_hr(GtkWebView *webview); +void pidgin_webview_insert_hr(PidginWebView *webview); /** - * gtk_webview_insert_link: - * @webview: The GtkWebView + * pidgin_webview_insert_link: + * @webview: The PidginWebView * @url: The URL of the link * @desc: The text description of the link. If not supplied, the URL is * used instead. * - * Inserts a link at the current location or selection in a GtkWebView. + * Inserts a link at the current location or selection in a PidginWebView. */ -void gtk_webview_insert_link(GtkWebView *webview, const char *url, const char *desc); +void pidgin_webview_insert_link(PidginWebView *webview, const char *url, const char *desc); /** - * gtk_webview_insert_image: - * @webview: The GtkWebView + * pidgin_webview_insert_image: + * @webview: The PidginWebView * @id: The PurpleStoredImage id * - * Inserts an image at the current location or selection in a GtkWebView. + * Inserts an image at the current location or selection in a PidginWebView. */ -void gtk_webview_insert_image(GtkWebView *webview, int id); +void pidgin_webview_insert_image(PidginWebView *webview, int id); /** - * gtk_webview_get_protocol_name: - * @webview: The GtkWebView + * pidgin_webview_get_protocol_name: + * @webview: The PidginWebView * - * Gets the protocol name associated with this GtkWebView. + * Gets the protocol name associated with this PidginWebView. */ -const char *gtk_webview_get_protocol_name(GtkWebView *webview); +const char *pidgin_webview_get_protocol_name(PidginWebView *webview); /** - * gtk_webview_set_protocol_name: - * @webview: The GtkWebView - * @protocol_name: The protocol name to associate with the GtkWebView + * pidgin_webview_set_protocol_name: + * @webview: The PidginWebView + * @protocol_name: The protocol name to associate with the PidginWebView * - * Associates a protocol name with a GtkWebView. + * Associates a protocol name with a PidginWebView. */ -void gtk_webview_set_protocol_name(GtkWebView *webview, const char *protocol_name); +void pidgin_webview_set_protocol_name(PidginWebView *webview, const char *protocol_name); /** - * gtk_webview_smiley_create: + * pidgin_webview_smiley_create: * @file: The image file for the smiley * @shortcut: The key shortcut for the smiley * @hide: %TRUE if the smiley should be hidden in the smiley dialog, * %FALSE otherwise * @flags: The smiley flags * - * Create a new GtkWebViewSmiley. + * Create a new PidginWebViewSmiley. * * Returns: The newly created smiley */ -GtkWebViewSmiley *gtk_webview_smiley_create(const char *file, +PidginWebViewSmiley *pidgin_webview_smiley_create(const char *file, const char *shortcut, gboolean hide, - GtkWebViewSmileyFlags flags); + PidginWebViewSmileyFlags flags); /** - * gtk_webview_smiley_reload: + * pidgin_webview_smiley_reload: * @smiley: The smiley to reload * * Reload the image data for the smiley. */ -void gtk_webview_smiley_reload(GtkWebViewSmiley *smiley); +void pidgin_webview_smiley_reload(PidginWebViewSmiley *smiley); /** - * gtk_webview_smiley_destroy: + * pidgin_webview_smiley_destroy: * @smiley: The smiley to destroy * - * Destroy a GtkWebViewSmiley. + * Destroy a PidginWebViewSmiley. */ -void gtk_webview_smiley_destroy(GtkWebViewSmiley *smiley); +void pidgin_webview_smiley_destroy(PidginWebViewSmiley *smiley); /** - * gtk_webview_smiley_get_smile: + * pidgin_webview_smiley_get_smile: * @smiley: The smiley * * Returns the text associated with a smiley. * * Returns: The text */ -const char *gtk_webview_smiley_get_smile(const GtkWebViewSmiley *smiley); +const char *pidgin_webview_smiley_get_smile(const PidginWebViewSmiley *smiley); /** - * gtk_webview_smiley_get_file: + * pidgin_webview_smiley_get_file: * @smiley: The smiley * * Returns the file associated with a smiley. * * Returns: The file */ -const char *gtk_webview_smiley_get_file(const GtkWebViewSmiley *smiley); +const char *pidgin_webview_smiley_get_file(const PidginWebViewSmiley *smiley); /** - * gtk_webview_smiley_get_hidden: + * pidgin_webview_smiley_get_hidden: * @smiley: The smiley * * Returns the invisibility of a smiley. * * Returns: The hidden status */ -gboolean gtk_webview_smiley_get_hidden(const GtkWebViewSmiley *smiley); +gboolean pidgin_webview_smiley_get_hidden(const PidginWebViewSmiley *smiley); /** - * gtk_webview_smiley_get_flags: + * pidgin_webview_smiley_get_flags: * @smiley: The smiley * * Returns the flags associated with a smiley. * * Returns: The flags */ -GtkWebViewSmileyFlags gtk_webview_smiley_get_flags(const GtkWebViewSmiley *smiley); +PidginWebViewSmileyFlags pidgin_webview_smiley_get_flags(const PidginWebViewSmiley *smiley); /** - * gtk_webview_smiley_find: - * @webview: The GtkWebView + * pidgin_webview_smiley_find: + * @webview: The PidginWebView * @sml: The name of the smiley category * @text: The text associated with the smiley * * Returns: The smiley object associated with the text. */ -GtkWebViewSmiley *gtk_webview_smiley_find(GtkWebView *webview, const char *sml, +PidginWebViewSmiley *pidgin_webview_smiley_find(PidginWebView *webview, const char *sml, const char *text); /** - * gtk_webview_associate_smiley: - * @webview: The GtkWebView + * pidgin_webview_associate_smiley: + * @webview: The PidginWebView * @sml: The name of the smiley category - * @smiley: The GtkWebViewSmiley to associate + * @smiley: The PidginWebViewSmiley to associate * - * Associates a smiley with a GtkWebView. + * Associates a smiley with a PidginWebView. */ -void gtk_webview_associate_smiley(GtkWebView *webview, const char *sml, - GtkWebViewSmiley *smiley); +void pidgin_webview_associate_smiley(PidginWebView *webview, const char *sml, + PidginWebViewSmiley *smiley); /** - * gtk_webview_remove_smileys: - * @webview: The GtkWebView. + * pidgin_webview_remove_smileys: + * @webview: The PidginWebView. * - * Removes all smileys associated with a GtkWebView. + * Removes all smileys associated with a PidginWebView. */ -void gtk_webview_remove_smileys(GtkWebView *webview); +void pidgin_webview_remove_smileys(PidginWebView *webview); /** - * gtk_webview_insert_smiley: - * @webview: The GtkWebView + * pidgin_webview_insert_smiley: + * @webview: The PidginWebView * @sml: The category of the smiley * @smiley: The text of the smiley to insert * - * Inserts a smiley at the current location or selection in a GtkWebView. + * Inserts a smiley at the current location or selection in a PidginWebView. */ -void gtk_webview_insert_smiley(GtkWebView *webview, const char *sml, +void pidgin_webview_insert_smiley(PidginWebView *webview, const char *sml, const char *smiley); /** - * gtk_webview_show_toolbar: - * @webview: The GtkWebView. + * pidgin_webview_show_toolbar: + * @webview: The PidginWebView. * - * Makes the toolbar associated with a GtkWebView visible. + * Makes the toolbar associated with a PidginWebView visible. */ -void gtk_webview_show_toolbar(GtkWebView *webview); +void pidgin_webview_show_toolbar(PidginWebView *webview); /** - * gtk_webview_hide_toolbar: - * @webview: The GtkWebView. + * pidgin_webview_hide_toolbar: + * @webview: The PidginWebView. * - * Makes the toolbar associated with a GtkWebView invisible. + * Makes the toolbar associated with a PidginWebView invisible. */ -void gtk_webview_hide_toolbar(GtkWebView *webview); +void pidgin_webview_hide_toolbar(PidginWebView *webview); /** - * gtk_webview_activate_toolbar: - * @webview: The GtkWebView - * @action: The GtkWebViewAction + * pidgin_webview_activate_toolbar: + * @webview: The PidginWebView + * @action: The PidginWebViewAction * - * Activate an action on the toolbar associated with a GtkWebView. + * Activate an action on the toolbar associated with a PidginWebView. */ -void gtk_webview_activate_toolbar(GtkWebView *webview, GtkWebViewAction action); +void pidgin_webview_activate_toolbar(PidginWebView *webview, PidginWebViewAction action); /* Do not use. */ void -gtk_webview_set_toolbar(GtkWebView *webview, GtkWidget *toolbar); +pidgin_webview_set_toolbar(PidginWebView *webview, GtkWidget *toolbar); G_END_DECLS diff --git a/pidgin/gtkwebviewtoolbar.c b/pidgin/gtkwebviewtoolbar.c index 289fa10b2e..79b9d3f304 100644 --- a/pidgin/gtkwebviewtoolbar.c +++ b/pidgin/gtkwebviewtoolbar.c @@ -40,14 +40,14 @@ #include "gtk3compat.h" -#define GTK_WEBVIEWTOOLBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_TYPE_WEBVIEWTOOLBAR, GtkWebViewToolbarPriv)) +#define PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_TYPE_WEBVIEWTOOLBAR, PidginWebViewToolbarPriv)) /****************************************************************************** * Structs *****************************************************************************/ -typedef struct _GtkWebViewToolbarPriv { +typedef struct _PidginWebViewToolbarPriv { PurpleConversation *active_conv; GtkWidget *wide_view; @@ -89,7 +89,7 @@ typedef struct _GtkWebViewToolbarPriv { GtkWidget *image_dialog; char *sml; -} GtkWebViewToolbarPriv; +} PidginWebViewToolbarPriv; /****************************************************************************** * Globals @@ -103,64 +103,64 @@ static GtkHBoxClass *parent_class = NULL; static void toggle_action_set_active_block(GtkToggleAction *action, gboolean is_active, - GtkWebViewToolbar *toolbar); + PidginWebViewToolbar *toolbar); /****************************************************************************** * Helpers *****************************************************************************/ static void -do_bold(GtkAction *bold, GtkWebViewToolbar *toolbar) +do_bold(GtkAction *bold, PidginWebViewToolbar *toolbar) { g_return_if_fail(toolbar != NULL); - gtk_webview_toggle_bold(GTK_WEBVIEW(toolbar->webview)); + pidgin_webview_toggle_bold(PIDGIN_WEBVIEW(toolbar->webview)); gtk_widget_grab_focus(toolbar->webview); } static void -do_italic(GtkAction *italic, GtkWebViewToolbar *toolbar) +do_italic(GtkAction *italic, PidginWebViewToolbar *toolbar) { g_return_if_fail(toolbar != NULL); - gtk_webview_toggle_italic(GTK_WEBVIEW(toolbar->webview)); + pidgin_webview_toggle_italic(PIDGIN_WEBVIEW(toolbar->webview)); gtk_widget_grab_focus(toolbar->webview); } static void -do_underline(GtkAction *underline, GtkWebViewToolbar *toolbar) +do_underline(GtkAction *underline, PidginWebViewToolbar *toolbar) { g_return_if_fail(toolbar != NULL); - gtk_webview_toggle_underline(GTK_WEBVIEW(toolbar->webview)); + pidgin_webview_toggle_underline(PIDGIN_WEBVIEW(toolbar->webview)); gtk_widget_grab_focus(toolbar->webview); } static void -do_strikethrough(GtkAction *strikethrough, GtkWebViewToolbar *toolbar) +do_strikethrough(GtkAction *strikethrough, PidginWebViewToolbar *toolbar) { g_return_if_fail(toolbar != NULL); - gtk_webview_toggle_strike(GTK_WEBVIEW(toolbar->webview)); + pidgin_webview_toggle_strike(PIDGIN_WEBVIEW(toolbar->webview)); gtk_widget_grab_focus(toolbar->webview); } static void -do_small(GtkAction *small, GtkWebViewToolbar *toolbar) +do_small(GtkAction *small, PidginWebViewToolbar *toolbar) { g_return_if_fail(toolbar != NULL); - gtk_webview_font_shrink(GTK_WEBVIEW(toolbar->webview)); + pidgin_webview_font_shrink(PIDGIN_WEBVIEW(toolbar->webview)); gtk_widget_grab_focus(toolbar->webview); } static void -do_big(GtkAction *large, GtkWebViewToolbar *toolbar) +do_big(GtkAction *large, PidginWebViewToolbar *toolbar) { g_return_if_fail(toolbar); - gtk_webview_font_grow(GTK_WEBVIEW(toolbar->webview)); + pidgin_webview_font_grow(PIDGIN_WEBVIEW(toolbar->webview)); gtk_widget_grab_focus(toolbar->webview); } static void -destroy_toolbar_font(GtkWebViewToolbar *toolbar) +destroy_toolbar_font(PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (priv->font_dialog != NULL) { @@ -170,10 +170,10 @@ destroy_toolbar_font(GtkWebViewToolbar *toolbar) } static void -realize_toolbar_font(GtkWidget *widget, GtkWebViewToolbar *toolbar) +realize_toolbar_font(GtkWidget *widget, PidginWebViewToolbar *toolbar) { #if !GTK_CHECK_VERSION(3,2,0) - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkFontSelection *sel; sel = GTK_FONT_SELECTION( @@ -189,7 +189,7 @@ realize_toolbar_font(GtkWidget *widget, GtkWebViewToolbar *toolbar) } static void -apply_font(GtkDialog *dialog, gint response, GtkWebViewToolbar *toolbar) +apply_font(GtkDialog *dialog, gint response, PidginWebViewToolbar *toolbar) { /* this could be expanded to include font size, weight, etc. but for now only works with font face */ @@ -206,26 +206,26 @@ apply_font(GtkDialog *dialog, gint response, GtkWebViewToolbar *toolbar) family_name = pango_font_description_get_family(desc); if (family_name) { - gtk_webview_toggle_fontface(GTK_WEBVIEW(toolbar->webview), + pidgin_webview_toggle_fontface(PIDGIN_WEBVIEW(toolbar->webview), family_name); } pango_font_description_free(desc); g_free(fontname); } else { - gtk_webview_toggle_fontface(GTK_WEBVIEW(toolbar->webview), ""); + pidgin_webview_toggle_fontface(PIDGIN_WEBVIEW(toolbar->webview), ""); } destroy_toolbar_font(toolbar); } static void -toggle_font(GtkAction *font, GtkWebViewToolbar *toolbar) +toggle_font(GtkAction *font, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(font))) { - char *fontname = gtk_webview_get_current_fontface(GTK_WEBVIEW(toolbar->webview)); + char *fontname = pidgin_webview_get_current_fontface(PIDGIN_WEBVIEW(toolbar->webview)); if (!priv->font_dialog) { GtkWindow *window; @@ -239,7 +239,7 @@ toggle_font(GtkAction *font, GtkWebViewToolbar *toolbar) g_free(fonttif); } else { gtk_font_chooser_set_font(GTK_FONT_CHOOSER(priv->font_dialog), - DEFAULT_FONT_FACE); + PIDGIN_DEFAULT_FONT_FACE); } g_signal_connect(G_OBJECT(priv->font_dialog), "response", @@ -260,12 +260,12 @@ toggle_font(GtkAction *font, GtkWebViewToolbar *toolbar) static gboolean destroy_toolbar_fgcolor(GtkWidget *widget, GdkEvent *event, - GtkWebViewToolbar *toolbar) + PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (widget != NULL) - gtk_webview_toggle_forecolor(GTK_WEBVIEW(toolbar->webview), ""); + pidgin_webview_toggle_forecolor(PIDGIN_WEBVIEW(toolbar->webview), ""); if (priv->fgcolor_dialog != NULL) { @@ -277,15 +277,15 @@ destroy_toolbar_fgcolor(GtkWidget *widget, GdkEvent *event, } static void -cancel_toolbar_fgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) +cancel_toolbar_fgcolor(GtkWidget *widget, PidginWebViewToolbar *toolbar) { destroy_toolbar_fgcolor(widget, NULL, toolbar); } static void -do_fgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) +do_fgcolor(GtkWidget *widget, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkColorSelectionDialog *dialog; GtkColorSelection *colorsel; GdkColor text_color; @@ -300,21 +300,21 @@ do_fgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) text_color.red / 256, text_color.green / 256, text_color.blue / 256); - gtk_webview_toggle_forecolor(GTK_WEBVIEW(toolbar->webview), open_tag); + pidgin_webview_toggle_forecolor(PIDGIN_WEBVIEW(toolbar->webview), open_tag); g_free(open_tag); cancel_toolbar_fgcolor(NULL, toolbar); } static void -toggle_fg_color(GtkAction *color, GtkWebViewToolbar *toolbar) +toggle_fg_color(GtkAction *color, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(color))) { GtkWidget *colorsel; GdkColor fgcolor; - char *color = gtk_webview_get_current_forecolor(GTK_WEBVIEW(toolbar->webview)); + char *color = pidgin_webview_get_current_forecolor(PIDGIN_WEBVIEW(toolbar->webview)); if (!priv->fgcolor_dialog) { GtkWidget *ok_button; @@ -350,11 +350,11 @@ toggle_fg_color(GtkAction *color, GtkWebViewToolbar *toolbar) static gboolean destroy_toolbar_bgcolor(GtkWidget *widget, GdkEvent *event, - GtkWebViewToolbar *toolbar) + PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (widget != NULL) { - gtk_webview_toggle_backcolor(GTK_WEBVIEW(toolbar->webview), ""); + pidgin_webview_toggle_backcolor(PIDGIN_WEBVIEW(toolbar->webview), ""); } if (priv->bgcolor_dialog != NULL) @@ -367,15 +367,15 @@ destroy_toolbar_bgcolor(GtkWidget *widget, GdkEvent *event, } static void -cancel_toolbar_bgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) +cancel_toolbar_bgcolor(GtkWidget *widget, PidginWebViewToolbar *toolbar) { destroy_toolbar_bgcolor(widget, NULL, toolbar); } static void -do_bgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) +do_bgcolor(GtkWidget *widget, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkColorSelectionDialog *dialog; GtkColorSelection *colorsel; GdkColor text_color; @@ -390,21 +390,21 @@ do_bgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) text_color.red / 256, text_color.green / 256, text_color.blue / 256); - gtk_webview_toggle_backcolor(GTK_WEBVIEW(toolbar->webview), open_tag); + pidgin_webview_toggle_backcolor(PIDGIN_WEBVIEW(toolbar->webview), open_tag); g_free(open_tag); cancel_toolbar_bgcolor(NULL, toolbar); } static void -toggle_bg_color(GtkAction *color, GtkWebViewToolbar *toolbar) +toggle_bg_color(GtkAction *color, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(color))) { GtkWidget *colorsel; GdkColor bgcolor; - char *color = gtk_webview_get_current_backcolor(GTK_WEBVIEW(toolbar->webview)); + char *color = pidgin_webview_get_current_backcolor(PIDGIN_WEBVIEW(toolbar->webview)); if (!priv->bgcolor_dialog) { GtkWidget *ok_button; @@ -441,25 +441,25 @@ toggle_bg_color(GtkAction *color, GtkWebViewToolbar *toolbar) } static void -clear_formatting_cb(GtkAction *clear, GtkWebViewToolbar *toolbar) +clear_formatting_cb(GtkAction *clear, PidginWebViewToolbar *toolbar) { - gtk_webview_clear_formatting(GTK_WEBVIEW(toolbar->webview)); + pidgin_webview_clear_formatting(PIDGIN_WEBVIEW(toolbar->webview)); gtk_widget_grab_focus(toolbar->webview); } static void -cancel_link_cb(GtkWebViewToolbar *toolbar, PurpleRequestFields *fields) +cancel_link_cb(PidginWebViewToolbar *toolbar, PurpleRequestFields *fields) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(priv->link), FALSE); priv->link_dialog = NULL; } static void -close_link_dialog(GtkWebViewToolbar *toolbar) +close_link_dialog(PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (priv->link_dialog != NULL) { purple_request_close(PURPLE_REQUEST_FIELDS, priv->link_dialog); @@ -468,18 +468,18 @@ close_link_dialog(GtkWebViewToolbar *toolbar) } static void -do_insert_link_cb(GtkWebViewToolbar *toolbar, PurpleRequestFields *fields) +do_insert_link_cb(PidginWebViewToolbar *toolbar, PurpleRequestFields *fields) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); const char *url, *description; url = purple_request_fields_get_string(fields, "url"); - if (gtk_webview_get_format_functions(GTK_WEBVIEW(toolbar->webview)) & GTK_WEBVIEW_LINKDESC) + if (pidgin_webview_get_format_functions(PIDGIN_WEBVIEW(toolbar->webview)) & PIDGIN_WEBVIEW_LINKDESC) description = purple_request_fields_get_string(fields, "description"); else description = NULL; - gtk_webview_insert_link(GTK_WEBVIEW(toolbar->webview), url, description); + pidgin_webview_insert_link(PIDGIN_WEBVIEW(toolbar->webview), url, description); gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(priv->link), FALSE); @@ -487,9 +487,9 @@ do_insert_link_cb(GtkWebViewToolbar *toolbar, PurpleRequestFields *fields) } static void -insert_link_cb(GtkAction *action, GtkWebViewToolbar *toolbar) +insert_link_cb(GtkAction *action, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(priv->link))) { PurpleRequestFields *fields; @@ -507,8 +507,8 @@ insert_link_cb(GtkAction *action, GtkWebViewToolbar *toolbar) purple_request_field_set_required(field, TRUE); purple_request_field_group_add_field(group, field); - if (gtk_webview_get_format_functions(GTK_WEBVIEW(toolbar->webview)) & GTK_WEBVIEW_LINKDESC) { - desc = gtk_webview_get_selected_text(GTK_WEBVIEW(toolbar->webview)); + if (pidgin_webview_get_format_functions(PIDGIN_WEBVIEW(toolbar->webview)) & PIDGIN_WEBVIEW_LINKDESC) { + desc = pidgin_webview_get_selected_text(PIDGIN_WEBVIEW(toolbar->webview)); field = purple_request_field_string_new("description", _("_Description"), desc, FALSE); purple_request_field_group_add_field(group, field); @@ -535,15 +535,15 @@ insert_link_cb(GtkAction *action, GtkWebViewToolbar *toolbar) } static void -insert_hr_cb(GtkAction *action, GtkWebViewToolbar *toolbar) +insert_hr_cb(GtkAction *action, PidginWebViewToolbar *toolbar) { - gtk_webview_insert_hr(GTK_WEBVIEW(toolbar->webview)); + pidgin_webview_insert_hr(PIDGIN_WEBVIEW(toolbar->webview)); } static void -do_insert_image_cb(GtkWidget *widget, int response, GtkWebViewToolbar *toolbar) +do_insert_image_cb(GtkWidget *widget, int response, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); gchar *filename = NULL, *name, *buf; char *filedata; size_t size; @@ -584,16 +584,16 @@ do_insert_image_cb(GtkWidget *widget, int response, GtkWebViewToolbar *toolbar) g_free(filename); - gtk_webview_insert_image(GTK_WEBVIEW(toolbar->webview), id); + pidgin_webview_insert_image(PIDGIN_WEBVIEW(toolbar->webview), id); /* TODO: do it after passing an image to prpl, not before * purple_imgstore_unref_by_id(id); */ } static void -insert_image_cb(GtkAction *action, GtkWebViewToolbar *toolbar) +insert_image_cb(GtkAction *action, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkWidget *window; if (!priv->image_dialog) { @@ -617,9 +617,9 @@ insert_image_cb(GtkAction *action, GtkWebViewToolbar *toolbar) } static void -destroy_smiley_dialog(GtkWebViewToolbar *toolbar) +destroy_smiley_dialog(PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (priv->smiley_dialog != NULL) { gtk_widget_destroy(priv->smiley_dialog); @@ -628,23 +628,23 @@ destroy_smiley_dialog(GtkWebViewToolbar *toolbar) } static gboolean -close_smiley_dialog(GtkWebViewToolbar *toolbar) +close_smiley_dialog(PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(priv->smiley), FALSE); return FALSE; } static void -insert_smiley_text(GtkWidget *widget, GtkWebViewToolbar *toolbar) +insert_smiley_text(GtkWidget *widget, PidginWebViewToolbar *toolbar) { char *smiley_text, *escaped_smiley; smiley_text = g_object_get_data(G_OBJECT(widget), "smiley_text"); escaped_smiley = g_markup_escape_text(smiley_text, -1); - gtk_webview_insert_smiley(GTK_WEBVIEW(toolbar->webview), - gtk_webview_get_protocol_name(GTK_WEBVIEW(toolbar->webview)), + pidgin_webview_insert_smiley(PIDGIN_WEBVIEW(toolbar->webview), + pidgin_webview_get_protocol_name(PIDGIN_WEBVIEW(toolbar->webview)), escaped_smiley); g_free(escaped_smiley); @@ -656,23 +656,23 @@ insert_smiley_text(GtkWidget *widget, GtkWebViewToolbar *toolbar) struct smiley_button_list { int width, height; GtkWidget *button; - const GtkWebViewSmiley *smiley; + const PidginWebViewSmiley *smiley; struct smiley_button_list *next; }; static struct smiley_button_list * -sort_smileys(struct smiley_button_list *ls, GtkWebViewToolbar *toolbar, - int *width, const GtkWebViewSmiley *smiley) +sort_smileys(struct smiley_button_list *ls, PidginWebViewToolbar *toolbar, + int *width, const PidginWebViewSmiley *smiley) { GtkWidget *image; GtkWidget *button; GtkRequisition size; struct smiley_button_list *cur; struct smiley_button_list *it, *it_last; - const gchar *filename = gtk_webview_smiley_get_file(smiley); - const gchar *face = gtk_webview_smiley_get_smile(smiley); + const gchar *filename = pidgin_webview_smiley_get_file(smiley); + const gchar *face = pidgin_webview_smiley_get_smile(smiley); PurpleSmiley *psmiley = NULL; - gboolean supports_custom = (gtk_webview_get_format_functions(GTK_WEBVIEW(toolbar->webview)) & GTK_WEBVIEW_CUSTOM_SMILEY); + gboolean supports_custom = (pidgin_webview_get_format_functions(PIDGIN_WEBVIEW(toolbar->webview)) & PIDGIN_WEBVIEW_CUSTOM_SMILEY); cur = g_new0(struct smiley_button_list, 1); it = ls; @@ -682,7 +682,7 @@ sort_smileys(struct smiley_button_list *ls, GtkWebViewToolbar *toolbar, gtk_widget_get_preferred_size(image, NULL, &size); if ((size.width > 24) - && (gtk_webview_smiley_get_flags(smiley) & GTK_WEBVIEW_SMILEY_CUSTOM)) { + && (pidgin_webview_smiley_get_flags(smiley) & PIDGIN_WEBVIEW_SMILEY_CUSTOM)) { /* This is a custom smiley, let's scale it */ GdkPixbuf *pixbuf = NULL; GtkImageType type; @@ -728,7 +728,7 @@ sort_smileys(struct smiley_button_list *ls, GtkWebViewToolbar *toolbar, "shadowed" by any custom smiley. This can only happen if the connection is custom smiley-enabled */ if (supports_custom && psmiley - && !(gtk_webview_smiley_get_flags(smiley) & GTK_WEBVIEW_SMILEY_CUSTOM)) { + && !(pidgin_webview_smiley_get_flags(smiley) & PIDGIN_WEBVIEW_SMILEY_CUSTOM)) { gchar tip[128]; g_snprintf(tip, sizeof(tip), _("This smiley is disabled because a custom smiley exists for this shortcut:\n %s"), @@ -761,12 +761,12 @@ sort_smileys(struct smiley_button_list *ls, GtkWebViewToolbar *toolbar, } static gboolean -smiley_is_unique(GSList *list, GtkWebViewSmiley *smiley) +smiley_is_unique(GSList *list, PidginWebViewSmiley *smiley) { - const char *file = gtk_webview_smiley_get_file(smiley); + const char *file = pidgin_webview_smiley_get_file(smiley); while (list) { - GtkWebViewSmiley *cur = (GtkWebViewSmiley *)list->data; - if (!strcmp(gtk_webview_smiley_get_file(cur), file)) + PidginWebViewSmiley *cur = (PidginWebViewSmiley *)list->data; + if (!strcmp(pidgin_webview_smiley_get_file(cur), file)) return FALSE; list = list->next; } @@ -775,7 +775,7 @@ smiley_is_unique(GSList *list, GtkWebViewSmiley *smiley) static gboolean smiley_dialog_input_cb(GtkWidget *dialog, GdkEvent *event, - GtkWebViewToolbar *toolbar) + PidginWebViewToolbar *toolbar) { if ((event->type == GDK_KEY_PRESS && event->key.keyval == GDK_KEY_Escape) || (event->type == GDK_BUTTON_PRESS && event->button.button == 1)) @@ -800,7 +800,7 @@ add_smiley_list(GtkWidget *container, struct smiley_button_list *list, line = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(container), line, FALSE, FALSE, 0); for (; list; list = list->next) { - if (custom != !!(gtk_webview_smiley_get_flags(list->smiley) & GTK_WEBVIEW_SMILEY_CUSTOM)) + if (custom != !!(pidgin_webview_smiley_get_flags(list->smiley) & PIDGIN_WEBVIEW_SMILEY_CUSTOM)) continue; gtk_box_pack_start(GTK_BOX(line), list->button, FALSE, FALSE, 0); gtk_widget_show(list->button); @@ -816,9 +816,9 @@ add_smiley_list(GtkWidget *container, struct smiley_button_list *list, } static void -insert_smiley_cb(GtkAction *smiley, GtkWebViewToolbar *toolbar) +insert_smiley_cb(GtkAction *smiley, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkWidget *dialog, *vbox; GtkWidget *smiley_table = NULL; GSList *smileys, *unique_smileys = NULL; @@ -842,22 +842,22 @@ insert_smiley_cb(GtkAction *smiley, GtkWebViewToolbar *toolbar) large number of smileys... need to reverse the list after for the dialog to work... */ while (smileys) { - GtkWebViewSmiley *smiley = (GtkWebViewSmiley *)smileys->data; - if (!gtk_webview_smiley_get_hidden(smiley)) { + PidginWebViewSmiley *smiley = (PidginWebViewSmiley *)smileys->data; + if (!pidgin_webview_smiley_get_hidden(smiley)) { if (smiley_is_unique(unique_smileys, smiley)) { unique_smileys = g_slist_prepend(unique_smileys, smiley); } } smileys = smileys->next; } - supports_custom = (gtk_webview_get_format_functions(GTK_WEBVIEW(toolbar->webview)) & GTK_WEBVIEW_CUSTOM_SMILEY); + supports_custom = (pidgin_webview_get_format_functions(PIDGIN_WEBVIEW(toolbar->webview)) & PIDGIN_WEBVIEW_CUSTOM_SMILEY); if (toolbar->webview && supports_custom) { const GSList *iterator = NULL; custom_smileys = pidgin_smileys_get_all(); for (iterator = custom_smileys ; iterator ; iterator = g_slist_next(iterator)) { - GtkWebViewSmiley *smiley = (GtkWebViewSmiley *)iterator->data; + PidginWebViewSmiley *smiley = (PidginWebViewSmiley *)iterator->data; unique_smileys = g_slist_prepend(unique_smileys, smiley); } } @@ -893,8 +893,8 @@ insert_smiley_cb(GtkAction *smiley, GtkWebViewToolbar *toolbar) /* create list of smileys sorted by height */ while (unique_smileys) { - GtkWebViewSmiley *smiley = (GtkWebViewSmiley *)unique_smileys->data; - if (!gtk_webview_smiley_get_hidden(smiley)) { + PidginWebViewSmiley *smiley = (PidginWebViewSmiley *)unique_smileys->data; + if (!pidgin_webview_smiley_get_hidden(smiley)) { ls = sort_smileys(ls, toolbar, &max_line_width, smiley); } unique_smileys = g_slist_delete_link(unique_smileys, unique_smileys); @@ -963,9 +963,9 @@ insert_smiley_cb(GtkAction *smiley, GtkWebViewToolbar *toolbar) } static void -send_attention_cb(GtkAction *attention, GtkWebViewToolbar *toolbar) +send_attention_cb(GtkAction *attention, PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); PurpleConversation *conv = priv->active_conv; const gchar *who = purple_conversation_get_name(conv); PurpleConnection *gc = purple_conversation_get_connection(conv); @@ -975,37 +975,37 @@ send_attention_cb(GtkAction *attention, GtkWebViewToolbar *toolbar) } static void -update_buttons_cb(GtkWebView *webview, GtkWebViewButtons buttons, - GtkWebViewToolbar *toolbar) +update_buttons_cb(PidginWebView *webview, PidginWebViewButtons buttons, + PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); - gtk_action_set_sensitive(priv->bold, buttons & GTK_WEBVIEW_BOLD); - gtk_action_set_sensitive(priv->italic, buttons & GTK_WEBVIEW_ITALIC); - gtk_action_set_sensitive(priv->underline, buttons & GTK_WEBVIEW_UNDERLINE); - gtk_action_set_sensitive(priv->strike, buttons & GTK_WEBVIEW_STRIKE); + gtk_action_set_sensitive(priv->bold, buttons & PIDGIN_WEBVIEW_BOLD); + gtk_action_set_sensitive(priv->italic, buttons & PIDGIN_WEBVIEW_ITALIC); + gtk_action_set_sensitive(priv->underline, buttons & PIDGIN_WEBVIEW_UNDERLINE); + gtk_action_set_sensitive(priv->strike, buttons & PIDGIN_WEBVIEW_STRIKE); - gtk_action_set_sensitive(priv->larger_size, buttons & GTK_WEBVIEW_GROW); - gtk_action_set_sensitive(priv->smaller_size, buttons & GTK_WEBVIEW_SHRINK); + gtk_action_set_sensitive(priv->larger_size, buttons & PIDGIN_WEBVIEW_GROW); + gtk_action_set_sensitive(priv->smaller_size, buttons & PIDGIN_WEBVIEW_SHRINK); - gtk_action_set_sensitive(priv->font, buttons & GTK_WEBVIEW_FACE); - gtk_action_set_sensitive(priv->fgcolor, buttons & GTK_WEBVIEW_FORECOLOR); - gtk_action_set_sensitive(priv->bgcolor, buttons & GTK_WEBVIEW_BACKCOLOR); + gtk_action_set_sensitive(priv->font, buttons & PIDGIN_WEBVIEW_FACE); + gtk_action_set_sensitive(priv->fgcolor, buttons & PIDGIN_WEBVIEW_FORECOLOR); + gtk_action_set_sensitive(priv->bgcolor, buttons & PIDGIN_WEBVIEW_BACKCOLOR); gtk_action_set_sensitive(priv->clear, - (buttons & GTK_WEBVIEW_BOLD || - buttons & GTK_WEBVIEW_ITALIC || - buttons & GTK_WEBVIEW_UNDERLINE || - buttons & GTK_WEBVIEW_STRIKE || - buttons & GTK_WEBVIEW_GROW || - buttons & GTK_WEBVIEW_SHRINK || - buttons & GTK_WEBVIEW_FACE || - buttons & GTK_WEBVIEW_FORECOLOR || - buttons & GTK_WEBVIEW_BACKCOLOR)); - - gtk_action_set_sensitive(priv->image, buttons & GTK_WEBVIEW_IMAGE); - gtk_action_set_sensitive(priv->link, buttons & GTK_WEBVIEW_LINK); - gtk_action_set_sensitive(priv->smiley, (buttons & GTK_WEBVIEW_SMILEY) && + (buttons & PIDGIN_WEBVIEW_BOLD || + buttons & PIDGIN_WEBVIEW_ITALIC || + buttons & PIDGIN_WEBVIEW_UNDERLINE || + buttons & PIDGIN_WEBVIEW_STRIKE || + buttons & PIDGIN_WEBVIEW_GROW || + buttons & PIDGIN_WEBVIEW_SHRINK || + buttons & PIDGIN_WEBVIEW_FACE || + buttons & PIDGIN_WEBVIEW_FORECOLOR || + buttons & PIDGIN_WEBVIEW_BACKCOLOR)); + + gtk_action_set_sensitive(priv->image, buttons & PIDGIN_WEBVIEW_IMAGE); + gtk_action_set_sensitive(priv->link, buttons & PIDGIN_WEBVIEW_LINK); + gtk_action_set_sensitive(priv->smiley, (buttons & PIDGIN_WEBVIEW_SMILEY) && pidgin_themes_get_proto_smileys(priv->sml)); } @@ -1015,7 +1015,7 @@ update_buttons_cb(GtkWebView *webview, GtkWebViewButtons buttons, */ static void toggle_action_set_active_block(GtkToggleAction *action, gboolean is_active, - GtkWebViewToolbar *toolbar) + PidginWebViewToolbar *toolbar) { GObject *object; g_return_if_fail(toolbar); @@ -1030,16 +1030,16 @@ toggle_action_set_active_block(GtkToggleAction *action, gboolean is_active, } static void -update_buttons(GtkWebViewToolbar *toolbar) +update_buttons(PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); gboolean bold, italic, underline, strike; char *tmp; char *label; label = g_strdup(_("_Font")); - gtk_webview_get_current_format(GTK_WEBVIEW(toolbar->webview), + pidgin_webview_get_current_format(PIDGIN_WEBVIEW(toolbar->webview), &bold, &italic, &underline, &strike); if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(priv->bold)) != bold) @@ -1076,7 +1076,7 @@ update_buttons(GtkWebViewToolbar *toolbar) label = markup; } - tmp = gtk_webview_get_current_fontface(GTK_WEBVIEW(toolbar->webview)); + tmp = pidgin_webview_get_current_fontface(PIDGIN_WEBVIEW(toolbar->webview)); toggle_action_set_active_block(GTK_TOGGLE_ACTION(priv->font), (tmp && *tmp), toolbar); if (tmp && *tmp) { @@ -1087,7 +1087,7 @@ update_buttons(GtkWebViewToolbar *toolbar) } g_free(tmp); - tmp = gtk_webview_get_current_forecolor(GTK_WEBVIEW(toolbar->webview)); + tmp = pidgin_webview_get_current_forecolor(PIDGIN_WEBVIEW(toolbar->webview)); /* TODO: rgb()/rgba() colors are not supported by GTK, so let's get rid * of such warnings for now. There are two solutions: rewrite those * colors to #aabbcc or implement the toolbar in javascript. @@ -1104,7 +1104,7 @@ update_buttons(GtkWebViewToolbar *toolbar) } g_free(tmp); - tmp = gtk_webview_get_current_backcolor(GTK_WEBVIEW(toolbar->webview)); + tmp = pidgin_webview_get_current_backcolor(PIDGIN_WEBVIEW(toolbar->webview)); /* TODO: see comment above */ if (tmp && strncmp(tmp, "rgb", 3) == 0) tmp[0] = '\0'; @@ -1122,20 +1122,20 @@ update_buttons(GtkWebViewToolbar *toolbar) } static void -toggle_button_cb(GtkWebView *webview, GtkWebViewButtons buttons, - GtkWebViewToolbar *toolbar) +toggle_button_cb(PidginWebView *webview, PidginWebViewButtons buttons, + PidginWebViewToolbar *toolbar) { update_buttons(toolbar); } static void -update_format_cb(GtkWebView *webview, GtkWebViewToolbar *toolbar) +update_format_cb(PidginWebView *webview, PidginWebViewToolbar *toolbar) { update_buttons(toolbar); } static void -mark_set_cb(GtkWebView *webview, GtkWebViewToolbar *toolbar) +mark_set_cb(PidginWebView *webview, PidginWebViewToolbar *toolbar) { update_buttons(toolbar); } @@ -1186,17 +1186,17 @@ pidgin_menu_deactivate(GtkWidget *menu, GtkToggleButton *button) } static void -switch_toolbar_view(GtkWidget *item, GtkWebViewToolbar *toolbar) +switch_toolbar_view(GtkWidget *item, PidginWebViewToolbar *toolbar) { purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide", !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide")); } static gboolean -gtk_webviewtoolbar_popup_menu(GtkWidget *widget, GdkEventButton *event, - GtkWebViewToolbar *toolbar) +pidgin_webviewtoolbar_popup_menu(GtkWidget *widget, GdkEventButton *event, + PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkWidget *menu; GtkWidget *item; gboolean wide; @@ -1231,7 +1231,7 @@ static void webviewtoolbar_view_pref_changed(const char *name, PurplePrefType type, gconstpointer value, gpointer toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (value) { gtk_widget_hide(priv->lean_view); gtk_widget_show_all(priv->wide_view); @@ -1246,10 +1246,10 @@ webviewtoolbar_view_pref_changed(const char *name, PurplePrefType type, *****************************************************************************/ static void -gtk_webviewtoolbar_finalize(GObject *object) +pidgin_webviewtoolbar_finalize(GObject *object) { - GtkWebViewToolbar *toolbar = GTK_WEBVIEWTOOLBAR(object); - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbar *toolbar = PIDGIN_WEBVIEWTOOLBAR(object); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); if (priv->image_dialog != NULL) { @@ -1270,7 +1270,7 @@ gtk_webviewtoolbar_finalize(GObject *object) G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, toolbar); #if 0 - g_signal_handlers_disconnect_matched(GTK_WEBVIEW(toolbar->webview)->text_buffer, + g_signal_handlers_disconnect_matched(PIDGIN_WEBVIEW(toolbar->webview)->text_buffer, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, toolbar); #endif @@ -1289,23 +1289,23 @@ gtk_webviewtoolbar_finalize(GObject *object) } static void -gtk_webviewtoolbar_class_init(GtkWebViewToolbarClass *class) +pidgin_webviewtoolbar_class_init(PidginWebViewToolbarClass *class) { GObjectClass *gobject_class; gobject_class = (GObjectClass *)class; parent_class = g_type_class_ref(GTK_TYPE_HBOX); - gobject_class->finalize = gtk_webviewtoolbar_finalize; + gobject_class->finalize = pidgin_webviewtoolbar_finalize; - g_type_class_add_private(class, sizeof(GtkWebViewToolbarPriv)); + g_type_class_add_private(class, sizeof(PidginWebViewToolbarPriv)); purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/toolbar"); purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide", FALSE); } static void -gtk_webviewtoolbar_create_actions(GtkWebViewToolbar *toolbar) +pidgin_webviewtoolbar_create_actions(PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkActionGroup *action_group; gsize i; struct { @@ -1337,7 +1337,7 @@ gtk_webviewtoolbar_create_actions(GtkWebViewToolbar *toolbar) {&priv->attention, "SendAttention", PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, N_("_Attention!"), N_("Get Attention"), send_attention_cb, FALSE}, }; - action_group = gtk_action_group_new("GtkWebViewToolbar"); + action_group = gtk_action_group_new("PidginWebViewToolbar"); #ifdef ENABLE_NLS gtk_action_group_set_translation_domain(action_group, PACKAGE); #endif @@ -1361,9 +1361,9 @@ gtk_webviewtoolbar_create_actions(GtkWebViewToolbar *toolbar) } static void -gtk_webviewtoolbar_create_wide_view(GtkWebViewToolbar *toolbar) +pidgin_webviewtoolbar_create_wide_view(PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkAction *layout[] = { priv->bold, priv->italic, @@ -1406,9 +1406,9 @@ gtk_webviewtoolbar_create_wide_view(GtkWebViewToolbar *toolbar) } static void -gtk_webviewtoolbar_create_lean_view(GtkWebViewToolbar *toolbar) +pidgin_webviewtoolbar_create_lean_view(PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkWidget *label; GtkWidget *menuitem; GtkToolItem *sep; @@ -1506,14 +1506,14 @@ gtk_webviewtoolbar_create_lean_view(GtkWebViewToolbar *toolbar) } static void -gtk_webviewtoolbar_init(GtkWebViewToolbar *toolbar) +pidgin_webviewtoolbar_init(PidginWebViewToolbar *toolbar) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); GtkWidget *hbox = GTK_WIDGET(toolbar); - gtk_webviewtoolbar_create_actions(toolbar); - gtk_webviewtoolbar_create_wide_view(toolbar); - gtk_webviewtoolbar_create_lean_view(toolbar); + pidgin_webviewtoolbar_create_actions(toolbar); + pidgin_webviewtoolbar_create_wide_view(toolbar); + pidgin_webviewtoolbar_create_lean_view(toolbar); gtk_box_pack_start(GTK_BOX(hbox), priv->wide_view, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), priv->lean_view, TRUE, TRUE, 0); @@ -1535,7 +1535,7 @@ gtk_webviewtoolbar_init(GtkWebViewToolbar *toolbar) NULL, G_CONNECT_AFTER | G_CONNECT_SWAPPED); g_signal_connect(G_OBJECT(hbox), "button-press-event", - G_CALLBACK(gtk_webviewtoolbar_popup_menu), toolbar); + G_CALLBACK(pidgin_webviewtoolbar_popup_menu), toolbar); } /****************************************************************************** @@ -1543,41 +1543,41 @@ gtk_webviewtoolbar_init(GtkWebViewToolbar *toolbar) *****************************************************************************/ GtkWidget * -gtk_webviewtoolbar_new(void) +pidgin_webviewtoolbar_new(void) { - return GTK_WIDGET(g_object_new(gtk_webviewtoolbar_get_type(), NULL)); + return GTK_WIDGET(g_object_new(pidgin_webviewtoolbar_get_type(), NULL)); } GType -gtk_webviewtoolbar_get_type(void) +pidgin_webviewtoolbar_get_type(void) { static GType webviewtoolbar_type = 0; if (!webviewtoolbar_type) { static const GTypeInfo webviewtoolbar_info = { - sizeof(GtkWebViewToolbarClass), + sizeof(PidginWebViewToolbarClass), NULL, NULL, - (GClassInitFunc)gtk_webviewtoolbar_class_init, + (GClassInitFunc)pidgin_webviewtoolbar_class_init, NULL, NULL, - sizeof(GtkWebViewToolbar), + sizeof(PidginWebViewToolbar), 0, - (GInstanceInitFunc)gtk_webviewtoolbar_init, + (GInstanceInitFunc)pidgin_webviewtoolbar_init, NULL }; webviewtoolbar_type = g_type_register_static(GTK_TYPE_HBOX, - "GtkWebViewToolbar", &webviewtoolbar_info, 0); + "PidginWebViewToolbar", &webviewtoolbar_info, 0); } return webviewtoolbar_type; } void -gtk_webviewtoolbar_attach(GtkWebViewToolbar *toolbar, GtkWidget *webview) +pidgin_webviewtoolbar_attach(PidginWebViewToolbar *toolbar, GtkWidget *webview) { - GtkWebViewButtons buttons; + PidginWebViewButtons buttons; g_return_if_fail(toolbar != NULL); g_return_if_fail(GTK_IS_WEBVIEWTOOLBAR(toolbar)); @@ -1596,25 +1596,25 @@ gtk_webviewtoolbar_attach(GtkWebViewToolbar *toolbar, GtkWidget *webview) g_signal_connect_after(G_OBJECT(webview), "selection-changed", G_CALLBACK(mark_set_cb), toolbar); - buttons = gtk_webview_get_format_functions(GTK_WEBVIEW(webview)); - update_buttons_cb(GTK_WEBVIEW(webview), buttons, toolbar); + buttons = pidgin_webview_get_format_functions(PIDGIN_WEBVIEW(webview)); + update_buttons_cb(PIDGIN_WEBVIEW(webview), buttons, toolbar); update_buttons(toolbar); } void -gtk_webviewtoolbar_associate_smileys(GtkWebViewToolbar *toolbar, +pidgin_webviewtoolbar_associate_smileys(PidginWebViewToolbar *toolbar, const char *proto_id) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); g_free(priv->sml); priv->sml = g_strdup(proto_id); } void -gtk_webviewtoolbar_switch_active_conversation(GtkWebViewToolbar *toolbar, +pidgin_webviewtoolbar_switch_active_conversation(PidginWebViewToolbar *toolbar, PurpleConversation *conv) { - GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + PidginWebViewToolbarPriv *priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); PurpleConnection *gc = purple_conversation_get_connection(conv); PurplePlugin *prpl = purple_connection_get_prpl(gc); @@ -1631,79 +1631,79 @@ gtk_webviewtoolbar_switch_active_conversation(GtkWebViewToolbar *toolbar, } void -gtk_webviewtoolbar_activate(GtkWebViewToolbar *toolbar, - GtkWebViewAction action) +pidgin_webviewtoolbar_activate(PidginWebViewToolbar *toolbar, + PidginWebViewAction action) { - GtkWebViewToolbarPriv *priv; + PidginWebViewToolbarPriv *priv; GtkAction *act; g_return_if_fail(toolbar != NULL); - priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); + priv = PIDGIN_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); switch (action) { - case GTK_WEBVIEW_ACTION_BOLD: + case PIDGIN_WEBVIEW_ACTION_BOLD: act = priv->bold; break; - case GTK_WEBVIEW_ACTION_ITALIC: + case PIDGIN_WEBVIEW_ACTION_ITALIC: act = priv->italic; break; - case GTK_WEBVIEW_ACTION_UNDERLINE: + case PIDGIN_WEBVIEW_ACTION_UNDERLINE: act = priv->underline; break; - case GTK_WEBVIEW_ACTION_STRIKE: + case PIDGIN_WEBVIEW_ACTION_STRIKE: act = priv->strike; break; - case GTK_WEBVIEW_ACTION_LARGER: + case PIDGIN_WEBVIEW_ACTION_LARGER: act = priv->larger_size; break; #if 0 - case GTK_WEBVIEW_ACTION_NORMAL: + case PIDGIN_WEBVIEW_ACTION_NORMAL: act = priv->normal_size; break; #endif - case GTK_WEBVIEW_ACTION_SMALLER: + case PIDGIN_WEBVIEW_ACTION_SMALLER: act = priv->smaller_size; break; - case GTK_WEBVIEW_ACTION_FONTFACE: + case PIDGIN_WEBVIEW_ACTION_FONTFACE: act = priv->font; break; - case GTK_WEBVIEW_ACTION_FGCOLOR: + case PIDGIN_WEBVIEW_ACTION_FGCOLOR: act = priv->fgcolor; break; - case GTK_WEBVIEW_ACTION_BGCOLOR: + case PIDGIN_WEBVIEW_ACTION_BGCOLOR: act = priv->bgcolor; break; - case GTK_WEBVIEW_ACTION_CLEAR: + case PIDGIN_WEBVIEW_ACTION_CLEAR: act = priv->clear; break; - case GTK_WEBVIEW_ACTION_IMAGE: + case PIDGIN_WEBVIEW_ACTION_IMAGE: act = priv->image; break; - case GTK_WEBVIEW_ACTION_LINK: + case PIDGIN_WEBVIEW_ACTION_LINK: act = priv->link; break; - case GTK_WEBVIEW_ACTION_HR: + case PIDGIN_WEBVIEW_ACTION_HR: act = priv->hr; break; - case GTK_WEBVIEW_ACTION_SMILEY: + case PIDGIN_WEBVIEW_ACTION_SMILEY: act = priv->smiley; break; - case GTK_WEBVIEW_ACTION_ATTENTION: + case PIDGIN_WEBVIEW_ACTION_ATTENTION: act = priv->attention; break; diff --git a/pidgin/gtkwebviewtoolbar.h b/pidgin/gtkwebviewtoolbar.h index 7621e06cf0..3fa38cfded 100644 --- a/pidgin/gtkwebviewtoolbar.h +++ b/pidgin/gtkwebviewtoolbar.h @@ -1,5 +1,5 @@ /* - * GtkWebViewToolbar + * PidginWebViewToolbar * * Pidgin is the legal property of its developers, whose names are too numerous * to list here. Please refer to the COPYRIGHT file distributed with this @@ -33,86 +33,86 @@ #include <gtk/gtk.h> #include "gtkwebview.h" -#define DEFAULT_FONT_FACE "Helvetica 12" +#define PIDGIN_DEFAULT_FONT_FACE "Helvetica 12" -#define GTK_TYPE_WEBVIEWTOOLBAR (gtk_webviewtoolbar_get_type()) -#define GTK_WEBVIEWTOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_WEBVIEWTOOLBAR, GtkWebViewToolbar)) -#define GTK_WEBVIEWTOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_WEBVIEWTOOLBAR, GtkWebViewToolbarClass)) +#define GTK_TYPE_WEBVIEWTOOLBAR (pidgin_webviewtoolbar_get_type()) +#define PIDGIN_WEBVIEWTOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_WEBVIEWTOOLBAR, PidginWebViewToolbar)) +#define PIDGIN_WEBVIEWTOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_WEBVIEWTOOLBAR, PidginWebViewToolbarClass)) #define GTK_IS_WEBVIEWTOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_WEBVIEWTOOLBAR)) #define GTK_IS_WEBVIEWTOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_WEBVIEWTOOLBAR)) -#define GTK_WEBVIEWTOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_WEBVIEWTOOLBAR, GtkWebViewToolbarClass)) +#define PIDGIN_WEBVIEWTOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_WEBVIEWTOOLBAR, PidginWebViewToolbarClass)) -typedef struct _GtkWebViewToolbar GtkWebViewToolbar; -typedef struct _GtkWebViewToolbarClass GtkWebViewToolbarClass; +typedef struct _PidginWebViewToolbar PidginWebViewToolbar; +typedef struct _PidginWebViewToolbarClass PidginWebViewToolbarClass; -struct _GtkWebViewToolbar { +struct _PidginWebViewToolbar { GtkHBox box; GtkWidget *webview; }; -struct _GtkWebViewToolbarClass { +struct _PidginWebViewToolbarClass { GtkHBoxClass parent_class; }; G_BEGIN_DECLS /** - * gtk_webviewtoolbar_get_type: + * pidgin_webviewtoolbar_get_type: * - * Returns the GType for a GtkWebViewToolbar widget + * Returns the GType for a PidginWebViewToolbar widget * - * Returns: The GType for GtkWebViewToolbar widget + * Returns: The GType for PidginWebViewToolbar widget */ -GType gtk_webviewtoolbar_get_type(void); +GType pidgin_webviewtoolbar_get_type(void); /** - * gtk_webviewtoolbar_new: + * pidgin_webviewtoolbar_new: * - * Create a new GtkWebViewToolbar object + * Create a new PidginWebViewToolbar object * - * Returns: A GtkWidget corresponding to the GtkWebViewToolbar object + * Returns: A GtkWidget corresponding to the PidginWebViewToolbar object */ -GtkWidget *gtk_webviewtoolbar_new(void); +GtkWidget *pidgin_webviewtoolbar_new(void); /** - * gtk_webviewtoolbar_attach: - * @toolbar: The GtkWebViewToolbar object - * @webview: The GtkWebView object + * pidgin_webviewtoolbar_attach: + * @toolbar: The PidginWebViewToolbar object + * @webview: The PidginWebView object * - * Attach a GtkWebViewToolbar object to a GtkWebView + * Attach a PidginWebViewToolbar object to a PidginWebView */ -void gtk_webviewtoolbar_attach(GtkWebViewToolbar *toolbar, GtkWidget *webview); +void pidgin_webviewtoolbar_attach(PidginWebViewToolbar *toolbar, GtkWidget *webview); /** - * gtk_webviewtoolbar_associate_smileys: - * @toolbar: The GtkWebViewToolbar object + * pidgin_webviewtoolbar_associate_smileys: + * @toolbar: The PidginWebViewToolbar object * @proto_id: The ID of the protocol from which smileys are associated * - * Associate the smileys from a protocol to a GtkWebViewToolbar object + * Associate the smileys from a protocol to a PidginWebViewToolbar object */ -void gtk_webviewtoolbar_associate_smileys(GtkWebViewToolbar *toolbar, +void pidgin_webviewtoolbar_associate_smileys(PidginWebViewToolbar *toolbar, const char *proto_id); /** - * gtk_webviewtoolbar_switch_active_conversation: - * @toolbar: The GtkWebViewToolbar object + * pidgin_webviewtoolbar_switch_active_conversation: + * @toolbar: The PidginWebViewToolbar object * @conv: The new conversation * - * Switch the active conversation for a GtkWebViewToolbar object + * Switch the active conversation for a PidginWebViewToolbar object */ -void gtk_webviewtoolbar_switch_active_conversation(GtkWebViewToolbar *toolbar, +void pidgin_webviewtoolbar_switch_active_conversation(PidginWebViewToolbar *toolbar, PurpleConversation *conv); /** - * gtk_webviewtoolbar_activate: - * @toolbar: The GtkWebViewToolbar object - * @action: The GtkWebViewAction + * pidgin_webviewtoolbar_activate: + * @toolbar: The PidginWebViewToolbar object + * @action: The PidginWebViewAction * - * Activate a GtkWebViewToolbar action + * Activate a PidginWebViewToolbar action */ -void gtk_webviewtoolbar_activate(GtkWebViewToolbar *toolbar, - GtkWebViewAction action); +void pidgin_webviewtoolbar_activate(PidginWebViewToolbar *toolbar, + PidginWebViewAction action); G_END_DECLS diff --git a/pidgin/gtkwhiteboard.c b/pidgin/gtkwhiteboard.c index 381edcca2c..38b3ca1ec1 100644 --- a/pidgin/gtkwhiteboard.c +++ b/pidgin/gtkwhiteboard.c @@ -78,13 +78,13 @@ static void color_select_dialog(GtkWidget *widget, PidginWhiteboard *gtkwb); *****************************************************************************/ /* GList *buttonList = NULL; -GdkColor DefaultColor[PALETTE_NUM_COLORS]; +GdkColor DefaultColor[PIDGIN_PALETTE_NUM_COLORS]; */ static int LastX; /* Tracks last position of the mouse when drawing */ static int LastY; static int MotionCount; /* Tracks how many brush motions made */ -static int BrushState = BRUSH_STATE_UP; +static int BrushState = PIDGIN_BRUSH_STATE_UP; static PurpleWhiteboardUiOps ui_ops = { @@ -170,7 +170,7 @@ static void pidgin_whiteboard_create(PurpleWhiteboard *wb) GtkWidget *hbox_palette; GtkWidget *vbox_palette_above_canvas_and_controls; - GtkWidget *palette_color_box[PALETTE_NUM_COLORS]; + GtkWidget *palette_color_box[PIDGIN_PALETTE_NUM_COLORS]; /* Create vertical box to place palette above the canvas and controls */ vbox_palette_above_canvas_and_controls = gtk_vbox_new(FALSE, 0); @@ -189,10 +189,10 @@ static void pidgin_whiteboard_create(PurpleWhiteboard *wb) hbox_canvas_and_controls, FALSE, FALSE, PIDGIN_HIG_BORDER); gtk_widget_show(hbox_canvas_and_controls); - for(i = 0; i < PALETTE_NUM_COLORS; i++) + for(i = 0; i < PIDGIN_PALETTE_NUM_COLORS; i++) { palette_color_box[i] = gtk_image_new_from_pixbuf(NULL); - gtk_widget_set_size_request(palette_color_box[i], gtkwb->width / PALETTE_NUM_COLORS ,32); + gtk_widget_set_size_request(palette_color_box[i], gtkwb->width / PIDGIN_PALETTE_NUM_COLORS ,32); gtk_container_add(GTK_CONTAINER(hbox_palette), palette_color_box[i]); gtk_widget_show(palette_color_box[i]); @@ -438,15 +438,15 @@ static gboolean pidgin_whiteboard_brush_down(GtkWidget *widget, GdkEventButton * PurpleWhiteboard *wb = gtkwb->wb; GList *draw_list = purple_whiteboard_get_draw_list(wb); - if(BrushState != BRUSH_STATE_UP) + if(BrushState != PIDGIN_BRUSH_STATE_UP) { /* Potential double-click DOWN to DOWN? */ - BrushState = BRUSH_STATE_DOWN; + BrushState = PIDGIN_BRUSH_STATE_DOWN; /* return FALSE; */ } - BrushState = BRUSH_STATE_DOWN; + BrushState = PIDGIN_BRUSH_STATE_DOWN; if(event->button == 1 && gtkwb->priv->pix != NULL) { @@ -506,15 +506,15 @@ static gboolean pidgin_whiteboard_brush_motion(GtkWidget *widget, GdkEventMotion if(state & GDK_BUTTON1_MASK && gtkwb->priv->pix != NULL) { - if((BrushState != BRUSH_STATE_DOWN) && (BrushState != BRUSH_STATE_MOTION)) + if((BrushState != PIDGIN_BRUSH_STATE_DOWN) && (BrushState != PIDGIN_BRUSH_STATE_MOTION)) { purple_debug_error("gtkwhiteboard", "***Bad brush state transition %d to MOTION\n", BrushState); - BrushState = BRUSH_STATE_MOTION; + BrushState = PIDGIN_BRUSH_STATE_MOTION; return FALSE; } - BrushState = BRUSH_STATE_MOTION; + BrushState = PIDGIN_BRUSH_STATE_MOTION; dx = x - LastX; dy = y - LastY; @@ -574,15 +574,15 @@ static gboolean pidgin_whiteboard_brush_up(GtkWidget *widget, GdkEventButton *ev PurpleWhiteboard *wb = gtkwb->wb; GList *draw_list = purple_whiteboard_get_draw_list(wb); - if((BrushState != BRUSH_STATE_DOWN) && (BrushState != BRUSH_STATE_MOTION)) + if((BrushState != PIDGIN_BRUSH_STATE_DOWN) && (BrushState != PIDGIN_BRUSH_STATE_MOTION)) { purple_debug_error("gtkwhiteboard", "***Bad brush state transition %d to UP\n", BrushState); - BrushState = BRUSH_STATE_UP; + BrushState = PIDGIN_BRUSH_STATE_UP; return FALSE; } - BrushState = BRUSH_STATE_UP; + BrushState = PIDGIN_BRUSH_STATE_UP; if(event->button == 1 && gtkwb->priv->pix != NULL) { diff --git a/pidgin/gtkwhiteboard.h b/pidgin/gtkwhiteboard.h index e65273096d..e64b8215bc 100644 --- a/pidgin/gtkwhiteboard.h +++ b/pidgin/gtkwhiteboard.h @@ -32,16 +32,16 @@ #include "whiteboard.h" -#define FULL_CIRCLE_DEGREES 23040 +#define PIDGIN_FULL_CIRCLE_DEGREES 23040 /* TODO: Make into an enum. */ -#define BRUSH_STATE_UP 0 -#define BRUSH_STATE_DOWN 1 -#define BRUSH_STATE_MOTION 2 +#define PIDGIN_BRUSH_STATE_UP 0 +#define PIDGIN_BRUSH_STATE_DOWN 1 +#define PIDGIN_BRUSH_STATE_MOTION 2 /* XXX: This seems duplicated with the Yahoo! Doodle protocol code. * XXX: How should they work together? */ -#define PALETTE_NUM_COLORS 7 +#define PIDGIN_PALETTE_NUM_COLORS 7 typedef struct _PidginWhiteboardPrivate PidginWhiteboardPrivate; diff --git a/pidgin/plugins/history.c b/pidgin/plugins/history.c index c0ce163ff2..9d20416c50 100644 --- a/pidgin/plugins/history.c +++ b/pidgin/plugins/history.c @@ -23,8 +23,8 @@ static gboolean _scroll_webview_to_end(gpointer data) { - GtkWebView *webview = data; - gtk_webview_scroll_to_end(GTK_WEBVIEW(webview), FALSE); + PidginWebView *webview = data; + pidgin_webview_scroll_to_end(PIDGIN_WEBVIEW(webview), FALSE); g_object_unref(G_OBJECT(webview)); return FALSE; } @@ -135,8 +135,8 @@ static void historize(PurpleConversation *c) #if 0 /* TODO WebKit: Do this properly... */ - if (!gtk_webview_is_empty(GTK_WEBVIEW(gtkconv->webview))) - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), "<BR>"); + if (!pidgin_webview_is_empty(PIDGIN_WEBVIEW(gtkconv->webview))) + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), "<BR>"); #endif escaped_alias = g_markup_escape_text(alias, -1); @@ -147,15 +147,15 @@ static void historize(PurpleConversation *c) header_date = purple_date_format_full(localtime(&((PurpleLog *)logs->data)->time)); header = g_strdup_printf(_("<b>Conversation with %s on %s:</b><br>"), escaped_alias, header_date); - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), header); + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), header); g_free(header); g_free(escaped_alias); g_strchomp(history); - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), history); + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), history); g_free(history); - gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), "<hr>"); + pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), "<hr>"); #if 0 /* FIXME: WebView has no protocol setting */ diff --git a/pidgin/plugins/markerline.c b/pidgin/plugins/markerline.c index d5d201ea5f..2145e75e1f 100644 --- a/pidgin/plugins/markerline.c +++ b/pidgin/plugins/markerline.c @@ -54,7 +54,7 @@ update_marker_for_gtkconv(PidginConversation *gtkconv) (PURPLE_IS_IM_CONVERSATION(conv) && !purple_prefs_get_bool(PREF_IMS))) return; - gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(gtkconv->webview), "var mhr = document.getElementById(\"markerhr\");" "if (!mhr) {" "mhr = document.createElement(\"hr\");" @@ -89,7 +89,7 @@ page_switched(GtkWidget *widget, GtkWidget *page, gint num, PidginWindow *win) static void detach_from_gtkconv(PidginConversation *gtkconv, gpointer null) { - gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(gtkconv->webview), "var mhr = document.getElementById(\"markerhr\");" "if (mhr) mhr.parentNode.removeChild(mhr);"); } @@ -154,7 +154,7 @@ jump_to_markerline(PurpleConversation *conv, gpointer null) if (!gtkconv) return; - gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), + pidgin_webview_safe_execute_script(PIDGIN_WEBVIEW(gtkconv->webview), "var mhr = document.getElementById(\"markerhr\");" "if (mhr) {" "window.scroll(0, mhr.offsetTop);" diff --git a/pidgin/plugins/xmppconsole.c b/pidgin/plugins/xmppconsole.c index 74a3671659..4d4c6a8dc6 100644 --- a/pidgin/plugins/xmppconsole.c +++ b/pidgin/plugins/xmppconsole.c @@ -185,7 +185,7 @@ purple_xmlnode_received_cb(PurpleConnection *gc, PurpleXmlNode **packet, gpointe return; str = purple_xmlnode_to_pretty_str(*packet, NULL); formatted = g_strdup_printf("<div class=incoming>%s</div>", str); - gtk_webview_append_html(GTK_WEBVIEW(console->webview), formatted); + pidgin_webview_append_html(PIDGIN_WEBVIEW(console->webview), formatted); g_free(formatted); g_free(str); } @@ -206,7 +206,7 @@ purple_xmlnode_sent_cb(PurpleConnection *gc, char **packet, gpointer null) str = purple_xmlnode_to_pretty_str(node, NULL); formatted = g_strdup_printf("<div class=outgoing>%s</div>", str); - gtk_webview_append_html(GTK_WEBVIEW(console->webview), formatted); + pidgin_webview_append_html(PIDGIN_WEBVIEW(console->webview), formatted); g_free(formatted); g_free(str); purple_xmlnode_free(node); @@ -227,13 +227,13 @@ message_send_cb(GtkWidget *widget, GdkEventKey *event, gpointer p) if (gc) prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); - text = gtk_webview_get_body_text(GTK_WEBVIEW(widget)); + text = pidgin_webview_get_body_text(PIDGIN_WEBVIEW(widget)); if (prpl_info && prpl_info->send_raw != NULL) prpl_info->send_raw(gc, text, strlen(text)); g_free(text); - gtk_webview_load_html_string(GTK_WEBVIEW(console->entry), ""); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(console->entry), ""); return TRUE; } @@ -275,15 +275,15 @@ entry_changed_cb(GtkWidget *webview, void *data) gtk_widget_set_size_request(console->sw, -1, height + 6); #endif - str = gtk_webview_get_body_text(GTK_WEBVIEW(webview)); + str = pidgin_webview_get_body_text(PIDGIN_WEBVIEW(webview)); if (!str) return; xmlstr = g_strdup_printf("<xml>%s</xml>", str); node = purple_xmlnode_from_str(xmlstr, -1); if (node) { - gtk_webview_clear_formatting(GTK_WEBVIEW(console->entry)); + pidgin_webview_clear_formatting(PIDGIN_WEBVIEW(console->entry)); } else { - gtk_webview_toggle_backcolor(GTK_WEBVIEW(console->entry), "#ffcece"); + pidgin_webview_toggle_backcolor(PIDGIN_WEBVIEW(console->entry), "#ffcece"); } g_free(str); g_free(xmlstr); @@ -360,7 +360,7 @@ static void iq_clicked_cb(GtkWidget *w, gpointer nul) g_random_int(), gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(type_combo))); - gtk_webview_load_html_string_with_selection(GTK_WEBVIEW(console->entry), stanza); + pidgin_webview_load_html_string_with_selection(PIDGIN_WEBVIEW(console->entry), stanza); gtk_widget_grab_focus(console->entry); g_free(to); g_free(stanza); @@ -515,7 +515,7 @@ static void presence_clicked_cb(GtkWidget *w, gpointer nul) *priority ? priority : "", *priority ? "</priority>" : ""); - gtk_webview_load_html_string_with_selection(GTK_WEBVIEW(console->entry), stanza); + pidgin_webview_load_html_string_with_selection(PIDGIN_WEBVIEW(console->entry), stanza); gtk_widget_grab_focus(console->entry); g_free(stanza); g_free(to); @@ -656,7 +656,7 @@ static void message_clicked_cb(GtkWidget *w, gpointer nul) *thread ? thread : "", *thread ? "</thread>" : ""); - gtk_webview_load_html_string_with_selection(GTK_WEBVIEW(console->entry), stanza); + pidgin_webview_load_html_string_with_selection(PIDGIN_WEBVIEW(console->entry), stanza); gtk_widget_grab_focus(console->entry); g_free(stanza); g_free(to); @@ -687,7 +687,7 @@ signing_on_cb(PurpleConnection *gc) if (console->count == 1) { console->gc = gc; - gtk_webview_load_html_string(GTK_WEBVIEW(console->webview), EMPTY_HTML); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(console->webview), EMPTY_HTML); gtk_combo_box_set_active(GTK_COMBO_BOX(console->dropdown), 0); } else gtk_widget_show_all(console->hbox); @@ -721,7 +721,7 @@ signed_off_cb(PurpleConnection *gc) if (gc == console->gc) { char *tmp = g_strdup_printf("<div class=info>%s</div>", _("Logged out.")); - gtk_webview_append_html(GTK_WEBVIEW(console->webview), tmp); + pidgin_webview_append_html(PIDGIN_WEBVIEW(console->webview), tmp); g_free(tmp); console->gc = NULL; } @@ -788,7 +788,7 @@ dropdown_changed_cb(GtkComboBox *widget, gpointer nul) return; console->gc = g_list_nth_data(console->accounts, gtk_combo_box_get_active(GTK_COMBO_BOX(console->dropdown))); - gtk_webview_load_html_string(GTK_WEBVIEW(console->webview), EMPTY_HTML); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(console->webview), EMPTY_HTML); } static void @@ -833,12 +833,12 @@ create_console(PurplePluginAction *action) gtk_box_pack_start(GTK_BOX(console->hbox), console->dropdown, TRUE, TRUE, 0); g_signal_connect(G_OBJECT(console->dropdown), "changed", G_CALLBACK(dropdown_changed_cb), NULL); - console->webview = gtk_webview_new(FALSE); - gtk_webview_load_html_string(GTK_WEBVIEW(console->webview), EMPTY_HTML); + console->webview = pidgin_webview_new(FALSE); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(console->webview), EMPTY_HTML); if (console->count == 0) { char *tmp = g_strdup_printf("<div class=info>%s</div>", _("Not connected to XMPP")); - gtk_webview_append_html(GTK_WEBVIEW(console->webview), tmp); + pidgin_webview_append_html(PIDGIN_WEBVIEW(console->webview), tmp); g_free(tmp); } gtk_box_pack_start(GTK_BOX(vbox), @@ -863,8 +863,8 @@ create_console(PurplePluginAction *action) gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); - console->entry = gtk_webview_new(TRUE); - gtk_webview_set_whole_buffer_formatting_only(GTK_WEBVIEW(console->entry), TRUE); + console->entry = pidgin_webview_new(TRUE); + pidgin_webview_set_whole_buffer_formatting_only(PIDGIN_WEBVIEW(console->entry), TRUE); g_signal_connect(G_OBJECT(console->entry),"key-press-event", G_CALLBACK(message_send_cb), console); console->sw = pidgin_make_scrollable(console->entry, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_ETCHED_IN, -1, -1); diff --git a/pidgin/smileyparser.c b/pidgin/smileyparser.c index 8a1c67d8c1..9d858a60c0 100644 --- a/pidgin/smileyparser.c +++ b/pidgin/smileyparser.c @@ -130,11 +130,11 @@ parse_for_smiley_list(const char *markup, GHashTable *smileys) } char * -smiley_parse_markup(const char *markup, const char *proto_id) +pidgin_smiley_parse_markup(const char *markup, const char *proto_id) { GList *smileys = purple_smileys_get_all(); char *temp = g_strdup(markup), *temp2; - struct smiley_list *list; + struct PidginSmileyList *list; const char *proto_name = "default"; if (proto_id != NULL) { diff --git a/pidgin/smileyparser.h b/pidgin/smileyparser.h index bc919a3248..684216aaf9 100644 --- a/pidgin/smileyparser.h +++ b/pidgin/smileyparser.h @@ -32,7 +32,7 @@ G_BEGIN_DECLS char * -smiley_parse_markup(const char *markup, const char *sml); +pidgin_smiley_parse_markup(const char *markup, const char *sml); G_END_DECLS |