Mercurial > pidgin.yaz
comparison src/dialogs.c @ 4044:133cf6424c53
[gaim-migrate @ 4252]
Stripped the old proto-specific smiley support out. The new proto-specific
smileys won't be set by the prpl, but by a smiley theme settable from
preferences.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 04 Dec 2002 05:12:06 +0000 |
parents | c14b687f4601 |
children | c3968c878c68 |
comparison
equal
deleted
inserted
replaced
4043:e25edee01c33 | 4044:133cf6424c53 |
---|---|
3592 gtk_text_buffer_insert_at_cursor(c->entry_buffer, | 3592 gtk_text_buffer_insert_at_cursor(c->entry_buffer, |
3593 current_smiley, -1); | 3593 current_smiley, -1); |
3594 close_smiley_dialog(NULL, c); | 3594 close_smiley_dialog(NULL, c); |
3595 } | 3595 } |
3596 | 3596 |
3597 static void toolbar_add_smiley_xpm(struct conversation *c, GtkWidget *bar, char **xpm, GtkWidget *win, | |
3598 char *face) | |
3599 { | |
3600 GtkWidget *tpm; | |
3601 GdkBitmap *mask; | |
3602 GdkPixmap *dpm; | |
3603 GtkWidget *button; | |
3604 | |
3605 dpm = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, xpm); | |
3606 tpm = gtk_pixmap_new(dpm, mask); | |
3607 gtk_widget_show(tpm); | |
3608 gdk_pixmap_unref(dpm); | |
3609 gdk_bitmap_unref(mask); | |
3610 button = | |
3611 gtk_toolbar_append_element(GTK_TOOLBAR(bar), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, NULL, | |
3612 NULL, tpm, GTK_SIGNAL_FUNC(set_smiley), (char *)face); | |
3613 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c); | |
3614 | |
3615 /* these look really weird with borders */ | |
3616 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
3617 } | |
3618 | |
3619 static void toolbar_add_smiley(struct conversation *c, GtkWidget *bar, char *filename, char *face) | 3597 static void toolbar_add_smiley(struct conversation *c, GtkWidget *bar, char *filename, char *face) |
3620 { | 3598 { |
3621 GtkWidget *tpm; | 3599 GtkWidget *tpm; |
3622 GtkImage *image; | 3600 GtkImage *image; |
3623 GtkWidget *button; | 3601 GtkWidget *button; |
3658 | 3636 |
3659 | 3637 |
3660 /* setup buttons */ | 3638 /* setup buttons */ |
3661 | 3639 |
3662 /* pack buttons */ | 3640 /* pack buttons */ |
3663 if (c->gc->prpl->smiley_list == NULL) { | |
3664 char *filename; | |
3665 smiley_box = gtk_toolbar_new(); | |
3666 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3667 | |
3668 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "angel.png", NULL); | |
3669 toolbar_add_smiley(c, smiley_box, filename, "O:-)"); | |
3670 g_free(filename); | |
3671 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "bigsmile.png", NULL); | |
3672 toolbar_add_smiley(c, smiley_box, filename, ":-D"); | |
3673 g_free(filename); | |
3674 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "burp.png", NULL); | |
3675 toolbar_add_smiley(c, smiley_box, filename, ":-!"); | |
3676 g_free(filename); | |
3677 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "crossedlips.png", NULL); | |
3678 toolbar_add_smiley(c, smiley_box, filename, ":-X"); | |
3679 g_free(filename); | |
3680 | |
3681 smiley_box = gtk_toolbar_new(); | |
3682 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3683 | |
3684 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "cry.png", NULL); | |
3685 toolbar_add_smiley(c, smiley_box, filename, ":'("); | |
3686 g_free(filename); | |
3687 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "embarrassed.png", NULL); | |
3688 toolbar_add_smiley(c, smiley_box, filename, ":-["); | |
3689 g_free(filename); | |
3690 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "kiss.png", NULL); | |
3691 toolbar_add_smiley(c, smiley_box, filename, ":-*"); | |
3692 g_free(filename); | |
3693 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "moneymouth.png", NULL); | |
3694 toolbar_add_smiley(c, smiley_box, filename, ":-$"); | |
3695 g_free(filename); | |
3696 | |
3697 smiley_box = gtk_toolbar_new(); | |
3698 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3699 | |
3700 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "sad.png", NULL); | |
3701 toolbar_add_smiley(c, smiley_box, filename, ":-("); | |
3702 g_free(filename); | |
3703 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "scream.png", NULL); | |
3704 toolbar_add_smiley(c, smiley_box, filename, "=-O"); | |
3705 g_free(filename); | |
3706 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "smile.png", NULL); | |
3707 toolbar_add_smiley(c, smiley_box, filename, ":-)"); | |
3708 g_free(filename); | |
3709 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "cool.png", NULL); | |
3710 toolbar_add_smiley(c, smiley_box, filename, "8-)"); | |
3711 g_free(filename); | |
3712 | |
3713 smiley_box = gtk_toolbar_new(); | |
3714 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3715 | |
3716 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "think.png", NULL); | |
3717 toolbar_add_smiley(c, smiley_box, filename, ":-/"); | |
3718 g_free(filename); | |
3719 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "tongue.png", NULL); | |
3720 toolbar_add_smiley(c, smiley_box, filename, ":-P"); | |
3721 g_free(filename); | |
3722 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "wink.png", NULL); | |
3723 toolbar_add_smiley(c, smiley_box, filename, ";-)"); | |
3724 g_free(filename); | |
3725 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", "default", "yell.png", NULL); | |
3726 toolbar_add_smiley(c, smiley_box, filename, ">:o"); | |
3727 g_free(filename); | |
3728 } else { | |
3729 | |
3730 smilies = c->gc->prpl->smiley_list(); | |
3731 | |
3732 while (smilies) { | |
3733 struct _prpl_smiley *smile = | |
3734 (struct _prpl_smiley *)smilies->data; | |
3735 | |
3736 if (smile->show) { | |
3737 total_count++; | |
3738 } | |
3739 | |
3740 smilies = g_slist_next(smilies); | |
3741 } | |
3742 | |
3743 smilies = c->gc->prpl->smiley_list(); | |
3744 | |
3745 smiley_box = gtk_toolbar_new(); | |
3746 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3747 | |
3748 while (smilies) { | |
3749 struct _prpl_smiley *smile = | |
3750 (struct _prpl_smiley *)smilies->data; | |
3751 | |
3752 if (smile->show) { | |
3753 | |
3754 if ((!(smiley_count % ((int)(sqrt(total_count))))) && (smiley_count > 0)) { | |
3755 smiley_box = gtk_toolbar_new(); | |
3756 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3757 } | |
3758 | |
3759 toolbar_add_smiley_xpm(c, smiley_box, smile->xpm, win, smile->key); | |
3760 smiley_count++; | |
3761 } | |
3762 | |
3763 smilies = g_slist_next(smilies); | |
3764 | |
3765 } | |
3766 } | |
3767 | 3641 |
3642 smiley_box = gtk_toolbar_new(); | |
3643 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3644 #define GDS G_DIR_SEPARATOR_S | |
3645 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "angel.png", "O:-)"); | |
3646 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "bigsmile.png", ":-D"); | |
3647 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "burp.png", ":-!"); | |
3648 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "crossedlips.png", ":-X"); | |
3649 | |
3650 smiley_box = gtk_toolbar_new(); | |
3651 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3652 | |
3653 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "cry.png", ":'("); | |
3654 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "embarrassed.png", ":-["); | |
3655 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "kiss.png", ":-*"); | |
3656 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "moneymouth.png", ":-$"); | |
3657 | |
3658 smiley_box = gtk_toolbar_new(); | |
3659 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3660 | |
3661 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "sad.png", ":-("); | |
3662 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "scream.png", "=-O"); | |
3663 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "smile.png", ":-)"); | |
3664 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "cool.png", "8-)"); | |
3665 | |
3666 smiley_box = gtk_toolbar_new(); | |
3667 gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0); | |
3668 | |
3669 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "think.png", ":-/"); | |
3670 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "tongue.png", ":-P"); | |
3671 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "wink.png", ";-)"); | |
3672 toolbar_add_smiley(c, smiley_box, DATADIR GDS "pixmaps" GDS "gaim" GDS "smileys" GDS "default" GDS "yell.png", ">:o"); | |
3768 | 3673 |
3769 gtk_container_add(GTK_CONTAINER(dialog), vbox); | 3674 gtk_container_add(GTK_CONTAINER(dialog), vbox); |
3770 gtk_container_set_border_width(GTK_CONTAINER(dialog), 5); | 3675 gtk_container_set_border_width(GTK_CONTAINER(dialog), 5); |
3771 | 3676 |
3772 /* connect signals */ | 3677 /* connect signals */ |