817 |
|
|
818 |
gui_redraw_buffer (window->buffer); |
gui_redraw_buffer (window->buffer); |
819 |
} |
} |
820 |
|
|
821 |
|
/* |
822 |
|
* gui_window_print_log: print window infos in log (usually for crash dump) |
823 |
|
*/ |
824 |
|
|
825 |
|
void |
826 |
|
gui_window_print_log (t_gui_window *window) |
827 |
|
{ |
828 |
|
wee_log_printf ("[window (addr:0x%X)]\n", window); |
829 |
|
wee_log_printf (" win_x . . . . . . . : %d\n", window->win_x); |
830 |
|
wee_log_printf (" win_y . . . . . . . : %d\n", window->win_y); |
831 |
|
wee_log_printf (" win_width . . . . . : %d\n", window->win_width); |
832 |
|
wee_log_printf (" win_height. . . . . : %d\n", window->win_height); |
833 |
|
wee_log_printf (" win_chat_x. . . . . : %d\n", window->win_chat_x); |
834 |
|
wee_log_printf (" win_chat_y. . . . . : %d\n", window->win_chat_y); |
835 |
|
wee_log_printf (" win_chat_width. . . : %d\n", window->win_chat_width); |
836 |
|
wee_log_printf (" win_chat_height . . : %d\n", window->win_chat_height); |
837 |
|
wee_log_printf (" win_chat_cursor_x . : %d\n", window->win_chat_cursor_x); |
838 |
|
wee_log_printf (" win_chat_cursor_y . : %d\n", window->win_chat_cursor_y); |
839 |
|
wee_log_printf (" win_nick_x. . . . . : %d\n", window->win_nick_x); |
840 |
|
wee_log_printf (" win_nick_y. . . . . : %d\n", window->win_nick_y); |
841 |
|
wee_log_printf (" win_nick_width. . . : %d\n", window->win_nick_width); |
842 |
|
wee_log_printf (" win_nick_height . . : %d\n", window->win_nick_height); |
843 |
|
wee_log_printf (" win_title . . . . . : 0x%X\n", window->win_title); |
844 |
|
wee_log_printf (" win_chat. . . . . . : 0x%X\n", window->win_chat); |
845 |
|
wee_log_printf (" win_nick. . . . . . : 0x%X\n", window->win_nick); |
846 |
|
wee_log_printf (" win_status. . . . . : 0x%X\n", window->win_status); |
847 |
|
wee_log_printf (" win_infobar . . . . : 0x%X\n", window->win_infobar); |
848 |
|
wee_log_printf (" win_input . . . . . : 0x%X\n", window->win_input); |
849 |
|
wee_log_printf (" win_separator . . . : 0x%X\n", window->win_separator); |
850 |
|
wee_log_printf (" textview_chat . . . : 0x%X\n", window->textview_chat); |
851 |
|
wee_log_printf (" textbuffer_chat . . : 0x%X\n", window->textbuffer_chat); |
852 |
|
wee_log_printf (" texttag_chat. . . . : 0x%X\n", window->texttag_chat); |
853 |
|
wee_log_printf (" textview_nicklist . : 0x%X\n", window->textview_nicklist); |
854 |
|
wee_log_printf (" textbuffer_nicklist : 0x%X\n", window->textbuffer_nicklist); |
855 |
|
wee_log_printf (" dcc_first . . . . . : 0x%X\n", window->dcc_first); |
856 |
|
wee_log_printf (" dcc_selected. . . . : 0x%X\n", window->dcc_selected); |
857 |
|
wee_log_printf (" dcc_last_displayed. : 0x%X\n", window->dcc_last_displayed); |
858 |
|
wee_log_printf (" buffer. . . . . . . : 0x%X\n", window->buffer); |
859 |
|
wee_log_printf (" first_line_displayed: %d\n", window->first_line_displayed); |
860 |
|
wee_log_printf (" sub_lines . . . . . : %d\n", window->sub_lines); |
861 |
|
wee_log_printf (" prev_window . . . . : 0x%X\n", window->prev_window); |
862 |
|
wee_log_printf (" next_window . . . . : 0x%X\n", window->next_window); |
863 |
|
|
864 |
|
} |
865 |
|
|
866 |
|
/* |
867 |
|
* gui_buffer_print_log: print buffer infos in log (usually for crash dump) |
868 |
|
*/ |
869 |
|
|
870 |
|
void |
871 |
|
gui_buffer_print_log (t_gui_buffer *buffer) |
872 |
|
{ |
873 |
|
t_gui_line *ptr_line; |
874 |
|
t_gui_message *ptr_message; |
875 |
|
int num; |
876 |
|
char buf[4096]; |
877 |
|
|
878 |
|
wee_log_printf ("[buffer (addr:0x%X)]\n", buffer); |
879 |
|
wee_log_printf (" num_displayed. . . . : %d\n", buffer->num_displayed); |
880 |
|
wee_log_printf (" number . . . . . . . : %d\n", buffer->number); |
881 |
|
wee_log_printf (" server . . . . . . . : 0x%X\n", buffer->server); |
882 |
|
wee_log_printf (" channel. . . . . . . : 0x%X\n", buffer->channel); |
883 |
|
wee_log_printf (" dcc. . . . . . . . . : %d\n", buffer->dcc); |
884 |
|
wee_log_printf (" lines. . . . . . . . : 0x%X\n", buffer->lines); |
885 |
|
wee_log_printf (" last_line. . . . . . : 0x%X\n", buffer->last_line); |
886 |
|
wee_log_printf (" num_lines. . . . . . : %d\n", buffer->num_lines); |
887 |
|
wee_log_printf (" line_complete. . . . : %d\n", buffer->line_complete); |
888 |
|
wee_log_printf (" notify_level . . . . : %d\n", buffer->notify_level); |
889 |
|
wee_log_printf (" log_filename . . . . : '%s'\n", buffer->log_filename); |
890 |
|
wee_log_printf (" log_file . . . . . . : 0x%X\n", buffer->log_file); |
891 |
|
wee_log_printf (" input_buffer . . . . : '%s'\n", buffer->input_buffer); |
892 |
|
wee_log_printf (" input_buffer_alloc . : %d\n", buffer->input_buffer_alloc); |
893 |
|
wee_log_printf (" input_buffer_size. . : %d\n", buffer->input_buffer_size); |
894 |
|
wee_log_printf (" input_buffer_pos . . : %d\n", buffer->input_buffer_pos); |
895 |
|
wee_log_printf (" input_buffer_1st_disp: %d\n", buffer->input_buffer_1st_display); |
896 |
|
wee_log_printf (" history. . . . . . . : 0x%X\n", buffer->history); |
897 |
|
wee_log_printf (" last_history . . . . : 0x%X\n", buffer->last_history); |
898 |
|
wee_log_printf (" ptr_history. . . . . : 0x%X\n", buffer->ptr_history); |
899 |
|
wee_log_printf (" prev_buffer. . . . . : 0x%X\n", buffer->prev_buffer); |
900 |
|
wee_log_printf (" next_buffer. . . . . : 0x%X\n", buffer->next_buffer); |
901 |
|
wee_log_printf ("\n"); |
902 |
|
wee_log_printf (" => last 100 lines:\n"); |
903 |
|
|
904 |
|
num = 0; |
905 |
|
ptr_line = buffer->last_line; |
906 |
|
while (ptr_line && (num < 100)) |
907 |
|
{ |
908 |
|
num++; |
909 |
|
ptr_line = ptr_line->prev_line; |
910 |
|
} |
911 |
|
if (!ptr_line) |
912 |
|
ptr_line = buffer->lines; |
913 |
|
else |
914 |
|
ptr_line = ptr_line->next_line; |
915 |
|
|
916 |
|
while (ptr_line) |
917 |
|
{ |
918 |
|
buf[0] = '\0'; |
919 |
|
for (ptr_message = ptr_line->messages; ptr_message; |
920 |
|
ptr_message = ptr_message->next_message) |
921 |
|
{ |
922 |
|
if (strlen (buf) + strlen (ptr_message->message) + 1 >= sizeof (buf)) |
923 |
|
break; |
924 |
|
strcat (buf, ptr_message->message); |
925 |
|
} |
926 |
|
num--; |
927 |
|
wee_log_printf (" line N-%05d: %s\n", num, buf); |
928 |
|
|
929 |
|
ptr_line = ptr_line->next_line; |
930 |
|
} |
931 |
|
} |