summaryrefslogtreecommitdiffstats
path: root/src/viewarea.h
blob: 502d7d0eab063e1f272fe8d1f7afa80873bd7a1e (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
  This file belong to the KMPlayer project, a movie player plugin for Konqueror
  Copyright (C) 2007  Koos Vriezen <[email protected]>

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2 of the License, or (at your option) any later version.

  This library 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
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
**/

#ifndef KMPLAYER_VIEW_AREA_H
#define KMPLAYER_VIEW_AREA_H

#include <tqwidget.h>

class TDEActionCollection;

namespace KMPlayer {

class View;
class ViewAreaPrivate;

/*
 * The area in which the video widget and controlpanel are laid out
 */
class KMPLAYER_EXPORT ViewArea : public TQWidget {
    TQ_OBJECT
  
public:
    ViewArea (TQWidget * parent, View * view);
    ~ViewArea ();
    TDE_NO_EXPORT bool isFullScreen () const { return m_fullscreen; }
    TDE_NO_EXPORT bool isMinimalMode () const { return m_minimal; }
    TDE_NO_EXPORT TDEActionCollection * actionCollection () const { return m_collection; }
    TDE_NO_EXPORT TQRect topWindowRect () const { return m_topwindow_rect; }
    SurfacePtr getSurface (NodePtr node);
    void setAudioVideoGeometry (const IRect &rect, unsigned int * bg);
    void setAudioVideoNode (NodePtr n);
    void mouseMoved ();
    void scheduleRepaint (const IRect &rect);
    void resizeEvent (TQResizeEvent *);
    void minimalMode ();
public slots:
    void fullScreen ();
    void accelActivated ();
    void scale (int);
protected:
    void showEvent (TQShowEvent *);
    void mouseMoveEvent (TQMouseEvent *);
    void mousePressEvent (TQMouseEvent *);
    void mouseDoubleClickEvent (TQMouseEvent *);
    void dragEnterEvent (TQDragEnterEvent *);
    void dropEvent (TQDropEvent *);
    void contextMenuEvent (TQContextMenuEvent * e);
    void paintEvent (TQPaintEvent *);
    void timerEvent (TQTimerEvent * e);
    void closeEvent (TQCloseEvent * e);
private:
    void syncVisual (const IRect & rect);
    void updateSurfaceBounds ();
    ViewAreaPrivate * d;
    TQWidget * m_parent;
    View * m_view;
    TDEActionCollection * m_collection;
    SurfacePtr surface;
    NodePtrW video_node;
    TQRect m_av_geometry;
    IRect m_repaint_rect;
    TQRect m_topwindow_rect;
    int m_mouse_invisible_timer;
    int m_repaint_timer;
    int m_fullscreen_scale;
    int scale_lbl_id;
    int scale_slider_id;
    bool m_fullscreen;
    bool m_minimal;
};

} // namespace KMPlayer

#endif