Mercurial > pidgin.yaz
changeset 6542:fe0294504602
[gaim-migrate @ 7064]
Learn as you go, I guess... Split off the Chat, Group, and Buddy classes
into their own files and bootstrapped them so they'll actually work (I hope
at least).
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Thu, 21 Aug 2003 03:23:18 +0000 |
parents | f31eb1fab20e |
children | 4d45f1eb0a7b |
files | plugins/perl/common/BuddyList.xs plugins/perl/common/BuddyList_Buddy.xs plugins/perl/common/BuddyList_Chat.xs plugins/perl/common/BuddyList_Group.xs plugins/perl/common/Gaim.xs |
diffstat | 5 files changed, 230 insertions(+), 232 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/perl/common/BuddyList.xs Thu Aug 21 02:40:08 2003 +0000 +++ b/plugins/perl/common/BuddyList.xs Thu Aug 21 03:23:18 2003 +0000 @@ -86,235 +86,3 @@ XPUSHs(sv_2mortal(gaim_perl_bless_object(node, "Gaim::BuddyList::Group"))); } - - -########################################################################### -MODULE = Gaim::BuddyList::Group PACKAGE = Gaim::BuddyList::Group PREFIX = gaim_group_ -PROTOTYPES: ENABLE -########################################################################### - -Gaim::BuddyList::Group -new(name) - const char *name -CODE: - RETVAL = gaim_group_new(name); -OUTPUT: - RETVAL - -void -rename(group, new_name) - Gaim::BuddyList::Group group - const char *new_name -CODE: - gaim_blist_rename_group(group, new_name); - -void -get_accounts(group) - Gaim::BuddyList::Group group -PREINIT: - GSList *l; -PPCODE: - for (l = gaim_group_get_accounts(group); l != NULL; l = l->next) - XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Account"))); - -int -get_size(group, offline) - Gaim::BuddyList::Group group - gboolean offline -CODE: - RETVAL = gaim_blist_get_group_size(group, offline); -OUTPUT: - RETVAL - -const char * -get_name(group) - Gaim::BuddyList::Group group -CODE: - RETVAL = group->name; -OUTPUT: - RETVAL - -int -get_online_count(group) - Gaim::BuddyList::Group group -CODE: - RETVAL = gaim_blist_get_group_online_count(group); -OUTPUT: - RETVAL - -void -gaim_group_set_setting(group, key, value) - Gaim::BuddyList::Group group - const char *key - const char *value - -const char * -gaim_group_get_setting(group, key) - Gaim::BuddyList::Group group - const char *key - -void -buddies(group) - Gaim::BuddyList::Group group -PREINIT: - GaimBlistNode *node; - GaimBlistNode *_group = (GaimBlistNode *)group; -PPCODE: - for (node = _group->child; node != NULL; node = node->next) - { - XPUSHs(sv_2mortal(gaim_perl_bless_object(node, - "Gaim::BuddyList::Buddy"))); - } - - -########################################################################### -MODULE = Gaim::BuddyList::Buddy PACKAGE = Gaim::BuddyList::Buddy PREFIX = gaim_buddy_ -PROTOTYPES: ENABLE -########################################################################### - -Gaim::BuddyList::Buddy -new(account, name, alias) - Gaim::Account account - const char *name - const char *alias -CODE: - RETVAL = gaim_buddy_new(account, name, alias); -OUTPUT: - RETVAL - -void -update_presence(buddy, presence) - Gaim::BuddyList::Buddy buddy - int presence -CODE: - gaim_blist_update_buddy_presence(buddy, presence); - -void -set_idle_time(buddy, idle) - Gaim::BuddyList::Buddy buddy - int idle -CODE: - gaim_blist_update_buddy_idle(buddy, idle); - -void -set_warning_percent(buddy, warning) - Gaim::BuddyList::Buddy buddy - int warning -CODE: - gaim_blist_update_buddy_evil(buddy, warning); - -void -rename(buddy, new_name) - Gaim::BuddyList::Buddy buddy - const char *new_name -CODE: - gaim_blist_rename_buddy(buddy, new_name); - -void -set_alias(buddy, alias) - Gaim::BuddyList::Buddy buddy - const char *alias -CODE: - gaim_blist_alias_buddy(buddy, alias); - -void -set_server_alias(buddy, alias) - Gaim::BuddyList::Buddy buddy - const char *alias -CODE: - gaim_blist_server_alias_buddy(buddy, alias); - -const char * -get_name(buddy) - Gaim::BuddyList::Buddy buddy -CODE: - RETVAL = buddy->name; -OUTPUT: - RETVAL - -Gaim::Account -get_account(buddy) - Gaim::BuddyList::Buddy buddy -CODE: - RETVAL = buddy->account; -OUTPUT: - RETVAL - -const char * -get_alias_only(buddy) - Gaim::BuddyList::Buddy buddy -CODE: - RETVAL = gaim_get_buddy_alias_only(buddy); -OUTPUT: - RETVAL - -const char * -get_alias(buddy) - Gaim::BuddyList::Buddy buddy -CODE: - RETVAL = gaim_get_buddy_alias(buddy); -OUTPUT: - RETVAL - -Gaim::BuddyList::Group -get_group(buddy) - Gaim::BuddyList::Buddy buddy -CODE: - RETVAL = gaim_find_buddys_group(buddy); -OUTPUT: - RETVAL - -void -gaim_buddy_set_setting(buddy, key, value) - Gaim::BuddyList::Buddy buddy - const char *key - const char *value - -const char * -gaim_buddy_get_setting(buddy, key) - Gaim::BuddyList::Buddy buddy - const char *key - - -########################################################################### -MODULE = Gaim::BuddyList::Chat PACKAGE = Gaim::BuddyList::Chat PREFIX = gaim_chat_ -PROTOTYPES: ENABLE -########################################################################### - -void -set_alias(chat, alias) - Gaim::BuddyList::Chat chat - const char *alias -CODE: - gaim_blist_alias_chat(chat, alias); - -const char * -gaim_chat_get_display_name(chat) - Gaim::BuddyList::Chat chat - -Gaim::BuddyList::Group -gaim_blist_chat_get_group(chat) - Gaim::BuddyList::Chat chat -CODE: - RETVAL = gaim_blist_chat_get_group(chat); -OUTPUT: - RETVAL - -void -gaim_chat_set_setting(chat, key, value) - Gaim::BuddyList::Chat chat - const char *key - const char *value - -const char * -gaim_chat_get_setting(chat, key) - Gaim::BuddyList::Chat chat - const char *key - -Gaim::Account -get_account(chat) - Gaim::BuddyList::Chat chat -CODE: - RETVAL = chat->account; -OUTPUT: - RETVAL
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/perl/common/BuddyList_Buddy.xs Thu Aug 21 03:23:18 2003 +0000 @@ -0,0 +1,107 @@ +#include "module.h" + +MODULE = Gaim::BuddyList::Buddy PACKAGE = Gaim::BuddyList::Buddy PREFIX = gaim_buddy_ +PROTOTYPES: ENABLE + +Gaim::BuddyList::Buddy +new(account, name, alias) + Gaim::Account account + const char *name + const char *alias +CODE: + RETVAL = gaim_buddy_new(account, name, alias); +OUTPUT: + RETVAL + +void +update_presence(buddy, presence) + Gaim::BuddyList::Buddy buddy + int presence +CODE: + gaim_blist_update_buddy_presence(buddy, presence); + +void +set_idle_time(buddy, idle) + Gaim::BuddyList::Buddy buddy + int idle +CODE: + gaim_blist_update_buddy_idle(buddy, idle); + +void +set_warning_percent(buddy, warning) + Gaim::BuddyList::Buddy buddy + int warning +CODE: + gaim_blist_update_buddy_evil(buddy, warning); + +void +rename(buddy, new_name) + Gaim::BuddyList::Buddy buddy + const char *new_name +CODE: + gaim_blist_rename_buddy(buddy, new_name); + +void +set_alias(buddy, alias) + Gaim::BuddyList::Buddy buddy + const char *alias +CODE: + gaim_blist_alias_buddy(buddy, alias); + +void +set_server_alias(buddy, alias) + Gaim::BuddyList::Buddy buddy + const char *alias +CODE: + gaim_blist_server_alias_buddy(buddy, alias); + +const char * +get_name(buddy) + Gaim::BuddyList::Buddy buddy +CODE: + RETVAL = buddy->name; +OUTPUT: + RETVAL + +Gaim::Account +get_account(buddy) + Gaim::BuddyList::Buddy buddy +CODE: + RETVAL = buddy->account; +OUTPUT: + RETVAL + +const char * +get_alias_only(buddy) + Gaim::BuddyList::Buddy buddy +CODE: + RETVAL = gaim_get_buddy_alias_only(buddy); +OUTPUT: + RETVAL + +const char * +get_alias(buddy) + Gaim::BuddyList::Buddy buddy +CODE: + RETVAL = gaim_get_buddy_alias(buddy); +OUTPUT: + RETVAL + +Gaim::BuddyList::Group +get_group(buddy) + Gaim::BuddyList::Buddy buddy +CODE: + RETVAL = gaim_find_buddys_group(buddy); +OUTPUT: + RETVAL + +void +gaim_buddy_set_setting(buddy, key, value) + Gaim::BuddyList::Buddy buddy + const char *key + const char *value + +const char * +gaim_buddy_get_setting(buddy, key) + Gaim::BuddyList::Buddy buddy + const char *key
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/perl/common/BuddyList_Chat.xs Thu Aug 21 03:23:18 2003 +0000 @@ -0,0 +1,42 @@ +#include "module.h" + +MODULE = Gaim::BuddyList::Chat PACKAGE = Gaim::BuddyList::Chat PREFIX = gaim_chat_ +PROTOTYPES: ENABLE + +void +set_alias(chat, alias) + Gaim::BuddyList::Chat chat + const char *alias +CODE: + gaim_blist_alias_chat(chat, alias); + +const char * +gaim_chat_get_display_name(chat) + Gaim::BuddyList::Chat chat + +Gaim::BuddyList::Group +gaim_blist_chat_get_group(chat) + Gaim::BuddyList::Chat chat +CODE: + RETVAL = gaim_blist_chat_get_group(chat); +OUTPUT: + RETVAL + +void +gaim_chat_set_setting(chat, key, value) + Gaim::BuddyList::Chat chat + const char *key + const char *value + +const char * +gaim_chat_get_setting(chat, key) + Gaim::BuddyList::Chat chat + const char *key + +Gaim::Account +get_account(chat) + Gaim::BuddyList::Chat chat +CODE: + RETVAL = chat->account; +OUTPUT: + RETVAL
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/perl/common/BuddyList_Group.xs Thu Aug 21 03:23:18 2003 +0000 @@ -0,0 +1,77 @@ +#include "module.h" + +MODULE = Gaim::BuddyList::Group PACKAGE = Gaim::BuddyList::Group PREFIX = gaim_group_ +PROTOTYPES: ENABLE + +Gaim::BuddyList::Group +new(name) + const char *name +CODE: + RETVAL = gaim_group_new(name); +OUTPUT: + RETVAL + +void +rename(group, new_name) + Gaim::BuddyList::Group group + const char *new_name +CODE: + gaim_blist_rename_group(group, new_name); + +void +get_accounts(group) + Gaim::BuddyList::Group group +PREINIT: + GSList *l; +PPCODE: + for (l = gaim_group_get_accounts(group); l != NULL; l = l->next) + XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Account"))); + +int +get_size(group, offline) + Gaim::BuddyList::Group group + gboolean offline +CODE: + RETVAL = gaim_blist_get_group_size(group, offline); +OUTPUT: + RETVAL + +const char * +get_name(group) + Gaim::BuddyList::Group group +CODE: + RETVAL = group->name; +OUTPUT: + RETVAL + +int +get_online_count(group) + Gaim::BuddyList::Group group +CODE: + RETVAL = gaim_blist_get_group_online_count(group); +OUTPUT: + RETVAL + +void +gaim_group_set_setting(group, key, value) + Gaim::BuddyList::Group group + const char *key + const char *value + +const char * +gaim_group_get_setting(group, key) + Gaim::BuddyList::Group group + const char *key + +void +buddies(group) + Gaim::BuddyList::Group group +PREINIT: + GaimBlistNode *node; + GaimBlistNode *_group = (GaimBlistNode *)group; +PPCODE: + for (node = _group->child; node != NULL; node = node->next) + { + XPUSHs(sv_2mortal(gaim_perl_bless_object(node, + "Gaim::BuddyList::Buddy"))); + }
--- a/plugins/perl/common/Gaim.xs Thu Aug 21 02:40:08 2003 +0000 +++ b/plugins/perl/common/Gaim.xs Thu Aug 21 03:23:18 2003 +0000 @@ -77,4 +77,8 @@ BOOT: GAIM_PERL_BOOT(Account); + GAIM_PERL_BOOT(BuddyList); + GAIM_PERL_BOOT(BuddyList__Group); + GAIM_PERL_BOOT(BuddyList__Buddy); + GAIM_PERL_BOOT(BuddyList__Chat);