annotate plugins/perl/common/BuddyList_Group.xs @ 6922:1d994e9b81f9

[gaim-migrate @ 7469] Group::buddies() now returns the actual buddies. Contacts changed things slightly. I'll add contact support soon. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 24 Sep 2003 00:55:42 +0000
parents fe0294504602
children 7a8aa87164ae
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;
6922
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
71 GaimBlistNode *contact;
6542
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 GaimBlistNode *_group = (GaimBlistNode *)group;
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 PPCODE:
6922
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
74 for (contact = _group->child; contact != NULL; contact = contact->next)
6542
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 {
6922
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
76 for (node = contact->child; node != NULL; node = node->next)
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
77 {
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
78 XPUSHs(sv_2mortal(gaim_perl_bless_object(node,
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
79 "Gaim::BuddyList::Buddy")));
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
80 }
6542
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 }
6922
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
82