summaryrefslogtreecommitdiffstats
path: root/src/qt_qt_wrapper.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-01 21:04:03 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-01 21:04:03 +0000
commitaaca1f57ef3dc6f96057625a4978397bb376e570 (patch)
tree14fe35292dfdfd5a688642eec3a29760c66edb06 /src/qt_qt_wrapper.cpp
parent0a404f40f6dafde84ba50c0cfbfa8ef787aa4406 (diff)
downloadgtk-qt-engine-aaca1f57ef3dc6f96057625a4978397bb376e570.tar.gz
gtk-qt-engine-aaca1f57ef3dc6f96057625a4978397bb376e570.zip
Fix gtk-qt-engine loading failure
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gtk-qt-engine@1244319 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/qt_qt_wrapper.cpp')
-rw-r--r--src/qt_qt_wrapper.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/src/qt_qt_wrapper.cpp b/src/qt_qt_wrapper.cpp
index 40f74c7..d871e61 100644
--- a/src/qt_qt_wrapper.cpp
+++ b/src/qt_qt_wrapper.cpp
@@ -43,7 +43,7 @@
#define RC_CACHE_VERSION TQString("1")
-bool gtkTQtEnable = false;
+bool gtkQtEnable = false;
bool mozillaFix = false;
bool tqAppOwner = false;
@@ -86,14 +86,14 @@ int isDomino;
int isPolyester;
int eclipseFix;
int openOfficeFix;
-int gtkTQtDebug;
+int gtkQtDebug;
Atom kipcCommAtom;
Atom desktopWindowAtom;
void setFillPixmap(GdkPixbuf* buf)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
// This code isn't very robust. It doesn't handle depths other than 24 bits.
@@ -205,7 +205,7 @@ void createTQApp()
}
if (ret == -1)
{
- printf("Gtk-TQt theme engine warning:\n");
+ printf("Gtk-Qt theme engine warning:\n");
printf(msg);
printf(" This may cause problems for the GNOME window manager\n");
}
@@ -289,7 +289,7 @@ void createTQApp()
if (ret == -1)
{
- printf("Gtk-TQt theme engine warning:\n");
+ printf("Gtk-Qt theme engine warning:\n");
printf(msg);
printf(" This may cause problems for the GNOME window manager\n");
}
@@ -300,7 +300,7 @@ void createTQApp()
int fd = open(cmdlinePath, O_RDONLY);
if (fd == -1)
{
- printf("Gtk-TQt theme engine warning:\n");
+ printf("Gtk-Qt theme engine warning:\n");
printf(" Could not open %s\n", (const char*)cmdlinePath);
printf(" This may cause problems for the GNOME window manager\n");
}
@@ -330,15 +330,15 @@ void createTQApp()
eclipseFix = cmdLine.tqcontains("eclipse");
- gtkTQtDebug = (getenv("GTK_TQT_ENGINE_DEBUG") != NULL) ? 1 : 0;
+ gtkQtDebug = (getenv("GTK_TQT_ENGINE_DEBUG") != NULL) ? 1 : 0;
- if (gtkTQtDebug)
+ if (gtkQtDebug)
printf("createTQApp()\n");
char* sessionEnv = getenv("SESSION_MANAGER");
if (TQString(sessionEnv).endsWith(TQString::number(getpid())) || cmdLine.tqcontains("nspluginviewer") || cmdLine.tqcontains("gnome-wm") || cmdLine.tqcontains("metacity") || cmdLine.tqcontains("xfwm4") || (getenv("GTK_TQT_ENGINE_DISABLE") != NULL))
{
- printf("Not initializing the Gtk-TQt theme engine\n");
+ printf("Not initializing the Gtk-Qt theme engine\n");
}
else
{
@@ -372,13 +372,13 @@ void createTQApp()
XSetErrorHandler( original_x_errhandler );
XSetIOErrorHandler( original_xio_errhandler );
- gtkTQtEnable = true;
+ gtkQtEnable = true;
}
free(argv[0]);
free(argv);
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
isBaghira = (TQString(tqApp->tqstyle().name()).lower() == "baghira");
@@ -436,7 +436,7 @@ void createTQApp()
void destroyTQApp()
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
delete meepWidget;
delete meepWidgetP;
@@ -463,7 +463,7 @@ GdkFilterReturn gdkEventFilter(GdkXEvent *xevent, GdkEvent *gevent, gpointer dat
if (event->xclient.data.l[0] != 2)
return GDK_FILTER_REMOVE;
- if (gtkTQtDebug)
+ if (gtkQtDebug)
printf("StyleChanged IPC message\n");
// Find out the new widget style
@@ -619,7 +619,7 @@ TQColor gdkColorToTQColor(GdkColor* c)
void drawButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int defaultButton, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -654,7 +654,7 @@ void drawButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int defa
// Thanks Peter Hartshorn <peter@dimtech.com.au>
void drawToolbar(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
int w1, h1;
@@ -709,7 +709,7 @@ void drawToolbar(GdkWindow* window, GtkStyle* style, GtkStateType state, int x,
void drawMenubar(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
int w1, h1;
@@ -758,7 +758,7 @@ void drawMenubar(GdkWindow* window, GtkStyle* style, GtkStateType state, int x,
void drawTab(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -789,7 +789,7 @@ void drawTab(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int
void drawVLine(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int ySource, int yDest)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
int width = style->xthickness;
@@ -816,7 +816,7 @@ void drawVLine(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, in
void drawHLine(GdkWindow* window, GtkStyle* style, GtkStateType state, int y, int xSource, int xDest)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
int width = abs(xSource-xDest);
@@ -841,7 +841,7 @@ void drawHLine(GdkWindow* window, GtkStyle* style, GtkStateType state, int y, in
void drawLineEdit(GdkWindow* window, GtkStyle* style, GtkStateType state, int hasFocus, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -864,7 +864,7 @@ void drawLineEdit(GdkWindow* window, GtkStyle* style, GtkStateType state, int ha
void drawFrame(GdkWindow* window, GtkStyle* style, GtkStateType state, GtkShadowType shadow_type, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1)) // Caused crash in gaim file transfers window
@@ -891,7 +891,7 @@ void drawFrame(GdkWindow* window, GtkStyle* style, GtkStateType state, GtkShadow
void drawComboBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -919,7 +919,7 @@ void drawComboBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int x,
void drawCheckBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int checked, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
int realH = tqApp->tqstyle().tqpixelMetric(TQStyle::PM_IndicatorHeight);
@@ -938,7 +938,7 @@ void drawCheckBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int ch
painter.fillRect(0, 0, realW, realH, tqApp->tqpalette().active().brush(TQColorGroup::Background));
tqApp->tqstyle().tqdrawControl(TQStyle::CE_CheckBox, &painter, &checkbox, TQRect(0, 0, realW, realH), tqApp->tqpalette().active(), sflags);
- // TQt checkboxes are usually bigger than GTK wants.
+ // Qt checkboxes are usually bigger than GTK wants.
// We cheat, and draw them over the expected area.
int xOffset = (realW - w) / 2;
int yOffset = (realH - h) / 2;
@@ -950,7 +950,7 @@ void drawCheckBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int ch
void drawMenuCheck(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
TQCheckBox checkbox(0);
@@ -985,7 +985,7 @@ void drawMenuCheck(GdkWindow* window, GtkStyle* style, GtkStateType state, int x
void drawRadioButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int checked, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
int realH = tqApp->tqstyle().tqpixelMetric(TQStyle::PM_IndicatorHeight);
@@ -1010,7 +1010,7 @@ void drawRadioButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int
tqApp->tqstyle().tqdrawControl(TQStyle::CE_RadioButton, &painter, &radio, TQRect(0,0,realH,realW), tqApp->tqpalette().active(), sflags);
- // TQt checkboxes are usually bigger than GTK wants.
+ // Qt checkboxes are usually bigger than GTK wants.
// We cheat, and draw them over the expected area.
int xOffset = (realW - w) / 2;
int yOffset = (realH - h) / 2;
@@ -1023,7 +1023,7 @@ void drawRadioButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int
void drawScrollBarSlider(GdkWindow* window, GtkStyle* style, GtkStateType state, int orientation, GtkAdjustment* adj, int x, int y, int w, int h, int offset, int totalExtent)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1077,13 +1077,13 @@ void drawScrollBarSlider(GdkWindow* window, GtkStyle* style, GtkStateType state,
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- bitBlt(TQT_TQPAINTDEVICE(&pixmap), 1, 0, TQT_TQPAINTDEVICE(&leftPix), leftRect.width(), 0, 6, h, TQt::CopyROP, true);
- bitBlt(TQT_TQPAINTDEVICE(&pixmap), w-7, 0, TQT_TQPAINTDEVICE(&rightPix), 0, 0, 7, h, TQt::CopyROP, true);
+ bitBlt(TQT_TQPAINTDEVICE(&pixmap), 1, 0, TQT_TQPAINTDEVICE(&leftPix), leftRect.width(), 0, 6, h, Qt::CopyROP, true);
+ bitBlt(TQT_TQPAINTDEVICE(&pixmap), w-7, 0, TQT_TQPAINTDEVICE(&rightPix), 0, 0, 7, h, Qt::CopyROP, true);
}
else
{
- bitBlt(TQT_TQPAINTDEVICE(&pixmap), 0, 1, TQT_TQPAINTDEVICE(&leftPix), 0, leftRect.height(), w, 6, TQt::CopyROP, true);
- bitBlt(TQT_TQPAINTDEVICE(&pixmap), 0, h-7, TQT_TQPAINTDEVICE(&rightPix), 0, 0, w, 7, TQt::CopyROP, true);
+ bitBlt(TQT_TQPAINTDEVICE(&pixmap), 0, 1, TQT_TQPAINTDEVICE(&leftPix), 0, leftRect.height(), w, 6, Qt::CopyROP, true);
+ bitBlt(TQT_TQPAINTDEVICE(&pixmap), 0, h-7, TQT_TQPAINTDEVICE(&rightPix), 0, 0, w, 7, Qt::CopyROP, true);
}
}
@@ -1104,7 +1104,7 @@ void drawScrollBarSlider(GdkWindow* window, GtkStyle* style, GtkStateType state,
void drawScrollBar(GdkWindow* window, GtkStyle* style, GtkStateType state, int orientation, GtkAdjustment* adj, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1166,9 +1166,9 @@ void drawScrollBar(GdkWindow* window, GtkStyle* style, GtkStateType state, int o
&painter2, scrollBar, TQRect(0, 0, w, h+thumbSize),
tqApp->tqpalette().active(), sflags);
- bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, w, offset, TQt::CopyROP);
+ bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, w, offset, Qt::CopyROP);
bitBlt(&pixmap, 0, offset, &tmpPixmap, 0, offset + thumbSize,
- w, h - offset, TQt::CopyROP);
+ w, h - offset, Qt::CopyROP);
} else {
TQRect r;
r = tqApp->tqstyle().querySubControlMetrics(TQStyle::CC_ScrollBar,
@@ -1191,9 +1191,9 @@ void drawScrollBar(GdkWindow* window, GtkStyle* style, GtkStateType state, int o
&painter2, scrollBar, TQRect(0, 0, w+thumbSize, h),
tqApp->tqpalette().active(), sflags);
- bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, offset, h, TQt::CopyROP);
+ bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, offset, h, Qt::CopyROP);
bitBlt(&pixmap, offset, 0, &tmpPixmap, offset + thumbSize, 0,
- w - offset, h, TQt::CopyROP);
+ w - offset, h, Qt::CopyROP);
}
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
@@ -1203,7 +1203,7 @@ void drawScrollBar(GdkWindow* window, GtkStyle* style, GtkStateType state, int o
void drawToolButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1242,7 +1242,7 @@ void drawToolButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int
void drawMenuBarItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1264,7 +1264,7 @@ void drawMenuBarItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int
void drawMenuItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1289,7 +1289,7 @@ void drawMenuItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int x,
void drawSplitter(GdkWindow* window, GtkStyle* style, GtkStateType state, int orientation, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1312,7 +1312,7 @@ void drawSplitter(GdkWindow* window, GtkStyle* style, GtkStateType state, int or
void drawTabFrame(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h, GtkPositionType pos)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1370,7 +1370,7 @@ void drawTabFrame(GdkWindow* window, GtkStyle* style, GtkStateType state, int x,
void drawMenu(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1408,7 +1408,7 @@ void drawMenu(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int
void drawProgressChunk(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h)
{
// This is only for Mozilla/Firefox
- if (!mozillaFix || !gtkTQtEnable)
+ if (!mozillaFix || !gtkQtEnable)
return;
if ((w<=1) || (h<=1))
@@ -1447,7 +1447,7 @@ void drawProgressChunk(GdkWindow * window, GtkStyle * style, GtkStateType state,
void drawProgressBar(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkProgressBarOrientation orientation, gfloat percentage, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w<=1) || (h<=1))
@@ -1483,7 +1483,7 @@ void drawProgressBar(GdkWindow * window, GtkStyle * style, GtkStateType state, G
void drawSlider(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkAdjustment *adj, int x, int y, int w, int h, GtkOrientation orientation, int inverted)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
meepSlider->setBackgroundOrigin(TQWidget::ParentOrigin);
@@ -1508,7 +1508,7 @@ void drawSlider(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkAdj
void drawSpinButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int direction, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1529,7 +1529,7 @@ void drawSpinButton(GdkWindow * window, GtkStyle * style, GtkStateType state, in
void drawListHeader(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1551,7 +1551,7 @@ void drawListHeader(GdkWindow* window, GtkStyle* style, GtkStateType state, int
void drawListViewItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1563,7 +1563,7 @@ void drawListViewItem(GdkWindow* window, GtkStyle* style, GtkStateType state, in
/* Get the brush corresponding to highlight color */
TQBrush brush = tqApp->palette().brush(TQPalette::Active, TQColorGroup::Highlight);
painter.setBrush(brush);
- painter.setPen(TQt::NoPen);
+ painter.setPen(Qt::NoPen);
painter.drawRect(0, 0, w, h);
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
@@ -1573,7 +1573,7 @@ void drawListViewItem(GdkWindow* window, GtkStyle* style, GtkStateType state, in
void drawSquareButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
TQPixmap pixmap(20, 20);
@@ -1600,7 +1600,7 @@ void drawSquareButton(GdkWindow* window, GtkStyle* style, GtkStateType state, in
void initDrawTabNG(int count)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
delete meepTabBar;
@@ -1615,7 +1615,7 @@ void initDrawTabNG(int count)
void drawTabNG(GdkWindow *window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h, GtkNotebook *notebook)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
GtkPositionType tpos = gtk_notebook_get_tab_pos(notebook);
@@ -1683,7 +1683,7 @@ void drawTabNG(GdkWindow *window, GtkStyle* style, GtkStateType state, int x, in
void drawArrow(GdkWindow* window, GtkStyle* style, GtkStateType state, GtkArrowType direction, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1724,7 +1724,7 @@ void drawArrow(GdkWindow* window, GtkStyle* style, GtkStateType state, GtkArrowT
void drawFocusRect(GdkWindow * window, GtkStyle * style, int x, int y, int w, int h)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((w < 1) || (h < 1))
@@ -1866,10 +1866,10 @@ static TQStringList iconInheritsDirs( const TQString& icondir )
void setRcProperties(GtkRcStyle* rc_style, int forceRecreate)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
- if (gtkTQtDebug)
+ if (gtkQtDebug)
printf("setRcProperties()\n");
gtkRcStyle = rc_style;
@@ -1938,7 +1938,7 @@ void setRcProperties(GtkRcStyle* rc_style, int forceRecreate)
stream.setDevice(TQT_TQIODEVICE(&cacheFile));
stream << "# " << iconTheme << ", " << tqApp->tqstyle().name() << ", " << RC_CACHE_VERSION << "\n\n";
- stream << "# This file was generated by the Gtk TQt Theme Engine\n";
+ stream << "# This file was generated by the Gtk Qt Theme Engine\n";
stream << "# It will be recreated when you change your KDE icon theme or widget style\n\n";
TQScrollBar sbar(NULL);
@@ -2145,7 +2145,7 @@ void addIconThemeDir(const TQString& theme)
void setMenuBackground(GtkStyle* style)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if (menuBackgroundPixmap == NULL)
@@ -2185,10 +2185,10 @@ void setColour(GdkColor* g, TQColor q)
void setColors(GtkStyle* style)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
- if (gtkTQtDebug)
+ if (gtkQtDebug)
printf("setColors()\n");
/*gtkStyle = style;*/
@@ -2206,7 +2206,7 @@ void setColors(GtkStyle* style)
void getTextColor(GdkColor *color, GtkStateType state_type)
{
- if (!gtkTQtEnable)
+ if (!gtkQtEnable)
return;
if ((state_type == GTK_STATE_PRELIGHT) || (state_type == GTK_STATE_ACTIVE) || (state_type == GTK_STATE_SELECTED))