Mercurial > pidgin.yaz
diff pidgin/gtkconv.c @ 15501:d75099d2567e
gaim_gtk to pidgin. I hope
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 03 Feb 2007 07:23:11 +0000 |
parents | 0d4890637238 |
children | 6fde15c1dcfc |
line wrap: on
line diff
--- a/pidgin/gtkconv.c Sat Feb 03 01:08:41 2007 +0000 +++ b/pidgin/gtkconv.c Sat Feb 03 07:23:11 2007 +0000 @@ -72,16 +72,16 @@ typedef enum { - GAIM_GTKCONV_SET_TITLE = 1 << 0, - GAIM_GTKCONV_BUDDY_ICON = 1 << 1, - GAIM_GTKCONV_MENU = 1 << 2, - GAIM_GTKCONV_TAB_ICON = 1 << 3, - GAIM_GTKCONV_TOPIC = 1 << 4, - GAIM_GTKCONV_SMILEY_THEME = 1 << 5, - GAIM_GTKCONV_COLORIZE_TITLE = 1 << 6 -}GaimGtkConvFields; - -#define GAIM_GTKCONV_ALL ((1 << 7) - 1) + PIDGINCONV_SET_TITLE = 1 << 0, + PIDGINCONV_BUDDY_ICON = 1 << 1, + PIDGINCONV_MENU = 1 << 2, + PIDGINCONV_TAB_ICON = 1 << 3, + PIDGINCONV_TOPIC = 1 << 4, + PIDGINCONV_SMILEY_THEME = 1 << 5, + PIDGINCONV_COLORIZE_TITLE = 1 << 6 +}PidginConvFields; + +#define PIDGINCONV_ALL ((1 << 7) - 1) #define SEND_COLOR "#204a87" #define RECV_COLOR "#cc0000" @@ -143,32 +143,32 @@ static GtkWidget *invite_dialog = NULL; static GtkWidget *warn_close_dialog = NULL; -static GaimGtkWindow *hidden_convwin = NULL; +static PidginWindow *hidden_convwin = NULL; static GList *window_list = NULL; -static gboolean update_send_to_selection(GaimGtkWindow *win); -static void generate_send_to_items(GaimGtkWindow *win); +static gboolean update_send_to_selection(PidginWindow *win); +static void generate_send_to_items(PidginWindow *win); /* Prototypes. <-- because Paco-Paco hates this comment. */ -static void got_typing_keypress(GaimGtkConversation *gtkconv, gboolean first); -static void gray_stuff_out(GaimGtkConversation *gtkconv); +static void got_typing_keypress(PidginConversation *gtkconv, gboolean first); +static void gray_stuff_out(PidginConversation *gtkconv); static GList *generate_invite_user_names(GaimConnection *gc); static void add_chat_buddy_common(GaimConversation *conv, GaimConvChatBuddy *cb, const char *old_name); static gboolean tab_complete(GaimConversation *conv); -static void gaim_gtkconv_updated(GaimConversation *conv, GaimConvUpdateType type); -static void gtkconv_set_unseen(GaimGtkConversation *gtkconv, GaimUnseenState state); -static void update_typing_icon(GaimGtkConversation *gtkconv); +static void pidginconv_updated(GaimConversation *conv, GaimConvUpdateType type); +static void gtkconv_set_unseen(PidginConversation *gtkconv, GaimUnseenState state); +static void update_typing_icon(PidginConversation *gtkconv); static const char *item_factory_translate_func (const char *path, gpointer func_data); -gboolean gaim_gtkconv_has_focus(GaimConversation *conv); -static void gaim_gtkconv_custom_smiley_allocated(GdkPixbufLoader *loader, gpointer user_data); -static void gaim_gtkconv_custom_smiley_closed(GdkPixbufLoader *loader, gpointer user_data); +gboolean pidginconv_has_focus(GaimConversation *conv); +static void pidginconv_custom_smiley_allocated(GdkPixbufLoader *loader, gpointer user_data); +static void pidginconv_custom_smiley_closed(GdkPixbufLoader *loader, gpointer user_data); static GdkColor* generate_nick_colors(guint *numcolors, GdkColor background); static gboolean color_is_visible(GdkColor foreground, GdkColor background, int color_contrast, int brightness_contrast); -static void gaim_gtkconv_update_fields(GaimConversation *conv, GaimGtkConvFields fields); -static void focus_out_from_menubar(GtkWidget *wid, GaimGtkWindow *win); - -static GdkColor *get_nick_color(GaimGtkConversation *gtkconv, const char *name) { +static void pidginconv_update_fields(GaimConversation *conv, PidginConvFields fields); +static void focus_out_from_menubar(GtkWidget *wid, PidginWindow *win); + +static GdkColor *get_nick_color(PidginConversation *gtkconv, const char *name) { static GdkColor col; GtkStyle *style = gtk_widget_get_style(gtkconv->imhtml); float scale; @@ -192,7 +192,7 @@ **************************************************************************/ static gint -close_conv_cb(GtkWidget *w, GaimGtkConversation *gtkconv) +close_conv_cb(GtkWidget *w, PidginConversation *gtkconv) { GList *list = g_list_copy(gtkconv->convs); @@ -211,7 +211,7 @@ } static gboolean -size_allocate_cb(GtkWidget *w, GtkAllocation *allocation, GaimGtkConversation *gtkconv) +size_allocate_cb(GtkWidget *w, GtkAllocation *allocation, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; @@ -254,7 +254,7 @@ } static void -default_formatize(GaimGtkConversation *c) +default_formatize(PidginConversation *c) { GaimConversation *conv = c->active_conv; @@ -319,13 +319,13 @@ } static void -clear_formatting_cb(GtkIMHtml *imhtml, GaimGtkConversation *gtkconv) +clear_formatting_cb(GtkIMHtml *imhtml, PidginConversation *gtkconv) { default_formatize(gtkconv); } static const char * -gaim_gtk_get_cmd_prefix(void) +pidgin_get_cmd_prefix(void) { return "/"; } @@ -386,9 +386,9 @@ clear_command_cb(GaimConversation *conv, const char *cmd, char **args, char **error, void *data) { - GaimGtkConversation *gtkconv = NULL; - - gtkconv = GAIM_GTK_CONVERSATION(conv); + PidginConversation *gtkconv = NULL; + + gtkconv = PIDGIN_CONVERSATION(conv); gtk_imhtml_clear(GTK_IMHTML(gtkconv->imhtml)); return GAIM_CMD_STATUS_OK; @@ -434,7 +434,7 @@ } static void -send_history_add(GaimGtkConversation *gtkconv, const char *message) +send_history_add(PidginConversation *gtkconv, const char *message) { GList *first; @@ -445,7 +445,7 @@ } static void -reset_default_size(GaimGtkConversation *gtkconv) +reset_default_size(PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) @@ -459,13 +459,13 @@ static gboolean check_for_and_do_command(GaimConversation *conv) { - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; char *cmd; const char *prefix; GtkTextIter start; - gtkconv = GAIM_GTK_CONVERSATION(conv); - prefix = gaim_gtk_get_cmd_prefix(); + gtkconv = PIDGIN_CONVERSATION(conv); + prefix = pidgin_get_cmd_prefix(); cmd = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry), NULL, NULL); gtk_text_buffer_get_start_iter(GTK_IMHTML(gtkconv->entry)->text_buffer, &start); @@ -524,7 +524,7 @@ } static void -send_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) +send_cb(GtkWidget *widget, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; GaimAccount *account; @@ -603,7 +603,7 @@ } static void -add_remove_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) +add_remove_cb(GtkWidget *widget, PidginConversation *gtkconv) { GaimAccount *account; const char *name; @@ -617,7 +617,7 @@ b = gaim_find_buddy(account, name); if (b != NULL) - gaim_gtkdialogs_remove_buddy(b); + pidgindialogs_remove_buddy(b); else if (account != NULL && gaim_account_is_connected(account)) gaim_blist_request_add_buddy(account, (char *)name, NULL, NULL); } else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) { @@ -625,15 +625,15 @@ c = gaim_blist_find_chat(account, name); if (c != NULL) - gaim_gtkdialogs_remove_chat(c); + pidgindialogs_remove_chat(c); else if (account != NULL && gaim_account_is_connected(account)) gaim_blist_request_add_chat(account, NULL, NULL, name); } - gtk_widget_grab_focus(GAIM_GTK_CONVERSATION(conv)->entry); -} - -static void chat_do_info(GaimGtkConversation *gtkconv, const char *who) + gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry); +} + +static void chat_do_info(PidginConversation *gtkconv, const char *who) { GaimConversation *conv = gtkconv->active_conv; GaimPluginProtocolInfo *prpl_info = NULL; @@ -658,7 +658,7 @@ static void -info_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) +info_cb(GtkWidget *widget, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; @@ -669,7 +669,7 @@ gtk_widget_grab_focus(gtkconv->entry); } else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) { /* Get info of the person currently selected in the GtkTreeView */ - GaimGtkChatPane *gtkchat; + PidginChatPane *gtkchat; GtkTreeIter iter; GtkTreeModel *model; GtkTreeSelection *sel; @@ -691,7 +691,7 @@ } static void -block_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) +block_cb(GtkWidget *widget, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; GaimAccount *account; @@ -699,13 +699,13 @@ account = gaim_conversation_get_account(conv); if (account != NULL && gaim_account_is_connected(account)) - gaim_gtk_request_add_block(account, gaim_conversation_get_name(conv)); - - gtk_widget_grab_focus(GAIM_GTK_CONVERSATION(conv)->entry); -} - -static void -unblock_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) + pidgin_request_add_block(account, gaim_conversation_get_name(conv)); + + gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry); +} + +static void +unblock_cb(GtkWidget *widget, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; GaimAccount *account; @@ -713,18 +713,18 @@ account = gaim_conversation_get_account(conv); if (account != NULL && gaim_account_is_connected(account)) - gaim_gtk_request_add_permit(account, gaim_conversation_get_name(conv)); - - gtk_widget_grab_focus(GAIM_GTK_CONVERSATION(conv)->entry); + pidgin_request_add_permit(account, gaim_conversation_get_name(conv)); + + gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry); } static void do_invite(GtkWidget *w, int resp, InviteBuddyInfo *info) { const char *buddy, *message; - GaimGtkConversation *gtkconv; - - gtkconv = GAIM_GTK_CONVERSATION(info->conv); + PidginConversation *gtkconv; + + gtkconv = PIDGIN_CONVERSATION(info->conv); if (resp == GTK_RESPONSE_OK) { buddy = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(info->entry)->entry)); @@ -769,7 +769,7 @@ if (strcmp(convprotocol, gaim_account_get_protocol_id(buddy->account))) { - gaim_notify_error(GAIM_GTK_CONVERSATION(info->conv), NULL, + gaim_notify_error(PIDGIN_CONVERSATION(info->conv), NULL, _("That buddy is not on the same protocol as this " "chat."), NULL); } @@ -784,18 +784,18 @@ char *username = NULL; GaimAccount *account; - if (gaim_gtk_parse_x_im_contact((const char *)sd->data, FALSE, &account, + if (pidgin_parse_x_im_contact((const char *)sd->data, FALSE, &account, &protocol, &username, NULL)) { if (account == NULL) { - gaim_notify_error(GAIM_GTK_CONVERSATION(info->conv), NULL, + gaim_notify_error(PIDGIN_CONVERSATION(info->conv), NULL, _("You are not currently signed on with an account that " "can invite that buddy."), NULL); } else if (strcmp(convprotocol, gaim_account_get_protocol_id(account))) { - gaim_notify_error(GAIM_GTK_CONVERSATION(info->conv), NULL, + gaim_notify_error(PIDGIN_CONVERSATION(info->conv), NULL, _("That buddy is not on the same protocol as this " "chat."), NULL); } @@ -819,14 +819,14 @@ }; static void -invite_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) +invite_cb(GtkWidget *widget, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; InviteBuddyInfo *info = NULL; if (invite_dialog == NULL) { GaimConnection *gc; - GaimGtkWindow *gtkwin; + PidginWindow *gtkwin; GtkWidget *label; GtkWidget *vbox, *hbox; GtkWidget *table; @@ -839,7 +839,7 @@ info->conv = conv; gc = gaim_conversation_get_gc(conv); - gtkwin = gaim_gtkconv_get_window(gtkconv); + gtkwin = pidginconv_get_window(gtkconv); /* Create the new dialog. */ invite_dialog = gtk_dialog_new_with_buttons( @@ -959,7 +959,7 @@ static void menu_new_conv_cb(gpointer data, guint action, GtkWidget *widget) { - gaim_gtkdialogs_im(); + pidgindialogs_im(); } static void @@ -971,7 +971,7 @@ gchar *text; if ((fp = g_fopen(filename, "w+")) == NULL) { - gaim_notify_error(GAIM_GTK_CONVERSATION(conv), NULL, _("Unable to open file."), NULL); + gaim_notify_error(PIDGIN_CONVERSATION(conv), NULL, _("Unable to open file."), NULL); return; } @@ -980,7 +980,7 @@ fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name); text = gtk_imhtml_get_markup( - GTK_IMHTML(GAIM_GTK_CONVERSATION(conv)->imhtml)); + GTK_IMHTML(PIDGIN_CONVERSATION(conv)->imhtml)); fprintf(fp, "%s", text); g_free(text); @@ -995,13 +995,13 @@ static void menu_save_as_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; - GaimConversation *conv = gaim_gtk_conv_window_get_active_conversation(win); + PidginWindow *win = data; + GaimConversation *conv = pidgin_conv_window_get_active_conversation(win); gchar *buf; buf = g_strdup_printf("%s.html", gaim_normalize(conv->account, conv->name)); - gaim_request_file(GAIM_GTK_CONVERSATION(conv), _("Save Conversation"), + gaim_request_file(PIDGIN_CONVERSATION(conv), _("Save Conversation"), gaim_escape_filename(buf), TRUE, G_CALLBACK(savelog_writefile_cb), NULL, conv); @@ -1011,17 +1011,17 @@ static void menu_view_log_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; GaimLogType type; - GaimGtkBuddyList *gtkblist; + PidginBuddyList *gtkblist; GdkCursor *cursor; const char *name; GaimAccount *account; GSList *buddies; GSList *cur; - conv = gaim_gtk_conv_window_get_active_conversation(win); + conv = pidgin_conv_window_get_active_conversation(win); if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) type = GAIM_LOG_IM; @@ -1030,7 +1030,7 @@ else return; - gtkblist = gaim_gtk_blist_get_default_gtk_blist(); + gtkblist = pidgin_blist_get_default_gtk_blist(); cursor = gdk_cursor_new(GDK_WATCH); gdk_window_set_cursor(gtkblist->window->window, cursor); @@ -1051,7 +1051,7 @@ GaimBlistNode *node = cur->data; if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL))) { - gaim_gtk_log_show_contact((GaimContact *)node->parent); + pidgin_log_show_contact((GaimContact *)node->parent); g_slist_free(buddies); gdk_window_set_cursor(gtkblist->window->window, NULL); gdk_window_set_cursor(win->window->window, NULL); @@ -1060,7 +1060,7 @@ } g_slist_free(buddies); - gaim_gtk_log_show(type, name, account); + pidgin_log_show(type, name, account); gdk_window_set_cursor(gtkblist->window->window, NULL); gdk_window_set_cursor(win->window->window, NULL); @@ -1069,38 +1069,38 @@ static void menu_clear_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - GaimGtkConversation *gtkconv; - - conv = gaim_gtk_conv_window_get_active_conversation(win); - gtkconv = GAIM_GTK_CONVERSATION(conv); + PidginConversation *gtkconv; + + conv = pidgin_conv_window_get_active_conversation(win); + gtkconv = PIDGIN_CONVERSATION(conv); gtk_imhtml_clear(GTK_IMHTML(gtkconv->imhtml)); } struct _search { - GaimGtkWindow *gtkwin; + PidginWindow *gtkwin; GtkWidget *entry; }; static void do_search_cb(GtkWidget *widget, gint resp, struct _search *s) { GaimConversation *conv; - GaimGtkConversation *gtk_active_conv; + PidginConversation *gtk_active_conv; GList *iter; - conv = gaim_gtk_conv_window_get_active_conversation(s->gtkwin); - gtk_active_conv = GAIM_GTK_CONVERSATION(conv); + conv = pidgin_conv_window_get_active_conversation(s->gtkwin); + gtk_active_conv = PIDGIN_CONVERSATION(conv); switch (resp) { case GTK_RESPONSE_OK: /* clear highlighting except the active conversation window * highlight the keywords in the active conversation window */ - for (iter = gaim_gtk_conv_window_get_gtkconvs(s->gtkwin) ; iter ; iter = iter->next) + for (iter = pidgin_conv_window_get_gtkconvs(s->gtkwin) ; iter ; iter = iter->next) { - GaimGtkConversation *gtkconv = iter->data; + PidginConversation *gtkconv = iter->data; if (gtkconv != gtk_active_conv) { @@ -1117,9 +1117,9 @@ case GTK_RESPONSE_DELETE_EVENT: case GTK_RESPONSE_CLOSE: /* clear the keyword highlighting in all the conversation windows */ - for (iter = gaim_gtk_conv_window_get_gtkconvs(s->gtkwin); iter; iter=iter->next) + for (iter = pidgin_conv_window_get_gtkconvs(s->gtkwin); iter; iter=iter->next) { - GaimGtkConversation *gconv = iter->data; + PidginConversation *gconv = iter->data; gtk_imhtml_search_clear(GTK_IMHTML(gconv->imhtml)); } @@ -1133,7 +1133,7 @@ static void menu_find_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *gtkwin = data; + PidginWindow *gtkwin = data; GtkWidget *hbox; GtkWidget *img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); @@ -1181,7 +1181,7 @@ gtk_entry_set_activates_default(GTK_ENTRY(s->entry), TRUE); gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(s->entry)); g_signal_connect(G_OBJECT(s->entry), "changed", - G_CALLBACK(gaim_gtk_set_sensitive_if_input), + G_CALLBACK(pidgin_set_sensitive_if_input), gtkwin->dialogs.search); gtk_box_pack_start(GTK_BOX(hbox), s->entry, FALSE, FALSE, 0); @@ -1192,8 +1192,8 @@ static void menu_send_file_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; - GaimConversation *conv = gaim_gtk_conv_window_get_active_conversation(win); + PidginWindow *win = data; + GaimConversation *conv = pidgin_conv_window_get_active_conversation(win); if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) { serv_send_file(gaim_conversation_get_gc(conv), gaim_conversation_get_name(conv), NULL); @@ -1204,23 +1204,23 @@ static void menu_add_pounce_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - conv = gaim_gtk_conv_window_get_active_gtkconv(win)->active_conv; - - gaim_gtk_pounce_editor_show(gaim_conversation_get_account(conv), + conv = pidgin_conv_window_get_active_gtkconv(win)->active_conv; + + pidgin_pounce_editor_show(gaim_conversation_get_account(conv), gaim_conversation_get_name(conv), NULL); } static void menu_insert_link_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; - GaimGtkConversation *gtkconv; + PidginWindow *win = data; + PidginConversation *gtkconv; GtkIMHtmlToolbar *toolbar; - gtkconv = gaim_gtk_conv_window_get_active_gtkconv(win); + gtkconv = pidgin_conv_window_get_active_gtkconv(win); toolbar = GTK_IMHTMLTOOLBAR(gtkconv->toolbar); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbar->link), @@ -1230,12 +1230,12 @@ static void menu_insert_image_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; GtkIMHtmlToolbar *toolbar; - gtkconv = gaim_gtk_conv_window_get_active_gtkconv(win); + gtkconv = pidgin_conv_window_get_active_gtkconv(win); conv = gtkconv->active_conv; toolbar = GTK_IMHTMLTOOLBAR(gtkconv->toolbar); @@ -1246,12 +1246,12 @@ static void menu_alias_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; GaimAccount *account; const char *name; - conv = gaim_gtk_conv_window_get_active_conversation(win); + conv = pidgin_conv_window_get_active_conversation(win); account = gaim_conversation_get_account(conv); name = gaim_conversation_get_name(conv); @@ -1260,87 +1260,87 @@ b = gaim_find_buddy(account, name); if (b != NULL) - gaim_gtkdialogs_alias_buddy(b); + pidgindialogs_alias_buddy(b); } else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) { GaimChat *c; c = gaim_blist_find_chat(account, name); if (c != NULL) - gaim_gtkdialogs_alias_chat(c); + pidgindialogs_alias_chat(c); } } static void menu_get_info_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - conv = gaim_gtk_conv_window_get_active_conversation(win); - - info_cb(NULL, GAIM_GTK_CONVERSATION(conv)); + conv = pidgin_conv_window_get_active_conversation(win); + + info_cb(NULL, PIDGIN_CONVERSATION(conv)); } static void menu_invite_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - conv = gaim_gtk_conv_window_get_active_conversation(win); - - invite_cb(NULL, GAIM_GTK_CONVERSATION(conv)); + conv = pidgin_conv_window_get_active_conversation(win); + + invite_cb(NULL, PIDGIN_CONVERSATION(conv)); } static void menu_block_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - conv = gaim_gtk_conv_window_get_active_conversation(win); - - block_cb(NULL, GAIM_GTK_CONVERSATION(conv)); + conv = pidgin_conv_window_get_active_conversation(win); + + block_cb(NULL, PIDGIN_CONVERSATION(conv)); } static void menu_unblock_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - conv = gaim_gtk_conv_window_get_active_conversation(win); - - unblock_cb(NULL, GAIM_GTK_CONVERSATION(conv)); + conv = pidgin_conv_window_get_active_conversation(win); + + unblock_cb(NULL, PIDGIN_CONVERSATION(conv)); } static void menu_add_remove_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - conv = gaim_gtk_conv_window_get_active_conversation(win); - - add_remove_cb(NULL, GAIM_GTK_CONVERSATION(conv)); + conv = pidgin_conv_window_get_active_conversation(win); + + add_remove_cb(NULL, PIDGIN_CONVERSATION(conv)); } static void menu_close_conv_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; - - close_conv_cb(NULL, GAIM_GTK_CONVERSATION(gaim_gtk_conv_window_get_active_conversation(win))); + PidginWindow *win = data; + + close_conv_cb(NULL, PIDGIN_CONVERSATION(pidgin_conv_window_get_active_conversation(win))); } static void menu_logging_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; gboolean logging; - conv = gaim_gtk_conv_window_get_active_conversation(win); + conv = pidgin_conv_window_get_active_conversation(win); if (conv == NULL) return; @@ -1384,16 +1384,16 @@ static void menu_sounds_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - GaimGtkConversation *gtkconv; - - conv = gaim_gtk_conv_window_get_active_conversation(win); + PidginConversation *gtkconv; + + conv = pidgin_conv_window_get_active_conversation(win); if (!conv) return; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtkconv->make_sound = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); @@ -1407,7 +1407,7 @@ } static void -chat_do_im(GaimGtkConversation *gtkconv, const char *who) +chat_do_im(PidginConversation *gtkconv, const char *who) { GaimConversation *conv = gtkconv->active_conv; GaimAccount *account; @@ -1432,16 +1432,16 @@ if(!real_who) return; - gaim_gtkdialogs_im_with_user(account, real_who); + pidgindialogs_im_with_user(account, real_who); g_free(real_who); } static void -ignore_cb(GtkWidget *w, GaimGtkConversation *gtkconv) +ignore_cb(GtkWidget *w, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; - GaimGtkChatPane *gtkchat; + PidginChatPane *gtkchat; GaimConvChatBuddy *cbuddy; GaimConvChat *chat; GaimConvChatBuddyFlags flags; @@ -1481,7 +1481,7 @@ } static void -menu_chat_im_cb(GtkWidget *w, GaimGtkConversation *gtkconv) +menu_chat_im_cb(GtkWidget *w, PidginConversation *gtkconv) { const char *who = g_object_get_data(G_OBJECT(w), "user_data"); @@ -1489,7 +1489,7 @@ } static void -menu_chat_send_file_cb(GtkWidget *w, GaimGtkConversation *gtkconv) +menu_chat_send_file_cb(GtkWidget *w, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; const char *who = g_object_get_data(G_OBJECT(w), "user_data"); @@ -1499,7 +1499,7 @@ } static void -menu_chat_info_cb(GtkWidget *w, GaimGtkConversation *gtkconv) +menu_chat_info_cb(GtkWidget *w, PidginConversation *gtkconv) { char *who; @@ -1509,7 +1509,7 @@ } static void -menu_chat_get_away_cb(GtkWidget *w, GaimGtkConversation *gtkconv) +menu_chat_get_away_cb(GtkWidget *w, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; GaimPluginProtocolInfo *prpl_info = NULL; @@ -1535,7 +1535,7 @@ } static void -menu_chat_add_remove_cb(GtkWidget *w, GaimGtkConversation *gtkconv) +menu_chat_add_remove_cb(GtkWidget *w, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; GaimAccount *account; @@ -1547,15 +1547,15 @@ b = gaim_find_buddy(account, name); if (b != NULL) - gaim_gtkdialogs_remove_buddy(b); + pidgindialogs_remove_buddy(b); else if (account != NULL && gaim_account_is_connected(account)) gaim_blist_request_add_buddy(account, name, NULL, NULL); - gtk_widget_grab_focus(GAIM_GTK_CONVERSATION(conv)->entry); + gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry); } static GtkTextMark * -get_mark_for_user(GaimGtkConversation *gtkconv, const char *who) +get_mark_for_user(PidginConversation *gtkconv, const char *who) { GtkTextBuffer *buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)); char *tmp = g_strconcat("user:", who, NULL); @@ -1566,7 +1566,7 @@ } static void -menu_last_said_cb(GtkWidget *w, GaimGtkConversation *gtkconv) +menu_last_said_cb(GtkWidget *w, PidginConversation *gtkconv) { GtkTextMark *mark; const char *who; @@ -1607,7 +1607,7 @@ if (!is_me) { button = gaim_new_item_from_stock(menu, _("IM"), GAIM_STOCK_IM, - G_CALLBACK(menu_chat_im_cb), GAIM_GTK_CONVERSATION(conv), 0, 0, NULL); + G_CALLBACK(menu_chat_im_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL); if (gc == NULL) gtk_widget_set_sensitive(button, FALSE); @@ -1619,7 +1619,7 @@ { button = gaim_new_item_from_stock(menu, _("Send File"), GAIM_STOCK_FILE_TRANSFER, G_CALLBACK(menu_chat_send_file_cb), - GAIM_GTK_CONVERSATION(conv), 0, 0, NULL); + PIDGIN_CONVERSATION(conv), 0, 0, NULL); if (gc == NULL || prpl_info == NULL || !(!prpl_info->can_receive_file || prpl_info->can_receive_file(gc, who))) @@ -1633,10 +1633,10 @@ if (gaim_conv_chat_is_user_ignored(GAIM_CONV_CHAT(conv), who)) button = gaim_new_item_from_stock(menu, _("Un-Ignore"), GAIM_STOCK_IGNORE, - G_CALLBACK(ignore_cb), GAIM_GTK_CONVERSATION(conv), 0, 0, NULL); + G_CALLBACK(ignore_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL); else button = gaim_new_item_from_stock(menu, _("Ignore"), GAIM_STOCK_IGNORE, - G_CALLBACK(ignore_cb), GAIM_GTK_CONVERSATION(conv), 0, 0, NULL); + G_CALLBACK(ignore_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL); if (gc == NULL) gtk_widget_set_sensitive(button, FALSE); @@ -1646,7 +1646,7 @@ if (prpl_info && (prpl_info->get_info || prpl_info->get_cb_info)) { button = gaim_new_item_from_stock(menu, _("Info"), GAIM_STOCK_INFO, - G_CALLBACK(menu_chat_info_cb), GAIM_GTK_CONVERSATION(conv), 0, 0, NULL); + G_CALLBACK(menu_chat_info_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL); if (gc == NULL) gtk_widget_set_sensitive(button, FALSE); @@ -1656,7 +1656,7 @@ if (prpl_info && prpl_info->get_cb_away) { button = gaim_new_item_from_stock(menu, _("Get Away Message"), GAIM_STOCK_AWAY, - G_CALLBACK(menu_chat_get_away_cb), GAIM_GTK_CONVERSATION(conv), 0, 0, NULL); + G_CALLBACK(menu_chat_get_away_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL); if (gc == NULL) gtk_widget_set_sensitive(button, FALSE); @@ -1667,10 +1667,10 @@ if (!is_me && prpl_info && !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { if ((buddy = gaim_find_buddy(conv->account, who)) != NULL) button = gaim_new_item_from_stock(menu, _("Remove"), GTK_STOCK_REMOVE, - G_CALLBACK(menu_chat_add_remove_cb), GAIM_GTK_CONVERSATION(conv), 0, 0, NULL); + G_CALLBACK(menu_chat_add_remove_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL); else button = gaim_new_item_from_stock(menu, _("Add"), GTK_STOCK_ADD, - G_CALLBACK(menu_chat_add_remove_cb), GAIM_GTK_CONVERSATION(conv), 0, 0, NULL); + G_CALLBACK(menu_chat_add_remove_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL); if (gc == NULL) gtk_widget_set_sensitive(button, FALSE); @@ -1679,17 +1679,17 @@ } button = gaim_new_item_from_stock(menu, _("Last said"), GTK_STOCK_INDEX, - G_CALLBACK(menu_last_said_cb), GAIM_GTK_CONVERSATION(conv), 0, 0, NULL); + G_CALLBACK(menu_last_said_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL); g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free); - if (!get_mark_for_user(GAIM_GTK_CONVERSATION(conv), who)) + if (!get_mark_for_user(PIDGIN_CONVERSATION(conv), who)) gtk_widget_set_sensitive(button, FALSE); if (buddy != NULL) { if (gaim_account_is_connected(conv->account)) - gaim_gtk_append_blist_node_proto_menu(menu, conv->account->gc, + pidgin_append_blist_node_proto_menu(menu, conv->account->gc, (GaimBlistNode *)buddy); - gaim_gtk_append_blist_node_extended_menu(menu, (GaimBlistNode *)buddy); + pidgin_append_blist_node_extended_menu(menu, (GaimBlistNode *)buddy); gtk_widget_show_all(menu); } @@ -1698,10 +1698,10 @@ static gint -gtkconv_chat_popup_menu_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) +gtkconv_chat_popup_menu_cb(GtkWidget *widget, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; - GaimGtkChatPane *gtkchat; + PidginChatPane *gtkchat; GaimConnection *gc; GaimAccount *account; GtkTreeSelection *sel; @@ -1710,7 +1710,7 @@ GtkWidget *menu; gchar *who; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtkchat = gtkconv->u.chat; account = gaim_conversation_get_account(conv); gc = account->gc; @@ -1724,7 +1724,7 @@ gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1); menu = create_chat_menu (conv, who, gc); gtk_menu_popup(GTK_MENU(menu), NULL, NULL, - gaim_gtk_treeview_popup_menu_position_func, widget, + pidgin_treeview_popup_menu_position_func, widget, 0, GDK_CURRENT_TIME); g_free(who); @@ -1734,10 +1734,10 @@ static gint right_click_chat_cb(GtkWidget *widget, GdkEventButton *event, - GaimGtkConversation *gtkconv) + PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; - GaimGtkChatPane *gtkchat; + PidginChatPane *gtkchat; GaimConnection *gc; GaimAccount *account; GtkTreePath *path; @@ -1786,16 +1786,16 @@ } static void -move_to_next_unread_tab(GaimGtkConversation *gtkconv, gboolean forward) -{ - GaimGtkConversation *next_gtkconv = NULL; - GaimGtkWindow *win; +move_to_next_unread_tab(PidginConversation *gtkconv, gboolean forward) +{ + PidginConversation *next_gtkconv = NULL; + PidginWindow *win; int initial, i, total, diff; win = gtkconv->win; initial = gtk_notebook_page_num(GTK_NOTEBOOK(win->notebook), gtkconv->tab_cont); - total = gaim_gtk_conv_window_get_gtkconv_count(win); + total = pidgin_conv_window_get_gtkconv_count(win); /* By adding total here, the moduli calculated later will always have two * positive arguments. x % y where x < 0 is not guaranteed to return a * positive number. @@ -1803,29 +1803,29 @@ diff = (forward ? 1 : -1) + total; for (i = (initial + diff) % total; i != initial; i = (i + diff) % total) { - next_gtkconv = gaim_gtk_conv_window_get_gtkconv_at_index(win, i); + next_gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, i); if (next_gtkconv->unseen_state > 0) break; } if (i == initial) { /* no new messages */ i = (i + diff) % total; - next_gtkconv = gaim_gtk_conv_window_get_gtkconv_at_index(win, i); + next_gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, i); } if (next_gtkconv != NULL && next_gtkconv != gtkconv) - gaim_gtk_conv_window_switch_gtkconv(win, next_gtkconv); + pidgin_conv_window_switch_gtkconv(win, next_gtkconv); } static gboolean entry_key_press_cb(GtkWidget *entry, GdkEventKey *event, gpointer data) { - GaimGtkWindow *win; + PidginWindow *win; GaimConversation *conv; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; int curconv; - gtkconv = (GaimGtkConversation *)data; + gtkconv = (PidginConversation *)data; conv = gtkconv->active_conv; win = gtkconv->win; curconv = gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook)); @@ -1923,7 +1923,7 @@ case GDK_Page_Down: case ']': - if (!gaim_gtk_conv_window_get_gtkconv_at_index(win, curconv + 1)) + if (!pidgin_conv_window_get_gtkconv_at_index(win, curconv + 1)) gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0); else gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), curconv + 1); @@ -1932,7 +1932,7 @@ case GDK_Page_Up: case '[': - if (!gaim_gtk_conv_window_get_gtkconv_at_index(win, curconv - 1)) + if (!pidgin_conv_window_get_gtkconv_at_index(win, curconv - 1)) gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), -1); else gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), curconv - 1); @@ -1975,7 +1975,7 @@ if (event->keyval > '0' && event->keyval <= '9') { guint switchto = event->keyval - '1'; - if (switchto < gaim_gtk_conv_window_get_gtkconv_count(win)) + if (switchto < pidgin_conv_window_get_gtkconv_count(win)) gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), switchto); return TRUE; @@ -2036,7 +2036,7 @@ static gboolean refocus_entry_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) { - GaimGtkConversation *gtkconv = data; + PidginConversation *gtkconv = data; /* If we have a valid key for the conversation display, then exit */ if ((event->state & GDK_CONTROL_MASK) || @@ -2063,16 +2063,16 @@ } void -gaim_gtkconv_switch_active_conversation(GaimConversation *conv) -{ - GaimGtkConversation *gtkconv; +pidginconv_switch_active_conversation(GaimConversation *conv) +{ + PidginConversation *gtkconv; GaimConversation *old_conv; GtkIMHtml *entry; const char *protocol_name; g_return_if_fail(conv != NULL); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); old_conv = gtkconv->active_conv; if (old_conv == conv) @@ -2158,7 +2158,7 @@ (conv->features & GAIM_CONNECTION_FORMATTING_WBFO)); } - gaim_signal_emit(gaim_gtk_conversations_get_handle(), "conversation-switched", conv); + gaim_signal_emit(pidgin_conversations_get_handle(), "conversation-switched", conv); gray_stuff_out(gtkconv); update_typing_icon(gtkconv); @@ -2178,14 +2178,14 @@ return; conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, name); - gaim_gtkconv_switch_active_conversation(conv); + pidginconv_switch_active_conversation(conv); } static void insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position, gchar *new_text, gint new_text_length, gpointer user_data) { - GaimGtkConversation *gtkconv = (GaimGtkConversation *)user_data; + PidginConversation *gtkconv = (PidginConversation *)user_data; GaimConversation *conv; g_return_if_fail(gtkconv != NULL); @@ -2203,7 +2203,7 @@ delete_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *start_pos, GtkTextIter *end_pos, gpointer user_data) { - GaimGtkConversation *gtkconv = (GaimGtkConversation *)user_data; + PidginConversation *gtkconv = (PidginConversation *)user_data; GaimConversation *conv; GaimConvIm *im; @@ -2235,7 +2235,7 @@ * A bunch of buddy icon functions **************************************************************************/ GdkPixbuf * -gaim_gtkconv_get_tab_icon(GaimConversation *conv, gboolean small_icon) +pidginconv_get_tab_icon(GaimConversation *conv, gboolean small_icon) { GaimAccount *account = NULL; const char *name = NULL; @@ -2260,14 +2260,14 @@ if (ops && ops->update) ops->update(NULL, (GaimBlistNode*)b); - status = gaim_gtk_blist_get_status_icon((GaimBlistNode*)b, + status = pidgin_blist_get_status_icon((GaimBlistNode*)b, (small_icon ? GAIM_STATUS_ICON_SMALL : GAIM_STATUS_ICON_LARGE)); } } /* If they don't have a buddy icon, then use the PRPL icon */ if (status == NULL) - status = gaim_gtk_create_prpl_icon(account, small_icon ? PIDGIN_PRPL_ICON_SMALL : PIDGIN_PRPL_ICON_LARGE); + status = pidgin_create_prpl_icon(account, small_icon ? PIDGIN_PRPL_ICON_SMALL : PIDGIN_PRPL_ICON_LARGE); return status; } @@ -2275,18 +2275,18 @@ static void update_tab_icon(GaimConversation *conv) { - GaimGtkConversation *gtkconv; - GaimGtkWindow *win; + PidginConversation *gtkconv; + PidginWindow *win; GdkPixbuf *status = NULL; g_return_if_fail(conv != NULL); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); win = gtkconv->win; if (conv != gtkconv->active_conv) return; - status = gaim_gtkconv_get_tab_icon(conv, TRUE); + status = pidginconv_get_tab_icon(conv, TRUE); g_return_if_fail(status != NULL); @@ -2296,11 +2296,11 @@ if (status != NULL) g_object_unref(status); - if (gaim_gtk_conv_window_is_active_conversation(conv) && + if (pidgin_conv_window_is_active_conversation(conv) && (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM || gtkconv->u.im->anim == NULL)) { - status = gaim_gtkconv_get_tab_icon(conv, FALSE); + status = pidginconv_get_tab_icon(conv, FALSE); gtk_window_set_icon(GTK_WINDOW(win->window), status); @@ -2317,7 +2317,7 @@ */ static gboolean reset_auto_resize_cb(gpointer data) { - GaimGtkConversation *gtkconv = (GaimGtkConversation *)data; + PidginConversation *gtkconv = (PidginConversation *)data; gtkconv->auto_resize = FALSE; return FALSE; } @@ -2325,7 +2325,7 @@ static gboolean redraw_icon(gpointer data) { - GaimGtkConversation *gtkconv = (GaimGtkConversation *)data; + PidginConversation *gtkconv = (PidginConversation *)data; GaimConversation *conv = gtkconv->active_conv; GaimAccount *account; GaimPluginProtocolInfo *prpl_info = NULL; @@ -2335,7 +2335,7 @@ gint delay; int scale_width, scale_height; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); account = gaim_conversation_get_account(conv); if(account && account->gc) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl); @@ -2346,7 +2346,7 @@ gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL); buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); - gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, + pidgin_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, GAIM_ICON_SCALE_DISPLAY, &scale_width, &scale_height); /* this code is ugly, and scares me */ @@ -2372,7 +2372,7 @@ } static void -start_anim(GtkObject *obj, GaimGtkConversation *gtkconv) +start_anim(GtkObject *obj, PidginConversation *gtkconv) { int delay; @@ -2394,10 +2394,10 @@ } static void -remove_icon(GtkWidget *widget, GaimGtkConversation *gtkconv) +remove_icon(GtkWidget *widget, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; - GaimGtkWindow *gtkwin; + PidginWindow *gtkwin; g_return_if_fail(conv != NULL); @@ -2427,7 +2427,7 @@ static void saveicon_writefile_cb(void *user_data, const char *filename) { - GaimGtkConversation *gtkconv = (GaimGtkConversation *)user_data; + PidginConversation *gtkconv = (PidginConversation *)user_data; GaimConversation *conv = gtkconv->active_conv; FILE *fp; GaimBuddyIcon *icon; @@ -2452,7 +2452,7 @@ } static const char * -custom_icon_pref_name(GaimGtkConversation *gtkconv) +custom_icon_pref_name(PidginConversation *gtkconv) { GaimConversation *conv; GaimAccount *account; @@ -2472,34 +2472,34 @@ custom_icon_sel_cb(const char *filename, gpointer data) { if (filename) { - GaimGtkConversation *gtkconv = data; + PidginConversation *gtkconv = data; GaimConversation *conv = gtkconv->active_conv; GaimAccount *account = gaim_conversation_get_account(conv); - gaim_gtk_set_custom_buddy_icon(account, gaim_conversation_get_name(conv), filename); - } -} - -static void -set_custom_icon_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) -{ - GtkWidget *win = gaim_gtk_buddy_icon_chooser_new(GTK_WINDOW(gtkconv->win->window), + pidgin_set_custom_buddy_icon(account, gaim_conversation_get_name(conv), filename); + } +} + +static void +set_custom_icon_cb(GtkWidget *widget, PidginConversation *gtkconv) +{ + GtkWidget *win = pidgin_buddy_icon_chooser_new(GTK_WINDOW(gtkconv->win->window), custom_icon_sel_cb, gtkconv); gtk_widget_show_all(win); } static void -remove_custom_icon_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) +remove_custom_icon_cb(GtkWidget *widget, PidginConversation *gtkconv) { GaimConversation *conv; GaimAccount *account; conv = gtkconv->active_conv; account = gaim_conversation_get_account(conv); - gaim_gtk_set_custom_buddy_icon(account, gaim_conversation_get_name(conv), NULL); -} - -static void -icon_menu_save_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) + pidgin_set_custom_buddy_icon(account, gaim_conversation_get_name(conv), NULL); +} + +static void +icon_menu_save_cb(GtkWidget *widget, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; const gchar *ext; @@ -2520,7 +2520,7 @@ } static void -stop_anim(GtkObject *obj, GaimGtkConversation *gtkconv) +stop_anim(GtkObject *obj, PidginConversation *gtkconv) { if (gtkconv->u.im->icon_timer != 0) g_source_remove(gtkconv->u.im->icon_timer); @@ -2530,7 +2530,7 @@ static void -toggle_icon_animate_cb(GtkWidget *w, GaimGtkConversation *gtkconv) +toggle_icon_animate_cb(GtkWidget *w, PidginConversation *gtkconv) { gtkconv->u.im->animate = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w)); @@ -2542,7 +2542,7 @@ } static gboolean -icon_menu(GtkObject *obj, GdkEventButton *e, GaimGtkConversation *gtkconv) +icon_menu(GtkObject *obj, GdkEventButton *e, PidginConversation *gtkconv) { static GtkWidget *menu = NULL; const char *pref; @@ -2594,24 +2594,24 @@ static void menu_buddyicon_cb(gpointer data, guint action, GtkWidget *widget) { - GaimGtkWindow *win = data; + PidginWindow *win = data; GaimConversation *conv; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; gboolean active; - conv = gaim_gtk_conv_window_get_active_conversation(win); + conv = pidgin_conv_window_get_active_conversation(win); if (!conv) return; g_return_if_fail(gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); active = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); gtkconv->u.im->show_icon = active; if (active) - gaim_gtkconv_update_buddy_icon(conv); + pidginconv_update_buddy_icon(conv); else remove_icon(NULL, gtkconv); } @@ -2620,22 +2620,22 @@ * End of the bunch of buddy icon functions **************************************************************************/ void -gaim_gtkconv_present_conversation(GaimConversation *conv) -{ - GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); +pidginconv_present_conversation(GaimConversation *conv) +{ + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); if(gtkconv->win==hidden_convwin) { - gaim_gtk_conv_window_remove_gtkconv(hidden_convwin, gtkconv); - gaim_gtkconv_placement_place(gtkconv); - } - - gaim_gtkconv_switch_active_conversation(conv); - gaim_gtk_conv_window_switch_gtkconv(gtkconv->win, gtkconv); + pidgin_conv_window_remove_gtkconv(hidden_convwin, gtkconv); + pidginconv_placement_place(gtkconv); + } + + pidginconv_switch_active_conversation(conv); + pidgin_conv_window_switch_gtkconv(gtkconv->win, gtkconv); gtk_window_present(GTK_WINDOW(gtkconv->win->window)); } GList * -gaim_gtk_conversations_find_unseen_list(GaimConversationType type, +pidgin_conversations_find_unseen_list(GaimConversationType type, GaimUnseenState min_state, gboolean hidden_only, guint max_count) @@ -2654,7 +2654,7 @@ for (; l != NULL && (max_count == 0 || c < max_count); l = l->next) { GaimConversation *conv = (GaimConversation*)l->data; - GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); if(gtkconv->active_conv != conv) continue; @@ -2675,11 +2675,11 @@ unseen_conv_menu_cb(GtkMenuItem *item, GaimConversation *conv) { g_return_if_fail(conv != NULL); - gaim_gtkconv_present_conversation(conv); + pidginconv_present_conversation(conv); } guint -gaim_gtk_conversations_fill_menu(GtkWidget *menu, GList *convs) +pidgin_conversations_fill_menu(GtkWidget *menu, GList *convs) { GList *l; guint ret=0; @@ -2689,10 +2689,10 @@ for (l = convs; l != NULL ; l = l->next) { GaimConversation *conv = (GaimConversation*)l->data; - GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); GtkWidget *icon = gtk_image_new(); - GdkPixbuf *pbuf = gaim_gtkconv_get_tab_icon(conv, TRUE); + GdkPixbuf *pbuf = pidginconv_get_tab_icon(conv, TRUE); GtkWidget *item; gchar *text = g_strdup_printf("%s (%d)", gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)), @@ -2712,8 +2712,8 @@ return ret; } -GaimGtkWindow * -gaim_gtkconv_get_window(GaimGtkConversation *gtkconv) +PidginWindow * +pidginconv_get_window(PidginConversation *gtkconv) { g_return_val_if_fail(gtkconv != NULL, NULL); return gtkconv->win; @@ -2795,7 +2795,7 @@ sound_method_pref_changed_cb(const char *name, GaimPrefType type, gconstpointer value, gpointer data) { - GaimGtkWindow *win = data; + PidginWindow *win = data; const char *method = value; if (!strcmp(method, "none")) @@ -2806,7 +2806,7 @@ } else { - GaimGtkConversation *gtkconv = gaim_gtk_conv_window_get_active_gtkconv(win); + PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win); if (gtkconv != NULL) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.sounds), @@ -2820,7 +2820,7 @@ show_buddy_icons_pref_changed_cb(const char *name, GaimPrefType type, gconstpointer value, gpointer data) { - GaimGtkWindow *win = data; + PidginWindow *win = data; gboolean show_icons = GPOINTER_TO_INT(value); if (!show_icons) @@ -2831,7 +2831,7 @@ } else { - GaimGtkConversation *gtkconv = gaim_gtk_conv_window_get_active_gtkconv(win); + PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win); if (gtkconv != NULL) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(win->menu.show_icon), @@ -2842,15 +2842,15 @@ } static void -regenerate_options_items(GaimGtkWindow *win) +regenerate_options_items(PidginWindow *win) { GtkWidget *menu; GList *list; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; GaimConversation *conv; GaimBuddy *buddy; - gtkconv = gaim_gtk_conv_window_get_active_gtkconv(win); + gtkconv = pidgin_conv_window_get_active_gtkconv(win); conv = gtkconv->active_conv; buddy = gaim_find_buddy(conv->account, conv->name); @@ -2868,9 +2868,9 @@ if (buddy) { if (gaim_account_is_connected(conv->account)) - gaim_gtk_append_blist_node_proto_menu(menu, conv->account->gc, + pidgin_append_blist_node_proto_menu(menu, conv->account->gc, (GaimBlistNode *)buddy); - gaim_gtk_append_blist_node_extended_menu(menu, (GaimBlistNode *)buddy); + pidgin_append_blist_node_extended_menu(menu, (GaimBlistNode *)buddy); } if ((list = gtk_container_get_children(GTK_CONTAINER(menu))) == NULL) @@ -2885,7 +2885,7 @@ static void menubar_activated(GtkWidget *item, gpointer data) { - GaimGtkWindow *win = data; + PidginWindow *win = data; regenerate_options_items(win); /* The following are to make sure the 'More' submenu is not regenerated every time @@ -2895,7 +2895,7 @@ } static void -focus_out_from_menubar(GtkWidget *wid, GaimGtkWindow *win) +focus_out_from_menubar(GtkWidget *wid, PidginWindow *win) { /* The menubar has been deactivated. Make sure the 'More' submenu is regenerated next time * the 'Conversation' menu pops up. */ @@ -2906,7 +2906,7 @@ } static GtkWidget * -setup_menubar(GaimGtkWindow *win) +setup_menubar(PidginWindow *win) { GtkAccelGroup *accel_group; const char *method; @@ -2926,7 +2926,7 @@ gtk_item_factory_create_items(win->menu.item_factory, menu_item_count, menu_items, win); g_signal_connect(G_OBJECT(accel_group), "accel-changed", - G_CALLBACK(gaim_gtk_save_accels_cb), NULL); + G_CALLBACK(pidgin_save_accels_cb), NULL); /* Make sure the 'Conversation -> More' menuitems are regenerated whenever * the 'Conversation' menu pops up because the entries can change after the @@ -3029,7 +3029,7 @@ gaim_prefs_connect_callback(win, "/gaim/gtk/conversations/im/show_buddy_icons", show_buddy_icons_pref_changed_cb, win); - win->menu.tray = gaim_gtk_menu_tray_new(); + win->menu.tray = pidgin_menu_tray_new(); gtk_menu_shell_append(GTK_MENU_SHELL(win->menu.menubar), win->menu.tray); gtk_widget_show(win->menu.tray); @@ -3045,7 +3045,7 @@ **************************************************************************/ static void -got_typing_keypress(GaimGtkConversation *gtkconv, gboolean first) +got_typing_keypress(PidginConversation *gtkconv, gboolean first) { GaimConversation *conv = gtkconv->active_conv; GaimConvIm *im; @@ -3073,9 +3073,9 @@ } static void -update_typing_icon(GaimGtkConversation *gtkconv) -{ - GaimGtkWindow *gtkwin; +update_typing_icon(PidginConversation *gtkconv) +{ + PidginWindow *gtkwin; GaimConvIm *im = NULL; GaimConversation *conv = gtkconv->active_conv; char *stock_id; @@ -3104,14 +3104,14 @@ if (gtkwin->menu.typing_icon == NULL) { gtkwin->menu.typing_icon = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_MENU); - gaim_gtk_menu_tray_append(GAIM_GTK_MENU_TRAY(gtkwin->menu.tray), + pidgin_menu_tray_append(PIDGIN_MENU_TRAY(gtkwin->menu.tray), gtkwin->menu.typing_icon, tooltip); } else { gtk_image_set_from_stock(GTK_IMAGE(gtkwin->menu.typing_icon), stock_id, GTK_ICON_SIZE_MENU); - gaim_gtk_menu_tray_set_tooltip(GAIM_GTK_MENU_TRAY(gtkwin->menu.tray), + pidgin_menu_tray_set_tooltip(PIDGIN_MENU_TRAY(gtkwin->menu.tray), gtkwin->menu.typing_icon, tooltip); } @@ -3120,7 +3120,7 @@ } static gboolean -update_send_to_selection(GaimGtkWindow *win) +update_send_to_selection(PidginWindow *win) { GaimAccount *account; GaimConversation *conv; @@ -3128,7 +3128,7 @@ GList *child; GaimBuddy *b; - conv = gaim_gtk_conv_window_get_active_conversation(win); + conv = pidgin_conv_window_get_active_conversation(win); if (conv == NULL) return FALSE; @@ -3196,9 +3196,9 @@ /* Create a pixmap for the protocol icon. */ if (buddy != NULL) - pixbuf = gaim_gtk_blist_get_status_icon((GaimBlistNode*)buddy, GAIM_STATUS_ICON_SMALL); + pixbuf = pidgin_blist_get_status_icon((GaimBlistNode*)buddy, GAIM_STATUS_ICON_SMALL); else - pixbuf = gaim_gtk_create_prpl_icon(account, 0.5); + pixbuf = pidgin_create_prpl_icon(account, 0.5); /* Now convert it to GtkImage */ if (pixbuf == NULL) @@ -3263,17 +3263,17 @@ } static void -generate_send_to_items(GaimGtkWindow *win) +generate_send_to_items(PidginWindow *win) { GtkWidget *menu; GSList *group = NULL; GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; GSList *l, *buds; g_return_if_fail(win != NULL); - gtkconv = gaim_gtk_conv_window_get_active_gtkconv(win); + gtkconv = pidgin_conv_window_get_active_gtkconv(win); g_return_if_fail(gtkconv != NULL); @@ -3434,8 +3434,8 @@ static void add_chat_buddy_common(GaimConversation *conv, GaimConvChatBuddy *cb, const char *old_name) { - GaimGtkConversation *gtkconv; - GaimGtkChatPane *gtkchat; + PidginConversation *gtkconv; + PidginChatPane *gtkchat; GaimConvChat *chat; GaimConnection *gc; GaimPluginProtocolInfo *prpl_info; @@ -3452,7 +3452,7 @@ flags = GPOINTER_TO_INT(cb->flags); chat = GAIM_CONV_CHAT(conv); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtkchat = gtkconv->u.chat; gc = gaim_conversation_get_gc(conv); @@ -3580,7 +3580,7 @@ static gboolean tab_complete(GaimConversation *conv) { - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; GtkTextIter cursor, word_start, start_buffer; int start; int most_matched = -1; @@ -3591,7 +3591,7 @@ GList *matches = NULL; gboolean command = FALSE; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtk_text_buffer_get_start_iter(gtkconv->entry_buffer, &start_buffer); gtk_text_buffer_get_iter_at_mark(gtkconv->entry_buffer, &cursor, @@ -3620,7 +3620,7 @@ start--; } - prefix = gaim_gtk_get_cmd_prefix(); + prefix = pidgin_get_cmd_prefix(); if (start == -1 && (strlen(text) >= strlen(prefix)) && !strncmp(text, prefix, strlen(prefix))) { command = TRUE; gtk_text_iter_forward_chars(&word_start, strlen(prefix)); @@ -3651,7 +3651,7 @@ } else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) { GaimConvChat *chat = GAIM_CONV_CHAT(conv); GList *l = gaim_conv_chat_get_users(chat); - GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(GAIM_GTK_CONVERSATION(conv)->u.chat->list)); + GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(PIDGIN_CONVERSATION(conv)->u.chat->list)); GtkTreeIter iter; int f; @@ -3747,12 +3747,12 @@ return TRUE; } -static void topic_callback(GtkWidget *w, GaimGtkConversation *gtkconv) +static void topic_callback(GtkWidget *w, PidginConversation *gtkconv) { GaimPluginProtocolInfo *prpl_info = NULL; GaimConnection *gc; GaimConversation *conv = gtkconv->active_conv; - GaimGtkChatPane *gtkchat; + PidginChatPane *gtkchat; char *new_topic; const char *current_topic; @@ -3764,7 +3764,7 @@ if(prpl_info->set_chat_topic == NULL) return; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtkchat = gtkconv->u.chat; new_topic = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtkchat->topic_text))); current_topic = gaim_conv_chat_get_topic(GAIM_CONV_CHAT(conv)); @@ -3822,7 +3822,7 @@ static void update_chat_alias(GaimBuddy *buddy, GaimConversation *conv, GaimConnection *gc, GaimPluginProtocolInfo *prpl_info) { - GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); GaimConvChat *chat = GAIM_CONV_CHAT(conv); GtkTreeModel *model; char *normalized_name; @@ -3929,7 +3929,7 @@ return; /* This is safe because this callback is only used in chats, not IMs. */ - model = gtk_tree_view_get_model(GTK_TREE_VIEW(GAIM_GTK_CONVERSATION(conv)->u.chat->list)); + model = gtk_tree_view_get_model(GTK_TREE_VIEW(PIDGIN_CONVERSATION(conv)->u.chat->list)); if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) return; @@ -3974,7 +3974,7 @@ buddy_cb_common(buddy, conv, FALSE); } -static void send_menu_cb(GtkWidget *widget, GaimGtkConversation *gtkconv) +static void send_menu_cb(GtkWidget *widget, PidginConversation *gtkconv) { g_signal_emit_by_name(gtkconv->entry, "message_send"); } @@ -3983,7 +3983,7 @@ entry_popup_menu_cb(GtkIMHtml *imhtml, GtkMenu *menu, gpointer data) { GtkWidget *menuitem; - GaimGtkConversation *gtkconv = data; + PidginConversation *gtkconv = data; g_return_if_fail(menu != NULL); g_return_if_fail(gtkconv != NULL); @@ -4001,7 +4001,7 @@ } -static void resize_imhtml_cb(GaimGtkConversation *gtkconv) +static void resize_imhtml_cb(PidginConversation *gtkconv) { GtkTextBuffer *buffer; GtkTextIter iter; @@ -4043,11 +4043,11 @@ } static GtkWidget * -setup_chat_pane(GaimGtkConversation *gtkconv) +setup_chat_pane(PidginConversation *gtkconv) { GaimPluginProtocolInfo *prpl_info; GaimConversation *conv = gtkconv->active_conv; - GaimGtkChatPane *gtkchat; + PidginChatPane *gtkchat; GaimConnection *gc; GtkWidget *vpaned, *hpaned; GtkWidget *vbox, *hbox, *frame; @@ -4107,8 +4107,8 @@ gtk_widget_show(hpaned); /* Setup gtkihmtml. */ - frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL, &imhtml_sw); - gtk_widget_set_name(gtkconv->imhtml, "gaim_gtkconv_imhtml"); + frame = pidgin_create_imhtml(FALSE, >kconv->imhtml, NULL, &imhtml_sw); + gtk_widget_set_name(gtkconv->imhtml, "pidginconv_imhtml"); gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), TRUE); gtk_paned_pack1(GTK_PANED(hpaned), frame, TRUE, TRUE); gtk_widget_show(frame); @@ -4219,14 +4219,14 @@ gtk_widget_show(vbox); /* Setup the toolbar, entry widget and all signals */ - frame = gaim_gtk_create_imhtml(TRUE, >kconv->entry, >kconv->toolbar, NULL); + frame = pidgin_create_imhtml(TRUE, >kconv->entry, >kconv->toolbar, NULL); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); gtk_widget_show(frame); g_signal_connect(G_OBJECT(gtkconv->entry), "populate-popup", G_CALLBACK(entry_popup_menu_cb), gtkconv); - gtk_widget_set_name(gtkconv->entry, "gaim_gtkconv_entry"); + gtk_widget_set_name(gtkconv->entry, "pidginconv_entry"); gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->entry), gaim_account_get_protocol_name(conv->account)); gtk_widget_set_size_request(gtkconv->lower_hbox, -1, @@ -4260,7 +4260,7 @@ } static GtkWidget * -setup_im_pane(GaimGtkConversation *gtkconv) +setup_im_pane(PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; GtkWidget *frame; @@ -4281,8 +4281,8 @@ gtk_widget_show(vbox); /* Setup the gtkimhtml widget */ - frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL, &imhtml_sw); - gtk_widget_set_name(gtkconv->imhtml, "gaim_gtkconv_imhtml"); + frame = pidgin_create_imhtml(FALSE, >kconv->imhtml, NULL, &imhtml_sw); + gtk_widget_set_name(gtkconv->imhtml, "pidginconv_imhtml"); gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),TRUE); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); gtk_widget_show(frame); @@ -4318,14 +4318,14 @@ gtk_widget_show(vbox2); /* Setup the toolbar, entry widget and all signals */ - frame = gaim_gtk_create_imhtml(TRUE, >kconv->entry, >kconv->toolbar, NULL); + frame = pidgin_create_imhtml(TRUE, >kconv->entry, >kconv->toolbar, NULL); gtk_box_pack_start(GTK_BOX(vbox2), frame, TRUE, TRUE, 0); gtk_widget_show(frame); g_signal_connect(G_OBJECT(gtkconv->entry), "populate-popup", G_CALLBACK(entry_popup_menu_cb), gtkconv); - gtk_widget_set_name(gtkconv->entry, "gaim_gtkconv_entry"); + gtk_widget_set_name(gtkconv->entry, "pidginconv_entry"); gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->entry), gaim_account_get_protocol_name(conv->account)); gtk_widget_set_size_request(gtkconv->lower_hbox, -1, @@ -4374,16 +4374,16 @@ static void conv_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, guint info, guint t, - GaimGtkConversation *gtkconv) + PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; - GaimGtkWindow *win = gtkconv->win; + PidginWindow *win = gtkconv->win; GaimConversation *c; if (sd->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE)) { GaimBlistNode *n = NULL; GaimBuddy *b; - GaimGtkConversation *gtkconv = NULL; + PidginConversation *gtkconv = NULL; n = *(GaimBlistNode **)sd->data; @@ -4401,25 +4401,25 @@ */ c = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, b->name, b->account); if (c != NULL) { - GaimGtkWindow *oldwin; - gtkconv = GAIM_GTK_CONVERSATION(c); + PidginWindow *oldwin; + gtkconv = PIDGIN_CONVERSATION(c); oldwin = gtkconv->win; if (oldwin != win) { - gaim_gtk_conv_window_remove_gtkconv(oldwin, gtkconv); - gaim_gtk_conv_window_add_gtkconv(win, gtkconv); + pidgin_conv_window_remove_gtkconv(oldwin, gtkconv); + pidgin_conv_window_add_gtkconv(win, gtkconv); } } else { c = gaim_conversation_new(GAIM_CONV_TYPE_IM, b->account, b->name); - gtkconv = GAIM_GTK_CONVERSATION(c); + gtkconv = PIDGIN_CONVERSATION(c); if (gtkconv->win != win) { - gaim_gtk_conv_window_remove_gtkconv(gtkconv->win, gtkconv); - gaim_gtk_conv_window_add_gtkconv(win, gtkconv); + pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv); + pidgin_conv_window_add_gtkconv(win, gtkconv); } } /* Make this conversation the active conversation */ - gaim_gtk_conv_window_switch_gtkconv(win, gtkconv); + pidgin_conv_window_switch_gtkconv(win, gtkconv); gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); } @@ -4428,9 +4428,9 @@ char *protocol = NULL; char *username = NULL; GaimAccount *account; - GaimGtkConversation *gtkconv; - - if (gaim_gtk_parse_x_im_contact((const char *)sd->data, FALSE, &account, + PidginConversation *gtkconv; + + if (pidgin_parse_x_im_contact((const char *)sd->data, FALSE, &account, &protocol, &username, NULL)) { if (account == NULL) @@ -4442,11 +4442,11 @@ else { c = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, username); - gtkconv = GAIM_GTK_CONVERSATION(c); + gtkconv = PIDGIN_CONVERSATION(c); if (gtkconv->win != win) { - gaim_gtk_conv_window_remove_gtkconv(gtkconv->win, gtkconv); - gaim_gtk_conv_window_add_gtkconv(win, gtkconv); + pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv); + pidgin_conv_window_add_gtkconv(win, gtkconv); } } } @@ -4473,8 +4473,8 @@ {"application/x-im-contact", 0, GTK_IMHTML_DRAG_NUM + 1} }; -static GaimGtkConversation * -gaim_gtk_conv_find_gtkconv(GaimConversation * conv) +static PidginConversation * +pidgin_conv_find_gtkconv(GaimConversation * conv) { GaimBuddy *bud = gaim_find_buddy(conv->account, conv->name), *b; GaimContact *c; @@ -4506,15 +4506,15 @@ g_return_if_fail(bnode); g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(bnode)); - for (list = gaim_gtk_conv_windows_get_list(); list; list = list->next) + for (list = pidgin_conv_windows_get_list(); list; list = list->next) { - GaimGtkWindow *win = list->data; - GaimConversation *conv = gaim_gtk_conv_window_get_active_conversation(win); + PidginWindow *win = list->data; + GaimConversation *conv = pidgin_conv_window_get_active_conversation(win); if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM) continue; - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_MENU); + pidginconv_update_fields(conv, PIDGINCONV_MENU); } } @@ -4524,20 +4524,20 @@ static void private_gtkconv_new(GaimConversation *conv, gboolean hidden) { - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; GaimConversationType conv_type = gaim_conversation_get_type(conv); GtkWidget *pane = NULL; GtkWidget *tab_cont; - if (conv_type == GAIM_CONV_TYPE_IM && (gtkconv = gaim_gtk_conv_find_gtkconv(conv))) { + if (conv_type == GAIM_CONV_TYPE_IM && (gtkconv = pidgin_conv_find_gtkconv(conv))) { conv->ui_data = gtkconv; if (!g_list_find(gtkconv->convs, conv)) gtkconv->convs = g_list_prepend(gtkconv->convs, conv); - gaim_gtkconv_switch_active_conversation(conv); + pidginconv_switch_active_conversation(conv); return; } - gtkconv = g_new0(GaimGtkConversation, 1); + gtkconv = g_new0(PidginConversation, 1); conv->ui_data = gtkconv; gtkconv->active_conv = conv; gtkconv->convs = g_list_prepend(gtkconv->convs, conv); @@ -4550,11 +4550,11 @@ gtkconv->unseen_count = 0; if (conv_type == GAIM_CONV_TYPE_IM) { - gtkconv->u.im = g_malloc0(sizeof(GaimGtkImPane)); + gtkconv->u.im = g_malloc0(sizeof(PidginImPane)); pane = setup_im_pane(gtkconv); } else if (conv_type == GAIM_CONV_TYPE_CHAT) { - gtkconv->u.chat = g_malloc0(sizeof(GaimGtkChatPane)); + gtkconv->u.chat = g_malloc0(sizeof(PidginChatPane)); pane = setup_chat_pane(gtkconv); } @@ -4600,7 +4600,7 @@ /* Setup the container for the tab. */ gtkconv->tab_cont = tab_cont = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); - g_object_set_data(G_OBJECT(tab_cont), "GaimGtkConversation", gtkconv); + g_object_set_data(G_OBJECT(tab_cont), "PidginConversation", gtkconv); gtk_container_set_border_width(GTK_CONTAINER(tab_cont), GAIM_HIG_BOX_SPACE); gtk_container_add(GTK_CONTAINER(tab_cont), pane); gtk_widget_show(pane); @@ -4622,9 +4622,9 @@ gtkconv->entry); if (hidden) - gaim_gtk_conv_window_add_gtkconv(hidden_convwin, gtkconv); + pidgin_conv_window_add_gtkconv(hidden_convwin, gtkconv); else - gaim_gtkconv_placement_place(gtkconv); + pidginconv_placement_place(gtkconv); if (nick_colors == NULL) { nbr_nick_colors = NUM_NICK_COLORS; @@ -4633,13 +4633,13 @@ } static void -gaim_gtkconv_new_hidden(GaimConversation *conv) +pidginconv_new_hidden(GaimConversation *conv) { private_gtkconv_new(conv, TRUE); } void -gaim_gtkconv_new(GaimConversation *conv) +pidginconv_new(GaimConversation *conv) { private_gtkconv_new(conv, FALSE); } @@ -4648,16 +4648,16 @@ received_im_msg_cb(GaimAccount *account, char *sender, char *message, GaimConversation *conv, GaimMessageFlags flags) { - GaimConversationUiOps *ui_ops = gaim_gtk_conversations_get_conv_ui_ops(); + GaimConversationUiOps *ui_ops = pidgin_conversations_get_conv_ui_ops(); if (conv != NULL) return; /* create hidden conv if hide_new pref is always */ if (strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/im/hide_new"), "always") == 0) { - ui_ops->create_conversation = gaim_gtkconv_new_hidden; + ui_ops->create_conversation = pidginconv_new_hidden; gaim_conversation_new(GAIM_CONV_TYPE_IM, account, sender); - ui_ops->create_conversation = gaim_gtkconv_new; + ui_ops->create_conversation = pidginconv_new; return; } @@ -4665,24 +4665,24 @@ if (strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/im/hide_new"), "away") == 0 && !gaim_status_is_available(gaim_account_get_active_status(account))) { - ui_ops->create_conversation = gaim_gtkconv_new_hidden; + ui_ops->create_conversation = pidginconv_new_hidden; gaim_conversation_new(GAIM_CONV_TYPE_IM, account, sender); - ui_ops->create_conversation = gaim_gtkconv_new; + ui_ops->create_conversation = pidginconv_new; return; } } static void -gaim_gtkconv_destroy(GaimConversation *conv) -{ - GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); +pidginconv_destroy(GaimConversation *conv) +{ + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); gtkconv->convs = g_list_remove(gtkconv->convs, conv); /* Don't destroy ourselves until all our convos are gone */ if (gtkconv->convs) return; - gaim_gtk_conv_window_remove_gtkconv(gtkconv->win, gtkconv); + pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv); /* If the "Save Conversation" or "Save Icon" dialogs are open then close them */ gaim_request_close_with_handle(gtkconv); @@ -4715,13 +4715,13 @@ static void -gaim_gtkconv_write_im(GaimConversation *conv, const char *who, +pidginconv_write_im(GaimConversation *conv, const char *who, const char *message, GaimMessageFlags flags, time_t mtime) { - GaimGtkConversation *gtkconv; - - gtkconv = GAIM_GTK_CONVERSATION(conv); + PidginConversation *gtkconv; + + gtkconv = PIDGIN_CONVERSATION(conv); if (conv != gtkconv->active_conv && flags & GAIM_MESSAGE_ACTIVE_ONLY) @@ -4730,7 +4730,7 @@ * calling gaim_conv_im_write(), so they get suppressed here, * before being written to the log. */ gaim_debug_info("gtkconv", - "Suppressing message for an inactive conversation in gaim_gtkconv_write_im()\n"); + "Suppressing message for an inactive conversation in pidginconv_write_im()\n"); return; } @@ -4754,7 +4754,7 @@ if (btn_event->button == 2 && event->type == GDK_2BUTTON_PRESS) { - chat_do_info(GAIM_GTK_CONVERSATION(conv), buddyname); + chat_do_info(PIDGIN_CONVERSATION(conv), buddyname); return TRUE; } else if (btn_event->button == 3 @@ -4787,7 +4787,7 @@ } static GtkTextTag *get_buddy_tag(GaimConversation *conv, const char *who) { - GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); GtkTextTag *buddytag; gchar *str; @@ -4811,12 +4811,12 @@ } static void -gaim_gtkconv_write_conv(GaimConversation *conv, const char *name, const char *alias, +pidginconv_write_conv(GaimConversation *conv, const char *name, const char *alias, const char *message, GaimMessageFlags flags, time_t mtime) { - GaimGtkConversation *gtkconv; - GaimGtkWindow *win; + PidginConversation *gtkconv; + PidginWindow *win; GaimConnection *gc; GaimAccount *account; GaimPluginProtocolInfo *prpl_info; @@ -4838,7 +4838,7 @@ int tag_count = 0; g_return_if_fail(conv != NULL); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); g_return_if_fail(gtkconv != NULL); if (conv != gtkconv->active_conv) @@ -4850,14 +4850,14 @@ * you wanted, call gaim_conv_im_write() instead of * gaim_conversation_write(). */ gaim_debug_info("gtkconv", - "Suppressing message for an inactive conversation in gaim_gtkconv_write_conv()\n"); + "Suppressing message for an inactive conversation in pidginconv_write_conv()\n"); return; } /* Set the active conversation to the one that just messaged us. */ /* TODO: consider not doing this if the account is offline or something */ if (flags & (GAIM_MESSAGE_SEND | GAIM_MESSAGE_RECV)) - gaim_gtkconv_switch_active_conversation(conv); + pidginconv_switch_active_conversation(conv); } type = gaim_conversation_get_type(conv); @@ -4868,7 +4868,7 @@ displaying = g_strdup(message); plugin_return = GPOINTER_TO_INT(gaim_signal_emit_return_1( - gaim_gtk_conversations_get_handle(), (type == GAIM_CONV_TYPE_IM ? + pidgin_conversations_get_handle(), (type == GAIM_CONV_TYPE_IM ? "displaying-im-msg" : "displaying-chat-msg"), account, name, &displaying, conv, flags)); if (plugin_return) @@ -4932,7 +4932,7 @@ if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)))) gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", gtk_font_options_all); - mdate = gaim_signal_emit_return_1(gaim_gtk_conversations_get_handle(), + mdate = gaim_signal_emit_return_1(pidgin_conversations_get_handle(), "conversation-timestamp", conv, mtime); if (mdate == NULL) @@ -5160,7 +5160,7 @@ g_free(sml_attrib); /* Tab highlighting stuff */ - if (!(flags & GAIM_MESSAGE_SEND) && !gaim_gtkconv_has_focus(conv)) + if (!(flags & GAIM_MESSAGE_SEND) && !pidginconv_has_focus(conv)) { GaimUnseenState unseen = GAIM_UNSEEN_NONE; @@ -5177,17 +5177,17 @@ gtkconv_set_unseen(gtkconv, unseen); } - gaim_signal_emit(gaim_gtk_conversations_get_handle(), + gaim_signal_emit(pidgin_conversations_get_handle(), (type == GAIM_CONV_TYPE_IM ? "displayed-im-msg" : "displayed-chat-msg"), account, name, displaying, conv, flags); g_free(displaying); } static void -gaim_gtkconv_chat_add_users(GaimConversation *conv, GList *cbuddies, gboolean new_arrivals) +pidginconv_chat_add_users(GaimConversation *conv, GList *cbuddies, gboolean new_arrivals) { GaimConvChat *chat; - GaimGtkConversation *gtkconv; - GaimGtkChatPane *gtkchat; + PidginConversation *gtkconv; + PidginChatPane *gtkchat; GtkListStore *ls; GList *l; @@ -5195,7 +5195,7 @@ int num_users; chat = GAIM_CONV_CHAT(conv); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtkchat = gtkconv->u.chat; num_users = g_list_length(gaim_conv_chat_get_users(chat)); @@ -5228,12 +5228,12 @@ } static void -gaim_gtkconv_chat_rename_user(GaimConversation *conv, const char *old_name, +pidginconv_chat_rename_user(GaimConversation *conv, const char *old_name, const char *new_name, const char *new_alias) { GaimConvChat *chat; - GaimGtkConversation *gtkconv; - GaimGtkChatPane *gtkchat; + PidginConversation *gtkconv; + PidginChatPane *gtkchat; GaimConvChatBuddyFlags flags; GaimConvChatBuddy *cbuddy; GtkTreeIter iter; @@ -5241,7 +5241,7 @@ int f = 1; chat = GAIM_CONV_CHAT(conv); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtkchat = gtkconv->u.chat; model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); @@ -5276,11 +5276,11 @@ } static void -gaim_gtkconv_chat_remove_users(GaimConversation *conv, GList *users) +pidginconv_chat_remove_users(GaimConversation *conv, GList *users) { GaimConvChat *chat; - GaimGtkConversation *gtkconv; - GaimGtkChatPane *gtkchat; + PidginConversation *gtkconv; + PidginChatPane *gtkchat; GtkTreeIter iter; GtkTreeModel *model; GList *l; @@ -5289,7 +5289,7 @@ gboolean f; chat = GAIM_CONV_CHAT(conv); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtkchat = gtkconv->u.chat; num_users = g_list_length(gaim_conv_chat_get_users(chat)); @@ -5329,20 +5329,20 @@ } static void -gaim_gtkconv_chat_update_user(GaimConversation *conv, const char *user) +pidginconv_chat_update_user(GaimConversation *conv, const char *user) { GaimConvChat *chat; GaimConvChatBuddyFlags flags; GaimConvChatBuddy *cbuddy; - GaimGtkConversation *gtkconv; - GaimGtkChatPane *gtkchat; + PidginConversation *gtkconv; + PidginChatPane *gtkchat; GtkTreeIter iter; GtkTreeModel *model; int f = 1; char *alias = NULL; chat = GAIM_CONV_CHAT(conv); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtkchat = gtkconv->u.chat; model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); @@ -5384,23 +5384,23 @@ } gboolean -gaim_gtkconv_has_focus(GaimConversation *conv) -{ - GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); - GaimGtkWindow *win; +pidginconv_has_focus(GaimConversation *conv) +{ + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); + PidginWindow *win; gboolean has_focus; win = gtkconv->win; g_object_get(G_OBJECT(win->window), "has-toplevel-focus", &has_focus, NULL); - if (has_focus && gaim_gtk_conv_window_is_active_conversation(conv)) + if (has_focus && pidgin_conv_window_is_active_conversation(conv)) return TRUE; return FALSE; } -static void gaim_gtkconv_custom_smiley_allocated(GdkPixbufLoader *loader, gpointer user_data) +static void pidginconv_custom_smiley_allocated(GdkPixbufLoader *loader, gpointer user_data) { GtkIMHtmlSmiley *smiley; @@ -5410,11 +5410,11 @@ if (smiley->icon) g_object_ref(G_OBJECT(smiley->icon)); #ifdef DEBUG_CUSTOM_SMILEY - gaim_debug_info("custom-smiley", "gaim_gtkconv_custom_smiley_allocated(): got GdkPixbufAnimation %p for smiley '%s'\n", smiley->icon, smiley->smile); + gaim_debug_info("custom-smiley", "pidginconv_custom_smiley_allocated(): got GdkPixbufAnimation %p for smiley '%s'\n", smiley->icon, smiley->smile); #endif } -static void gaim_gtkconv_custom_smiley_closed(GdkPixbufLoader *loader, gpointer user_data) +static void pidginconv_custom_smiley_closed(GdkPixbufLoader *loader, gpointer user_data) { GtkIMHtmlSmiley *smiley; GtkWidget *icon = NULL; @@ -5424,7 +5424,7 @@ smiley = (GtkIMHtmlSmiley *)user_data; if (!smiley->imhtml) { #ifdef DEBUG_CUSTOM_SMILEY - gaim_debug_error("custom-smiley", "gaim_gtkconv_custom_smiley_closed(): orphan smiley found: %p\n", smiley); + gaim_debug_error("custom-smiley", "pidginconv_custom_smiley_closed(): orphan smiley found: %p\n", smiley); #endif g_object_unref(G_OBJECT(loader)); smiley->loader = NULL; @@ -5436,7 +5436,7 @@ icon = gtk_image_new_from_animation(smiley->icon); #ifdef DEBUG_CUSTOM_SMILEY - gaim_debug_info("custom-smiley", "gaim_gtkconv_custom_smiley_closed(): got GtkImage %p from GtkPixbufAnimation %p for smiley '%s'\n", + gaim_debug_info("custom-smiley", "pidginconv_custom_smiley_closed(): got GtkImage %p from GtkPixbufAnimation %p for smiley '%s'\n", icon, smiley->icon, smiley->smile); #endif if (icon) { @@ -5482,8 +5482,8 @@ smiley->loader = gdk_pixbuf_loader_new(); smiley->icon = NULL; - g_signal_connect(smiley->loader, "area_prepared", G_CALLBACK(gaim_gtkconv_custom_smiley_allocated), smiley); - g_signal_connect(smiley->loader, "closed", G_CALLBACK(gaim_gtkconv_custom_smiley_closed), smiley); + g_signal_connect(smiley->loader, "area_prepared", G_CALLBACK(pidginconv_custom_smiley_allocated), smiley); + g_signal_connect(smiley->loader, "closed", G_CALLBACK(pidginconv_custom_smiley_closed), smiley); return TRUE; } @@ -5499,8 +5499,8 @@ smiley->loader = loader; smiley->flags = smiley->flags | GTK_IMHTML_SMILEY_CUSTOM; - g_signal_connect(smiley->loader, "area_prepared", G_CALLBACK(gaim_gtkconv_custom_smiley_allocated), smiley); - g_signal_connect(smiley->loader, "closed", G_CALLBACK(gaim_gtkconv_custom_smiley_closed), smiley); + g_signal_connect(smiley->loader, "area_prepared", G_CALLBACK(pidginconv_custom_smiley_allocated), smiley); + g_signal_connect(smiley->loader, "closed", G_CALLBACK(pidginconv_custom_smiley_closed), smiley); gtk_imhtml_associate_smiley(imhtml, sml, smiley); @@ -5508,9 +5508,9 @@ } static gboolean -gaim_gtkconv_custom_smiley_add(GaimConversation *conv, const char *smile, gboolean remote) -{ - GaimGtkConversation *gtkconv; +pidginconv_custom_smiley_add(GaimConversation *conv, const char *smile, gboolean remote) +{ + PidginConversation *gtkconv; struct smiley_list *list; const char *sml = NULL, *conv_sml; @@ -5519,13 +5519,13 @@ } /* If smileys are off, return false */ - if (gaim_gtkthemes_smileys_disabled()) + if (pidginthemes_smileys_disabled()) return FALSE; /* If possible add this smiley to the current theme. * The addition is only temporary: custom smilies aren't saved to disk. */ conv_sml = gaim_account_get_protocol_name(conv->account); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); for (list = (struct smiley_list *)current_smiley_theme->list; list; list = list->next) { if (!strcmp(list->sml, conv_sml)) { @@ -5545,16 +5545,16 @@ } static void -gaim_gtkconv_custom_smiley_write(GaimConversation *conv, const char *smile, +pidginconv_custom_smiley_write(GaimConversation *conv, const char *smile, const guchar *data, gsize size) { - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; GtkIMHtmlSmiley *smiley; GdkPixbufLoader *loader; const char *sml; sml = gaim_account_get_protocol_name(conv->account); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); smiley = gtk_imhtml_smiley_get(GTK_IMHTML(gtkconv->imhtml), sml, smile); if (!smiley) @@ -5568,9 +5568,9 @@ } static void -gaim_gtkconv_custom_smiley_close(GaimConversation *conv, const char *smile) -{ - GaimGtkConversation *gtkconv; +pidginconv_custom_smiley_close(GaimConversation *conv, const char *smile) +{ + PidginConversation *gtkconv; GtkIMHtmlSmiley *smiley; GdkPixbufLoader *loader; const char *sml; @@ -5579,7 +5579,7 @@ g_return_if_fail(smile != NULL); sml = gaim_account_get_protocol_name(conv->account); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); smiley = gtk_imhtml_smiley_get(GTK_IMHTML(gtkconv->imhtml), sml, smile); if (!smiley) @@ -5599,9 +5599,9 @@ } static void -gaim_gtkconv_send_confirm(GaimConversation *conv, const char *message) -{ - GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); +pidginconv_send_confirm(GaimConversation *conv, const char *message) +{ + PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); gtk_imhtml_append_text(GTK_IMHTML(gtkconv->entry), message, 0); } @@ -5612,9 +5612,9 @@ * account signs on or off. */ static void -gray_stuff_out(GaimGtkConversation *gtkconv) -{ - GaimGtkWindow *win; +gray_stuff_out(PidginConversation *gtkconv) +{ + PidginWindow *win; GaimConversation *conv = gtkconv->active_conv; GaimConnection *gc; GaimPluginProtocolInfo *prpl_info = NULL; @@ -5622,7 +5622,7 @@ GtkIMHtmlButtons buttons; GaimAccount *account; - win = gaim_gtkconv_get_window(gtkconv); + win = pidginconv_get_window(gtkconv); gc = gaim_conversation_get_gc(conv); account = gaim_conversation_get_account(conv); @@ -5778,7 +5778,7 @@ /* * Update the window's icon */ - if (gaim_gtk_conv_window_is_active_conversation(conv)) + if (pidgin_conv_window_is_active_conversation(conv)) { if ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) && (gtkconv->u.im->anim)) @@ -5787,7 +5787,7 @@ gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim); g_object_ref(window_icon); } else { - window_icon = gaim_gtkconv_get_tab_icon(conv, FALSE); + window_icon = pidginconv_get_tab_icon(conv, FALSE); } gtk_window_set_icon(GTK_WINDOW(win->window), window_icon); if (window_icon != NULL) @@ -5796,47 +5796,47 @@ } static void -gaim_gtkconv_update_fields(GaimConversation *conv, GaimGtkConvFields fields) -{ - GaimGtkConversation *gtkconv; - GaimGtkWindow *win; - - gtkconv = GAIM_GTK_CONVERSATION(conv); +pidginconv_update_fields(GaimConversation *conv, PidginConvFields fields) +{ + PidginConversation *gtkconv; + PidginWindow *win; + + gtkconv = PIDGIN_CONVERSATION(conv); if (!gtkconv) return; - win = gaim_gtkconv_get_window(gtkconv); + win = pidginconv_get_window(gtkconv); if (!win) return; - if (fields & GAIM_GTKCONV_SET_TITLE) + if (fields & PIDGINCONV_SET_TITLE) { gaim_conversation_autoset_title(conv); } - if (fields & GAIM_GTKCONV_BUDDY_ICON) + if (fields & PIDGINCONV_BUDDY_ICON) { if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) - gaim_gtkconv_update_buddy_icon(conv); - } - - if (fields & GAIM_GTKCONV_MENU) + pidginconv_update_buddy_icon(conv); + } + + if (fields & PIDGINCONV_MENU) { - gray_stuff_out(GAIM_GTK_CONVERSATION(conv)); + gray_stuff_out(PIDGIN_CONVERSATION(conv)); generate_send_to_items(win); } - if (fields & GAIM_GTKCONV_TAB_ICON) + if (fields & PIDGINCONV_TAB_ICON) { update_tab_icon(conv); generate_send_to_items(win); /* To update the icons in SendTo menu */ } - if ((fields & GAIM_GTKCONV_TOPIC) && + if ((fields & PIDGINCONV_TOPIC) && gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) { const char *topic; GaimConvChat *chat = GAIM_CONV_CHAT(conv); - GaimGtkChatPane *gtkchat = gtkconv->u.chat; + PidginChatPane *gtkchat = gtkconv->u.chat; if (gtkchat->topic_text != NULL) { @@ -5848,11 +5848,11 @@ } } - if (fields & GAIM_GTKCONV_SMILEY_THEME) - gaim_gtkthemes_smiley_themeize(GAIM_GTK_CONVERSATION(conv)->imhtml); - - if ((fields & GAIM_GTKCONV_COLORIZE_TITLE) || - (fields & GAIM_GTKCONV_SET_TITLE)) + if (fields & PIDGINCONV_SMILEY_THEME) + pidginthemes_smiley_themeize(PIDGIN_CONVERSATION(conv)->imhtml); + + if ((fields & PIDGINCONV_COLORIZE_TITLE) || + (fields & PIDGINCONV_SET_TITLE)) { char *title; GaimConvIm *im = NULL; @@ -5921,11 +5921,11 @@ else gtk_label_set_text(GTK_LABEL(gtkconv->tab_label), title); - if (gaim_gtk_conv_window_is_active_conversation(conv)) + if (pidgin_conv_window_is_active_conversation(conv)) update_typing_icon(gtkconv); gtk_label_set_text(GTK_LABEL(gtkconv->menu_label), title); - if (gaim_gtk_conv_window_is_active_conversation(conv)) + if (pidgin_conv_window_is_active_conversation(conv)) gtk_window_set_title(GTK_WINDOW(win->window), title); g_free(title); @@ -5933,74 +5933,74 @@ } static void -gaim_gtkconv_updated(GaimConversation *conv, GaimConvUpdateType type) -{ - GaimGtkConvFields flags = 0; +pidginconv_updated(GaimConversation *conv, GaimConvUpdateType type) +{ + PidginConvFields flags = 0; g_return_if_fail(conv != NULL); if (type == GAIM_CONV_UPDATE_ACCOUNT) { - flags = GAIM_GTKCONV_ALL; + flags = PIDGINCONV_ALL; } else if (type == GAIM_CONV_UPDATE_TYPING || type == GAIM_CONV_UPDATE_UNSEEN || type == GAIM_CONV_UPDATE_TITLE) { - flags = GAIM_GTKCONV_COLORIZE_TITLE; + flags = PIDGINCONV_COLORIZE_TITLE; } else if (type == GAIM_CONV_UPDATE_TOPIC) { - flags = GAIM_GTKCONV_TOPIC; + flags = PIDGINCONV_TOPIC; } else if (type == GAIM_CONV_ACCOUNT_ONLINE || type == GAIM_CONV_ACCOUNT_OFFLINE) { - flags = GAIM_GTKCONV_MENU | GAIM_GTKCONV_TAB_ICON | GAIM_GTKCONV_SET_TITLE; + flags = PIDGINCONV_MENU | PIDGINCONV_TAB_ICON | PIDGINCONV_SET_TITLE; } else if (type == GAIM_CONV_UPDATE_AWAY) { - flags = GAIM_GTKCONV_TAB_ICON; + flags = PIDGINCONV_TAB_ICON; } else if (type == GAIM_CONV_UPDATE_ADD || type == GAIM_CONV_UPDATE_REMOVE || type == GAIM_CONV_UPDATE_CHATLEFT) { - flags = GAIM_GTKCONV_SET_TITLE | GAIM_GTKCONV_MENU; + flags = PIDGINCONV_SET_TITLE | PIDGINCONV_MENU; } else if (type == GAIM_CONV_UPDATE_ICON) { - flags = GAIM_GTKCONV_BUDDY_ICON; + flags = PIDGINCONV_BUDDY_ICON; } else if (type == GAIM_CONV_UPDATE_FEATURES) { - flags = GAIM_GTKCONV_MENU; - } - - gaim_gtkconv_update_fields(conv, flags); + flags = PIDGINCONV_MENU; + } + + pidginconv_update_fields(conv, flags); } static GaimConversationUiOps conversation_ui_ops = { - gaim_gtkconv_new, - gaim_gtkconv_destroy, /* destroy_conversation */ + pidginconv_new, + pidginconv_destroy, /* destroy_conversation */ NULL, /* write_chat */ - gaim_gtkconv_write_im, /* write_im */ - gaim_gtkconv_write_conv, /* write_conv */ - gaim_gtkconv_chat_add_users, /* chat_add_users */ - gaim_gtkconv_chat_rename_user, /* chat_rename_user */ - gaim_gtkconv_chat_remove_users, /* chat_remove_users */ - gaim_gtkconv_chat_update_user, /* chat_update_user */ - gaim_gtkconv_present_conversation, /* present */ - gaim_gtkconv_has_focus, /* has_focus */ - gaim_gtkconv_custom_smiley_add, /* custom_smiley_add */ - gaim_gtkconv_custom_smiley_write, /* custom_smiley_write */ - gaim_gtkconv_custom_smiley_close, /* custom_smiley_close */ - gaim_gtkconv_send_confirm, /* send_confirm */ + pidginconv_write_im, /* write_im */ + pidginconv_write_conv, /* write_conv */ + pidginconv_chat_add_users, /* chat_add_users */ + pidginconv_chat_rename_user, /* chat_rename_user */ + pidginconv_chat_remove_users, /* chat_remove_users */ + pidginconv_chat_update_user, /* chat_update_user */ + pidginconv_present_conversation, /* present */ + pidginconv_has_focus, /* has_focus */ + pidginconv_custom_smiley_add, /* custom_smiley_add */ + pidginconv_custom_smiley_write, /* custom_smiley_write */ + pidginconv_custom_smiley_close, /* custom_smiley_close */ + pidginconv_send_confirm, /* send_confirm */ }; GaimConversationUiOps * -gaim_gtk_conversations_get_conv_ui_ops(void) +pidgin_conversations_get_conv_ui_ops(void) { return &conversation_ui_ops; } @@ -6009,10 +6009,10 @@ * Public conversation utility functions **************************************************************************/ void -gaim_gtkconv_update_buddy_icon(GaimConversation *conv) -{ - GaimGtkConversation *gtkconv; - GaimGtkWindow *win; +pidginconv_update_buddy_icon(GaimConversation *conv) +{ + PidginConversation *gtkconv; + PidginWindow *win; GdkPixbufLoader *loader; GdkPixbufAnimation *anim; @@ -6038,7 +6038,7 @@ g_return_if_fail(GAIM_IS_GTK_CONVERSATION(conv)); g_return_if_fail(gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM); - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); win = gtkconv->win; if (conv != gtkconv->active_conv) return; @@ -6134,7 +6134,7 @@ start_anim(NULL, gtkconv); } - gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, + pidgin_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, GAIM_ICON_SCALE_DISPLAY, &scale_width, &scale_height); scale = gdk_pixbuf_scale_simple(buf, MAX(gdk_pixbuf_get_width(buf) * scale_width / @@ -6174,7 +6174,7 @@ gtk_widget_show(frame); /* The buddy icon code needs badly to be fixed. */ - if(gaim_gtk_conv_window_is_active_conversation(conv)) + if(pidgin_conv_window_is_active_conversation(conv)) { buf = gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim); gtk_window_set_icon(GTK_WINDOW(win->window), buf); @@ -6182,21 +6182,21 @@ } void -gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv) -{ - GaimGtkWindow *win; +pidginconv_update_buttons_by_protocol(GaimConversation *conv) +{ + PidginWindow *win; if (!GAIM_IS_GTK_CONVERSATION(conv)) return; - win = GAIM_GTK_CONVERSATION(conv)->win; - - if (win != NULL && gaim_gtk_conv_window_is_active_conversation(conv)) - gray_stuff_out(GAIM_GTK_CONVERSATION(conv)); + win = PIDGIN_CONVERSATION(conv)->win; + + if (win != NULL && pidgin_conv_window_is_active_conversation(conv)) + gray_stuff_out(PIDGIN_CONVERSATION(conv)); } int -gaim_gtkconv_get_tab_at_xy(GaimGtkWindow *win, int x, int y, gboolean *to_right) +pidginconv_get_tab_at_xy(PidginWindow *win, int x, int y, gboolean *to_right) { gint nb_x, nb_y, x_rel, y_rel; GtkNotebook *notebook; @@ -6270,7 +6270,7 @@ { GList *l; GaimConversation *conv; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; for (l = gaim_get_conversations(); l != NULL; l = l->next) { conv = (GaimConversation *)l->data; @@ -6278,7 +6278,7 @@ if (!GAIM_IS_GTK_CONVERSATION(conv)) continue; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); if (value) gtk_widget_show(gtkconv->close); @@ -6294,7 +6294,7 @@ #ifdef USE_GTKSPELL GList *cl; GaimConversation *conv; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; GtkSpell *spell; for (cl = gaim_get_conversations(); cl != NULL; cl = cl->next) { @@ -6304,10 +6304,10 @@ if (!GAIM_IS_GTK_CONVERSATION(conv)) continue; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); if (value) - gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(gtkconv->entry)); + pidgin_setup_gtkspell(GTK_TEXT_VIEW(gtkconv->entry)); else { spell = gtkspell_get_from_text_view(GTK_TEXT_VIEW(gtkconv->entry)); gtkspell_detach(spell); @@ -6322,11 +6322,11 @@ { GList *l; GtkPositionType pos; - GaimGtkWindow *win; + PidginWindow *win; pos = GPOINTER_TO_INT(value); - for (l = gaim_gtk_conv_windows_get_list(); l != NULL; l = l->next) { + for (l = pidgin_conv_windows_get_list(); l != NULL; l = l->next) { win = l->data; gtk_notebook_set_tab_pos(GTK_NOTEBOOK(win->notebook), pos&~8); @@ -6339,8 +6339,8 @@ { GList *l; GaimConversation *conv; - GaimGtkConversation *gtkconv; - GaimGtkWindow *win; + PidginConversation *gtkconv; + PidginWindow *win; for (l = gaim_get_conversations(); l != NULL; l = l->next) { @@ -6349,7 +6349,7 @@ if (!GAIM_IS_GTK_CONVERSATION(conv)) continue; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); win = gtkconv->win; gtk_check_menu_item_set_active( @@ -6367,8 +6367,8 @@ { GList *l; GaimConversation *conv; - GaimGtkConversation *gtkconv; - GaimGtkWindow *win; + PidginConversation *gtkconv; + PidginWindow *win; for (l = gaim_get_conversations(); l != NULL; l = l->next) { @@ -6377,7 +6377,7 @@ if (!GAIM_IS_GTK_CONVERSATION(conv)) continue; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); win = gtkconv->win; gtk_check_menu_item_set_active( @@ -6397,8 +6397,8 @@ { GList *l; GaimConversation *conv; - GaimGtkConversation *gtkconv; - GaimGtkWindow *win; + PidginConversation *gtkconv; + PidginWindow *win; if (!gaim_prefs_get_bool("/gaim/gtk/conversations/im/show_buddy_icons")) return; @@ -6406,15 +6406,15 @@ /* Set the "animate" flag for each icon based on the new preference */ for (l = gaim_get_ims(); l != NULL; l = l->next) { conv = (GaimConversation *)l->data; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); gtkconv->u.im->animate = GPOINTER_TO_INT(value); } /* Now either stop or start animation for the active conversation in each window */ - for (l = gaim_gtk_conv_windows_get_list(); l != NULL; l = l->next) { + for (l = pidgin_conv_windows_get_list(); l != NULL; l = l->next) { win = l->data; - conv = gaim_gtk_conv_window_get_active_conversation(win); - gaim_gtkconv_update_buddy_icon(conv); + conv = pidgin_conv_window_get_active_conversation(win); + pidginconv_update_buddy_icon(conv); } } @@ -6428,7 +6428,7 @@ GaimConversation *conv = l->data; if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) - gaim_gtkconv_update_buddy_icon(conv); + pidginconv_update_buddy_icon(conv); } } @@ -6445,7 +6445,7 @@ { GList *l; GaimConversation *conv = NULL; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; if(strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/im/hide_new"), "away")!=0) return; @@ -6466,8 +6466,8 @@ if (!l) break; - gaim_gtk_conv_window_remove_gtkconv(hidden_convwin, gtkconv); - gaim_gtkconv_placement_place(gtkconv); + pidgin_conv_window_remove_gtkconv(hidden_convwin, gtkconv); + pidginconv_placement_place(gtkconv); /* TODO: do we need to do anything for any other conversations that are in the same gtkconv here? * I'm a little concerned that not doing so will cause the "pending" indicator in the gtkblist not to be cleared. -DAA*/ @@ -6481,7 +6481,7 @@ { GList *l; GaimConversation *conv = NULL; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; gboolean when_away = FALSE; if(!hidden_convwin) @@ -6504,8 +6504,8 @@ gaim_conversation_get_account(conv)))) continue; - gaim_gtk_conv_window_remove_gtkconv(hidden_convwin, gtkconv); - gaim_gtkconv_placement_place(gtkconv); + pidgin_conv_window_remove_gtkconv(hidden_convwin, gtkconv); + pidginconv_placement_place(gtkconv); } } @@ -6519,15 +6519,15 @@ if (strcmp(name, "/gaim/gtk/conversations/placement")) return; - func = gaim_gtkconv_placement_get_fnc(value); + func = pidginconv_placement_get_fnc(value); if (func == NULL) return; - gaim_gtkconv_placement_set_current_func(func); -} - -static GaimGtkConversation * + pidginconv_placement_set_current_func(func); +} + +static PidginConversation * get_gtkconv_with_contact(GaimContact *contact) { GaimBlistNode *node; @@ -6540,7 +6540,7 @@ GaimConversation *conv; conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account); if (conv) - return GAIM_GTK_CONVERSATION(conv); + return PIDGIN_CONVERSATION(conv); } return NULL; } @@ -6559,8 +6559,8 @@ * one of the contacts containing the buddy corresponding to * a conversation. It's easier to just update them all. */ /* if (gaim_conversation_get_account(conv) == account) */ - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_TAB_ICON | - GAIM_GTKCONV_MENU | GAIM_GTKCONV_COLORIZE_TITLE); + pidginconv_update_fields(conv, PIDGINCONV_TAB_ICON | + PIDGINCONV_MENU | PIDGINCONV_COLORIZE_TITLE); } } @@ -6572,7 +6572,7 @@ conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account); if (conv) - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_TAB_ICON); + pidginconv_update_fields(conv, PIDGINCONV_TAB_ICON); return FALSE; } @@ -6580,16 +6580,16 @@ static void update_buddy_status_changed(GaimBuddy *buddy, GaimStatus *old, GaimStatus *newstatus) { - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; GaimConversation *conv; gtkconv = get_gtkconv_with_contact(gaim_buddy_get_contact(buddy)); if (gtkconv) { conv = gtkconv->active_conv; - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_TAB_ICON | GAIM_GTKCONV_COLORIZE_TITLE); + pidginconv_update_fields(conv, PIDGINCONV_TAB_ICON | PIDGINCONV_COLORIZE_TITLE); if ((gaim_status_is_online(old) ^ gaim_status_is_online(newstatus)) != 0) - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_MENU); + pidginconv_update_fields(conv, PIDGINCONV_MENU); } /* In case a conversation is started after the buddy has signed-on/off */ @@ -6599,13 +6599,13 @@ static void update_buddy_privacy_changed(GaimBuddy *buddy) { - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; GaimConversation *conv; gtkconv = get_gtkconv_with_contact(gaim_buddy_get_contact(buddy)); if (gtkconv) { conv = gtkconv->active_conv; - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_TAB_ICON | GAIM_GTKCONV_MENU); + pidginconv_update_fields(conv, PIDGINCONV_TAB_ICON | PIDGINCONV_MENU); } } @@ -6616,7 +6616,7 @@ conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account); if (conv) - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_TAB_ICON); + pidginconv_update_fields(conv, PIDGINCONV_TAB_ICON); } static void @@ -6626,7 +6626,7 @@ conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account); if (conv) - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_BUDDY_ICON); + pidginconv_update_fields(conv, PIDGINCONV_BUDDY_ICON); } static void @@ -6650,40 +6650,40 @@ static void update_conversation_switched(GaimConversation *conv) { - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_TAB_ICON | GAIM_GTKCONV_SET_TITLE | - GAIM_GTKCONV_MENU | GAIM_GTKCONV_BUDDY_ICON); + pidginconv_update_fields(conv, PIDGINCONV_TAB_ICON | PIDGINCONV_SET_TITLE | + PIDGINCONV_MENU | PIDGINCONV_BUDDY_ICON); } static void update_buddy_typing(GaimAccount *account, const char *who) { GaimConversation *conv; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, account); if (!conv) return; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); if (gtkconv && gtkconv->active_conv == conv) - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_COLORIZE_TITLE); + pidginconv_update_fields(conv, PIDGINCONV_COLORIZE_TITLE); } static void update_chat(GaimConversation *conv) { - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_TOPIC | - GAIM_GTKCONV_MENU | GAIM_GTKCONV_SET_TITLE); + pidginconv_update_fields(conv, PIDGINCONV_TOPIC | + PIDGINCONV_MENU | PIDGINCONV_SET_TITLE); } static void update_chat_topic(GaimConversation *conv, const char *old, const char *new) { - gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_TOPIC); + pidginconv_update_fields(conv, PIDGINCONV_TOPIC); } void * -gaim_gtk_conversations_get_handle(void) +pidgin_conversations_get_handle(void) { static int handle; @@ -6691,9 +6691,9 @@ } void -gaim_gtk_conversations_init(void) -{ - void *handle = gaim_gtk_conversations_get_handle(); +pidgin_conversations_init(void) +{ + void *handle = pidgin_conversations_get_handle(); void *blist_handle = gaim_blist_get_handle(); /* Conversations */ @@ -6772,9 +6772,9 @@ gaim_signal_register(handle, "conversation-dragging", gaim_marshal_VOID__POINTER_POINTER, NULL, 2, gaim_value_new(GAIM_TYPE_BOXED, - "GaimGtkWindow *"), + "PidginWindow *"), gaim_value_new(GAIM_TYPE_BOXED, - "GaimGtkWindow *")); + "PidginWindow *")); gaim_signal_register(handle, "conversation-timestamp", #if SIZEOF_TIME_T == 4 @@ -6879,7 +6879,7 @@ gaim_conversations_set_ui_ops(&conversation_ui_ops); - hidden_convwin = gaim_gtk_conv_window_new(); + hidden_convwin = pidgin_conv_window_new(); window_list = g_list_remove(window_list, hidden_convwin); gaim_signal_connect(gaim_accounts_get_handle(), "account-status-changed", @@ -6906,7 +6906,7 @@ handle, GAIM_CALLBACK(update_buddy_typing), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "buddy-typing-stopped", handle, GAIM_CALLBACK(update_buddy_typing), NULL); - gaim_signal_connect(gaim_gtk_conversations_get_handle(), "conversation-switched", + gaim_signal_connect(pidgin_conversations_get_handle(), "conversation-switched", handle, GAIM_CALLBACK(update_conversation_switched), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "chat-left", handle, GAIM_CALLBACK(update_chat), NULL); @@ -6915,17 +6915,17 @@ gaim_signal_connect(gaim_conversations_get_handle(), "chat-topic-changed", handle, GAIM_CALLBACK(update_chat_topic), NULL); gaim_signal_connect_priority(gaim_conversations_get_handle(), "conversation-updated", handle, - GAIM_CALLBACK(gaim_gtkconv_updated), NULL, + GAIM_CALLBACK(pidginconv_updated), NULL, GAIM_SIGNAL_PRIORITY_LOWEST); } void -gaim_gtk_conversations_uninit(void) -{ - gaim_prefs_disconnect_by_handle(gaim_gtk_conversations_get_handle()); - gaim_signals_disconnect_by_handle(gaim_gtk_conversations_get_handle()); - gaim_signals_unregister_by_instance(gaim_gtk_conversations_get_handle()); - gaim_gtk_conv_window_destroy(hidden_convwin); +pidgin_conversations_uninit(void) +{ + gaim_prefs_disconnect_by_handle(pidgin_conversations_get_handle()); + gaim_signals_disconnect_by_handle(pidgin_conversations_get_handle()); + gaim_signals_unregister_by_instance(pidgin_conversations_get_handle()); + pidgin_conv_window_destroy(hidden_convwin); hidden_convwin=NULL; } @@ -7002,17 +7002,17 @@ #include "gtkimhtmltoolbar.h" static void -do_close(GtkWidget *w, int resp, GaimGtkWindow *win) +do_close(GtkWidget *w, int resp, PidginWindow *win) { gtk_widget_destroy(warn_close_dialog); warn_close_dialog = NULL; if (resp == GTK_RESPONSE_OK) - gaim_gtk_conv_window_destroy(win); -} - -static void -build_warn_close_dialog(GaimGtkWindow *gtkwin) + pidgin_conv_window_destroy(win); +} + +static void +build_warn_close_dialog(PidginWindow *gtkwin) { GtkWidget *label; GtkWidget *vbox, *hbox; @@ -7073,14 +7073,14 @@ static gboolean close_win_cb(GtkWidget *w, GdkEventAny *e, gpointer d) { - GaimGtkWindow *win = d; + PidginWindow *win = d; GList *l; /* If there are unread messages then show a warning dialog */ - for (l = gaim_gtk_conv_window_get_gtkconvs(win); + for (l = pidgin_conv_window_get_gtkconvs(win); l != NULL; l = l->next) { - GaimGtkConversation *gtkconv = l->data; + PidginConversation *gtkconv = l->data; if (gaim_conversation_get_type(gtkconv->active_conv) == GAIM_CONV_TYPE_IM && gtkconv->unseen_state >= GAIM_UNSEEN_TEXT) { @@ -7091,13 +7091,13 @@ } } - gaim_gtk_conv_window_destroy(win); + pidgin_conv_window_destroy(win); return TRUE; } static void -gtkconv_set_unseen(GaimGtkConversation *gtkconv, GaimUnseenState state) +gtkconv_set_unseen(PidginConversation *gtkconv, GaimUnseenState state) { if (state == GAIM_UNSEEN_NONE) { @@ -7124,8 +7124,8 @@ static gint focus_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d) { - GaimGtkWindow *win = d; - GaimGtkConversation *gtkconv = gaim_gtk_conv_window_get_active_gtkconv(win); + PidginWindow *win = d; + PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win); gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); @@ -7143,7 +7143,7 @@ #endif static void -notebook_init_grab(GaimGtkWindow *gtkwin, GtkWidget *widget) +notebook_init_grab(PidginWindow *gtkwin, GtkWidget *widget) { static GdkCursor *cursor = NULL; @@ -7171,7 +7171,7 @@ } static gboolean -notebook_motion_cb(GtkWidget *widget, GdkEventButton *e, GaimGtkWindow *win) +notebook_motion_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win) { /* @@ -7189,17 +7189,17 @@ } } else { /* Otherwise, draw the arrows. */ - GaimGtkWindow *dest_win; + PidginWindow *dest_win; GtkNotebook *dest_notebook; GtkWidget *tab; gint nb_x, nb_y, page_num; gint arrow1_x, arrow1_y, arrow2_x, arrow2_y; gboolean horiz_tabs = FALSE; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; gboolean to_right = FALSE; /* Get the window that the cursor is over. */ - dest_win = gaim_gtk_conv_window_get_at_xy(e->x_root, e->y_root); + dest_win = pidgin_conv_window_get_at_xy(e->x_root, e->y_root); if (dest_win == NULL) { dnd_hints_hide_all(); @@ -7214,7 +7214,7 @@ arrow1_x = arrow2_x = nb_x; arrow1_y = arrow2_y = nb_y; - page_num = gaim_gtkconv_get_tab_at_xy(dest_win, + page_num = pidginconv_get_tab_at_xy(dest_win, e->x_root, e->y_root, &to_right); to_right = to_right && (win != dest_win); @@ -7224,7 +7224,7 @@ horiz_tabs = TRUE; } - gtkconv = gaim_gtk_conv_window_get_gtkconv_at_index(dest_win, page_num); + gtkconv = pidgin_conv_window_get_gtkconv_at_index(dest_win, page_num); tab = gtkconv->tabby; if (horiz_tabs) { @@ -7261,7 +7261,7 @@ } static gboolean -notebook_leave_cb(GtkWidget *widget, GdkEventCrossing *e, GaimGtkWindow *win) +notebook_leave_cb(GtkWidget *widget, GdkEventCrossing *e, PidginWindow *win) { if (win->in_drag) return FALSE; @@ -7282,7 +7282,7 @@ * THANK YOU GALEON! */ static gboolean -notebook_press_cb(GtkWidget *widget, GdkEventButton *e, GaimGtkWindow *win) +notebook_press_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win) { gint nb_x, nb_y, x_rel, y_rel; int tab_clicked; @@ -7290,13 +7290,13 @@ GtkWidget *tab; if (e->button == 2) { - GaimGtkConversation *gtkconv; - tab_clicked = gaim_gtkconv_get_tab_at_xy(win, e->x_root, e->y_root, NULL); + PidginConversation *gtkconv; + tab_clicked = pidginconv_get_tab_at_xy(win, e->x_root, e->y_root, NULL); if (tab_clicked == -1) return FALSE; - gtkconv = gaim_gtk_conv_window_get_gtkconv_at_index(win, tab_clicked); + gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, tab_clicked); close_conv_cb(NULL, gtkconv); return TRUE; } @@ -7316,7 +7316,7 @@ * Make sure a tab was actually clicked. The arrow buttons * mess things up. */ - tab_clicked = gaim_gtkconv_get_tab_at_xy(win, e->x_root, e->y_root, NULL); + tab_clicked = pidginconv_get_tab_at_xy(win, e->x_root, e->y_root, NULL); if (tab_clicked == -1) return FALSE; @@ -7370,11 +7370,11 @@ } static gboolean -notebook_release_cb(GtkWidget *widget, GdkEventButton *e, GaimGtkWindow *win) -{ - GaimGtkWindow *dest_win; +notebook_release_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win) +{ + PidginWindow *dest_win; GaimConversation *conv; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; gint dest_page_num = 0; gboolean new_window = FALSE; gboolean to_right = FALSE; @@ -7427,16 +7427,16 @@ dnd_hints_hide_all(); - dest_win = gaim_gtk_conv_window_get_at_xy(e->x_root, e->y_root); - - conv = gaim_gtk_conv_window_get_active_conversation(win); + dest_win = pidgin_conv_window_get_at_xy(e->x_root, e->y_root); + + conv = pidgin_conv_window_get_active_conversation(win); if (dest_win == NULL) { /* If the current window doesn't have any other conversations, * there isn't much point transferring the conv to a new window. */ - if (gaim_gtk_conv_window_get_gtkconv_count(win) > 1) { + if (pidgin_conv_window_get_gtkconv_count(win) > 1) { /* Make a new window to stick this to. */ - dest_win = gaim_gtk_conv_window_new(); + dest_win = pidgin_conv_window_new(); new_window = TRUE; } } @@ -7444,23 +7444,23 @@ if (dest_win == NULL) return FALSE; - gaim_signal_emit(gaim_gtk_conversations_get_handle(), + gaim_signal_emit(pidgin_conversations_get_handle(), "conversation-dragging", win, dest_win); /* Get the destination page number. */ if (!new_window) - dest_page_num = gaim_gtkconv_get_tab_at_xy(dest_win, + dest_page_num = pidginconv_get_tab_at_xy(dest_win, e->x_root, e->y_root, &to_right); - gtkconv = gaim_gtk_conv_window_get_gtkconv_at_index(win, win->drag_tab); + gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, win->drag_tab); if (win == dest_win) { gtk_notebook_reorder_child(GTK_NOTEBOOK(win->notebook), gtkconv->tab_cont, dest_page_num); } else { - gaim_gtk_conv_window_remove_gtkconv(win, gtkconv); - gaim_gtk_conv_window_add_gtkconv(dest_win, gtkconv); + pidgin_conv_window_remove_gtkconv(win, gtkconv); + pidgin_conv_window_add_gtkconv(dest_win, gtkconv); gtk_notebook_reorder_child(GTK_NOTEBOOK(dest_win->notebook), gtkconv->tab_cont, dest_page_num + to_right); - gaim_gtk_conv_window_switch_gtkconv(dest_win, gtkconv); + pidgin_conv_window_switch_gtkconv(dest_win, gtkconv); if (new_window) { gint win_width, win_height; @@ -7471,11 +7471,11 @@ e->x_root - (win_width / 2), e->y_root - (win_height / 2)); - gaim_gtk_conv_window_show(dest_win); + pidgin_conv_window_show(dest_win); } } - gtk_widget_grab_focus(GAIM_GTK_CONVERSATION(conv)->entry); + gtk_widget_grab_focus(PIDGIN_CONVERSATION(conv)->entry); return TRUE; } @@ -7485,24 +7485,24 @@ before_switch_conv_cb(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer user_data) { - GaimGtkWindow *win; + PidginWindow *win; GaimConversation *conv; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; win = user_data; - conv = gaim_gtk_conv_window_get_active_conversation(win); + conv = pidgin_conv_window_get_active_conversation(win); g_return_if_fail(conv != NULL); if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM) return; - gtkconv = GAIM_GTK_CONVERSATION(conv); + gtkconv = PIDGIN_CONVERSATION(conv); stop_anim(NULL, gtkconv); } static void -close_window(GtkWidget *w, GaimGtkWindow *win) +close_window(GtkWidget *w, PidginWindow *win) { close_win_cb(w, NULL, win); } @@ -7510,43 +7510,43 @@ static void detach_tab_cb(GtkWidget *w, GObject *menu) { - GaimGtkWindow *win, *new_window; - GaimGtkConversation *gtkconv; + PidginWindow *win, *new_window; + PidginConversation *gtkconv; gtkconv = g_object_get_data(menu, "clicked_tab"); if (!gtkconv) return; - win = gaim_gtkconv_get_window(gtkconv); + win = pidginconv_get_window(gtkconv); /* Nothing to do if there's only one tab in the window */ - if (gaim_gtk_conv_window_get_gtkconv_count(win) == 1) + if (pidgin_conv_window_get_gtkconv_count(win) == 1) return; - gaim_gtk_conv_window_remove_gtkconv(win, gtkconv); - - new_window = gaim_gtk_conv_window_new(); - gaim_gtk_conv_window_add_gtkconv(new_window, gtkconv); - gaim_gtk_conv_window_show(new_window); + pidgin_conv_window_remove_gtkconv(win, gtkconv); + + new_window = pidgin_conv_window_new(); + pidgin_conv_window_add_gtkconv(new_window, gtkconv); + pidgin_conv_window_show(new_window); } static void close_others_cb(GtkWidget *w, GObject *menu) { GList *iter; - GaimGtkConversation *gtkconv; - GaimGtkWindow *win; + PidginConversation *gtkconv; + PidginWindow *win; gtkconv = g_object_get_data(menu, "clicked_tab"); if (!gtkconv) return; - win = gaim_gtkconv_get_window(gtkconv); - - for (iter = gaim_gtk_conv_window_get_gtkconvs(win); iter; ) + win = pidginconv_get_window(gtkconv); + + for (iter = pidgin_conv_window_get_gtkconvs(win); iter; ) { - GaimGtkConversation *gconv = iter->data; + PidginConversation *gconv = iter->data; iter = iter->next; if (gconv != gtkconv) @@ -7558,7 +7558,7 @@ static void close_tab_cb(GtkWidget *w, GObject *menu) { - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; gtkconv = g_object_get_data(menu, "clicked_tab"); @@ -7567,16 +7567,16 @@ } static gboolean -right_click_menu_cb(GtkNotebook *notebook, GdkEventButton *event, GaimGtkWindow *win) +right_click_menu_cb(GtkNotebook *notebook, GdkEventButton *event, PidginWindow *win) { GtkWidget *item, *menu; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; if (event->type != GDK_BUTTON_PRESS || event->button != 3) return FALSE; - gtkconv = gaim_gtk_conv_window_get_gtkconv_at_index(win, - gaim_gtkconv_get_tab_at_xy(win, event->x_root, event->y_root, NULL)); + gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, + pidginconv_get_tab_at_xy(win, event->x_root, event->y_root, NULL)); if (g_object_get_data(G_OBJECT(notebook->menu), "clicked_tab")) { @@ -7622,19 +7622,19 @@ switch_conv_cb(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer user_data) { - GaimGtkWindow *win; + PidginWindow *win; GaimConversation *conv; - GaimGtkConversation *gtkconv; + PidginConversation *gtkconv; const char *sound_method; win = user_data; - gtkconv = gaim_gtk_conv_window_get_gtkconv_at_index(win, page_num); + gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, page_num); conv = gtkconv->active_conv; g_return_if_fail(conv != NULL); /* clear unseen flag if conversation is not hidden */ - if(!gaim_gtkconv_is_hidden(gtkconv)) { + if(!pidginconv_is_hidden(gtkconv)) { gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); } @@ -7646,7 +7646,7 @@ generate_send_to_items(win); regenerate_options_items(win); - gaim_gtkconv_switch_active_conversation(conv); + pidginconv_switch_active_conversation(conv); sound_method = gaim_prefs_get_string("/gaim/gtk/sound/method"); if (strcmp(sound_method, "none") != 0) @@ -7674,7 +7674,7 @@ (gtkconv->u.im->animate)) start_anim(NULL, gtkconv); - gaim_signal_emit(gaim_gtk_conversations_get_handle(), "conversation-switched", conv); + gaim_signal_emit(pidgin_conversations_get_handle(), "conversation-switched", conv); } /************************************************************************** @@ -7682,20 +7682,20 @@ **************************************************************************/ GList * -gaim_gtk_conv_windows_get_list() +pidgin_conv_windows_get_list() { return window_list; } -GaimGtkWindow * -gaim_gtk_conv_window_new() -{ - GaimGtkWindow *win; +PidginWindow * +pidgin_conv_window_new() +{ + PidginWindow *win; GtkPositionType pos; GtkWidget *testidea; GtkWidget *menubar; - win = g_malloc0(sizeof(GaimGtkWindow)); + win = g_malloc0(sizeof(PidginWindow)); window_list = g_list_append(window_list, win); @@ -7766,7 +7766,7 @@ } void -gaim_gtk_conv_window_destroy(GaimGtkWindow *win) +pidgin_conv_window_destroy(PidginWindow *win) { gaim_prefs_disconnect_by_handle(win); window_list = g_list_remove(window_list, win); @@ -7780,7 +7780,7 @@ if (win->gtkconvs) { while (win->gtkconvs) { GList *nextgtk = win->gtkconvs->next; - GaimGtkConversation *gtkconv = win->gtkconvs->data; + PidginConversation *gtkconv = win->gtkconvs->data; GList *nextcore = gtkconv->convs->next; GaimConversation *conv = gtkconv->convs->data; gaim_conversation_destroy(conv); @@ -7801,25 +7801,25 @@ } void -gaim_gtk_conv_window_show(GaimGtkWindow *win) +pidgin_conv_window_show(PidginWindow *win) { gtk_widget_show(win->window); } void -gaim_gtk_conv_window_hide(GaimGtkWindow *win) +pidgin_conv_window_hide(PidginWindow *win) { gtk_widget_hide(win->window); } void -gaim_gtk_conv_window_raise(GaimGtkWindow *win) +pidgin_conv_window_raise(PidginWindow *win) { gdk_window_raise(GDK_WINDOW(win->window->window)); } void -gaim_gtk_conv_window_switch_gtkconv(GaimGtkWindow *win, GaimGtkConversation *gtkconv) +pidgin_conv_window_switch_gtkconv(PidginWindow *win, PidginConversation *gtkconv) { gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), gtk_notebook_page_num(GTK_NOTEBOOK(win->notebook), @@ -7827,10 +7827,10 @@ } void -gaim_gtk_conv_window_add_gtkconv(GaimGtkWindow *win, GaimGtkConversation *gtkconv) +pidgin_conv_window_add_gtkconv(PidginWindow *win, PidginConversation *gtkconv) { GaimConversation *conv = gtkconv->active_conv; - GaimGtkConversation *focus_gtkconv; + PidginConversation *focus_gtkconv; GtkWidget *tabby, *menu_tabby; GtkWidget *tab_cont = gtkconv->tab_cont; GtkWidget *close_image; @@ -7947,7 +7947,7 @@ gtk_widget_show(menu_tabby); if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) - gaim_gtkconv_update_buddy_icon(conv); + pidginconv_update_buddy_icon(conv); /* Add this pane to the conversation's notebook. */ gtk_notebook_append_page_menu(GTK_NOTEBOOK(win->notebook), tab_cont, tabby, menu_tabby); @@ -7956,7 +7956,7 @@ gtk_widget_show(tab_cont); - if (gaim_gtk_conv_window_get_gtkconv_count(win) == 1) { + if (pidgin_conv_window_get_gtkconv_count(win) == 1) { /* Er, bug in notebooks? Switch to the page manually. */ gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0); @@ -7965,16 +7965,16 @@ } else gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), TRUE); - focus_gtkconv = g_list_nth_data(gaim_gtk_conv_window_get_gtkconvs(win), + focus_gtkconv = g_list_nth_data(pidgin_conv_window_get_gtkconvs(win), gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook))); gtk_widget_grab_focus(focus_gtkconv->entry); - if (gaim_gtk_conv_window_get_gtkconv_count(win) == 1) + if (pidgin_conv_window_get_gtkconv_count(win) == 1) update_send_to_selection(win); } void -gaim_gtk_conv_window_remove_gtkconv(GaimGtkWindow *win, GaimGtkConversation *gtkconv) +pidgin_conv_window_remove_gtkconv(PidginWindow *win, PidginConversation *gtkconv) { unsigned int index; GaimConversationType conv_type; @@ -7988,7 +7988,7 @@ gtk_notebook_remove_page(GTK_NOTEBOOK(win->notebook), index); /* go back to tabless if need be */ - if (gaim_gtk_conv_window_get_gtkconv_count(win) <= 2) { + if (pidgin_conv_window_get_gtkconv_count(win) <= 2) { gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook), gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")); } @@ -7996,22 +7996,22 @@ win->gtkconvs = g_list_remove(win->gtkconvs, gtkconv); if (!win->gtkconvs && win != hidden_convwin) - gaim_gtk_conv_window_destroy(win); -} - -GaimGtkConversation * -gaim_gtk_conv_window_get_gtkconv_at_index(const GaimGtkWindow *win, int index) + pidgin_conv_window_destroy(win); +} + +PidginConversation * +pidgin_conv_window_get_gtkconv_at_index(const PidginWindow *win, int index) { GtkWidget *tab_cont; if (index == -1) index = 0; tab_cont = gtk_notebook_get_nth_page(GTK_NOTEBOOK(win->notebook), index); - return tab_cont ? g_object_get_data(G_OBJECT(tab_cont), "GaimGtkConversation") : NULL; -} - -GaimGtkConversation * -gaim_gtk_conv_window_get_active_gtkconv(const GaimGtkWindow *win) + return tab_cont ? g_object_get_data(G_OBJECT(tab_cont), "PidginConversation") : NULL; +} + +PidginConversation * +pidgin_conv_window_get_active_gtkconv(const PidginWindow *win) { int index; GtkWidget *tab_cont; @@ -8022,27 +8022,27 @@ tab_cont = gtk_notebook_get_nth_page(GTK_NOTEBOOK(win->notebook), index); if (!tab_cont) return NULL; - return g_object_get_data(G_OBJECT(tab_cont), "GaimGtkConversation"); + return g_object_get_data(G_OBJECT(tab_cont), "PidginConversation"); } GaimConversation * -gaim_gtk_conv_window_get_active_conversation(const GaimGtkWindow *win) -{ - GaimGtkConversation *gtkconv; - - gtkconv = gaim_gtk_conv_window_get_active_gtkconv(win); +pidgin_conv_window_get_active_conversation(const PidginWindow *win) +{ + PidginConversation *gtkconv; + + gtkconv = pidgin_conv_window_get_active_gtkconv(win); return gtkconv ? gtkconv->active_conv : NULL; } gboolean -gaim_gtk_conv_window_is_active_conversation(const GaimConversation *conv) -{ - return conv == gaim_gtk_conv_window_get_active_conversation(GAIM_GTK_CONVERSATION(conv)->win); +pidgin_conv_window_is_active_conversation(const GaimConversation *conv) +{ + return conv == pidgin_conv_window_get_active_conversation(PIDGIN_CONVERSATION(conv)->win); } gboolean -gaim_gtk_conv_window_has_focus(GaimGtkWindow *win) +pidgin_conv_window_has_focus(PidginWindow *win) { gboolean has_focus = FALSE; @@ -8051,10 +8051,10 @@ return has_focus; } -GaimGtkWindow * -gaim_gtk_conv_window_get_at_xy(int x, int y) -{ - GaimGtkWindow *win; +PidginWindow * +pidgin_conv_window_get_at_xy(int x, int y) +{ + PidginWindow *win; GdkWindow *gdkwin; GList *l; @@ -8063,7 +8063,7 @@ if (gdkwin) gdkwin = gdk_window_get_toplevel(gdkwin); - for (l = gaim_gtk_conv_windows_get_list(); l != NULL; l = l->next) { + for (l = pidgin_conv_windows_get_list(); l != NULL; l = l->next) { win = l->data; if (gdkwin == win->window->window) @@ -8074,28 +8074,28 @@ } GList * -gaim_gtk_conv_window_get_gtkconvs(GaimGtkWindow *win) +pidgin_conv_window_get_gtkconvs(PidginWindow *win) { return win->gtkconvs; } guint -gaim_gtk_conv_window_get_gtkconv_count(GaimGtkWindow *win) +pidgin_conv_window_get_gtkconv_count(PidginWindow *win) { return g_list_length(win->gtkconvs); } -GaimGtkWindow * -gaim_gtk_conv_window_first_with_type(GaimConversationType type) +PidginWindow * +pidgin_conv_window_first_with_type(GaimConversationType type) { GList *wins, *convs; - GaimGtkWindow *win; - GaimGtkConversation *conv; + PidginWindow *win; + PidginConversation *conv; if (type == GAIM_CONV_TYPE_UNKNOWN) return NULL; - for (wins = gaim_gtk_conv_windows_get_list(); wins != NULL; wins = wins->next) { + for (wins = pidgin_conv_windows_get_list(); wins != NULL; wins = wins->next) { win = wins->data; for (convs = win->gtkconvs; @@ -8112,17 +8112,17 @@ return NULL; } -GaimGtkWindow * -gaim_gtk_conv_window_last_with_type(GaimConversationType type) +PidginWindow * +pidgin_conv_window_last_with_type(GaimConversationType type) { GList *wins, *convs; - GaimGtkWindow *win; - GaimGtkConversation *conv; + PidginWindow *win; + PidginConversation *conv; if (type == GAIM_CONV_TYPE_UNKNOWN) return NULL; - for (wins = g_list_last(gaim_gtk_conv_windows_get_list()); + for (wins = g_list_last(pidgin_conv_windows_get_list()); wins != NULL; wins = wins->prev) { @@ -8159,55 +8159,55 @@ /* This one places conversations in the last made window. */ static void -conv_placement_last_created_win(GaimGtkConversation *conv) -{ - GaimGtkWindow *win; - - GList *l = g_list_last(gaim_gtk_conv_windows_get_list()); +conv_placement_last_created_win(PidginConversation *conv) +{ + PidginWindow *win; + + GList *l = g_list_last(pidgin_conv_windows_get_list()); win = l ? l->data : NULL;; if (win == NULL) { - win = gaim_gtk_conv_window_new(); - - gaim_gtk_conv_window_add_gtkconv(win, conv); - gaim_gtk_conv_window_show(win); + win = pidgin_conv_window_new(); + + pidgin_conv_window_add_gtkconv(win, conv); + pidgin_conv_window_show(win); } else { - gaim_gtk_conv_window_add_gtkconv(win, conv); + pidgin_conv_window_add_gtkconv(win, conv); } } /* This one places conversations in the last made window of the same type. */ static void -conv_placement_last_created_win_type(GaimGtkConversation *conv) -{ - GaimGtkWindow *win; - - win = gaim_gtk_conv_window_last_with_type(gaim_conversation_get_type(conv->active_conv)); +conv_placement_last_created_win_type(PidginConversation *conv) +{ + PidginWindow *win; + + win = pidgin_conv_window_last_with_type(gaim_conversation_get_type(conv->active_conv)); if (win == NULL) { - win = gaim_gtk_conv_window_new(); - - gaim_gtk_conv_window_add_gtkconv(win, conv); - gaim_gtk_conv_window_show(win); + win = pidgin_conv_window_new(); + + pidgin_conv_window_add_gtkconv(win, conv); + pidgin_conv_window_show(win); } else - gaim_gtk_conv_window_add_gtkconv(win, conv); + pidgin_conv_window_add_gtkconv(win, conv); } /* This one places each conversation in its own window. */ static void -conv_placement_new_window(GaimGtkConversation *conv) -{ - GaimGtkWindow *win; - - win = gaim_gtk_conv_window_new(); - - gaim_gtk_conv_window_add_gtkconv(win, conv); - - gaim_gtk_conv_window_show(win); +conv_placement_new_window(PidginConversation *conv) +{ + PidginWindow *win; + + win = pidgin_conv_window_new(); + + pidgin_conv_window_add_gtkconv(win, conv); + + pidgin_conv_window_show(win); } static GaimGroup * -conv_get_group(GaimGtkConversation *conv) +conv_get_group(PidginConversation *conv) { GaimGroup *group = NULL; @@ -8239,7 +8239,7 @@ * open windows will get a new window. */ static void -conv_placement_by_group(GaimGtkConversation *conv) +conv_placement_by_group(PidginConversation *conv) { GaimConversationType type; GaimGroup *group = NULL; @@ -8250,9 +8250,9 @@ group = conv_get_group(conv); /* Go through the list of IMs and find one with this group. */ - for (wl = gaim_gtk_conv_windows_get_list(); wl != NULL; wl = wl->next) { - GaimGtkWindow *win2; - GaimGtkConversation *conv2; + for (wl = pidgin_conv_windows_get_list(); wl != NULL; wl = wl->next) { + PidginWindow *win2; + PidginConversation *conv2; GaimGroup *group2 = NULL; win2 = wl->data; @@ -8265,7 +8265,7 @@ group2 = conv_get_group(conv2); if (group == group2) { - gaim_gtk_conv_window_add_gtkconv(win2, conv); + pidgin_conv_window_add_gtkconv(win2, conv); return; } @@ -8278,7 +8278,7 @@ /* This groups things by account. Otherwise, the same semantics as above */ static void -conv_placement_by_account(GaimGtkConversation *conv) +conv_placement_by_account(PidginConversation *conv) { GaimConversationType type; GList *wins, *convs; @@ -8288,9 +8288,9 @@ type = gaim_conversation_get_type(conv->active_conv); /* Go through the list of IMs and find one with this group. */ - for (wins = gaim_gtk_conv_windows_get_list(); wins != NULL; wins = wins->next) { - GaimGtkWindow *win2; - GaimGtkConversation *conv2; + for (wins = pidgin_conv_windows_get_list(); wins != NULL; wins = wins->next) { + PidginWindow *win2; + PidginConversation *conv2; win2 = wins->data; @@ -8300,7 +8300,7 @@ conv2 = convs->data; if (account == gaim_conversation_get_account(conv2->active_conv)) { - gaim_gtk_conv_window_add_gtkconv(win2, conv); + pidgin_conv_window_add_gtkconv(win2, conv); return; } } @@ -8358,7 +8358,7 @@ } GList * -gaim_gtkconv_placement_get_options(void) +pidginconv_placement_get_options(void) { GList *n, *list = NULL; ConvPlacementData *data; @@ -8376,7 +8376,7 @@ void -gaim_gtkconv_placement_add_fnc(const char *id, const char *name, +pidginconv_placement_add_fnc(const char *id, const char *name, GaimConvPlacementFunc fnc) { g_return_if_fail(id != NULL); @@ -8389,7 +8389,7 @@ } void -gaim_gtkconv_placement_remove_fnc(const char *id) +pidginconv_placement_remove_fnc(const char *id) { ConvPlacementData *data = get_conv_placement_data(id); @@ -8404,7 +8404,7 @@ } const char * -gaim_gtkconv_placement_get_name(const char *id) +pidginconv_placement_get_name(const char *id) { ConvPlacementData *data; @@ -8419,7 +8419,7 @@ } GaimConvPlacementFunc -gaim_gtkconv_placement_get_fnc(const char *id) +pidginconv_placement_get_fnc(const char *id) { ConvPlacementData *data; @@ -8434,7 +8434,7 @@ } void -gaim_gtkconv_placement_set_current_func(GaimConvPlacementFunc func) +pidginconv_placement_set_current_func(GaimConvPlacementFunc func) { g_return_if_fail(func != NULL); @@ -8446,13 +8446,13 @@ } GaimConvPlacementFunc -gaim_gtkconv_placement_get_current_func(void) +pidginconv_placement_get_current_func(void) { return place_conv; } void -gaim_gtkconv_placement_place(GaimGtkConversation *gtkconv) +pidginconv_placement_place(PidginConversation *gtkconv) { if (place_conv) place_conv(gtkconv); @@ -8461,7 +8461,7 @@ } gboolean -gaim_gtkconv_is_hidden(GaimGtkConversation *gtkconv) +pidginconv_is_hidden(PidginConversation *gtkconv) { g_return_val_if_fail(gtkconv != NULL, FALSE);