comparison src/gtkimhtml.c @ 10899:1e6bdc7175e9

[gaim-migrate @ 12619] Bits'n'pieces: Don't allow gaim-remote "clones" to knock gaim out by specifying a big packet length. Correctly bound the point sizes in gtkimhtml & yahoo Fix up some code in MSN that isn't actually being used, just in case someone comes along and submits a patch that would use it. Don't try writing to the server in MSN if you're not actually connected Fix message flags in SILC committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 05 May 2005 13:09:28 +0000
parents 6240d7fd5b2c
children d056acc96b30
comparison
equal deleted inserted replaced
10898:cfacc0de0d94 10899:1e6bdc7175e9
94 static void mark_set_cb(GtkTextBuffer *buffer, GtkTextIter *arg1, GtkTextMark *mark, GtkIMHtml *imhtml); 94 static void mark_set_cb(GtkTextBuffer *buffer, GtkTextIter *arg1, GtkTextMark *mark, GtkIMHtml *imhtml);
95 static void hijack_menu_cb(GtkIMHtml *imhtml, GtkMenu *menu, gpointer data); 95 static void hijack_menu_cb(GtkIMHtml *imhtml, GtkMenu *menu, gpointer data);
96 static void paste_received_cb (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data); 96 static void paste_received_cb (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data);
97 static void paste_plaintext_received_cb (GtkClipboard *clipboard, const gchar *text, gpointer data); 97 static void paste_plaintext_received_cb (GtkClipboard *clipboard, const gchar *text, gpointer data);
98 98
99 /* POINT_SIZE converts from AIM font sizes to point sizes. It probably should be redone in such a 99 /* POINT_SIZE converts from AIM font sizes to a point size scale factor. */
100 * way that it base the sizes off the default font size rather than using arbitrary font sizes. */
101 #define MAX_FONT_SIZE 7 100 #define MAX_FONT_SIZE 7
102 #define POINT_SIZE(x) (options & GTK_IMHTML_USE_POINTSIZE ? x : _point_sizes [MIN ((x), MAX_FONT_SIZE) - 1]) 101 #define POINT_SIZE(x) (_point_sizes [MIN ((x > 0 ? x : 1), MAX_FONT_SCALE) - 1])
103 static gdouble _point_sizes [] = { .69444444, .8333333, 1, 1.2, 1.44, 1.728, 2.0736}; 102 static gdouble _point_sizes [] = { .69444444, .8333333, 1, 1.2, 1.44, 1.728, 2.0736};
104 103
105 enum { 104 enum {
106 TARGET_HTML, 105 TARGET_HTML,
107 TARGET_UTF8_STRING, 106 TARGET_UTF8_STRING,
3451 * me. So this works around that oddity. 3450 * me. So this works around that oddity.
3452 */ 3451 */
3453 GtkTextAttributes *attr = gtk_text_view_get_default_attributes(GTK_TEXT_VIEW(imhtml)); 3452 GtkTextAttributes *attr = gtk_text_view_get_default_attributes(GTK_TEXT_VIEW(imhtml));
3454 tag = gtk_text_buffer_create_tag(imhtml->text_buffer, str, "size", 3453 tag = gtk_text_buffer_create_tag(imhtml->text_buffer, str, "size",
3455 (gint) (pango_font_description_get_size(attr->font) * 3454 (gint) (pango_font_description_get_size(attr->font) *
3456 (double) _point_sizes[size-1]), NULL); 3455 (double) POINT_SIZE(size)), NULL);
3457 gtk_text_attributes_unref(attr); 3456 gtk_text_attributes_unref(attr);
3458 } 3457 }
3459 3458
3460 return tag; 3459 return tag;
3461 } 3460 }