-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvncgrabsequencemm.cpp
51 lines (44 loc) · 1.41 KB
/
vncgrabsequencemm.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* This file is part of gsshvnc.
*
* gsshvnc is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* gsshvnc is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with gsshvnc. If not, see <http://www.gnu.org/licenses/>.
*/
#include "vncgrabsequencemm.h"
#include <gtkmm/label.h>
Vnc::GrabSequence::GrabSequence(std::vector<guint> keysyms)
{
m_seq = vnc_grab_sequence_new(static_cast<guint>(keysyms.size()),
keysyms.data());
m_owned = true;
}
Vnc::GrabSequence::GrabSequence(const Glib::ustring &str)
{
m_seq = vnc_grab_sequence_new_from_string(str.c_str());
m_owned = true;
}
Vnc::GrabSequence::~GrabSequence()
{
if (m_owned && m_seq)
vnc_grab_sequence_free(m_seq);
}
Glib::ustring Vnc::GrabSequence::as_string()
{
gchar *str = vnc_grab_sequence_as_string(m_seq);
Glib::ustring result(str);
g_free(str);
return result;
}
guint Vnc::GrabSequence::get_nth(guint n)
{
return vnc_grab_sequence_get_nth(m_seq, n);
}