Mercurial > pidgin
changeset 4032:2b3a9d8f168e
[gaim-migrate @ 4238]
Smileys. These are just the default smileys--I'm adding the prpl-specific smileys right now.
If you want to help by creating some png's, IM me.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 03 Dec 2002 02:02:16 +0000 |
parents | ec7e8c93c2ee |
children | 8e139d7ff0b2 |
files | pixmaps/Makefile.am pixmaps/angel.png pixmaps/angel.xpm pixmaps/bigsmile.png pixmaps/bigsmile.xpm pixmaps/burp.png pixmaps/burp.xpm pixmaps/cool.png pixmaps/crossedlips.png pixmaps/crossedlips.xpm pixmaps/cry.png pixmaps/cry.xpm pixmaps/embarrassed.png pixmaps/embarrassed.xpm pixmaps/kiss.png pixmaps/kiss.xpm pixmaps/moneymouth.png pixmaps/moneymouth.xpm pixmaps/sad.png pixmaps/scream.png pixmaps/scream.xpm pixmaps/smile.png pixmaps/smile.xpm pixmaps/smile8.xpm pixmaps/think.png pixmaps/think.xpm pixmaps/tongue.png pixmaps/tongue.xpm pixmaps/wink.png pixmaps/wink.xpm pixmaps/yell.png pixmaps/yell.xpm src/conversation.c src/gtkimhtml.c src/gtkimhtml.h |
diffstat | 35 files changed, 398 insertions(+), 515 deletions(-) [+] |
line wrap: on
line diff
--- a/pixmaps/Makefile.am Tue Dec 03 01:08:08 2002 +0000 +++ b/pixmaps/Makefile.am Tue Dec 03 02:02:16 2002 +0000 @@ -3,27 +3,28 @@ accounts.png \ accounts-menu.png \ add.xpm \ - angel.xpm \ + angel.png \ arrow_down.xpm \ arrow_right.xpm \ away.png \ away_big.xpm \ - bigsmile.xpm \ + bigsmile.png \ block.xpm \ broken.xpm \ - burp.xpm \ + burp.png \ cancel.xpm \ change-bgcolor-small.png \ change-fgcolor-small.png \ close.xpm \ + cool.png \ connect.png \ - crazy4.xpm \ - crossedlips.xpm \ - cry.xpm \ - download.xpm \ + crazy.png \ + crossedlips.png \ + cry.png \ + download.png \ edit.png \ - embarrassed.xpm \ - farted.xpm \ + embarrassed.png \ + farted.png \ fontface2.xpm \ gaim.png \ gaim_cool.png \ @@ -40,30 +41,29 @@ insert-link-small.png \ insert-smiley-small.png \ join.xpm \ - kiss.xpm \ + kiss.png \ login_icon.xpm \ logo.png \ logo.xpm \ logout_icon.xpm \ - luke03.xpm \ - moneymouth.xpm \ - mrt.xpm \ + luke.png \ + moneymouth.png \ + mrt.png \ msgpend.png \ msgunread.png \ no_icon.xpm \ offline.png \ ok.xpm \ - oneeye.xpm \ + oneeye.png \ online.png \ panic.xpm \ preferences.png \ refresh.xpm \ - sad.xpm \ + sad.png \ save.xpm \ - scream.xpm \ + scream.png \ signon.png \ - smile.xpm \ - smile8.xpm \ + smile.png \ status-away.xpm \ status-game.xpm \ status-here.xpm \ @@ -76,12 +76,12 @@ text_bigger.png \ text_normal.png \ text_smaller.png \ - think.xpm \ + think.png \ tmp_send.xpm \ - tongue.xpm \ - warn.xpm \ - wink.xpm \ - yell.xpm + tongue.png \ + warn.png \ + wink.png \ + yell.png gaimbuttonpixdir = $(datadir)/pixmaps/gaim/buttons @@ -93,6 +93,11 @@ gaimmenupixdir = $(datadir)/pixmaps/gaim/menus gaimmenupix_DATA = insert-image-small.png about_menu.png import-menu.png accounts-menu.png insert-link-small.png +gaimsmileypixdir = $(datadir)/pixmaps/gaim/smileys/default +gaimsmileypix_DATA = luke.png oneeye.png crazy.png mrt.png download.png farted.png \ + smile.png sad.png wink.png tongue.png scream.png kiss.png yell.png cool.png moneymouth.png burp.png embarrassed.png cry.png \ + think.png crossedlips.png bigsmile.png angel.png + gaimdistpixdir = $(datadir)/pixmaps/gaim gaimdistpix_DATA = away.png connect.png msgpend.png offline.png online.png msgunread.png logo.png
--- a/pixmaps/angel.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* XPM */ -static char * angel_xpm[] = { -"19 19 7 1", -" c None", -". c #000066", -"+ c #000000", -"@ c #FFFF00", -"# c #333333", -"$ c #FFFFFF", -"% c #FFFF33", -" .......... ", -" ... ... ", -" .. ++++++ .. ", -" .. ++@@@@@@++ ..", -" ..+@@@@@@@@@@+.. ", -" ...@@@@@@@@... ", -" +@@..........@@+ ", -" +@@@@#@@@@+@@@@+ ", -" +@@@@@++@@@++@@@@+", -" +@@@@#$+@@#$+@@@@+", -" +@@@@#$$@@#$$@@@@+", -" +@@@@@#@@@@#@@@@@+", -" +@@@@@@@@@@@@@@@@+", -" +@@+%@@@@@@@+%@+ ", -" +@@@+@@@@@@+@@@+ ", -" +@@@++++++@@@+ ", -" +@@@@@@@@@@+ ", -" ++@@@@@@++ ", -" ++++++ "};
--- a/pixmaps/bigsmile.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* XPM */ -static char * bigsmile_xpm[] = { -"19 19 7 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #333300", -"$ c #CCCC33", -"% c #FFFFFF", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@....@@@....@+. ", -" .@#.$$..@..$$.#@. ", -".+.@@@@@@@@@@@@@.+.", -".@..@@@@@@@@@@@..@.", -".@.%.@@@@@@@@@.%.@.", -".@.%..@@@@@@@..%.@.", -".@.%.%.......%.%.@.", -".@...%.%%.%%.%...@.", -".+.%.%.%%.%%.%.%.+.", -" ..%...........%.. ", -" .+..%.%%.%%.%..+. ", -" .+.%.%%.%%.%.@. ", -" .+.........+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/burp.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* XPM */ -static char * burp_xpm[] = { -"19 19 10 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #333300", -"$ c #333333", -"% c #666666", -"& c #FFFFFF", -"* c #666600", -"= c #999900", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@##@@@@@##@@+. ", -" .@@#++#@@@#++#@@. ", -".+@@$%..@@@%%.$@@+.", -".@@@#&&#@@@#&&#@@@.", -".@@@@$#@@@@@#$@@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@@@@@@@@+*@+#@@.", -".@@..@@@@@@.....=@.", -".@*...@@@@....@*@@.", -" .@..........#=#@. ", -" .@@=#.......@#@@. ", -" .@@@@@@*..=*@@. ", -" .@@@@@@@@@@@. ", -" ..@@@@@@@.. ", -" ....... "};
--- a/pixmaps/crossedlips.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* XPM */ -static char * crossedlips_xpm[] = { -"19 19 5 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #333300", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@#@@@@@#@@@. ", -" .+@@...@@@...@@+. ", -" .@@@...@@@...@@@. ", -".+@@@...@@@...@@@+.", -".@@@@@.@@@@@.@@@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@@..@@@@@..@@@@.", -".@@@@+...+...+@@@@.", -".+@@@@@+...+@@@@@+.", -" .@@@+...+.#.+@@@. ", -" .+@@..@@@@@..@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@@@@@@@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/cry.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* XPM */ -static char * cry_xpm[] = { -"19 19 12 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #333300", -"$ c #333333", -"% c #999900", -"& c #FFFFFF", -"* c #666600", -"= c #CCCC33", -"- c #666666", -"; c #FFCC00", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@.@@@..@@@. ", -" .+@@.#@@@@@@.@@+. ", -" .@@.@$..@@$.$.@@. ", -".+@@@%&..@%&..@@@+.", -".@@@@%&&$@%&&*@@@@.", -".@@@@@$$=@@$-@#@@@.", -".@@@@@@@@@@@@@.*@@.", -".;@@@@@@@@@@@@.*@@.", -".;@@@@.......@@@@@.", -".;@@@.@@@@@@@.@@@+.", -" .;@.;;;...@@@.@@. ", -" .;@@@@;;;@@@@@@+. ", -" .;@@@@@@@@@@@@. ", -" .;;@@@@@@@@+. ", -" ..;;;@@@+.. ", -" ....... "};
--- a/pixmaps/embarrassed.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* XPM */ -static char * embarrassed_xpm[] = { -"19 19 11 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #D8D83F", -"$ c #666633", -"% c #FFFFFF", -"& c #FFCC00", -"* c #FF9900", -"= c #999933", -"- c #333300", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@@.@@@@@.@@@+. ", -" .@@@.@@@@@@@.@@@. ", -".#@@.$..@@@..$.@@+.", -".@@.$%.%.@.%.%$.@@.", -".@@@$%.%.@.%.%$@@@.", -".@@@&.%%.@.%%.&@@@.", -".@&&&&..@@@..&&&@@.", -".@&&**&@@@@@&**&&@.", -".+&****&@@@&****&+.", -" .&&***&@@@&***&&. ", -" .&&&=&.....&=&&&. ", -" .&&-.@@@@@..&&. ", -" .+*@@***@@*+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/kiss.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* XPM */ -static char * kiss_xpm[] = { -"19 19 19 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #FFCC00", -"$ c #CC9900", -"% c #999900", -"& c #CC9933", -"* c #333300", -"= c #666600", -"- c #996600", -"; c #666666", -"> c #333333", -", c #FFFFFF", -"' c #999999", -") c #999933", -"! c #FF0000", -"~ c #FF3300", -"{ c #FF6600", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@@@@###@@@. ", -" .+@@@@@@##$#%@@+. ", -" .%@###@@&*.=-@@@. ", -".+%*.+#@@;..>#@@@+.", -".@@;..#@%,;.>@@@@@.", -".@@;,.@@%,,,;@@@@@.", -".@@;,'@@+;,,;@@@@@.", -".@@#;)@@@@;;@@@@@@.", -".@@#@@@@@@##@@@@@@.", -".+@##!@!~@###@@@@+.", -" .##!!!!!!@####@@. ", -" .##!!!!!!!!@####. ", -" .@@!!!!!@@@@@@. ", -" .+@!{@@@@@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/moneymouth.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* XPM */ -static char * moneymouth_xpm[] = { -"19 19 4 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@@.@@@@@.@@@+. ", -" .@@@...@@@...@@@. ", -".+@@@...@@@...@@@+.", -".@@@@...@@@...@@@@.", -".@@@@@.@@@@@.@@@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@@@@.@@..@@@@@@.", -".@@.@@.@@.@@.@@.@@.", -".+@.............@+.", -" .@.@@.@@.@@.@@.@. ", -" .+@@@@..@@.@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@@@@@@@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/scream.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* XPM */ -static char * scream_xpm[] = { -"19 19 7 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #333300", -"$ c #999900", -"% c #FFFFFF", -" ....... ", -" ..+@@@@@+.. ", -" .+@#@@@@@#@+. ", -" .@@.@#@@@#@.@@. ", -" .+@@$%%@@@%%$@@+. ", -" .@@$%.%$@$%.%$@@. ", -".+@@$%.%$@$%.%$@@+.", -".@@@@.%%$@$%%.@@@@.", -".@@@@@..@@@..@@@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@@@@@...@@@@@@@.", -".@@@@@@$...$@@@@@@.", -".+@@@@@.....@@@@@+.", -" .@@@@@.....@@@@@. ", -" .+@@@@$...$@@@@+. ", -" .@@@@@...@@@@@. ", -" .+@@@@@@@@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/smile.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* XPM */ -static char * smile_xpm[] = { -"19 19 7 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #666600", -"$ c #999900", -"% c #FF3300", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@@.@@@@@.@@@+. ", -" .@@@...@@@...@@@. ", -".+@@@...@@@...@@@+.", -".@@@@...@@@...@@@@.", -".@@@@@.@@@@@.@@@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@.@@@@@@@@@.@@@.", -".@@.#@@@@@@@@@#.@@.", -".+@@@.+@@@@@+.@@@+.", -" .@@@@..$$$..@@@@. ", -" .+@@@@.%%%.@@@@+. ", -" .@@@@@...@@@@@. ", -" .+@@@@@@@@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/smile8.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* XPM */ -static char * smile8_xpm[] = { -"19 19 5 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #999933", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@@@@@@@@@@@@+. ", -" .......@@@....... ", -".+@.............@+.", -".@@.............@@.", -".@@.....@@@.....@@.", -".@@@...@@@@@...@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@.@@@@@@@@@.@@@.", -".+@..@@@@@@@@@..@+.", -" .@@@.#@@@@@#.@@@. ", -" .+@@@.......@@@+. ", -" .@@@@.###.@@@@. ", -" .+@@@...@@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/think.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* XPM */ -static char * think_xpm[] = { -"19 19 11 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #333333", -"$ c #666600", -"% c #FFFFFF", -"& c #666666", -"* c #999900", -"= c #CCCC33", -"- c #333300", -" ....... ", -" ..+@@@@@+.. ", -" .+@@.@@@.@@+. ", -" .@@@.@@@@@.@@@. ", -" .+@..##@@@##..@+. ", -" .@.$%%#@@&%%*$@@. ", -".+@@&%..@@&%..@@@+.", -".@@@+...@@=#..@@@@.", -".@@@@@+@@@@@+@@@@@.", -".@@@@@@@@@@@@@@.@@.", -".@@@@@@@@@@@@...@@.", -".@@@@@@@@$-.-@@@@@.", -".+@@@@$..@@@@@@@@+.", -" .@@..@@@@@@@@@@@. ", -" .+@@@@@@@@@@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@@@@@@@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/tongue.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* XPM */ -static char * tongue_xpm[] = { -"19 19 7 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #333300", -"$ c #FF0000", -"% c #CC9900", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@@.@@@@@.@@@+. ", -" .@@@...@@@...@@@. ", -".+@@@...@@@...@@@+.", -".@@@@...@@@...@@@@.", -".@@@@...@@@...@@@@.", -".@@@@@.@@@@@.@@@@@.", -".@@#@@@@@@@@@@@#@@.", -".@#+#@@@@@@@@@#+#@.", -".+@@@#@@@@@@@#@@@+.", -" .@@@@#######$%@@. ", -" .+@@@@@@@$$$$$@+. ", -" .@@@@@@@@$$$@@. ", -" .+@@@@@@@@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/wink.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* XPM */ -static char * wink_xpm[] = { -"19 19 6 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #333300", -"$ c #FFFFFF", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" .@@@@@@@@@@@@@. ", -" .+@@@@@@@@@@@@@+. ", -" .@@#.@@@@@@@@@@@. ", -".+@.$$.@@@@..@@@@+.", -".@@.$..@@...@@@@@@.", -".@@@..@@@@@@@@@@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@@@@@@@.@@@@@@@.", -".+@.@@@@@@@...@@@+.", -" .@@.@@@@@..@@@@@. ", -" .+@@.....#@@@@@+. ", -" .@@@....@@@@@@. ", -" .+@@@@@@@@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/pixmaps/yell.xpm Tue Dec 03 01:08:08 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* XPM */ -static char * yell_xpm[] = { -"19 19 8 1", -" c None", -". c #000000", -"+ c #CCCC00", -"@ c #FFFF00", -"# c #333300", -"$ c #330000", -"% c #FF6600", -"& c #CC3300", -" ....... ", -" ..+@@@@@+.. ", -" .+@@@@@@@@@+. ", -" ..@@@@@@@@@@@#. ", -" .++..@@@@@@@..++. ", -" .@@@@..@@@..@@@@. ", -".+@@@..@@@@@..@@@+.", -".@@@@..@@@@@..@@@@.", -".@@@@@@@@@@@@@@@@@.", -".@@@@@@@....@@@@@@.", -".@@@@@@......@@@@@.", -".@@@@@........@@@@.", -".+@@@@........@@@+.", -" .@@@@...$$...@@@. ", -" .+@@@..%%%%..@@+. ", -" .@@@@.%&&%.@@@. ", -" .+@@@.$$.@@+. ", -" ..+@@@@@+.. ", -" ....... "};
--- a/src/conversation.c Tue Dec 03 01:08:08 2002 +0000 +++ b/src/conversation.c Tue Dec 03 02:02:16 2002 +0000 @@ -54,15 +54,6 @@ #include "win32dep.h" #endif -/*#include "pixmaps/save_small.xpm"*/ - -#include "pixmaps/luke03.xpm" -#include "pixmaps/oneeye.xpm" -#include "pixmaps/crazy4.xpm" -#include "pixmaps/mrt.xpm" -#include "pixmaps/download.xpm" -#include "pixmaps/farted.xpm" - int state_lock = 0; GdkPixmap *dark_icon_pm = NULL; @@ -98,15 +89,89 @@ void gaim_setup_imhtml_smileys(GtkWidget *imhtml) { - gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:)", luke03_xpm); - gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:-)", luke03_xpm); - gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "O-)", oneeye_xpm); - gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:)", crazy4_xpm); - gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:-)", crazy4_xpm); - gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-o)))", mrt_xpm); - gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-O)))", mrt_xpm); - gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "8-|)", download_xpm); - gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-]", farted_xpm); + /* This is ugly right now--it will get better when the themable smileys come */ + + + char *filename; + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "smile.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":)", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-)", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "sad.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":(", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-(", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "wink.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ";)", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ";-)", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "tounge.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-p", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-P", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "scream.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "=-O", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "=-o", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "kiss.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-*", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "yell.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:o", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:O", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "cool.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "8-)", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "moneymouth.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-$", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "burp.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-!", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "embarrassed.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-[", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "cry.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":'(", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "think.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-/", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-\\", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "crossedlips.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-x", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-X", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "bigsmile.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-d", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-D", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "angel.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "O:-)", NULL, filename); + + + /* "Secret" smileys */ + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "luke.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:)", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:-)", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "oneeye.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "O-)", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "crazy.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:)", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:-)", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "mrt.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-o)))", NULL, filename); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-O)))", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "download.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "8-|)", NULL, filename); + + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "farted.png", NULL); + gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-]", NULL, filename); } void gaim_setup_imhtml(GtkWidget *imhtml) @@ -1797,6 +1862,7 @@ char buf2[BUF_LONG]; char mdate[64]; int unhighlight = 0; + char *withfonttag; if (c->is_chat && (!c->gc || !g_slist_find(c->gc->buddy_chats, c))) return; @@ -1959,8 +2025,9 @@ g_free(str); gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, -1, 0); - - logstr = gtk_imhtml_append_text(GTK_IMHTML(c->text), what, length, gtk_font_options); + + withfonttag = g_strdup_printf("<font sml=\"%s\">%s</font>", c->gc->prpl->name, what); + logstr = gtk_imhtml_append_text(GTK_IMHTML(c->text), withfonttag, length, gtk_font_options); gtk_imhtml_append_text(GTK_IMHTML(c->text), "<BR>", -1, 0); @@ -1999,10 +2066,10 @@ if (logging_options & OPT_LOG_STRIP_HTML) { t1 = strip_html(buf); - t2 = strip_html(what); + t2 = strip_html(withfonttag); } else { t1 = html_logize(buf); - t2 = html_logize(what); + t2 = html_logize(withfonttag); } fd = open_log_file(nm, c->is_chat); if (fd) { @@ -2018,8 +2085,11 @@ g_free(t2); g_free(nm); } + + g_free(withfonttag); } + if (!(flags & WFLAG_NOLOG) && ((c->is_chat && (chat_options & OPT_CHAT_POPUP)) || (!c->is_chat && (im_options & OPT_IM_POPUP)))) gdk_window_show(c->window->window); @@ -3594,7 +3664,7 @@ struct _prpl_smiley *smile = (struct _prpl_smiley *)smilies->data; - gtk_imhtml_associate_smiley(GTK_IMHTML(c->text), smile->key, smile->xpm); + //gtk_imhtml_associate_smiley(GTK_IMHTML(c->text), smile->key, smile->xpm); smilies = g_slist_next(smilies); } } else {
--- a/src/gtkimhtml.c Tue Dec 03 01:08:08 2002 +0000 +++ b/src/gtkimhtml.c Tue Dec 03 02:02:16 2002 +0000 @@ -47,8 +47,76 @@ gchar *face; gchar *fore; gchar *back; + gchar *sml; }; +struct _GtkSmileyTree { + GString *values; + GtkSmileyTree **children; + gchar *image; +}; + +static GtkSmileyTree* +gtk_smiley_tree_new () +{ + return g_new0 (GtkSmileyTree, 1); +} + +static void +gtk_smiley_tree_insert (GtkSmileyTree *tree, + const gchar *text, + const gchar *path) +{ + GtkSmileyTree *t = tree; + const gchar *x = text; + + if (!strlen (x)) + return; + + while (*x) { + gchar *pos; + gint index; + + if (!t->values) + t->values = g_string_new (""); + + pos = strchr (t->values->str, *x); + if (!pos) { + t->values = g_string_append_c (t->values, *x); + index = t->values->len - 1; + t->children = g_realloc (t->children, t->values->len * sizeof (GtkSmileyTree *)); + t->children [index] = g_new0 (GtkSmileyTree, 1); + } else + index = (int) pos - (int) t->values->str; + + t = t->children [index]; + + x++; + } + + t->image = path; +} +gtk_smiley_tree_destroy (GtkSmileyTree *tree) +{ + GSList *list = g_slist_append (NULL, tree); + + while (list) { + GtkSmileyTree *t = list->data; + gint i; + list = g_slist_remove(list, t); + if (t->values) { + for (i = 0; i < t->values->len; i++) + list = g_slist_append (list, t->children [i]); + g_string_free (t->values, TRUE); + g_free (t->children); + } + g_free (t); + } +} + +static GtkTextViewClass *parent_class = NULL; + + /* GtkIMHtml has one signal--URL_CLICKED */ enum { URL_CLICKED, @@ -56,12 +124,24 @@ }; static guint signals [LAST_SIGNAL] = { 0 }; +static void +gtk_imhtml_finalize (GObject *object) +{ + GtkIMHtml *imhtml = GTK_IMHTML(object); + + g_hash_table_foreach_remove(imhtml->smiley_data, gtk_smiley_tree_destroy, NULL); + gtk_smiley_tree_destroy(imhtml->default_smilies); + G_OBJECT_CLASS(parent_class)->finalize (object); +} /* Boring GTK stuff */ static void gtk_imhtml_class_init (GtkIMHtmlClass *class) { GtkObjectClass *object_class; + GObjectClass *gobject_class; object_class = (GtkObjectClass*) class; + gobject_class = (GObjectClass*) class; + parent_class = gtk_type_class(GTK_TYPE_TEXT_VIEW); signals[URL_CLICKED] = gtk_signal_new("url_clicked", GTK_RUN_FIRST, GTK_CLASS_TYPE(object_class), @@ -69,6 +149,7 @@ gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + gobject_class->finalize = gtk_imhtml_finalize; } static void gtk_imhtml_init (GtkIMHtml *imhtml) @@ -98,6 +179,8 @@ imhtml->hand_cursor = gdk_cursor_new (GDK_HAND2); imhtml->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR); + imhtml->smiley_data = g_hash_table_new (g_str_hash, g_str_equal); + imhtml->default_smilies = gtk_smiley_tree_new(); } GtkWidget *gtk_imhtml_new(void *a, void *b) @@ -139,6 +222,149 @@ } } +static void +gtk_smiley_tree_remove (GtkSmileyTree *tree, + const gchar *text) +{ + GtkSmileyTree *t = tree; + const gchar *x = text; + gint len = 0; + + while (*x) { + gchar *pos; + + if (!t->values) + return; + + pos = strchr (t->values->str, *x); + if (pos) + t = t->children [(int) pos - (int) t->values->str]; + else + return; + + x++; len++; + } + + if (t->image) + t->image = NULL; +} + +static gint +gtk_smiley_tree_lookup (GtkSmileyTree *tree, + const gchar *text) +{ + GtkSmileyTree *t = tree; + const gchar *x = text; + gint len = 0; + + while (*x) { + gchar *pos; + + if (!t->values) + break; + + pos = strchr (t->values->str, *x); + if (pos) + t = t->children [(int) pos - (int) t->values->str]; + else + break; + + x++; len++; + } + + if (t->image) + return len; + + return 0; +} + +void +gtk_imhtml_associate_smiley (GtkIMHtml *imhtml, + gchar *text, + gchar *sml, + gchar *path) +{ + GtkSmileyTree *tree; + g_return_if_fail (imhtml != NULL); + g_return_if_fail (GTK_IS_IMHTML (imhtml)); + g_return_if_fail (text != NULL); + + if (sml == NULL) + tree = imhtml->default_smilies; + else if ((tree = g_hash_table_lookup(imhtml->smiley_data, sml))) { + } else { + tree = gtk_smiley_tree_new(); + g_hash_table_insert(imhtml->smiley_data, sml, tree); + } + + if (path == NULL) + gtk_smiley_tree_remove (tree, text); + else + gtk_smiley_tree_insert (tree, text, path); +} + +static gboolean +gtk_imhtml_is_smiley (GtkIMHtml *imhtml, + GSList *fonts, + const gchar *text, + gint *len) +{ + GtkSmileyTree *tree; + FontDetail *font; + char *sml = NULL; + + if (fonts) { + font = fonts->data; + sml = font->sml; + } + + if (sml == NULL) + tree = imhtml->default_smilies; + else { + tree = g_hash_table_lookup(imhtml->smiley_data, sml); + } + if (tree == NULL) + return FALSE; + + *len = gtk_smiley_tree_lookup (tree, text); + return (*len > 0); +} + +static gchar* +gtk_smiley_tree_image (GtkIMHtml *imhtml, + const gchar *sml, + const gchar *text) +{ + GtkSmileyTree *t; + const gchar *x = text; + + if (sml == NULL) + t = imhtml->default_smilies; + else + t = g_hash_table_lookup(imhtml->smiley_data, sml); + + + if (t == NULL) + return sml ? gtk_smiley_tree_image(imhtml, NULL, text) : NULL; + + while (*x) { + gchar *pos; + + if (!t->values) { + return sml ? gtk_smiley_tree_image(imhtml, NULL, text) : NULL; + } + + pos = strchr (t->values->str, *x); + if (pos) { + t = t->children [(int) pos - (int) t->values->str]; + } else { + return sml ? gtk_smiley_tree_image(imhtml, NULL, text) : NULL; + } + x++; + } + + return t->image; +} #define VALID_TAG(x) if (!g_strncasecmp (string, x ">", strlen (x ">"))) { \ *tag = g_strndup (string, strlen (x)); \ *len = strlen (x) + 1; \ @@ -414,7 +640,7 @@ gchar *tag; gchar *url = NULL; gchar *bg = NULL; - gint tlen, wpos=0; + gint tlen, smilelen, wpos=0; gint type; const gchar *c; gchar amp; @@ -557,6 +783,8 @@ g_free (font->fore); if (font->back) g_free (font->back); + if (font->sml) + g_free (font->sml); g_free (font); } break; @@ -584,14 +812,14 @@ break; case 43: /* FONT (opt) */ { - gchar *color, *back, *face, *size; + gchar *color, *back, *face, *size, *sml; FontDetail *font, *oldfont = NULL; color = gtk_imhtml_get_html_opt (tag, "COLOR="); back = gtk_imhtml_get_html_opt (tag, "BACK="); face = gtk_imhtml_get_html_opt (tag, "FACE="); size = gtk_imhtml_get_html_opt (tag, "SIZE="); - - if (!(color || back || face || size)) + sml = gtk_imhtml_get_html_opt (tag, "SML="); + if (!(color || back || face || size || sml)) break; NEW_BIT (NEW_TEXT_BIT); @@ -614,7 +842,12 @@ font->face = face; else if (oldfont && oldfont->face) font->face = g_strdup(oldfont->face); - + + if (sml) + font->sml = sml; + else if (oldfont && oldfont->sml) + font->sml = g_strdup(oldfont->sml); + if (size && !(options & GTK_IMHTML_NO_SIZES)) { if (*size == '+') { sscanf (size + 1, "%hd", &font->size); @@ -678,7 +911,21 @@ } c++; pos++; - } else if (*c) { + } else if (gtk_imhtml_is_smiley (imhtml, fonts, c, &smilelen) || gtk_imhtml_is_smiley(imhtml, NULL, c, &smilelen)) { + FontDetail *fd; + gchar *sml = NULL; + if (fonts) { + fd = fonts->data; + sml = fd->sml; + } + NEW_BIT (NEW_TEXT_BIT); + wpos = g_snprintf (ws, smilelen + 1, "%s", c); + gtk_text_buffer_insert_pixbuf(imhtml->text_buffer, &iter, gdk_pixbuf_new_from_file(gtk_smiley_tree_image (imhtml, sml, ws), NULL)); + c += smilelen; + pos += smilelen; + wpos = 0; + ws[0] = 0; + } else if (*c) { ws [wpos++] = *c++; pos++; } else { @@ -693,6 +940,22 @@ str = g_string_append (str, "</A>"); } + while (fonts) { + FontDetail *font = fonts->data; + fonts = g_slist_remove (fonts, font); + if (font->face) + g_free (font->face); + if (font->fore) + g_free (font->fore); + if (font->back) + g_free (font->back); + if (font->sml) + g_free (font->sml); + g_free (font); + if (str) + str = g_string_append (str, "</FONT>"); + } + if (str) { while (bold) { str = g_string_append (str, "</B>"); @@ -727,9 +990,10 @@ pre--; } } - g_free(ws); - gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (imhtml), mark, - 0, TRUE, 0.0, 1.0); + g_free (ws); + if (!(options & GTK_IMHTML_NO_SCROLL)) + gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (imhtml), mark, + 0, TRUE, 0.0, 1.0); gtk_text_buffer_delete_mark (imhtml->text_buffer, mark); return str; } @@ -746,9 +1010,6 @@ void gtk_imhtml_set_img_handler (GtkIMHtml *imhtml, GtkIMHtmlImage handler){} -void gtk_imhtml_associate_smiley (GtkIMHtml *imhtml, - gchar *text, - gchar **xpm){} void gtk_imhtml_init_smileys (GtkIMHtml *imhtml){} void gtk_imhtml_remove_smileys (GtkIMHtml *imhtml){} void gtk_imhtml_reset_smileys (GtkIMHtml *imhtml){}
--- a/src/gtkimhtml.h Tue Dec 03 01:08:08 2002 +0000 +++ b/src/gtkimhtml.h Tue Dec 03 02:02:16 2002 +0000 @@ -49,6 +49,8 @@ gboolean comments, smileys; GdkCursor *hand_cursor; GdkCursor *arrow_cursor; + GHashTable *smiley_data; + GtkSmileyTree *default_smilies; }; struct _GtkIMHtmlClass { @@ -85,8 +87,9 @@ GtkIMHtmlImage handler); void gtk_imhtml_associate_smiley (GtkIMHtml *imhtml, + gchar *sml, gchar *text, - gchar **xpm); + gchar *path); void gtk_imhtml_init_smileys (GtkIMHtml *imhtml);