Drop USE_TQT4 code

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/9/head
Michele Calgaro 8 months ago
parent 2493c9445c
commit 54852b3b05
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1,6 +1,6 @@
/*
This file is taken from kcolorspaces.cpp and kcolorutils.cpp from tdelibs
The code has been modified to work with TQColor (TQt3 &TQt4) and GdkColor
The code has been modified to work with TQColor (TQt3) and GdkColor
*/
/* This file is part of the KDE project

@ -29,14 +29,6 @@
#include <math.h>
#include "config.h"
// #define QT4_OR_ABOVE 1
#if defined _WIN32 && defined QT4_OR_ABOVE
#include <sys/stat.h>
#include <float.h>
#include <direct.h>
#endif
#ifdef __cplusplus
#include <tqconfig.h>
#ifdef CONFIG_DIALOG
@ -44,42 +36,18 @@
#endif
#include <map>
#include <set>
#if !defined CONFIG_DIALOG && defined QT4_OR_ABOVE
#include <TQtCore/TQString>
#endif
#else
#include <glib.h>
#endif
#ifdef __cplusplus
#include <tqpixmap.h>
#if defined QT4_OR_ABOVE
#include <TQtCore/TQSet>
#include <tqstyle.h>
#endif
#endif
#if defined QT4_OR_ABOVE && !defined TQTC_TQT_ONLY
#include <KDE/KColorUtils>
#endif
#ifdef __cplusplus
namespace TDEQtCurveStyle {
#endif
#if defined _WIN32 && defined QT4_OR_ABOVE
static int isnan(double x)
{
return _isnan(x);
}
static int lstat(const char* fileName, struct stat* s)
{
return stat(fileName, s);
}
#endif
/*
The following #define disables the rounding when scrollbar type==none.
#define SIMPLE_SCROLLBARS
@ -102,12 +70,7 @@ typedef enum
#ifdef __cplusplus
typedef TQColor color;
#if defined QT4_OR_ABOVE
typedef TQSet<TQString> Strings;
#else
typedef TQStringList Strings;
#endif
#else
typedef gboolean bool;
@ -395,25 +358,20 @@ enum
#define FULLLY_ROUNDED (opts.round>=ROUND_FULL)
#define DO_EFFECT (EFFECT_NONE!=opts.buttonEffect)
#if !defined __cplusplus || ( defined QT4_OR_ABOVE)
#if !defined __cplusplus
#define SLIDER_GLOW (DO_EFFECT && MO_GLOW==opts.coloredMouseOver /*&& SLIDER_TRIANGULAR!=opts.sliderStyle*/ ? 2 : 0)
#endif
#define ENTRY_MO (opts.unifyCombo && opts.unifySpin)
#if !defined __cplusplus || ( defined QT4_OR_ABOVE)
#if !defined __cplusplus
#define FOCUS_ALPHA 0.08
#define FOCUS_GLOW_LINE_ALPHA 0.5
#define BORDER_BLEND_ALPHA 0.7
#define ETCH_TOP_ALPHA 0.055
#define ETCH_BOTTOM_ALPHA 0.1
// #if defined QT4_OR_ABOVE
// #define ETCH_RADIO_TOP_ALPHA 0.055
// #define ETCH_RADIO_BOTTOM_ALPHA 0.80
// #else
#define ETCH_RADIO_TOP_ALPHA 0.09
#define ETCH_RADIO_BOTTOM_ALPHA 1.0
// #endif
#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
@ -439,44 +397,7 @@ enum
#endif
#if defined __cplusplus && defined QT4_OR_ABOVE
typedef enum
{
TQtC_Round = TQStyle::PM_CustomBase,
TQtC_TitleBarButtonAppearance,
TQtC_TitleAlignment,
TQtC_TitleBarButtons,
TQtC_TitleBarIcon,
TQtC_TitleBarIconColor,
TQtC_TitleBarEffect,
TQtC_BlendMenuAndTitleBar,
TQtC_ShadeMenubarOnlyWhenActive,
TQtC_ToggleButtons,
TQtC_MenubarColor,
TQtC_WindowBorder,
TQtC_CustomBgnd,
TQtC_TitleBarApp
} TQtCMetrics;
#define TQtC_StateKWin ((TQStyle::StateFlag)0x10000000)
// PE_FrameWindow
#define TQtC_StateKWinNotFull ((TQStyle::StateFlag)0x20000000)
// CC_TitleBar
#define TQtC_StateKWinFillBgnd ((TQStyle::StateFlag)0x20000000)
#define TQtC_StateKWinNoBorder ((TQStyle::StateFlag)0x40000000)
#define TQtC_StateKWinCompositing ((TQStyle::StateFlag)0x80000000)
#define TQtC_StateKWinTabDrag ((TQStyle::StateFlag)0x00000001)
#define TQtC_PE_DrawBackground ((TQStyle::PrimitiveElement)(TQStyle::PE_CustomBase+10000))
#define CLOSE_COLOR TQColor(191, 82, 82)
#define DARK_WINDOW_TEXT(A) ((A).red()<230 || (A).green()<230 || (A).blue()<230)
#define HOVER_BUTTON_ALPHA(A) (DARK_WINDOW_TEXT(A) ? 0.25 : 0.65)
#define WINDOW_TEXT_SHADOW_ALPHA(A) (EFFECT_SHADOW==(A) ? 0.10 : 0.60)
#define WINDOW_SHADOW_COLOR(A) (EFFECT_SHADOW==(A) ? TQt::black : TQt::white)
#endif
#if defined CONFIG_DIALOG || ( defined QT4_OR_ABOVE)
#if defined CONFIG_DIALOG
#define QTCURVE_PREVIEW_CONFIG "QTCURVE_PREVIEW_CONFIG"
#define QTCURVE_PREVIEW_CONFIG_FULL "QTCURVE_PREVIEW_CONFIG_FULL"
@ -1135,7 +1056,7 @@ typedef struct
*/
#endif
mapKdeIcons,
#if defined CONFIG_DIALOG || ( defined QT4_OR_ABOVE) || !defined __cplusplus
#if defined CONFIG_DIALOG || !defined __cplusplus
gtkButtonOrder,
#endif
fadeLines,
@ -1165,11 +1086,8 @@ typedef struct
borderInactiveTab,
doubleGtkComboArrow,
menuIcons,
#if defined CONFIG_DIALOG || ( defined QT4_OR_ABOVE)
#if defined CONFIG_DIALOG
stdBtnSizes,
#endif
#if defined QT4_OR_ABOVE
xbar,
#endif
forceAlternateLvCols,
invertBotTab,
@ -1191,10 +1109,7 @@ typedef struct
bgndOpacity,
menuBgndOpacity,
dlgOpacity;
#if defined QT4_OR_ABOVE
int dwtSettings;
#endif
#if defined CONFIG_DIALOG || ( defined QT4_OR_ABOVE)
#if defined CONFIG_DIALOG
int titlebarButtons;
TBCols titlebarButtonColors;
ETitleBarIcon titlebarIcon;
@ -1275,7 +1190,7 @@ typedef struct
TQtCPixmap menuBgndPixmap;
TQtCImage bgndImage,
menuBgndImage;
#if !defined __cplusplus || ( defined QT4_OR_ABOVE)
#if !defined __cplusplus
/* NOTE: If add any more settings here, need to alter copyOpts/freeOpts/defaultSettings in config_file.c */
Strings noBgndGradientApps,
noBgndOpacityApps,
@ -1286,14 +1201,6 @@ typedef struct
Strings noDlgFixApps;
#endif
Strings noMenuStripeApps;
#if defined QT4_OR_ABOVE
Strings menubarApps,
statusbarApps,
useTQtFileDialogApps,
windowDragWhiteList,
windowDragBlackList;
#endif
#ifndef __cplusplus
} Options;
#else
@ -1485,10 +1392,6 @@ inline int limit(double c)
}
#endif
#if defined QT4_OR_ABOVE && !defined TQTC_TQT_ONLY
#define tint(COLA, COLB, FACTOR) KColorUtils::tint((COLA), (COLB), (FACTOR))
#define midColor(COLA, COLB) KColorUtils::mix((COLA), (COLB), 0.5)
#else
#include "colorutils.c"
#ifdef __cplusplus
#define tint(COLA, COLB, FACTOR) ColorUtils_tint(&(COLA), &(COLB), (FACTOR))
@ -1498,7 +1401,6 @@ inline int limit(double c)
#define tint(COLA, COLB, FACTOR) ColorUtils_tint((COLA), (COLB), (FACTOR))
#define midColor(COLA, COLB) ColorUtils_mix((COLA), (COLB), 0.5)
#endif
#endif
#ifdef __cplusplus
static void shade(const Options *opts, const color &ca, color *cb, double k)
@ -1596,12 +1498,7 @@ static void shade(const Options *opts, const color *ca, color *cb, double k)
case SHADING_HCY:
{
#define HCY_FACTOR 0.15
#if defined QT4_OR_ABOVE && !defined TQTC_TQT_ONLY
if(k>1.0)
*cb=KColorUtils::lighten(ca, (k*(1+HCY_FACTOR))-1.0, 1.0);
else
*cb=KColorUtils::darken(ca, 1.0-(k*(1-HCY_FACTOR)), 1.0);
#elif defined __cplusplus
#if defined __cplusplus
if(k>1.0)
*cb=ColorUtils_lighten(&ca, (k*(1+HCY_FACTOR))-1.0, 1.0);
else
@ -1614,9 +1511,6 @@ static void shade(const Options *opts, const color *ca, color *cb, double k)
#endif
}
}
#if defined __cplusplus && defined QT4_OR_ABOVE
cb->setAlpha(ca.alpha());
#endif
#ifndef __cplusplus
cb->pixel = ca->pixel;
#endif
@ -1819,7 +1713,7 @@ static EAppearance widgetApp(EWidget w, const Options *opts)
#define MIN_ROUND_MAX_HEIGHT 12
#define MIN_ROUND_MAX_WIDTH 24
#if !defined __cplusplus || ( defined QT4_OR_ABOVE)
#if !defined __cplusplus
#if defined __cplusplus
#define EXTRA_INNER_RADIUS 3.5
@ -1894,17 +1788,12 @@ ERound getWidgetRound(const Options *opts, int w, int h, EWidget widget)
if((WIDGET_CHECKBOX==widget || WIDGET_FOCUS==widget) && ROUND_NONE!=r)
r=ROUND_SLIGHT;
#if defined __cplusplus && ( defined QT4_OR_ABOVE)
if((WIDGET_MDI_WINDOW_BUTTON==widget && (opts->titlebarButtons&TITLEBAR_BUTTON_ROUND)) ||
WIDGET_RADIO_BUTTON==widget || WIDGET_DIAL==widget)
return ROUND_MAX;
#endif
#ifndef __cplusplus
if(WIDGET_RADIO_BUTTON==widget)
return ROUND_MAX;
#endif
#if !defined __cplusplus || ( defined QT4_OR_ABOVE)
#if !defined __cplusplus
if(WIDGET_SLIDER==widget &&
(SLIDER_ROUND==opts->sliderStyle || SLIDER_ROUND_ROTATED==opts->sliderStyle || SLIDER_CIRCULAR==opts->sliderStyle))
return ROUND_MAX;
@ -1942,17 +1831,12 @@ static double getRadius(const Options *opts, int w, int h, EWidget widget, ERadi
(WIDGET_ENTRY==widget && (opts->square&SQUARE_ENTRY)) )
return 0.0;
#if defined __cplusplus && ( defined QT4_OR_ABOVE)
if((WIDGET_MDI_WINDOW_BUTTON==widget && (opts->titlebarButtons&TITLEBAR_BUTTON_ROUND)) ||
WIDGET_RADIO_BUTTON==widget || WIDGET_DIAL==widget)
return (w>h ? h : w)/2.0;
#endif
#ifndef __cplusplus
if(WIDGET_RADIO_BUTTON==widget)
return (w>h ? h : w)/2.0;
#endif
#if !defined __cplusplus || ( defined QT4_OR_ABOVE)
#if !defined __cplusplus
if(WIDGET_SLIDER==widget &&
(SLIDER_ROUND==opts->sliderStyle || SLIDER_ROUND_ROTATED==opts->sliderStyle || SLIDER_CIRCULAR==opts->sliderStyle))
return (w>h ? h : w)/2.0;

@ -1276,11 +1276,7 @@ void QtCurveStyle::applicationPolish(const TQStyleControlElementData &ceData, Co
{
TQMetaObject *meta=(TQMetaObject *)metaObject();
#ifdef USE_QT4
#warning Qt4 does not allow the metaobject classname to be set (skipping)
#else // USE_QT4
meta->classname="HighContrastStyle";
#endif // USE_QT4
}
if(opts.scrollbarType==SCROLLBAR_NEXT)

Loading…
Cancel
Save