Gnash
0.8.11dev
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
libcore
HostInterface.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3
// Free Software Foundation, Inc
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, write to the Free Software
17
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
50
51
#ifndef GNASH_HOST_INTERFACE_H
52
#define GNASH_HOST_INTERFACE_H
53
54
#include <boost/variant.hpp>
55
#include <boost/any.hpp>
56
#include <string>
57
#include <iosfwd>
58
59
#include "
dsodefs.h
"
60
61
namespace
gnash {
62
64
//
66
class
CustomMessage
67
{
68
public
:
69
explicit
CustomMessage
(
const
std::string&
s
,
70
const
boost::any&
arg
= boost::blank())
71
:
72
_name(s),
73
_arg(
arg
)
74
{}
75
const
std::string&
name
()
const
{
return
_name; }
76
const
boost::any&
arg
()
const
{
return
_arg; }
77
private
:
78
std::string _name;
79
boost::any _arg;
80
};
81
83
//
85
class
HostMessage
86
{
87
public
:
88
90
//
92
enum
KnownEvent
{
93
98
SHOW_MOUSE
,
99
104
RESIZE_STAGE
,
105
110
UPDATE_STAGE
,
111
117
SHOW_MENU
,
118
124
SET_DISPLAYSTATE
,
125
130
SET_CLIPBOARD
,
131
136
SCREEN_RESOLUTION
,
137
142
SCREEN_DPI
,
143
148
PIXEL_ASPECT_RATIO
,
149
154
PLAYER_TYPE
,
155
160
SCREEN_COLOR
,
161
166
NOTIFY_ERROR
,
167
172
QUERY
,
173
175
EXTERNALINTERFACE_ISPLAYING
,
176
EXTERNALINTERFACE_PAN
,
177
EXTERNALINTERFACE_PLAY
,
178
EXTERNALINTERFACE_REWIND
,
179
EXTERNALINTERFACE_SETZOOMRECT
,
180
EXTERNALINTERFACE_STOPPLAY
,
181
EXTERNALINTERFACE_ZOOM
182
};
183
184
explicit
HostMessage
(
KnownEvent
e
,
const
boost::any&
arg
= boost::blank())
185
:
186
_event(e),
187
_arg(
arg
)
188
{}
189
190
KnownEvent
event
()
const
{
return
_event; }
191
const
boost::any&
arg
()
const
{
return
_arg; }
192
193
private
:
194
KnownEvent
_event;
195
boost::any _arg;
196
};
197
199
class
FsCallback
200
{
201
public
:
202
virtual
void
notify
(
const
std::string& cmd,
const
std::string& arg) = 0;
203
virtual
~FsCallback
() {}
204
};
205
207
class
HostInterface
208
{
209
public
:
210
211
virtual
~HostInterface
() {}
212
213
typedef
boost::variant<HostMessage, CustomMessage>
Message
;
214
216
//
219
//
223
virtual
boost::any
call
(
const
Message
&
e
) = 0;
224
226
//
229
virtual
void
exit
() = 0;
230
231
};
232
234
DSOEXPORT
std::ostream&
operator<<
(std::ostream& os,
const
HostMessage
&
m
);
235
DSOEXPORT
std::ostream&
operator<<
(std::ostream& os,
const
CustomMessage
&
m
);
236
238
DSOEXPORT
std::ostream&
operator<<
(std::ostream& os,
HostMessage::KnownEvent
e
);
239
240
241
}
// namespace gnash
242
243
#endif
Generated on Mon Jul 16 2012 04:05:33 for Gnash by
1.8.1.1