Thu, 22 Feb 2024 06:03:16 -0600
Add a favorite property to PurpleContactInfo
This will be used in the future for toggling whether or not contacts are
favorited or starred.
Testing Done:
Ran the unit tests under valgrind.
Reviewed at https://reviews.imfreedom.org/r/2965/
|
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 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
7 | * source distribution. |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
12 | * any later version. |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
17 | * more details. |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
18 | * |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
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 | #include "purpleproxyinfo.h" |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #include "purpleenums.h" |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | struct _PurpleProxyInfo { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | GObject parent; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | PurpleProxyType proxy_type; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | gchar *hostname; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | gint port; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | gchar *username; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | gchar *password; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | }; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | enum { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | PROP_0, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | PROP_PROXY_TYPE, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | PROP_HOSTNAME, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | PROP_PORT, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | PROP_USERNAME, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | PROP_PASSWORD, |
|
42584
687260353985
Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42576
diff
changeset
|
44 | N_PROPERTIES, |
|
41318
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 | static GParamSpec *properties[N_PROPERTIES] = {NULL, }; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | |
|
42576
ab1ca778ddb2
Make sure all of the final types in libpurple are defined as such
Gary Kramlich <grim@reaperworld.com>
parents:
42303
diff
changeset
|
48 | G_DEFINE_FINAL_TYPE(PurpleProxyInfo, purple_proxy_info, G_TYPE_OBJECT) |
|
41318
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | /****************************************************************************** |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | * GObject Implementation |
|
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 | static void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | 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
|
55 | GParamSpec *pspec) |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | PurpleProxyInfo *info = PURPLE_PROXY_INFO(obj); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | switch(param_id) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | case PROP_PROXY_TYPE: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | 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
|
62 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | case PROP_HOSTNAME: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | 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
|
65 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | case PROP_PORT: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | 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
|
68 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | case PROP_USERNAME: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | 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
|
71 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | case PROP_PASSWORD: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | 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
|
74 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | default: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | 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
|
77 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | } |
|
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 | static void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | 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
|
83 | const GValue *value, GParamSpec *pspec) |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | PurpleProxyInfo *info = PURPLE_PROXY_INFO(obj); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | switch(param_id) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | case PROP_PROXY_TYPE: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | 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
|
90 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | case PROP_HOSTNAME: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | 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
|
93 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | case PROP_PORT: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | 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
|
96 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | case PROP_USERNAME: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | 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
|
99 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | case PROP_PASSWORD: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | 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
|
102 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | default: |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | 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
|
105 | break; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | } |
|
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 | static void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | purple_proxy_info_finalize(GObject *obj) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | PurpleProxyInfo *info = PURPLE_PROXY_INFO(obj); |
|
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_free(info->hostname); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
114 | g_free(info->username); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | g_free(info->password); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
117 | 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
|
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 |
|
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
|
121 | 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
|
122 | } |
|
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 | static void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | 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
|
126 | 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
|
127 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | 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
|
129 | 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
|
130 | 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
|
131 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
132 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
133 | * PurpleProxyInfo:proxy-type: |
|
41318
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 | * 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
|
136 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
138 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 | 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
|
140 | "proxy-type", "proxy-type", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | "The proxy type for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | PURPLE_TYPE_PROXY_TYPE, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | PURPLE_PROXY_TYPE_USE_GLOBAL, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | 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
|
145 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
147 | * PurpleProxyInfo:hostname: |
|
41318
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 | * 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
|
150 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | 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
|
154 | "hostname", "hostname", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | "The hostname for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | NULL, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
157 | 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
|
158 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
160 | * PurpleProxyInfo:port: |
|
41318
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 | * 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
|
163 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
164 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
165 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
166 | 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
|
167 | "port", "port", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
168 | "The port for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
169 | 0, 65535, 0, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
170 | 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
|
171 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
172 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
173 | * PurpleProxyInfo:username: |
|
41318
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 | * 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
|
176 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
177 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
178 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
179 | 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
|
180 | "username", "username", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
181 | "The username for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
182 | NULL, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
183 | 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
|
184 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
185 | /** |
|
42303
52c26807d91a
Fix a number of issues with the documentation for properties
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
186 | * PurpleProxyInfo:password: |
|
41318
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 | * 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
|
189 | * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
190 | * Since: 3.0.0 |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
191 | */ |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
192 | 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
|
193 | "password", "password", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
194 | "The password for this proxy.", |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
195 | NULL, |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
196 | 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
|
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 | 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
|
200 | } |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
201 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
202 | /****************************************************************************** |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
203 | * Public API |
|
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 | PurpleProxyInfo * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
206 | purple_proxy_info_new(void) { |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
207 | 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
|
208 | } |
|
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 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
211 | 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
|
212 | PurpleProxyType 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_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
|
215 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
216 | info->proxy_type = proxy_type; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
217 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
218 | 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
|
219 | } |
|
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 | PurpleProxyType |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
222 | 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
|
223 | 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
|
224 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
225 | return info->proxy_type; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
226 | } |
|
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 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
229 | 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
|
230 | 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
|
231 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
232 | g_free(info->hostname); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
233 | info->hostname = g_strdup(hostname); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
234 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
235 | 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
|
236 | } |
|
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 | const gchar * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
239 | 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
|
240 | 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
|
241 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
242 | return info->hostname; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
243 | } |
|
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 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
246 | 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
|
247 | 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
|
248 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
249 | info->port = port; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
250 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
251 | 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
|
252 | } |
|
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 | gint |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
255 | 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
|
256 | 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
|
257 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
258 | return info->port; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
259 | } |
|
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 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
262 | 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
|
263 | 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
|
264 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
265 | g_free(info->username); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
266 | info->username = g_strdup(username); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
267 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
268 | 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
|
269 | } |
|
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 | const gchar * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
272 | 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
|
273 | 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
|
274 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
275 | return info->username; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
276 | } |
|
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 | void |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
279 | 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
|
280 | 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
|
281 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
282 | g_free(info->password); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
283 | info->password = g_strdup(password); |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
284 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
285 | 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
|
286 | } |
|
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 | const gchar * |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
289 | 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
|
290 | 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
|
291 | |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
292 | return info->password; |
|
56092ffeae95
Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
293 | } |