annotate plugins/perl/common/BuddyList_Group.xs @ 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
children 1d994e9b81f9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6542
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 #include "module.h"
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 MODULE = Gaim::BuddyList::Group PACKAGE = Gaim::BuddyList::Group PREFIX = gaim_group_
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 PROTOTYPES: ENABLE
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 Gaim::BuddyList::Group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 new(name)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 const char *name
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 RETVAL = gaim_group_new(name);
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 OUTPUT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 RETVAL
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 void
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 rename(group, new_name)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 const char *new_name
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 gaim_blist_rename_group(group, new_name);
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 void
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 get_accounts(group)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 PREINIT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 GSList *l;
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 PPCODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 for (l = gaim_group_get_accounts(group); l != NULL; l = l->next)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Account")));
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 int
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 get_size(group, offline)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 gboolean offline
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 RETVAL = gaim_blist_get_group_size(group, offline);
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 OUTPUT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 RETVAL
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 const char *
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 get_name(group)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 RETVAL = group->name;
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 OUTPUT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 RETVAL
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 int
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48 get_online_count(group)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 RETVAL = gaim_blist_get_group_online_count(group);
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 OUTPUT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 RETVAL
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 void
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 gaim_group_set_setting(group, key, value)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 const char *key
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 const char *value
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 const char *
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 gaim_group_get_setting(group, key)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 const char *key
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 void
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 buddies(group)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 PREINIT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 GaimBlistNode *node;
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 GaimBlistNode *_group = (GaimBlistNode *)group;
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 PPCODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 for (node = _group->child; node != NULL; node = node->next)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 {
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 XPUSHs(sv_2mortal(gaim_perl_bless_object(node,
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 "Gaim::BuddyList::Buddy")));
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 }