Created V0.3.x branch and moved the head into the trunk directory.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@246 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2007-11-15 03:18:48 +00:00
commit 935745a08e
1318 changed files with 348809 additions and 0 deletions

View file

@ -0,0 +1,90 @@
/********************************************************************************************************
* PROGRAM : childform
* DATE - TIME : Samstag 30 Dezember 2006 - 12h04
* AUTHOR : ( )
* FILENAME : QSkinMainWindow.h
* LICENSE :
* COMMENTARY :
********************************************************************************************************/
#ifndef QSkinObject_H
#define QSkinObject_H
#include "qskinwidgetresizehandler.h"
#include <QtCore>
#include <QObject>
#include <QApplication>
#include <QWidget>
#include <QMouseEvent>
#include <QDesktopWidget>
#include <QBitmap>
#include <QEvent>
#include <QPainter>
#include <QPixmap>
#include <QSettings>
#include <QBasicTimer>
#ifdef WIN32
#define _WIN32_WINNT 0x0500
#define WINVER 0x0500
#include <windows.h>
#endif
class QSkinWidgetResizeHandler;
class QSkinObject : public QObject
{
Q_OBJECT
friend class QSkinWidgetResizeHandler;
public:
QSkinObject(QWidget* wgtParent);
~QSkinObject(){}
void setSkinPath(const QString & skinpath);
QString getSkinPath();
int customFrameWidth();
public slots:
void updateStyle();
void updateButtons();
void startSkinning();
void stopSkinning();
protected:
bool eventFilter(QObject *o, QEvent *e);
//Events to filter
//void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
//void mouseReleaseEvent(QMouseEvent *mouseEvent);
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *e);
//void closeEvent(QCloseEvent *e);
void loadSkinIni();
void manageRegions();
QPixmap drawCtrl(QWidget * widget);
QRegion childRegion;
void timerEvent ( QTimerEvent * event );
private:
QRect saveRect;
QRect skinGeometry;
QPixmap widgetMask;//the pixmap, in which the ready frame is stored on pressed?
QString skinPath;
QFont titleFont;
QColor titleColor;
bool milchglas;
bool gotMousePress;
QRegion quitButton;
QRegion maxButton;
QRegion minButton;
QRect contentsRect;
QSkinWidgetResizeHandler * resizeHandler;
bool mousePress;
QBasicTimer *skinTimer;
QWidget *skinWidget;
void fastbluralpha(QImage &img, int radius);
Qt::WindowFlags flags;
int wlong;
#ifdef WIN32
public slots:
void setLayered();
void updateAlpha();
private:
double alpha;
#endif
};
#endif

View file

@ -0,0 +1,115 @@
/****************************************************************
* RShare is distributed under the following license:
*
* Copyright (C) 2006, The RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef QSKINWIDGETRESIZEHANDLER_P_H
#define QSKINWIDGETRESIZEHANDLER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. This header file may
// change from version to version without notice, or even be
// removed.
//
// We mean it.
//
#include <QObject>
#include <QPoint>
#include "qskinobject.h"
class QSkinObject;
class QMouseEvent;
class QKeyEvent;
class QSkinWidgetResizeHandler : public QObject
{
Q_OBJECT
friend class QSkinObject;
public:
enum Action {
Move = 0x01,
Resize = 0x02,
Any = Move|Resize
};
explicit QSkinWidgetResizeHandler(QSkinObject * skobj, QWidget *parent, QWidget *cw = 0);
void setActive(bool b) { setActive(Any, b); }
void setActive(Action ac, bool b);
bool isActive() const { return isActive(Any); }
bool isActive(Action ac) const;
void setMovingEnabled(bool b) { movingEnabled = b; }
bool isMovingEnabled() const { return movingEnabled; }
bool isButtonDown() const { return buttonDown; }
void setExtraHeight(int h) { extrahei = h; }
void setSizeProtection(bool b) { sizeprotect = b; }
void setFrameWidth(int w) { fw = w; }
void doResize();
void doMove();
Q_SIGNALS:
void activate();
protected:
bool eventFilter(QObject *o, QEvent *e);
void mouseMoveEvent(QMouseEvent *e);
void keyPressEvent(QKeyEvent *e);
private:
Q_DISABLE_COPY(QSkinWidgetResizeHandler)
QSkinObject *obj;
enum MousePosition {
Nowhere,
TopLeft, BottomRight, BottomLeft, TopRight,
Top, Bottom, Left, Right,
Center
};
QWidget *widget;
QWidget *childWidget;
QPoint moveOffset;
QPoint invertedMoveOffset;
MousePosition mode;
int fw;
int extrahei;
int range;
uint buttonDown :1;
uint moveResizeMode :1;
uint activeForResize :1;
uint sizeprotect :1;
uint movingEnabled :1;
uint activeForMove :1;
uint widgetType;
void setMouseCursor(MousePosition m);
bool isMove() const {
return moveResizeMode && mode == Center;
}
bool isResize() const {
return moveResizeMode && !isMove();
}
};
#endif // QSkinWidgetResizeHandler_P_H