ScummVM API documentation
videobox.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * aint32 with this program; if not, write to the Free Software
19 *
20 *
21 * Based on the original sources
22 * Faery Tale II -- The Halls of the Dead
23 * (c) 1993-1996 The Wyrmkeep Entertainment Co.
24 */
25
26#ifndef SAGA2_VIDEOBOX_H
27#define SAGA2_VIDEOBOX_H
28
29#include "saga2/modal.h"
30#include "saga2/grequest.h"
31
32namespace Saga2 {
33
34// scroll class
35class CVideoBox : public ModalWindow {
36public:
37 enum {
38 kVBxSize = 340,
39 kVBySize = 220,
40 kVBx = (640 - kVBxSize) / 2,
41 kVBy = (480 - kVBySize) / 3
42 };
43
44private:
45 enum brush {
46 kVBxBrushSize = 340, // size of each brush 'chunk'.
47 kVByBrushSize = 110,
48 kVBnumBrushes = 2 // number of chunks
49 };
50
51 enum borderWidth {
52 kVBborderWidth = 6
53 };
54
55 enum {
56 kVBvidPan1ResID = 0,
57 kVBvidPan2ResID
58 };
59
60public:
61
62 // resource handle
63 hResContext *_decRes;
64
65 // requester info struct
66 requestInfo _rInfo;
67
68 // rect for the window
69 Rect16 _vidBoxRect;
70
71 // rect for the window panes
72 Rect16 _vidPanRects[kVBnumBrushes];
73
74public:
75 // decoration declarations
76 WindowDecoration _vidDec[kVBnumBrushes];
77
78
79protected:
80 void drawClipped(
81 gPort &port,
82 const Point16 &offset,
83 const Rect16 &clipRect);
84
85 void draw(); // redraw the window
86
87private:
88 bool activate(gEventType why); // activate the control
89 void deactivate();
90 void pointerMove(gPanelMessage &msg);
91 bool pointerHit(gPanelMessage &msg);
92 void pointerDrag(gPanelMessage &msg);
93 void pointerRelease(gPanelMessage &msg);
94
95public:
96 CVideoBox(const Rect16 &box,
97 uint16,
98 AppFunc *cmd = NULL);
99
100 ~CVideoBox();
101
102 // returns the active area of this video box
103 static Rect16 getAreaRect() {
104 return Rect16(kVBx, kVBy, kVBxSize, kVBySize);
105 }
106
107 // initializes the resources for this object
108 void init();
109
110 // opens and initalizes vid box
111 int16 openVidBox(char *fileName);
112};
113
114// function prototypes
115int16 openVidBox(char *fileName);
116
117} // end of namespace Saga2
118
119#endif
Definition: videobox.h:35
Definition: modal.h:45
Definition: rect.h:42
Definition: rect.h:290
Definition: panel.h:218
Definition: gdraw.h:178
Definition: hresmgr.h:98
Definition: floating.h:61
Definition: grequest.h:32