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 13 years ago
parent b23b8edce7
commit d1fb90134a

@ -40,7 +40,8 @@ else (NOT QTC_QT_ONLY)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
include(QtCurveQt3) include(QtCurveQt3)
if (QT_PLUGINS_DIR MATCHES NOTFOUND) 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 (QT_PLUGINS_DIR MATCHES NOTFOUND)
endif (NOT QTC_QT_ONLY) endif (NOT QTC_QT_ONLY)
@ -50,6 +51,15 @@ exec_program(kde-config
OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX) OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX)
endif (NOT QTC_QT_ONLY) 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 exec_program(kde-config
ARGS --install locale --expandvars ARGS --install locale --expandvars
OUTPUT_VARIABLE KDE3_LOCALE_PREFIX) OUTPUT_VARIABLE KDE3_LOCALE_PREFIX)

@ -1,6 +1,6 @@
/* /*
This file is taken from kcolorspaces.cpp and kcolorutils.cpp from kdelibs 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 /* 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> #include <math.h>
#ifdef __cplusplus #ifdef __cplusplus
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
#define FLOAT_COLOR(VAL, COL) (VAL).COL##F() #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 #else
#define FLOAT_COLOR(VAL, COL) ((double)(((VAL).COL()*1.0)/255.0)) #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 #endif
#else #else
#define inline #define inline
@ -67,7 +67,7 @@ static inline double ColorUtils_wrap(double a)
static const double yc[3] = { 0.299, 0.587, 0.114 }; static const double yc[3] = { 0.299, 0.587, 0.114 };
#elif HCY_REC == 709 #elif HCY_REC == 709
static const double yc[3] = {0.2126, 0.7152, 0.0722}; 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 }; static const double yc[3] = { 0.34375, 0.5, 0.15625 };
#endif #endif

@ -2,7 +2,7 @@
#define __COMMON_H__ #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 /* 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 <string.h>
#include <stdarg.h> #include <stdarg.h>
#include <math.h> #include <math.h>
#include "config.h" #include "config.h"
#if defined _WIN32 && defined QT_VERSION && (QT_VERSION >= 0x040000) #if defined _WIN32 && (0x039999 >= 0x040000)
#include <sys/stat.h> #include <sys/stat.h>
#include <float.h> #include <float.h>
#include <direct.h> #include <direct.h>
@ -66,28 +66,28 @@ typedef enum
} EShading; } EShading;
#ifdef __cplusplus #ifdef __cplusplus
#include <qconfig.h> #include <tqconfig.h>
#ifdef CONFIG_DIALOG #ifdef CONFIG_DIALOG
#include <qapplication.h> #include <tqapplication.h>
#endif #endif
#include <map> #include <map>
#include <set> #include <set>
#if !defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION >= 0x040000) #if !defined CONFIG_DIALOG && (0x039999 >= 0x040000)
#include <QtCore/QString> #include <TQtCore/TQString>
#endif #endif
#else #else
#include <glib.h> #include <glib.h>
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
#include <qpixmap.h> #include <tqpixmap.h>
typedef QColor color; typedef TQColor color;
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
#include <QtCore/QSet> #include <TQtCore/TQSet>
typedef QSet<QString> Strings; typedef TQSet<TQString> Strings;
#else #else
typedef QStringList Strings; typedef TQStringList Strings;
#endif #endif
#else #else
@ -182,14 +182,14 @@ enum
#define SUNKEN_BEVEL_DARK_ALPHA(X) (X.value()/800.0) // 0.25 #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 SUNKEN_BEVEL_LIGHT_ALPHA(X) (X.value()/500.0) // 0.40
#define MENU_SIZE_ATOM "_QTCURVE_MENUBAR_SIZE_" #define MENU_SIZE_ATOM "_TQTCURVE_MENUBAR_SIZE_"
#define STATUSBAR_ATOM "_QTCURVE_STATUSBAR_" #define STATUSBAR_ATOM "_TQTCURVE_STATUSBAR_"
#define TITLEBAR_SIZE_ATOM "_QTCURVE_TITLEBAR_SIZE_" #define TITLEBAR_SIZE_ATOM "_TQTCURVE_TITLEBAR_SIZE_"
#define ACTIVE_WINDOW_ATOM "_QTCURVE_ACTIVE_WINDOW_" #define ACTIVE_WINDOW_ATOM "_TQTCURVE_ACTIVE_WINDOW_"
#define TOGGLE_MENUBAR_ATOM "_QTCURVE_TOGGLE_MENUBAR_" #define TOGGLE_MENUBAR_ATOM "_TQTCURVE_TOGGLE_MENUBAR_"
#define TOGGLE_STATUSBAR_ATOM "_QTCURVE_TOGGLE_STATUSBAR_" #define TOGGLE_STATUSBAR_ATOM "_TQTCURVE_TOGGLE_STATUSBAR_"
#define OPACITY_ATOM "_QTCURVE_OPACITY_" #define OPACITY_ATOM "_TQTCURVE_OPACITY_"
#define BGND_ATOM "_QTCURVE_BGND_" #define BGND_ATOM "_TQTCURVE_BGND_"
#define BLEND_TITLEBAR (opts.menubarAppearance==opts.titlebarAppearance && opts.menubarAppearance==opts.inactiveTitlebarAppearance && \ #define BLEND_TITLEBAR (opts.menubarAppearance==opts.titlebarAppearance && opts.menubarAppearance==opts.inactiveTitlebarAppearance && \
!(opts.windowBorder&WINDOW_BORDER_BLEND_TITLEBAR) && SHADE_WINDOW_BORDER==opts.shadeMenubars && opts.windowDrag) !(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 FULLLY_ROUNDED (opts.round>=ROUND_FULL)
#define DO_EFFECT (EFFECT_NONE!=opts.buttonEffect) #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) #define SLIDER_GLOW (DO_EFFECT && MO_GLOW==opts.coloredMouseOver /*&& SLIDER_TRIANGULAR!=opts.sliderStyle*/ ? 2 : 0)
#endif #endif
#define ENTRY_MO (opts.unifyCombo && opts.unifySpin) #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_ALPHA 0.08
#define FOCUS_GLOW_LINE_ALPHA 0.5 #define FOCUS_GLOW_LINE_ALPHA 0.5
#define BORDER_BLEND_ALPHA 0.7 #define BORDER_BLEND_ALPHA 0.7
#define ETCH_TOP_ALPHA 0.055 #define ETCH_TOP_ALPHA 0.055
#define ETCH_BOTTOM_ALPHA 0.1 #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_TOP_ALPHA 0.055
// #define ETCH_RADIO_BOTTOM_ALPHA 0.80 // #define ETCH_RADIO_BOTTOM_ALPHA 0.80
// #else // #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_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_OUTER_ALPHA qtcRingAlpha[2] //0.5
#define RINGS_WIDTH(T) (IMG_SQUARE_RINGS==T ? 260 : 450) #define RINGS_WIDTH(T) (IMG_STQUARE_RINGS==T ? 260 : 450)
#define RINGS_HEIGHT(T) (IMG_SQUARE_RINGS==T ? 220 : 360) #define RINGS_HEIGHT(T) (IMG_STQUARE_RINGS==T ? 220 : 360)
#define RINGS_SQUARE_LARGE_ALPHA (RINGS_OUTER_ALPHA*0.675) #define RINGS_STQUARE_LARGE_ALPHA (RINGS_OUTER_ALPHA*0.675)
#define RINGS_SQUARE_SMALL_ALPHA (RINGS_OUTER_ALPHA*0.50) #define RINGS_STQUARE_SMALL_ALPHA (RINGS_OUTER_ALPHA*0.50)
#define RINGS_SQUARE_LINE_WIDTH 20.0 #define RINGS_STQUARE_LINE_WIDTH 20.0
#define RINGS_SQUARE_RADIUS 18.0 #define RINGS_STQUARE_RADIUS 18.0
#define RINGS_SQUARE_LARGE_SIZE 120.0 #define RINGS_STQUARE_LARGE_SIZE 120.0
#define RINGS_SQUARE_SMALL_SIZE 100.0 #define RINGS_STQUARE_SMALL_SIZE 100.0
#if !defined __cplusplus #if !defined __cplusplus
#define MENU_AND_TOOLTIP_RADIUS (opts.round>=ROUND_FULL ? 5.0 : 3.5) #define MENU_AND_TOOLTIP_RADIUS (opts.round>=ROUND_FULL ? 5.0 : 3.5)
@ -416,48 +416,48 @@ enum
#endif #endif
#if defined __cplusplus && defined QT_VERSION && (QT_VERSION >= 0x040000) #if defined __cplusplus && (0x039999 >= 0x040000)
#include <qstyle.h> #include <tqstyle.h>
typedef enum typedef enum
{ {
QtC_Round = QStyle::PM_CustomBase, TQtC_Round = TQStyle::PM_CustomBase,
QtC_TitleBarButtonAppearance, TQtC_TitleBarButtonAppearance,
QtC_TitleAlignment, TQtC_TitleAlignment,
QtC_TitleBarButtons, TQtC_TitleBarButtons,
QtC_TitleBarIcon, TQtC_TitleBarIcon,
QtC_TitleBarIconColor, TQtC_TitleBarIconColor,
QtC_TitleBarEffect, TQtC_TitleBarEffect,
QtC_BlendMenuAndTitleBar, TQtC_BlendMenuAndTitleBar,
QtC_ShadeMenubarOnlyWhenActive, TQtC_ShadeMenubarOnlyWhenActive,
QtC_ToggleButtons, TQtC_ToggleButtons,
QtC_MenubarColor, TQtC_MenubarColor,
QtC_WindowBorder, TQtC_WindowBorder,
QtC_CustomBgnd, TQtC_CustomBgnd,
QtC_TitleBarApp TQtC_TitleBarApp
} QtCMetrics; } TQtCMetrics;
#define QtC_StateKWin ((QStyle::StateFlag)0x10000000) #define TQtC_StateKWin ((TQStyle::StateFlag)0x10000000)
// PE_FrameWindow // PE_FrameWindow
#define QtC_StateKWinNotFull ((QStyle::StateFlag)0x20000000) #define TQtC_StateKWinNotFull ((TQStyle::StateFlag)0x20000000)
// CC_TitleBar // CC_TitleBar
#define QtC_StateKWinFillBgnd ((QStyle::StateFlag)0x20000000) #define TQtC_StateKWinFillBgnd ((TQStyle::StateFlag)0x20000000)
#define QtC_StateKWinNoBorder ((QStyle::StateFlag)0x40000000) #define TQtC_StateKWinNoBorder ((TQStyle::StateFlag)0x40000000)
#define QtC_StateKWinCompositing ((QStyle::StateFlag)0x80000000) #define TQtC_StateKWinCompositing ((TQStyle::StateFlag)0x80000000)
#define QtC_StateKWinTabDrag ((QStyle::StateFlag)0x00000001) #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 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 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_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 #endif
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) #if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
#define QTCURVE_PREVIEW_CONFIG "QTCURVE_PREVIEW_CONFIG" #define TQTCURVE_PREVIEW_CONFIG "TQTCURVE_PREVIEW_CONFIG"
#define QTCURVE_PREVIEW_CONFIG_FULL "QTCURVE_PREVIEW_CONFIG_FULL" #define TQTCURVE_PREVIEW_CONFIG_FULL "TQTCURVE_PREVIEW_CONFIG_FULL"
typedef enum typedef enum
{ {
@ -512,7 +512,7 @@ typedef enum
#define TBAR_VERSION_HACK 65535 #define TBAR_VERSION_HACK 65535
#define TBAR_BORDER_VERSION_HACK (TBAR_VERSION_HACK+1000) #define TBAR_BORDER_VERSION_HACK (TBAR_VERSION_HACK+1000)
typedef std::map<int, QColor> TBCols; typedef std::map<int, TQColor> TBCols;
#endif #endif
typedef enum typedef enum
@ -529,7 +529,7 @@ typedef enum
IMG_NONE, IMG_NONE,
IMG_BORDERED_RINGS, IMG_BORDERED_RINGS,
IMG_PLAIN_RINGS, IMG_PLAIN_RINGS,
IMG_SQUARE_RINGS, IMG_STQUARE_RINGS,
IMG_FILE IMG_FILE
} EImageType; } EImageType;
@ -538,29 +538,29 @@ typedef struct
EImageType type; EImageType type;
bool loaded; bool loaded;
#if defined __cplusplus #if defined __cplusplus
QString file; TQString file;
QPixmap pix; TQPixmap pix;
#else // __cplusplus #else // __cplusplus
const char *file; const char *file;
GdkPixbuf *pix; GdkPixbuf *pix;
#endif // __cplusplus #endif // __cplusplus
int width, height; int width, height;
} QtCImage; } TQtCImage;
typedef enum typedef enum
{ {
SQUARE_NONE = 0x0000, STQUARE_NONE = 0x0000,
SQUARE_ENTRY = 0x0001, STQUARE_ENTRY = 0x0001,
SQUARE_PROGRESS = 0x0002, STQUARE_PROGRESS = 0x0002,
SQUARE_SCROLLVIEW = 0x0004, STQUARE_SCROLLVIEW = 0x0004,
SQUARE_LISTVIEW_SELECTION = 0x0008, STQUARE_LISTVIEW_SELECTION = 0x0008,
SQUARE_FRAME = 0x0010, STQUARE_FRAME = 0x0010,
SQUARE_TAB_FRAME = 0x0020, STQUARE_TAB_FRAME = 0x0020,
SQUARE_SLIDER = 0x0040, STQUARE_SLIDER = 0x0040,
SQUARE_SB_SLIDER = 0x0080, STQUARE_SB_SLIDER = 0x0080,
SQUARE_WINDOWS = 0x0100, STQUARE_WINDOWS = 0x0100,
SQUARE_TOOLTIPS = 0x0200, STQUARE_TOOLTIPS = 0x0200,
SQUARE_POPUP_MENUS = 0x0400 STQUARE_POPUP_MENUS = 0x0400
} ESquare; } ESquare;
typedef enum typedef enum
@ -582,7 +582,7 @@ typedef enum
{ {
PIX_CHECK, PIX_CHECK,
#ifdef __cplusplus #ifdef __cplusplus
#if defined QT_VERSION && (QT_VERSION < 0x040000) #if (0x039999 < 0x040000)
PIX_RADIO_ON, PIX_RADIO_ON,
PIX_RADIO_BORDER, PIX_RADIO_BORDER,
PIX_RADIO_INNER, PIX_RADIO_INNER,
@ -627,10 +627,10 @@ typedef enum
WIDGET_SPIN_DOWN, WIDGET_SPIN_DOWN,
WIDGET_UNCOLOURED_MO_BUTTON, WIDGET_UNCOLOURED_MO_BUTTON,
#else #else
WIDGET_CHECKBUTTON, // Qt4 only WIDGET_CHECKBUTTON, // TQt4 only
WIDGET_MDI_WINDOW, // Qt4 only WIDGET_MDI_WINDOW, // TQt4 only
WIDGET_MDI_WINDOW_TITLE, // Qt4 only WIDGET_MDI_WINDOW_TITLE, // TQt4 only
WIDGET_MDI_WINDOW_BUTTON, // Qt4 only WIDGET_MDI_WINDOW_BUTTON, // TQt4 only
WIDGET_DOCK_WIDGET_TITLE, WIDGET_DOCK_WIDGET_TITLE,
WIDGET_DIAL, WIDGET_DIAL,
#endif #endif
@ -640,7 +640,7 @@ typedef enum
WIDGET_SELECTION, WIDGET_SELECTION,
WIDGET_FRAME, WIDGET_FRAME,
WIDGET_NO_ETCH_BTN, WIDGET_NO_ETCH_BTN,
WIDGET_MENU_BUTTON, // Qt4 only WIDGET_MENU_BUTTON, // TQt4 only
WIDGET_FOCUS, WIDGET_FOCUS,
WIDGET_TAB_FRAME, WIDGET_TAB_FRAME,
WIDGET_OTHER WIDGET_OTHER
@ -1045,7 +1045,7 @@ typedef struct
highlightTab, highlightTab,
roundAllTabs, roundAllTabs,
animatedProgress, animatedProgress,
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT #ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
fixParentlessDialogs, fixParentlessDialogs,
#endif #endif
customMenuTextColor, customMenuTextColor,
@ -1069,7 +1069,7 @@ typedef struct
*/ */
#endif #endif
mapKdeIcons, mapKdeIcons,
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus #if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000)) || !defined __cplusplus
gtkButtonOrder, gtkButtonOrder,
fadeLines, fadeLines,
#endif #endif
@ -1099,10 +1099,10 @@ typedef struct
borderInactiveTab, borderInactiveTab,
doubleGtkComboArrow, doubleGtkComboArrow,
menuIcons, menuIcons,
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) #if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
stdBtnSizes, stdBtnSizes,
#endif #endif
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
xbar, xbar,
#endif #endif
forceAlternateLvCols, forceAlternateLvCols,
@ -1125,10 +1125,10 @@ typedef struct
bgndOpacity, bgndOpacity,
menuBgndOpacity, menuBgndOpacity,
dlgOpacity; dlgOpacity;
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
int dwtSettings; int dwtSettings;
#endif #endif
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) #if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
int titlebarButtons; int titlebarButtons;
TBCols titlebarButtonColors; TBCols titlebarButtonColors;
ETitleBarIcon titlebarIcon; ETitleBarIcon titlebarIcon;
@ -1204,23 +1204,23 @@ typedef struct
#else #else
Gradient *customGradient[NUM_CUSTOM_GRAD]; Gradient *customGradient[NUM_CUSTOM_GRAD];
#endif #endif
QtCImage bgndImage, TQtCImage bgndImage,
menuBgndImage; 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 */ /* NOTE: If add any more settings here, need to alter copyOpts/freeOpts/defaultSettings in config_file.c */
Strings noBgndGradientApps, Strings noBgndGradientApps,
noBgndOpacityApps, noBgndOpacityApps,
noMenuBgndOpacityApps, noMenuBgndOpacityApps,
noBgndImageApps; noBgndImageApps;
#endif #endif
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT #ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
Strings noDlgFixApps; Strings noDlgFixApps;
#endif #endif
Strings noMenuStripeApps; Strings noMenuStripeApps;
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
Strings menubarApps, Strings menubarApps,
statusbarApps, statusbarApps,
useQtFileDialogApps, useTQtFileDialogApps,
windowDragWhiteList, windowDragWhiteList,
windowDragBlackList; windowDragBlackList;
#endif #endif
@ -1416,7 +1416,7 @@ inline int limit(double c)
} }
#endif #endif
#if defined QT_VERSION && (QT_VERSION >= 0x040000) && !defined QTC_QT_ONLY #if (0x039999 >= 0x040000) && !defined TQTC_TQT_ONLY
#include <KDE/KColorUtils> #include <KDE/KColorUtils>
#define tint(COLA, COLB, FACTOR) KColorUtils::tint((COLA), (COLB), (FACTOR)) #define tint(COLA, COLB, FACTOR) KColorUtils::tint((COLA), (COLB), (FACTOR))
#define midColor(COLA, COLB) KColorUtils::mix((COLA), (COLB), 0.5) #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: case SHADING_HCY:
{ {
#define HCY_FACTOR 0.15 #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) if(k>1.0)
*cb=KColorUtils::lighten(ca, (k*(1+HCY_FACTOR))-1.0, 1.0); *cb=KColorUtils::lighten(ca, (k*(1+HCY_FACTOR))-1.0, 1.0);
else else
@ -1546,7 +1546,7 @@ static void shade(const Options *opts, const color *ca, color *cb, double k)
#endif #endif
} }
} }
#if defined __cplusplus && defined QT_VERSION && (QT_VERSION >= 0x040000) #if defined __cplusplus && (0x039999 >= 0x040000)
cb->setAlpha(ca.alpha()); cb->setAlpha(ca.alpha());
#endif #endif
#ifndef __cplusplus #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]; unsigned char source=data[offset+column+1];
#if defined __cplusplus #if defined __cplusplus
#if Q_BYTE_ORDER == Q_BIG_ENDIAN #if TQ_BYTE_ORDER == TQ_BIG_ENDIAN
/* ARGB */ /* ARGB */
data[offset+column+1] = checkBounds(r-source); data[offset+column+1] = checkBounds(r-source);
data[offset+column+2] = checkBounds(g-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_HEIGHT 12
#define MIN_ROUND_MAX_WIDTH 24 #define MIN_ROUND_MAX_WIDTH 24
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000)) #if !defined __cplusplus || ( (0x039999 >= 0x040000))
#if defined __cplusplus #if defined __cplusplus
#define EXTRA_INNER_RADIUS 3.5 #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_OUTER_RADIUS 2.5
#define FULL_ETCH_RADIUS 3.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_INNER_RADIUS 0.5
#define SLIGHT_OUTER_RADIUS 1.5 #define SLIGHT_OUTER_RADIUS 1.5
#define SLIGHT_ETCH_RADIUS 2.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; ERound r=opts->round;
if( ((WIDGET_PBAR_TROUGH==widget || WIDGET_PROGRESSBAR==widget) && (opts->square&SQUARE_PROGRESS)) || if( ((WIDGET_PBAR_TROUGH==widget || WIDGET_PROGRESSBAR==widget) && (opts->square&STQUARE_PROGRESS)) ||
(WIDGET_ENTRY==widget && (opts->square&SQUARE_ENTRY)) ) (WIDGET_ENTRY==widget && (opts->square&STQUARE_ENTRY)) )
return ROUND_NONE; return ROUND_NONE;
if((WIDGET_CHECKBOX==widget || WIDGET_FOCUS==widget) && ROUND_NONE!=r) if((WIDGET_CHECKBOX==widget || WIDGET_FOCUS==widget) && ROUND_NONE!=r)
r=ROUND_SLIGHT; 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)) || if((WIDGET_MDI_WINDOW_BUTTON==widget && (opts->titlebarButtons&TITLEBAR_BUTTON_ROUND)) ||
WIDGET_RADIO_BUTTON==widget || WIDGET_DIAL==widget) WIDGET_RADIO_BUTTON==widget || WIDGET_DIAL==widget)
return ROUND_MAX; return ROUND_MAX;
@ -1836,7 +1836,7 @@ ERound getWidgetRound(const Options *opts, int w, int h, EWidget widget)
return ROUND_MAX; return ROUND_MAX;
#endif #endif
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000)) #if !defined __cplusplus || ( (0x039999 >= 0x040000))
if(WIDGET_SLIDER==widget && if(WIDGET_SLIDER==widget &&
(SLIDER_ROUND==opts->sliderStyle || SLIDER_ROUND_ROTATED==opts->sliderStyle || SLIDER_CIRCULAR==opts->sliderStyle)) (SLIDER_ROUND==opts->sliderStyle || SLIDER_ROUND_ROTATED==opts->sliderStyle || SLIDER_CIRCULAR==opts->sliderStyle))
return ROUND_MAX; 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) if((WIDGET_CHECKBOX==widget || WIDGET_FOCUS==widget) && ROUND_NONE!=r)
r=ROUND_SLIGHT; r=ROUND_SLIGHT;
if( ((WIDGET_PBAR_TROUGH==widget || WIDGET_PROGRESSBAR==widget) && (opts->square&SQUARE_PROGRESS)) || if( ((WIDGET_PBAR_TROUGH==widget || WIDGET_PROGRESSBAR==widget) && (opts->square&STQUARE_PROGRESS)) ||
(WIDGET_ENTRY==widget && (opts->square&SQUARE_ENTRY)) ) (WIDGET_ENTRY==widget && (opts->square&STQUARE_ENTRY)) )
return 0.0; 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)) || if((WIDGET_MDI_WINDOW_BUTTON==widget && (opts->titlebarButtons&TITLEBAR_BUTTON_ROUND)) ||
WIDGET_RADIO_BUTTON==widget || WIDGET_DIAL==widget) WIDGET_RADIO_BUTTON==widget || WIDGET_DIAL==widget)
return (w>h ? h : w)/2.0; 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; return (w>h ? h : w)/2.0;
#endif #endif
#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000)) #if !defined __cplusplus || ( (0x039999 >= 0x040000))
if(WIDGET_SLIDER==widget && if(WIDGET_SLIDER==widget &&
(SLIDER_ROUND==opts->sliderStyle || SLIDER_ROUND_ROTATED==opts->sliderStyle || SLIDER_CIRCULAR==opts->sliderStyle)) (SLIDER_ROUND==opts->sliderStyle || SLIDER_ROUND_ROTATED==opts->sliderStyle || SLIDER_CIRCULAR==opts->sliderStyle))
return (w>h ? h : w)/2.0; 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 #ifdef __cplusplus
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
#include <QMap> #include <TQMap>
#include <QFile> #include <TQFile>
#include <QTextStream> #include <TQTextStream>
#define TO_LATIN1(A) A.toLatin1().constData() #define TO_LATIN1(A) A.toLatin1().constData()
#else #else
#define TO_LATIN1(A) A.latin1() #define TO_LATIN1(A) A.latin1()
#include <qmap.h> #include <tqmap.h>
#include <qfile.h> #include <tqfile.h>
#include <qtextstream.h> #include <tqtextstream.h>
#endif #endif
#endif // __cplusplus #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)) if(0==memcmp(str, "glass", 5) || 0==memcmp(str, "shinyglass", 10))
return APPEARANCE_SHINY_GLASS; return APPEARANCE_SHINY_GLASS;
if(0==memcmp(str, "agua", 4)) 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; return APPEARANCE_AGUA_MOD;
#else #else
return APPEARANCE_AGUA; return APPEARANCE_AGUA;
@ -488,7 +488,7 @@ static EAlign toAlign(const char *str, EAlign def)
} }
#endif #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) static ETitleBarIcon toTitlebarIcon(const char *str, ETitleBarIcon def)
{ {
if(str) if(str)
@ -515,7 +515,7 @@ static EImageType toImageType(const char *str, EImageType def)
if(0==memcmp(str, "rings", 5)) if(0==memcmp(str, "rings", 5))
return IMG_BORDERED_RINGS; return IMG_BORDERED_RINGS;
if(0==memcmp(str, "squarerings", 11)) if(0==memcmp(str, "squarerings", 11))
return IMG_SQUARE_RINGS; return IMG_STQUARE_RINGS;
if(0==memcmp(str, "file", 4)) if(0==memcmp(str, "file", 4))
return IMG_FILE; return IMG_FILE;
} }
@ -569,41 +569,41 @@ static const char * getHome()
#ifdef __cplusplus #ifdef __cplusplus
#if defined QTC_QT_ONLY || QT_VERSION < 0x040000 #if defined TQTC_TQT_ONLY || 0x039999 < 0x040000
#if QT_VERSION < 0x040000 #if 0x039999 < 0x040000
#include <qdir.h> #include <tqdir.h>
#include <qfile.h> #include <tqfile.h>
#endif #endif
// Take from KStandardDirs::makeDir // 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 // we want an absolute path
if (QDir::isRelativePath(dir)) if (TQDir::isRelativePath(dir))
return false; return false;
#ifdef Q_WS_WIN #ifdef TQ_WS_WIN
return QDir().mkpath(dir); return TQDir().mkpath(dir);
#else #else
QString target = dir; TQString target = dir;
uint len = target.length(); uint len = target.length();
// append trailing slash if missing // append trailing slash if missing
if (dir.at(len - 1) != '/') if (dir.at(len - 1) != '/')
target += '/'; target += '/';
QString base; TQString base;
uint i = 1; uint i = 1;
while( i < len ) while( i < len )
{ {
struct stat st; struct stat st;
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
int pos = target.indexOf('/', i); int pos = target.indexOf('/', i);
#else #else
int pos = target.find('/', i); int pos = target.tqfind('/', i);
#endif #endif
base += target.mid(i - 1, pos - i + 1); 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 // bail out if we encountered a problem
if (stat(baseEncoded, &st) != 0) 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 (mkdir(baseEncoded, static_cast<mode_t>(mode)) != 0)
{ {
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
baseEncoded.prepend("trying to create local folder "); baseEncoded.prepend("trying to create local folder ");
perror(baseEncoded.constData()); perror(baseEncoded.constData());
#else #else
perror("trying to create QtCurve config folder "); perror("trying to create TQtCurve config folder ");
#endif #endif
return false; // Couldn't create it :-( return false; // Couldn't create it :-(
} }
@ -697,7 +697,7 @@ static const char *qtcConfDir()
if(0!=lstat(cfgDir, &info)) if(0!=lstat(cfgDir, &info))
{ {
#ifdef __cplusplus #ifdef __cplusplus
#if defined QTC_QT_ONLY || QT_VERSION < 0x040000 #if defined TQTC_TQT_ONLY || 0x039999 < 0x040000
makeDir(cfgDir, 0755); makeDir(cfgDir, 0755);
#else #else
KStandardDirs::makeDir(cfgDir, 0755); KStandardDirs::makeDir(cfgDir, 0755);
@ -725,16 +725,16 @@ static WindowBorders qtcGetWindowBorderSize(bool force)
if(-1==sizes.titleHeight || force) if(-1==sizes.titleHeight || force)
{ {
#ifdef __cplusplus #ifdef __cplusplus
QFile f(qtcConfDir()+QString(BORDER_SIZE_FILE)); TQFile f(qtcConfDir()+TQString(BORDER_SIZE_FILE));
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
if(f.open(QIODevice::ReadOnly)) if(f.open(TQIODevice::ReadOnly))
#else #else
if(f.open(IO_ReadOnly)) if(f.open(IO_ReadOnly))
#endif #endif
{ {
QTextStream stream(&f); TQTextStream stream(&f);
QString line; TQString line;
sizes.titleHeight=stream.readLine().toInt(); sizes.titleHeight=stream.readLine().toInt();
sizes.toolTitleHeight=stream.readLine().toInt(); sizes.toolTitleHeight=stream.readLine().toInt();
@ -770,7 +770,7 @@ static WindowBorders qtcGetWindowBorderSize(bool force)
return sizes.titleHeight<12 ? def : sizes; 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 MENU_FILE_PREFIX "menubar-"
#define STATUS_FILE_PREFIX "statusbar-" #define STATUS_FILE_PREFIX "statusbar-"
@ -781,17 +781,17 @@ static WindowBorders qtcGetWindowBorderSize(bool force)
#define qtcSetStatusBarHidden(A, H) qtcSetBarHidden((A), (H), STATUS_FILE_PREFIX) #define qtcSetStatusBarHidden(A, H) qtcSetBarHidden((A), (H), STATUS_FILE_PREFIX)
#ifdef __cplusplus #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) if(!hidden)
QFile::remove(QFile::decodeName(qtcConfDir())+prefix+app); TQFile::remove(TQFile::decodeName(qtcConfDir())+prefix+app);
else else
QFile(QFile::decodeName(qtcConfDir())+prefix+app).open(QIODevice::WriteOnly); TQFile(TQFile::decodeName(qtcConfDir())+prefix+app).open(TQIODevice::WriteOnly);
} }
#else // __cplusplus #else // __cplusplus
@ -839,7 +839,7 @@ static void qtcSetBarHidden(const char *app, bool hidden, const char *prefix)
#include <QtSvg/QSvgRenderer> #include <QtSvg/QSvgRenderer>
#endif // __cplusplus #endif // __cplusplus
static void loadBgndImage(QtCImage *img) static void loadBgndImage(TQtCImage *img)
{ {
if(!img->loaded && if(!img->loaded &&
img->width>16 && img->width<1024 && img->height>16 && img->height<1024) img->width>16 && img->width<1024 && img->height>16 && img->height<1024)
@ -848,13 +848,13 @@ static void loadBgndImage(QtCImage *img)
#ifdef __cplusplus #ifdef __cplusplus
if(!img->file.isEmpty()) if(!img->file.isEmpty())
{ {
QSvgRenderer svg(img->file); TQSvgRenderer svg(img->file);
if(svg.isValid()) if(svg.isValid())
{ {
img->pix=QPixmap(img->width, img->height); img->pix=TQPixmap(img->width, img->height);
img->pix.fill(Qt::transparent); img->pix.fill(TQt::transparent);
QPainter painter(&img->pix); TQPainter painter(&img->pix);
svg.render(&painter); svg.render(&painter);
painter.end(); 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 #ifdef CONFIG_READ
@ -885,41 +885,41 @@ static void checkColor(EShade *s, color *c)
#ifdef __cplusplus #ifdef __cplusplus
class QtCConfig class TQtCConfig
{ {
public: public:
QtCConfig(const QString &filename); TQtCConfig(const TQString &filename);
bool ok() const { return values.count()>0; } bool ok() const { return values.count()>0; }
bool hasKey(const QString &key) { return values.contains(key); } bool hasKey(const TQString &key) { return values.tqcontains(key); }
const QString & readEntry(const QString &key, const QString &def=QString::null); const TQString & readEntry(const TQString &key, const TQString &def=TQString());
private: 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 0x039999 >= 0x040000
if(f.open(QIODevice::ReadOnly)) if(f.open(TQIODevice::ReadOnly))
#else #else
if(f.open(IO_ReadOnly)) if(f.open(IO_ReadOnly))
#endif #endif
{ {
QTextStream stream(&f); TQTextStream stream(&f);
QString line; TQString line;
while(!stream.atEnd()) while(!stream.atEnd())
{ {
line = stream.readLine(); line = stream.readLine();
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
int pos=line.indexOf('='); int pos=line.indexOf('=');
#else #else
int pos=line.find('='); int pos=line.tqfind('=');
#endif #endif
if(-1!=pos) if(-1!=pos)
values[line.left(pos)]=line.mid(pos+1); 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); 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(); 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; int major, minor, patch;
return !val.isEmpty() && 3==sscanf(TO_LATIN1(val), "%d.%d.%d", &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; : 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); 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)) #if ( (0x039999 >= 0x040000))
QStringList strings(readStringEntry(cfg, key).split(',', QString::SkipEmptyParts)); TQStringList strings(readStringEntry(cfg, key).split(',', TQString::SkipEmptyParts));
#else #else
QStringList strings(QStringList::split(',', readStringEntry(cfg, key))); TQStringList strings(TQStringList::split(',', readStringEntry(cfg, key)));
#endif #endif
bool ok(count==strings.size()); bool ok(count==strings.size());
if(ok) if(ok)
{ {
QStringList::ConstIterator it(strings.begin()); TQStringList::ConstIterator it(strings.begin());
int i; int i;
for(i=0; i<count && ok; ++i, ++it) 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) \ #define CFG_READ_COLOR(ENTRY) \
{ \ { \
QString sVal(cfg.readEntry(#ENTRY)); \ TQString sVal(cfg.readEntry(#ENTRY)); \
if(sVal.isEmpty()) \ if(sVal.isEmpty()) \
opts->ENTRY=def->ENTRY; \ opts->ENTRY=def->ENTRY; \
else \ else \
@ -999,7 +999,7 @@ static void readDoubleList(QtCConfig &cfg, const char *key, double *list, int co
opts->ENTRY.loaded=false; \ opts->ENTRY.loaded=false; \
if(IMG_FILE==opts->ENTRY.type) \ if(IMG_FILE==opts->ENTRY.type) \
{ \ { \
QString file(cfg.readEntry(#ENTRY ".file")); \ TQString file(cfg.readEntry(#ENTRY ".file")); \
if(!file.isEmpty()) \ if(!file.isEmpty()) \
{ \ { \
opts->ENTRY.file=file; \ 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) \ #define CFG_READ_STRING_LIST(ENTRY) \
{ \ { \
QString val=readStringEntry(cfg, #ENTRY); \ TQString val=readStringEntry(cfg, #ENTRY); \
Strings set=val.isEmpty() ? Strings() : Strings::fromList(val.split(",", QString::SkipEmptyParts)); \ Strings set=val.isEmpty() ? Strings() : Strings::fromList(val.split(",", TQString::SkipEmptyParts)); \
opts->ENTRY=set.count() || cfg.hasKey(#ENTRY) ? set : def->ENTRY; \ opts->ENTRY=set.count() || cfg.hasKey(#ENTRY) ? set : def->ENTRY; \
} }
#else #else
#define CFG_READ_STRING_LIST(ENTRY) \ #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); \ Strings list=val.isEmpty() ? Strings() : Strings::split(",", val, false); \
opts->ENTRY=list.count() || cfg.hasKey(#ENTRY) ? list : def->ENTRY; \ 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); opts->ENTRY=toAlign(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#endif #endif
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) #if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
#define CFG_READ_TB_ICON(ENTRY) \ #define CFG_READ_TB_ICON(ENTRY) \
opts->ENTRY=toTitlebarIcon(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toTitlebarIcon(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#endif #endif
@ -1325,7 +1325,7 @@ static void copyOpts(Options *src, Options *dest)
dest->noBgndOpacityApps=src->noBgndOpacityApps; dest->noBgndOpacityApps=src->noBgndOpacityApps;
dest->noMenuBgndOpacityApps=src->noMenuBgndOpacityApps; dest->noMenuBgndOpacityApps=src->noMenuBgndOpacityApps;
dest->noBgndImageApps=src->noBgndImageApps; dest->noBgndImageApps=src->noBgndImageApps;
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT #ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
dest->noDlgFixApps=src->noDlgFixApps; dest->noDlgFixApps=src->noDlgFixApps;
src->noDlgFixApps=NULL; src->noDlgFixApps=NULL;
#endif #endif
@ -1351,7 +1351,7 @@ static void freeOpts(Options *opts)
g_strfreev(opts->noMenuBgndOpacityApps); g_strfreev(opts->noMenuBgndOpacityApps);
if(opts->noBgndImageApps) if(opts->noBgndImageApps)
g_strfreev(opts->noBgndImageApps); g_strfreev(opts->noBgndImageApps);
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT #ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
if(opts->noDlgFixApps) if(opts->noDlgFixApps)
g_strfreev(opts->noDlgFixApps); g_strfreev(opts->noDlgFixApps);
opts->noDlgFixApps=NULL opts->noDlgFixApps=NULL
@ -1480,7 +1480,7 @@ static void checkConfig(Options *opts)
if(opts->gbFactor<MIN_GB_FACTOR || opts->gbFactor>MAX_GB_FACTOR) if(opts->gbFactor<MIN_GB_FACTOR || opts->gbFactor>MAX_GB_FACTOR)
opts->gbFactor=DEF_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; opts->crSize=CR_SMALL_SIZE;
if(SLIDER_CIRCULAR==opts->sliderStyle) if(SLIDER_CIRCULAR==opts->sliderStyle)
opts->sliderStyle=SLIDER_ROUND; opts->sliderStyle=SLIDER_ROUND;
@ -1497,7 +1497,7 @@ static void checkConfig(Options *opts)
opts->colorMenubarMouseOver=true; 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) if(opts->round>ROUND_FULL)
opts->round=ROUND_FULL; opts->round=ROUND_FULL;
#endif #endif
@ -1528,7 +1528,7 @@ static void checkConfig(Options *opts)
opts->coloredTbarMo=true; opts->coloredTbarMo=true;
if(opts->round<ROUND_SLIGHT) if(opts->round<ROUND_SLIGHT)
opts->square|=SQUARE_POPUP_MENUS|SQUARE_TOOLTIPS; opts->square|=STQUARE_POPUP_MENUS|STQUARE_TOOLTIPS;
#endif #endif
if(opts->bgndOpacity<0 || opts->bgndOpacity>100) if(opts->bgndOpacity<0 || opts->bgndOpacity>100)
@ -1554,7 +1554,7 @@ static void checkConfig(Options *opts)
opts->activeTabAppearance=MODIFY_AGUA(opts->activeTabAppearance); opts->activeTabAppearance=MODIFY_AGUA(opts->activeTabAppearance);
opts->menuitemAppearance=MODIFY_AGUA(opts->menuitemAppearance); 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->borderProgress=true;
opts->titlebarAppearance=MODIFY_AGUA(opts->titlebarAppearance); opts->titlebarAppearance=MODIFY_AGUA(opts->titlebarAppearance);
@ -1567,7 +1567,7 @@ static void checkConfig(Options *opts)
opts->lighterPopupMenuBgnd=0; opts->lighterPopupMenuBgnd=0;
#ifdef __cplusplus #ifdef __cplusplus
#if defined QT_VERSION && QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
if(!(opts->titlebarButtons&TITLEBAR_BUTTON_ROUND)) if(!(opts->titlebarButtons&TITLEBAR_BUTTON_ROUND))
#endif #endif
opts->titlebarButtonAppearance=MODIFY_AGUA(opts->titlebarButtonAppearance); opts->titlebarButtonAppearance=MODIFY_AGUA(opts->titlebarButtonAppearance);
@ -1591,7 +1591,7 @@ static void checkConfig(Options *opts)
} }
#ifdef __cplusplus #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 #else
static bool readConfig(const char *file, Options *opts, Options *defOpts) static bool readConfig(const char *file, Options *opts, Options *defOpts)
#endif #endif
@ -1599,7 +1599,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
#ifdef __cplusplus #ifdef __cplusplus
if(file.isEmpty()) if(file.isEmpty())
{ {
const char *env=getenv("QTCURVE_CONFIG_FILE"); const char *env=getenv("TQTCURVE_CONFIG_FILE");
if(NULL!=env) if(NULL!=env)
return readConfig(env, opts, defOpts); return readConfig(env, opts, defOpts);
@ -1609,10 +1609,10 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
if(cfgDir) if(cfgDir)
{ {
QString filename(QFile::decodeName(cfgDir)+CONFIG_FILE); TQString filename(TQFile::decodeName(cfgDir)+CONFIG_FILE);
if(!QFile::exists(filename)) if(!TQFile::exists(filename))
filename=QFile::decodeName(cfgDir)+"../"OLD_CONFIG_FILE; filename=TQFile::decodeName(cfgDir)+"../"OLD_CONFIG_FILE;
return readConfig(filename, opts, defOpts); return readConfig(filename, opts, defOpts);
} }
} }
@ -1620,7 +1620,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
#else #else
if(!file) if(!file)
{ {
const char *env=getenv("QTCURVE_CONFIG_FILE"); const char *env=getenv("TQTCURVE_CONFIG_FILE");
if(NULL!=env) if(NULL!=env)
return readConfig(env, opts, defOpts); return readConfig(env, opts, defOpts);
@ -1646,7 +1646,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
else else
{ {
#ifdef __cplusplus #ifdef __cplusplus
QtCConfig cfg(file); TQtCConfig cfg(file);
if(cfg.ok()) if(cfg.ok())
{ {
@ -1676,7 +1676,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
#else #else
Options newOpts; Options newOpts;
Options *def=&newOpts; Options *def=&newOpts;
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT #ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
opts->noDlgFixApps=NULL; opts->noDlgFixApps=NULL;
#endif #endif
opts->noBgndGradientApps=opts->noBgndOpacityApps=opts->noMenuBgndOpacityApps=opts->noBgndImageApps=opts->noMenuStripeApps=NULL; 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)) if(opts->version<MAKE_VERSION(1, 4))
{ {
opts->square= opts->square=
(readBoolEntry(cfg, "squareLvSelection", def->square&SQUARE_LISTVIEW_SELECTION) ? SQUARE_LISTVIEW_SELECTION : SQUARE_NONE)+ (readBoolEntry(cfg, "squareLvSelection", def->square&STQUARE_LISTVIEW_SELECTION) ? STQUARE_LISTVIEW_SELECTION : STQUARE_NONE)+
(readBoolEntry(cfg, "squareScrollViews", def->square&SQUARE_SCROLLVIEW) ? SQUARE_SCROLLVIEW : SQUARE_NONE)+ (readBoolEntry(cfg, "squareScrollViews", def->square&STQUARE_SCROLLVIEW) ? STQUARE_SCROLLVIEW : STQUARE_NONE)+
(readBoolEntry(cfg, "squareProgress", def->square&SQUARE_PROGRESS) ? SQUARE_PROGRESS : SQUARE_NONE)+ (readBoolEntry(cfg, "squareProgress", def->square&STQUARE_PROGRESS) ? STQUARE_PROGRESS : STQUARE_NONE)+
(readBoolEntry(cfg, "squareEntry", def->square&SQUARE_ENTRY)? SQUARE_ENTRY : SQUARE_NONE); (readBoolEntry(cfg, "squareEntry", def->square&STQUARE_ENTRY)? STQUARE_ENTRY : STQUARE_NONE);
} }
else else
CFG_READ_INT(square) CFG_READ_INT(square)
if(opts->version<MAKE_VERSION(1, 6)) if(opts->version<MAKE_VERSION(1, 6))
opts->square|=SQUARE_TOOLTIPS; opts->square|=STQUARE_TOOLTIPS;
if(opts->version<MAKE_VERSION3(1, 6, 1)) 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)) if(opts->version<MAKE_VERSION(1, 2))
def->crSize=CR_SMALL_SIZE; def->crSize=CR_SMALL_SIZE;
if(opts->version<MAKE_VERSION(1, 0)) if(opts->version<MAKE_VERSION(1, 0))
@ -1747,7 +1747,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
def->crHighlight=0; def->crHighlight=0;
#ifdef __cplusplus #ifdef __cplusplus
def->dwtAppearance=APPEARANCE_FLAT; def->dwtAppearance=APPEARANCE_FLAT;
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
def->dwtSettings=0; def->dwtSettings=0;
#endif #endif
#endif #endif
@ -1761,7 +1761,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
def->etchEntry=true; def->etchEntry=true;
def->gtkScrollViews=false; def->gtkScrollViews=false;
def->thinSbarGroove=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->titlebarButtons=TITLEBAR_BUTTON_HOVER_FRAME;
def->titlebarIcon=TITLEBAR_ICON_MENU_BUTTON; def->titlebarIcon=TITLEBAR_ICON_MENU_BUTTON;
#endif #endif
@ -1846,7 +1846,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_GRAD_TYPE(bgndGrad) CFG_READ_GRAD_TYPE(bgndGrad)
CFG_READ_GRAD_TYPE(menuBgndGrad) CFG_READ_GRAD_TYPE(menuBgndGrad)
CFG_READ_APPEARANCE(menuBgndAppearance, APP_ALLOW_STRIPED) 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_BOOL(fixParentlessDialogs)
CFG_READ_STRING_LIST(noDlgFixApps) CFG_READ_STRING_LIST(noDlgFixApps)
#endif #endif
@ -1929,7 +1929,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_BOOL(darkerBorders) CFG_READ_BOOL(darkerBorders)
CFG_READ_BOOL(vArrows) CFG_READ_BOOL(vArrows)
CFG_READ_BOOL(xCheck) 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_BOOL(fadeLines)
CFG_READ_GLOW(glowProgress) CFG_READ_GLOW(glowProgress)
#endif #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_INT_BOOL(windowDrag, WM_DRAG_MENUBAR)
CFG_READ_BOOL(shadePopupMenu) 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_BOOL(stdBtnSizes)
CFG_READ_INT(titlebarButtons) CFG_READ_INT(titlebarButtons)
CFG_READ_TB_ICON(titlebarIcon) CFG_READ_TB_ICON(titlebarIcon)
#endif #endif
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
CFG_READ_BOOL(xbar) CFG_READ_BOOL(xbar)
CFG_READ_INT(dwtSettings) CFG_READ_INT(dwtSettings)
#endif #endif
@ -2001,10 +2001,10 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_INT(expanderHighlight) CFG_READ_INT(expanderHighlight)
CFG_READ_BOOL(mapKdeIcons) CFG_READ_BOOL(mapKdeIcons)
#endif #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) CFG_READ_BOOL(gtkButtonOrder)
#endif #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) CFG_READ_BOOL(reorderGtkButtons)
#endif #endif
CFG_READ_APPEARANCE(titlebarAppearance, APP_ALLOW_NONE) 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; opts->inactiveTitlebarAppearance=APPEARANCE_FLAT;
#ifdef __cplusplus #ifdef __cplusplus
CFG_READ_APPEARANCE(titlebarButtonAppearance, APP_ALLOW_BASIC) CFG_READ_APPEARANCE(titlebarButtonAppearance, APP_ALLOW_BASIC)
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
if(opts->xbar && opts->menubarHiding) if(opts->xbar && opts->menubarHiding)
opts->xbar=false; opts->xbar=false;
#endif #endif
@ -2031,16 +2031,16 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_IMAGE(bgndImage) CFG_READ_IMAGE(bgndImage)
CFG_READ_IMAGE(menuBgndImage) CFG_READ_IMAGE(menuBgndImage)
CFG_READ_STRING_LIST(noMenuStripeApps) 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(noBgndGradientApps)
CFG_READ_STRING_LIST(noBgndOpacityApps) CFG_READ_STRING_LIST(noBgndOpacityApps)
CFG_READ_STRING_LIST(noMenuBgndOpacityApps) CFG_READ_STRING_LIST(noMenuBgndOpacityApps)
CFG_READ_STRING_LIST(noBgndImageApps) CFG_READ_STRING_LIST(noBgndImageApps)
#endif #endif
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
CFG_READ_STRING_LIST(menubarApps) CFG_READ_STRING_LIST(menubarApps)
CFG_READ_STRING_LIST(statusbarApps) CFG_READ_STRING_LIST(statusbarApps)
CFG_READ_STRING_LIST(useQtFileDialogApps) CFG_READ_STRING_LIST(useTQtFileDialogApps)
CFG_READ_STRING_LIST(windowDragWhiteList) CFG_READ_STRING_LIST(windowDragWhiteList)
CFG_READ_STRING_LIST(windowDragBlackList) CFG_READ_STRING_LIST(windowDragBlackList)
#endif #endif
@ -2048,22 +2048,22 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
readDoubleList(cfg, "customAlphas", opts->customAlphas, NUM_STD_ALPHAS); readDoubleList(cfg, "customAlphas", opts->customAlphas, NUM_STD_ALPHAS);
#ifdef __cplusplus #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(opts->titlebarButtons&TITLEBAR_BUTTON_COLOR || opts->titlebarButtons&TITLEBAR_BUTTON_ICON_COLOR)
{ {
#if (defined QT_VERSION && (QT_VERSION >= 0x040000)) #if ( (0x039999 >= 0x040000))
QStringList cols(readStringEntry(cfg, "titlebarButtonColors").split(',', QString::SkipEmptyParts)); TQStringList cols(readStringEntry(cfg, "titlebarButtonColors").split(',', TQString::SkipEmptyParts));
#else #else
QStringList cols(QStringList::split(',', readStringEntry(cfg, "titlebarButtonColors"))); TQStringList cols(TQStringList::split(',', readStringEntry(cfg, "titlebarButtonColors")));
#endif #endif
if(cols.count() && 0==(cols.count()%NUM_TITLEBAR_BUTTONS) && cols.count()<=(NUM_TITLEBAR_BUTTONS*3)) 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()); end(cols.end());
for(int i=0; it!=end; ++it, ++i) for(int i=0; it!=end; ++it, ++i)
{ {
QColor col; TQColor col;
setRgb(&col, TO_LATIN1((*it))); setRgb(&col, TO_LATIN1((*it)));
opts->titlebarButtonColors[i]=col; 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) for(i=APPEARANCE_CUSTOM1; i<(APPEARANCE_CUSTOM1+NUM_CUSTOM_GRAD); ++i)
{ {
QString gradKey; TQString gradKey;
gradKey.sprintf("customgradient%d", (i-APPEARANCE_CUSTOM1)+1); gradKey.sprintf("customgradient%d", (i-APPEARANCE_CUSTOM1)+1);
#if (defined QT_VERSION && (QT_VERSION >= 0x040000)) #if ( (0x039999 >= 0x040000))
QStringList vals(readStringEntry(cfg, gradKey).split(',', QString::SkipEmptyParts)); TQStringList vals(readStringEntry(cfg, gradKey).split(',', TQString::SkipEmptyParts));
#else #else
QStringList vals(QStringList::split(',', readStringEntry(cfg, gradKey))); TQStringList vals(TQStringList::split(',', readStringEntry(cfg, gradKey)));
#endif #endif
if(vals.size()) if(vals.size())
@ -2095,7 +2095,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
if(vals.size()>=5) if(vals.size()>=5)
{ {
QStringList::ConstIterator it(vals.begin()), TQStringList::ConstIterator it(vals.begin()),
end(vals.end()); end(vals.end());
bool ok(true), bool ok(true),
haveAlpha(false); haveAlpha(false);
@ -2348,7 +2348,7 @@ static void defaultSettings(Options *opts)
opts->menuDelay=DEFAULT_MENU_DELAY; opts->menuDelay=DEFAULT_MENU_DELAY;
opts->sliderWidth=DEFAULT_SLIDER_WIDTH; opts->sliderWidth=DEFAULT_SLIDER_WIDTH;
opts->selectionAppearance=APPEARANCE_HARSH_GRADIENT; 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->round=ROUND_EXTRA;
opts->fadeLines=true; opts->fadeLines=true;
opts->glowProgress=GLOW_NONE; opts->glowProgress=GLOW_NONE;
@ -2359,7 +2359,7 @@ static void defaultSettings(Options *opts)
#ifdef __cplusplus #ifdef __cplusplus
opts->dwtAppearance=APPEARANCE_CUSTOM1; opts->dwtAppearance=APPEARANCE_CUSTOM1;
#endif #endif
#if !defined __cplusplus || (defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION >= 0x040000)) #if !defined __cplusplus || (defined CONFIG_DIALOG && (0x039999 >= 0x040000))
opts->reorderGtkButtons=false; opts->reorderGtkButtons=false;
#endif #endif
opts->bgndImage.type=IMG_NONE; opts->bgndImage.type=IMG_NONE;
@ -2404,7 +2404,7 @@ static void defaultSettings(Options *opts)
opts->toolbarBorders=TB_NONE; opts->toolbarBorders=TB_NONE;
opts->toolbarSeparators=LINE_SUNKEN; opts->toolbarSeparators=LINE_SUNKEN;
opts->splitters=LINE_1DOT; opts->splitters=LINE_1DOT;
#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT #ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
opts->fixParentlessDialogs=false; opts->fixParentlessDialogs=false;
#ifdef __cplusplus #ifdef __cplusplus
opts->noDlgFixApps << "kate" << "plasma" << "plasma-desktop" << "plasma-netbook"; opts->noDlgFixApps << "kate" << "plasma" << "plasma-desktop" << "plasma-netbook";
@ -2459,7 +2459,7 @@ static void defaultSettings(Options *opts)
opts->boldProgress=true; opts->boldProgress=true;
opts->coloredTbarMo=false; opts->coloredTbarMo=false;
opts->borderSelection=false; opts->borderSelection=false;
opts->square=SQUARE_POPUP_MENUS; opts->square=STQUARE_POPUP_MENUS;
opts->stripedSbar=false; opts->stripedSbar=false;
opts->windowDrag=WM_DRAG_NONE; opts->windowDrag=WM_DRAG_NONE;
opts->shadePopupMenu=false; opts->shadePopupMenu=false;
@ -2467,7 +2467,7 @@ static void defaultSettings(Options *opts)
opts->groupBox=FRAME_FADED; opts->groupBox=FRAME_FADED;
opts->gbFactor=DEF_GB_FACTOR; opts->gbFactor=DEF_GB_FACTOR;
opts->gbLabel=GB_LBL_BOLD|GB_LBL_OUTSIDE; 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->stdBtnSizes=false;
opts->titlebarButtons=TITLEBAR_BUTTON_ROUND|TITLEBAR_BUTTON_HOVER_SYMBOL; opts->titlebarButtons=TITLEBAR_BUTTON_ROUND|TITLEBAR_BUTTON_HOVER_SYMBOL;
opts->titlebarIcon=TITLEBAR_ICON_NEXT_TO_TITLE; opts->titlebarIcon=TITLEBAR_ICON_NEXT_TO_TITLE;
@ -2494,12 +2494,12 @@ static void defaultSettings(Options *opts)
opts->titlebarAlignment=ALIGN_FULL_CENTER; opts->titlebarAlignment=ALIGN_FULL_CENTER;
opts->titlebarEffect=EFFECT_SHADOW; opts->titlebarEffect=EFFECT_SHADOW;
opts->centerTabText=false; opts->centerTabText=false;
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
opts->xbar=false; opts->xbar=false;
opts->dwtSettings=DWT_BUTTONS_AS_PER_TITLEBAR|DWT_ROUND_TOP_ONLY; opts->dwtSettings=DWT_BUTTONS_AS_PER_TITLEBAR|DWT_ROUND_TOP_ONLY;
opts->menubarApps << "amarok" << "arora" << "kaffeine" << "kcalc" << "smplayer" << "VirtualBox"; opts->menubarApps << "amarok" << "arora" << "kaffeine" << "kcalc" << "smplayer" << "VirtualBox";
opts->statusbarApps << "kde"; opts->statusbarApps << "kde";
opts->useQtFileDialogApps << "googleearth-bin"; opts->useTQtFileDialogApps << "googleearth-bin";
opts->noMenuBgndOpacityApps << "inkscape" << "inkscape" << "sonata" << "totem"; opts->noMenuBgndOpacityApps << "inkscape" << "inkscape" << "sonata" << "totem";
opts->noBgndOpacityApps << "smplayer" << "kaffeine" << "dragon" << "kscreenlocker" << "inkscape" << "inkscape" << "sonata" << "totem"; opts->noBgndOpacityApps << "smplayer" << "kaffeine" << "dragon" << "kscreenlocker" << "inkscape" << "inkscape" << "sonata" << "totem";
#endif #endif
@ -2543,7 +2543,7 @@ static void defaultSettings(Options *opts)
readConfig(systemFilename, opts, 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) if(FOCUS_FILLED==opts->focus)
opts->focus=FOCUS_FULL; opts->focus=FOCUS_FULL;
#endif #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) switch(exp)
{ {
@ -2669,7 +2669,7 @@ static QString toStr(EAppearance exp, EAppAllow allow)
} }
default: default:
{ {
QString app; TQString app;
app.sprintf("customgradient%d", (exp-APPEARANCE_CUSTOM1)+1); app.sprintf("customgradient%d", (exp-APPEARANCE_CUSTOM1)+1);
return app; 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()); colorStr.sprintf("#%02X%02X%02X", col.red(), col.green(), col.blue());
return colorStr; return colorStr;
} }
static QString toStr(EShade exp, const QColor &col) static TQString toStr(EShade exp, const TQColor &col)
{ {
switch(exp) switch(exp)
{ {
@ -2960,7 +2960,7 @@ static const char * toStr(EImageType lv)
return "plainrings"; return "plainrings";
case IMG_BORDERED_RINGS: case IMG_BORDERED_RINGS:
return "rings"; return "rings";
case IMG_SQUARE_RINGS: case IMG_STQUARE_RINGS:
return "squarerings"; return "squarerings";
case IMG_FILE: case IMG_FILE:
return "file"; return "file";
@ -2983,8 +2983,8 @@ static const char * toStr(EGlow lv)
} }
} }
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
#include <QTextStream> #include <TQTextStream>
#define CFG config #define CFG config
#else #else
#define CFG (*cfg) #define CFG (*cfg)
@ -3042,7 +3042,7 @@ static const char * toStr(EGlow lv)
if (!exportingStyle && def.ENTRY==opts.ENTRY) \ if (!exportingStyle && def.ENTRY==opts.ENTRY) \
CFG.deleteEntry(#ENTRY); \ CFG.deleteEntry(#ENTRY); \
else \ 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) 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(cfgDir)
{ {
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
KConfig defCfg(QFile::decodeName(cfgDir)+CONFIG_FILE, KConfig::SimpleConfig); KConfig defCfg(TQFile::decodeName(cfgDir)+CONFIG_FILE, KConfig::SimpleConfig);
#else #else
KConfig defCfg(QFile::decodeName(cfgDir)+CONFIG_FILE, false, false); KConfig defCfg(TQFile::decodeName(cfgDir)+CONFIG_FILE, false, false);
#endif #endif
if(writeConfig(&defCfg, opts, def, exportingStyle)) 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) 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)) if(TQFile::exists(oldFileName))
QFile::remove(oldFileName); TQFile::remove(oldFileName);
} }
} }
} }
} }
else else
{ {
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
KConfigGroup config(cfg, SETTINGS_GROUP); KConfigGroup config(cfg, SETTINGS_GROUP);
#else #else
cfg->setGroup(SETTINGS_GROUP); 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(bgndGrad)
CFG_WRITE_ENTRY(menuBgndGrad) CFG_WRITE_ENTRY(menuBgndGrad)
CFG_WRITE_APPEARANCE_ENTRY(menuBgndAppearance, APP_ALLOW_STRIPED) 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) CFG_WRITE_ENTRY(fixParentlessDialogs)
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
CFG_WRITE_STRING_LIST_ENTRY(noDlgFixApps) CFG_WRITE_STRING_LIST_ENTRY(noDlgFixApps)
#endif #endif
#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_NUM(windowDrag)
CFG_WRITE_ENTRY(shadePopupMenu) CFG_WRITE_ENTRY(shadePopupMenu)
CFG_WRITE_ENTRY_NUM(windowBorder) CFG_WRITE_ENTRY_NUM(windowBorder)
#if defined QT_VERSION && (QT_VERSION >= 0x040000) #if (0x039999 >= 0x040000)
CFG_WRITE_ENTRY(xbar) CFG_WRITE_ENTRY(xbar)
CFG_WRITE_ENTRY_NUM(dwtSettings) CFG_WRITE_ENTRY_NUM(dwtSettings)
#endif #endif
CFG_WRITE_ENTRY_NUM(bgndOpacity) CFG_WRITE_ENTRY_NUM(bgndOpacity)
CFG_WRITE_ENTRY_NUM(menuBgndOpacity) CFG_WRITE_ENTRY_NUM(menuBgndOpacity)
CFG_WRITE_ENTRY_NUM(dlgOpacity) 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(stdBtnSizes)
CFG_WRITE_ENTRY_NUM(titlebarButtons) CFG_WRITE_ENTRY_NUM(titlebarButtons)
CFG_WRITE_ENTRY(titlebarIcon) 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) && if((opts.titlebarButtons&TITLEBAR_BUTTON_COLOR || opts.titlebarButtons&TITLEBAR_BUTTON_ICON_COLOR) &&
opts.titlebarButtonColors.size() && 0==(opts.titlebarButtonColors.size()%NUM_TITLEBAR_BUTTONS)) opts.titlebarButtonColors.size() && 0==(opts.titlebarButtonColors.size()%NUM_TITLEBAR_BUTTONS))
{ {
QString val; TQString val;
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
QTextStream str(&val); TQTextStream str(&val);
#else #else
QTextStream str(&val, IO_WriteOnly); TQTextStream str(&val, IO_WriteOnly);
#endif #endif
for(unsigned int i=0; i<opts.titlebarButtonColors.size(); ++i) 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()) 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(gtkComboMenus)
CFG_WRITE_ENTRY(doubleGtkComboArrow) CFG_WRITE_ENTRY(doubleGtkComboArrow)
CFG_WRITE_ENTRY(gtkButtonOrder) 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) CFG_WRITE_ENTRY(reorderGtkButtons)
#endif #endif
CFG_WRITE_ENTRY(mapKdeIcons) CFG_WRITE_ENTRY(mapKdeIcons)
CFG_WRITE_ENTRY(shading) CFG_WRITE_ENTRY(shading)
CFG_WRITE_ENTRY(titlebarAlignment) CFG_WRITE_ENTRY(titlebarAlignment)
CFG_WRITE_ENTRY(centerTabText) 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(noBgndGradientApps)
CFG_WRITE_STRING_LIST_ENTRY(noBgndOpacityApps) CFG_WRITE_STRING_LIST_ENTRY(noBgndOpacityApps)
CFG_WRITE_STRING_LIST_ENTRY(noMenuBgndOpacityApps) 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(noMenuStripeApps)
CFG_WRITE_STRING_LIST_ENTRY(menubarApps) CFG_WRITE_STRING_LIST_ENTRY(menubarApps)
CFG_WRITE_STRING_LIST_ENTRY(statusbarApps) CFG_WRITE_STRING_LIST_ENTRY(statusbarApps)
CFG_WRITE_STRING_LIST_ENTRY(useQtFileDialogApps) CFG_WRITE_STRING_LIST_ENTRY(useTQtFileDialogApps)
#endif #endif
for(int i=APPEARANCE_CUSTOM1; i<(APPEARANCE_CUSTOM1+NUM_CUSTOM_GRAD); ++i) for(int i=APPEARANCE_CUSTOM1; i<(APPEARANCE_CUSTOM1+NUM_CUSTOM_GRAD); ++i)
{ {
GradientCont::const_iterator cg(opts.customGradient.find((EAppearance)i)); GradientCont::const_iterator cg(opts.customGradient.tqfind((EAppearance)i));
QString gradKey; TQString gradKey;
gradKey.sprintf("customgradient%d", (i-APPEARANCE_CUSTOM1)+1); 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; 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; TQString gradVal;
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
QTextStream str(&gradVal); TQTextStream str(&gradVal);
#else #else
QTextStream str(&gradVal, IO_WriteOnly); TQTextStream str(&gradVal, IO_WriteOnly);
#endif #endif
GradientStopCont stops((*cg).second.stops.fix()); GradientStopCont stops((*cg).second.stops.fix());
GradientStopCont::const_iterator it(stops.begin()), 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[4]!=def.customShades[4] ||
opts.customShades[5]!=def.customShades[5]) opts.customShades[5]!=def.customShades[5])
{ {
QString shadeVal; TQString shadeVal;
#if QT_VERSION >= 0x040000 #if 0x039999 >= 0x040000
QTextStream str(&shadeVal); TQTextStream str(&shadeVal);
#else #else
QTextStream str(&shadeVal, IO_WriteOnly); TQTextStream str(&shadeVal, IO_WriteOnly);
#endif #endif
if(0==opts.customShades[0]) if(0==opts.customShades[0])
str << 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 <pwd.h>
#include <sys/types.h> #include <sys/types.h>
#define QTC_MAX_FILENAME_LEN 1024 #define TQTC_MAX_FILENAME_LEN 1024
#define QTC_MAX_INPUT_LINE_LEN 256 #define TQTC_MAX_INPUT_LINE_LEN 256
#define QTC_FILE "qtcurvestylerc" #define TQTC_FILE "qtcurvestylerc"
#ifdef CONFIG_READ #ifdef CONFIG_READ
static int c2h(char ch) static int c2h(char ch)
@ -301,7 +301,7 @@ static const char * getHome()
static const char *xdgConfigFolder() static const char *xdgConfigFolder()
{ {
static char xdgDir[QTC_MAX_FILENAME_LEN]={'\0'}; static char xdgDir[TQTC_MAX_FILENAME_LEN]={'\0'};
if(!xdgDir[0]) if(!xdgDir[0])
{ {
@ -368,66 +368,66 @@ static const char *xdgConfigFolder()
#ifdef CONFIG_READ #ifdef CONFIG_READ
#ifdef __cplusplus #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 #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 #endif
static void checkColor(EShade *s, color *c) 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; *s=SHADE_NONE;
} }
#ifdef __cplusplus #ifdef __cplusplus
#if QT_VERSION >= 0x040000 #if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
#include <QMap> #include <TQMap>
#include <QFile> #include <TQFile>
#include <QTextStream> #include <TQTextStream>
#define QTC_LATIN1(A) A.toLatin1() #define TQTC_LATIN1(A) A.toLatin1()
#else #else
#define QTC_LATIN1(A) A.latin1() #define TQTC_LATIN1(A) A.latin1()
#include <qmap.h> #include <tqmap.h>
#include <qfile.h> #include <tqfile.h>
#include <qtextstream.h> #include <tqtextstream.h>
#endif #endif
class QtCConfig class TQtCConfig
{ {
public: public:
QtCConfig(const QString &filename); TQtCConfig(const TQString &filename);
bool ok() const { return values.count()>0; } 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: 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 [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
if(f.open(QIODevice::ReadOnly)) if(f.open(TQIODevice::ReadOnly))
#else #else
if(f.open(IO_ReadOnly)) if(f.open(IO_ReadOnly))
#endif #endif
{ {
QTextStream stream(&f); TQTextStream stream(&f);
QString line; TQString line;
while(!stream.atEnd()) while(!stream.atEnd())
{ {
line = stream.readLine(); line = stream.readLine();
#if QT_VERSION >= 0x040000 #if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
int pos=line.indexOf('='); int pos=line.indexOf('=');
#else #else
int pos=line.find('='); int pos=line.tqfind('=');
#endif #endif
if(-1!=pos) if(-1!=pos)
values[line.left(pos)]=line.mid(pos+1); 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); 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(); 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); return val.isEmpty() ? def : (val=="true" ? true : false);
} }
#if QT_VERSION >= 0x040000 #if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
#define QTC_LATIN1(A) A.toLatin1() #define TQTC_LATIN1(A) A.toLatin1()
#else #else
#define QTC_LATIN1(A) A.latin1() #define TQTC_LATIN1(A) A.latin1()
#endif #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()) \ if(sVal.isEmpty()) \
opts->ENTRY=def->ENTRY; \ opts->ENTRY=def->ENTRY; \
else \ else \
setRgb(&(opts->ENTRY), QTC_LATIN1(sVal)); \ setRgb(&(opts->ENTRY), TQTC_LATIN1(sVal)); \
} }
#else #else
@ -502,9 +502,9 @@ static GHashTable * loadConfig(const char *filename)
if(f) 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, '='); char *eq=strchr(line, '=');
int pos=eq ? eq-line : -1; 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; 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); \ const char *str=readStringEntry(cfg, #ENTRY); \
\ \
@ -565,63 +565,63 @@ static gboolean readBoolEntry(GHashTable *cfg, char *key, gboolean def)
} }
#endif #endif
#define QTC_CFG_READ_NUM(ENTRY) \ #define TQTC_CFG_READ_NUM(ENTRY) \
opts->ENTRY=readNumEntry(cfg, #ENTRY, def->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); opts->ENTRY=readBoolEntry(cfg, #ENTRY, def->ENTRY);
#define QTC_CFG_READ_ROUND(ENTRY) \ #define TQTC_CFG_READ_ROUND(ENTRY) \
opts->ENTRY=toRound(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->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; opts->ENTRY=((double)(readNumEntry(cfg, #ENTRY, ((int)(def->ENTRY*100))-100)+100))/100.0;
#define QTC_CFG_READ_TB_BORDER(ENTRY) \ #define TQTC_CFG_READ_TB_BORDER(ENTRY) \
opts->ENTRY=toTBarBorder(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toTBarBorder(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_MOUSE_OVER(ENTRY) \ #define TQTC_CFG_READ_MOUSE_OVER(ENTRY) \
opts->ENTRY=toMouseOver(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toMouseOver(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_APPEARANCE(ENTRY, DEF) \ #define TQTC_CFG_READ_APPEARANCE(ENTRY, DEF) \
opts->ENTRY=toAppearance(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), DEF); opts->ENTRY=toAppearance(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), DEF);
/* /*
#define QTC_CFG_READ_APPEARANCE(ENTRY) \ #define TQTC_CFG_READ_APPEARANCE(ENTRY) \
opts->ENTRY=toAppearance(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toAppearance(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
*/ */
#define QTC_CFG_READ_STRIPE(ENTRY) \ #define TQTC_CFG_READ_STRIPE(ENTRY) \
opts->ENTRY=toStripe(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toStripe(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_SLIDER(ENTRY) \ #define TQTC_CFG_READ_SLIDER(ENTRY) \
opts->ENTRY=toSlider(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toSlider(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_DEF_BTN(ENTRY) \ #define TQTC_CFG_READ_DEF_BTN(ENTRY) \
opts->ENTRY=toInd(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toInd(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_LINE(ENTRY) \ #define TQTC_CFG_READ_LINE(ENTRY) \
opts->ENTRY=toLine(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toLine(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_SHADE(ENTRY, AD) \ #define TQTC_CFG_READ_SHADE(ENTRY, AD) \
opts->ENTRY=toShade(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), AD, def->ENTRY); opts->ENTRY=toShade(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), AD, def->ENTRY);
#define QTC_CFG_READ_SCROLLBAR(ENTRY) \ #define TQTC_CFG_READ_SCROLLBAR(ENTRY) \
opts->ENTRY=toScrollbar(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toScrollbar(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#define QTC_CFG_READ_EFFECT(ENTRY) \ #define TQTC_CFG_READ_EFFECT(ENTRY) \
opts->ENTRY=toEffect(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toEffect(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#ifdef QTC_CONFIG_DIALOG #ifdef TQTC_CONFIG_DIALOG
#define QTC_CFG_READ_SHADING(ENTRY, UNUSED) \ #define TQTC_CFG_READ_SHADING(ENTRY, UNUSED) \
opts->ENTRY=toShading(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY); opts->ENTRY=toShading(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#else #else
#define QTC_CFG_READ_SHADING(ENTRY, DEF) \ #define TQTC_CFG_READ_SHADING(ENTRY, DEF) \
ENTRY=toShading(QTC_LATIN1(readStringEntry(cfg, #ENTRY)), DEF); ENTRY=toShading(TQTC_LATIN1(readStringEntry(cfg, #ENTRY)), DEF);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
static bool readConfig(const QString &file, Options *opts, Options *def) static bool readConfig(const TQString &file, Options *opts, Options *def)
#else #else
static bool readConfig(const char *file, Options *opts, Options *def) static bool readConfig(const char *file, Options *opts, Options *def)
#endif #endif
@ -633,9 +633,9 @@ static bool readConfig(const char *file, Options *opts, Options *def)
if(xdg) if(xdg)
{ {
QString filename(xdg); TQString filename(xdg);
filename+="/"QTC_FILE; filename+="/"TQTC_FILE;
return readConfig(filename, opts, def); return readConfig(filename, opts, def);
} }
} }
@ -646,9 +646,9 @@ static bool readConfig(const char *file, Options *opts, Options *def)
if(xdg) 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); return readConfig(filename, opts, def);
} }
} }
@ -656,7 +656,7 @@ static bool readConfig(const char *file, Options *opts, Options *def)
else else
{ {
#ifdef __cplusplus #ifdef __cplusplus
QtCConfig cfg(file); TQtCConfig cfg(file);
if(cfg.ok()) if(cfg.ok())
{ {
@ -666,77 +666,77 @@ static bool readConfig(const char *file, Options *opts, Options *def)
if(cfg) if(cfg)
{ {
#endif #endif
QTC_CFG_READ_NUM(passwordChar) TQTC_CFG_READ_NUM(passwordChar)
QTC_CFG_READ_ROUND(round) TQTC_CFG_READ_ROUND(round)
QTC_CFG_READ_DI(highlightFactor) TQTC_CFG_READ_DI(highlightFactor)
QTC_CFG_READ_TB_BORDER(toolbarBorders) TQTC_CFG_READ_TB_BORDER(toolbarBorders)
QTC_CFG_READ_APPEARANCE(appearance, def->appearance) TQTC_CFG_READ_APPEARANCE(appearance, def->appearance)
QTC_CFG_READ_BOOL(fixParentlessDialogs) TQTC_CFG_READ_BOOL(fixParentlessDialogs)
QTC_CFG_READ_STRIPE(stripedProgress) TQTC_CFG_READ_STRIPE(stripedProgress)
QTC_CFG_READ_SLIDER(sliderStyle) TQTC_CFG_READ_SLIDER(sliderStyle)
QTC_CFG_READ_BOOL(animatedProgress) TQTC_CFG_READ_BOOL(animatedProgress)
QTC_CFG_READ_BOOL(lighterPopupMenuBgnd) TQTC_CFG_READ_BOOL(lighterPopupMenuBgnd)
QTC_CFG_READ_BOOL(embolden) TQTC_CFG_READ_BOOL(embolden)
QTC_CFG_READ_DEF_BTN(defBtnIndicator) TQTC_CFG_READ_DEF_BTN(defBtnIndicator)
QTC_CFG_READ_LINE(sliderThumbs) TQTC_CFG_READ_LINE(sliderThumbs)
QTC_CFG_READ_LINE(handles) TQTC_CFG_READ_LINE(handles)
QTC_CFG_READ_BOOL(highlightTab) TQTC_CFG_READ_BOOL(highlightTab)
QTC_CFG_READ_BOOL(colorSelTab) TQTC_CFG_READ_BOOL(colorSelTab)
QTC_CFG_READ_SHADE(shadeSliders, false) TQTC_CFG_READ_SHADE(shadeSliders, false)
QTC_CFG_READ_SHADE(shadeMenubars, true) TQTC_CFG_READ_SHADE(shadeMenubars, true)
QTC_CFG_READ_SHADE(shadeCheckRadio, false) TQTC_CFG_READ_SHADE(shadeCheckRadio, false)
QTC_CFG_READ_APPEARANCE(menubarAppearance, def->menubarAppearance) TQTC_CFG_READ_APPEARANCE(menubarAppearance, def->menubarAppearance)
QTC_CFG_READ_APPEARANCE(menuitemAppearance, opts->appearance) TQTC_CFG_READ_APPEARANCE(menuitemAppearance, opts->appearance)
QTC_CFG_READ_APPEARANCE(toolbarAppearance, def->toolbarAppearance) TQTC_CFG_READ_APPEARANCE(toolbarAppearance, def->toolbarAppearance)
QTC_CFG_READ_LINE(toolbarSeparators) TQTC_CFG_READ_LINE(toolbarSeparators)
QTC_CFG_READ_LINE(splitters) TQTC_CFG_READ_LINE(splitters)
QTC_CFG_READ_BOOL(customMenuTextColor) TQTC_CFG_READ_BOOL(customMenuTextColor)
QTC_CFG_READ_MOUSE_OVER(coloredMouseOver) TQTC_CFG_READ_MOUSE_OVER(coloredMouseOver)
QTC_CFG_READ_BOOL(menubarMouseOver) TQTC_CFG_READ_BOOL(menubarMouseOver)
QTC_CFG_READ_BOOL(shadeMenubarOnlyWhenActive) TQTC_CFG_READ_BOOL(shadeMenubarOnlyWhenActive)
QTC_CFG_READ_BOOL(thinnerMenuItems) TQTC_CFG_READ_BOOL(thinnerMenuItems)
QTC_CFG_READ_COLOR(customSlidersColor) TQTC_CFG_READ_COLOR(customSlidersColor)
QTC_CFG_READ_COLOR(customMenubarsColor) TQTC_CFG_READ_COLOR(customMenubarsColor)
QTC_CFG_READ_COLOR(customMenuSelTextColor) TQTC_CFG_READ_COLOR(customMenuSelTextColor)
QTC_CFG_READ_COLOR(customMenuNormTextColor) TQTC_CFG_READ_COLOR(customMenuNormTextColor)
QTC_CFG_READ_COLOR(customCheckRadioColor) TQTC_CFG_READ_COLOR(customCheckRadioColor)
QTC_CFG_READ_SCROLLBAR(scrollbarType) TQTC_CFG_READ_SCROLLBAR(scrollbarType)
QTC_CFG_READ_EFFECT(buttonEffect) TQTC_CFG_READ_EFFECT(buttonEffect)
QTC_CFG_READ_APPEARANCE(lvAppearance, opts->appearance) TQTC_CFG_READ_APPEARANCE(lvAppearance, opts->appearance)
QTC_CFG_READ_APPEARANCE(tabAppearance, opts->appearance) TQTC_CFG_READ_APPEARANCE(tabAppearance, opts->appearance)
QTC_CFG_READ_APPEARANCE(sliderAppearance, opts->appearance) TQTC_CFG_READ_APPEARANCE(sliderAppearance, opts->appearance)
QTC_CFG_READ_APPEARANCE(progressAppearance, opts->appearance) TQTC_CFG_READ_APPEARANCE(progressAppearance, opts->appearance)
#ifndef QTC_PLAIN_FOCUS_ONLY #ifndef TQTC_PLAIN_FOCUS_ONLY
QTC_CFG_READ_BOOL(stdFocus) TQTC_CFG_READ_BOOL(stdFocus)
#endif #endif
QTC_CFG_READ_BOOL(lvLines) TQTC_CFG_READ_BOOL(lvLines)
QTC_CFG_READ_BOOL(drawStatusBarFrames) TQTC_CFG_READ_BOOL(drawStatusBarFrames)
QTC_CFG_READ_BOOL(fillSlider) TQTC_CFG_READ_BOOL(fillSlider)
QTC_CFG_READ_BOOL(roundMbTopOnly) TQTC_CFG_READ_BOOL(roundMbTopOnly)
QTC_CFG_READ_BOOL(borderMenuitems) TQTC_CFG_READ_BOOL(borderMenuitems)
QTC_CFG_READ_BOOL(gradientPbGroove) TQTC_CFG_READ_BOOL(gradientPbGroove)
QTC_CFG_READ_BOOL(darkerBorders) TQTC_CFG_READ_BOOL(darkerBorders)
QTC_CFG_READ_BOOL(vArrows) TQTC_CFG_READ_BOOL(vArrows)
QTC_CFG_READ_BOOL(xCheck) TQTC_CFG_READ_BOOL(xCheck)
QTC_CFG_READ_BOOL(framelessGroupBoxes) TQTC_CFG_READ_BOOL(framelessGroupBoxes)
QTC_CFG_READ_BOOL(inactiveHighlight) TQTC_CFG_READ_BOOL(inactiveHighlight)
QTC_CFG_READ_BOOL(colorMenubarMouseOver) TQTC_CFG_READ_BOOL(colorMenubarMouseOver)
#ifdef __cplusplus #ifdef __cplusplus
QTC_CFG_READ_BOOL(stdSidebarButtons) TQTC_CFG_READ_BOOL(stdSidebarButtons)
QTC_CFG_READ_BOOL(gtkScrollViews) TQTC_CFG_READ_BOOL(gtkScrollViews)
QTC_CFG_READ_BOOL(gtkComboMenus) TQTC_CFG_READ_BOOL(gtkComboMenus)
/* /*
#else #else
QTC_CFG_READ_BOOL(setDialogButtonOrder) TQTC_CFG_READ_BOOL(setDialogButtonOrder)
*/ */
#endif #endif
#if !defined __cplusplus || defined QTC_CONFIG_DIALOG #if !defined __cplusplus || defined TQTC_CONFIG_DIALOG
QTC_CFG_READ_BOOL(mapKdeIcons) TQTC_CFG_READ_BOOL(mapKdeIcons)
#endif #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
QTC_CFG_READ_BOOL(gtkButtonOrder) TQTC_CFG_READ_BOOL(gtkButtonOrder)
#endif #endif
QTC_CFG_READ_SHADING(shading, shading); TQTC_CFG_READ_SHADING(shading, shading);
#ifndef __cplusplus #ifndef __cplusplus
releaseConfig(cfg); releaseConfig(cfg);
@ -793,7 +793,7 @@ static bool fileExists(const char *path)
static const char * getSystemConfigFile() 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; int i;
@ -842,7 +842,7 @@ static void defaultSettings(Options *opts)
opts->thinnerMenuItems=false; opts->thinnerMenuItems=false;
opts->scrollbarType=SCROLLBAR_KDE; opts->scrollbarType=SCROLLBAR_KDE;
opts->buttonEffect=EFFECT_NONE; opts->buttonEffect=EFFECT_NONE;
#ifndef QTC_PLAIN_FOCUS_ONLY #ifndef TQTC_PLAIN_FOCUS_ONLY
opts->stdFocus=true; opts->stdFocus=true;
#endif #endif
opts->lvLines=false; opts->lvLines=false;
@ -857,7 +857,7 @@ static void defaultSettings(Options *opts)
opts->framelessGroupBoxes=false; opts->framelessGroupBoxes=false;
opts->colorMenubarMouseOver=false; opts->colorMenubarMouseOver=false;
opts->inactiveHighlight=false; opts->inactiveHighlight=false;
#ifdef QTC_CONFIG_DIALOG #ifdef TQTC_CONFIG_DIALOG
opts->shading=SHADING_HSL; opts->shading=SHADING_HSL;
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
@ -880,10 +880,10 @@ static void defaultSettings(Options *opts)
opts->customCheckRadioColor.red=opts->customCheckRadioColor.green=opts->customCheckRadioColor.blue=0; opts->customCheckRadioColor.red=opts->customCheckRadioColor.green=opts->customCheckRadioColor.blue=0;
#endif #endif
#if !defined __cplusplus || defined QTC_CONFIG_DIALOG #if !defined __cplusplus || defined TQTC_CONFIG_DIALOG
opts->mapKdeIcons=true; opts->mapKdeIcons=true;
#endif #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; opts->gtkButtonOrder=false;
#endif #endif
@ -1050,9 +1050,9 @@ static const char *toStr(EEffect e)
inline const char * toStr(bool b) { return b ? "true" : "false"; } 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()); colorStr.sprintf("#%02X%02X%02X", col.red(), col.green(), col.blue());
return colorStr; 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 #define CFG config
#else #else
#define CFG (*cfg) #define CFG (*cfg)
@ -1147,11 +1147,11 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
if(xdg) 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); KConfig defCfg(filename, KConfig::SimpleConfig);
#else #else
KConfig defCfg(filename, false, false); KConfig defCfg(filename, false, false);
@ -1162,10 +1162,10 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
} }
else else
{ {
#if QT_VERSION >= 0x040000 #if [[[TQT_VERSION IS DEPRECATED]]] >= 0x040000
KConfigGroup config(cfg, QTC_GROUP); KConfigGroup config(cfg, TQTC_GROUP);
#else #else
cfg->setGroup(QTC_GROUP); cfg->setGroup(TQTC_GROUP);
#endif #endif
CFG_WRITE_ENTRY_NUM(passwordChar) CFG_WRITE_ENTRY_NUM(passwordChar)
CFG_WRITE_ENTRY(round) 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(tabAppearance)
CFG_WRITE_ENTRY_FORCE(sliderAppearance) CFG_WRITE_ENTRY_FORCE(sliderAppearance)
CFG_WRITE_ENTRY_FORCE(progressAppearance) CFG_WRITE_ENTRY_FORCE(progressAppearance)
#ifndef QTC_PLAIN_FOCUS_ONLY #ifndef TQTC_PLAIN_FOCUS_ONLY
CFG_WRITE_ENTRY(stdFocus) CFG_WRITE_ENTRY(stdFocus)
#endif #endif
CFG_WRITE_ENTRY(lvLines) CFG_WRITE_ENTRY(lvLines)

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

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

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

Loading…
Cancel
Save