]> git.sesse.net Git - vlc/blob - modules/gui/skins/x11/x11_window.h
* tooltips are now updated during scrolling
[vlc] / modules / gui / skins / x11 / x11_window.h
1 /*****************************************************************************
2  * x11_window.h: X11 implementation of the Window class
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id: x11_window.h,v 1.6 2003/06/17 18:13:18 asmax Exp $
6  *
7  * Authors: Cyril Deguet     <asmax@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111,
22  * USA.
23  *****************************************************************************/
24
25
26 #ifndef VLC_SKIN_X11_WIN
27 #define VLC_SKIN_X11_WIN
28
29 //--- X11 -------------------------------------------------------------------
30 #include <X11/Xlib.h>
31
32 #include "x11_timer.h"
33
34 //---------------------------------------------------------------------------
35 class Graphics;
36 class Event;
37
38
39 typedef struct
40 {
41     intf_thread_t *p_intf;
42     X11Timer *timer;
43     string text;
44     Display *display;
45     Window window;
46     GC gc;
47     Font font;
48     int curX;
49     int curY;
50     bool active;
51 } tooltip_t;
52
53
54 //---------------------------------------------------------------------------
55 class X11Window : public SkinWindow
56 {
57     private:
58         // General parameters
59         Window Wnd;
60         Display *display;
61         GC Gc;
62         int CursorX;
63         int CursorY;
64         int WindowX;
65         int WindowY;
66         string Name;
67
68         // Drag&Drop
69         X11DropObject *DropObject;
70
71         // Tooltip texts
72         tooltip_t ToolTip;
73
74         // Double-click handling
75         int ClickedX;
76         int ClickedY;
77         int ClickedTime;
78         int DblClickDelay;
79
80         // Left button down
81         bool LButtonDown;
82         // Right button down
83         bool RButtonDown;
84
85     public:
86         // Cosntructors
87         X11Window( intf_thread_t *_p_intf, Window wnd, int x, int y,
88             bool visible, int transition, int normalalpha, int movealpha,
89             bool dragdrop, string name );
90
91         // Destructors
92         virtual ~X11Window();
93
94         // Event processing
95         virtual bool ProcessOSEvent( Event *evt );
96
97         // Window graphic aspect
98         virtual void OSShow( bool show );
99         virtual void RefreshFromImage( int x, int y, int w, int h );
100         virtual void SetTransparency( int Value = -1 );
101         virtual void WindowManualMove();
102         virtual void WindowManualMoveInit();
103
104         // Window methods
105         virtual void Move( int left, int top );
106         virtual void Size( int width, int height );
107
108         // Specific X11 methods
109         Window GetHandle() { return Wnd; };
110
111         // Tooltip texts
112         virtual void ChangeToolTipText( string text );
113
114         // Getters
115         string GetName() { return Name; }
116 };
117 //---------------------------------------------------------------------------
118
119 #endif