Fri, 20 Oct 2023 01:09:45 -0500
Implement ProtocolFileTransfer
Testing Done:
Ran the unit tests under valgrind.
Bugs closed: PIDGIN-17833
Reviewed at https://reviews.imfreedom.org/r/2643/
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * This program is free software; you can redistribute it and/or modify |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation; either version 2 of the License, or |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | #include "purpleproxyinfo.h" |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | #include "purpleenums.h" |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | struct _PurpleProxyInfo { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | GObject parent; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | PurpleProxyType proxy_type; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | gchar *hostname; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | gint port; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | gchar *username; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | gchar *password; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | }; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | enum { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | PROP_0, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | PROP_PROXY_TYPE, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | PROP_HOSTNAME, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | PROP_PORT, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | PROP_USERNAME, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | PROP_PASSWORD, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | N_PROPERTIES |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | }; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | static GParamSpec *properties[N_PROPERTIES] = {NULL, }; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | G_DEFINE_TYPE(PurpleProxyInfo, purple_proxy_info, G_TYPE_OBJECT) |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | /****************************************************************************** |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | * GObject Implementation |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | *****************************************************************************/ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | static void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | purple_proxy_info_get_property(GObject *obj, guint param_id, GValue *value, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | GParamSpec *pspec) |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | PurpleProxyInfo *info = PURPLE_PROXY_INFO(obj); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | switch(param_id) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | case PROP_PROXY_TYPE: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | g_value_set_enum(value, purple_proxy_info_get_proxy_type(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | case PROP_HOSTNAME: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | g_value_set_string(value, purple_proxy_info_get_hostname(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | case PROP_PORT: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | g_value_set_int(value, purple_proxy_info_get_port(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | case PROP_USERNAME: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | g_value_set_string(value, purple_proxy_info_get_username(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | case PROP_PASSWORD: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | g_value_set_string(value, purple_proxy_info_get_password(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | default: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | static void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | purple_proxy_info_set_property(GObject *obj, guint param_id, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | const GValue *value, GParamSpec *pspec) |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | PurpleProxyInfo *info = PURPLE_PROXY_INFO(obj); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | switch(param_id) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | case PROP_PROXY_TYPE: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | purple_proxy_info_set_proxy_type(info, g_value_get_enum(value)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | case PROP_HOSTNAME: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | purple_proxy_info_set_hostname(info, g_value_get_string(value)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | case PROP_PORT: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | purple_proxy_info_set_port(info, g_value_get_int(value)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | case PROP_USERNAME: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | purple_proxy_info_set_username(info, g_value_get_string(value)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | case PROP_PASSWORD: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | purple_proxy_info_set_password(info, g_value_get_string(value)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | default: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | static void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | purple_proxy_info_finalize(GObject *obj) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | PurpleProxyInfo *info = PURPLE_PROXY_INFO(obj); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | g_free(info->hostname); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | g_free(info->username); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | g_free(info->password); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | G_OBJECT_CLASS(purple_proxy_info_parent_class)->finalize(obj); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
114 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | static void |
|
41960
c8a4853205e3
Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41318
diff
changeset
|
117 | purple_proxy_info_init(G_GNUC_UNUSED PurpleProxyInfo *info) { |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | static void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | purple_proxy_info_class_init(PurpleProxyInfoClass *klass) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | obj_class->get_property = purple_proxy_info_get_property; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | obj_class->set_property = purple_proxy_info_set_property; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 | obj_class->finalize = purple_proxy_info_finalize; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
129 | * PurpleProxyInfo:proxy-type: |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
130 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
131 | * The [enum@ProxyType] to use for this proxy. |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
132 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 | properties[PROP_PROXY_TYPE] = g_param_spec_enum( |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 | "proxy-type", "proxy-type", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | "The proxy type for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
138 | PURPLE_TYPE_PROXY_TYPE, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 | PURPLE_PROXY_TYPE_USE_GLOBAL, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
143 | * PurpleProxyInfo:hostname: |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | * The hostname to use for this proxy. |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | properties[PROP_HOSTNAME] = g_param_spec_string( |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | "hostname", "hostname", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | "The hostname for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | NULL, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
154 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
156 | * PurpleProxyInfo:port: |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
157 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
158 | * The port to use for this proxy. |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
160 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
161 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
162 | properties[PROP_PORT] = g_param_spec_int( |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
163 | "port", "port", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
164 | "The port for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
165 | 0, 65535, 0, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
166 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
167 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
168 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
169 | * PurpleProxyInfo:username: |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
170 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
171 | * The username to use for this proxy. |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
172 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
173 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
174 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
175 | properties[PROP_USERNAME] = g_param_spec_string( |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
176 | "username", "username", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
177 | "The username for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
178 | NULL, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
179 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
180 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
181 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
182 | * PurpleProxyInfo:password: |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
183 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
184 | * The password to use for this proxy. |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
185 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
186 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
187 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
188 | properties[PROP_PASSWORD] = g_param_spec_string( |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
189 | "password", "password", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
190 | "The password for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
191 | NULL, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
192 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
193 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
194 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
195 | g_object_class_install_properties(obj_class, N_PROPERTIES, properties); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
196 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
197 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
198 | /****************************************************************************** |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
199 | * Public API |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
200 | *****************************************************************************/ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
201 | PurpleProxyInfo * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
202 | purple_proxy_info_new(void) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
203 | return g_object_new(PURPLE_TYPE_PROXY_INFO, NULL); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
204 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
205 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
206 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
207 | purple_proxy_info_set_proxy_type(PurpleProxyInfo *info, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
208 | PurpleProxyType proxy_type) |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
209 | { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
210 | g_return_if_fail(PURPLE_IS_PROXY_INFO(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
211 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
212 | info->proxy_type = proxy_type; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
213 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
214 | g_object_notify_by_pspec(G_OBJECT(info), properties[PROP_PROXY_TYPE]); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
215 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
216 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
217 | PurpleProxyType |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
218 | purple_proxy_info_get_proxy_type(PurpleProxyInfo *info) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
219 | g_return_val_if_fail(PURPLE_IS_PROXY_INFO(info), PURPLE_PROXY_TYPE_NONE); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
220 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
221 | return info->proxy_type; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
222 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
223 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
224 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
225 | purple_proxy_info_set_hostname(PurpleProxyInfo *info, const gchar *hostname) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
226 | g_return_if_fail(PURPLE_IS_PROXY_INFO(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
227 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
228 | g_free(info->hostname); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
229 | info->hostname = g_strdup(hostname); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
230 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
231 | g_object_notify_by_pspec(G_OBJECT(info), properties[PROP_HOSTNAME]); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
232 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
233 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
234 | const gchar * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
235 | purple_proxy_info_get_hostname(PurpleProxyInfo *info) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
236 | g_return_val_if_fail(PURPLE_IS_PROXY_INFO(info), NULL); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
237 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
238 | return info->hostname; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
239 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
240 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
241 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
242 | purple_proxy_info_set_port(PurpleProxyInfo *info, gint port) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
243 | g_return_if_fail(PURPLE_IS_PROXY_INFO(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
244 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
245 | info->port = port; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
246 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
247 | g_object_notify_by_pspec(G_OBJECT(info), properties[PROP_PORT]); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
248 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
249 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
250 | gint |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
251 | purple_proxy_info_get_port(PurpleProxyInfo *info) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
252 | g_return_val_if_fail(PURPLE_IS_PROXY_INFO(info), 0); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
253 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
254 | return info->port; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
255 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
256 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
257 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
258 | purple_proxy_info_set_username(PurpleProxyInfo *info, const gchar *username) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
259 | g_return_if_fail(PURPLE_IS_PROXY_INFO(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
260 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
261 | g_free(info->username); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
262 | info->username = g_strdup(username); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
263 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
264 | g_object_notify_by_pspec(G_OBJECT(info), properties[PROP_USERNAME]); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
265 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
266 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
267 | const gchar * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
268 | purple_proxy_info_get_username(PurpleProxyInfo *info) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
269 | g_return_val_if_fail(PURPLE_IS_PROXY_INFO(info), NULL); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
270 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
271 | return info->username; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
272 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
273 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
274 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
275 | purple_proxy_info_set_password(PurpleProxyInfo *info, const gchar *password) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
276 | g_return_if_fail(PURPLE_IS_PROXY_INFO(info)); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
277 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
278 | g_free(info->password); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
279 | info->password = g_strdup(password); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
280 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
281 | g_object_notify_by_pspec(G_OBJECT(info), properties[PROP_PASSWORD]); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
282 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
283 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
284 | const gchar * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
285 | purple_proxy_info_get_password(PurpleProxyInfo *info) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
286 | g_return_val_if_fail(PURPLE_IS_PROXY_INFO(info), NULL); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
287 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
288 | return info->password; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
289 | } |