summaryrefslogtreecommitdiff
path: root/library
authorzecke <zecke>2004-10-16 00:01:01 (UTC)
committer zecke <zecke>2004-10-16 00:01:01 (UTC)
commitdf14f647ff1a60ca82e0fa9bd91458be146153b8 (patch) (side-by-side diff)
tree4859961352851a4392e1442f2080c15bff8ad7bc /library
parent419f9710c488f56a7a117eb1529970d3371e0094 (diff)
downloadopie-df14f647ff1a60ca82e0fa9bd91458be146153b8.zip
opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.tar.gz
opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.tar.bz2
Replace QPEApplication::qpeDir() + "/ with
QPEApplication::qpeDir() + " as it is guranteed that qpeDir() will have '/' as the last charachter
Diffstat (limited to 'library') (more/less context) (show whitespace changes)
-rw-r--r--library/fontdatabase.cpp2
-rw-r--r--library/network.cpp6
-rw-r--r--library/qpedecoration_qws.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/library/fontdatabase.cpp b/library/fontdatabase.cpp
index d94e338..7934a09 100644
--- a/library/fontdatabase.cpp
+++ b/library/fontdatabase.cpp
@@ -1,251 +1,251 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qpe/qpeapplication.h>
#include "fontdatabase.h"
#include <qpe/qlibrary.h>
#include <qfontmanager_qws.h>
#include <qdir.h>
#include <stdio.h>
#include <stdlib.h>
static QString fontDir()
{
QString qtdir = getenv("QTDIR");
if ( qtdir.isEmpty() ) qtdir = "/usr/local/qt-embedded";
return qtdir+"/lib/fonts/";
}
#ifdef QT_NO_FONTDATABASE
static QString fontFamily( const QString& key )
{
int u0 = key.find('_');
int u1 = key.find('_',u0+1);
int u2 = key.find('_',u1+1);
QString family = key.left(u0);
//int pointSize = key.mid(u0+1,u1-u0-1).toInt();
//int weight = key.mid(u1+1,u2-u1-1).toInt();
//bool italic = key.mid(u2-1,1) == "i";
// #### ignores _t and _I fields
return family;
}
#endif
QValueList<FontFactory> *FontDatabase::factoryList = 0;
/*!
\class FontDatabase fontdatabase.h
\brief The FontDatabase class provides information about available fonts.
Most often you will simply want to query the database for the
available font families().
Use FontDatabase rather than QFontDatabase when you may need access
to fonts that are not normally available. For example, if the
freetype library and the Qtopia freetype plugin are installed,
TrueType fonts will be available to your application. Font renderer
plugins have greater resource requirements than system fonts so they
should be used only when necessary. You can force the loading of
font renderer plugins with loadRenderers().
\ingroup qtopiaemb
*/
/*!
Constructs a FontDatabase object.
*/
FontDatabase::FontDatabase()
#ifndef QT_NO_FONTDATABASE
: QFontDatabase()
#endif
{
if ( !factoryList )
loadRenderers();
}
/*!
Returns a list of names of all the available font families.
*/
QStringList FontDatabase::families() const
{
#ifndef QT_NO_FONTDATABASE
return QFontDatabase::families();
#else
#ifndef QWS
QStringList list;
return list;
#else
QStringList list;
QDict<void> familyDict;
QDiskFont *qdf;
for ( qdf=qt_fontmanager->diskfonts.first(); qdf!=0;
qdf=qt_fontmanager->diskfonts.next()) {
QString familyname = qdf->name;
if ( !familyDict.find( familyname ) ) {
familyDict.insert( familyname, (void *)1 );
list.append( familyname );
}
}
QDir dir(fontDir(),"*.qpf");
for (int i=0; i<(int)dir.count(); i++) {
QString familyname = fontFamily(dir[i]);
if ( !familyDict.find( familyname ) ) {
familyDict.insert( familyname, (void *)1 );
list.append( familyname );
}
}
return list;
#endif
#endif
}
#ifdef QT_NO_FONTDATABASE
/*!
Returns a list of standard fontsizes.
*/
QValueList<int> FontDatabase::standardSizes()
{
static int s[]={ 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28,
36, 48, 72, 0 };
static bool first = TRUE;
static QValueList<int> sList;
if ( first ) {
first = FALSE;
int i = 0;
while( s[i] )
sList.append( s[i++] );
}
return sList;
}
#endif
/*!
Load any font renderer plugins that are available and make the fonts
that the plugins can read available.
*/
void FontDatabase::loadRenderers()
{
#ifndef QWS
return;
#else
#ifndef QT_NO_COMPONENT
if ( !factoryList )
factoryList = new QValueList<FontFactory>;
QValueList<FontFactory>::Iterator mit;
for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) {
qt_fontmanager->factories.setAutoDelete( false );
qt_fontmanager->factories.removeRef( (*mit).factory );
qt_fontmanager->factories.setAutoDelete( true );
(*mit).interface->release();
(*mit).library->unload();
delete (*mit).library;
}
factoryList->clear();
- QString path = QPEApplication::qpeDir() + "/plugins/fontfactories";
+ QString path = QPEApplication::qpeDir() + "plugins/fontfactories";
#ifdef Q_OS_MACX
QDir dir( path, "lib*.dylib" );
#else
QDir dir( path, "lib*.so" );
#endif
if ( !dir.exists())
return;
QStringList list = dir.entryList();
QStringList::Iterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
FontFactoryInterface *iface = 0;
QLibrary *lib = new QLibrary( path + "/" + *it );
if ( lib->queryInterface( IID_FontFactory, (QUnknownInterface**)&iface ) == QS_OK ) {
FontFactory factory;
factory.library = lib;
factory.interface = iface;
factory.factory = factory.interface->fontFactory();
factoryList->append( factory );
qt_fontmanager->factories.append( factory.factory );
readFonts( factory.factory );
} else {
delete lib;
}
}
#endif
#endif
}
/*!
\internal
*/
void FontDatabase::readFonts( QFontFactory *factory )
{
#ifndef QWS
return;
#else
// Load in font definition file
QString fn = fontDir() + "fontdir";
FILE* fontdef=fopen(fn.local8Bit(),"r");
if(!fontdef) {
QCString temp=fn.local8Bit();
qWarning("Cannot find font definition file %s - is $QTDIR set correctly?",
temp.data());
return;
}
char buf[200]="";
char name[200]="";
char render[200]="";
char file[200]="";
char flags[200]="";
char isitalic[10]="";
fgets(buf,200,fontdef);
while(!feof(fontdef)) {
if ( buf[0] != '#' ) {
int weight=50;
int size=0;
flags[0]=0;
sscanf(buf,"%s %s %s %s %d %d %s",name,file,render,isitalic,&weight,&size,flags);
QString filename;
if ( file[0] != '/' )
filename = fontDir();
filename += file;
if ( QFile::exists(filename) ) {
if( factory->name() == render ) {
QDiskFont * qdf=new QDiskFont(factory,name,isitalic[0]=='y',
weight,size,flags,filename);
qt_fontmanager->diskfonts.append(qdf);
#if QT_VERSION >= 232
QFontDatabase::qwsAddDiskFont( qdf );
#endif
}
}
}
fgets(buf,200,fontdef);
}
fclose(fontdef);
#endif
}
diff --git a/library/network.cpp b/library/network.cpp
index f2a673c..0bbbec1 100644
--- a/library/network.cpp
+++ b/library/network.cpp
@@ -230,219 +230,219 @@ private:
cfg.setGroup("Properties");
if ( plugin ) {
if ( plugin->isActive(cfg) ) {
up = TRUE;
if ( firstStart )
plugin->start( cfg );
}
if ( plugin->isAvailable(cfg) )
available.append(*it);
}
}
// Try to work around unreproducible bug whereby
// the netmon applet shows wrong state.
bool reannounce = wait<0;
if ( available != pavailable || reannounce ) {
QCopEnvelope e("QPE/Network", "available(QStringList)");
e << available;
}
if ( up != wasup || reannounce ) {
QCopEnvelope("QPE/Network", up ? "up()" : "down()");
}
}
void start( const QString& file, const QString& password )
{
if ( !current.isEmpty() )
stop();
current = QString::null;
Config cfg(file, Config::File);
cfg.setGroup("Info");
QString type = cfg.readEntry("Type");
NetworkInterface* plugin = Network::loadPlugin(type);
bool started = FALSE;
if ( plugin ) {
cfg.setGroup("Properties");
if ( plugin->start(cfg,password) ) {
Network::writeProxySettings( cfg );
current = file;
wait=0;
startTimer(400);
started = TRUE;
}
}
if ( !started ) {
QCopEnvelope("QPE/Network", "failed()");
}
}
void stop()
{
bool stopped = FALSE;
if ( !current.isEmpty() ) {
Config cfg(current, Config::File);
cfg.setGroup("Info");
QString type = cfg.readEntry("Type");
NetworkInterface* plugin = Network::loadPlugin(type);
if ( plugin ) {
cfg.setGroup("Properties");
if ( plugin->stop(cfg) ) {
current = QString::null;
wait=0;
startTimer(400);
stopped = TRUE;
}
}
}
if ( !stopped ) {
QCopEnvelope("QPE/Network", "failed()");
}
}
void timerEvent(QTimerEvent*)
{
examineNetworks();
if ( wait >= 0 ) {
if ( up == !current.isNull() ) {
// done
killTimers();
if ( up ) {
startTimer(3000); // monitor link
wait = -1;
}
} else {
wait++;
if ( wait == 600 ) {
killTimers(); // forget about it after 240 s
QCopEnvelope("QPE/Network", "failed()");
up = !current.isNull();
}
}
} else if ( !up ) {
killTimers();
}
}
private:
QStringList available;
QString current;
bool up;
int wait;
};
static NetworkServer* ns=0;
/*!
\internal
*/
QString Network::serviceName(const QString& service)
{
Config cfg(service, Config::File);
cfg.setGroup("Info");
return cfg.readEntry("Name");
}
/*!
\internal
*/
QString Network::serviceType(const QString& service)
{
Config cfg(service, Config::File);
cfg.setGroup("Info");
return cfg.readEntry("Type");
}
/*!
\internal
*/
bool Network::serviceNeedsPassword(const QString& service)
{
Config cfg(service,Config::File);
cfg.setGroup("Info");
QString type = cfg.readEntry("Type");
NetworkInterface* plugin = Network::loadPlugin(type);
cfg.setGroup("Properties");
return plugin ? plugin->needPassword(cfg) : FALSE;
}
/*!
\internal
*/
bool Network::networkOnline()
{
return ns && ns->networkOnline();
}
/*!
\internal
*/
void Network::createServer(QObject* parent)
{
ns = new NetworkServer(parent);
}
/*!
\internal
*/
int Network::addStateWidgets(QWidget* parent)
{
int n=0;
QStringList l = Network::choices();
QVBoxLayout* vb = new QVBoxLayout(parent);
for (QStringList::ConstIterator it=l.begin(); it!=l.end(); ++it) {
Config cfg(*it,Config::File);
cfg.setGroup("Info");
QString type = cfg.readEntry("Type");
NetworkInterface* plugin = Network::loadPlugin(type);
cfg.setGroup("Properties");
if ( plugin ) {
QWidget* w;
if ( (w=plugin->addStateWidget(parent,cfg)) ) {
n++;
vb->addWidget(w);
}
}
}
return n;
}
static QDict<NetworkInterface> *ifaces;
/*!
\internal
*/
NetworkInterface* Network::loadPlugin(const QString& type)
{
#ifndef QT_NO_COMPONENT
if ( !ifaces ) ifaces = new QDict<NetworkInterface>;
NetworkInterface *iface = ifaces->find(type);
if ( !iface ) {
#ifdef Q_OS_MACX
- QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".dylib";
+ QString libfile = QPEApplication::qpeDir() + "plugins/network/lib" + type + ".dylib";
#else
- QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".so";
+ QString libfile = QPEApplication::qpeDir() + "plugins/network/lib" + type + ".so";
#endif
QLibrary lib(libfile);
if ( !lib.queryInterface( IID_Network, (QUnknownInterface**)&iface ) == QS_OK )
return 0;
ifaces->insert(type,iface);
QStringList langs = Global::languageList();
for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) {
QString lang = *it;
QTranslator * trans = new QTranslator(qApp);
- QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/lib"+type+".qm";
+ QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/lib"+type+".qm";
if ( trans->load( tfn ))
qApp->installTranslator( trans );
else
delete trans;
}
}
return iface;
#else
return 0;
#endif
}
#include "network.moc"
#endif // QT_NO_COP
diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp
index 7842ebd..8b02de6 100644
--- a/library/qpedecoration_qws.cpp
+++ b/library/qpedecoration_qws.cpp
@@ -347,385 +347,385 @@ static QImage *maximizeImage( int th )
int WindowDecorationInterface::metric( Metric m, const WindowData *wd ) const
{
switch ( m ) {
case TitleHeight:
if ( QApplication::desktop()->height() > 320 )
return 19;
else
return 15;
case LeftBorder:
case RightBorder:
case TopBorder:
case BottomBorder:
return 4;
case OKWidth:
return okImage(metric(TitleHeight,wd))->width();
case CloseWidth:
return closeImage(metric(TitleHeight,wd))->width();
case HelpWidth:
return helpImage(metric(TitleHeight,wd))->width();
case MaximizeWidth:
return maximizeImage(metric(TitleHeight,wd))->width();
case CornerGrabSize:
return 16;
}
return 0;
}
void WindowDecorationInterface::drawArea( Area a, QPainter *p, const WindowData *wd ) const
{
int th = metric( TitleHeight, wd );
QRect r = wd->rect;
switch ( a ) {
case Border:
{
const QColorGroup &cg = wd->palette.active();
qDrawWinPanel(p, r.x()-metric(LeftBorder,wd),
r.y()-th-metric(TopBorder,wd),
r.width()+metric(LeftBorder,wd)+metric(RightBorder,wd),
r.height()+th+metric(TopBorder,wd)+metric(BottomBorder,wd),
cg, FALSE, &cg.brush(QColorGroup::Background));
}
break;
case Title:
{
const QColorGroup &cg = wd->palette.active();
QBrush titleBrush;
QPen titleLines;
if ( wd->flags & WindowData::Active ) {
titleBrush = cg.brush(QColorGroup::Highlight);
titleLines = titleBrush.color().dark();
} else {
titleBrush = cg.brush(QColorGroup::Background);
titleLines = titleBrush.color();
}
p->fillRect( r.x(), r.y()-th, r.width(), th, titleBrush);
p->setPen( titleLines );
for ( int i = r.y()-th; i < r.y(); i += 2 )
p->drawLine( r.left(), i, r.right(), i );
}
break;
case TitleText:
p->drawText( r.x()+3+metric(HelpWidth,wd), r.top()-th,
r.width()-metric(OKWidth,wd)-metric(CloseWidth,wd),
th, QPainter::AlignVCenter, wd->caption);
break;
}
}
void WindowDecorationInterface::drawButton( Button b, QPainter *p, const WindowData *wd, int x, int y, int, int, QWSButton::State state ) const
{
QImage *img = 0;
switch ( b ) {
case OK:
img = okImage(metric(TitleHeight,wd));
break;
case Close:
img = closeImage(metric(TitleHeight,wd));
break;
case Help:
img = helpImage(metric(TitleHeight,wd));
break;
case Maximize:
img = maximizeImage(metric(TitleHeight,wd));
break;
}
if ( img ) {
if ((state & QWSButton::MouseOver) && (state & QWSButton::Clicked))
p->drawImage(x+2, y+2, *img);
else
p->drawImage(x+1, y+1, *img);
}
}
QRegion WindowDecorationInterface::mask( const WindowData *wd ) const
{
int th = metric(TitleHeight,wd);
QRect rect( wd->rect );
QRect r(rect.left() - metric(LeftBorder,wd),
rect.top() - th - metric(TopBorder,wd),
rect.width() + metric(LeftBorder,wd) + metric(RightBorder,wd),
rect.height() + th + metric(TopBorder,wd) + metric(BottomBorder,wd));
return QRegion(r) - rect;
}
class DefaultWindowDecoration : public WindowDecorationInterface
{
public:
DefaultWindowDecoration(){}
QString name() const {
return qApp->translate("WindowDecoration", "Default",
"List box text for default window decoration");
}
QPixmap icon() const {
return QPixmap();
}
QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
*iface = 0;
if ( uuid == IID_QUnknown )
*iface = this;
else if ( uuid == IID_WindowDecoration )
*iface = this;
else
return QS_FALSE;
if ( *iface )
(*iface)->addRef();
return QS_OK;
}
Q_REFCOUNT
};
static WindowDecorationInterface *wdiface = 0;
static QLibrary* wdlib = 0;
static QString libname;
//===========================================================================
bool QPEDecoration::helpExists() const
{
if ( helpFile.isNull() ) {
QStringList helpPath = Global::helpPath();
QString hf = QString(qApp->argv()[0]) + ".html";
bool he = FALSE;
for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !he; ++it)
he = QFile::exists( *it + "/" + hf );
((QPEDecoration*)this)->helpFile = hf;
((QPEDecoration*)this)->helpexists = he;
return he;
}
return helpexists;
}
QPEDecoration::QPEDecoration()
: QWSDefaultDecoration()
{
if ( wdlib ) {
delete wdlib;
wdlib = 0;
} else {
delete wdiface;
}
wdiface = new DefaultWindowDecoration;
helpexists = FALSE; // We don't know (flagged by helpFile being null)
qpeManager = new QPEManager( this );
imageOk = Resource::loadImage( "OKButton" );
imageClose = Resource::loadImage( "CloseButton" );
imageHelp = Resource::loadImage( "HelpButton" );
}
QPEDecoration::QPEDecoration( const QString &plugin )
: QWSDefaultDecoration()
{
libname = plugin;
if ( wdlib ) {
wdiface->release();
wdlib->unload();
delete wdlib;
wdlib = 0;
} else {
delete wdiface;
}
WindowDecorationInterface *iface = 0;
- QString path = QPEApplication::qpeDir() + "/plugins/decorations/";
+ QString path = QPEApplication::qpeDir() + "plugins/decorations/";
#ifdef Q_OS_MACX
if ( plugin.find( ".dylib" ) > 0 ) {
#else
if ( plugin.find( ".so" ) > 0 ) {
#endif
// full library name supplied
path += plugin;
} else {
#ifdef Q_OS_MACX
path += "lib" + plugin.lower() + ".dylib"; // compatibility
#else
path += "lib" + plugin.lower() + ".so"; // compatibility
#endif
}
QLibrary *lib = new QLibrary( path );
if ( lib->queryInterface( IID_WindowDecoration, (QUnknownInterface**)&iface ) == QS_OK && iface ) {
wdiface = iface;
wdlib = lib;
} else {
delete lib;
wdiface = new DefaultWindowDecoration;
}
helpexists = FALSE; // We don't know (flagged by helpFile being null)
qpeManager = new QPEManager( this );
}
QPEDecoration::~QPEDecoration()
{
delete qpeManager;
}
const char **QPEDecoration::menuPixmap()
{
return (const char **)0;
}
const char **QPEDecoration::closePixmap()
{
return (const char **)qpe_close_xpm;
}
const char **QPEDecoration::minimizePixmap()
{
return (const char **)qpe_accept_xpm;
}
const char **QPEDecoration::maximizePixmap()
{
return (const char **)0;
}
const char **QPEDecoration::normalizePixmap()
{
return (const char **)0;
}
int QPEDecoration::getTitleHeight( const QWidget *w )
{
WindowDecorationInterface::WindowData wd;
windowData( w, wd );
return wdiface->metric(WindowDecorationInterface::TitleHeight,&wd);
}
/*
If rect is empty, no frame is added. (a hack, really)
*/
QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecoration::Region type)
{
qpeManager->updateActive();
WindowDecorationInterface::WindowData wd;
windowData( widget, wd );
wd.rect = rect;
int titleHeight = wdiface->metric(WindowDecorationInterface::TitleHeight,&wd);
int okWidth = wdiface->metric(WindowDecorationInterface::OKWidth,&wd);
int closeWidth = wdiface->metric(WindowDecorationInterface::CloseWidth,&wd);
int helpWidth = wdiface->metric(WindowDecorationInterface::HelpWidth,&wd);
int grab = wdiface->metric(WindowDecorationInterface::CornerGrabSize,&wd);
QRegion region;
switch ((int)type) {
case Menu:
break;
case Maximize:
if ( !widget->inherits( "QDialog" ) && qApp->desktop()->width() > 350 ) {
int maximizeWidth = wdiface->metric(WindowDecorationInterface::MaximizeWidth,&wd);
int left = rect.right() - maximizeWidth - closeWidth;
if ( ((DecorHackWidget *)widget)->needsOk() )
left -= okWidth;
QRect r(left, rect.top() - titleHeight, closeWidth, titleHeight);
region = r;
}
break;
case Minimize:
if ( ((DecorHackWidget *)widget)->needsOk() ) {
QRect r(rect.right() - okWidth,
rect.top() - titleHeight, okWidth, titleHeight);
if (r.left() > rect.left() + titleHeight)
region = r;
}
break;
case Close:
{
int left = rect.right() - closeWidth;
if ( ((DecorHackWidget *)widget)->needsOk() )
left -= okWidth;
QRect r(left, rect.top() - titleHeight, closeWidth, titleHeight);
region = r;
}
break;
case Title:
if ( !widget->isMaximized() ) {
int width = rect.width() - helpWidth - closeWidth;
if ( ((DecorHackWidget *)widget)->needsOk() )
width -= okWidth;
QRect r(rect.left()+helpWidth, rect.top() - titleHeight,
width, titleHeight);
if (r.width() > 0)
region = r;
}
break;
case Help:
if ( helpExists() || widget->testWFlags(Qt::WStyle_ContextHelp) ) {
QRect r(rect.left(), rect.top() - titleHeight,
helpWidth, titleHeight);
region = r;
}
break;
case Top:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
int b = wdiface->metric(WindowDecorationInterface::TopBorder,&wd);
region = m & QRect( br.left()+grab, br.top(),
br.width()-2*grab, b );
}
break;
case Left:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
int b = wdiface->metric(WindowDecorationInterface::LeftBorder,&wd);
region = m & QRect( br.left(), br.top()+grab,
b, br.height()-2*grab );
}
break;
case Right:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
int b = wdiface->metric(WindowDecorationInterface::RightBorder,&wd);
region = m & QRect( rect.right(), br.top()+grab,
b, br.height()-2*grab );
}
break;
case Bottom:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
int b = wdiface->metric(WindowDecorationInterface::BottomBorder,&wd);
region = m & QRect( br.left()+grab, rect.bottom(),
br.width()-2*grab, b );
}
break;
case TopLeft:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
int tb = wdiface->metric(WindowDecorationInterface::TopBorder,&wd);
int lb = wdiface->metric(WindowDecorationInterface::LeftBorder,&wd);
QRegion crgn( br.left(), br.top(), grab, tb );
crgn |= QRect( br.left(), br.top(), lb, grab );
region = m & crgn;
}
break;
case TopRight:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
int tb = wdiface->metric(WindowDecorationInterface::TopBorder,&wd);
int rb = wdiface->metric(WindowDecorationInterface::RightBorder,&wd);
QRegion crgn( br.right()-grab, br.top(), grab, tb );
crgn |= QRect( br.right()-rb, br.top(), rb, grab );
region = m & crgn;
}