comparison src/gtkimhtml.h @ 10776:b640d066eb51

[gaim-migrate @ 12387] this makes us do full backgrounds only for body tags, and changes how full backgrounds work. Sean, I left a lot of your code there, #if 0'd out. This probably isn't prefect yet, and I think I might have removed one of Sean's more recent changes. So I'm hoping Sean finishes this for me. Or at least yells at me about what to fix. Or at least tries it. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sat, 02 Apr 2005 23:59:49 +0000
parents 533060d9a2c6
children 5335eb2b8b95
comparison
equal deleted inserted replaced
10775:d47e82ac9918 10776:b640d066eb51
53 typedef struct _GtkIMHtmlImage GtkIMHtmlImage; 53 typedef struct _GtkIMHtmlImage GtkIMHtmlImage;
54 typedef struct _GtkIMHtmlHr GtkIMHtmlHr; 54 typedef struct _GtkIMHtmlHr GtkIMHtmlHr;
55 typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs; 55 typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs;
56 56
57 typedef enum { 57 typedef enum {
58 GTK_IMHTML_BOLD = 1 << 0, 58 GTK_IMHTML_BOLD = 1 << 0,
59 GTK_IMHTML_ITALIC = 1 << 1, 59 GTK_IMHTML_ITALIC = 1 << 1,
60 GTK_IMHTML_UNDERLINE = 1 << 2, 60 GTK_IMHTML_UNDERLINE = 1 << 2,
61 GTK_IMHTML_GROW = 1 << 3, 61 GTK_IMHTML_GROW = 1 << 3,
62 GTK_IMHTML_SHRINK = 1 << 4, 62 GTK_IMHTML_SHRINK = 1 << 4,
63 GTK_IMHTML_FACE = 1 << 5, 63 GTK_IMHTML_FACE = 1 << 5,
64 GTK_IMHTML_FORECOLOR = 1 << 6, 64 GTK_IMHTML_FORECOLOR = 1 << 6,
65 GTK_IMHTML_BACKCOLOR = 1 << 7, 65 GTK_IMHTML_BACKCOLOR = 1 << 7,
66 GTK_IMHTML_LINK = 1 << 8, 66 GTK_IMHTML_BACKGROUND = 1 << 8,
67 GTK_IMHTML_IMAGE = 1 << 9, 67 GTK_IMHTML_LINK = 1 << 9,
68 GTK_IMHTML_SMILEY = 1 << 10, 68 GTK_IMHTML_IMAGE = 1 << 10,
69 GTK_IMHTML_LINKDESC = 1 << 11, 69 GTK_IMHTML_SMILEY = 1 << 11,
70 GTK_IMHTML_STRIKE = 1 << 12, 70 GTK_IMHTML_LINKDESC = 1 << 12,
71 GTK_IMHTML_ALL = -1 71 GTK_IMHTML_STRIKE = 1 << 13,
72 GTK_IMHTML_ALL = -1
72 } GtkIMHtmlButtons; 73 } GtkIMHtmlButtons;
73 74
74 struct _GtkIMHtml { 75 struct _GtkIMHtml {
75 GtkTextView text_view; 76 GtkTextView text_view;
76 GtkTextBuffer *text_buffer; 77 GtkTextBuffer *text_buffer;
104 gboolean italic:1; 105 gboolean italic:1;
105 gboolean underline:1; 106 gboolean underline:1;
106 gboolean strike:1; 107 gboolean strike:1;
107 gchar *forecolor; 108 gchar *forecolor;
108 gchar *backcolor; 109 gchar *backcolor;
110 gchar *background;
109 gchar *fontface; 111 gchar *fontface;
110 int fontsize; 112 int fontsize;
111 GtkTextTag *link; 113 GtkTextTag *link;
112 } edit; 114 } edit;
113 115
114 char *clipboard_text_string; 116 char *clipboard_text_string;
115 char *clipboard_html_string; 117 char *clipboard_html_string;
116 118
117 GSList *im_images; 119 GSList *im_images;
118 GtkIMHtmlFuncs *funcs; 120 GtkIMHtmlFuncs *funcs;
119 GSList *backcolor_tags;
120 }; 121 };
121 122
122 struct _GtkIMHtmlClass { 123 struct _GtkIMHtmlClass {
123 GtkTextViewClass parent_class; 124 GtkTextViewClass parent_class;
124 125
133 struct _GtkIMHtmlFontDetail { 134 struct _GtkIMHtmlFontDetail {
134 gushort size; 135 gushort size;
135 gchar *face; 136 gchar *face;
136 gchar *fore; 137 gchar *fore;
137 gchar *back; 138 gchar *back;
139 gchar *bg;
138 gchar *sml; 140 gchar *sml;
139 gboolean underline; 141 gboolean underline;
140 }; 142 };
141 143
142 struct _GtkSmileyTree { 144 struct _GtkSmileyTree {
521 * @return A string containg the foreground color or @c NULL if none is set. 523 * @return A string containg the foreground color or @c NULL if none is set.
522 */ 524 */
523 char *gtk_imhtml_get_current_forecolor(GtkIMHtml *imhtml); 525 char *gtk_imhtml_get_current_forecolor(GtkIMHtml *imhtml);
524 526
525 /** 527 /**
528 * Returns a string containing the selected font background color at the current
529 * position in a GTK IM/HTML.
530 *
531 * @param imhtml The GTK IM/HTML.
532 *
533 * @return A string containg the font background color or @c NULL if none is set.
534 */
535 char *gtk_imhtml_get_current_backcolor(GtkIMHtml *imhtml);
536
537 /**
526 * Returns a string containing the selected background color at the current 538 * Returns a string containing the selected background color at the current
527 * position in a GTK IM/HTML. 539 * position in a GTK IM/HTML.
528 * 540 *
529 * @param imhtml The GTK IM/HTML. 541 * @param imhtml The GTK IM/HTML.
530 * 542 *
531 * @return A string containg the background color or @c NULL if none is set. 543 * @return A string containg the background color or @c NULL if none is set.
532 */ 544 */
533 char *gtk_imhtml_get_current_backcolor(GtkIMHtml *imhtml); 545 char *gtk_imhtml_get_current_background(GtkIMHtml *imhtml);
534 546
535 /** 547 /**
536 * Returns a integer containing the selected HTML font size at the current 548 * Returns a integer containing the selected HTML font size at the current
537 * position in a GTK IM/HTML. 549 * position in a GTK IM/HTML.
538 * 550 *
606 * @param color The HTML-style color, or @c NULL or "" to clear the color. 618 * @param color The HTML-style color, or @c NULL or "" to clear the color.
607 * 619 *
608 * @return @c TRUE if a color was set, or @c FALSE if it was cleared. 620 * @return @c TRUE if a color was set, or @c FALSE if it was cleared.
609 */ 621 */
610 gboolean gtk_imhtml_toggle_backcolor(GtkIMHtml *imhtml, const char *color); 622 gboolean gtk_imhtml_toggle_backcolor(GtkIMHtml *imhtml, const char *color);
623
624 /**
625 * Toggles a background color at the current location or selection in a GTK
626 * IM/HTML.
627 *
628 * @param imhtml The GTK IM/HTML.
629 * @param color The HTML-style color, or @c NULL or "" to clear the color.
630 *
631 * @return @c TRUE if a color was set, or @c FALSE if it was cleared.
632 */
633 gboolean gtk_imhtml_toggle_background(GtkIMHtml *imhtml, const char *color);
611 634
612 /** 635 /**
613 * Toggles a font face at the current location or selection in a GTK IM/HTML. 636 * Toggles a font face at the current location or selection in a GTK IM/HTML.
614 * 637 *
615 * @param imhtml The GTK IM/HTML. 638 * @param imhtml The GTK IM/HTML.