Debian Codegraph @

subprojects/gtk-frdp/src/frdp-session.h

raw symbols SCIP
1 /* frdp-session.h
2 *
3 * Copyright (C) 2018 Felipe Borges <[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 #pragma once
20
21 #include <glib-object.h>
22 #include <frdp-display.h>
23
24 G_BEGIN_DECLS
25
26 #define FRDP_TYPE_SESSION (frdp_session_get_type())
27
28 G_DECLARE_FINAL_TYPE (FrdpSession, frdp_session, FRDP, SESSION, GObject)
29
30 typedef struct _FrdpSessionPrivate FrdpSessionPrivate;
31
32 struct _FrdpSession
33 {
34 GObject parent;
35
36 FrdpSessionPrivate *priv;
37
38 /* Do not add fields to this struct */
39 };
40
41 typedef enum
42 {
43 FRDP_MOUSE_EVENT_MOVE = 1 << 0,
44 FRDP_MOUSE_EVENT_DOWN = 1 << 1,
45 FRDP_MOUSE_EVENT_WHEEL = 1 << 2,
46 FRDP_MOUSE_EVENT_WHEEL_NEGATIVE = 1 << 3,
47 FRDP_MOUSE_EVENT_BUTTON1 = 1 << 4,
48 FRDP_MOUSE_EVENT_BUTTON2 = 1 << 5,
49 FRDP_MOUSE_EVENT_BUTTON3 = 1 << 6,
50 FRDP_MOUSE_EVENT_BUTTON4 = 1 << 7,
51 FRDP_MOUSE_EVENT_BUTTON5 = 1 << 8,
52 FRDP_MOUSE_EVENT_HWHEEL = 1 << 9,
53 } FrdpMouseEvent;
54
55 typedef enum
56 {
57 FRDP_KEY_EVENT_PRESS = 1 << 0,
58 FRDP_KEY_EVENT_RELEASE = 1 << 1,
59 } FrdpKeyEvent;
60
61 FrdpSession *frdp_session_new (FrdpDisplay *display);
62
63 void frdp_session_connect (FrdpSession *self,
64 const gchar *hostname,
65 guint port,
66 GCancellable *cancellable,
67 GAsyncReadyCallback callback,
68 gpointer user_data);
69
70 gboolean frdp_session_connect_finish (FrdpSession *self,
71 GAsyncResult *result,
72 GError **error);
73
74 gboolean frdp_session_is_open (FrdpSession *self);
75
76 void frdp_session_close (FrdpSession *self);
77
78 void frdp_session_mouse_event (FrdpSession *self,
79 FrdpMouseEvent event,
80 guint16 x,
81 guint16 y);
82
83 void frdp_session_mouse_smooth_scroll_event (FrdpSession *self,
84 guint16 x,
85 guint16 y,
86 double delta_x,
87 double delta_y);
88
89 void frdp_session_mouse_pointer (FrdpSession *self,
90 gboolean enter);
91
92 void frdp_session_send_key (FrdpSession *self,
93 GdkEventKey *key);
94
95 GdkPixbuf *frdp_session_get_pixbuf (FrdpSession *self);
96 /*FreeRDP fatal error codes*/
97 typedef enum {
98 FRDP_ERRCONNECT_CONNECT_CANCELLED = 0x2000B,
99 FRDP_ERRCONNECT_AUTHENTICATION_FAILED = 0x20009,
100 FRDP_ERRCONNECT_SECURITY_NEGO_CONNECT_FAILED = 0x2000c,
101
102 } FrdpErrConnect;
103
104 G_END_DECLS