Port gtk-qt-engine to TQt4

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gtk-qt-engine@1230499 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 5cf5e6b821
commit 91064f3b1d

@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>EmacsDetails</class> <class>EmacsDetails</class>
<widget class="QDialog"> <widget class="TQDialog">
<property name="name"> <property name="name">
<cstring>EmacsDetails</cstring> <cstring>EmacsDetails</cstring>
</property> </property>
<property name="geometry"> <property name="tqgeometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -19,7 +19,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel2</cstring> <cstring>textLabel2</cstring>
</property> </property>
@ -28,7 +28,7 @@
When enabled, they will override the standard keyboard shortcuts in GTK applications.</string> When enabled, they will override the standard keyboard shortcuts in GTK applications.</string>
</property> </property>
</widget> </widget>
<widget class="QListView"> <widget class="TQListView">
<column> <column>
<property name="text"> <property name="text">
<string>Shortcut</string> <string>Shortcut</string>
@ -184,9 +184,9 @@ When enabled, they will override the standard keyboard shortcuts in GTK applicat
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout13</cstring> <cstring>tqlayout13</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
@ -202,14 +202,14 @@ When enabled, they will override the standard keyboard shortcuts in GTK applicat
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>101</width> <width>101</width>
<height>21</height> <height>21</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>pushButton4</cstring> <cstring>pushButton4</cstring>
</property> </property>
@ -229,5 +229,5 @@ When enabled, they will override the standard keyboard shortcuts in GTK applicat
<slot>close()</slot> <slot>close()</slot>
</connection> </connection>
</connections> </connections>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
</UI> </UI>

