From: Sean E. <sea...@us...> - 2002-08-30 11:55:00
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv32499/src Modified Files: Tag: gtk1-stable conversation.c gtkimhtml.c gtkimhtml.h prpl.h Log Message: Thanks javabsp Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.358.2.1 retrieving revision 1.358.2.2 diff -u -d -r1.358.2.1 -r1.358.2.2 --- conversation.c 25 Aug 2002 21:29:03 -0000 1.358.2.1 +++ conversation.c 30 Aug 2002 11:54:53 -0000 1.358.2.2 @@ -92,7 +92,7 @@ static void remove_checkbox(struct conversation *); static void update_smilies(struct conversation *c); - +static void update_fontmode(struct conversation *c); /*------------------------------------------------------------------------*/ /* Helpers */ @@ -193,6 +193,7 @@ update_icon(c); update_checkbox(c); update_smilies(c); + update_fontmode(c); plugin_event(event_new_conversation, name, 0, 0, 0); return c; } @@ -1766,6 +1767,12 @@ char buf2[BUF_LONG]; char mdate[64]; int unhighlight = 0; + int timesize; + + if (c->gc && c->gc->prpl->options & OPT_PROTO_USE_POINT_SIZE) + timesize = 10; + else + timesize = 2; if (c->is_chat && (!c->gc || !g_slist_find(c->gc->buddy_chats, c))) return; @@ -1819,11 +1826,11 @@ if (flags & WFLAG_SYSTEM) { if (convo_options & OPT_CONVO_SHOW_TIME) - g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", mdate, what); + g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"%d\">(%s) </FONT><B>%s</B>", timesize, mdate, what); else g_snprintf(buf, BUF_LONG, "<B>%s</B>", what); - g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>", - mdate, what); + g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"%d\"><!--(%s) --></FONT><B>%s</B><BR>", + timesize, mdate, what); gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, -1, 0); @@ -1905,12 +1912,12 @@ } if (convo_options & OPT_CONVO_SHOW_TIME) - g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>" - "<B>%s</B></FONT> ", colour, mdate, str); + g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"%d\">(%s) </FONT>" + "<B>%s</B></FONT> ", colour, timesize, mdate, str); else g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", colour, str); - g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>" - "<B>%s</B></FONT> ", colour, mdate, str); + g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"%d\"><!--(%s) --></FONT>" + "<B>%s</B></FONT> ", colour, timesize, mdate, str); g_free(str); @@ -2328,6 +2335,7 @@ update_icon(cnv); update_checkbox(cnv); update_smilies(cnv); + update_fontmode(cnv); gaim_setup_imhtml_smileys(cnv->text); } @@ -2487,6 +2495,7 @@ update_icon(c); update_checkbox(c); update_smilies(c); + update_fontmode(c); gaim_setup_imhtml_smileys(c->text); } @@ -3526,6 +3535,15 @@ c->icon_timer = 0; c->frame = 0; #endif +} + +void update_fontmode(struct conversation *c) +{ + if (!c || !c->gc) + return; + + gtk_imhtml_set_use_pointsize(GTK_IMHTML(c->text), + c->gc->prpl->options & OPT_PROTO_USE_POINT_SIZE); } void update_smilies(struct conversation *c) Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.108.2.2 retrieving revision 1.108.2.3 diff -u -d -r1.108.2.2 -r1.108.2.3 --- gtkimhtml.c 29 Aug 2002 00:32:22 -0000 1.108.2.2 +++ gtkimhtml.c 30 Aug 2002 11:54:54 -0000 1.108.2.3 @@ -69,7 +69,8 @@ #define MAX_FONT_SIZE 7 -#define POINT_SIZE(x) (_point_sizes [MIN ((x), MAX_FONT_SIZE) - 1]) +#define POINT_SIZE(x) (imhtml->use_pointsize ? x * 10 : \ + _point_sizes [MIN ((x), MAX_FONT_SIZE) - 1]) static gint _point_sizes [] = { 80, 100, 120, 140, 200, 300, 400 }; #define DEFAULT_PRE_FACE "courier" @@ -260,6 +261,11 @@ gtk_imhtml_init_smileys (imhtml); } +void +gtk_imhtml_set_use_pointsize (GtkIMHtml *imhtml, gboolean point) +{ + imhtml->use_pointsize = point; +} struct im_image { gchar *filename; Index: gtkimhtml.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.h,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -d -r1.14 -r1.14.2.1 --- gtkimhtml.h 20 Apr 2002 08:10:13 -0000 1.14 +++ gtkimhtml.h 30 Aug 2002 11:54:54 -0000 1.14.2.1 @@ -79,7 +79,8 @@ gboolean smileys; gboolean comments; - + gboolean use_pointsize; + GtkSmileyTree *smiley_data; }; @@ -132,6 +133,9 @@ void gtk_imhtml_show_comments (GtkIMHtml *imhtml, gboolean show); + +void gtk_imhtml_set_use_pointsize(GtkIMHtml *imhtml, + gboolean point); GString* gtk_imhtml_append_text (GtkIMHtml *imhtml, const gchar *text, Index: prpl.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.h,v retrieving revision 1.66 retrieving revision 1.66.2.1 diff -u -d -r1.66 -r1.66.2.1 --- prpl.h 15 Jun 2002 20:21:01 -0000 1.66 +++ prpl.h 30 Aug 2002 11:54:54 -0000 1.66.2.1 @@ -72,6 +72,8 @@ #define OPT_PROTO_BUDDY_ICON 0x00000040 /* Oscar lets you send images in direct IMs */ #define OPT_PROTO_IM_IMAGE 0x00000080 +/* Oscar doesn't use point size, Yahoo and Jabber do */ +#define OPT_PROTO_USE_POINT_SIZE 0x00000100 #define GAIM_AWAY_CUSTOM "Custom" |