2 * Copyright (c) 2004-2007 Marcus Overhagen <marcus@overhagen.de>
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify,
8 * merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
35 #include "Controller.h"
36 #include "VideoView.h"
38 class MainWin
: public BWindow
44 void FrameResized(float new_width
, float new_height
);
45 void Zoom(BPoint rec_position
, float rec_width
, float rec_height
);
46 void DispatchMessage(BMessage
*message
, BHandler
*handler
);
47 void MessageReceived(BMessage
*msg
);
50 void MouseDown(BMessage
*msg
);
51 void MouseMoved(BMessage
*msg
);
52 void MouseUp(BMessage
*msg
);
53 status_t
KeyDown(BMessage
*msg
);
57 void SetupInterfaceMenu();
58 void SetupChannelMenu();
60 void SelectInitialInterface();
62 void SelectInterface(int i
);
63 void SelectChannel(int i
);
65 void SetInterfaceMenuMarker();
66 void SetChannelMenuMarker();
68 void VideoFormatChange(int width
, int height
, float width_scale
, float height_scale
);
70 void UpdateWindowTitle();
72 void AdjustFullscreenRenderer();
73 void AdjustWindowedRenderer(bool user_resized
);
75 void ToggleFullscreen();
76 void ToggleKeepAspectRatio();
77 void ToggleAlwaysOnTop();
78 void ToggleNoBorder();
80 void ToggleNoBorderNoMenu();
82 void ShowContextMenu(const BPoint
&screen_point
);
86 VideoView
* fVideoView
;
90 BMenu
* fInterfaceMenu
;
91 BMenu
* fSettingsMenu
;
94 Controller
* fController
;
95 volatile bool fIsFullscreen
;
96 volatile bool fKeepAspectRatio
;
97 volatile bool fAlwaysOnTop
;
98 volatile bool fNoMenu
;
99 volatile bool fNoBorder
;
106 bool fMouseDownTracking
;
107 BPoint fMouseDownMousePos
;
108 BPoint fMouseDownWindowPos
;
109 bool fFrameResizedTriggeredAutomatically
;
110 bool fIgnoreFrameResized
;
111 bool fFrameResizedCalled
;