@ -18,35 +18,35 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qlayout.h> #include <tqlayout.h>
#include <klocale.h> #include <klocale.h>
#include <kglobal.h> #include <kglobal.h>
#include <kfontdialog.h> #include <kfontdialog.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <qfile.h> #include <tqfile.h>
#include <qtextstream.h> #include <tqtextstream.h>
#include <qregexp.h> #include <tqregexp.h>
#include <qdir.h> #include <tqdir.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <qmap.h> #include <tqmap.h>
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qlabel.h> #include <tqlabel.h>
#include <kurllabel.h> #include <kurllabel.h>
#include <kapplication.h> #include <kapplication.h>
#include <kfontcombo.h> #include <kfontcombo.h>
#include <qspinbox.h> #include <tqspinbox.h>
#include <ksqueezedtextlabel.h> #include <ksqueezedtextlabel.h>
#include <stdlib.h> #include <stdlib.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kconfig.h> #include <kconfig.h>
#include <qstyle.h> #include <tqstyle.h>
#include <qheader.h> #include <tqheader.h>
#include <klistview.h> #include <klistview.h>
#include <qmessagebox.h> #include <tqmessagebox.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <kglobal.h> #include <kglobal.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
@ -56,19 +56,19 @@
#include "kcmgtk.h" #include "kcmgtk.h"
#include "mozillaprofile.h" #include "mozillaprofile.h"
const QString KcmGtk::GTK_RC_FILE(".gtkrc-2.0-kde-kde4"); const TQString KcmGtk::GTK_RC_FILE(".gtkrc-2.0-kde-kde4");
const QString KcmGtk::KDE_RC_DIR(KGlobal::dirs()->localkdedir() + "/env/"); const TQString KcmGtk::KDE_RC_DIR(KGlobal::dirs()->localkdedir() + "/env/");
const QString KcmGtk::GTK_QT_RC_FILE("gtk-qt-engine.rc.sh"); const TQString KcmGtk::GTK_TQT_RC_FILE("gtk-qt-engine.rc.sh");
/*typedef KGenericFactory<KcmGtk, QWidget> KcmGtkFactory; /*typedef KGenericFactory<KcmGtk, TQWidget> KcmGtkFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_gtk, KcmGtkFactory("gtk"))*/ K_EXPORT_COMPONENT_FACTORY( kcm_gtk, KcmGtkFactory("gtk"))*/
extern "C" extern "C"
{ {
KCModule *create_kcmgtk( QWidget * parent, const char * name ) KCModule *create_kcmgtk( TQWidget * tqparent, const char * name )
{ {
KGlobal::locale()->insertCatalogue( "gtkqtengine" ); KGlobal::locale()->insertCatalogue( "gtkqtengine" );
return new KcmGtk( parent, "kcmgtk" ); return new KcmGtk( tqparent, "kcmgtk" );
} }
} }
@ -77,21 +77,21 @@ GtkRcParser::GtkRcParser()
{ {
} }
void GtkRcParser::parse(QString fileName) void GtkRcParser::parse(TQString fileName)
{ {
QFile file(fileName); TQFile file(fileName);
file.open(IO_ReadOnly); file.open(IO_ReadOnly);
QTextStream stream(&file); TQTextStream stream(&file);
QRegExp includeRe("include\\s*\"([^\"]*)\""); TQRegExp includeRe("include\\s*\"([^\"]*)\"");
QRegExp fontRe("font_name\\s*=\\s*\"([^\"]*)\""); TQRegExp fontRe("font_name\\s*=\\s*\"([^\"]*)\"");
QRegExp keyThemeRe("gtk-key-theme-name\\s*=\\s*\"([^\"]*)\""); TQRegExp keyThemeRe("gtk-key-theme-name\\s*=\\s*\"([^\"]*)\"");
QStringList includes; TQStringList includes;
while (1) while (1)
{ {
QString line = stream.readLine(); TQString line = stream.readLine();
if (line.isNull()) if (line.isNull())
break; break;
if (line.startsWith("#")) if (line.startsWith("#"))
@ -103,7 +103,7 @@ void GtkRcParser::parse(QString fileName)
{ {
if (includeRe.search(line) == -1) if (includeRe.search(line) == -1)
continue; continue;
QString themePath = includeRe.cap(1); TQString themePath = includeRe.cap(1);
if (themePath.endsWith("/gtk-2.0/gtkrc") && !themePath.startsWith("/etc")) if (themePath.endsWith("/gtk-2.0/gtkrc") && !themePath.startsWith("/etc"))
style = includeRe.cap(1); style = includeRe.cap(1);
} }
@ -118,7 +118,7 @@ void GtkRcParser::parse(QString fileName)
{ {
if (keyThemeRe.search(line) == -1) if (keyThemeRe.search(line) == -1)
continue; continue;
if (keyThemeRe.cap(1).lower() == "emacs") if (TQString(keyThemeRe.cap(1)).lower() == "emacs")
emacs = true; emacs = true;
} }
} }
@ -126,16 +126,16 @@ void GtkRcParser::parse(QString fileName)
file.close(); file.close();
} }
QFont GtkRcParser::parseFont(QString fontString) TQFont GtkRcParser::parseFont(TQString fontString)
{ {
QFont ret; TQFont ret;
while (true) while (true)
{ {
int lastSpacePos = fontString.findRev(' '); int lastSpacePos = fontString.tqfindRev(' ');
if (lastSpacePos == -1) if (lastSpacePos == -1)
break; break;
QString lastWord = fontString.right(fontString.length() - lastSpacePos).stripWhiteSpace(); TQString lastWord = fontString.right(fontString.length() - lastSpacePos).stripWhiteSpace();
if (lastWord.lower() == "bold") if (lastWord.lower() == "bold")
ret.setBold(true); ret.setBold(true);
@ -156,8 +156,8 @@ QFont GtkRcParser::parseFont(QString fontString)
return ret; return ret;
} }
KcmGtk::KcmGtk(QWidget *parent, const char *name, const QStringList&) KcmGtk::KcmGtk(TQWidget *tqparent, const char *name, const TQStringList&)
: KCModule(parent, name), : KCModule(tqparent, name),
myAboutData(0), myAboutData(0),
emacsDetailsDialog(NULL), emacsDetailsDialog(NULL),
searchPathsDialog(NULL) searchPathsDialog(NULL)
@ -166,17 +166,17 @@ KcmGtk::KcmGtk(QWidget *parent, const char *name, const QStringList&)
config = new KConfig("kcmgtkrc"); config = new KConfig("kcmgtkrc");
QStringList gtkSearchPathsDefault; TQStringList gtkSearchPathsDefault;
gtkSearchPathsDefault.append("/usr"); gtkSearchPathsDefault.append("/usr");
gtkSearchPathsDefault.append("/usr/local"); gtkSearchPathsDefault.append("/usr/local");
gtkSearchPathsDefault.append("/opt/gnome"); gtkSearchPathsDefault.append("/opt/gnome");
gtkSearchPathsDefault.append(QDir::homeDirPath() + "/.local"); gtkSearchPathsDefault.append(TQDir::homeDirPath() + "/.local");
gtkSearchPaths = config->readListEntry("gtkSearchPaths", gtkSearchPathsDefault); gtkSearchPaths = config->readListEntry("gtkSearchPaths", gtkSearchPathsDefault);
// Add the widget to our layout // Add the widget to our tqlayout
QBoxLayout* l = new QVBoxLayout(this); TQBoxLayout* l = new TQVBoxLayout(this);
widget = new KcmGtkWidget(this); widget = new KcmGtkWidget(this);
l->addWidget(widget); l->addWidget(widget);
@ -191,33 +191,33 @@ KcmGtk::KcmGtk(QWidget *parent, const char *name, const QStringList&)
load(); load();
// Connect some signals // Connect some signals
connect(widget->warning2, SIGNAL(leftClickedURL(const QString&)), KApplication::kApplication(), SLOT(invokeBrowser(const QString&))); connect(widget->warning2, TQT_SIGNAL(leftClickedURL(const TQString&)), KApplication::kApplication(), TQT_SLOT(invokeBrowser(const TQString&)));
connect(widget->styleGroup, SIGNAL(clicked(int)), SLOT(itemChanged())); connect(widget->styleGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(itemChanged()));
connect(widget->fontGroup, SIGNAL(clicked(int)), SLOT(itemChanged())); connect(widget->fontGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(itemChanged()));
connect(widget->styleBox, SIGNAL(activated(int)), SLOT(itemChanged())); connect(widget->styleBox, TQT_SIGNAL(activated(int)), TQT_SLOT(itemChanged()));
connect(widget->styleBox, SIGNAL(activated(int)), SLOT(styleChanged())); connect(widget->styleBox, TQT_SIGNAL(activated(int)), TQT_SLOT(styleChanged()));
connect(widget->emacsBox, SIGNAL(toggled(bool)), SLOT(itemChanged())); connect(widget->emacsBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(itemChanged()));
connect(widget->fontChange, SIGNAL(clicked()), SLOT(fontChangeClicked())); connect(widget->fontChange, TQT_SIGNAL(clicked()), TQT_SLOT(fontChangeClicked()));
connect(widget->firefoxFix, SIGNAL(clicked()), SLOT(firefoxFixClicked())); connect(widget->firefoxFix, TQT_SIGNAL(clicked()), TQT_SLOT(firefoxFixClicked()));
connect(widget->emacsDetails, SIGNAL(clicked()), SLOT(emacsDetailsClicked())); connect(widget->emacsDetails, TQT_SIGNAL(clicked()), TQT_SLOT(emacsDetailsClicked()));
connect(widget->warning3, SIGNAL(clicked()), SLOT(searchPathsClicked())); connect(widget->warning3, TQT_SIGNAL(clicked()), TQT_SLOT(searchPathsClicked()));
} }
void KcmGtk::getInstalledThemes() void KcmGtk::getInstalledThemes()
{ {
themes.clear(); themes.clear();
for ( QStringList::Iterator it = gtkSearchPaths.begin(); it != gtkSearchPaths.end(); ++it ) for ( TQStringList::Iterator it = gtkSearchPaths.begin(); it != gtkSearchPaths.end(); ++it )
{ {
QString path = (*it) + "/share/themes/"; TQString path = (*it) + "/share/themes/";
QDir dir(path); TQDir dir(path);
QStringList entryList = dir.entryList(QDir::Dirs, QDir::Unsorted); TQStringList entryList = dir.entryList(TQDir::Dirs, TQDir::Unsorted);
for ( QStringList::Iterator it2 = entryList.begin(); it2 != entryList.end(); ++it2 ) for ( TQStringList::Iterator it2 = entryList.begin(); it2 != entryList.end(); ++it2 )
{ {
if ((*it2).startsWith(".")) if ((*it2).startsWith("."))
continue; continue;
if (themes.find(*it2) != themes.end()) if (themes.tqfind(*it2) != themes.end())
continue; continue;
if (!QFile::exists(path + (*it2) + "/gtk-2.0/gtkrc")) if (!TQFile::exists(path + (*it2) + "/gtk-2.0/gtkrc"))
continue; continue;
themes.insert((*it2), path + (*it2) + "/gtk-2.0/gtkrc"); themes.insert((*it2), path + (*it2) + "/gtk-2.0/gtkrc");
} }
@ -226,7 +226,7 @@ void KcmGtk::getInstalledThemes()
widget->styleBox->clear(); widget->styleBox->clear();
widget->styleBox->insertStringList(themes.keys()); widget->styleBox->insertStringList(themes.keys());
bool installed = (themes.find("Qt") != themes.end()); bool installed = (themes.tqfind("TQt") != themes.end());
widget->styleKde->setEnabled(installed); widget->styleKde->setEnabled(installed);
widget->warning1->setHidden(installed); widget->warning1->setHidden(installed);
widget->warning2->setHidden(installed); widget->warning2->setHidden(installed);
@ -255,20 +255,20 @@ void KcmGtk::styleChanged()
itemChanged(); itemChanged();
} }
QString KcmGtk::env(QString key) TQString KcmGtk::env(TQString key)
{ {
char* value = getenv(key.latin1()); char* value = getenv(key.latin1());
if (value == NULL) if (value == NULL)
return QString::null; return TQString();
else else
return QString(value); return TQString(value);
} }
void KcmGtk::updateFontPreview() void KcmGtk::updateFontPreview()
{ {
widget->fontPreview->setFont(font); widget->fontPreview->setFont(font);
widget->fontPreview->setText( widget->fontPreview->setText(
i18n("%1 (size %2)").arg(font.family()).arg(QString::number(font.pointSize()))); i18n("%1 (size %2)").tqarg(font.family()).tqarg(TQString::number(font.pointSize())));
widget->fontPreview2->setFont(font); widget->fontPreview2->setFont(font);
} }
@ -281,18 +281,18 @@ KcmGtk::~KcmGtk()
void KcmGtk::load() void KcmGtk::load()
{ {
parser.parse(QDir::homeDirPath() + "/" + GTK_RC_FILE); parser.parse(TQDir::homeDirPath() + "/" + GTK_RC_FILE);
bool usingQtEngine = false; bool usingTQtEngine = false;
if (!parser.style.isEmpty()) if (!parser.style.isEmpty())
{ {
for ( QMapIterator<QString, QString> it = themes.begin(); it != themes.end(); ++it ) for ( TQMapIterator<TQString, TQString> it = themes.begin(); it != themes.end(); ++it )
{ {
if (it.data() != parser.style) if (it.data() != parser.style)
continue; continue;
if (it.key() == "Qt") if (it.key() == "TQt")
usingQtEngine = true; usingTQtEngine = true;
for (int i=0 ; i<widget->styleBox->count() ; ++i) for (int i=0 ; i<widget->styleBox->count() ; ++i)
{ {
@ -306,17 +306,17 @@ void KcmGtk::load()
break; break;
} }
if (usingQtEngine) if (usingTQtEngine)
widget->styleGroup->setButton(widget->styleGroup->id(widget->styleKde)); widget->styleGroup->setButton(widget->styleGroup->id(widget->styleKde));
else else
widget->styleGroup->setButton(widget->styleGroup->id(widget->styleOther)); widget->styleGroup->setButton(widget->styleGroup->id(widget->styleOther));
} }
font = parser.font; font = parser.font;
if (QApplication::font().family() == font.family() && if (TQApplication::font().family() == font.family() &&
QApplication::font().pointSize() == font.pointSize() && TQApplication::font().pointSize() == font.pointSize() &&
QApplication::font().bold() == font.bold() && TQApplication::font().bold() == font.bold() &&
QApplication::font().italic() == font.italic()) TQApplication::font().italic() == font.italic())
widget->fontGroup->setButton(widget->fontGroup->id(widget->fontKde)); widget->fontGroup->setButton(widget->fontGroup->id(widget->fontKde));
else else
widget->fontGroup->setButton(widget->fontGroup->id(widget->fontOther)); widget->fontGroup->setButton(widget->fontGroup->id(widget->fontOther));
@ -330,24 +330,24 @@ void KcmGtk::load()
void KcmGtk::save() void KcmGtk::save()
{ {
// First write out the gtkrc file // First write out the gtkrc file
QFile file(QDir::homeDirPath() + "/" + GTK_RC_FILE); TQFile file(TQDir::homeDirPath() + "/" + GTK_RC_FILE);
file.open(IO_WriteOnly); file.open(IO_WriteOnly);
QTextStream stream(&file); TQTextStream stream(&file);
QFont selectedFont(widget->fontKde->isChecked() ? QApplication::font() : font); TQFont selectedFont(widget->fontKde->isChecked() ? TQApplication::font() : font);
QString fontName = selectedFont.family() + " " + TQString fontName = selectedFont.family() + " " +
QString(selectedFont.bold() ? "Bold " : "") + TQString(selectedFont.bold() ? "Bold " : "") +
QString(selectedFont.italic() ? "Italic " : "") + TQString(selectedFont.italic() ? "Italic " : "") +
QString::number(selectedFont.pointSize()); TQString::number(selectedFont.pointSize());
QString themeName = widget->styleKde->isChecked() ? themes["Qt"] : themes[widget->styleBox->currentText()]; TQString themeName = widget->styleKde->isChecked() ? themes["TQt"] : themes[widget->styleBox->currentText()];
QString themeNameShort = widget->styleKde->isChecked() ? QString("Qt") : widget->styleBox->currentText(); TQString themeNameShort = widget->styleKde->isChecked() ? TQString("TQt") : widget->styleBox->currentText();
stream << "# This file was written by KDE\n"; stream << "# This file was written by KDE\n";
stream << "# You can edit it in the KDE control center, under \"GTK Styles and Fonts\"\n"; stream << "# You can edit it in the KDE control center, under \"GTK Styles and Fonts\"\n";
stream << "\n"; stream << "\n";
stream << "include \"" << themeName << "\"\n"; stream << "include \"" << themeName << "\"\n";
if (QFile::exists("/etc/gtk-2.0/gtkrc")) if (TQFile::exists("/etc/gtk-2.0/gtkrc"))
stream << "include \"/etc/gtk-2.0/gtkrc\"\n"; stream << "include \"/etc/gtk-2.0/gtkrc\"\n";
stream << "\n"; stream << "\n";
stream << "style \"user-font\"\n"; stream << "style \"user-font\"\n";
@ -365,22 +365,22 @@ void KcmGtk::save()
file.close(); file.close();
// Now we check if that file is actually being loaded. // Now we check if that file is actually being loaded.
QDir kdeRcDir; TQDir kdeRcDir;
if (!kdeRcDir.exists(KDE_RC_DIR)) if (!kdeRcDir.exists(KDE_RC_DIR))
{ {
// Make sure KDE's rc dir exists // Make sure KDE's rc dir exists
kdeRcDir.mkdir(KDE_RC_DIR); kdeRcDir.mkdir(KDE_RC_DIR);
} }
file.setName(KDE_RC_DIR + "/" + GTK_QT_RC_FILE); file.setName(KDE_RC_DIR + "/" + GTK_TQT_RC_FILE);
bool envFileDidNotExist = (!file.exists()); bool envFileDidNotExist = (!file.exists());
file.open(IO_ReadWrite); file.open(IO_ReadWrite);
stream.setDevice(&file); stream.setDevice(TQT_TQIODEVICE(&file));
bool found = false; bool found = false;
for (;;) for (;;)
{ {
QString line = stream.readLine(); TQString line = stream.readLine();
if (line.isNull()) if (line.isNull())
break; break;
@ -404,16 +404,16 @@ void KcmGtk::save()
// Tell the user to restart KDE if the environment file was created this time // Tell the user to restart KDE if the environment file was created this time
if (envFileDidNotExist) if (envFileDidNotExist)
QMessageBox::information(this, "Restart KDE", "Your changes have been saved, but you will have to restart KDE for them to take effect.", QMessageBox::Ok); TQMessageBox::information(this, "Restart KDE", "Your changes have been saved, but you will have to restart KDE for them to take effect.", TQMessageBox::Ok);
// Older versions of the Gtk-Qt theme engine wrote directly into ~/.gtkrc-2.0 // Older versions of the Gtk-TQt theme engine wrote directly into ~/.gtkrc-2.0
// If the user has upgraded, that file needs to be deleted so the old settings // If the user has upgraded, that file needs to be deleted so the old settings
// won't override the new ones set now. // won't override the new ones set now.
file.setName(QDir::homeDirPath() + "/.gtkrc-2.0"); file.setName(TQDir::homeDirPath() + "/.gtkrc-2.0");
if (file.exists()) if (file.exists())
{ {
file.open(IO_ReadOnly); file.open(IO_ReadOnly);
QString firstLine; TQString firstLine;
file.readLine(firstLine, 50); file.readLine(firstLine, 50);
file.close(); file.close();
@ -422,19 +422,19 @@ void KcmGtk::save()
} }
// Simarly, remove the line we added to ~/.bashrc to tell GTK to load ~/.gtkrc-2.0 // Simarly, remove the line we added to ~/.bashrc to tell GTK to load ~/.gtkrc-2.0
file.setName(QDir::homeDirPath() + "/.bashrc"); file.setName(TQDir::homeDirPath() + "/.bashrc");
if (file.exists()) if (file.exists())
{ {
file.open(IO_ReadOnly); file.open(IO_ReadOnly);
QByteArray fileData = file.readAll(); TQByteArray fileData = file.readAll();
file.close(); file.close();
QString rcLine = "export GTK2_RC_FILES=$HOME/.gtkrc-2.0"; TQString rcLine = "export GTK2_RC_FILES=$HOME/.gtkrc-2.0";
QString fileDataString(fileData); TQString fileDataString(fileData);
fileDataString.replace("\n" + rcLine, "\n# (This is no longer needed from version 0.8 of the theme engine)\n# " + rcLine); fileDataString.tqreplace("\n" + rcLine, "\n# (This is no longer needed from version 0.8 of the theme engine)\n# " + rcLine);
file.open(IO_WriteOnly); file.open(IO_WriteOnly);
stream.setDevice(&file); stream.setDevice(TQT_TQIODEVICE(&file));
stream << fileDataString; stream << fileDataString;
file.close(); file.close();
} }
@ -448,7 +448,7 @@ int KcmGtk::buttons()
return KCModule::Apply; return KCModule::Apply;
} }
QString KcmGtk::quickHelp() const TQString KcmGtk::quickHelp() const
{ {
return i18n(""); return i18n("");
} }
@ -457,10 +457,10 @@ QString KcmGtk::quickHelp() const
void KcmGtk::firefoxFixClicked() void KcmGtk::firefoxFixClicked()
{ {
profiles.clear(); profiles.clear();
getProfiles(QDir::homeDirPath() + "/.mozilla/firefox/", 0); getProfiles(TQDir::homeDirPath() + "/.mozilla/firefox/", 0);
getProfiles(QDir::homeDirPath() + "/.thunderbird/", 1); getProfiles(TQDir::homeDirPath() + "/.thunderbird/", 1);
QString profilePath; TQString profilePath;
if (profiles.count() == 0) if (profiles.count() == 0)
{ {
KMessageBox::error(this, i18n("No Mozilla profiles found"), i18n("Could not load Mozilla profiles")); KMessageBox::error(this, i18n("No Mozilla profiles found"), i18n("Could not load Mozilla profiles"));
@ -477,9 +477,9 @@ void KcmGtk::firefoxFixClicked()
w->profilesList->header()->hide(); w->profilesList->header()->hide();
w->profilesList->hideColumn(1); w->profilesList->hideColumn(1);
QPixmap icon = KGlobal::iconLoader()->loadIcon("kuser", KIcon::Small); TQPixmap icon = KGlobal::iconLoader()->loadIcon("kuser", KIcon::Small);
for ( QMapIterator<QString,QString> it = profiles.begin(); it != profiles.end(); ++it ) for ( TQMapIterator<TQString,TQString> it = profiles.begin(); it != profiles.end(); ++it )
{ {
KListViewItem* i = new KListViewItem(w->profilesList); KListViewItem* i = new KListViewItem(w->profilesList);
i->setPixmap(0, icon); i->setPixmap(0, icon);
@ -488,13 +488,13 @@ void KcmGtk::firefoxFixClicked()
} }
dialog->setMainWidget(w); dialog->setMainWidget(w);
if (dialog->exec() == QDialog::Rejected) if (dialog->exec() == TQDialog::Rejected)
{ {
delete dialog; delete dialog;
return; return;
} }
QListViewItemIterator it2(w->profilesList, QListViewItemIterator::Selected); TQListViewItemIterator it2(w->profilesList, TQListViewItemIterator::Selected);
while (it2.current()) while (it2.current())
{ {
KListViewItem* i = (KListViewItem*) it2.current(); KListViewItem* i = (KListViewItem*) it2.current();
@ -508,22 +508,22 @@ void KcmGtk::firefoxFixClicked()
KMessageBox::information(this, i18n("Your Mozilla profile was updated sucessfully. You must close and restart all Firefox and Thunderbird windows for the changes to take effect"), i18n("Mozilla profile")); KMessageBox::information(this, i18n("Your Mozilla profile was updated sucessfully. You must close and restart all Firefox and Thunderbird windows for the changes to take effect"), i18n("Mozilla profile"));
} }
void KcmGtk::getProfiles(const QString& basePath, int type) void KcmGtk::getProfiles(const TQString& basePath, int type)
{ {
QString fileName = basePath + "/profiles.ini"; TQString fileName = basePath + "/profiles.ini";
if (QFile::exists(fileName)) if (TQFile::exists(fileName))
{ {
KConfig config(fileName, true, false); KConfig config(fileName, true, false);
QStringList groups = config.groupList(); TQStringList groups = config.groupList();
for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) for ( TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it )
{ {
if (!(*it).lower().startsWith("profile")) if (!(*it).lower().startsWith("profile"))
continue; continue;
config.setGroup(*it); config.setGroup(*it);
QString name = (type ? i18n("Thunderbird") : i18n("Firefox")) + " - " + config.readEntry("Name"); TQString name = (type ? i18n("Thunderbird") : i18n("Firefox")) + " - " + config.readEntry("Name");
QString path = config.readEntry("Path"); TQString path = config.readEntry("Path");
if (!path.startsWith("/")) if (!path.startsWith("/"))
path = basePath + path; path = basePath + path;
profiles.insert(name, path); profiles.insert(name, path);
@ -531,65 +531,65 @@ void KcmGtk::getProfiles(const QString& basePath, int type)
} }
} }
void KcmGtk::fixProfile(const QString& path) void KcmGtk::fixProfile(const TQString& path)
{ {
if (!QFile::exists(path + "/chrome")) if (!TQFile::exists(path + "/chrome"))
{ {
QDir dir(path); TQDir dir(path);
dir.mkdir("chrome"); dir.mkdir("chrome");
} }
QString data = scrollBarCSS(); TQString data = scrollBarCSS();
writeFirefoxCSS(path + "/chrome/userChrome.css", data); writeFirefoxCSS(path + "/chrome/userChrome.css", data);
writeFirefoxCSS(path + "/chrome/userContent.css", data); writeFirefoxCSS(path + "/chrome/userContent.css", data);
} }
QString KcmGtk::scrollBarCSS() TQString KcmGtk::scrollBarCSS()
{ {
// The following code determines how many buttons are on a scrollbar // The following code determines how many buttons are on a scrollbar
// It works by looking at each pixel of the scrollbar's area not taken up by the groove, // It works by looking at each pixel of the scrollbar's area not taken up by the groove,
// and asking the style which subcontrol is at that location. // and asking the style which subcontrol is at that location.
QScrollBar sbar(NULL); TQScrollBar sbar(NULL);
sbar.setOrientation(Qt::Horizontal); sbar.setOrientation(Qt::Horizontal);
sbar.setValue(1); sbar.setValue(1);
sbar.resize(200,25); sbar.resize(200,25);
QRect rect = qApp->style().querySubControlMetrics(QStyle::CC_ScrollBar, &sbar, QStyle::SC_ScrollBarGroove); TQRect rect = tqApp->tqstyle().querySubControlMetrics(TQStyle::CC_ScrollBar, &sbar, TQStyle::SC_ScrollBarGroove);
bool back1 = false; bool back1 = false;
bool forward1 = false; bool forward1 = false;
bool back2 = false; bool back2 = false;
bool forward2 = false; bool forward2 = false;
QStyle::SubControl sc = QStyle::SC_None; TQStyle::SubControl sc = TQStyle::SC_None;
for (QPoint pos(0,7) ; pos.x()<rect.x() ; pos.setX(pos.x()+1)) for (TQPoint pos(0,7) ; pos.x()<rect.x() ; pos.setX(pos.x()+1))
{ {
QStyle::SubControl sc2 = qApp->style().querySubControl(QStyle::CC_ScrollBar, &sbar, pos); TQStyle::SubControl sc2 = tqApp->tqstyle().querySubControl(TQStyle::CC_ScrollBar, &sbar, pos);
if (sc != sc2) if (sc != sc2)
{ {
if (sc2 == QStyle::SC_ScrollBarAddLine) forward1 = true; if (sc2 == TQStyle::SC_ScrollBarAddLine) forward1 = true;
if (sc2 == QStyle::SC_ScrollBarSubLine) back1 = true; if (sc2 == TQStyle::SC_ScrollBarSubLine) back1 = true;
sc = sc2; sc = sc2;
} }
} }
sc = QStyle::SC_None; sc = TQStyle::SC_None;
for (QPoint pos(rect.x()+rect.width(),7) ; pos.x()<200 ; pos.setX(pos.x()+1)) for (TQPoint pos(rect.x()+rect.width(),7) ; pos.x()<200 ; pos.setX(pos.x()+1))
{ {
QStyle::SubControl sc2 = qApp->style().querySubControl(QStyle::CC_ScrollBar, &sbar, pos); TQStyle::SubControl sc2 = tqApp->tqstyle().querySubControl(TQStyle::CC_ScrollBar, &sbar, pos);
if (sc != sc2) if (sc != sc2)
{ {
if (sc2 == QStyle::SC_ScrollBarAddLine) forward2 = true; if (sc2 == TQStyle::SC_ScrollBarAddLine) forward2 = true;
if (sc2 == QStyle::SC_ScrollBarSubLine) back2 = true; if (sc2 == TQStyle::SC_ScrollBarSubLine) back2 = true;
sc = sc2; sc = sc2;
} }
} }
QString upTop = (back1 ? "-moz-box" : "none"); TQString upTop = (back1 ? "-moz-box" : "none");
QString downTop = (forward1 ? "-moz-box" : "none"); TQString downTop = (forward1 ? "-moz-box" : "none");
QString upBottom = (back2 ? "-moz-box" : "none"); TQString upBottom = (back2 ? "-moz-box" : "none");
QString downBottom = (forward2 ? "-moz-box" : "none"); TQString downBottom = (forward2 ? "-moz-box" : "none");
QString data; TQString data;
data += "/* The following four lines were added by KDE */\n"; data += "/* The following four lines were added by KDE */\n";
data += "scrollbarbutton[sbattr=\"scrollbar-up-top\"] { display: " + upTop + " !important; }\n"; data += "scrollbarbutton[sbattr=\"scrollbar-up-top\"] { display: " + upTop + " !important; }\n";
data += "scrollbarbutton[sbattr=\"scrollbar-down-top\"] { display: " + downTop + " !important; }\n"; data += "scrollbarbutton[sbattr=\"scrollbar-down-top\"] { display: " + downTop + " !important; }\n";
@ -599,16 +599,16 @@ QString KcmGtk::scrollBarCSS()
return data; return data;
} }
void KcmGtk::writeFirefoxCSS(const QString& path, const QString& data) void KcmGtk::writeFirefoxCSS(const TQString& path, const TQString& data)
{ {
QString fileData; TQString fileData;
QFile file(path); TQFile file(path);
if (file.open(IO_ReadOnly)) if (file.open(IO_ReadOnly))
{ {
QTextStream stream(&file); TQTextStream stream(&file);
for (;;) for (;;)
{ {
QString line = stream.readLine(); TQString line = stream.readLine();
if (line.isNull()) if (line.isNull())
break; break;
@ -627,10 +627,10 @@ void KcmGtk::writeFirefoxCSS(const QString& path, const QString& data)
if (!file.open(IO_WriteOnly | IO_Truncate)) if (!file.open(IO_WriteOnly | IO_Truncate))
{ {
KMessageBox::error(this, i18n("Could not write to %1").arg(path), i18n("Mozilla profile")); KMessageBox::error(this, i18n("Could not write to %1").tqarg(path), i18n("Mozilla profile"));
return; return;
} }
QTextStream stream(&file); TQTextStream stream(&file);
stream << fileData << data; stream << fileData << data;
file.close(); file.close();
@ -653,16 +653,16 @@ void KcmGtk::searchPathsClicked()
if (searchPathsDialog == NULL) if (searchPathsDialog == NULL)
{ {
searchPathsDialog = new SearchPaths(this); searchPathsDialog = new SearchPaths(this);
connect(searchPathsDialog->okButton, SIGNAL(clicked()), SLOT(searchPathsOk())); connect(searchPathsDialog->okButton, TQT_SIGNAL(clicked()), TQT_SLOT(searchPathsOk()));
connect(searchPathsDialog->pathBox, SIGNAL(textChanged(const QString&)), SLOT(searchPathsTextChanged(const QString&))); connect(searchPathsDialog->pathBox, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(searchPathsTextChanged(const TQString&)));
connect(searchPathsDialog->pathList, SIGNAL(currentChanged(QListBoxItem*)), SLOT(searchPathsCurrentChanged(QListBoxItem*))); connect(searchPathsDialog->pathList, TQT_SIGNAL(currentChanged(TQListBoxItem*)), TQT_SLOT(searchPathsCurrentChanged(TQListBoxItem*)));
connect(searchPathsDialog->addButton, SIGNAL(clicked()), SLOT(searchPathsAddClicked())); connect(searchPathsDialog->addButton, TQT_SIGNAL(clicked()), TQT_SLOT(searchPathsAddClicked()));
connect(searchPathsDialog->removeButton, SIGNAL(clicked()), SLOT(searchPathsRemoveClicked())); connect(searchPathsDialog->removeButton, TQT_SIGNAL(clicked()), TQT_SLOT(searchPathsRemoveClicked()));
} }
searchPathsDialog->pathList->clear(); searchPathsDialog->pathList->clear();
for (QStringList::Iterator it = gtkSearchPaths.begin(); it != gtkSearchPaths.end(); ++it ) for (TQStringList::Iterator it = gtkSearchPaths.begin(); it != gtkSearchPaths.end(); ++it )
new QListBoxText(searchPathsDialog->pathList, *it); new TQListBoxText(searchPathsDialog->pathList, *it);
searchPathsDialog->show(); searchPathsDialog->show();
} }
@ -671,7 +671,7 @@ void KcmGtk::searchPathsOk()
{ {
gtkSearchPaths.clear(); gtkSearchPaths.clear();
int i=0; int i=0;
QListBoxItem* item = 0; TQListBoxItem* item = 0;
while ((item = searchPathsDialog->pathList->item(i++))) while ((item = searchPathsDialog->pathList->item(i++)))
gtkSearchPaths.append(item->text()); gtkSearchPaths.append(item->text());
@ -679,19 +679,19 @@ void KcmGtk::searchPathsOk()
getInstalledThemes(); getInstalledThemes();
} }
void KcmGtk::searchPathsTextChanged(const QString& text) void KcmGtk::searchPathsTextChanged(const TQString& text)
{ {
searchPathsDialog->addButton->setDisabled(text.isEmpty()); searchPathsDialog->addButton->setDisabled(text.isEmpty());
} }
void KcmGtk::searchPathsCurrentChanged(QListBoxItem* item) void KcmGtk::searchPathsCurrentChanged(TQListBoxItem* item)
{ {
searchPathsDialog->removeButton->setEnabled(item != NULL); searchPathsDialog->removeButton->setEnabled(item != NULL);
} }
void KcmGtk::searchPathsAddClicked() void KcmGtk::searchPathsAddClicked()
{ {
new QListBoxText(searchPathsDialog->pathList, searchPathsDialog->pathBox->text()); new TQListBoxText(searchPathsDialog->pathList, searchPathsDialog->pathBox->text());
searchPathsDialog->pathBox->clear(); searchPathsDialog->pathBox->clear();
} }

@ -34,35 +34,36 @@ public:
GtkRcParser(); GtkRcParser();
~GtkRcParser() {} ~GtkRcParser() {}
void parse(QString fileName); void parse(TQString fileName);
QFont font; TQFont font;
QString style; TQString style;
bool emacs; bool emacs;
private: private:
QFont parseFont(QString fontString); TQFont parseFont(TQString fontString);
}; };
class KcmGtk: public KCModule class KcmGtk: public KCModule
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
// How to name the kde-specific gtk-rc-file // How to name the kde-specific gtk-rc-file
static const QString GTK_RC_FILE; static const TQString GTK_RC_FILE;
// Where to search for KDE's config files // Where to search for KDE's config files
static const QString KDE_RC_DIR; static const TQString KDE_RC_DIR;
// How to name qtk-qt-engines rc-file // How to name qtk-qt-engines rc-file
static const QString GTK_QT_RC_FILE; static const TQString GTK_TQT_RC_FILE;
public: public:
KcmGtk( QWidget *parent=0, const char *name=0, const QStringList& = QStringList() ); KcmGtk( TQWidget *tqparent=0, const char *name=0, const TQStringList& = TQStringList() );
~KcmGtk(); ~KcmGtk();
virtual void load(); virtual void load();
virtual void save(); virtual void save();
virtual int buttons(); virtual int buttons();
virtual QString quickHelp() const; virtual TQString quickHelp() const;
virtual const KAboutData *aboutData()const virtual const KAboutData *aboutData()const
{ return myAboutData; }; { return myAboutData; };
@ -76,27 +77,27 @@ public slots:
void searchPathsOk(); void searchPathsOk();
void searchPathsAddClicked(); void searchPathsAddClicked();
void searchPathsRemoveClicked(); void searchPathsRemoveClicked();
void searchPathsTextChanged(const QString& text); void searchPathsTextChanged(const TQString& text);
void searchPathsCurrentChanged(QListBoxItem* item); void searchPathsCurrentChanged(TQListBoxItem* item);
private: private:
void updateFontPreview(); void updateFontPreview();
void getProfiles(const QString& basePath, int type); void getProfiles(const TQString& basePath, int type);
void fixProfile(const QString& path); void fixProfile(const TQString& path);
QString scrollBarCSS(); TQString scrollBarCSS();
void writeFirefoxCSS(const QString& path, const QString& data); void writeFirefoxCSS(const TQString& path, const TQString& data);
void getInstalledThemes(); void getInstalledThemes();
QString env(QString key); TQString env(TQString key);
KcmGtkWidget* widget; KcmGtkWidget* widget;
QMap<QString,QString> themes; TQMap<TQString,TQString> themes;
GtkRcParser parser; GtkRcParser parser;
KAboutData *myAboutData; KAboutData *myAboutData;
QFont font; TQFont font;
QMap<QString,QString> profiles; TQMap<TQString,TQString> profiles;
EmacsDetails* emacsDetailsDialog; EmacsDetails* emacsDetailsDialog;
QStringList gtkSearchPaths; TQStringList gtkSearchPaths;
SearchPaths* searchPathsDialog; SearchPaths* searchPathsDialog;
KConfig* config; KConfig* config;
}; };

@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KcmGtkWidget</class> <class>KcmGtkWidget</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>KcmGtkWidget</cstring> <cstring>KcmGtkWidget</cstring>
</property> </property>
<property name="geometry"> <property name="tqgeometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -22,7 +22,7 @@
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>styleGroup</cstring> <cstring>styleGroup</cstring>
</property> </property>
@ -41,15 +41,15 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout12</cstring> <cstring>tqlayout12</cstring>
</property> </property>
<vbox> <vbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>styleIcon</cstring> <cstring>styleIcon</cstring>
</property> </property>
@ -67,7 +67,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Minimum</enum> <enum>Minimum</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>16</height> <height>16</height>
@ -76,9 +76,9 @@
</spacer> </spacer>
</vbox> </vbox>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout17</cstring> <cstring>tqlayout17</cstring>
</property> </property>
<grid> <grid>
<property name="name"> <property name="name">
@ -94,22 +94,22 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>150</width> <width>150</width>
<height>21</height> <height>21</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="3"> <widget class="TQLayoutWidget" row="3" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>layout16</cstring> <cstring>tqlayout16</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>warning3</cstring> <cstring>warning3</cstring>
</property> </property>
@ -127,7 +127,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>176</width> <width>176</width>
<height>20</height> <height>20</height>
@ -136,7 +136,7 @@
</spacer> </spacer>
</hbox> </hbox>
</widget> </widget>
<widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="3"> <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>styleKde</cstring> <cstring>styleKde</cstring>
</property> </property>
@ -144,7 +144,7 @@
<string>&amp;Use my KDE style in GTK applications</string> <string>&amp;Use my KDE style in GTK applications</string>
</property> </property>
</widget> </widget>
<widget class="QComboBox" row="1" column="1"> <widget class="TQComboBox" row="1" column="1">
<property name="name"> <property name="name">
<cstring>styleBox</cstring> <cstring>styleBox</cstring>
</property> </property>
@ -160,7 +160,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" row="1" column="0"> <widget class="TQRadioButton" row="1" column="0">
<property name="name"> <property name="name">
<cstring>styleOther</cstring> <cstring>styleOther</cstring>
</property> </property>
@ -171,7 +171,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="2" column="0" rowspan="1" colspan="3"> <widget class="TQLabel" row="2" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>warning1</cstring> <cstring>warning1</cstring>
</property> </property>
@ -194,7 +194,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>fontGroup</cstring> <cstring>fontGroup</cstring>
</property> </property>
@ -213,15 +213,15 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout7_2</cstring> <cstring>tqlayout7_2</cstring>
</property> </property>
<vbox> <vbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>fontIcon</cstring> <cstring>fontIcon</cstring>
</property> </property>
@ -239,7 +239,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>31</height> <height>31</height>
@ -248,15 +248,15 @@
</spacer> </spacer>
</vbox> </vbox>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout14</cstring> <cstring>tqlayout14</cstring>
</property> </property>
<grid> <grid>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QPushButton" row="1" column="1"> <widget class="TQPushButton" row="1" column="1">
<property name="name"> <property name="name">
<cstring>fontChange</cstring> <cstring>fontChange</cstring>
</property> </property>
@ -274,14 +274,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>238</width> <width>238</width>
<height>21</height> <height>21</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QRadioButton" row="1" column="0"> <widget class="TQRadioButton" row="1" column="0">
<property name="name"> <property name="name">
<cstring>fontOther</cstring> <cstring>fontOther</cstring>
</property> </property>
@ -289,9 +289,9 @@
<string>Use another font:</string> <string>Use another font:</string>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="3"> <widget class="TQLayoutWidget" row="3" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>layout10</cstring> <cstring>tqlayout10</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
@ -307,7 +307,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>10</height> <height>10</height>
@ -324,7 +324,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="3"> <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>fontKde</cstring> <cstring>fontKde</cstring>
</property> </property>
@ -335,9 +335,9 @@
<string>Alt+Y</string> <string>Alt+Y</string>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="3"> <widget class="TQLayoutWidget" row="2" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>layout13</cstring> <cstring>tqlayout13</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
@ -353,7 +353,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>16</height> <height>16</height>
@ -367,7 +367,7 @@
<property name="text"> <property name="text">
<string>Preview line 1</string> <string>Preview line 1</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>AlignVCenter</set> <set>AlignVCenter</set>
</property> </property>
</widget> </widget>
@ -377,7 +377,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>groupBox2</cstring> <cstring>groupBox2</cstring>
</property> </property>
@ -388,15 +388,15 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout10</cstring> <cstring>tqlayout10</cstring>
</property> </property>
<vbox> <vbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>keyboardIcon</cstring> <cstring>keyboardIcon</cstring>
</property> </property>
@ -414,7 +414,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Minimum</enum> <enum>Minimum</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>21</width> <width>21</width>
<height>10</height> <height>10</height>
@ -423,15 +423,15 @@
</spacer> </spacer>
</vbox> </vbox>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout12</cstring> <cstring>tqlayout12</cstring>
</property> </property>
<vbox> <vbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QCheckBox"> <widget class="TQCheckBox">
<property name="name"> <property name="name">
<cstring>emacsBox</cstring> <cstring>emacsBox</cstring>
</property> </property>
@ -442,15 +442,15 @@
<string>Alt+B</string> <string>Alt+B</string>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout11</cstring> <cstring>tqlayout11</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>emacsDetails</cstring> <cstring>emacsDetails</cstring>
</property> </property>
@ -468,7 +468,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>141</width> <width>141</width>
<height>21</height> <height>21</height>
@ -481,7 +481,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>groupBox1</cstring> <cstring>groupBox1</cstring>
</property> </property>
@ -500,15 +500,15 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout7_2_2</cstring> <cstring>tqlayout7_2_2</cstring>
</property> </property>
<vbox> <vbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>firefoxIcon</cstring> <cstring>firefoxIcon</cstring>
</property> </property>
@ -526,7 +526,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>31</height> <height>31</height>
@ -535,34 +535,34 @@
</spacer> </spacer>
</vbox> </vbox>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout12</cstring> <cstring>tqlayout12</cstring>
</property> </property>
<vbox> <vbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
<property name="text"> <property name="text">
<string>Scrollbar buttons may sometimes be displayed incorrectly in Firefox and Thunderbird. This can be fixed by installing some files into your Mozilla profile.</string> <string>Scrollbar buttons may sometimes be displayed incorrectly in Firefox and Thunderbird. This can be fixed by installing some files into your Mozilla profile.</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>WordBreak|AlignVCenter</set> <set>WordBreak|AlignVCenter</set>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout11</cstring> <cstring>tqlayout11</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>firefoxFix</cstring> <cstring>firefoxFix</cstring>
</property> </property>
@ -580,7 +580,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>101</width> <width>101</width>
<height>21</height> <height>21</height>
@ -593,14 +593,14 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1_2</cstring> <cstring>textLabel1_2</cstring>
</property> </property>
<property name="text"> <property name="text">
<string>Note that changes made here will only affect GTK applications when KDE is running. To change the styles and fonts used by applications in GNOME, use the GNOME configuration tools.</string> <string>Note that changes made here will only affect GTK applications when KDE is running. To change the styles and fonts used by applications in GNOME, use the GNOME configuration tools.</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>WordBreak|AlignVCenter</set> <set>WordBreak|AlignVCenter</set>
</property> </property>
</widget> </widget>
@ -614,7 +614,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>51</width> <width>51</width>
<height>16</height> <height>16</height>
@ -636,7 +636,7 @@
<tabstop>emacsDetails</tabstop> <tabstop>emacsDetails</tabstop>
<tabstop>firefoxFix</tabstop> <tabstop>firefoxFix</tabstop>
</tabstops> </tabstops>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
<includehints> <includehints>
<includehint>kurllabel.h</includehint> <includehint>kurllabel.h</includehint>
<includehint>ksqueezedtextlabel.h</includehint> <includehint>ksqueezedtextlabel.h</includehint>

@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>MozillaProfileWidget</class> <class>MozillaProfileWidget</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>MozillaProfileWidget</cstring> <cstring>MozillaProfileWidget</cstring>
</property> </property>
<property name="geometry"> <property name="tqgeometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -22,7 +22,7 @@
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>label</cstring> <cstring>label</cstring>
</property> </property>
@ -67,7 +67,7 @@
</widget> </widget>
<customwidgets> <customwidgets>
</customwidgets> </customwidgets>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
<includehints> <includehints>
<includehint>klistview.h</includehint> <includehint>klistview.h</includehint>
</includehints> </includehints>

@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>SearchPaths</class> <class>SearchPaths</class>
<widget class="QDialog"> <widget class="TQDialog">
<property name="name"> <property name="name">
<cstring>SearchPaths</cstring> <cstring>SearchPaths</cstring>
</property> </property>
<property name="geometry"> <property name="tqgeometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -19,36 +19,36 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
<property name="text"> <property name="text">
<string>The control center module could not find the GTK-Qt theme engine in its list of search paths. If you have installed it elsewhere, you will need to add the correct path to the list below.</string> <string>The control center module could not find the GTK-Qt theme engine in its list of search paths. If you have installed it elsewhere, you will need to add the correct path to the list below.</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>WordBreak|AlignVCenter</set> <set>WordBreak|AlignVCenter</set>
</property> </property>
</widget> </widget>
<widget class="QListBox"> <widget class="TQListBox">
<property name="name"> <property name="name">
<cstring>pathList</cstring> <cstring>pathList</cstring>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout31</cstring> <cstring>tqlayout31</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLineEdit"> <widget class="TQLineEdit">
<property name="name"> <property name="name">
<cstring>pathBox</cstring> <cstring>pathBox</cstring>
</property> </property>
</widget> </widget>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>addButton</cstring> <cstring>addButton</cstring>
</property> </property>
@ -62,7 +62,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>removeButton</cstring> <cstring>removeButton</cstring>
</property> </property>
@ -89,9 +89,9 @@
<enum>Horizontal</enum> <enum>Horizontal</enum>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout33</cstring> <cstring>tqlayout33</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
@ -107,14 +107,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>51</width> <width>51</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>okButton</cstring> <cstring>okButton</cstring>
</property> </property>
@ -122,7 +122,7 @@
<string>Ok</string> <string>Ok</string>
</property> </property>
</widget> </widget>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>cancelButton</cstring> <cstring>cancelButton</cstring>
</property> </property>
@ -148,5 +148,5 @@
<slot>reject()</slot> <slot>reject()</slot>
</connection> </connection>
</connections> </connections>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
</UI> </UI>

@ -11,19 +11,19 @@ G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void);
G_MODULE_EXPORT void theme_init (GTypeModule *module) G_MODULE_EXPORT void theme_init (GTypeModule *module)
{ {
createQApp(); createTQApp();
qtengine_rc_style_register_type (module); qtengine_rc_style_register_type (module);
qtengine_style_register_type (module); qtengine_style_register_type (module);
} }
G_MODULE_EXPORT void theme_exit (void) G_MODULE_EXPORT void theme_exit (void)
{ {
destroyQApp(); destroyTQApp();
} }
G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void) G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void)
{ {
void *ptr = GTK_RC_STYLE (g_object_new (QTENGINE_TYPE_RC_STYLE, NULL)); void *ptr = GTK_RC_STYLE (g_object_new (TQTENGINE_TYPE_RC_STYLE, NULL));
return (GtkRcStyle *)ptr; return (GtkRcStyle *)ptr;
} }

File diff suppressed because it is too large Load Diff

@ -1,5 +1,5 @@
#ifndef QTENGINE_QT_WRAPPER_H #ifndef TQTENGINE_TQT_WRAPPER_H
#define QTENGINE_QT_WRAPPER_H #define TQTENGINE_TQT_WRAPPER_H
#include <gtk/gtknotebook.h> #include <gtk/gtknotebook.h>
@ -10,20 +10,20 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
void mapColour(GdkColor* g, QColor q); void mapColour(GdkColor* g, TQColor q);
void addIconThemeDir(const QString& theme); void addIconThemeDir(const TQString& theme);
QString doIconMapping(const QString& stockName, const QString& path, int sizes = 7); TQString doIconMapping(const TQString& stockName, const TQString& path, int sizes = 7);
void initKdeSettings(); void initKdeSettings();
QString kdeConfigValue(const QString& section, const QString& name, const QString& def); TQString kdeConfigValue(const TQString& section, const TQString& name, const TQString& def);
QString kdeFindDir(const QString& suffix, const QString& file1, const QString& file2); TQString kdeFindDir(const TQString& suffix, const TQString& file1, const TQString& file2);
GdkFilterReturn gdkEventFilter(GdkXEvent *xevent, GdkEvent *event, gpointer data); GdkFilterReturn gdkEventFilter(GdkXEvent *xevent, GdkEvent *event, gpointer data);
#endif #endif
void createQApp(); void createTQApp();
void destroyQApp(); void destroyTQApp();
void setColors(GtkStyle* style); void setColors(GtkStyle* style);
void setRcProperties(GtkRcStyle* rc_style, int forceRecreate); void setRcProperties(GtkRcStyle* rc_style, int forceRecreate);
void drawButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int defaultButton, int x, int y, int w, int h); void drawButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int defaultButton, int x, int y, int w, int h);
@ -70,7 +70,7 @@ extern int isAlloy;
extern int isDomino; extern int isDomino;
extern int isPolyester; extern int isPolyester;
extern int openOfficeFix; extern int openOfficeFix;
extern int gtkQtDebug; extern int gtkTQtDebug;
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -4,8 +4,8 @@
static void qtengine_rc_style_init (QtEngineRcStyle *style); static void qtengine_rc_style_init (TQtEngineRcStyle *style);
static void qtengine_rc_style_class_init (QtEngineRcStyleClass *klass); static void qtengine_rc_style_class_init (TQtEngineRcStyleClass *klass);
static void qtengine_rc_style_finalize (GObject *object); static void qtengine_rc_style_finalize (GObject *object);
static guint qtengine_rc_style_parse (GtkRcStyle *rc_style, static guint qtengine_rc_style_parse (GtkRcStyle *rc_style,
GtkSettings *settings, GtkSettings *settings,
@ -15,7 +15,7 @@ static void qtengine_rc_style_merge (GtkRcStyle *dest,
static GtkStyle *qtengine_rc_style_create_style (GtkRcStyle *rc_style); static GtkStyle *qtengine_rc_style_create_style (GtkRcStyle *rc_style);
static GtkRcStyleClass *parent_class; static GtkRcStyleClass *tqparent_class;
GType qtengine_type_rc_style = 0; GType qtengine_type_rc_style = 0;
@ -24,30 +24,30 @@ void qtengine_rc_style_register_type (GTypeModule *module)
{ {
static const GTypeInfo object_info = static const GTypeInfo object_info =
{ {
sizeof (QtEngineRcStyleClass), sizeof (TQtEngineRcStyleClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) qtengine_rc_style_class_init, (GClassInitFunc) qtengine_rc_style_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (QtEngineRcStyle), sizeof (TQtEngineRcStyle),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) qtengine_rc_style_init, (GInstanceInitFunc) qtengine_rc_style_init,
}; };
qtengine_type_rc_style = g_type_module_register_type (module, GTK_TYPE_RC_STYLE, "QtEngineRcStyle", &object_info, 0); qtengine_type_rc_style = g_type_module_register_type (module, GTK_TYPE_RC_STYLE, "TQtEngineRcStyle", &object_info, 0);
} }
static void qtengine_rc_style_init (QtEngineRcStyle *style) static void qtengine_rc_style_init (TQtEngineRcStyle *style)
{ {
} }
static void qtengine_rc_style_class_init (QtEngineRcStyleClass *klass) static void qtengine_rc_style_class_init (TQtEngineRcStyleClass *klass)
{ {
GtkRcStyleClass *rc_style_class = GTK_RC_STYLE_CLASS (klass); GtkRcStyleClass *rc_style_class = GTK_RC_STYLE_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); tqparent_class = g_type_class_peek_parent (klass);
rc_style_class->parse = qtengine_rc_style_parse; rc_style_class->parse = qtengine_rc_style_parse;
rc_style_class->merge = qtengine_rc_style_merge; rc_style_class->merge = qtengine_rc_style_merge;
@ -88,7 +88,7 @@ static void
qtengine_rc_style_merge (GtkRcStyle * dest, qtengine_rc_style_merge (GtkRcStyle * dest,
GtkRcStyle * src) GtkRcStyle * src)
{ {
parent_class->merge(dest, src); tqparent_class->merge(dest, src);
} }
/* Create an empty style suitable to this RC style /* Create an empty style suitable to this RC style
@ -96,6 +96,6 @@ qtengine_rc_style_merge (GtkRcStyle * dest,
static GtkStyle * static GtkStyle *
qtengine_rc_style_create_style (GtkRcStyle *rc_style) qtengine_rc_style_create_style (GtkRcStyle *rc_style)
{ {
void *ptr = GTK_STYLE (g_object_new (QTENGINE_TYPE_STYLE, NULL)); void *ptr = GTK_STYLE (g_object_new (TQTENGINE_TYPE_STYLE, NULL));
return (GtkStyle *)ptr; return (GtkStyle *)ptr;
} }

@ -1,25 +1,25 @@
#include <gtk/gtkrc.h> #include <gtk/gtkrc.h>
typedef struct _QtEngineRcStyle QtEngineRcStyle; typedef struct _TQtEngineRcStyle TQtEngineRcStyle;
typedef struct _QtEngineRcStyleClass QtEngineRcStyleClass; typedef struct _TQtEngineRcStyleClass TQtEngineRcStyleClass;
extern GType qtengine_type_rc_style; extern GType qtengine_type_rc_style;
#define QTENGINE_TYPE_RC_STYLE qtengine_type_rc_style #define TQTENGINE_TYPE_RC_STYLE qtengine_type_rc_style
#define QTENGINE_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), QTENGINE_TYPE_RC_STYLE, QtEngineRcStyle)) #define TQTENGINE_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TQTENGINE_TYPE_RC_STYLE, TQtEngineRcStyle))
#define QTENGINE_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), QTENGINE_TYPE_RC_STYLE, QtEngineRcStyleClass)) #define TQTENGINE_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TQTENGINE_TYPE_RC_STYLE, TQtEngineRcStyleClass))
#define QTENGINE_IS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), QTENGINE_TYPE_RC_STYLE)) #define TQTENGINE_IS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TQTENGINE_TYPE_RC_STYLE))
#define QTENGINE_IS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), QTENGINE_TYPE_RC_STYLE)) #define TQTENGINE_IS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TQTENGINE_TYPE_RC_STYLE))
#define QTENGINE_RC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), QTENGINE_TYPE_RC_STYLE, QtEngineRcStyleClass)) #define TQTENGINE_RC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TQTENGINE_TYPE_RC_STYLE, TQtEngineRcStyleClass))
struct _QtEngineRcStyle struct _TQtEngineRcStyle
{ {
GtkRcStyle parent_instance; GtkRcStyle tqparent_instance;
}; };
struct _QtEngineRcStyleClass struct _TQtEngineRcStyleClass
{ {
GtkRcStyleClass parent_class; GtkRcStyleClass tqparent_class;
}; };
void qtengine_rc_style_register_type (GTypeModule *module); void qtengine_rc_style_register_type (GTypeModule *module);

@ -1,27 +1,27 @@
#include <gtk/gtkstyle.h> #include <gtk/gtkstyle.h>
typedef struct _QtEngineStyle QtEngineStyle; typedef struct _TQtEngineStyle TQtEngineStyle;
typedef struct _QtEngineStyleClass QtEngineStyleClass; typedef struct _TQtEngineStyleClass TQtEngineStyleClass;
extern GType qtengine_type_style; extern GType qtengine_type_style;
#define QTENGINE_TYPE_STYLE qtengine_type_style #define TQTENGINE_TYPE_STYLE qtengine_type_style
#define QTENGINE_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), QTENGINE_TYPE_STYLE, QtEngineStyle)) #define TQTENGINE_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TQTENGINE_TYPE_STYLE, TQtEngineStyle))
#define QTENGINE_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), QTENGINE_TYPE_STYLE, QtEngineStyleClass)) #define TQTENGINE_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TQTENGINE_TYPE_STYLE, TQtEngineStyleClass))
#define QTENGINE_IS_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), QTENGINE_TYPE_STYLE)) #define TQTENGINE_IS_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TQTENGINE_TYPE_STYLE))
#define QTENGINE_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), QTENGINE_TYPE_STYLE)) #define TQTENGINE_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TQTENGINE_TYPE_STYLE))
#define QTENGINE_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), QTENGINE_TYPE_STYLE, QtEngineStyleClass)) #define TQTENGINE_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TQTENGINE_TYPE_STYLE, TQtEngineStyleClass))
struct _QtEngineStyle struct _TQtEngineStyle
{ {
GtkStyle parent_instance; GtkStyle tqparent_instance;
GdkPixmap* menuBackground; GdkPixmap* menuBackground;
}; };
struct _QtEngineStyleClass struct _TQtEngineStyleClass
{ {
GtkStyleClass parent_class; GtkStyleClass tqparent_class;
}; };
void qtengine_style_register_type (GTypeModule *module); void qtengine_style_register_type (GTypeModule *module);

@ -18,7 +18,7 @@
#define DETAIL(xx) ((detail) && (!strcmp(xx, detail))) #define DETAIL(xx) ((detail) && (!strcmp(xx, detail)))
#define DETAILHAS(xx) ((detail) && (strstr(detail, xx))) #define DETAILHAS(xx) ((detail) && (strstr(detail, xx)))
#define PARENT(xx) ((parent) && (!strcmp(xx, gtk_widget_get_name(parent)))) #define PARENT(xx) ((tqparent) && (!strcmp(xx, gtk_widget_get_name(tqparent))))
#ifndef max #ifndef max
#define max(x,y) ((x)>=(y)?(x):(y)) #define max(x,y) ((x)>=(y)?(x):(y))
#endif #endif
@ -26,17 +26,17 @@
#define min(x,y) ((x)<=(y)?(x):(y)) #define min(x,y) ((x)<=(y)?(x):(y))
#endif #endif
static void qtengine_style_init (QtEngineStyle *style); static void qtengine_style_init (TQtEngineStyle *style);
static void qtengine_style_class_init (QtEngineStyleClass *klass); static void qtengine_style_class_init (TQtEngineStyleClass *klass);
static GtkNotebook *notebook = NULL; static GtkNotebook *notebook = NULL;
static int nb_num_pages = 0; static int nb_num_pages = 0;
static GtkStyleClass *parent_class = NULL; static GtkStyleClass *tqparent_class = NULL;
static PangoLayout* static PangoLayout*
get_insensitive_layout (GdkDrawable *drawable, get_insensitive_layout (GdkDrawable *drawable,
PangoLayout *layout); PangoLayout *tqlayout);
static GtkShadowType static GtkShadowType
@ -81,7 +81,7 @@ draw_hline(GtkStyle* style,
gint x2, gint x2,
gint y) gint y)
{ {
if (gtkQtDebug) if (gtkTQtDebug)
printf("HLINE (%d,%d,%d) Widget: %s Detail: %s\n",x1,y1,y,gtk_widget_get_name(widget),detail); printf("HLINE (%d,%d,%d) Widget: %s Detail: %s\n",x1,y1,y,gtk_widget_get_name(widget),detail);
if (DETAIL("vscale")) if (DETAIL("vscale"))
@ -102,7 +102,7 @@ draw_vline(GtkStyle* style,
gint yDest, gint yDest,
gint x) gint x)
{ {
if (gtkQtDebug) if (gtkTQtDebug)
printf("VLINE (%d,%d,%d) Widget: %s Detail: %s\n",ySource ,yDest ,x,gtk_widget_get_name(widget),detail); printf("VLINE (%d,%d,%d) Widget: %s Detail: %s\n",ySource ,yDest ,x,gtk_widget_get_name(widget),detail);
@ -135,7 +135,7 @@ draw_shadow(GtkStyle *style,
sanitize_size(window, &width, &height); sanitize_size(window, &width, &height);
if (gtkQtDebug) if (gtkTQtDebug)
printf("Shadow (%d,%d,%d,%d) Widget: %s Detail: %s\n",x,y,width,height,gtk_widget_get_name(widget),detail); printf("Shadow (%d,%d,%d,%d) Widget: %s Detail: %s\n",x,y,width,height,gtk_widget_get_name(widget),detail);
@ -159,9 +159,9 @@ draw_shadow(GtkStyle *style,
} }
/* The remainder of this function was borrowed from the "Metal" theme/ /* The remainder of this function was borrowed from the "Metal" theme/
I don't really want to use Qt to draw these frames as there are too I don't really want to use TQt to draw these frames as there are too
many of them (it would slow down the theme engine even more). many of them (it would slow down the theme engine even more).
TODO: Make them use the Qt color palette */ TODO: Make them use the TQt color palette */
switch (shadow_type) switch (shadow_type)
{ {
@ -459,7 +459,7 @@ draw_arrow(GtkStyle* style,
{ {
sanitize_size(window, &width, &height); sanitize_size(window, &width, &height);
if (gtkQtDebug) if (gtkTQtDebug)
printf("Arrow (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); printf("Arrow (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail);
if (DETAIL("hscrollbar") || DETAIL("vscrollbar")) if (DETAIL("hscrollbar") || DETAIL("vscrollbar"))
@ -474,7 +474,7 @@ draw_arrow(GtkStyle* style,
if (DETAIL("arrow")) if (DETAIL("arrow"))
{ {
GdkPixbuf *gpix; GdkPixbuf *gpix;
GtkWidget* parent; GtkWidget* tqparent;
if (gdk_window_is_viewable(gtk_widget_get_parent_window(widget))) if (gdk_window_is_viewable(gtk_widget_get_parent_window(widget)))
{ {
gpix = gdk_pixbuf_get_from_drawable(NULL, gtk_widget_get_parent_window(widget),NULL, x, y, 0, 0, width, height); gpix = gdk_pixbuf_get_from_drawable(NULL, gtk_widget_get_parent_window(widget),NULL, x, y, 0, 0, width, height);
@ -482,8 +482,8 @@ draw_arrow(GtkStyle* style,
g_object_unref(gpix); g_object_unref(gpix);
} }
parent = gtk_widget_get_parent(widget); tqparent = gtk_widget_get_parent(widget);
drawArrow(window,style, GTK_WIDGET_STATE(parent), arrow_type, x, y, width, height); drawArrow(window,style, GTK_WIDGET_STATE(tqparent), arrow_type, x, y, width, height);
return; return;
} }
/* if (DETAIL("menuitem")) /* if (DETAIL("menuitem"))
@ -531,7 +531,7 @@ draw_arrow(GtkStyle* style,
ay = y; ay = y;
aw = width; aw = width;
ah = height; ah = height;
calculate_arrow_geometry (arrow_type, &ax, &ay, &aw, &ah); calculate_arrow_tqgeometry (arrow_type, &ax, &ay, &aw, &ah);
half_width = width / 2; half_width = width / 2;
half_height = height / 2; half_height = height / 2;
@ -615,7 +615,7 @@ draw_box(GtkStyle * style,
int nbpages; int nbpages;
sanitize_size(window, &width, &height); sanitize_size(window, &width, &height);
if (gtkQtDebug) if (gtkTQtDebug)
printf("Box (%d,%d,%d,%d) Widget: %s Detail: %s\n",x,y,width,height,gtk_widget_get_name(widget),detail); printf("Box (%d,%d,%d,%d) Widget: %s Detail: %s\n",x,y,width,height,gtk_widget_get_name(widget),detail);
if (GTK_IS_SCROLLBAR(widget)) if (GTK_IS_SCROLLBAR(widget))
@ -641,7 +641,7 @@ draw_box(GtkStyle * style,
if (DETAIL("menubar")) if (DETAIL("menubar"))
{ {
if (openOfficeFix == 1) if (openOfficeFix == 1)
parent_class->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); tqparent_class->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
else else
drawMenubar(window,style,state_type,x,y,width,height); drawMenubar(window,style,state_type,x,y,width,height);
return; return;
@ -649,7 +649,7 @@ draw_box(GtkStyle * style,
if (DETAIL("menu")) if (DETAIL("menu"))
{ {
if (openOfficeFix == 1) if (openOfficeFix == 1)
parent_class->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); tqparent_class->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
else else
{ {
if ((x >= 0) && (y >= 0)) /* Work around weirdness in firefox */ if ((x >= 0) && (y >= 0)) /* Work around weirdness in firefox */
@ -700,11 +700,11 @@ draw_box(GtkStyle * style,
} }
if (DETAIL("button")) if (DETAIL("button"))
{ {
GtkWidget *parent; GtkWidget *tqparent;
int toolbutton = 0; int toolbutton = 0;
parent = gtk_widget_get_parent(widget); tqparent = gtk_widget_get_parent(widget);
if (parent && (GTK_IS_CLIST(parent) || GTK_IS_LIST(parent) || GTK_IS_TREE_VIEW(parent))) if (tqparent && (GTK_IS_CLIST(tqparent) || GTK_IS_LIST(tqparent) || GTK_IS_TREE_VIEW(tqparent)))
{ {
drawListHeader(window,style,state_type,x,y,width,height); drawListHeader(window,style,state_type,x,y,width,height);
return; return;
@ -714,12 +714,12 @@ draw_box(GtkStyle * style,
* toolbar in gtk */ * toolbar in gtk */
while (1) while (1)
{ {
if (GTK_IS_WIDGET(parent)) if (GTK_IS_WIDGET(tqparent))
{ {
#ifdef HAVE_BONOBO #ifdef HAVE_BONOBO
if (GTK_IS_TOOLBAR(parent) || BONOBO_IS_UI_TOOLBAR(parent)) if (GTK_IS_TOOLBAR(tqparent) || BONOBO_IS_UI_TOOLBAR(tqparent))
#else #else
if (GTK_IS_TOOLBAR(parent)) if (GTK_IS_TOOLBAR(tqparent))
#endif #endif
{ {
toolbutton = 1; toolbutton = 1;
@ -728,10 +728,10 @@ draw_box(GtkStyle * style,
} }
else else
break; break;
parent = gtk_widget_get_parent(parent); tqparent = gtk_widget_get_parent(tqparent);
} }
parent = gtk_widget_get_parent(widget); tqparent = gtk_widget_get_parent(widget);
if (toolbutton) if (toolbutton)
drawToolButton(window,style,state_type,x,y,width,height); drawToolButton(window,style,state_type,x,y,width,height);
@ -744,9 +744,9 @@ draw_box(GtkStyle * style,
int defaultButton = GTK_WIDGET_HAS_FOCUS(widget); int defaultButton = GTK_WIDGET_HAS_FOCUS(widget);
GtkWindow* toplevel; GtkWindow* toplevel;
if (isBaghira && GTK_IS_BOX(parent) && (g_list_length(GTK_BOX(parent)->children) == 2)) if (isBaghira && GTK_IS_BOX(tqparent) && (g_list_length(GTK_BOX(tqparent)->children) == 2))
{ {
child1 = g_list_first((GTK_BOX(parent)->children)); child1 = g_list_first((GTK_BOX(tqparent)->children));
child = ((GtkBoxChild *)child1->data)->widget; child = ((GtkBoxChild *)child1->data)->widget;
if (GTK_IS_ENTRY(child)) if (GTK_IS_ENTRY(child))
{ {
@ -754,7 +754,7 @@ draw_box(GtkStyle * style,
return; return;
} }
child1 = g_list_last((GTK_BOX(parent)->children)); child1 = g_list_last((GTK_BOX(tqparent)->children));
child = ((GtkBoxChild *)child1->data)->widget; child = ((GtkBoxChild *)child1->data)->widget;
if (GTK_IS_ENTRY(child)) if (GTK_IS_ENTRY(child))
{ {
@ -781,9 +781,9 @@ draw_box(GtkStyle * style,
/* THIS IS WHAT WORKS NOW -- /* THIS IS WHAT WORKS NOW --
Tabs and tabbarbase will be drawn properly according to the QT style Tabs and tabbarbase will be drawn properly according to the QT style
But the tabs won't be aligned according to QT. GTK+ does not have But the tabs won't be aligned according to QT. GTK+ does not have
an option for alignment of tabs. So if were to do this not only do we have to an option for tqalignment of tabs. So if were to do this not only do we have to
calculate the x,y position of the tab ourselves, which is difficult in Qt unless calculate the x,y position of the tab ourselves, which is difficult in TQt unless
we are displaying the tab (can be done by subclassing QTabBar/QTabWidget) we are displaying the tab (can be done by subclassing TQTabBar/TQTabWidget)
but also have to position the tab bar label ourselves in gtk. but also have to position the tab bar label ourselves in gtk.
*/ */
@ -811,7 +811,7 @@ draw_box(GtkStyle * style,
if (DETAIL("toolbar")) if (DETAIL("toolbar"))
{ {
if (openOfficeFix == 1) if (openOfficeFix == 1)
parent_class->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); tqparent_class->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
else else
drawToolbar(window,style,state_type,x,y,width,height); drawToolbar(window,style,state_type,x,y,width,height);
return; return;
@ -852,24 +852,24 @@ draw_flat_box(GtkStyle * style,
{ {
sanitize_size(window, &width, &height); sanitize_size(window, &width, &height);
if (gtkQtDebug) if (gtkTQtDebug)
printf("Flat Box (%d,%d,%d,%d) Widget: %s Detail: %s %d %d\n",x,y,width,height,gtk_widget_get_name(widget),detail, state_type, GTK_STATE_SELECTED); printf("Flat Box (%d,%d,%d,%d) Widget: %s Detail: %s %d %d\n",x,y,width,height,gtk_widget_get_name(widget),detail, state_type, GTK_STATE_SELECTED);
if (DETAIL("tooltip")) if (DETAIL("tooltip"))
{ {
GdkColor tooltipColor; GdkColor tooltipColor;
GdkGCValues gc_values; GdkGCValues gc_values;
GdkGCValuesMask gc_values_mask; GdkGCValuesMask gc_values_tqmask;
GdkGC* tooltipGc; GdkGC* tooltipGc;
tooltipColor.red = 255*257; tooltipColor.red = 255*257;
tooltipColor.green = 255*257; tooltipColor.green = 255*257;
tooltipColor.blue = 220*257; tooltipColor.blue = 220*257;
gdk_colormap_alloc_color(style->colormap, &tooltipColor, FALSE, TRUE); gdk_colormap_alloc_color(style->colormap, &tooltipColor, FALSE, TRUE);
gc_values_mask = GDK_GC_FOREGROUND; gc_values_tqmask = GDK_GC_FOREGROUND;
gc_values.foreground = tooltipColor; gc_values.foreground = tooltipColor;
tooltipGc = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); tooltipGc = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
gdk_draw_rectangle(window, tooltipGc, TRUE, x, y, width, height); gdk_draw_rectangle(window, tooltipGc, TRUE, x, y, width, height);
gdk_draw_rectangle(window, style->black_gc, FALSE, x, y, width - 1, height - 1); gdk_draw_rectangle(window, style->black_gc, FALSE, x, y, width - 1, height - 1);
@ -908,7 +908,7 @@ draw_check(GtkStyle * style,
gint width, gint width,
gint height) gint height)
{ {
if (gtkQtDebug) if (gtkTQtDebug)
printf("Check (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); printf("Check (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail);
if (GTK_IS_MENU_ITEM(widget)) if (GTK_IS_MENU_ITEM(widget))
@ -945,7 +945,7 @@ draw_option(GtkStyle * style,
gint width, gint width,
gint height) gint height)
{ {
if (gtkQtDebug) if (gtkTQtDebug)
printf("Option (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); printf("Option (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail);
if (gdk_window_is_viewable(gtk_widget_get_parent_window(widget))) if (gdk_window_is_viewable(gtk_widget_get_parent_window(widget)))
@ -979,7 +979,7 @@ draw_tab(GtkStyle * style,
gint width, gint width,
gint height) gint height)
{ {
if (gtkQtDebug) if (gtkTQtDebug)
printf("Tab (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); printf("Tab (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail);
gtk_paint_box(style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); gtk_paint_box(style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
@ -1011,7 +1011,7 @@ draw_shadow_gap(GtkStyle * style,
sanitize_size (window, &width, &height); sanitize_size (window, &width, &height);
shadow_type = get_shadow_type (style, detail, shadow_type); shadow_type = get_shadow_type (style, detail, shadow_type);
if (gtkQtDebug) if (gtkTQtDebug)
printf("Shadow_Gap (%d,%d,%d,%d) Widget: %s Detail: %s\n",x,y,width,height,gtk_widget_get_name(widget),detail); printf("Shadow_Gap (%d,%d,%d,%d) Widget: %s Detail: %s\n",x,y,width,height,gtk_widget_get_name(widget),detail);
switch (shadow_type) { switch (shadow_type) {
@ -1154,7 +1154,7 @@ draw_box_gap(GtkStyle* style,
if (width<0 || height<0) return; /* Eclipse really can be this stupid! */ if (width<0 || height<0) return; /* Eclipse really can be this stupid! */
if (gtkQtDebug) if (gtkTQtDebug)
printf("Box_gap (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); printf("Box_gap (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail);
if (DETAIL("notebook")) if (DETAIL("notebook"))
@ -1181,7 +1181,7 @@ draw_extension(GtkStyle * style,
sanitize_size (window, &width, &height); sanitize_size (window, &width, &height);
if (gtkQtDebug) if (gtkTQtDebug)
printf("Extension (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); printf("Extension (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail);
gtk_paint_box(style, window, state_type, shadow_type, area, widget, detail, gtk_paint_box(style, window, state_type, shadow_type, area, widget, detail,
@ -1201,14 +1201,14 @@ draw_focus (GtkStyle *style,
gint width, gint width,
gint height) gint height)
{ {
if (gtkQtDebug) if (gtkTQtDebug)
printf("Focus Rect (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); printf("Focus Rect (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail);
GtkWidget* parent = gtk_widget_get_parent(widget); GtkWidget* tqparent = gtk_widget_get_parent(widget);
if (GTK_IS_CHECK_BUTTON(widget) || if (GTK_IS_CHECK_BUTTON(widget) ||
GTK_IS_RADIO_BUTTON(widget) || GTK_IS_RADIO_BUTTON(widget) ||
(parent && (GTK_IS_CLIST(parent) || GTK_IS_LIST(parent) || GTK_IS_TREE_VIEW(parent)))) (tqparent && (GTK_IS_CLIST(tqparent) || GTK_IS_LIST(tqparent) || GTK_IS_TREE_VIEW(tqparent))))
{ {
drawFocusRect(window, style, x, y, width, height); drawFocusRect(window, style, x, y, width, height);
} }
@ -1229,7 +1229,7 @@ draw_slider(GtkStyle * style,
gint height, gint height,
GtkOrientation orientation) GtkOrientation orientation)
{ {
if (gtkQtDebug) if (gtkTQtDebug)
printf("Slider (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); printf("Slider (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail);
if (DETAIL("slider")) if (DETAIL("slider"))
@ -1237,11 +1237,11 @@ draw_slider(GtkStyle * style,
GtkAdjustment* adj = gtk_range_get_adjustment(GTK_RANGE(widget)); GtkAdjustment* adj = gtk_range_get_adjustment(GTK_RANGE(widget));
int widgetX, widgetY; int widgetX, widgetY;
GtkWidget* parent = widget; GtkWidget* tqparent = widget;
while (gtk_widget_get_parent(parent) != NULL) while (gtk_widget_get_parent(tqparent) != NULL)
parent = gtk_widget_get_parent(parent); tqparent = gtk_widget_get_parent(tqparent);
gtk_widget_translate_coordinates(widget, parent, 0, 0, &widgetX, &widgetY); gtk_widget_translate_coordinates(widget, tqparent, 0, 0, &widgetX, &widgetY);
if (orientation == GTK_ORIENTATION_VERTICAL) if (orientation == GTK_ORIENTATION_VERTICAL)
drawScrollBarSlider(window, style, state_type, orientation, adj, x-1, y, width+2, height, y-widgetY, widget->allocation.height); drawScrollBarSlider(window, style, state_type, orientation, adj, x-1, y, width+2, height, y-widgetY, widget->allocation.height);
@ -1270,7 +1270,7 @@ draw_handle(GtkStyle * style,
sanitize_size(window, &width, &height); sanitize_size(window, &width, &height);
if (gtkQtDebug) if (gtkTQtDebug)
printf("Handle (%d,%d,%d,%d) Widget: %s Detail: %s \n",x,y,width,height,gtk_widget_get_name(widget),detail, state_type); printf("Handle (%d,%d,%d,%d) Widget: %s Detail: %s \n",x,y,width,height,gtk_widget_get_name(widget),detail, state_type);
drawSplitter(window,style,state_type,orientation,x,y,width,height); drawSplitter(window,style,state_type,orientation,x,y,width,height);
@ -1287,33 +1287,33 @@ void draw_layout (GtkStyle *style,
const gchar *detail, const gchar *detail,
gint x, gint x,
gint y, gint y,
PangoLayout *layout) PangoLayout *tqlayout)
{ {
GdkColor color; GdkColor color;
GdkGC *gc; GdkGC *gc;
getTextColor(&color, state_type); getTextColor(&color, state_type);
if (gtkQtDebug) if (gtkTQtDebug)
printf("Layout (%d,%d) Widget: %s Detail: %s %d \n",x,y,gtk_widget_get_name(widget),detail, state_type); printf("Layout (%d,%d) Widget: %s Detail: %s %d \n",x,y,gtk_widget_get_name(widget),detail, state_type);
if (DETAIL("accellabel") || DETAIL("label") || DETAIL("cellrenderertext")) if (DETAIL("accellabel") || DETAIL("label") || DETAIL("cellrenderertext"))
{ {
GtkWidget* parent = gtk_widget_get_parent(widget); GtkWidget* tqparent = gtk_widget_get_parent(widget);
GtkWidget* parent1 = gtk_widget_get_parent(parent); GtkWidget* tqparent1 = gtk_widget_get_parent(tqparent);
/* printf("parent's names are %s->%s->%s\n", gtk_widget_get_name(widget), gtk_widget_get_name(parent), gtk_widget_get_name(parent1)); */ /* printf("tqparent's names are %s->%s->%s\n", gtk_widget_get_name(widget), gtk_widget_get_name(tqparent), gtk_widget_get_name(tqparent1)); */
/* In baghira -- even highlight the menu bar items */ /* In baghira -- even highlight the menu bar items */
if ((GTK_IS_MENU_ITEM(parent) && (!GTK_IS_MENU_BAR(parent1) || isBaghira || isPolyester)) || GTK_IS_TREE_VIEW(widget)) if ((GTK_IS_MENU_ITEM(tqparent) && (!GTK_IS_MENU_BAR(tqparent1) || isBaghira || isPolyester)) || GTK_IS_TREE_VIEW(widget))
{ {
PangoAttrList *layoutattr; PangoAttrList *tqlayoutattr;
const gchar *text; const gchar *text;
gint text_length = 0; gint text_length = 0;
gint text_bytelen = 0; gint text_bytelen = 0;
text = pango_layout_get_text (layout); text = pango_layout_get_text (tqlayout);
if (text != 0) if (text != 0)
{ {
PangoAttribute *textcolorattr; PangoAttribute *textcolorattr;
@ -1324,19 +1324,19 @@ void draw_layout (GtkStyle *style,
textcolorattr->start_index = 0; textcolorattr->start_index = 0;
textcolorattr->end_index = text_bytelen; textcolorattr->end_index = text_bytelen;
layoutattr = pango_layout_get_attributes(layout); tqlayoutattr = pango_layout_get_attributes(tqlayout);
if (layoutattr == NULL) if (tqlayoutattr == NULL)
{ {
layoutattr = pango_attr_list_new(); tqlayoutattr = pango_attr_list_new();
pango_attr_list_insert(layoutattr, pango_attribute_copy(textcolorattr)); pango_attr_list_insert(tqlayoutattr, pango_attribute_copy(textcolorattr));
pango_layout_set_attributes(layout,layoutattr); pango_layout_set_attributes(tqlayout,tqlayoutattr);
pango_attr_list_unref(layoutattr); pango_attr_list_unref(tqlayoutattr);
} }
else else
{ {
pango_attr_list_change(layoutattr, pango_attribute_copy(textcolorattr)); pango_attr_list_change(tqlayoutattr, pango_attribute_copy(textcolorattr));
pango_layout_set_attributes(layout,layoutattr); pango_layout_set_attributes(tqlayout,tqlayoutattr);
} }
pango_attribute_destroy(textcolorattr); pango_attribute_destroy(textcolorattr);
} }
@ -1355,13 +1355,13 @@ void draw_layout (GtkStyle *style,
if (state_type == GTK_STATE_INSENSITIVE) if (state_type == GTK_STATE_INSENSITIVE)
{ {
PangoLayout *ins; PangoLayout *ins;
ins = get_insensitive_layout (window, layout); ins = get_insensitive_layout (window, tqlayout);
gdk_draw_layout (window, gc, x, y, ins); gdk_draw_layout (window, gc, x, y, ins);
g_object_unref (ins); g_object_unref (ins);
} }
else else
{ {
gdk_draw_layout (window, gc, x, y, layout); gdk_draw_layout (window, gc, x, y, tqlayout);
} }
if (area) if (area)
@ -1390,7 +1390,7 @@ range_new (guint start,
static PangoLayout* static PangoLayout*
get_insensitive_layout (GdkDrawable *drawable, get_insensitive_layout (GdkDrawable *drawable,
PangoLayout *layout) PangoLayout *tqlayout)
{ {
GSList *embossed_ranges = NULL; GSList *embossed_ranges = NULL;
GSList *stippled_ranges = NULL; GSList *stippled_ranges = NULL;
@ -1400,7 +1400,7 @@ get_insensitive_layout (GdkDrawable *drawable,
PangoAttrList *attrs; PangoAttrList *attrs;
GdkBitmap *stipple = NULL; GdkBitmap *stipple = NULL;
iter = pango_layout_get_iter (layout); iter = pango_layout_get_iter (tqlayout);
do do
{ {
@ -1447,7 +1447,7 @@ get_insensitive_layout (GdkDrawable *drawable,
pango_layout_iter_free (iter); pango_layout_iter_free (iter);
new_layout = pango_layout_copy (layout); new_layout = pango_layout_copy (tqlayout);
attrs = pango_layout_get_attributes (new_layout); attrs = pango_layout_get_attributes (new_layout);
@ -1526,25 +1526,25 @@ qtengine_style_register_type (GTypeModule *module)
{ {
static const GTypeInfo object_info = static const GTypeInfo object_info =
{ {
sizeof (QtEngineStyleClass), sizeof (TQtEngineStyleClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) qtengine_style_class_init, (GClassInitFunc) qtengine_style_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (QtEngineStyle), sizeof (TQtEngineStyle),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) qtengine_style_init, (GInstanceInitFunc) qtengine_style_init,
}; };
qtengine_type_style = g_type_module_register_type (module, qtengine_type_style = g_type_module_register_type (module,
GTK_TYPE_STYLE, GTK_TYPE_STYLE,
"QtEngineStyle", "TQtEngineStyle",
&object_info, 0); &object_info, 0);
} }
static void static void
qtengine_style_init (QtEngineStyle *style) qtengine_style_init (TQtEngineStyle *style)
{ {
} }
@ -1743,7 +1743,7 @@ static void
gtk_style_real_realize (GtkStyle *style) gtk_style_real_realize (GtkStyle *style)
{ {
GdkGCValues gc_values; GdkGCValues gc_values;
GdkGCValuesMask gc_values_mask; GdkGCValuesMask gc_values_tqmask;
gint i; gint i;
@ -1771,13 +1771,13 @@ gtk_style_real_realize (GtkStyle *style)
style->white.blue = 0xffff; style->white.blue = 0xffff;
gdk_colormap_alloc_color (style->colormap, &style->white, FALSE, TRUE); gdk_colormap_alloc_color (style->colormap, &style->white, FALSE, TRUE);
gc_values_mask = GDK_GC_FOREGROUND; gc_values_tqmask = GDK_GC_FOREGROUND;
gc_values.foreground = style->black; gc_values.foreground = style->black;
style->black_gc = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->black_gc = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
gc_values.foreground = style->white; gc_values.foreground = style->white;
style->white_gc = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->white_gc = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
@ -1808,28 +1808,28 @@ gtk_style_real_realize (GtkStyle *style)
style->text_aa[i].red, style->text_aa[i].green, style->text_aa[i].blue); style->text_aa[i].red, style->text_aa[i].green, style->text_aa[i].blue);
gc_values.foreground = style->fg[i]; gc_values.foreground = style->fg[i];
style->fg_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->fg_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
gc_values.foreground = style->bg[i]; gc_values.foreground = style->bg[i];
style->bg_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->bg_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
gc_values.foreground = style->light[i]; gc_values.foreground = style->light[i];
style->light_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->light_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
gc_values.foreground = style->dark[i]; gc_values.foreground = style->dark[i];
style->dark_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->dark_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
gc_values.foreground = style->mid[i]; gc_values.foreground = style->mid[i];
style->mid_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->mid_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
gc_values.foreground = style->text[i]; gc_values.foreground = style->text[i];
style->text_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->text_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
gc_values.foreground = style->base[i]; gc_values.foreground = style->base[i];
style->base_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->base_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
gc_values.foreground = style->text_aa[i]; gc_values.foreground = style->text_aa[i];
style->text_aa_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); style->text_aa_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_tqmask);
} }
} }
@ -1845,15 +1845,15 @@ static void
set_background (GtkStyle *style, GdkWindow *window, GtkStateType state_type) set_background (GtkStyle *style, GdkWindow *window, GtkStateType state_type)
{ {
GdkPixmap *pixmap; GdkPixmap *pixmap;
gint parent_relative; gint tqparent_relative;
GdkPixmap* pix_test; GdkPixmap* pix_test;
/* What kind of horrible person would store a pointer to a widget here... */ /* What kind of horrible person would store a pointer to a widget here... */
void* parent = 0; void* tqparent = 0;
gdk_window_get_user_data(window, &parent); gdk_window_get_user_data(window, &tqparent);
if (GTK_IS_MENU((GtkWidget*) parent)) if (GTK_IS_MENU((GtkWidget*) tqparent))
{ {
pix_test = QTENGINE_STYLE(style)->menuBackground; pix_test = TQTENGINE_STYLE(style)->menuBackground;
} }
else else
pix_test = style->bg_pixmap[state_type]; pix_test = style->bg_pixmap[state_type];
@ -1863,28 +1863,28 @@ set_background (GtkStyle *style, GdkWindow *window, GtkStateType state_type)
if (pix_test == (GdkPixmap*) GDK_PARENT_RELATIVE) if (pix_test == (GdkPixmap*) GDK_PARENT_RELATIVE)
{ {
pixmap = NULL; pixmap = NULL;
parent_relative = TRUE; tqparent_relative = TRUE;
} }
else else
{ {
pixmap = pix_test; pixmap = pix_test;
parent_relative = FALSE; tqparent_relative = FALSE;
gdk_drawable_set_colormap(pixmap, style->colormap); gdk_drawable_set_colormap(pixmap, style->colormap);
} }
if (pixmap && !gdk_drawable_get_colormap (pixmap)) gdk_drawable_set_colormap (pixmap, gdk_drawable_get_colormap (window)); if (pixmap && !gdk_drawable_get_colormap (pixmap)) gdk_drawable_set_colormap (pixmap, gdk_drawable_get_colormap (window));
gdk_window_set_back_pixmap (window, pixmap, parent_relative); gdk_window_set_back_pixmap (window, pixmap, tqparent_relative);
} }
else else
gdk_window_set_background (window, &style->bg[state_type]); gdk_window_set_background (window, &style->bg[state_type]);
} }
static void static void
qtengine_style_class_init (QtEngineStyleClass *klass) qtengine_style_class_init (TQtEngineStyleClass *klass)
{ {
GtkStyleClass *style_class = GTK_STYLE_CLASS (klass); GtkStyleClass *style_class = GTK_STYLE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); tqparent_class = g_type_class_peek_parent (klass);
style_class->draw_hline = draw_hline; style_class->draw_hline = draw_hline;
style_class->draw_vline = draw_vline; style_class->draw_vline = draw_vline;

Loading…
Cancel
Save