TQt4 port kde-style-qtcurve

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kde-style-qtcurve@1230744 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent b23b8edce7
commit d1fb90134a

@ -40,7 +40,8 @@ else (NOT QTC_QT_ONLY)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
include(QtCurveQt3)
if (QT_PLUGINS_DIR MATCHES NOTFOUND)
message(SEND_ERROR "ERROR: Failed to detemine Qt3 plugins folder. Please pass -DQT_PLUGINS_DIR=<folder> to cmake")
MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4")
SET(QT_INCLUDE_DIR "/usr/include/qt4")
endif (QT_PLUGINS_DIR MATCHES NOTFOUND)
endif (NOT QTC_QT_ONLY)
@ -50,6 +51,15 @@ exec_program(kde-config
OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX)
endif (NOT QTC_QT_ONLY)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT")
# NASTY HACK TO FORCE COMPILATION
# REMOVE WHEN FIXED
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/opt/trinity/include")
SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt" CACHE FILEPATH "")
SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc" CACHE FILEPATH "")
exec_program(kde-config
ARGS --install locale --expandvars
OUTPUT_VARIABLE KDE3_LOCALE_PREFIX)

@ -1,6 +1,6 @@
/*
This file is taken from kcolorspaces.cpp and kcolorutils.cpp from kdelibs
The code has been modified to work with QColor (Qt3 &Qt4) and GdkColor
The code has been modified to work with TQColor (TQt3 &TQt4) and GdkColor
*/
/* This file is part of the KDE project
@ -26,12 +26,12 @@ The code has been modified to work with QColor (Qt3 &Qt4) and GdkColor
#include <math.h>
#ifdef __cplusplus
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
#define FLOAT_COLOR(VAL, COL) (VAL).COL##F()
#define TO_COLOR(R, G, B) QColor::fromRgbF(R, G, B)
#define TO_COLOR(R, G, B) TQColor::fromRgbF(R, G, B)
#else
#define FLOAT_COLOR(VAL, COL) ((double)(((VAL).COL()*1.0)/255.0))
#define TO_COLOR(R, G, B) QColor(limit(R*255.0), limit(G*255.0), limit(B*255.0))
#define TO_COLOR(R, G, B) TQColor(limit(R*255.0), limit(G*255.0), limit(B*255.0))
#endif
#else
#define inline
@ -67,7 +67,7 @@ static inline double ColorUtils_wrap(double a)
static const double yc[3] = { 0.299, 0.587, 0.114 };
#elif HCY_REC == 709
static const double yc[3] = {0.2126, 0.7152, 0.0722};
#else // use Qt values
#else // use TQt values
static const double yc[3] = { 0.34375, 0.5, 0.15625 };
#endif

@ -2,7 +2,7 @@
#define __COMMON_H__
/*
QtCurve (C) Craig Drummond, 2003 - 2010 craig.p.drummond@gmail.com
TQtCurve (C) Craig Drummond, 2003 - 2010 craig.p.drummond@gmail.com
----
@ -22,14 +22,14 @@
*/
/* This file is quite 'hacky' as it contains lots of static function definitions - but I want to share the code
between Qt and Gtk, but not polute the namespace with exported functions... */
between TQt and Gtk, but not polute the namespace with exported functions... */
#include <string.h>
#include <stdarg.h>
#include <math.h>
#include "config.h"
#if defined _WIN32 && defined QT_VERSION && (QT_VERSION >= 0x040000)
#if defined _WIN32 && (0x039999 >= 0x040000)
#include <sys/stat.h>
#include <float.h>
#include <direct.h>
@ -66,28 +66,28 @@ typedef enum
} EShading;
#ifdef __cplusplus
#include <qconfig.h>
#include <tqconfig.h>
#ifdef CONFIG_DIALOG
#include <qapplication.h>
#include <tqapplication.h>
#endif
#include <map>
#include <set>
#if !defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION >= 0x040000)
#include <QtCore/QString>
#if !defined CONFIG_DIALOG && (0x039999 >= 0x040000)
#include <TQtCore/TQString>
#endif
#else
#include <glib.h>
#endif
#ifdef __cplusplus
#include <qpixmap.h>
typedef QColor color;
#include <tqpixmap.h>
typedef TQColor color;
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#include <QtCore/QSet>
typedef QSet<QString> Strings;
#if (0x039999 >= 0x040000)
#include <TQtCore/TQSet>
typedef TQSet<TQString> Strings;
#else
typedef QStringList Strings;
typedef TQStringList Strings;
#endif
#else
@ -182,14 +182,14 @@ enum
#define SUNKEN_BEVEL_DARK_ALPHA(X) (X.value()/800.0) // 0.25
#define SUNKEN_BEVEL_LIGHT_ALPHA(X) (X.value()/500.0) // 0.40
#define MENU_SIZE_ATOM "_QTCURVE_MENUBAR_SIZE_"
#define STATUSBAR_ATOM "_QTCURVE_STATUSBAR_"
#define TITLEBAR_SIZE_ATOM "_QTCURVE_TITLEBAR_SIZE_"
#define ACTIVE_WINDOW_ATOM "_QTCURVE_ACTIVE_WINDOW_"
#define TOGGLE_MENUBAR_ATOM "_QTCURVE_TOGGLE_MENUBAR_"
#define TOGGLE_STATUSBAR_ATOM "_QTCURVE_TOGGLE_STATUSBAR_"
#define OPACITY_ATOM "_QTCURVE_OPACITY_"
#define BGND_ATOM "_QTCURVE_BGND_"
#define MENU_SIZE_ATOM "_TQTCURVE_MENUBAR_SIZE_"
#define STATUSBAR_ATOM "_TQTCURVE_STATUSBAR_"
#define TITLEBAR_SIZE_ATOM "_TQTCURVE_TITLEBAR_SIZE_"
#define ACTIVE_WINDOW_ATOM "_TQTCURVE_ACTIVE_WINDOW_"
#define TOGGLE_MENUBAR_ATOM "_TQTCURVE_TOGGLE_MENUBAR_"
#define TOGGLE_STATUSBAR_ATOM "_TQTCURVE_TOGGLE_STATUSBAR_"
#define OPACITY_ATOM "_TQTCURVE_OPACITY_"
#define BGND_ATOM "_TQTCURVE_BGND_"
#define BLEND_TITLEBAR (opts.menubarAppearance==opts.titlebarAppearance && opts.menubarAppearance==opts.inactiveTitlebarAppearance && \
!(opts.windowBorder&WINDOW_BORDER_BLEND_TITLEBAR) && SHADE_WINDOW_BORDER==opts.shadeMenubars && opts.windowDrag)
@ -372,19 +372,19 @@ enum
#define FULLLY_ROUNDED (opts.round>=ROUND_FULL)
#define DO_EFFECT (EFFECT_NONE!=opts.buttonEffect)
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || ( (0x039999 >= 0x040000))
#define SLIDER_GLOW (DO_EFFECT && MO_GLOW==opts.coloredMouseOver /*&& SLIDER_TRIANGULAR!=opts.sliderStyle*/ ? 2 : 0)
#endif
#define ENTRY_MO (opts.unifyCombo && opts.unifySpin)
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || ( (0x039999 >= 0x040000))
#define FOCUS_ALPHA 0.08
#define FOCUS_GLOW_LINE_ALPHA 0.5
#define BORDER_BLEND_ALPHA 0.7
#define ETCH_TOP_ALPHA 0.055
#define ETCH_BOTTOM_ALPHA 0.1
// #if defined QT_VERSION && (QT_VERSION >= 0x040000)
// #if (0x039999 >= 0x040000)
// #define ETCH_RADIO_TOP_ALPHA 0.055
// #define ETCH_RADIO_BOTTOM_ALPHA 0.80
// #else
@ -394,15 +394,15 @@ enum
#define RINGS_INNER_ALPHA(T) qtcRingAlpha[IMG_PLAIN_RINGS==(T) ? 1 : 0] //(IMG_PLAIN_RINGS==opts.bgndImage.type ? 0.25 : 0.125)
#define RINGS_OUTER_ALPHA qtcRingAlpha[2] //0.5
#define RINGS_WIDTH(T) (IMG_SQUARE_RINGS==T ? 260 : 450)
#define RINGS_HEIGHT(T) (IMG_SQUARE_RINGS==T ? 220 : 360)
#define RINGS_WIDTH(T) (IMG_STQUARE_RINGS==T ? 260 : 450)
#define RINGS_HEIGHT(T) (IMG_STQUARE_RINGS==T ? 220 : 360)
#define RINGS_SQUARE_LARGE_ALPHA (RINGS_OUTER_ALPHA*0.675)
#define RINGS_SQUARE_SMALL_ALPHA (RINGS_OUTER_ALPHA*0.50)
#define RINGS_SQUARE_LINE_WIDTH 20.0
#define RINGS_SQUARE_RADIUS 18.0
#define RINGS_SQUARE_LARGE_SIZE 120.0
#define RINGS_SQUARE_SMALL_SIZE 100.0
#define RINGS_STQUARE_LARGE_ALPHA (RINGS_OUTER_ALPHA*0.675)
#define RINGS_STQUARE_SMALL_ALPHA (RINGS_OUTER_ALPHA*0.50)
#define RINGS_STQUARE_LINE_WIDTH 20.0
#define RINGS_STQUARE_RADIUS 18.0
#define RINGS_STQUARE_LARGE_SIZE 120.0
#define RINGS_STQUARE_SMALL_SIZE 100.0
#if !defined __cplusplus
#define MENU_AND_TOOLTIP_RADIUS (opts.round>=ROUND_FULL ? 5.0 : 3.5)
@ -416,48 +416,48 @@ enum
#endif
#if defined __cplusplus && defined QT_VERSION && (QT_VERSION >= 0x040000)
#if defined __cplusplus && (0x039999 >= 0x040000)
#include <qstyle.h>
#include <tqstyle.h>
typedef enum
{
QtC_Round = QStyle::PM_CustomBase,
QtC_TitleBarButtonAppearance,
QtC_TitleAlignment,
QtC_TitleBarButtons,
QtC_TitleBarIcon,
QtC_TitleBarIconColor,
QtC_TitleBarEffect,
QtC_BlendMenuAndTitleBar,
QtC_ShadeMenubarOnlyWhenActive,
QtC_ToggleButtons,
QtC_MenubarColor,
QtC_WindowBorder,
QtC_CustomBgnd,
QtC_TitleBarApp
} QtCMetrics;
#define QtC_StateKWin ((QStyle::StateFlag)0x10000000)
TQtC_Round = TQStyle::PM_CustomBase,
TQtC_TitleBarButtonAppearance,
TQtC_TitleAlignment,
TQtC_TitleBarButtons,
TQtC_TitleBarIcon,
TQtC_TitleBarIconColor,
TQtC_TitleBarEffect,
TQtC_BlendMenuAndTitleBar,
TQtC_ShadeMenubarOnlyWhenActive,
TQtC_ToggleButtons,
TQtC_MenubarColor,
TQtC_WindowBorder,
TQtC_CustomBgnd,
TQtC_TitleBarApp
} TQtCMetrics;
#define TQtC_StateKWin ((TQStyle::StateFlag)0x10000000)
// PE_FrameWindow
#define QtC_StateKWinNotFull ((QStyle::StateFlag)0x20000000)
#define TQtC_StateKWinNotFull ((TQStyle::StateFlag)0x20000000)
// CC_TitleBar
#define QtC_StateKWinFillBgnd ((QStyle::StateFlag)0x20000000)
#define QtC_StateKWinNoBorder ((QStyle::StateFlag)0x40000000)
#define QtC_StateKWinCompositing ((QStyle::StateFlag)0x80000000)
#define QtC_StateKWinTabDrag ((QStyle::StateFlag)0x00000001)
#define TQtC_StateKWinFillBgnd ((TQStyle::StateFlag)0x20000000)
#define TQtC_StateKWinNoBorder ((TQStyle::StateFlag)0x40000000)
#define TQtC_StateKWinCompositing ((TQStyle::StateFlag)0x80000000)
#define TQtC_StateKWinTabDrag ((TQStyle::StateFlag)0x00000001)
#define QtC_PE_DrawBackground ((QStyle::PrimitiveElement)(QStyle::PE_CustomBase+10000))
#define TQtC_PE_DrawBackground ((TQStyle::PrimitiveElement)(TQStyle::PE_CustomBase+10000))
#define CLOSE_COLOR QColor(191, 82, 82)
#define CLOSE_COLOR TQColor(191, 82, 82)
#define DARK_WINDOW_TEXT(A) ((A).red()<230 || (A).green()<230 || (A).blue()<230)
#define HOVER_BUTTON_ALPHA(A) (DARK_WINDOW_TEXT(A) ? 0.25 : 0.65)
#define WINDOW_TEXT_SHADOW_ALPHA(A) (EFFECT_SHADOW==(A) ? 0.10 : 0.60)
#define WINDOW_SHADOW_COLOR(A) (EFFECT_SHADOW==(A) ? Qt::black : Qt::white)
#define WINDOW_SHADOW_COLOR(A) (EFFECT_SHADOW==(A) ? TQt::black : TQt::white)
#endif
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#define QTCURVE_PREVIEW_CONFIG "QTCURVE_PREVIEW_CONFIG"
#define QTCURVE_PREVIEW_CONFIG_FULL "QTCURVE_PREVIEW_CONFIG_FULL"
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
#define TQTCURVE_PREVIEW_CONFIG "TQTCURVE_PREVIEW_CONFIG"
#define TQTCURVE_PREVIEW_CONFIG_FULL "TQTCURVE_PREVIEW_CONFIG_FULL"
typedef enum
{
@ -512,7 +512,7 @@ typedef enum
#define TBAR_VERSION_HACK 65535
#define TBAR_BORDER_VERSION_HACK (TBAR_VERSION_HACK+1000)
typedef std::map<int, QColor> TBCols;
typedef std::map<int, TQColor> TBCols;
#endif
typedef enum
@ -529,7 +529,7 @@ typedef enum
IMG_NONE,
IMG_BORDERED_RINGS,
IMG_PLAIN_RINGS,
IMG_SQUARE_RINGS,
IMG_STQUARE_RINGS,
IMG_FILE
} EImageType;
@ -538,29 +538,29 @@ typedef struct
EImageType type;
bool loaded;
#if defined __cplusplus
QString file;
QPixmap pix;
TQString file;
TQPixmap pix;
#else // __cplusplus
const char *file;
GdkPixbuf *pix;
#endif // __cplusplus
int width, height;
} QtCImage;
} TQtCImage;
typedef enum
{
SQUARE_NONE = 0x0000,
SQUARE_ENTRY = 0x0001,
SQUARE_PROGRESS = 0x0002,
SQUARE_SCROLLVIEW = 0x0004,
SQUARE_LISTVIEW_SELECTION = 0x0008,
SQUARE_FRAME = 0x0010,
SQUARE_TAB_FRAME = 0x0020,
SQUARE_SLIDER = 0x0040,
SQUARE_SB_SLIDER = 0x0080,
SQUARE_WINDOWS = 0x0100,
SQUARE_TOOLTIPS = 0x0200,
SQUARE_POPUP_MENUS = 0x0400
STQUARE_NONE = 0x0000,
STQUARE_ENTRY = 0x0001,
STQUARE_PROGRESS = 0x0002,
STQUARE_SCROLLVIEW = 0x0004,
STQUARE_LISTVIEW_SELECTION = 0x0008,
STQUARE_FRAME = 0x0010,
STQUARE_TAB_FRAME = 0x0020,
STQUARE_SLIDER = 0x0040,
STQUARE_SB_SLIDER = 0x0080,
STQUARE_WINDOWS = 0x0100,
STQUARE_TOOLTIPS = 0x0200,
STQUARE_POPUP_MENUS = 0x0400
} ESquare;
typedef enum
@ -582,7 +582,7 @@ typedef enum
{
PIX_CHECK,
#ifdef __cplusplus
#if defined QT_VERSION && (QT_VERSION < 0x040000)
#if (0x039999 < 0x040000)
PIX_RADIO_ON,
PIX_RADIO_BORDER,
PIX_RADIO_INNER,
@ -627,10 +627,10 @@ typedef enum
WIDGET_SPIN_DOWN,
WIDGET_UNCOLOURED_MO_BUTTON,
#else
WIDGET_CHECKBUTTON, // Qt4 only
WIDGET_MDI_WINDOW, // Qt4 only
WIDGET_MDI_WINDOW_TITLE, // Qt4 only
WIDGET_MDI_WINDOW_BUTTON, // Qt4 only
WIDGET_CHECKBUTTON, // TQt4 only
WIDGET_MDI_WINDOW, // TQt4 only
WIDGET_MDI_WINDOW_TITLE, // TQt4 only
WIDGET_MDI_WINDOW_BUTTON, // TQt4 only
WIDGET_DOCK_WIDGET_TITLE,
WIDGET_DIAL,
#endif
@ -640,7 +640,7 @@ typedef enum
WIDGET_SELECTION,
WIDGET_FRAME,
WIDGET_NO_ETCH_BTN,
WIDGET_MENU_BUTTON, // Qt4 only
WIDGET_MENU_BUTTON, // TQt4 only
WIDGET_FOCUS,
WIDGET_TAB_FRAME,
WIDGET_OTHER
@ -1045,7 +1045,7 @@ typedef struct
highlightTab,
roundAllTabs,
animatedProgress,
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
fixParentlessDialogs,
#endif
customMenuTextColor,
@ -1069,7 +1069,7 @@ typedef struct
*/
#endif
mapKdeIcons,
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000)) || !defined __cplusplus
gtkButtonOrder,
fadeLines,
#endif
@ -1099,10 +1099,10 @@ typedef struct
borderInactiveTab,
doubleGtkComboArrow,
menuIcons,
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
stdBtnSizes,
#endif
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
xbar,
#endif
forceAlternateLvCols,
@ -1125,10 +1125,10 @@ typedef struct
bgndOpacity,
menuBgndOpacity,
dlgOpacity;
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
int dwtSettings;
#endif
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
int titlebarButtons;
TBCols titlebarButtonColors;
ETitleBarIcon titlebarIcon;
@ -1204,23 +1204,23 @@ typedef struct
#else
Gradient *customGradient[NUM_CUSTOM_GRAD];
#endif
QtCImage bgndImage,
TQtCImage bgndImage,
menuBgndImage;
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || ( (0x039999 >= 0x040000))
/* NOTE: If add any more settings here, need to alter copyOpts/freeOpts/defaultSettings in config_file.c */
Strings noBgndGradientApps,
noBgndOpacityApps,
noMenuBgndOpacityApps,
noBgndImageApps;
#endif
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
Strings noDlgFixApps;
#endif
Strings noMenuStripeApps;
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
Strings menubarApps,
statusbarApps,
useQtFileDialogApps,
useTQtFileDialogApps,
windowDragWhiteList,
windowDragBlackList;
#endif
@ -1416,7 +1416,7 @@ inline int limit(double c)
}
#endif
#if defined QT_VERSION && (QT_VERSION >= 0x040000) && !defined QTC_QT_ONLY
#if (0x039999 >= 0x040000) && !defined TQTC_TQT_ONLY
#include <KDE/KColorUtils>
#define tint(COLA, COLB, FACTOR) KColorUtils::tint((COLA), (COLB), (FACTOR))
#define midColor(COLA, COLB) KColorUtils::mix((COLA), (COLB), 0.5)
@ -1528,7 +1528,7 @@ static void shade(const Options *opts, const color *ca, color *cb, double k)
case SHADING_HCY:
{
#define HCY_FACTOR 0.15
#if defined QT_VERSION && (QT_VERSION >= 0x040000) && !defined QTC_QT_ONLY
#if (0x039999 >= 0x040000) && !defined TQTC_TQT_ONLY
if(k>1.0)
*cb=KColorUtils::lighten(ca, (k*(1+HCY_FACTOR))-1.0, 1.0);
else
@ -1546,7 +1546,7 @@ static void shade(const Options *opts, const color *ca, color *cb, double k)
#endif
}
}
#if defined __cplusplus && defined QT_VERSION && (QT_VERSION >= 0x040000)
#if defined __cplusplus && (0x039999 >= 0x040000)
cb->setAlpha(ca.alpha());
#endif
#ifndef __cplusplus
@ -1581,7 +1581,7 @@ static void adjustPix(unsigned char *data, int numChannels, int w, int h, int st
unsigned char source=data[offset+column+1];
#if defined __cplusplus
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
#if TQ_BYTE_ORDER == TQ_BIG_ENDIAN
/* ARGB */
data[offset+column+1] = checkBounds(r-source);
data[offset+column+2] = checkBounds(g-source);
@ -1751,7 +1751,7 @@ static EAppearance widgetApp(EWidget w, const Options *opts)
#define MIN_ROUND_MAX_HEIGHT 12
#define MIN_ROUND_MAX_WIDTH 24
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || ( (0x039999 >= 0x040000))
#if defined __cplusplus
#define EXTRA_INNER_RADIUS 3.5
@ -1761,7 +1761,7 @@ static EAppearance widgetApp(EWidget w, const Options *opts)
#define FULL_OUTER_RADIUS 2.5
#define FULL_ETCH_RADIUS 3.5
#if defined QT_VERSION && (QT_VERSION < 0x040600)
#if (0x039999 < 0x040600)
#define SLIGHT_INNER_RADIUS 0.5
#define SLIGHT_OUTER_RADIUS 1.5
#define SLIGHT_ETCH_RADIUS 2.5
@ -1819,14 +1819,14 @@ ERound getWidgetRound(const Options *opts, int w, int h, EWidget widget)
{
ERound r=opts->round;
if( ((WIDGET_PBAR_TROUGH==widget || WIDGET_PROGRESSBAR==widget) && (opts->square&SQUARE_PROGRESS)) ||
(WIDGET_ENTRY==widget && (opts->square&SQUARE_ENTRY)) )
if( ((WIDGET_PBAR_TROUGH==widget || WIDGET_PROGRESSBAR==widget) && (opts->square&STQUARE_PROGRESS)) ||
(WIDGET_ENTRY==widget && (opts->square&STQUARE_ENTRY)) )
return ROUND_NONE;
if((WIDGET_CHECKBOX==widget || WIDGET_FOCUS==widget) && ROUND_NONE!=r)
r=ROUND_SLIGHT;
#if defined __cplusplus && (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined __cplusplus && ( (0x039999 >= 0x040000))
if((WIDGET_MDI_WINDOW_BUTTON==widget && (opts->titlebarButtons&TITLEBAR_BUTTON_ROUND)) ||
WIDGET_RADIO_BUTTON==widget || WIDGET_DIAL==widget)
return ROUND_MAX;
@ -1836,7 +1836,7 @@ ERound getWidgetRound(const Options *opts, int w, int h, EWidget widget)
return ROUND_MAX;
#endif
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || ( (0x039999 >= 0x040000))
if(WIDGET_SLIDER==widget &&
(SLIDER_ROUND==opts->sliderStyle || SLIDER_ROUND_ROTATED==opts->sliderStyle || SLIDER_CIRCULAR==opts->sliderStyle))
return ROUND_MAX;
@ -1870,11 +1870,11 @@ static double getRadius(const Options *opts, int w, int h, EWidget widget, ERadi
if((WIDGET_CHECKBOX==widget || WIDGET_FOCUS==widget) && ROUND_NONE!=r)
r=ROUND_SLIGHT;
if( ((WIDGET_PBAR_TROUGH==widget || WIDGET_PROGRESSBAR==widget) && (opts->square&SQUARE_PROGRESS)) ||
(WIDGET_ENTRY==widget && (opts->square&SQUARE_ENTRY)) )
if( ((WIDGET_PBAR_TROUGH==widget || WIDGET_PROGRESSBAR==widget) && (opts->square&STQUARE_PROGRESS)) ||
(WIDGET_ENTRY==widget && (opts->square&STQUARE_ENTRY)) )
return 0.0;
#if defined __cplusplus && (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined __cplusplus && ( (0x039999 >= 0x040000))
if((WIDGET_MDI_WINDOW_BUTTON==widget && (opts->titlebarButtons&TITLEBAR_BUTTON_ROUND)) ||
WIDGET_RADIO_BUTTON==widget || WIDGET_DIAL==widget)
return (w>h ? h : w)/2.0;
@ -1884,7 +1884,7 @@ static double getRadius(const Options *opts, int w, int h, EWidget widget, ERadi
return (w>h ? h : w)/2.0;
#endif
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || ( (0x039999 >= 0x040000))
if(WIDGET_SLIDER==widget &&
(SLIDER_ROUND==opts->sliderStyle || SLIDER_ROUND_ROTATED==opts->sliderStyle || SLIDER_CIRCULAR==opts->sliderStyle))
return (w>h ? h : w)/2.0;

@ -1,5 +1,5 @@
/*
QtCurve (C) Craig Drummond, 2003 - 2010 craig.p.drummond@gmail.com
TQtCurve (C) Craig Drummond, 2003 - 2010 craig.p.drummond@gmail.com
----
@ -43,17 +43,17 @@
#ifdef __cplusplus
#if QT_VERSION >= 0x040000
#include <QMap>
#include <QFile>
#include <QTextStream>
#if 0x039999 >= 0x040000
#include <TQMap>
#include <TQFile>
#include <TQTextStream>
#define TO_LATIN1(A) A.toLatin1().constData()
#else
#define TO_LATIN1(A) A.latin1()
#include <qmap.h>
#include <qfile.h>
#include <qtextstream.h>
#include <tqmap.h>
#include <tqfile.h>
#include <tqtextstream.h>
#endif
#endif // __cplusplus
@ -181,7 +181,7 @@ static EAppearance toAppearance(const char *str, EAppearance def, EAppAllow allo
if(0==memcmp(str, "glass", 5) || 0==memcmp(str, "shinyglass", 10))
return APPEARANCE_SHINY_GLASS;
if(0==memcmp(str, "agua", 4))
#if defined __cplusplus && !defined CONFIG_DIALOG && defined QT_VERSION && QT_VERSION < 0x040000
#if defined __cplusplus && !defined CONFIG_DIALOG && 0x039999 < 0x040000
return APPEARANCE_AGUA_MOD;
#else
return APPEARANCE_AGUA;
@ -488,7 +488,7 @@ static EAlign toAlign(const char *str, EAlign def)
}
#endif
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
static ETitleBarIcon toTitlebarIcon(const char *str, ETitleBarIcon def)
{
if(str)
@ -515,7 +515,7 @@ static EImageType toImageType(const char *str, EImageType def)
if(0==memcmp(str, "rings", 5))
return IMG_BORDERED_RINGS;
if(0==memcmp(str, "squarerings", 11))
return IMG_SQUARE_RINGS;
return IMG_STQUARE_RINGS;
if(0==memcmp(str, "file", 4))
return IMG_FILE;
}
@ -569,41 +569,41 @@ static const char * getHome()
#ifdef __cplusplus
#if defined QTC_QT_ONLY || QT_VERSION < 0x040000
#if QT_VERSION < 0x040000
#include <qdir.h>
#include <qfile.h>
#if defined TQTC_TQT_ONLY || 0x039999 < 0x040000
#if 0x039999 < 0x040000
#include <tqdir.h>
#include <tqfile.h>
#endif
// Take from KStandardDirs::makeDir
static bool makeDir(const QString& dir, int mode)
static bool makeDir(const TQString& dir, int mode)
{
// we want an absolute path
if (QDir::isRelativePath(dir))
if (TQDir::isRelativePath(dir))
return false;
#ifdef Q_WS_WIN
return QDir().mkpath(dir);
#ifdef TQ_WS_WIN
return TQDir().mkpath(dir);
#else
QString target = dir;
TQString target = dir;
uint len = target.length();
// append trailing slash if missing
if (dir.at(len - 1) != '/')
target += '/';
QString base;
TQString base;
uint i = 1;
while( i < len )
{
struct stat st;
#if QT_VERSION >= 0x040000
#if 0x039999 >= 0x040000
int pos = target.indexOf('/', i);
#else
int pos = target.find('/', i);
int pos = target.tqfind('/', i);
#endif
base += target.mid(i - 1, pos - i + 1);
QByteArray baseEncoded = QFile::encodeName(base);
TQByteArray baseEncoded = TQFile::encodeName(base);
// bail out if we encountered a problem
if (stat(baseEncoded, &st) != 0)
{
@ -614,11 +614,11 @@ static bool makeDir(const QString& dir, int mode)
if (mkdir(baseEncoded, static_cast<mode_t>(mode)) != 0)
{
#if QT_VERSION >= 0x040000
#if 0x039999 >= 0x040000
baseEncoded.prepend("trying to create local folder ");
perror(baseEncoded.constData());
#else
perror("trying to create QtCurve config folder ");
perror("trying to create TQtCurve config folder ");
#endif
return false; // Couldn't create it :-(
}
@ -697,7 +697,7 @@ static const char *qtcConfDir()
if(0!=lstat(cfgDir, &info))
{
#ifdef __cplusplus
#if defined QTC_QT_ONLY || QT_VERSION < 0x040000
#if defined TQTC_TQT_ONLY || 0x039999 < 0x040000
makeDir(cfgDir, 0755);
#else
KStandardDirs::makeDir(cfgDir, 0755);
@ -725,16 +725,16 @@ static WindowBorders qtcGetWindowBorderSize(bool force)
if(-1==sizes.titleHeight || force)
{
#ifdef __cplusplus
QFile f(qtcConfDir()+QString(BORDER_SIZE_FILE));
TQFile f(qtcConfDir()+TQString(BORDER_SIZE_FILE));
#if QT_VERSION >= 0x040000
if(f.open(QIODevice::ReadOnly))
#if 0x039999 >= 0x040000
if(f.open(TQIODevice::ReadOnly))
#else
if(f.open(IO_ReadOnly))
#endif
{
QTextStream stream(&f);
QString line;
TQTextStream stream(&f);
TQString line;
sizes.titleHeight=stream.readLine().toInt();
sizes.toolTitleHeight=stream.readLine().toInt();
@ -770,7 +770,7 @@ static WindowBorders qtcGetWindowBorderSize(bool force)
return sizes.titleHeight<12 ? def : sizes;
}
#if (!defined QT_VERSION || QT_VERSION >= 0x040000) && !defined CONFIG_DIALOG
#if (0x039999 >= 0x040000) && !defined CONFIG_DIALOG
#define MENU_FILE_PREFIX "menubar-"
#define STATUS_FILE_PREFIX "statusbar-"
@ -781,17 +781,17 @@ static WindowBorders qtcGetWindowBorderSize(bool force)
#define qtcSetStatusBarHidden(A, H) qtcSetBarHidden((A), (H), STATUS_FILE_PREFIX)
#ifdef __cplusplus
static bool qtcBarHidden(const QString &app, const char *prefix)
static bool qtcBarHidden(const TQString &app, const char *prefix)
{
return QFile::exists(QFile::decodeName(qtcConfDir())+prefix+app);
return TQFile::exists(TQFile::decodeName(qtcConfDir())+prefix+app);
}
static void qtcSetBarHidden(const QString &app, bool hidden, const char *prefix)
static void qtcSetBarHidden(const TQString &app, bool hidden, const char *prefix)
{
if(!hidden)
QFile::remove(QFile::decodeName(qtcConfDir())+prefix+app);
TQFile::remove(TQFile::decodeName(qtcConfDir())+prefix+app);
else
QFile(QFile::decodeName(qtcConfDir())+prefix+app).open(QIODevice::WriteOnly);
TQFile(TQFile::decodeName(qtcConfDir())+prefix+app).open(TQIODevice::WriteOnly);
}
#else // __cplusplus
@ -839,7 +839,7 @@ static void qtcSetBarHidden(const char *app, bool hidden, const char *prefix)
#include <QtSvg/QSvgRenderer>
#endif // __cplusplus
static void loadBgndImage(QtCImage *img)
static void loadBgndImage(TQtCImage *img)
{
if(!img->loaded &&
img->width>16 && img->width<1024 && img->height>16 && img->height<1024)
@ -848,13 +848,13 @@ static void loadBgndImage(QtCImage *img)
#ifdef __cplusplus
if(!img->file.isEmpty())
{
QSvgRenderer svg(img->file);
TQSvgRenderer svg(img->file);
if(svg.isValid())
{
img->pix=QPixmap(img->width, img->height);
img->pix.fill(Qt::transparent);
QPainter painter(&img->pix);
img->pix=TQPixmap(img->width, img->height);
img->pix.fill(TQt::transparent);
TQPainter painter(&img->pix);
svg.render(&painter);
painter.end();
}
@ -867,7 +867,7 @@ static void loadBgndImage(QtCImage *img)
}
}
#endif // (!defined QT_VERSION || QT_VERSION >= 0x040000) && !defined CONFIG_DIALOG
#endif // (!defined 0x039999 || 0x039999 >= 0x040000) && !defined CONFIG_DIALOG
#ifdef CONFIG_READ
@ -885,41 +885,41 @@ static void checkColor(EShade *s, color *c)
#ifdef __cplusplus
class QtCConfig
class TQtCConfig
{
public:
QtCConfig(const QString &filename);
TQtCConfig(const TQString &filename);
bool ok() const { return values.count()>0; }
bool hasKey(const QString &key) { return values.contains(key); }
const QString & readEntry(const QString &key, const QString &def=QString::null);
bool hasKey(const TQString &key) { return values.tqcontains(key); }
const TQString & readEntry(const TQString &key, const TQString &def=TQString());
private:
QMap<QString, QString> values;
TQMap<TQString, TQString> values;
};
QtCConfig::QtCConfig(const QString &filename)
TQtCConfig::TQtCConfig(const TQString &filename)
{
QFile f(filename);
TQFile f(filename);
#if QT_VERSION >= 0x040000
if(f.open(QIODevice::ReadOnly))
#if 0x039999 >= 0x040000
if(f.open(TQIODevice::ReadOnly))
#else
if(f.open(IO_ReadOnly))
#endif
{
QTextStream stream(&f);
QString line;
TQTextStream stream(&f);
TQString line;
while(!stream.atEnd())
{
line = stream.readLine();
#if QT_VERSION >= 0x040000
#if 0x039999 >= 0x040000
int pos=line.indexOf('=');
#else
int pos=line.find('=');
int pos=line.tqfind('=');
#endif
if(-1!=pos)
values[line.left(pos)]=line.mid(pos+1);
@ -928,26 +928,26 @@ QtCConfig::QtCConfig(const QString &filename)
}
}
inline const QString & QtCConfig::readEntry(const QString &key, const QString &def)
inline const TQString & TQtCConfig::readEntry(const TQString &key, const TQString &def)
{
return values.contains(key) ? values[key] : def;
return values.tqcontains(key) ? values[key] : def;
}
inline QString readStringEntry(QtCConfig &cfg, const QString &key)
inline TQString readStringEntry(TQtCConfig &cfg, const TQString &key)
{
return cfg.readEntry(key);
}
static int readNumEntry(QtCConfig &cfg, const QString &key, int def)
static int readNumEntry(TQtCConfig &cfg, const TQString &key, int def)
{
const QString &val(readStringEntry(cfg, key));
const TQString &val(readStringEntry(cfg, key));
return val.isEmpty() ? def : val.toInt();
}
static int readVersionEntry(QtCConfig &cfg, const QString &key)
static int readVersionEntry(TQtCConfig &cfg, const TQString &key)
{
const QString &val(readStringEntry(cfg, key));
const TQString &val(readStringEntry(cfg, key));
int major, minor, patch;
return !val.isEmpty() && 3==sscanf(TO_LATIN1(val), "%d.%d.%d", &major, &minor, &patch)
@ -955,25 +955,25 @@ static int readVersionEntry(QtCConfig &cfg, const QString &key)
: 0;
}
static bool readBoolEntry(QtCConfig &cfg, const QString &key, bool def)
static bool readBoolEntry(TQtCConfig &cfg, const TQString &key, bool def)
{
const QString &val(readStringEntry(cfg, key));
const TQString &val(readStringEntry(cfg, key));
return val.isEmpty() ? def : (val=="true" ? true : false);
}
static void readDoubleList(QtCConfig &cfg, const char *key, double *list, int count)
static void readDoubleList(TQtCConfig &cfg, const char *key, double *list, int count)
{
#if (defined QT_VERSION && (QT_VERSION >= 0x040000))
QStringList strings(readStringEntry(cfg, key).split(',', QString::SkipEmptyParts));
#if ( (0x039999 >= 0x040000))
TQStringList strings(readStringEntry(cfg, key).split(',', TQString::SkipEmptyParts));
#else
QStringList strings(QStringList::split(',', readStringEntry(cfg, key)));
TQStringList strings(TQStringList::split(',', readStringEntry(cfg, key)));
#endif
bool ok(count==strings.size());
if(ok)
{
QStringList::ConstIterator it(strings.begin());
TQStringList::ConstIterator it(strings.begin());
int i;
for(i=0; i<count && ok; ++i, ++it)
@ -986,7 +986,7 @@ static void readDoubleList(QtCConfig &cfg, const char *key, double *list, int co
#define CFG_READ_COLOR(ENTRY) \
{ \
QString sVal(cfg.readEntry(#ENTRY)); \
TQString sVal(cfg.readEntry(#ENTRY)); \
if(sVal.isEmpty()) \
opts->ENTRY=def->ENTRY; \
else \
@ -999,7 +999,7 @@ static void readDoubleList(QtCConfig &cfg, const char *key, double *list, int co
opts->ENTRY.loaded=false; \
if(IMG_FILE==opts->ENTRY.type) \
{ \
QString file(cfg.readEntry(#ENTRY ".file")); \
TQString file(cfg.readEntry(#ENTRY ".file")); \
if(!file.isEmpty()) \
{ \
opts->ENTRY.file=file; \
@ -1009,17 +1009,17 @@ static void readDoubleList(QtCConfig &cfg, const char *key, double *list, int co
} \
}
#if QT_VERSION >= 0x040000
#if 0x039999 >= 0x040000
#define CFG_READ_STRING_LIST(ENTRY) \
{ \
QString val=readStringEntry(cfg, #ENTRY); \
Strings set=val.isEmpty() ? Strings() : Strings::fromList(val.split(",", QString::SkipEmptyParts)); \
TQString val=readStringEntry(cfg, #ENTRY); \
Strings set=val.isEmpty() ? Strings() : Strings::fromList(val.split(",", TQString::SkipEmptyParts)); \
opts->ENTRY=set.count() || cfg.hasKey(#ENTRY) ? set : def->ENTRY; \
}
#else
#define CFG_READ_STRING_LIST(ENTRY) \
{ \
QString val=readStringEntry(cfg, #ENTRY); \
TQString val=readStringEntry(cfg, #ENTRY); \
Strings list=val.isEmpty() ? Strings() : Strings::split(",", val, false); \
opts->ENTRY=list.count() || cfg.hasKey(#ENTRY) ? list : def->ENTRY; \
}
@ -1266,7 +1266,7 @@ static void readDoubleList(GHashTable *cfg, char *key, double *list, int count)
opts->ENTRY=toAlign(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#endif
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
#define CFG_READ_TB_ICON(ENTRY) \
opts->ENTRY=toTitlebarIcon(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#endif
@ -1325,7 +1325,7 @@ static void copyOpts(Options *src, Options *dest)
dest->noBgndOpacityApps=src->noBgndOpacityApps;
dest->noMenuBgndOpacityApps=src->noMenuBgndOpacityApps;
dest->noBgndImageApps=src->noBgndImageApps;
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
dest->noDlgFixApps=src->noDlgFixApps;
src->noDlgFixApps=NULL;
#endif
@ -1351,7 +1351,7 @@ static void freeOpts(Options *opts)
g_strfreev(opts->noMenuBgndOpacityApps);
if(opts->noBgndImageApps)
g_strfreev(opts->noBgndImageApps);
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
if(opts->noDlgFixApps)
g_strfreev(opts->noDlgFixApps);
opts->noDlgFixApps=NULL
@ -1480,7 +1480,7 @@ static void checkConfig(Options *opts)
if(opts->gbFactor<MIN_GB_FACTOR || opts->gbFactor>MAX_GB_FACTOR)
opts->gbFactor=DEF_GB_FACTOR;
#if defined __cplusplus && defined QT_VERSION && QT_VERSION < 0x040000 && !defined CONFIG_DIALOG
#if defined __cplusplus && 0x039999 < 0x040000 && !defined CONFIG_DIALOG
opts->crSize=CR_SMALL_SIZE;
if(SLIDER_CIRCULAR==opts->sliderStyle)
opts->sliderStyle=SLIDER_ROUND;
@ -1497,7 +1497,7 @@ static void checkConfig(Options *opts)
opts->colorMenubarMouseOver=true;
*/
#if defined __cplusplus && defined QT_VERSION && QT_VERSION < 0x040000 && !defined CONFIG_DIALOG
#if defined __cplusplus && 0x039999 < 0x040000 && !defined CONFIG_DIALOG
if(opts->round>ROUND_FULL)
opts->round=ROUND_FULL;
#endif
@ -1528,7 +1528,7 @@ static void checkConfig(Options *opts)
opts->coloredTbarMo=true;
if(opts->round<ROUND_SLIGHT)
opts->square|=SQUARE_POPUP_MENUS|SQUARE_TOOLTIPS;
opts->square|=STQUARE_POPUP_MENUS|STQUARE_TOOLTIPS;
#endif
if(opts->bgndOpacity<0 || opts->bgndOpacity>100)
@ -1554,7 +1554,7 @@ static void checkConfig(Options *opts)
opts->activeTabAppearance=MODIFY_AGUA(opts->activeTabAppearance);
opts->menuitemAppearance=MODIFY_AGUA(opts->menuitemAppearance);
if(!opts->borderProgress && (!opts->fillProgress || !(opts->square&SQUARE_PROGRESS)))
if(!opts->borderProgress && (!opts->fillProgress || !(opts->square&STQUARE_PROGRESS)))
opts->borderProgress=true;
opts->titlebarAppearance=MODIFY_AGUA(opts->titlebarAppearance);
@ -1567,7 +1567,7 @@ static void checkConfig(Options *opts)
opts->lighterPopupMenuBgnd=0;
#ifdef __cplusplus
#if defined QT_VERSION && QT_VERSION >= 0x040000
#if 0x039999 >= 0x040000
if(!(opts->titlebarButtons&TITLEBAR_BUTTON_ROUND))
#endif
opts->titlebarButtonAppearance=MODIFY_AGUA(opts->titlebarButtonAppearance);
@ -1591,7 +1591,7 @@ static void checkConfig(Options *opts)
}
#ifdef __cplusplus
static bool readConfig(const QString &file, Options *opts, Options *defOpts=0L)
static bool readConfig(const TQString &file, Options *opts, Options *defOpts=0L)
#else
static bool readConfig(const char *file, Options *opts, Options *defOpts)
#endif
@ -1599,7 +1599,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
#ifdef __cplusplus
if(file.isEmpty())
{
const char *env=getenv("QTCURVE_CONFIG_FILE");
const char *env=getenv("TQTCURVE_CONFIG_FILE");
if(NULL!=env)
return readConfig(env, opts, defOpts);
@ -1609,10 +1609,10 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
if(cfgDir)
{
QString filename(QFile::decodeName(cfgDir)+CONFIG_FILE);
TQString filename(TQFile::decodeName(cfgDir)+CONFIG_FILE);
if(!QFile::exists(filename))
filename=QFile::decodeName(cfgDir)+"../"OLD_CONFIG_FILE;
if(!TQFile::exists(filename))
filename=TQFile::decodeName(cfgDir)+"../"OLD_CONFIG_FILE;
return readConfig(filename, opts, defOpts);
}
}
@ -1620,7 +1620,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
#else
if(!file)
{
const char *env=getenv("QTCURVE_CONFIG_FILE");
const char *env=getenv("TQTCURVE_CONFIG_FILE");
if(NULL!=env)
return readConfig(env, opts, defOpts);
@ -1646,7 +1646,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
else
{
#ifdef __cplusplus
QtCConfig cfg(file);
TQtCConfig cfg(file);
if(cfg.ok())
{
@ -1676,7 +1676,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
#else
Options newOpts;
Options *def=&newOpts;
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
opts->noDlgFixApps=NULL;
#endif
opts->noBgndGradientApps=opts->noBgndOpacityApps=opts->noMenuBgndOpacityApps=opts->noBgndImageApps=opts->noMenuStripeApps=NULL;
@ -1724,18 +1724,18 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
if(opts->version<MAKE_VERSION(1, 4))
{
opts->square=
(readBoolEntry(cfg, "squareLvSelection", def->square&SQUARE_LISTVIEW_SELECTION) ? SQUARE_LISTVIEW_SELECTION : SQUARE_NONE)+
(readBoolEntry(cfg, "squareScrollViews", def->square&SQUARE_SCROLLVIEW) ? SQUARE_SCROLLVIEW : SQUARE_NONE)+
(readBoolEntry(cfg, "squareProgress", def->square&SQUARE_PROGRESS) ? SQUARE_PROGRESS : SQUARE_NONE)+
(readBoolEntry(cfg, "squareEntry", def->square&SQUARE_ENTRY)? SQUARE_ENTRY : SQUARE_NONE);
(readBoolEntry(cfg, "squareLvSelection", def->square&STQUARE_LISTVIEW_SELECTION) ? STQUARE_LISTVIEW_SELECTION : STQUARE_NONE)+
(readBoolEntry(cfg, "squareScrollViews", def->square&STQUARE_SCROLLVIEW) ? STQUARE_SCROLLVIEW : STQUARE_NONE)+
(readBoolEntry(cfg, "squareProgress", def->square&STQUARE_PROGRESS) ? STQUARE_PROGRESS : STQUARE_NONE)+
(readBoolEntry(cfg, "squareEntry", def->square&STQUARE_ENTRY)? STQUARE_ENTRY : STQUARE_NONE);
}
else
CFG_READ_INT(square)
if(opts->version<MAKE_VERSION(1, 6))
opts->square|=SQUARE_TOOLTIPS;
opts->square|=STQUARE_TOOLTIPS;
if(opts->version<MAKE_VERSION3(1, 6, 1))
opts->square|=SQUARE_POPUP_MENUS;
opts->square|=STQUARE_POPUP_MENUS;
if(opts->version<MAKE_VERSION(1, 2))
def->crSize=CR_SMALL_SIZE;
if(opts->version<MAKE_VERSION(1, 0))
@ -1747,7 +1747,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
def->crHighlight=0;
#ifdef __cplusplus
def->dwtAppearance=APPEARANCE_FLAT;
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
def->dwtSettings=0;
#endif
#endif
@ -1761,7 +1761,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
def->etchEntry=true;
def->gtkScrollViews=false;
def->thinSbarGroove=false;
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
def->titlebarButtons=TITLEBAR_BUTTON_HOVER_FRAME;
def->titlebarIcon=TITLEBAR_ICON_MENU_BUTTON;
#endif
@ -1846,7 +1846,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_GRAD_TYPE(bgndGrad)
CFG_READ_GRAD_TYPE(menuBgndGrad)
CFG_READ_APPEARANCE(menuBgndAppearance, APP_ALLOW_STRIPED)
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
CFG_READ_BOOL(fixParentlessDialogs)
CFG_READ_STRING_LIST(noDlgFixApps)
#endif
@ -1929,7 +1929,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_BOOL(darkerBorders)
CFG_READ_BOOL(vArrows)
CFG_READ_BOOL(xCheck)
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000)) || !defined __cplusplus
CFG_READ_BOOL(fadeLines)
CFG_READ_GLOW(glowProgress)
#endif
@ -1966,12 +1966,12 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_INT_BOOL(windowDrag, WM_DRAG_MENUBAR)
CFG_READ_BOOL(shadePopupMenu)
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
CFG_READ_BOOL(stdBtnSizes)
CFG_READ_INT(titlebarButtons)
CFG_READ_TB_ICON(titlebarIcon)
#endif
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
CFG_READ_BOOL(xbar)
CFG_READ_INT(dwtSettings)
#endif
@ -2001,10 +2001,10 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_INT(expanderHighlight)
CFG_READ_BOOL(mapKdeIcons)
#endif
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000)) || !defined __cplusplus
CFG_READ_BOOL(gtkButtonOrder)
#endif
#if !defined __cplusplus || (defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || (defined CONFIG_DIALOG && (0x039999 >= 0x040000))
CFG_READ_BOOL(reorderGtkButtons)
#endif
CFG_READ_APPEARANCE(titlebarAppearance, APP_ALLOW_NONE)
@ -2022,7 +2022,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
opts->inactiveTitlebarAppearance=APPEARANCE_FLAT;
#ifdef __cplusplus
CFG_READ_APPEARANCE(titlebarButtonAppearance, APP_ALLOW_BASIC)
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
if(opts->xbar && opts->menubarHiding)
opts->xbar=false;
#endif
@ -2031,16 +2031,16 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_IMAGE(bgndImage)
CFG_READ_IMAGE(menuBgndImage)
CFG_READ_STRING_LIST(noMenuStripeApps)
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || ( (0x039999 >= 0x040000))
CFG_READ_STRING_LIST(noBgndGradientApps)
CFG_READ_STRING_LIST(noBgndOpacityApps)
CFG_READ_STRING_LIST(noMenuBgndOpacityApps)
CFG_READ_STRING_LIST(noBgndImageApps)
#endif
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
CFG_READ_STRING_LIST(menubarApps)
CFG_READ_STRING_LIST(statusbarApps)
CFG_READ_STRING_LIST(useQtFileDialogApps)
CFG_READ_STRING_LIST(useTQtFileDialogApps)
CFG_READ_STRING_LIST(windowDragWhiteList)
CFG_READ_STRING_LIST(windowDragBlackList)
#endif
@ -2048,22 +2048,22 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
readDoubleList(cfg, "customAlphas", opts->customAlphas, NUM_STD_ALPHAS);
#ifdef __cplusplus
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
if(opts->titlebarButtons&TITLEBAR_BUTTON_COLOR || opts->titlebarButtons&TITLEBAR_BUTTON_ICON_COLOR)
{
#if (defined QT_VERSION && (QT_VERSION >= 0x040000))
QStringList cols(readStringEntry(cfg, "titlebarButtonColors").split(',', QString::SkipEmptyParts));
#if ( (0x039999 >= 0x040000))
TQStringList cols(readStringEntry(cfg, "titlebarButtonColors").split(',', TQString::SkipEmptyParts));
#else
QStringList cols(QStringList::split(',', readStringEntry(cfg, "titlebarButtonColors")));
TQStringList cols(TQStringList::split(',', readStringEntry(cfg, "titlebarButtonColors")));
#endif
if(cols.count() && 0==(cols.count()%NUM_TITLEBAR_BUTTONS) && cols.count()<=(NUM_TITLEBAR_BUTTONS*3))
{
QStringList::ConstIterator it(cols.begin()),
TQStringList::ConstIterator it(cols.begin()),
end(cols.end());
for(int i=0; it!=end; ++it, ++i)
{
QColor col;
TQColor col;
setRgb(&col, TO_LATIN1((*it)));
opts->titlebarButtonColors[i]=col;
}
@ -2080,14 +2080,14 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
for(i=APPEARANCE_CUSTOM1; i<(APPEARANCE_CUSTOM1+NUM_CUSTOM_GRAD); ++i)
{
QString gradKey;
TQString gradKey;
gradKey.sprintf("customgradient%d", (i-APPEARANCE_CUSTOM1)+1);
#if (defined QT_VERSION && (QT_VERSION >= 0x040000))
QStringList vals(readStringEntry(cfg, gradKey).split(',', QString::SkipEmptyParts));
#if ( (0x039999 >= 0x040000))
TQStringList vals(readStringEntry(cfg, gradKey).split(',', TQString::SkipEmptyParts));
#else
QStringList vals(QStringList::split(',', readStringEntry(cfg, gradKey)));
TQStringList vals(TQStringList::split(',', readStringEntry(cfg, gradKey)));
#endif
if(vals.size())
@ -2095,7 +2095,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
if(vals.size()>=5)
{
QStringList::ConstIterator it(vals.begin()),
TQStringList::ConstIterator it(vals.begin()),
end(vals.end());
bool ok(true),
haveAlpha(false);
@ -2348,7 +2348,7 @@ static void defaultSettings(Options *opts)
opts->menuDelay=DEFAULT_MENU_DELAY;
opts->sliderWidth=DEFAULT_SLIDER_WIDTH;
opts->selectionAppearance=APPEARANCE_HARSH_GRADIENT;
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000)) || !defined __cplusplus
opts->round=ROUND_EXTRA;
opts->fadeLines=true;
opts->glowProgress=GLOW_NONE;
@ -2359,7 +2359,7 @@ static void defaultSettings(Options *opts)
#ifdef __cplusplus
opts->dwtAppearance=APPEARANCE_CUSTOM1;
#endif
#if !defined __cplusplus || (defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || (defined CONFIG_DIALOG && (0x039999 >= 0x040000))
opts->reorderGtkButtons=false;
#endif
opts->bgndImage.type=IMG_NONE;
@ -2404,7 +2404,7 @@ static void defaultSettings(Options *opts)
opts->toolbarBorders=TB_NONE;
opts->toolbarSeparators=LINE_SUNKEN;
opts->splitters=LINE_1DOT;
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
opts->fixParentlessDialogs=false;
#ifdef __cplusplus
opts->noDlgFixApps << "kate" << "plasma" << "plasma-desktop" << "plasma-netbook";
@ -2459,7 +2459,7 @@ static void defaultSettings(Options *opts)
opts->boldProgress=true;
opts->coloredTbarMo=false;
opts->borderSelection=false;
opts->square=SQUARE_POPUP_MENUS;
opts->square=STQUARE_POPUP_MENUS;
opts->stripedSbar=false;
opts->windowDrag=WM_DRAG_NONE;
opts->shadePopupMenu=false;
@ -2467,7 +2467,7 @@ static void defaultSettings(Options *opts)
opts->groupBox=FRAME_FADED;
opts->gbFactor=DEF_GB_FACTOR;
opts->gbLabel=GB_LBL_BOLD|GB_LBL_OUTSIDE;
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
opts->stdBtnSizes=false;
opts->titlebarButtons=TITLEBAR_BUTTON_ROUND|TITLEBAR_BUTTON_HOVER_SYMBOL;
opts->titlebarIcon=TITLEBAR_ICON_NEXT_TO_TITLE;
@ -2494,12 +2494,12 @@ static void defaultSettings(Options *opts)
opts->titlebarAlignment=ALIGN_FULL_CENTER;
opts->titlebarEffect=EFFECT_SHADOW;
opts->centerTabText=false;
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
opts->xbar=false;
opts->dwtSettings=DWT_BUTTONS_AS_PER_TITLEBAR|DWT_ROUND_TOP_ONLY;
opts->menubarApps << "amarok" << "arora" << "kaffeine" << "kcalc" << "smplayer" << "VirtualBox";
opts->statusbarApps << "kde";
opts->useQtFileDialogApps << "googleearth-bin";
opts->useTQtFileDialogApps << "googleearth-bin";
opts->noMenuBgndOpacityApps << "inkscape" << "inkscape" << "sonata" << "totem";
opts->noBgndOpacityApps << "smplayer" << "kaffeine" << "dragon" << "kscreenlocker" << "inkscape" << "inkscape" << "sonata" << "totem";
#endif
@ -2543,7 +2543,7 @@ static void defaultSettings(Options *opts)
readConfig(systemFilename, opts, opts);
}
#if !defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION < 0x040000)
#if !defined CONFIG_DIALOG && (0x039999 < 0x040000)
if(FOCUS_FILLED==opts->focus)
opts->focus=FOCUS_FULL;
#endif
@ -2628,7 +2628,7 @@ static const char *toStr(EMouseOver mo)
}
}
static QString toStr(EAppearance exp, EAppAllow allow)
static TQString toStr(EAppearance exp, EAppAllow allow)
{
switch(exp)
{
@ -2669,7 +2669,7 @@ static QString toStr(EAppearance exp, EAppAllow allow)
}
default:
{
QString app;
TQString app;
app.sprintf("customgradient%d", (exp-APPEARANCE_CUSTOM1)+1);
return app;
@ -2677,15 +2677,15 @@ static QString toStr(EAppearance exp, EAppAllow allow)
}
}
static QString toStr(const QColor &col)
static TQString toStr(const TQColor &col)
{
QString colorStr;
TQString colorStr;
colorStr.sprintf("#%02X%02X%02X", col.red(), col.green(), col.blue());
return colorStr;
}
static QString toStr(EShade exp, const QColor &col)
static TQString toStr(EShade exp, const TQColor &col)
{
switch(exp)
{
@ -2960,7 +2960,7 @@ static const char * toStr(EImageType lv)
return "plainrings";
case IMG_BORDERED_RINGS:
return "rings";
case IMG_SQUARE_RINGS:
case IMG_STQUARE_RINGS:
return "squarerings";
case IMG_FILE:
return "file";
@ -2983,8 +2983,8 @@ static const char * toStr(EGlow lv)
}
}
#if QT_VERSION >= 0x040000
#include <QTextStream>
#if 0x039999 >= 0x040000
#include <TQTextStream>
#define CFG config
#else
#define CFG (*cfg)
@ -3042,7 +3042,7 @@ static const char * toStr(EGlow lv)
if (!exportingStyle && def.ENTRY==opts.ENTRY) \
CFG.deleteEntry(#ENTRY); \
else \
CFG.writeEntry(#ENTRY, QStringList(opts.ENTRY.toList()).join(",")); \
CFG.writeEntry(#ENTRY, TQStringList(opts.ENTRY.toList()).join(",")); \
bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, bool exportingStyle=false)
{
@ -3052,10 +3052,10 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
if(cfgDir)
{
#if QT_VERSION >= 0x040000
KConfig defCfg(QFile::decodeName(cfgDir)+CONFIG_FILE, KConfig::SimpleConfig);
#if 0x039999 >= 0x040000
KConfig defCfg(TQFile::decodeName(cfgDir)+CONFIG_FILE, KConfig::SimpleConfig);
#else
KConfig defCfg(QFile::decodeName(cfgDir)+CONFIG_FILE, false, false);
KConfig defCfg(TQFile::decodeName(cfgDir)+CONFIG_FILE, false, false);
#endif
if(writeConfig(&defCfg, opts, def, exportingStyle))
@ -3064,17 +3064,17 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
for(int i=0; oldFiles[i]; ++i)
{
QString oldFileName(QFile::decodeName(cfgDir)+QString("../")+oldFiles[i]);
TQString oldFileName(TQFile::decodeName(cfgDir)+TQString("../")+oldFiles[i]);
if(QFile::exists(oldFileName))
QFile::remove(oldFileName);
if(TQFile::exists(oldFileName))
TQFile::remove(oldFileName);
}
}
}
}
else
{
#if QT_VERSION >= 0x040000
#if 0x039999 >= 0x040000
KConfigGroup config(cfg, SETTINGS_GROUP);
#else
cfg->setGroup(SETTINGS_GROUP);
@ -3092,9 +3092,9 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
CFG_WRITE_ENTRY(bgndGrad)
CFG_WRITE_ENTRY(menuBgndGrad)
CFG_WRITE_APPEARANCE_ENTRY(menuBgndAppearance, APP_ALLOW_STRIPED)
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
CFG_WRITE_ENTRY(fixParentlessDialogs)
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
CFG_WRITE_STRING_LIST_ENTRY(noDlgFixApps)
#endif
#endif
@ -3202,14 +3202,14 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
CFG_WRITE_ENTRY_NUM(windowDrag)
CFG_WRITE_ENTRY(shadePopupMenu)
CFG_WRITE_ENTRY_NUM(windowBorder)
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
CFG_WRITE_ENTRY(xbar)
CFG_WRITE_ENTRY_NUM(dwtSettings)
#endif
CFG_WRITE_ENTRY_NUM(bgndOpacity)
CFG_WRITE_ENTRY_NUM(menuBgndOpacity)
CFG_WRITE_ENTRY_NUM(dlgOpacity)
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
CFG_WRITE_ENTRY(stdBtnSizes)
CFG_WRITE_ENTRY_NUM(titlebarButtons)
CFG_WRITE_ENTRY(titlebarIcon)
@ -3217,15 +3217,15 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
if((opts.titlebarButtons&TITLEBAR_BUTTON_COLOR || opts.titlebarButtons&TITLEBAR_BUTTON_ICON_COLOR) &&
opts.titlebarButtonColors.size() && 0==(opts.titlebarButtonColors.size()%NUM_TITLEBAR_BUTTONS))
{
QString val;
#if QT_VERSION >= 0x040000
QTextStream str(&val);
TQString val;
#if 0x039999 >= 0x040000
TQTextStream str(&val);
#else
QTextStream str(&val, IO_WriteOnly);
TQTextStream str(&val, IO_WriteOnly);
#endif
for(unsigned int i=0; i<opts.titlebarButtonColors.size(); ++i)
{
TBCols::const_iterator c(opts.titlebarButtonColors.find((ETitleBarButtons)i));
TBCols::const_iterator c(opts.titlebarButtonColors.tqfind((ETitleBarButtons)i));
if(c!=opts.titlebarButtonColors.end())
{
@ -3250,14 +3250,14 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
CFG_WRITE_ENTRY(gtkComboMenus)
CFG_WRITE_ENTRY(doubleGtkComboArrow)
CFG_WRITE_ENTRY(gtkButtonOrder)
#if !defined __cplusplus || (defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION >= 0x040000))
#if !defined __cplusplus || (defined CONFIG_DIALOG && (0x039999 >= 0x040000))
CFG_WRITE_ENTRY(reorderGtkButtons)
#endif
CFG_WRITE_ENTRY(mapKdeIcons)
CFG_WRITE_ENTRY(shading)
CFG_WRITE_ENTRY(titlebarAlignment)
CFG_WRITE_ENTRY(centerTabText)
#if defined QT_VERSION && (QT_VERSION >= 0x040000)
#if (0x039999 >= 0x040000)
CFG_WRITE_STRING_LIST_ENTRY(noBgndGradientApps)
CFG_WRITE_STRING_LIST_ENTRY(noBgndOpacityApps)
CFG_WRITE_STRING_LIST_ENTRY(noMenuBgndOpacityApps)
@ -3265,13 +3265,13 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
CFG_WRITE_STRING_LIST_ENTRY(noMenuStripeApps)
CFG_WRITE_STRING_LIST_ENTRY(menubarApps)
CFG_WRITE_STRING_LIST_ENTRY(statusbarApps)
CFG_WRITE_STRING_LIST_ENTRY(useQtFileDialogApps)
CFG_WRITE_STRING_LIST_ENTRY(useTQtFileDialogApps)
#endif
for(int i=APPEARANCE_CUSTOM1; i<(APPEARANCE_CUSTOM1+NUM_CUSTOM_GRAD); ++i)
{
GradientCont::const_iterator cg(opts.customGradient.find((EAppearance)i));
QString gradKey;
GradientCont::const_iterator cg(opts.customGradient.tqfind((EAppearance)i));
TQString gradKey;
gradKey.sprintf("customgradient%d", (i-APPEARANCE_CUSTOM1)+1);
@ -3281,13 +3281,13 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
{
GradientCont::const_iterator d;
if(exportingStyle || (d=def.customGradient.find((EAppearance)i))==def.customGradient.end() || !((*d)==(*cg)))
if(exportingStyle || (d=def.customGradient.tqfind((EAppearance)i))==def.customGradient.end() || !((*d)==(*cg)))
{
QString gradVal;
#if QT_VERSION >= 0x040000
QTextStream str(&gradVal);
TQString gradVal;
#if 0x039999 >= 0x040000
TQTextStream str(&gradVal);
#else
QTextStream str(&gradVal, IO_WriteOnly);
TQTextStream str(&gradVal, IO_WriteOnly);
#endif
GradientStopCont stops((*cg).second.stops.fix());
GradientStopCont::const_iterator it(stops.begin()),
@ -3323,11 +3323,11 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
opts.customShades[4]!=def.customShades[4] ||
opts.customShades[5]!=def.customShades[5])
{
QString shadeVal;
#if QT_VERSION >= 0x040000
QTextStream str(&shadeVal);
TQString shadeVal;
#if 0x039999 >= 0x040000
TQTextStream str(&shadeVal);
#else
QTextStream str(&shadeVal, IO_WriteOnly);
TQTextStream str(&shadeVal, IO_WriteOnly);
#endif
if(0==opts.customShades[0])
str << 0;

@ -1,5 +1,5 @@
/*
QtCurve (C) Craig Drummond, 2003 - 2007 Craig.Drummond@lycos.co.uk
TQtCurve (C) Craig Drummond, 2003 - 2007 Craig.Drummond@lycos.co.uk
----
@ -29,9 +29,9 @@
#include <pwd.h>
#include <sys/types.h>
#define QTC_MAX_FILENAME_LEN 1024
#define QTC_MAX_INPUT_LINE_LEN 256
#define QTC_FILE "qtcurvestylerc"
#define TQTC_MAX_FILENAME_LEN 1024
#define TQTC_MAX_INPUT_LINE_LEN 256
#define TQTC_FILE "qtcurvestylerc"
#ifdef CONFIG_READ
static int c2h(char ch)
@ -301,7 +301,7 @@ static const char * getHome()
static const char *xdgConfigFolder()
{
static char xdgDir[QTC_MAX_FILENAME_LEN]={'\0'};
static char xdgDir[TQTC_MAX_FILENAME_LEN]={'\0'};
if(!xdgDir[0])
{
@ -368,66 +368,66 @@ static const char *xdgConfigFolder()
#ifdef CONFIG_READ
#ifdef __cplusplus
#define QTC_IS_BLACK(A) (0==(A).red() && 0==(A).green() && 0==(A).blue())
#define TQTC_IS_BLACK(A) (0==(A).red() && 0==(A).green() && 0==(A).blue())
#else
#define QTC_IS_BLACK(A) (0==(A).red && 0==(A).green && 0==(A).blue)
#define TQTC_IS_BLACK(A) (0==(A).red && 0==(A).green && 0==(A).blue)
#endif
static void checkColor(EShade *s, color *c)
{
if(SHADE_CUSTOM==*s && QTC_IS_BLACK(*c))
if(SHADE_CUSTOM==*s && TQTC_IS_BLACK(*c))
*s=SHADE_NONE;
}
#ifdef __cplusplus
#if QT_VERSION >= 0x040000
#include <QMap>
#include <QFile>
#include <QTextStream>
#define QTC_LATIN1(A) A.toLatin1()
#if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
#include <TQMap>
#include <TQFile>
#include <TQTextStream>
#define TQTC_LATIN1(A) A.toLatin1()
#else
#define QTC_LATIN1(A) A.latin1()
#define TQTC_LATIN1(A) A.latin1()
#include <qmap.h>
#include <qfile.h>
#include <qtextstream.h>
#include <tqmap.h>
#include <tqfile.h>
#include <tqtextstream.h>
#endif
class QtCConfig
class TQtCConfig
{
public:
QtCConfig(const QString &filename);
TQtCConfig(const TQString &filename);
bool ok() const { return values.count()>0; }
const QString & readEntry(const char *key, const QString &def=QString::null);
const TQString & readEntry(const char *key, const TQString &def=TQString());
private:
QMap<QString, QString> values;
TQMap<TQString, TQString> values;
};
QtCConfig::QtCConfig(const QString &filename)
TQtCConfig::TQtCConfig(const TQString &filename)
{
QFile f(filename);
TQFile f(filename);
#if QT_VERSION >= 0x040000
if(f.open(QIODevice::ReadOnly))
#if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
if(f.open(TQIODevice::ReadOnly))
#else
if(f.open(IO_ReadOnly))
#endif
{
QTextStream stream(&f);
QString line;
TQTextStream stream(&f);
TQString line;
while(!stream.atEnd())
{
line = stream.readLine();
#if QT_VERSION >= 0x040000
#if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
int pos=line.indexOf('=');
#else
int pos=line.find('=');
int pos=line.tqfind('=');
#endif
if(-1!=pos)
values[line.left(pos)]=line.mid(pos+1);
@ -436,43 +436,43 @@ QtCConfig::QtCConfig(const QString &filename)
}
}
inline const QString & QtCConfig::readEntry(const char *key, const QString &def)
inline const TQString & TQtCConfig::readEntry(const char *key, const TQString &def)
{
return values.contains(key) ? values[key] : def;
return values.tqcontains(key) ? values[key] : def;
}
inline QString readStringEntry(QtCConfig &cfg, const char *key)
inline TQString readStringEntry(TQtCConfig &cfg, const char *key)
{
return cfg.readEntry(key);
}
static int readNumEntry(QtCConfig &cfg, const char *key, int def)
static int readNumEntry(TQtCConfig &cfg, const char *key, int def)
{
const QString &val(readStringEntry(cfg, key));
const TQString &val(readStringEntry(cfg, key));
return val.isEmpty() ? def : val.toInt();
}
static bool readBoolEntry(QtCConfig &cfg, const char *key, bool def)
static bool readBoolEntry(TQtCConfig &cfg, const char *key, bool def)
{
const QString &val(readStringEntry(cfg, key));
const TQString &val(readStringEntry(cfg, key));
return val.isEmpty() ? def : (val=="true" ? true : false);
}
#if QT_VERSION >= 0x040000
#define QTC_LATIN1(A) A.toLatin1()
#if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
#define TQTC_LATIN1(A) A.toLatin1()
#else
#define QTC_LATIN1(A) A.latin1()
#define TQTC_LATIN1(A) A.latin1()
#endif
#define QTC_CFG_READ_COLOR(ENTRY) \
#define TQTC_CFG_READ_COLOR(ENTRY) \
{ \
QString sVal(cfg.readEntry(#ENTRY)); \
TQString sVal(cfg.readEntry(#ENTRY)); \
if(sVal.isEmpty()) \
opts->ENTRY=def->ENTRY; \
else \
setRgb(&(opts->ENTRY), QTC_LATIN1(sVal)); \
setRgb(&(opts->ENTRY), TQTC_LATIN1(sVal)); \
}
#else
@ -502,9 +502,9 @@ static GHashTable * loadConfig(const char *filename)
if(f)
{
char line[QTC_MAX_INPUT_LINE_LEN];
char line[TQTC_MAX_INPUT_LINE_LEN];
while(NULL!=fgets(line, QTC_MAX_INPUT_LINE_LEN-1, f))
while(NULL!=fgets(line, TQTC_MAX_INPUT_LINE_LEN-1, f))
{
char *eq=strchr(line, '=');
int pos=eq ? eq-line : -1;
@ -552,9 +552,9 @@ static gboolean readBoolEntry(GHashTable *cfg, char *key, gboolean def)
return str ? (0==memcmp(str, "true", 4) ? true : false) : def;
}
#define QTC_LATIN1(A) A
#define TQTC_LATIN1(A) A
#define QTC_CFG_READ_COLOR(ENTRY) \
#define TQTC_CFG_READ_COLOR(ENTRY) \
{ \
const char *str=readStringEntry(cfg, #ENTRY); \
\
@ -565,63 +565,63 @@ static gboolean readBoolEntry(GHashTable *cfg, char *key, gboolean def)
}
#endif
#define QTC_CFG_READ_NUM(ENTRY) \
#define TQTC_CFG_READ_NUM(ENTRY) \
opts->ENTRY=readNumEntry(cfg, #ENTRY, def->ENTRY);
#define QTC_CFG_READ_BOOL(ENTRY) \
#define TQTC_CFG_READ_BOOL(ENTRY) \
opts->ENTRY=readBoolEntry(cfg, #ENTRY, def->ENTRY);
#define QTC_CFG_READ_ROUND(ENTRY) \
opts->ENTRY=toRound(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_ROUND(ENTRY) \
opts->ENTRY=toRound(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_DI(ENTRY) \
#define TQTC_CFG_READ_DI(ENTRY) \
opts->ENTRY=((double)(readNumEntry(cfg, #ENTRY, ((int)(def->ENTRY*100))-100)+100))/100.0;
#define QTC_CFG_READ_TB_BORDER(ENTRY) \
opts->ENTRY=toTBarBorder(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_TB_BORDER(ENTRY) \
opts->ENTRY=toTBarBorder(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_MOUSE_OVER(ENTRY) \
opts->ENTRY=toMouseOver(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_MOUSE_OVER(ENTRY) \
opts->ENTRY=toMouseOver(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_APPEARANCE(ENTRY, DEF) \
opts->ENTRY=toAppearance(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), DEF);
#define TQTC_CFG_READ_APPEARANCE(ENTRY, DEF) \
opts->ENTRY=toAppearance(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), DEF);
/*
#define QTC_CFG_READ_APPEARANCE(ENTRY) \
opts->ENTRY=toAppearance(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_APPEARANCE(ENTRY) \
opts->ENTRY=toAppearance(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
*/
#define QTC_CFG_READ_STRIPE(ENTRY) \
opts->ENTRY=toStripe(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_STRIPE(ENTRY) \
opts->ENTRY=toStripe(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_SLIDER(ENTRY) \
opts->ENTRY=toSlider(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_SLIDER(ENTRY) \
opts->ENTRY=toSlider(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_DEF_BTN(ENTRY) \
opts->ENTRY=toInd(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_DEF_BTN(ENTRY) \
opts->ENTRY=toInd(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_LINE(ENTRY) \
opts->ENTRY=toLine(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_LINE(ENTRY) \
opts->ENTRY=toLine(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_SHADE(ENTRY, AD) \
opts->ENTRY=toShade(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), AD, def->ENTRY);
#define TQTC_CFG_READ_SHADE(ENTRY, AD) \
opts->ENTRY=toShade(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), AD, def->ENTRY);
#define QTC_CFG_READ_SCROLLBAR(ENTRY) \
opts->ENTRY=toScrollbar(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_SCROLLBAR(ENTRY) \
opts->ENTRY=toScrollbar(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_EFFECT(ENTRY) \
opts->ENTRY=toEffect(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define TQTC_CFG_READ_EFFECT(ENTRY) \
opts->ENTRY=toEffect(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#ifdef QTC_CONFIG_DIALOG
#define QTC_CFG_READ_SHADING(ENTRY, UNUSED) \
opts->ENTRY=toShading(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#ifdef TQTC_CONFIG_DIALOG
#define TQTC_CFG_READ_SHADING(ENTRY, UNUSED) \
opts->ENTRY=toShading(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#else
#define QTC_CFG_READ_SHADING(ENTRY, DEF) \
ENTRY=toShading(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), DEF);
#define TQTC_CFG_READ_SHADING(ENTRY, DEF) \
ENTRY=toShading(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), DEF);
#endif
#ifdef __cplusplus
static bool readConfig(const QString &file, Options *opts, Options *def)
static bool readConfig(const TQString &file, Options *opts, Options *def)
#else
static bool readConfig(const char *file, Options *opts, Options *def)
#endif
@ -633,9 +633,9 @@ static bool readConfig(const char *file, Options *opts, Options *def)
if(xdg)
{
QString filename(xdg);
TQString filename(xdg);
filename+="/"QTC_FILE;
filename+="/"TQTC_FILE;
return readConfig(filename, opts, def);
}
}
@ -646,9 +646,9 @@ static bool readConfig(const char *file, Options *opts, Options *def)
if(xdg)
{
char filename[QTC_MAX_FILENAME_LEN];
char filename[TQTC_MAX_FILENAME_LEN];
sprintf(filename, "%s/"QTC_FILE, xdg);
sprintf(filename, "%s/"TQTC_FILE, xdg);
return readConfig(filename, opts, def);
}
}
@ -656,7 +656,7 @@ static bool readConfig(const char *file, Options *opts, Options *def)
else
{
#ifdef __cplusplus
QtCConfig cfg(file);
TQtCConfig cfg(file);
if(cfg.ok())
{
@ -666,77 +666,77 @@ static bool readConfig(const char *file, Options *opts, Options *def)
if(cfg)
{
#endif
QTC_CFG_READ_NUM(passwordChar)
QTC_CFG_READ_ROUND(round)
QTC_CFG_READ_DI(highlightFactor)
QTC_CFG_READ_TB_BORDER(toolbarBorders)
QTC_CFG_READ_APPEARANCE(appearance, def->appearance)
QTC_CFG_READ_BOOL(fixParentlessDialogs)
QTC_CFG_READ_STRIPE(stripedProgress)
QTC_CFG_READ_SLIDER(sliderStyle)
QTC_CFG_READ_BOOL(animatedProgress)
QTC_CFG_READ_BOOL(lighterPopupMenuBgnd)
QTC_CFG_READ_BOOL(embolden)
QTC_CFG_READ_DEF_BTN(defBtnIndicator)
QTC_CFG_READ_LINE(sliderThumbs)
QTC_CFG_READ_LINE(handles)
QTC_CFG_READ_BOOL(highlightTab)
QTC_CFG_READ_BOOL(colorSelTab)
QTC_CFG_READ_SHADE(shadeSliders, false)
QTC_CFG_READ_SHADE(shadeMenubars, true)
QTC_CFG_READ_SHADE(shadeCheckRadio, false)
QTC_CFG_READ_APPEARANCE(menubarAppearance, def->menubarAppearance)
QTC_CFG_READ_APPEARANCE(menuitemAppearance, opts->appearance)
QTC_CFG_READ_APPEARANCE(toolbarAppearance, def->toolbarAppearance)
QTC_CFG_READ_LINE(toolbarSeparators)
QTC_CFG_READ_LINE(splitters)
QTC_CFG_READ_BOOL(customMenuTextColor)
QTC_CFG_READ_MOUSE_OVER(coloredMouseOver)
QTC_CFG_READ_BOOL(menubarMouseOver)
QTC_CFG_READ_BOOL(shadeMenubarOnlyWhenActive)
QTC_CFG_READ_BOOL(thinnerMenuItems)
QTC_CFG_READ_COLOR(customSlidersColor)
QTC_CFG_READ_COLOR(customMenubarsColor)
QTC_CFG_READ_COLOR(customMenuSelTextColor)
QTC_CFG_READ_COLOR(customMenuNormTextColor)
QTC_CFG_READ_COLOR(customCheckRadioColor)
QTC_CFG_READ_SCROLLBAR(scrollbarType)
QTC_CFG_READ_EFFECT(buttonEffect)
QTC_CFG_READ_APPEARANCE(lvAppearance, opts->appearance)
QTC_CFG_READ_APPEARANCE(tabAppearance, opts->appearance)
QTC_CFG_READ_APPEARANCE(sliderAppearance, opts->appearance)
QTC_CFG_READ_APPEARANCE(progressAppearance, opts->appearance)
#ifndef QTC_PLAIN_FOCUS_ONLY
QTC_CFG_READ_BOOL(stdFocus)
TQTC_CFG_READ_NUM(passwordChar)
TQTC_CFG_READ_ROUND(round)
TQTC_CFG_READ_DI(highlightFactor)
TQTC_CFG_READ_TB_BORDER(toolbarBorders)
TQTC_CFG_READ_APPEARANCE(appearance, def->appearance)
TQTC_CFG_READ_BOOL(fixParentlessDialogs)
TQTC_CFG_READ_STRIPE(stripedProgress)
TQTC_CFG_READ_SLIDER(sliderStyle)
TQTC_CFG_READ_BOOL(animatedProgress)
TQTC_CFG_READ_BOOL(lighterPopupMenuBgnd)
TQTC_CFG_READ_BOOL(embolden)
TQTC_CFG_READ_DEF_BTN(defBtnIndicator)
TQTC_CFG_READ_LINE(sliderThumbs)
TQTC_CFG_READ_LINE(handles)
TQTC_CFG_READ_BOOL(highlightTab)
TQTC_CFG_READ_BOOL(colorSelTab)
TQTC_CFG_READ_SHADE(shadeSliders, false)
TQTC_CFG_READ_SHADE(shadeMenubars, true)
TQTC_CFG_READ_SHADE(shadeCheckRadio, false)
TQTC_CFG_READ_APPEARANCE(menubarAppearance, def->menubarAppearance)
TQTC_CFG_READ_APPEARANCE(menuitemAppearance, opts->appearance)
TQTC_CFG_READ_APPEARANCE(toolbarAppearance, def->toolbarAppearance)
TQTC_CFG_READ_LINE(toolbarSeparators)
TQTC_CFG_READ_LINE(splitters)
TQTC_CFG_READ_BOOL(customMenuTextColor)
TQTC_CFG_READ_MOUSE_OVER(coloredMouseOver)
TQTC_CFG_READ_BOOL(menubarMouseOver)
TQTC_CFG_READ_BOOL(shadeMenubarOnlyWhenActive)
TQTC_CFG_READ_BOOL(thinnerMenuItems)
TQTC_CFG_READ_COLOR(customSlidersColor)
TQTC_CFG_READ_COLOR(customMenubarsColor)
TQTC_CFG_READ_COLOR(customMenuSelTextColor)
TQTC_CFG_READ_COLOR(customMenuNormTextColor)
TQTC_CFG_READ_COLOR(customCheckRadioColor)
TQTC_CFG_READ_SCROLLBAR(scrollbarType)
TQTC_CFG_READ_EFFECT(buttonEffect)
TQTC_CFG_READ_APPEARANCE(lvAppearance, opts->appearance)
TQTC_CFG_READ_APPEARANCE(tabAppearance, opts->appearance)
TQTC_CFG_READ_APPEARANCE(sliderAppearance, opts->appearance)
TQTC_CFG_READ_APPEARANCE(progressAppearance, opts->appearance)
#ifndef TQTC_PLAIN_FOCUS_ONLY
TQTC_CFG_READ_BOOL(stdFocus)
#endif
QTC_CFG_READ_BOOL(lvLines)
QTC_CFG_READ_BOOL(drawStatusBarFrames)
QTC_CFG_READ_BOOL(fillSlider)
QTC_CFG_READ_BOOL(roundMbTopOnly)
QTC_CFG_READ_BOOL(borderMenuitems)
QTC_CFG_READ_BOOL(gradientPbGroove)
QTC_CFG_READ_BOOL(darkerBorders)
QTC_CFG_READ_BOOL(vArrows)
QTC_CFG_READ_BOOL(xCheck)
QTC_CFG_READ_BOOL(framelessGroupBoxes)
QTC_CFG_READ_BOOL(inactiveHighlight)
QTC_CFG_READ_BOOL(colorMenubarMouseOver)
TQTC_CFG_READ_BOOL(lvLines)
TQTC_CFG_READ_BOOL(drawStatusBarFrames)
TQTC_CFG_READ_BOOL(fillSlider)
TQTC_CFG_READ_BOOL(roundMbTopOnly)
TQTC_CFG_READ_BOOL(borderMenuitems)
TQTC_CFG_READ_BOOL(gradientPbGroove)
TQTC_CFG_READ_BOOL(darkerBorders)
TQTC_CFG_READ_BOOL(vArrows)
TQTC_CFG_READ_BOOL(xCheck)
TQTC_CFG_READ_BOOL(framelessGroupBoxes)
TQTC_CFG_READ_BOOL(inactiveHighlight)
TQTC_CFG_READ_BOOL(colorMenubarMouseOver)
#ifdef __cplusplus
QTC_CFG_READ_BOOL(stdSidebarButtons)
QTC_CFG_READ_BOOL(gtkScrollViews)
QTC_CFG_READ_BOOL(gtkComboMenus)
TQTC_CFG_READ_BOOL(stdSidebarButtons)
TQTC_CFG_READ_BOOL(gtkScrollViews)
TQTC_CFG_READ_BOOL(gtkComboMenus)
/*
#else
QTC_CFG_READ_BOOL(setDialogButtonOrder)
TQTC_CFG_READ_BOOL(setDialogButtonOrder)
*/
#endif
#if !defined __cplusplus || defined QTC_CONFIG_DIALOG
QTC_CFG_READ_BOOL(mapKdeIcons)
#if !defined __cplusplus || defined TQTC_CONFIG_DIALOG
TQTC_CFG_READ_BOOL(mapKdeIcons)
#endif
#if defined QTC_CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus
QTC_CFG_READ_BOOL(gtkButtonOrder)
#if defined TQTC_CONFIG_DIALOG || (defined [[[TQT_VERSION IS DEPRECATED]]] && ([[[TQT_VERSION IS DEPRECATED]]] >= 0x040000)) || !defined __cplusplus
TQTC_CFG_READ_BOOL(gtkButtonOrder)
#endif
QTC_CFG_READ_SHADING(shading, shading);
TQTC_CFG_READ_SHADING(shading, shading);
#ifndef __cplusplus
releaseConfig(cfg);
@ -793,7 +793,7 @@ static bool fileExists(const char *path)
static const char * getSystemConfigFile()
{
static const char * constFiles[]={ "/etc/qt4/"QTC_FILE, "/etc/qt3/"QTC_FILE, "/etc/qt/"QTC_FILE, NULL };
static const char * constFiles[]={ "/etc/qt4/"TQTC_FILE, "/etc/qt3/"TQTC_FILE, "/etc/qt/"TQTC_FILE, NULL };
int i;
@ -842,7 +842,7 @@ static void defaultSettings(Options *opts)
opts->thinnerMenuItems=false;
opts->scrollbarType=SCROLLBAR_KDE;
opts->buttonEffect=EFFECT_NONE;
#ifndef QTC_PLAIN_FOCUS_ONLY
#ifndef TQTC_PLAIN_FOCUS_ONLY
opts->stdFocus=true;
#endif
opts->lvLines=false;
@ -857,7 +857,7 @@ static void defaultSettings(Options *opts)
opts->framelessGroupBoxes=false;
opts->colorMenubarMouseOver=false;
opts->inactiveHighlight=false;
#ifdef QTC_CONFIG_DIALOG
#ifdef TQTC_CONFIG_DIALOG
opts->shading=SHADING_HSL;
#endif
#ifdef __cplusplus
@ -880,10 +880,10 @@ static void defaultSettings(Options *opts)
opts->customCheckRadioColor.red=opts->customCheckRadioColor.green=opts->customCheckRadioColor.blue=0;
#endif
#if !defined __cplusplus || defined QTC_CONFIG_DIALOG
#if !defined __cplusplus || defined TQTC_CONFIG_DIALOG
opts->mapKdeIcons=true;
#endif
#if defined QTC_CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus
#if defined TQTC_CONFIG_DIALOG || (defined [[[TQT_VERSION IS DEPRECATED]]] && ([[[TQT_VERSION IS DEPRECATED]]] >= 0x040000)) || !defined __cplusplus
opts->gtkButtonOrder=false;
#endif
@ -1050,9 +1050,9 @@ static const char *toStr(EEffect e)
inline const char * toStr(bool b) { return b ? "true" : "false"; }
static QString toStr(const QColor &col)
static TQString toStr(const TQColor &col)
{
QString colorStr;
TQString colorStr;
colorStr.sprintf("#%02X%02X%02X", col.red(), col.green(), col.blue());
return colorStr;
@ -1100,7 +1100,7 @@ static const char *toStr(ESliderStyle s)
}
}
#if QT_VERSION >= 0x040000
#if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
#define CFG config
#else
#define CFG (*cfg)
@ -1147,11 +1147,11 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
if(xdg)
{
char filename[QTC_MAX_FILENAME_LEN];
char filename[TQTC_MAX_FILENAME_LEN];
sprintf(filename, "%s/"QTC_FILE, xdg);
sprintf(filename, "%s/"TQTC_FILE, xdg);
#if QT_VERSION >= 0x040000
#if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
KConfig defCfg(filename, KConfig::SimpleConfig);
#else
KConfig defCfg(filename, false, false);
@ -1162,10 +1162,10 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
}
else
{
#if QT_VERSION >= 0x040000
KConfigGroup config(cfg, QTC_GROUP);
#if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
KConfigGroup config(cfg, TQTC_GROUP);
#else
cfg->setGroup(QTC_GROUP);
cfg->setGroup(TQTC_GROUP);
#endif
CFG_WRITE_ENTRY_NUM(passwordChar)
CFG_WRITE_ENTRY(round)
@ -1207,7 +1207,7 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
CFG_WRITE_ENTRY_FORCE(tabAppearance)
CFG_WRITE_ENTRY_FORCE(sliderAppearance)
CFG_WRITE_ENTRY_FORCE(progressAppearance)
#ifndef QTC_PLAIN_FOCUS_ONLY
#ifndef TQTC_PLAIN_FOCUS_ONLY
CFG_WRITE_ENTRY(stdFocus)
#endif
CFG_WRITE_ENTRY(lvLines)

@ -1,5 +1,5 @@
#ifndef _QEMBED_1804289383
#define _QEMBED_1804289383
#ifndef _TQEMBED_1804289383
#define _TQEMBED_1804289383
static const unsigned int radio_frame_png_len = 419;
static const unsigned char radio_frame_png_data[] = {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,
@ -215,8 +215,8 @@ static const unsigned char dot_png_data[] = {
0xae,0x42,0x60,0x82
};
#include <qcstring.h>
#include <qdict.h>
#include <tqcstring.h>
#include <tqdict.h>
static struct Embed {
unsigned int size;
const unsigned char *data;
@ -235,14 +235,14 @@ static struct Embed {
{ 0, 0, 0 }
};
static const QByteArray& qembed_findData( const char* name )
static const TQByteArray& qembed_findData( const char* name )
{
static QDict<QByteArray> dict;
QByteArray* ba = dict.find( name );
static TQDict<TQByteArray> dict;
TQByteArray* ba = dict.tqfind( name );
if ( !ba ) {
for ( int i = 0; embed_vec[i].data; i++ ) {
if ( strcmp(embed_vec[i].name, name) == 0 ) {
ba = new QByteArray;
ba = new TQByteArray;
ba->setRawData( (char*)embed_vec[i].data,
embed_vec[i].size );
dict.insert( name, ba );
@ -250,7 +250,7 @@ static const QByteArray& qembed_findData( const char* name )
}
}
if ( !ba ) {
static QByteArray dummy;
static TQByteArray dummy;
return dummy;
}
}

@ -16,7 +16,7 @@
symbols may now refer to different variables
(e.g. if X11 #defined NoButton, after this file
is included NoButton would no longer be X11's
NoButton, but Qt::NoButton instead). At this time,
NoButton, but TQt::NoButton instead). At this time,
there's no conflict known that could cause problems.
The original X11 symbols are still accessible
@ -168,25 +168,25 @@ const int GrayScale = XGrayScale;
#endif
// Affects: Should be without side effects.
#ifdef Status
#ifndef FIXX11H_Status
#define FIXX11H_Status
typedef Status XStatus;
#undef Status
typedef XStatus Status;
#ifdef tqStatus
#ifndef FIXX11H_tqStatus
#define FIXX11H_tqStatus
typedef tqStatus XtqStatus;
#undef tqStatus
typedef XtqStatus tqStatus;
#endif
#undef Status
#undef tqStatus
#endif
// Affects: Should be without side effects.
#ifdef CursorShape
#ifndef FIXX11H_CursorShape
#define FIXX11H_CursorShape
const int XCursorShape = CursorShape;
#undef CursorShape
const int CursorShape = CursorShape;
#ifdef tqCursorShape
#ifndef FIXX11H_tqCursorShape
#define FIXX11H_tqCursorShape
const int XtqCursorShape = tqCursorShape;
#undef tqCursorShape
const int tqCursorShape = tqCursorShape;
#endif
#undef CursorShape
#undef tqCursorShape
#endif
// template --->

File diff suppressed because it is too large Load Diff

@ -4,7 +4,7 @@
* KStyle
* Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org>
*
* QWindowsStyle CC_ListView and style images were kindly donated by TrollTech,
* TQWindowsStyle CC_ListView and style images were kindly donated by TrollTech,
* Copyright (C) 1998-2000 TrollTech AS.
*
* Many thanks to Bradley T. Hughes for the 3 button scrollbar code.
@ -24,50 +24,51 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __QTC_KSTYLE_H
#define __QTC_KSTYLE_H
#ifndef __TQTC_KSTYLE_H
#define __TQTC_KSTYLE_H
// W A R N I N G
// -------------
// This API is still subject to change.
// I will remove this warning when I feel the API is sufficiently flexible.
#include <qcommonstyle.h>
#include <tqcommonstyle.h>
struct QtCKStylePrivate;
struct TQtCKStylePrivate;
/**
* Simplifies and extends the QStyle API to make style coding easier.
* Simplifies and extends the TQStyle API to make style coding easier.
*
* The KStyle class provides a simple internal menu transparency engine
* which attempts to use XRender for accelerated blending where requested,
* or falls back to fast internal software tinting/blending routines.
* It also simplifies more complex portions of the QStyle API, such as
* It also simplifies more complex portions of the TQStyle API, such as
* the PopupMenuItems, ScrollBars and Sliders by providing extra "primitive
* elements" which are simple to implement by the style writer.
*
* @see QStyle::QStyle
* @see QCommonStyle::QCommonStyle
* @see TQStyle::TQStyle
* @see TQCommonStyle::TQCommonStyle
* @author Karol Szwed (gallium@kde.org)
* @version $Id$
*/
class QtCKStyle: public QCommonStyle
class TQtCKStyle: public TQCommonStyle
{
Q_OBJECT
TQ_OBJECT
public:
/**
* QtCKStyle Flags:
* TQtCKStyle Flags:
*
* @li Default - Default style setting, where menu transparency
* and the FilledFrameWorkaround are disabled.
*
* @li AllowMenuTransparency - Enable this flag to use QtCKStyle's
* @li AllowMenuTransparency - Enable this flag to use TQtCKStyle's
* internal menu transparency engine.
*
* @li FilledFrameWorkaround - Enable this flag to facilitate
* proper repaints of QMenuBars and QToolBars when the style chooses
* to paint the interior of a QFrame. The style primitives in question
* proper tqrepaints of TQMenuBars and TQToolBars when the style chooses
* to paint the interior of a TQFrame. The style primitives in question
* are PE_PanelMenuBar and PE_PanelDockWindow. The HighColor style uses
* this workaround to enable painting of gradients in menubars and
* toolbars.
@ -114,9 +115,9 @@ class QtCKStyle: public QCommonStyle
*
* Select the appropriate KStyle flags and scrollbar type
* for your style. The user's style preferences selected in KControl
* are read by using QSettings and are automatically applied to the style.
* are read by using TQSettings and are automatically applied to the style.
* As a fallback, KStyle paints progressbars and tabbars. It inherits from
* QCommonStyle for speed, so don't expect much to be implemented.
* TQCommonStyle for speed, so don't expect much to be implemented.
*
* It is advisable to use a currently implemented style such as the HighColor
* style as a foundation for any new KStyle, so the limited number of
@ -128,18 +129,18 @@ class QtCKStyle: public QCommonStyle
* @see KStyle::KStyleScrollBarType
* @author Karol Szwed (gallium@kde.org)
*/
QtCKStyle( KStyleFlags flags = QtCKStyle::Default,
KStyleScrollBarType sbtype = QtCKStyle::WindowsStyleScrollBar );
TQtCKStyle( KStyleFlags flags = TQtCKStyle::Default,
KStyleScrollBarType sbtype = TQtCKStyle::WindowsStyleScrollBar );
/**
* Destructs the QtCKStyle object.
* Destructs the TQtCKStyle object.
*/
~QtCKStyle();
~TQtCKStyle();
/**
* Returns the default widget style depending on color depth.
*/
static QString defaultStyle();
static TQString defaultStyle();
/**
* Modifies the scrollbar type used by the style.
@ -147,10 +148,10 @@ class QtCKStyle: public QCommonStyle
* This function is only provided for convenience. It allows
* you to make a late decision about what scrollbar type to use for the
* style after performing some processing in your style's constructor.
* In most situations however, setting the scrollbar type via the QtCKStyle
* In most situations however, setting the scrollbar type via the TQtCKStyle
* constructor should suffice.
* @param sbtype the scroll bar type
* @see QtCKStyle::KStyleScrollBarType
* @see TQtCKStyle::KStyleScrollBarType
*/
void setScrollBarType(KStyleScrollBarType sbtype);
@ -164,9 +165,9 @@ class QtCKStyle: public QCommonStyle
/**
* KStyle Primitive Elements:
*
* The KStyle class extends the Qt's Style API by providing certain
* simplifications for parts of QStyle. To do this, the KStylePrimitive
* elements were defined, which are very similar to Qt's PrimitiveElement.
* The KStyle class extends the TQt's Style API by providing certain
* simplifications for parts of TQStyle. To do this, the KStylePrimitive
* elements were defined, which are very similar to TQt's PrimitiveElement.
*
* The first three Handle primitives simplify and extend PE_DockWindowHandle,
* so do not reimplement PE_DockWindowHandle if you want the KStyle handle
@ -182,10 +183,10 @@ class QtCKStyle: public QCommonStyle
*
* @li KPE_ToolBarHandle - This primitive must be reimplemented. It currently
* only paints a filled rectangle as default behavior. This primitive is used
* to render QToolBar handles.
* to render TQToolBar handles.
*
* @li KPE_GeneralHandle - This primitive must be reimplemented. It is used
* to render general handles that are not part of a QToolBar or QDockWindow, such
* to render general handles that are not part of a TQToolBar or TQDockWindow, such
* as the applet handles used in Kicker. The default implementation paints a filled
* rect of arbitrary color.
*
@ -198,7 +199,7 @@ class QtCKStyle: public QCommonStyle
* arbitrary color.
*
* @li KPE_ListViewExpander - This primitive is already implemented in KStyle. It
* is used to draw the Expand/Collapse element in QListViews. To indicate the
* is used to draw the Expand/Collapse element in TQListViews. To indicate the
* expanded state, the style flags are set to Style_Off, while Style_On implies collapsed.
*
* @li KPE_ListViewBranch - This primitive is already implemented in KStyle. It is
@ -217,21 +218,21 @@ class QtCKStyle: public QCommonStyle
};
/**
* This function is identical to Qt's QStyle::drawPrimitive(), except that
* This function is identical to TQt's TQStyle::drawPrimitive(), except that
* it adds one further parameter, 'widget', that can be used to determine
* the widget state of the KStylePrimitive in question.
*
* @see KStyle::KStylePrimitive
* @see QStyle::drawPrimitive
* @see QStyle::drawComplexControl
* @see TQStyle::drawPrimitive
* @see TQStyle::tqdrawComplexControl
*/
virtual void drawKStylePrimitive( KStylePrimitive kpe,
QPainter* p,
const QWidget* widget,
const QRect &r,
const QColorGroup &cg,
TQPainter* p,
const TQWidget* widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
enum KStylePixelMetric {
@ -246,76 +247,76 @@ class QtCKStyle: public QCommonStyle
KPM_ListViewBranchThickness = 0x00000100
};
int kPixelMetric( KStylePixelMetric kpm, const QWidget* widget = 0 ) const;
int kPixelMetric( KStylePixelMetric kpm, const TQWidget* widget = 0 ) const;
// ---------------------------------------------------------------------------
void polish( QWidget* widget );
void unPolish( QWidget* widget );
void polishPopupMenu( QPopupMenu* );
void polish( TQWidget* widget );
void unPolish( TQWidget* widget );
void polishPopupMenu( TQPopupMenu* );
void drawPrimitive( PrimitiveElement pe,
QPainter* p,
const QRect &r,
const QColorGroup &cg,
TQPainter* p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
void drawControl( ControlElement element,
QPainter* p,
const QWidget* widget,
const QRect &r,
const QColorGroup &cg,
void tqdrawControl( ControlElement element,
TQPainter* p,
const TQWidget* widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
void drawComplexControl( ComplexControl control,
QPainter *p,
const QWidget* widget,
const QRect &r,
const QColorGroup &cg,
void tqdrawComplexControl( ComplexControl control,
TQPainter *p,
const TQWidget* widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
SCFlags controls = SC_All,
SCFlags active = SC_None,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
SubControl querySubControl( ComplexControl control,
const QWidget* widget,
const QPoint &pos,
const QStyleOption& = QStyleOption::Default ) const;
const TQWidget* widget,
const TQPoint &pos,
const TQStyleOption& = TQStyleOption::Default ) const;
QRect querySubControlMetrics( ComplexControl control,
const QWidget* widget,
TQRect querySubControlMetrics( ComplexControl control,
const TQWidget* widget,
SubControl sc,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
int pixelMetric( PixelMetric m,
const QWidget* widget = 0 ) const;
int tqpixelMetric( PixelMetric m,
const TQWidget* widget = 0 ) const;
QRect subRect( SubRect r,
const QWidget* widget ) const;
TQRect subRect( SubRect r,
const TQWidget* widget ) const;
QPixmap stylePixmap( StylePixmap stylepixmap,
const QWidget* widget = 0,
const QStyleOption& = QStyleOption::Default ) const;
TQPixmap stylePixmap( StylePixmap stylepixmap,
const TQWidget* widget = 0,
const TQStyleOption& = TQStyleOption::Default ) const;
int styleHint( StyleHint sh,
const QWidget* w = 0,
const QStyleOption &opt = QStyleOption::Default,
QStyleHintReturn* shr = 0 ) const;
int tqstyleHint( StyleHint sh,
const TQWidget* w = 0,
const TQStyleOption &opt = TQStyleOption::Default,
TQStyleHintReturn* shr = 0 ) const;
protected:
bool eventFilter( QObject* object, QEvent* event );
bool eventFilter( TQObject* object, TQEvent* event );
private:
// Disable copy constructor and = operator
QtCKStyle( const QtCKStyle & );
QtCKStyle& operator=( const QtCKStyle & );
TQtCKStyle( const TQtCKStyle & );
TQtCKStyle& operator=( const TQtCKStyle & );
protected:
virtual void virtual_hook( int id, void* data );
private:
QtCKStylePrivate *d;
TQtCKStylePrivate *d;
};

File diff suppressed because it is too large Load Diff

@ -1,8 +1,8 @@
#ifndef __QTCURVE_H__
#define __QTCURVE_H__
#ifndef __TQTCURVE_H__
#define __TQTCURVE_H__
/*
QtCurve (C) Craig Drummond, 2003 - 2010 craig.p.drummond@gmail.com
TQtCurve (C) Craig Drummond, 2003 - 2010 craig.p.drummond@gmail.com
----
@ -51,32 +51,33 @@
*/
#include "config.h"
#ifdef QTC_QT_ONLY
#include "qtc_kstyle.h"
#ifdef TQTC_TQT_ONLY
#include "tqtc_kstyle.h"
#else
#include <kdeversion.h>
#include <kstyle.h>
#endif
#include <qcolor.h>
#include <qpoint.h>
#include <qpalette.h>
#include <qpixmap.h>
#include <qcache.h>
#include <qvaluelist.h>
#include <tqcolor.h>
#include <tqpoint.h>
#include <tqpalette.h>
#include <tqpixmap.h>
#include <tqcache.h>
#include <tqvaluelist.h>
#include "common.h"
class QTimer;
class QSlider;
class TQTimer;
class TQSlider;
#ifdef QTC_QT_ONLY
#define BASE_STYLE QtCKStyle
#ifdef TQTC_TQT_ONLY
#define BASE_STYLE TQtCKStyle
#else
#define BASE_STYLE KStyle
#endif
class QtCurveStyle : public BASE_STYLE
class TQtCurveStyle : public BASE_STYLE
{
Q_OBJECT
TQ_OBJECT
public:
@ -87,7 +88,7 @@ class QtCurveStyle : public BASE_STYLE
APP_OPENOFFICE,
APP_MACTOR,
APP_KPRESENTER,
APP_KONQUEROR,
APP_KONTQUEROR,
APP_SKIP_TASKBAR,
APP_KPRINTER,
APP_KDIALOG,
@ -125,136 +126,136 @@ class QtCurveStyle : public BASE_STYLE
ENTRY_NONE
};
#ifdef QTC_STYLE_SUPPORT
QtCurveStyle(const QString &name=QString());
#ifdef TQTC_STYLE_SUPPORT
TQtCurveStyle(const TQString &name=TQString());
#else
QtCurveStyle();
TQtCurveStyle();
#endif
virtual ~QtCurveStyle();
virtual ~TQtCurveStyle();
void polish(QApplication *app);
void polish(QPalette &pal);
QColorGroup setColorGroup(const QColorGroup &old, const QColorGroup &act, bool dis=false);
void polish(QWidget *widget);
void unPolish(QWidget *widget);
void drawLightBevel(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags,
int round, const QColor &fill, const QColor *custom=NULL,
void polish(TQApplication *app);
void polish(TQPalette &pal);
TQColorGroup setColorGroup(const TQColorGroup &old, const TQColorGroup &act, bool dis=false);
void polish(TQWidget *widget);
void unPolish(TQWidget *widget);
void drawLightBevel(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags,
int round, const TQColor &fill, const TQColor *custom=NULL,
bool doBorder=true, bool doCorners=true, EWidget w=WIDGET_OTHER) const
{ drawLightBevel(cg.background(), p, r, cg, flags, round, fill, custom, doBorder, doCorners, w); }
void drawLightBevel(const QColor &bgnd, QPainter *p, const QRect &r, const QColorGroup &cg,
SFlags flags, int round, const QColor &fill, const QColor *custom=NULL,
void drawLightBevel(const TQColor &bgnd, TQPainter *p, const TQRect &r, const TQColorGroup &cg,
SFlags flags, int round, const TQColor &fill, const TQColor *custom=NULL,
bool doBorder=true, bool doCorners=true, EWidget w=WIDGET_OTHER) const;
void drawGlow(QPainter *p, const QRect &r, const QColorGroup &cg, EWidget w, const QColor *cols=0) const;
void drawEtch(QPainter *p, const QRect &r, const QColorGroup &cg, bool raised=false, bool square=false) const;
void drawBorder(const QColor &bgnd, QPainter *p, const QRect &r, const QColorGroup &cg,
SFlags flags, int round, const QColor *custom=NULL, EWidget w=WIDGET_OTHER,
void drawGlow(TQPainter *p, const TQRect &r, const TQColorGroup &cg, EWidget w, const TQColor *cols=0) const;
void drawEtch(TQPainter *p, const TQRect &r, const TQColorGroup &cg, bool raised=false, bool square=false) const;
void drawBorder(const TQColor &bgnd, TQPainter *p, const TQRect &r, const TQColorGroup &cg,
SFlags flags, int round, const TQColor *custom=NULL, EWidget w=WIDGET_OTHER,
bool doCorners=true, EBorder borderProfile=BORDER_FLAT, bool blendBorderColors=true, int borderVal=STD_BORDER) const;
void drawMdiIcon(QPainter *painter, const QColor &color, const QColor &shadow, const QRect &r, bool sunken, int margin,
void drawMdiIcon(TQPainter *painter, const TQColor &color, const TQColor &shadow, const TQRect &r, bool sunken, int margin,
SubControl button) const;
void drawWindowIcon(QPainter *painter, const QColor &color, const QRect &r, bool sunken, int margin, SubControl button) const;
void drawEntryField(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags,
void drawWindowIcon(TQPainter *painter, const TQColor &color, const TQRect &r, bool sunken, int margin, SubControl button) const;
void drawEntryField(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags,
EntryColor coloration, int round, EWidget=WIDGET_ENTRY) const;
void drawArrow(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags,
QStyle::PrimitiveElement pe, bool small=false, bool checkActive=false) const;
void drawPrimitive(PrimitiveElement, QPainter *, const QRect &, const QColorGroup &,
SFlags = Style_Default, const QStyleOption & = QStyleOption::Default) const;
void drawKStylePrimitive(KStylePrimitive kpe, QPainter* p, const QWidget* widget, const QRect &r,
const QColorGroup &cg, SFlags flags, const QStyleOption &opt ) const;
void drawControl(ControlElement, QPainter *, const QWidget *, const QRect &, const QColorGroup &,
SFlags = Style_Default, const QStyleOption & = QStyleOption::Default) const;
void drawControlMask(ControlElement, QPainter *, const QWidget *, const QRect &,
const QStyleOption & = QStyleOption::Default) const;
void drawComplexControlMask(ComplexControl control, QPainter *p, const QWidget *widget,
const QRect &r, const QStyleOption &data) const;
QRect subRect(SubRect, const QWidget *) const;
void drawComplexControl(ComplexControl, QPainter *, const QWidget *, const QRect &,
const QColorGroup &, SFlags = Style_Default, SCFlags = SC_All,
SCFlags = SC_None, const QStyleOption & = QStyleOption::Default) const;
QRect querySubControlMetrics(ComplexControl, const QWidget *, SubControl,
const QStyleOption & = QStyleOption::Default) const;
int pixelMetric(PixelMetric, const QWidget *widget= 0) const;
int kPixelMetric(KStylePixelMetric kpm, const QWidget *widget) const;
QSize sizeFromContents(ContentsType, const QWidget *, const QSize &,
const QStyleOption & = QStyleOption::Default) const;
int styleHint(StyleHint, const QWidget *widget= 0, const QStyleOption & = QStyleOption::Default,
QStyleHintReturn *returnData= 0) const;
void drawItem(QPainter *p, const QRect &r, int flags, const QColorGroup &cg, bool enabled,
const QPixmap *pixmap, const QString &text, int len=-1, const QColor *penColor=0) const;
void drawArrow(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags,
TQ_PrimitiveElement pe, bool small=false, bool checkActive=false) const;
void tqdrawPrimitive(TQ_PrimitiveElement, TQPainter *, const TQRect &, const TQColorGroup &,
SFlags = Style_Default, const TQStyleOption & = TQStyleOption::Default) const;
void drawKStylePrimitive(KStylePrimitive kpe, TQPainter* p, const TQWidget* widget, const TQRect &r,
const TQColorGroup &cg, SFlags flags, const TQStyleOption &opt ) const;
void tqdrawControl(ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQColorGroup &,
SFlags = Style_Default, const TQStyleOption & = TQStyleOption::Default) const;
void tqdrawControlMask(ControlElement, TQPainter *, const TQWidget *, const TQRect &,
const TQStyleOption & = TQStyleOption::Default) const;
void tqdrawComplexControlMask(ComplexControl control, TQPainter *p, const TQWidget *widget,
const TQRect &r, const TQStyleOption &data) const;
TQRect subRect(SubRect, const TQWidget *) const;
void tqdrawComplexControl(ComplexControl, TQPainter *, const TQWidget *, const TQRect &,
const TQColorGroup &, SFlags = Style_Default, SCFlags = SC_All,
SCFlags = SC_None, const TQStyleOption & = TQStyleOption::Default) const;
TQRect querySubControlMetrics(TQ_ComplexControl, const TQWidget *, SubControl,
const TQStyleOption & = TQStyleOption::Default) const;
int tqpixelMetric(PixelMetric, const TQWidget *widget= 0) const;
int kPixelMetric(KStylePixelMetric kpm, const TQWidget *widget) const;
TQSize tqsizeFromContents(ContentsType, const TQWidget *, const TQSize &,
const TQStyleOption & = TQStyleOption::Default) const;
int tqstyleHint(StyleHint, const TQWidget *widget= 0, const TQStyleOption & = TQStyleOption::Default,
TQStyleHintReturn *returnData= 0) const;
void drawItem(TQPainter *p, const TQRect &r, int flags, const TQColorGroup &cg, bool enabled,
const TQPixmap *pixmap, const TQString &text, int len=-1, const TQColor *penColor=0) const;
protected:
bool appIsNotEmbedded(QDialog *dlg);
bool eventFilter(QObject *object, QEvent *event);
void drawMenuItem(QPainter *p, const QRect &r, int flags, const QColorGroup &cg,
bool mbi, int round, const QColor &bgnd, const QColor *cols) const;
void drawProgress(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, int round,
const QWidget *widget) const;
void drawBevelGradient(const QColor &base, QPainter *p, QRect const &r,
bool appIsNotEmbedded(TQDialog *dlg);
bool eventFilter(TQObject *object, TQEvent *event);
void drawMenuItem(TQPainter *p, const TQRect &r, int flags, const TQColorGroup &cg,
bool mbi, int round, const TQColor &bgnd, const TQColor *cols) const;
void drawProgress(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags, int round,
const TQWidget *widget) const;
void drawBevelGradient(const TQColor &base, TQPainter *p, TQRect const &r,
bool horiz, bool sel, EAppearance bevApp, EWidget w=WIDGET_OTHER) const;
void drawBevelGradientReal(const QColor &base, QPainter *p, QRect const &r,
void drawBevelGradientReal(const TQColor &base, TQPainter *p, TQRect const &r,
bool horiz, bool sel, EAppearance bevApp, EWidget w=WIDGET_OTHER) const;
void drawGradient(const QColor &top, const QColor &bot, QPainter *p, const QRect &r, bool horiz=true) const;
void drawSbSliderHandle(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, bool slider=false) const;
void drawSliderHandle(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, QSlider *slider, bool tb=false) const;
void drawSliderGroove(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags,
const QWidget *widget) const;
void drawMenuOrToolBarBackground(QPainter *p, const QRect &r, const QColorGroup &cg, bool menu=true, bool horiz=true) const;
void drawHandleMarkers(QPainter *p, const QRect &r, SFlags flags, bool tb, ELine handles) const;
void drawHighlight(QPainter *p, const QRect &r, const QColorGroup &cg, bool horiz, bool inc) const;
void drawGradient(const TQColor &top, const TQColor &bot, TQPainter *p, const TQRect &r, bool horiz=true) const;
void drawSbSliderHandle(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags, bool slider=false) const;
void drawSliderHandle(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags, TQSlider *slider, bool tb=false) const;
void drawSliderGroove(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags,
const TQWidget *widget) const;
void drawMenuOrToolBarBackground(TQPainter *p, const TQRect &r, const TQColorGroup &cg, bool menu=true, bool horiz=true) const;
void drawHandleMarkers(TQPainter *p, const TQRect &r, SFlags flags, bool tb, ELine handles) const;
void drawHighlight(TQPainter *p, const TQRect &r, const TQColorGroup &cg, bool horiz, bool inc) const;
private:
static QColor shadowColor(const QColor col)
static TQColor shadowColor(const TQColor col)
{
return qGray(col.rgb()) < 100 ? QColor(255, 255, 255) : QColor(0, 0, 0);
return tqGray(col.rgb()) < 100 ? TQColor(255, 255, 255) : TQColor(0, 0, 0);
}
void shadeColors(const QColor &base, QColor *vals) const;
const QColor * buttonColors(const QColorGroup &cg) const;
const QColor * checkRadioColors(const QColorGroup &cg, SFlags flags) const;
const QColor * sliderColors(/*const QColorGroup &cg, */SFlags flags) const;
const QColor * backgroundColors(const QColor &c) const;
const QColor * backgroundColors(const QColorGroup &cg) const
void shadeColors(const TQColor &base, TQColor *vals) const;
const TQColor * buttonColors(const TQColorGroup &cg) const;
const TQColor * checkRadioColors(const TQColorGroup &cg, SFlags flags) const;
const TQColor * sliderColors(/*const TQColorGroup &cg, */SFlags flags) const;
const TQColor * backgroundColors(const TQColor &c) const;
const TQColor * backgroundColors(const TQColorGroup &cg) const
{ return backgroundColors(cg.background()); }
const QColor * borderColors(SFlags flags, const QColor *use) const;
const QColor * getSidebarButtons() const;
void setMenuColors(const QColorGroup &cg);
const QColor * menuColors(const QColorGroup &cg, bool active) const;
const TQColor * borderColors(SFlags flags, const TQColor *use) const;
const TQColor * getSidebarButtons() const;
void setMenuColors(const TQColorGroup &cg);
const TQColor * menuColors(const TQColorGroup &cg, bool active) const;
void setDecorationColors(bool init=false);
const QColor * getMdiColors(const QColorGroup &cg, bool active) const;
const TQColor * getMdiColors(const TQColorGroup &cg, bool active) const;
#ifdef SET_MDI_WINDOW_BUTTON_POSITIONS
void readMdiPositions() const;
#endif
bool redrawHoverWidget(const QPoint &pos);
const QColor & getFill(SFlags flags, const QColor *use, bool cr=false, bool darker=false) const;
const QColor & getListViewFill(SFlags flags, const QColor *use) const;
const QColor & getTabFill(bool current, bool highlight, const QColor *use) const;
const QColor & menuStripeCol() const;
const QColor & checkRadioCol(SFlags flags, const QColorGroup &cg) const;
QColor shade(const QColor &a, float k) const;
bool redrawHoverWidget(const TQPoint &pos);
const TQColor & getFill(SFlags flags, const TQColor *use, bool cr=false, bool darker=false) const;
const TQColor & getListViewFill(SFlags flags, const TQColor *use) const;
const TQColor & getTabFill(bool current, bool highlight, const TQColor *use) const;
const TQColor & menuStripeCol() const;
const TQColor & checkRadioCol(SFlags flags, const TQColorGroup &cg) const;
TQColor shade(const TQColor &a, float k) const;
void shade(const color &ca, color *cb, double k) const;
void drawDot(QPainter *p, const QRect &r, const QColor *cols) const;
QPixmap * getPixelPixmap(const QColor col) const;
QPixmap * getPixmap(const QColor col, EPixmap pix, double shade=1.0) const;
QPixmap * createStripePixmap(const QColor &col, bool forWindow) const;
void drawDot(TQPainter *p, const TQRect &r, const TQColor *cols) const;
TQPixmap * getPixelPixmap(const TQColor col) const;
TQPixmap * getPixmap(const TQColor col, EPixmap pix, double shade=1.0) const;
TQPixmap * createStripePixmap(const TQColor &col, bool forWindow) const;
void setSbType();
bool isFormWidget(const QWidget *w) const { return itsKhtmlWidgets.contains(w); }
bool isFormWidget(const TQWidget *w) const { return itsKhtmlWidgets.tqcontains(w); }
void resetHover();
bool isWindowDragWidget(QObject *o, const QPoint &pos=QPoint());
bool isWindowDragWidget(TQObject *o, const TQPoint &pos=TQPoint());
private slots:
void updateProgressPos();
void progressBarDestroyed(QObject *bar);
void progressBarDestroyed(TQObject *bar);
void sliderThumbMoved(int val);
void khtmlWidgetDestroyed(QObject *o);
void hoverWidgetDestroyed(QObject *o);
void khtmlWidgetDestroyed(TQObject *o);
void hoverWidgetDestroyed(TQObject *o);
private:
mutable Options opts;
QColor itsHighlightCols[TOTAL_SHADES+1],
TQColor itsHighlightCols[TOTAL_SHADES+1],
itsBackgroundCols[TOTAL_SHADES+1],
itsMenubarCols[TOTAL_SHADES+1],
itsFocusCols[TOTAL_SHADES+1],
@ -268,32 +269,32 @@ class QtCurveStyle : public BASE_STYLE
itsButtonCols[TOTAL_SHADES+1],
itsLighterPopupMenuBgndCol,
itsCheckRadioCol;
mutable QColor *itsSidebarButtonsCols;
mutable QColor *itsActiveMdiColors;
mutable QColor *itsMdiColors;
mutable QColor itsActiveMdiTextColor;
mutable QColor itsMdiTextColor;
mutable QColor itsColoredButtonCols[TOTAL_SHADES+1];
mutable QColor itsColoredBackgroundCols[TOTAL_SHADES+1];
mutable TQColor *itsSidebarButtonsCols;
mutable TQColor *itsActiveMdiColors;
mutable TQColor *itsMdiColors;
mutable TQColor itsActiveMdiTextColor;
mutable TQColor itsMdiTextColor;
mutable TQColor itsColoredButtonCols[TOTAL_SHADES+1];
mutable TQColor itsColoredBackgroundCols[TOTAL_SHADES+1];
EApp itsThemedApp;
mutable QCache<QPixmap> itsPixmapCache;
#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200
mutable TQCache<TQPixmap> itsPixmapCache;
#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200
bool itsIsTransKicker;
#endif
EHover itsHover;
QPoint itsOldPos;
TQPoint itsOldPos;
mutable bool itsFormMode;
QWidget *itsHoverWidget;
TQWidget *itsHoverWidget;
int itsHoverSect;
QTab *itsHoverTab;
QPalette *itsMactorPal;
QMap<QWidget*, int> itsProgAnimWidgets;
QMap<const QWidget*, bool> itsKhtmlWidgets;
QTimer *itsAnimationTimer;
TQTab *itsHoverTab;
TQPalette *itsMactorPal;
TQMap<TQWidget*, int> itsProgAnimWidgets;
TQMap<const TQWidget*, bool> itsKhtmlWidgets;
TQTimer *itsAnimationTimer;
mutable bool itsActive,
itsIsSpecialHover;
mutable QValueList<int> itsMdiButtons[2]; // 0=left, 1=right
QWidget *itsDragWidget;
mutable TQValueList<int> itsMdiButtons[2]; // 0=left, 1=right
TQWidget *itsDragWidget;
bool itsDragWidgetHadMouseTracking;
};

Loading…
Cancel
Save