Debian Codegraph @

subprojects/gtk-frdp/src/frdp-channel.c

raw symbols SCIP
1 /* frdp-channel.c
2 *
3 * Copyright (C) 2023 Marek Kasik <[email protected]>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "frdp-channel.h"
20
21 #include "frdp-session.h"
22
23 typedef struct
24 {
25 FrdpSession *session;
26 } FrdpChannelPrivate;
27
28 G_DEFINE_TYPE_WITH_PRIVATE (FrdpChannel, frdp_channel, G_TYPE_OBJECT)
29
30 enum
31 {
32 PROP_0 = 0,
33 PROP_SESSION,
34 };
35
36 static void
37 frdp_channel_get_property (GObject *object,
38 guint property_id,
39 GValue *value,
40 GParamSpec *pspec)
41 {
42 FrdpChannel *self = FRDP_CHANNEL (object);
43 FrdpChannelPrivate *priv = frdp_channel_get_instance_private (self);
44
45 switch (property_id)
46 {
47 case PROP_SESSION:
48 g_value_set_pointer (value, priv->session);
49 break;
50 default:
51 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
52 break;
53 }
54 }
55
56 static void
57 frdp_channel_set_property (GObject *object,
58 guint property_id,
59 const GValue *value,
60 GParamSpec *pspec)
61 {
62 FrdpChannel *self = FRDP_CHANNEL (object);
63 FrdpChannelPrivate *priv = frdp_channel_get_instance_private (self);
64
65 switch (property_id)
66 {
67 case PROP_SESSION:
68 priv->session = g_value_get_pointer (value);
69 break;
70 default:
71 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
72 break;
73 }
74 }
75
76 static void
77 frdp_channel_class_init (FrdpChannelClass *klass)
78 {
79 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
80
81 gobject_class->get_property = frdp_channel_get_property;
82 gobject_class->set_property = frdp_channel_set_property;
83
84 g_object_class_install_property (gobject_class,
85 PROP_SESSION,
86 g_param_spec_pointer ("session",
87 "session",
88 "Current RDP session",
89 G_PARAM_READWRITE));
90 }
91
92 static void
93 frdp_channel_init (FrdpChannel *self)
94 {
95 }