16 namespace KWinInternal
19 Bridge::Bridge( Client* cl )
28 #define BRIDGE_HELPER( rettype, prototype, args1, args2, cst ) \
29 rettype Bridge::prototype ( args1 ) cst \
31 return c->prototype( args2 ); \
34 BRIDGE_HELPER(
bool, isActive,,,
const )
35 BRIDGE_HELPER(
bool, isCloseable,,, const )
36 BRIDGE_HELPER(
bool, isMaximizable,,, const )
37 BRIDGE_HELPER( Bridge::MaximizeMode, maximizeMode,,, const )
38 BRIDGE_HELPER(
bool, isMinimizable,,, const )
39 BRIDGE_HELPER(
bool, providesContextHelp,,, const )
40 BRIDGE_HELPER(
int, desktop,,, const )
41 BRIDGE_HELPER(
bool, isModal,,, const )
42 BRIDGE_HELPER(
bool, isShadeable,,, const )
43 BRIDGE_HELPER(
bool, isShade,,, const )
44 BRIDGE_HELPER(
bool, keepAbove,,, const )
45 BRIDGE_HELPER(
bool, keepBelow,,, const )
46 BRIDGE_HELPER(
bool, isMovable,,, const )
47 BRIDGE_HELPER(
bool, isResizable,,, const )
48 BRIDGE_HELPER( TQString, caption,,, const )
49 BRIDGE_HELPER(
void, processMousePressEvent, TQMouseEvent* e, e, )
50 BRIDGE_HELPER( TQRect, geometry,,, const )
51 BRIDGE_HELPER(
void, closeWindow,,, )
52 BRIDGE_HELPER(
void, maximize, MaximizeMode m, m, )
53 BRIDGE_HELPER(
void, minimize,,, )
54 BRIDGE_HELPER(
void, showContextHelp,,, )
55 BRIDGE_HELPER(
void, setDesktop,
int desktop, desktop, )
57 void Bridge::setKeepAbove(
bool set )
59 if( c->keepAbove() != set )
60 c->workspace()->performWindowOperation( c, KeepAboveOp );
63 void Bridge::setKeepBelow(
bool set )
65 if( c->keepBelow() != set )
66 c->workspace()->performWindowOperation( c, KeepBelowOp );
69 NET::WindowType Bridge::windowType(
unsigned long supported_types )
const
71 return c->windowType(
false, supported_types );
74 TQIconSet Bridge::icon()
const
76 return TQIconSet( c->miniIcon(), c->icon());
79 bool Bridge::isSetShade()
const
81 return c->shadeMode() != ShadeNone;
84 void Bridge::showWindowMenu( TQPoint p )
86 c->workspace()->showWindowMenu( p, c );
89 void Bridge::showWindowMenu(
const TQRect &p )
91 c->workspace()->showWindowMenu( p, c );
94 void Bridge::performWindowOperation( WindowOperation op )
96 c->workspace()->performWindowOperation( c, op );
99 void Bridge::setMask(
const TQRegion& r,
int mode )
101 c->setMask( r, mode );
104 bool Bridge::isPreview()
const
109 TQRect Bridge::iconGeometry()
const
111 NETRect r = c->info->iconGeometry();
112 return TQRect( r.pos.x, r.pos.y, r.size.width, r.size.height );
115 TQWidget* Bridge::workspaceWidget()
const
117 return c->workspace()->desktopWidget();
120 WId Bridge::windowId()
const
125 void Bridge::titlebarDblClickOperation()
127 c->workspace()->performWindowOperation( c, options->operationTitlebarDblClick());
130 void Bridge::titlebarMouseWheelOperation(
int delta )
132 c->performMouseCommand( options->operationTitlebarMouseWheel( delta ), TQCursor::pos());
135 void Bridge::setShade(
bool set )
137 c->setShade( set ? ShadeNormal : ShadeNone );
140 int Bridge::currentDesktop()
const
142 return c->workspace()->currentDesktop();
145 TQWidget* Bridge::initialParentWidget()
const
150 TQt::WFlags Bridge::initialWFlags()
const
155 void Bridge::helperShowHide(
bool show )
163 TQRegion Bridge::unobscuredRegion(
const TQRegion& r )
const
166 const ClientList stacking_order = c->workspace()->stackingOrder();
167 ClientList::ConstIterator it = stacking_order.find( c );
170 it != stacking_order.end();
173 if( !(*it)->isShown(
true ))
175 if( c->isOnAllDesktops())
177 if( !(*it)->isOnCurrentDesktop())
182 if( !(*it)->isOnDesktop( c->desktop()))
188 int dx = (*it)->x() - c->x();
189 int dy = (*it)->y() - c->y();
190 TQRegion creg = (*it)->mask();
191 creg.translate(dx, dy);
202 void Bridge::grabXServer(
bool grab )
205 KWinInternal::grabXServer();
207 KWinInternal::ungrabXServer();