Mercurial > pidgin.yaz
comparison src/gtkimhtml.c @ 8427:2e18099ded93
[gaim-migrate @ 9157]
I'm going to start committing stuff rapidly. I've turned off rich-text cut
and paste, as I have about an hour to finish everything I want finished and
don't think I can fit that in. This adds the protocol-specific smileys to
the toolbar, and I think that's about it.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 11 Mar 2004 20:02:00 +0000 |
parents | c25c697525b7 |
children | 018406bb4ab6 |
comparison
equal
deleted
inserted
replaced
8426:aa755705bcf5 | 8427:2e18099ded93 |
---|---|
86 | 86 |
87 enum { | 87 enum { |
88 URL_CLICKED, | 88 URL_CLICKED, |
89 BUTTONS_UPDATE, | 89 BUTTONS_UPDATE, |
90 TOGGLE_FORMAT, | 90 TOGGLE_FORMAT, |
91 CLEAR_FORMAT, | |
91 LAST_SIGNAL | 92 LAST_SIGNAL |
92 }; | 93 }; |
93 static guint signals [LAST_SIGNAL] = { 0 }; | 94 static guint signals [LAST_SIGNAL] = { 0 }; |
94 | 95 |
95 GtkTargetEntry selection_targets[] = { | 96 GtkTargetEntry selection_targets[] = { |
629 G_SIGNAL_RUN_FIRST, | 630 G_SIGNAL_RUN_FIRST, |
630 G_STRUCT_OFFSET(GtkIMHtmlClass, toggle_format), | 631 G_STRUCT_OFFSET(GtkIMHtmlClass, toggle_format), |
631 NULL, | 632 NULL, |
632 0, | 633 0, |
633 g_cclosure_marshal_VOID__POINTER, | 634 g_cclosure_marshal_VOID__POINTER, |
634 G_TYPE_NONE, 1, | 635 G_TYPE_NONE, 1, |
635 G_TYPE_INT); | 636 G_TYPE_INT); |
637 signals[CLEAR_FORMAT] = g_signal_new("format_function_clear", | |
638 G_TYPE_FROM_CLASS(gobject_class), | |
639 G_SIGNAL_RUN_FIRST, | |
640 G_STRUCT_OFFSET(GtkIMHtmlClass, clear_format), | |
641 NULL, | |
642 0, | |
643 g_cclosure_marshal_VOID__POINTER, | |
644 G_TYPE_NONE, 0); | |
636 gobject_class->finalize = gtk_imhtml_finalize; | 645 gobject_class->finalize = gtk_imhtml_finalize; |
637 } | 646 } |
638 | 647 |
639 static void gtk_imhtml_init (GtkIMHtml *imhtml) | 648 static void gtk_imhtml_init (GtkIMHtml *imhtml) |
640 { | 649 { |
680 gtk_drag_dest_set(GTK_WIDGET(imhtml), 0, | 689 gtk_drag_dest_set(GTK_WIDGET(imhtml), 0, |
681 link_drag_drop_targets, sizeof(link_drag_drop_targets) / sizeof(GtkTargetEntry), | 690 link_drag_drop_targets, sizeof(link_drag_drop_targets) / sizeof(GtkTargetEntry), |
682 GDK_ACTION_COPY); | 691 GDK_ACTION_COPY); |
683 g_signal_connect(G_OBJECT(imhtml), "drag_data_received", G_CALLBACK(gtk_imhtml_link_drag_rcv_cb), imhtml); | 692 g_signal_connect(G_OBJECT(imhtml), "drag_data_received", G_CALLBACK(gtk_imhtml_link_drag_rcv_cb), imhtml); |
684 | 693 |
694 #if 0 /* Remove buggy copy-and-paste for 0.76 */ | |
685 #if GTK_CHECK_VERSION(2,2,0) | 695 #if GTK_CHECK_VERSION(2,2,0) |
686 g_signal_connect(G_OBJECT(imhtml), "copy-clipboard", G_CALLBACK(copy_clipboard_cb), NULL); | 696 g_signal_connect(G_OBJECT(imhtml), "copy-clipboard", G_CALLBACK(copy_clipboard_cb), NULL); |
687 g_signal_connect(G_OBJECT(imhtml), "paste-clipboard", G_CALLBACK(paste_clipboard_cb), NULL); | 697 g_signal_connect(G_OBJECT(imhtml), "paste-clipboard", G_CALLBACK(paste_clipboard_cb), NULL); |
688 g_signal_connect(G_OBJECT(imhtml), "button-release-event", G_CALLBACK(button_release_cb), imhtml); | 698 g_signal_connect(G_OBJECT(imhtml), "button-release-event", G_CALLBACK(button_release_cb), imhtml); |
699 #endif | |
689 #endif | 700 #endif |
690 gtk_widget_add_events(GTK_WIDGET(imhtml), GDK_LEAVE_NOTIFY_MASK); | 701 gtk_widget_add_events(GTK_WIDGET(imhtml), GDK_LEAVE_NOTIFY_MASK); |
691 | 702 |
692 imhtml->tip = NULL; | 703 imhtml->tip = NULL; |
693 imhtml->tip_timer = 0; | 704 imhtml->tip_timer = 0; |
2048 void | 2059 void |
2049 gtk_imhtml_clear (GtkIMHtml *imhtml) | 2060 gtk_imhtml_clear (GtkIMHtml *imhtml) |
2050 { | 2061 { |
2051 GList *del; | 2062 GList *del; |
2052 GtkTextIter start, end; | 2063 GtkTextIter start, end; |
2064 GObject *object = g_object_ref(G_OBJECT(imhtml)); | |
2053 | 2065 |
2054 gtk_text_buffer_get_start_iter(imhtml->text_buffer, &start); | 2066 gtk_text_buffer_get_start_iter(imhtml->text_buffer, &start); |
2055 gtk_text_buffer_get_end_iter(imhtml->text_buffer, &end); | 2067 gtk_text_buffer_get_end_iter(imhtml->text_buffer, &end); |
2056 gtk_text_buffer_delete(imhtml->text_buffer, &start, &end); | 2068 gtk_text_buffer_delete(imhtml->text_buffer, &start, &end); |
2057 | 2069 |
2079 imhtml->edit.fontface = NULL; | 2091 imhtml->edit.fontface = NULL; |
2080 imhtml->edit.forecolor = NULL; | 2092 imhtml->edit.forecolor = NULL; |
2081 imhtml->edit.backcolor = NULL; | 2093 imhtml->edit.backcolor = NULL; |
2082 imhtml->edit.sizespan = NULL; | 2094 imhtml->edit.sizespan = NULL; |
2083 imhtml->edit.fontsize = 3; | 2095 imhtml->edit.fontsize = 3; |
2096 printf("Emiting signal\n"); | |
2097 g_signal_emit(object, signals[CLEAR_FORMAT], 0); | |
2098 g_object_unref(object); | |
2084 } | 2099 } |
2085 | 2100 |
2086 void gtk_imhtml_page_up (GtkIMHtml *imhtml) | 2101 void gtk_imhtml_page_up (GtkIMHtml *imhtml) |
2087 { | 2102 { |
2088 GdkRectangle rect; | 2103 GdkRectangle rect; |