xref: /AOO41X/main/vcl/inc/unx/salobj.h (revision 24f6443dc28f6479acd9115159f263e09548a0af)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SV_SALOBJ_H
25 #define _SV_SALOBJ_H
26 
27 #include <vcl/sv.h>
28 #include <vcl/sysdata.hxx>
29 
30 #include <vclpluginapi.h>
31 #include <salobj.hxx>
32 
33 class SalClipRegion
34 {
35 
36 public:
37 
38                 SalClipRegion();
39                ~SalClipRegion();
40 
41     void        BeginSetClipRegion( sal_uIntPtr nRects );
42     void        UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
43 
EndSetClipRegion()44     XRectangle *EndSetClipRegion()  {
45         return ClipRectangleList;   }
ResetClipRegion()46     void        ResetClipRegion()   {
47         numClipRectangles = 0;      }
GetClipRegionType()48     sal_uInt16      GetClipRegionType() {
49         return nClipRegionType;     }
SetClipRegionType(sal_uInt16 nType)50     void        SetClipRegionType( sal_uInt16 nType ) {
51         nClipRegionType = nType;    }
GetRectangleCount()52     int         GetRectangleCount() {
53         return numClipRectangles;   }
54 
55 private:
56 
57     XRectangle* ClipRectangleList;
58     int         numClipRectangles;
59     int         maxClipRectangles;
60     sal_uInt16      nClipRegionType;
61 };
62 
63 
64 class VCLPLUG_GEN_PUBLIC X11SalObject : public SalObject
65 {
66 public:
67     SystemChildData maSystemChildData;
68     SalFrame*       mpParent;
69     XLIB_Window     maPrimary;
70     XLIB_Window     maSecondary;
71     Colormap        maColormap;
72     SalClipRegion   maClipRegion;
73     sal_Bool            mbVisible;
74 
75     static VCL_DLLPUBLIC long Dispatch( XEvent* pEvent );
76     static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
77 
78     X11SalObject();
79     virtual ~X11SalObject();
80 
81     // overload all pure virtual methods
82     virtual void                    ResetClipRegion();
83     virtual sal_uInt16                  GetClipRegionType();
84     virtual void                    BeginSetClipRegion( sal_uIntPtr nRects );
85     virtual void                    UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
86     virtual void                    EndSetClipRegion();
87 
88     virtual void                    SetPosSize( long nX, long nY, long nWidth, long nHeight );
89     virtual void                    Show( sal_Bool bVisible );
90     virtual void                    Enable( sal_Bool nEnable );
91     virtual void                    GrabFocus();
92 
93     virtual void                    SetBackground();
94     virtual void                    SetBackground( SalColor nSalColor );
95 
96     virtual const SystemEnvData*    GetSystemData() const;
97 
98     virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
99 };
100 
101 #endif // _SV_SALOBJ_H
102