[gaim-migrate @ 11131]
"This patch that makes received-im-msg and
received-chat-msg signals correspond with each other.
My motivation was to add flags to received-chat-msg,
but I also added conv to received-im-msg to make the
signals match each other."
-- Nathan Fredrickson (noif)
I also updated the receiving-im-msg and receiving-chat-msg signals to match.
Now I can finally reject patch 909745 with "this should be a plugin", which
I've wanted to be able to say for a while. Yay :)
committer: Tailor Script <tailor@pidgin.im>
line source
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /**
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * @file gtkdebug.c GTK+ Debug API
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * @ingroup gtkui
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * gaim
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Gaim is the legal property of its developers, whose names are too numerous
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * to list here. Please refer to the COPYRIGHT file distributed with this
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * source distribution.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This program is free software; you can redistribute it and/or modify
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * it under the terms of the GNU General Public License as published by
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * the Free Software Foundation; either version 2 of the License, or
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * (at your option) any later version.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This program is distributed in the hope that it will be useful,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * GNU General Public License for more details.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * You should have received a copy of the GNU General Public License
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * along with this program; if not, write to the Free Software
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "internal.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkgaim.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "notify.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "prefs.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "request.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "util.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkdebug.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkdialogs.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkimhtml.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "gtkutils.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #include "stock.h"
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 extern int opt_debug;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 typedef struct
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *window;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *text;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *find;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean timestamps;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean paused;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 } DebugWindow;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static char debug_fg_colors[][8] = {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "#000000", /**< All debug levels. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "#666666", /**< Misc. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "#000000", /**< Information. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "#660000", /**< Warnings. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "#FF0000", /**< Errors. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "#FF0000", /**< Fatal errors. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static DebugWindow *debug_win = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 struct _find {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 DebugWindow *window;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *entry;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gint
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_window_destroy(GtkWidget *w, GdkEvent *event, void *unused)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_disconnect_by_handle(gaim_gtk_debug_get_handle());
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* If the "Save Log" dialog is open then close it */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_request_close_with_handle(debug_win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(debug_win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_win = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_set_bool("/gaim/gtk/debug/enabled", FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static gboolean
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 configure_cb(GtkWidget *w, GdkEventConfigure *event, DebugWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (GTK_WIDGET_VISIBLE(w)) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_set_int("/gaim/gtk/debug/width", event->width);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_set_int("/gaim/gtk/debug/height", event->height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return FALSE;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 do_find_cb(GtkWidget *widget, gint response, struct _find *f)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 switch (response) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GTK_RESPONSE_OK:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_search_find(GTK_IMHTML(f->window->text),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_get_text(GTK_ENTRY(f->entry)));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GTK_RESPONSE_DELETE_EVENT:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 case GTK_RESPONSE_CLOSE:
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_search_clear(GTK_IMHTML(f->window->text));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(f->window->find);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f->window->find = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(f);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 break;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 find_cb(GtkWidget *w, DebugWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *hbox, *img, *label;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 struct _find *f;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if(win->find)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_present(GTK_WINDOW(win->find));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f = g_malloc(sizeof(struct _find));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f->window = win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->find = gtk_dialog_new_with_buttons(_("Find"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_WINDOW(win->window), GTK_DIALOG_DESTROY_WITH_PARENT,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_STOCK_FIND, GTK_RESPONSE_OK, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_default_response(GTK_DIALOG(win->find),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_RESPONSE_OK);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->find), "response",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(do_find_cb), f);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(GTK_CONTAINER(win->find), 6);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_resizable(GTK_WINDOW(win->find), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_has_separator(GTK_DIALOG(win->find), FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(win->find)->vbox), 12);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_set_border_width(
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_CONTAINER(GTK_DIALOG(win->find)->vbox), 6);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hbox = gtk_hbox_new(FALSE, 12);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(win->find)->vbox),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 hbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_ICON_SIZE_DIALOG);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_dialog_set_response_sensitive(GTK_DIALOG(win->find),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_RESPONSE_OK, FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 label = gtk_label_new(NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Search for:"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 f->entry = gtk_entry_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_entry_set_activates_default(GTK_ENTRY(f->entry), TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(f->entry));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(f->entry), "changed",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(gaim_gtk_set_sensitive_if_input),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->find);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(hbox), f->entry, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(win->find);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_grab_focus(f->entry);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 save_writefile_cb(void *user_data, const char *filename)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 DebugWindow *win = (DebugWindow *)user_data;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 FILE *fp;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *tmp;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((fp = fopen(filename, "w+")) == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_notify_error(win, NULL, _("Unable to open file."), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 tmp = gtk_imhtml_get_text(GTK_IMHTML(win->text), NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fprintf(fp, "Gaim Debug log : %s\n", gaim_date_full());
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fprintf(fp, "%s", tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(tmp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 fclose(fp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 save_cb(GtkWidget *w, DebugWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_request_file(win, _("Save Debug Log"), "gaim-debug.log", TRUE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(save_writefile_cb), NULL, win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 clear_cb(GtkWidget *w, DebugWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_clear(GTK_IMHTML(win->text));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 pause_cb(GtkWidget *w, DebugWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->paused = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 timestamps_cb(GtkWidget *w, DebugWindow *win)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->timestamps = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_set_bool("/gaim/gtk/debug/timestamps", win->timestamps);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 timestamps_pref_cb(const char *name, GaimPrefType type, gpointer value,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data), GPOINTER_TO_INT(value));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static DebugWindow *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_window_new(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 DebugWindow *win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *vbox;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *toolbar;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *sw;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *button;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GtkWidget *image;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 int width, height;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win = g_new0(DebugWindow, 1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 width = gaim_prefs_get_int("/gaim/gtk/debug/width");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 height = gaim_prefs_get_int("/gaim/gtk/debug/height");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GAIM_DIALOG(win->window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_debug(GAIM_DEBUG_INFO, "gtkdebug", "Setting dimensions to %d, %d\n",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 width, height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_default_size(GTK_WINDOW(win->window), width, height);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_role(GTK_WINDOW(win->window), "debug");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_window_set_title(GTK_WINDOW(win->window), _("Debug Window"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->window), "delete_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(debug_window_destroy), NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_signal_connect(G_OBJECT(win->window), "configure_event",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 G_CALLBACK(configure_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup the vbox */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 vbox = gtk_vbox_new(FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(win->window), vbox);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gaim_prefs_get_bool("/gaim/gtk/debug/toolbar")) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Setup our top button bar thingie. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 toolbar = gtk_toolbar_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toolbar_set_icon_size(GTK_TOOLBAR(toolbar),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_ICON_SIZE_SMALL_TOOLBAR);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Find button */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_FIND,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, NULL, G_CALLBACK(find_cb), win, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Save */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_SAVE,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, NULL, G_CALLBACK(save_cb), win, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Clear button */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_CLEAR,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, NULL, G_CALLBACK(clear_cb), win, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Pause */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 image = gtk_image_new_from_stock(GAIM_STOCK_PAUSE, GTK_ICON_SIZE_MENU);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, _("Pause"), NULL, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 image, G_CALLBACK(pause_cb), win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Timestamps */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, _("Timestamps"), NULL, NULL,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 NULL, G_CALLBACK(timestamps_cb),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_get_bool("/gaim/gtk/debug/timestamps"));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_connect_callback(gaim_gtk_debug_get_handle(), "/gaim/gtk/debug/timestamps",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 timestamps_pref_cb, button);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Now our scrolled window... */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 sw = gtk_scrolled_window_new(NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GTK_SHADOW_IN);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* ... which has a gtkimhtml in it. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 win->text = gtk_imhtml_new(NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_container_add(GTK_CONTAINER(sw), win->text);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Pack it in... Not like that, sicko. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show_all(win->window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return win;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_enabled_cb(const char *name, GaimPrefType type, gpointer value,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gpointer data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (value)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_gtk_debug_window_show();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_gtk_debug_window_hide();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_glib_log_handler(const gchar *domain, GLogLevelFlags flags,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const gchar *msg, gpointer user_data)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GaimDebugLevel level;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *new_msg = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 char *new_domain = NULL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if ((flags & G_LOG_LEVEL_ERROR) == G_LOG_LEVEL_ERROR)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 level = GAIM_DEBUG_ERROR;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if ((flags & G_LOG_LEVEL_CRITICAL) == G_LOG_LEVEL_CRITICAL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 level = GAIM_DEBUG_FATAL;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if ((flags & G_LOG_LEVEL_WARNING) == G_LOG_LEVEL_WARNING)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 level = GAIM_DEBUG_WARNING;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if ((flags & G_LOG_LEVEL_MESSAGE) == G_LOG_LEVEL_MESSAGE)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 level = GAIM_DEBUG_INFO;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if ((flags & G_LOG_LEVEL_INFO) == G_LOG_LEVEL_INFO)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 level = GAIM_DEBUG_INFO;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else if ((flags & G_LOG_LEVEL_DEBUG) == G_LOG_LEVEL_DEBUG)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 level = GAIM_DEBUG_MISC;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_debug_warning("gtkdebug",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "Unknown glib logging level in %d\n", flags);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 level = GAIM_DEBUG_MISC; /* This will never happen. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (msg != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 new_msg = gaim_utf8_try_convert(msg);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (domain != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 new_domain = gaim_utf8_try_convert(domain);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (new_msg != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_debug(level, (new_domain != NULL ? new_domain : "g_log"),
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 "%s\n", new_msg);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(new_msg);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (new_domain != NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(new_domain);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef _WIN32
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_glib_dummy_print_handler(const gchar *string)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_gtk_debug_init(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Debug window preferences. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * NOTE: This must be set before prefs are loaded, and the callbacks
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * set after they are loaded, since prefs sets the enabled
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * preference here and that loads the window, which calls the
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * configure event, which overrides the width and height! :P
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_add_none("/gaim/gtk/debug");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_add_bool("/gaim/gtk/debug/enabled", FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_add_bool("/gaim/gtk/debug/timestamps", FALSE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_add_bool("/gaim/gtk/debug/toolbar", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_add_int("/gaim/gtk/debug/width", 450);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_add_int("/gaim/gtk/debug/height", 250);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_connect_callback(NULL, "/gaim/gtk/debug/enabled",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_enabled_cb, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #define REGISTER_G_LOG_HANDLER(name) \
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_log_set_handler((name), G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL \
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 | G_LOG_FLAG_RECURSION, \
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_glib_log_handler, NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /* Register the glib/gtk log handlers. */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 REGISTER_G_LOG_HANDLER(NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 REGISTER_G_LOG_HANDLER("Gdk");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 REGISTER_G_LOG_HANDLER("Gtk");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 REGISTER_G_LOG_HANDLER("GdkPixbuf");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 REGISTER_G_LOG_HANDLER("GLib");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 REGISTER_G_LOG_HANDLER("GModule");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 REGISTER_G_LOG_HANDLER("GLib-GObject");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 REGISTER_G_LOG_HANDLER("GThread");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #ifdef _WIN32
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (!opt_debug)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_set_print_handler(gaim_glib_dummy_print_handler);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 #endif
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_gtk_debug_window_show(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (debug_win == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_win = debug_window_new();
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_show(debug_win->window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_prefs_set_bool("/gaim/gtk/debug/enabled", TRUE);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_gtk_debug_window_hide(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (debug_win != NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_widget_destroy(debug_win->window);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_window_destroy(NULL, NULL, NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static void
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_gtk_debug_print(GaimDebugLevel level, const char *category,
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 const char *format, va_list args)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *arg_s, *ts_s;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gboolean timestamps;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 timestamps = gaim_prefs_get_bool("/gaim/gtk/debug/timestamps");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 arg_s = g_strdup_vprintf(format, args);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (category == NULL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ts_s = g_strdup("");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 /*
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * If the category is not NULL, then do timestamps.
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 * This IS right. :)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 */
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (timestamps) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar mdate[64];
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 time_t mtime = time(NULL);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime));
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ts_s = g_strdup_printf("(%s) ", mdate);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 ts_s = g_strdup("");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (gaim_prefs_get_bool("/gaim/gtk/debug/enabled") &&
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_win != NULL && !debug_win->paused) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *esc_s, *cat_s, *utf8_s, *s;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (category == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cat_s = g_strdup("");
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 cat_s = g_strdup_printf("<b>%s:</b> ", category);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 esc_s = g_markup_escape_text(arg_s, -1);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 s = g_strdup_printf("<font color=\"%s\">%s%s%s</font>",
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 debug_fg_colors[level], ts_s, cat_s, esc_s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(esc_s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 utf8_s = gaim_utf8_try_convert(s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 s = utf8_s;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (level == GAIM_DEBUG_FATAL) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gchar *temp = s;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 s = g_strdup_printf("<b>%s</b>", temp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(temp);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(cat_s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gtk_imhtml_append_text(GTK_IMHTML(debug_win->text), s, 0);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (opt_debug) {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 if (category == NULL)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_print("%s%s", ts_s, arg_s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 else
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_print("%s%s: %s", ts_s, category, arg_s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(ts_s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 g_free(arg_s);
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static GaimDebugUiOps ops =
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_gtk_debug_print
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 };
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 GaimDebugUiOps *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_gtk_debug_get_ui_ops(void)
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return &ops;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 void *
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 gaim_gtk_debug_get_handle() {
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 static int handle;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 return &handle;
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申 }
+ 鐃緒申��申鐃初姐�渇����鐃醇�鐃緒申��申鐃緒申