Update with current status
[gnash.git] / libcore / HostInterface.cpp
blob523c2c32f674c2e2140d2ef689439629d6c3f980
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
19 #include "HostInterface.h"
21 #include <boost/variant.hpp>
22 #include <boost/any.hpp>
23 #include <string>
24 #include <ostream>
26 namespace gnash {
28 std::ostream&
29 operator<<(std::ostream& os, const HostMessage& m)
31 return os << m.event();
34 std::ostream&
35 operator<<(std::ostream& os, const CustomMessage& m)
37 return os << m.name();
40 std::ostream&
41 operator<<(std::ostream& os, HostMessage::KnownEvent e)
43 struct Wrapper {
44 Wrapper(std::ostream& os) : _os(os << "<") {}
45 ~Wrapper() { _os << ">"; }
46 std::ostream& _os;
47 } a(os);
49 switch (e) {
50 case HostMessage::SHOW_MOUSE:
51 return os << "show mouse";
52 case HostMessage::RESIZE_STAGE:
53 return os << "resize stage";
54 case HostMessage::SHOW_MENU:
55 return os << "show menu";
56 case HostMessage::UPDATE_STAGE:
57 return os << "update stage";
58 case HostMessage::SET_DISPLAYSTATE:
59 return os << "set display state";
60 case HostMessage::SET_CLIPBOARD:
61 return os << "set clipboard";
62 case HostMessage::SCREEN_RESOLUTION:
63 return os << "screen resolution";
64 case HostMessage::SCREEN_DPI:
65 return os << "screen DPI";
66 case HostMessage::PIXEL_ASPECT_RATIO:
67 return os << "pixel aspect ratio";
68 case HostMessage::PLAYER_TYPE:
69 return os << "player type";
70 case HostMessage::SCREEN_COLOR:
71 return os << "screen color";
72 case HostMessage::EXTERNALINTERFACE_ISPLAYING:
73 return os << "ExternalInterface.isPlaying";
74 case HostMessage::EXTERNALINTERFACE_PAN:
75 return os << "ExternalInterface.pan";
76 case HostMessage::EXTERNALINTERFACE_PLAY:
77 return os << "ExternalInterface.play";
78 case HostMessage::EXTERNALINTERFACE_REWIND:
79 return os << "ExternalInterface.rewind";
80 case HostMessage::EXTERNALINTERFACE_SETZOOMRECT:
81 return os << "ExternalInterface.setZoomRect";
82 case HostMessage::EXTERNALINTERFACE_STOPPLAY:
83 return os << "ExternalInterface.stopPlay";
84 case HostMessage::EXTERNALINTERFACE_ZOOM:
85 return os << "ExternalInterface.zoom";
86 default:
87 return os << "Unknown event " << +e;
91 } // namespace gnash