xref: /trunk/main/vcl/inc/unx/salobj.h (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SV_SALOBJ_H
29 #define _SV_SALOBJ_H
30 
31 #include <vcl/sv.h>
32 #include <vcl/sysdata.hxx>
33 
34 #include <vclpluginapi.h>
35 #include <salobj.hxx>
36 
37 class SalClipRegion
38 {
39 
40 public:
41 
42 				SalClipRegion();
43 			   ~SalClipRegion();
44 
45     void      	BeginSetClipRegion( sal_uIntPtr nRects );
46     void      	UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
47 
48     XRectangle *EndSetClipRegion()	{
49 		return ClipRectangleList; 	}
50     void      	ResetClipRegion() 	{
51 		numClipRectangles = 0; 		}
52     sal_uInt16    	GetClipRegionType()	{
53 		return nClipRegionType;		}
54 	void 		SetClipRegionType( sal_uInt16 nType ) {
55 		nClipRegionType = nType;	}
56 	int			GetRectangleCount() {
57 		return numClipRectangles;	}
58 
59 private:
60 
61     XRectangle* ClipRectangleList;
62     int         numClipRectangles;
63     int         maxClipRectangles;
64 	sal_uInt16		nClipRegionType;
65 };
66 
67 
68 class VCLPLUG_GEN_PUBLIC X11SalObject : public SalObject
69 {
70 public:
71 	SystemChildData maSystemChildData;
72     SalFrame*       mpParent;
73 	XLIB_Window		maPrimary;
74 	XLIB_Window		maSecondary;
75     Colormap        maColormap;
76 	SalClipRegion	maClipRegion;
77 	sal_Bool			mbVisible;
78 
79 	static VCL_DLLPUBLIC long Dispatch( XEvent* pEvent );
80     static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
81 
82     X11SalObject();
83     virtual ~X11SalObject();
84 
85     // overload all pure virtual methods
86  	virtual void					ResetClipRegion();
87 	virtual sal_uInt16					GetClipRegionType();
88 	virtual void					BeginSetClipRegion( sal_uIntPtr nRects );
89 	virtual void					UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
90 	virtual void					EndSetClipRegion();
91 
92 	virtual void					SetPosSize( long nX, long nY, long nWidth, long nHeight );
93 	virtual void					Show( sal_Bool bVisible );
94 	virtual void					Enable( sal_Bool nEnable );
95 	virtual void					GrabFocus();
96 
97 	virtual void					SetBackground();
98 	virtual void					SetBackground( SalColor nSalColor );
99 
100 	virtual const SystemEnvData*	GetSystemData() const;
101 
102     virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
103 };
104 
105 #endif // _SV_SALOBJ_H
106