generic: rework startup to no create a shell script

by the time ksplash gets the X11 events for startup phases the startup
process is (and should be) done, especially after the display
configuration is done and the monitor is ready to output thus ksplash
does not really indicate much

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-11-03 11:27:05 +02:00
parent b1e456a448
commit 881a427576
136 changed files with 37 additions and 20052 deletions

View file

@ -10,13 +10,6 @@ include(KDE4Defaults)
set(LIBRARY_TYPE SHARED)
find_package(PNG)
set_package_properties(PNG PROPERTIES
DESCRIPTION "An Open, Extensible Image Format with Lossless Compression"
URL "http://www.libpng.org/"
TYPE REQUIRED
)
# kdelibs requires 0.91
find_package(SharedMimeInfo 0.91)
set_package_properties(SharedMimeInfo PROPERTIES
@ -57,11 +50,9 @@ if(Q_WS_X11)
add_feature_info("libXTest" X11_XTest_FOUND "The X11 Testing Resource extension library is useful for automated testing of X clients")
add_feature_info("libXcomposite" X11_Xcomposite_FOUND "The X11 Composite extension library may be used by Plasma and KWin")
add_feature_info("libXShm" X11_XShm_FOUND "The X11 shared-memory fences library may be used by ksplash")
add_feature_info("libxf86misc" X11_xf86misc_FOUND "The X11 miscellaneous library may be used by keyboard KCM") # TODO: unused?
add_feature_info("libXSync" X11_XSync_FOUND "The X11 synchronization may be used by KWin")
add_feature_info("libXinput" X11_Xinput_FOUND "The X11 XINPUT extension library may be used by keyboard KCM")
add_feature_info("libXinerama" X11_Xinerama_FOUND "The X11 XINERAMA extension library may be used by ksplash")
add_feature_info("libXRes" X11_XRes_FOUND "The X Resource library may be used by ksysguard")
add_feature_info("libXext" X11_dpms_FOUND "The X extensions library may be used by kscreensaver")
@ -287,8 +278,6 @@ add_subdirectory(kwin)
add_subdirectory(ksmserver)
add_subdirectory(kscreensaver)
add_subdirectory(ksplash)
add_subdirectory(qguiplatformplugin_kde)
add_subdirectory(ksysguard)
@ -296,7 +285,6 @@ add_subdirectory(kcontrol)
add_subdirectory(klipper)
add_subdirectory(kmenuedit)
add_subdirectory(krunner)
add_subdirectory(kstartupconfig)
add_subdirectory(freespacenotifier)
add_subdirectory(kinfocenter)

View file

@ -18,14 +18,12 @@ check_function_exists(nice HAVE_NICE)
check_include_files(malloc.h HAVE_MALLOC_H)
kde4_bool_to_01(FONTCONFIG_FOUND HAVE_FONTCONFIG) # kcontrol/fonts
kde4_bool_to_01(FREETYPE_FOUND HAVE_FREETYPE) # kcontrol/fonts
kde4_bool_to_01(X11_XShm_FOUND HAVE_XSHM) # ksplash
kde4_bool_to_01(X11_XTest_FOUND HAVE_XTEST) # khotkeys, kxkb
kde4_bool_to_01(X11_Xcomposite_FOUND HAVE_XCOMPOSITE) # plasma, kwin
kde4_bool_to_01(X11_Xcursor_FOUND HAVE_XCURSOR) # many uses
kde4_bool_to_01(X11_Xdamage_FOUND HAVE_XDAMAGE) # kwin
kde4_bool_to_01(X11_Xfixes_FOUND HAVE_XFIXES) # klipper, kicker, kwin
kde4_bool_to_01(X11_Xkb_FOUND HAVE_XKB) # kglobalaccel, kcontrol/keyboard
kde4_bool_to_01(X11_Xinerama_FOUND HAVE_XINERAMA)
kde4_bool_to_01(X11_Xrandr_FOUND HAVE_XRANDR) # kwin
kde4_bool_to_01(X11_Xrender_FOUND HAVE_XRENDER) # kcontrol/style, kicker
kde4_bool_to_01(X11_xf86misc_FOUND HAVE_XF86MISC) # kcontrol/keyboard

View file

@ -13,12 +13,6 @@
/* Define if you have the XKB extension */
#cmakedefine HAVE_XKB 1
/* Define if you have the Xinerama extension */
#cmakedefine HAVE_XINERAMA 1
/* Define if you have the XSHM (MIT SHM) extension */
#cmakedefine HAVE_XSHM 1
/* Define if you have the XComposite extension */
#cmakedefine HAVE_XCOMPOSITE 1

View file

@ -26,6 +26,7 @@
#include <QFile>
#include <QTimer>
#include <QLibrary>
#include <QtDBus/QtDBus>
#include <kapplication.h>
#include <kcmdlineargs.h>
@ -36,15 +37,14 @@
#include <kconfiggroup.h>
#include <klocale.h>
#include <ktoolinvocation.h>
#include <kservicetypetrader.h>
#include <klauncher_iface.h>
#include <QtDBus/QtDBus>
#ifdef Q_WS_X11
#include <X11/Xlib.h>
#include <QtGui/qx11info_x11.h>
#endif
#include <kservicetypetrader.h>
static int ready[ 2 ];
static bool startup = false;
@ -199,14 +199,6 @@ KCMInit::KCMInit( KCmdLineArgs* args )
if( startup )
{
runModules( 0 );
XEvent e;
e.xclient.type = ClientMessage;
e.xclient.message_type = XInternAtom( QX11Info::display(), "_KDE_SPLASH_PROGRESS", False );
e.xclient.display = QX11Info::display();
e.xclient.window = QX11Info::appRootWindow();
e.xclient.format = 8;
strcpy( e.xclient.data.b, "kcminit" );
XSendEvent( QX11Info::display(), QX11Info::appRootWindow(), False, SubstructureNotifyMask, &e );
sendReady();
QTimer::singleShot( 300 * 1000, qApp, SLOT(quit())); // just in case
qApp->exec(); // wait for runPhase1() and runPhase2()

View file

@ -20,7 +20,6 @@ add_subdirectory( colors )
add_subdirectory( krdb )
add_subdirectory( style )
add_subdirectory( desktoptheme )
add_subdirectory( splash )
add_subdirectory( standard_actions )
add_subdirectory( keys )
add_subdirectory( workspaceoptions )

View file

@ -6,7 +6,7 @@ X-KDE-ServiceTypes=KCModule,KCModuleInit
X-DocPath=kcontrol/mouse/index.html
X-KDE-Library=kcm_input
X-KDE-Init-Symbol=mouse
X-KDE-Init-Symbol=kcminit_mouse
X-KDE-Init-Phase=0
X-KDE-ParentApp=kcontrol

View file

@ -28,6 +28,8 @@
#include <KPluginLoader>
#include <KDebug>
#include <KApplication>
#include <KProcess>
#include <kdemacros.h>
#include <config-X11.h>
#include "randr.h"
@ -36,6 +38,28 @@
K_PLUGIN_FACTORY(KSSFactory, registerPlugin<KRandRModule>();)
K_EXPORT_PLUGIN(KSSFactory("krandr"))
extern "C"
{
KDE_EXPORT void kcminit_randr()
{
// TODO: drop legacy config support
KConfig config("krandrrc");
KConfigGroup group = config.group("Display");
const bool applyonstartup = group.readEntry("ApplyOnStartup", false);
if (applyonstartup) {
const QStringList commands = group.readEntry("StartupCommands").split("\n");
foreach (const QString &command, commands) {
KProcess kproc;
kproc.setShellCommand(command);
kproc.start();
if (!kproc.waitForStarted() || !kproc.waitForFinished()) {
kWarning() << kproc.readAllStandardError();
}
}
}
}
}
KRandRModule::KRandRModule(QWidget *parent, const QVariantList&)
: KCModule(KSSFactory::componentData(), parent)
{

View file

@ -2,8 +2,10 @@
Exec=kcmshell4 randr
Icon=preferences-desktop-display-randr
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ServiceTypes=KCModule,KCModuleInit
X-KDE-Library=kcm_randr
X-KDE-Init-Symbol=kcminit_randr
X-KDE-Init-Phase=0
X-KDE-ParentApp=kcontrol
#This is always false when kbuildsycoca runs, probably because it is now a QCoreApplication
#Hidden[$e]=$(if xdpyinfo|grep RANDR > /dev/null; then echo "false"; else echo "true"; fi)

View file

@ -1,14 +0,0 @@
add_subdirectory( pics )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${KDE4_INCLUDES} )
########### next target ###############
set(kcm_ksplashthemes_PART_SRCS installer.cpp main.cpp )
kde4_add_plugin(kcm_ksplashthemes ${kcm_ksplashthemes_PART_SRCS})
target_link_libraries(kcm_ksplashthemes ${KDE4_KIO_LIBS} ${KDE4_KARCHIVE_LIBS})
install(TARGETS kcm_ksplashthemes DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} )
########### install files ###############
install( FILES ksplashthememgr.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR} )

View file

@ -1,2 +0,0 @@
#!/bin/bash
$XGETTEXT *.cpp -o $podir/ksplashthemes.pot

View file

@ -1,555 +0,0 @@
/***************************************************************************
* Copyright Ravikiran Rajagopal 2003 *
* ravi@ee.eng.ohio-state.edu *
* Copyright (c) 1998 Stefan Taferner <taferner@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License (version 2) as *
* published by the Free Software Foundation. *
* *
***************************************************************************/
#include <unistd.h>
#include <stdlib.h>
#include <QProcess>
#include <QDir>
#include <QLabel>
#include <QLayout>
#include <QTextEdit>
#include <QPixmap>
#include <QFrame>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QScrollArea>
#include <QtGui/qevent.h>
#include "installer.h"
#include <kdebug.h>
#include <kfiledialog.h>
#include <kglobalsettings.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kpushbutton.h>
#include <kstandarddirs.h>
#include <karchive.h>
#include <kservicetypetrader.h>
#include <kio/netaccess.h>
ThemeListBox::ThemeListBox(QWidget *parent)
: KListWidget(parent)
{
setAcceptDrops(true);
}
void ThemeListBox::dragEnterEvent(QDragEnterEvent* event)
{
event->setAccepted((event->source() != this) && KUrl::List::canDecode(event->mimeData()));
}
void ThemeListBox::dragMoveEvent(QDragMoveEvent* event)
{
event->setAccepted((event->source() != this) && KUrl::List::canDecode(event->mimeData()));
}
void ThemeListBox::dropEvent(QDropEvent* event)
{
KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
if (!urls.isEmpty())
{
emit filesDropped(urls);
}
}
void ThemeListBox::mousePressEvent(QMouseEvent *e)
{
if ((e->buttons() & Qt::LeftButton) != 0)
{
mOldPos = e->globalPos();;
mDragFile.clear();
int cur = row(itemAt(e->pos()));
if (cur >= 0)
mDragFile = text2path[item(cur)->text()];
}
KListWidget::mousePressEvent(e);
}
void ThemeListBox::mouseMoveEvent(QMouseEvent *e)
{
if (((e->buttons() & Qt::LeftButton) != 0) && !mDragFile.isEmpty())
{
int delay = KGlobalSettings::dndEventDelay();
QPoint newPos = e->globalPos();
if(newPos.x() > mOldPos.x()+delay || newPos.x() < mOldPos.x()-delay ||
newPos.y() > mOldPos.y()+delay || newPos.y() < mOldPos.y()-delay)
{
KUrl url;
url.setPath(mDragFile);
KUrl::List urls;
urls.append(url);
QDrag *drag = new QDrag(this);
QMimeData *mime = new QMimeData();
urls.populateMimeData(mime);
drag->setMimeData(mime);
drag->start();
}
}
KListWidget::mouseMoveEvent(e);
}
//-----------------------------------------------------------------------------
SplashInstaller::SplashInstaller (QWidget *aParent, const char *aName, bool aInit)
: QWidget(aParent), mGui(!aInit)
{
setObjectName(aName);
KGlobal::dirs()->addResourceType("ksplashthemes", "data", "ksplash/Themes");
if (!mGui)
return;
QHBoxLayout* hbox = new QHBoxLayout( this );
hbox->setMargin( 0 );
QVBoxLayout* leftbox = new QVBoxLayout( );
hbox->addLayout( leftbox );
hbox->setStretchFactor( leftbox, 1 );
mThemesList = new ThemeListBox(this);
mThemesList->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
connect(mThemesList, SIGNAL(currentRowChanged(int)), SLOT(slotSetTheme(int)));
connect(mThemesList, SIGNAL(filesDropped(KUrl::List)), SLOT(slotFilesDropped(KUrl::List)));
leftbox->addWidget(mThemesList);
mBtnAdd = new KPushButton( KIcon("document-import"), i18n("Install Theme File..."), this );
mBtnAdd->setToolTip(i18n("Install a theme archive file you already have locally"));
mBtnAdd->setWhatsThis(i18n("If you already have a theme archive locally, this button will unpack it and make it available for KDE applications"));
leftbox->addWidget( mBtnAdd );
connect(mBtnAdd, SIGNAL(clicked()), SLOT(slotAdd()));
mBtnRemove = new KPushButton( KIcon("edit-delete"), i18n("Remove Theme"), this );
mBtnRemove->setToolTip(i18n("Remove the selected theme from your disk"));
mBtnRemove->setWhatsThis(i18n("This will remove the selected theme from your disk."));
mBtnRemove->setEnabled( false );
leftbox->addWidget( mBtnRemove );
connect(mBtnRemove, SIGNAL(clicked()), SLOT(slotRemove()));
mBtnTest = new KPushButton( KIcon("document-preview"), i18n("Test Theme"), this );
mBtnTest->setToolTip(i18n("Test the selected theme"));
mBtnTest->setWhatsThis(i18n("This will test the selected theme."));
mBtnTest->setEnabled( false );
leftbox->addWidget( mBtnTest );
connect(mBtnTest, SIGNAL(clicked()), SLOT(slotTest()));
QVBoxLayout* rightbox = new QVBoxLayout( );
hbox->addLayout( rightbox );
hbox->setStretchFactor( rightbox, 3 );
QScrollArea* scrollarea = new QScrollArea(this);
scrollarea->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
mPreview = new QLabel(this);
scrollarea->setWidget(mPreview);
mPreview->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
mPreview->setMinimumSize(QSize(320,240));
mPreview->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
rightbox->addWidget(scrollarea);
rightbox->setStretchFactor( scrollarea, 3 );
mText = new QTextEdit(this);
mText->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
mText->setMinimumSize(mText->sizeHint().width(), 7 * mText->fontMetrics().height());
mText->setReadOnly(true);
rightbox->addWidget(mText);
rightbox->setStretchFactor( mText, 1 );
readThemesList();
load();
}
//-----------------------------------------------------------------------------
SplashInstaller::~SplashInstaller()
{
}
int SplashInstaller::addTheme(const QString &path, const QString &name)
{
qDebug() << "SplashInstaller::addTheme: " << path << " " << name;
QString tmp(i18n( name.toUtf8() ));
int i = mThemesList->count();
while((i > 0) && (mThemesList->item(i-1)->text() > tmp))
i--;
if ((i > 0) && (mThemesList->item(i-1)->text() == tmp))
return i-1;
mThemesList->insertItem(i , tmp);
mThemesList->text2path.insert( tmp, path+'/'+name );
return i;
}
// Copy theme package into themes directory
void SplashInstaller::addNewTheme(const KUrl &srcURL)
{
const QString dir = KGlobal::dirs()->saveLocation("ksplashthemes");
KUrl url;
QStringList themeNames;
QString filename = srcURL.fileName();
int i = filename.lastIndexOf('.');
// Convert extension to lower case.
if (i >= 0)
filename = filename.left(i)+filename.mid(i).toLower();
url.setPath(KStandardDirs::locateLocal("tmp",filename));
// Remove file from temporary directory if it aleady exists - usually the result of a failed install.
if ( KIO::NetAccess::exists( url, KIO::NetAccess::SourceSide, 0 ) )
KIO::NetAccess::del( url, 0 );
if (srcURL.fileName().toLower() == "theme.rc" ) // uncompressed theme selected
{
QString themeName;
// Get the name of the Theme from the theme.rc file
KConfig _cnf(srcURL.path());
KConfigGroup cnf(&_cnf, QString("KSplash Theme: %1").arg(themeName) );
// copy directory of theme.rc to ThemesDir
KIO::NetAccess::dircopy(KUrl(srcURL.directory()), KUrl(dir + themeName));
themeNames << themeName;
}
else
{
bool rc = KIO::NetAccess::file_copy(srcURL, url, 0);
if (!rc)
{
kWarning() << "Failed to copy theme " << srcURL.fileName()
<< " into temporary directory " << url.path() << endl;
return;
}
// extract into theme directory: we may have multiple themes in one tarball!
KArchive tarFile(url.path());
if (!tarFile.isReadable())
{
kWarning() << "Unable to open archive: " << url.path();
KIO::NetAccess::del( url, 0 );
return;
}
// find theme directory entries.
foreach(const KArchiveEntry &e, tarFile.list())
{
if( e.pathname.endsWith("/Theme.rc") )
{
// each directory may contain one theme
themeNames << QFileInfo(e.pathname).path();
}
}
if (themeNames.count() < 1)
{
kWarning() << "No directory in archive: " << url.path();
KIO::NetAccess::del( url, 0 );
return;
}
// find all theme directory files
QStringList themeFiles;
foreach(const QString &t, themeNames)
{
foreach(const KArchiveEntry &e, tarFile.list(t + QDir::separator()))
{
themeFiles << QFile::decodeName(e.pathname);
}
}
// copy the theme into the "ksplashthemes" directory
if (!tarFile.extract(themeFiles, dir)) {
kWarning() << "Could not extract: " << themeFiles;
}
KIO::NetAccess::del( url, 0 );
}
readThemesList();
mThemesList->setCurrentRow(findTheme(themeNames.first()));
if (mThemesList->currentItem())
{
mThemesList->currentItem()->setSelected(true);
}
}
//-----------------------------------------------------------------------------
void SplashInstaller::readThemesList()
{
mThemesList->clear();
// Read local themes
const QStringList entryList = KGlobal::dirs()->resourceDirs("ksplashthemes");
//kDebug() << "readThemesList: " << entryList;
QDir dir;
QStringList subdirs;
QStringList::ConstIterator name;
for(name = entryList.constBegin(); name != entryList.constEnd(); name++)
{
dir = *name;
if (!dir.exists())
continue;
subdirs = dir.entryList( QDir::Dirs );
// kDebug() << "readThemesList: " << subdirs;
// TODO: Make sure it contains a *.rc file.
for (QStringList::const_iterator l = subdirs.constBegin(); l != subdirs.constEnd(); l++ )
if ( !(*l).startsWith(QString(".")) )
{
mThemesList->blockSignals( true ); // Don't activate any theme until all themes are loaded.
addTheme(dir.path(),*l);
mThemesList->blockSignals( false );
}
}
}
//-----------------------------------------------------------------------------
void SplashInstaller::defaults()
{
mThemesList->setCurrentRow(findTheme("Default"));
emit changed( true );
}
void SplashInstaller::load()
{
KConfig _cnf( "ksplashrc" );
KConfigGroup cnf(&_cnf, "KSplash");
QString curTheme = cnf.readEntry("Theme","Default");
mThemesList->setCurrentRow(findTheme(curTheme));
emit changed( false );
}
//-----------------------------------------------------------------------------
void SplashInstaller::save()
{
KConfig _cnf( "ksplashrc" );
KConfigGroup cnf(&_cnf, "KSplash");
int cur = mThemesList->currentRow();
if (cur < 0)
return;
QString path = mThemesList->item(cur)->text();
if ( mThemesList->text2path.contains( path ) )
path = mThemesList->text2path[path];
cur = path.lastIndexOf('/');
cnf.writeEntry("Theme", path.mid(cur+1) );
// save also the engine, so that it's known at KDE startup which splash implementation to use
cnf.writeEntry("Engine", mEngineOfSelected );
cnf.sync();
emit changed( false );
}
//-----------------------------------------------------------------------------
void SplashInstaller::slotRemove()
{
int cur = mThemesList->currentRow();
if (cur < 0)
return;
bool rc = false;
const QString themeName = mThemesList->item(cur)->text();
const QString themeDir = mThemesList->text2path[themeName];
if (!themeDir.isEmpty())
{
KUrl url;
url.setPath(themeDir);
if (KMessageBox::warningContinueCancel(this,i18n("Delete folder %1 and its contents?", themeDir),"",KGuiItem(i18n("&Delete"),"edit-delete"))==KMessageBox::Continue)
rc = KIO::NetAccess::del(url,this);
else
return;
}
if (!rc)
{
KMessageBox::sorry(this, i18n("Failed to remove theme '%1'", themeName));
return;
}
//mThemesList->removeItem(cur);
readThemesList();
cur = (cur >= mThemesList->count())?mThemesList->count()-1:cur;
mThemesList->setCurrentRow(cur);
}
//-----------------------------------------------------------------------------
void SplashInstaller::slotSetTheme(int id)
{
bool enabled;
QString path = QString();
QString infoTxt;
if (id < 0)
{
mPreview->setText(QString());
mText->setText(QString());
enabled = false;
}
else
{
QString error = i18n("(Could not load theme)");
path = mThemesList->item(id)->text();
if ( mThemesList->text2path.contains( path ) )
path = mThemesList->text2path[path];
enabled = false;
KUrl url;
QString themeName;
if (!path.isEmpty())
{
// Make sure the correct plugin is installed.
int i = path.lastIndexOf('/');
if (i >= 0)
themeName = path.mid(i+1);
url.setPath( path + "/Theme.rc" );
if (!KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, 0))
{
url.setPath( path + "/Theme.RC" );
if (!KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, 0))
{
url.setPath( path + "/theme.rc" );
if (!KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, 0))
url.setPath( path + '/' + themeName + ".rc" );
}
}
if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, 0))
{
KConfig _cnf(url.path());
KConfigGroup cnf(&_cnf, QString("KSplash Theme: %1").arg(themeName) );
// Get theme information.
infoTxt = "<qt>";
if ( cnf.hasKey( "Name" ) )
infoTxt += i18n( "<b>Name:</b> %1", cnf.readEntry( "Name", i18nc( "Unknown name", "Unknown" ) ) ) + "<br />";
if ( cnf.hasKey( "Description" ) )
infoTxt += i18n( "<b>Description:</b> %1", cnf.readEntry( "Description", i18nc( "Unknown description", "Unknown" ) ) ) + "<br />";
if ( cnf.hasKey( "Version" ) )
infoTxt += i18n( "<b>Version:</b> %1", cnf.readEntry( "Version", i18nc( "Unknown version", "Unknown" ) ) ) + "<br />";
if ( cnf.hasKey( "Author" ) )
infoTxt += i18n( "<b>Author:</b> %1", cnf.readEntry( "Author", i18nc( "Unknown author", "Unknown" ) ) ) + "<br />";
if ( cnf.hasKey( "Homepage" ) )
infoTxt += i18n( "<b>Homepage:</b> %1", cnf.readEntry( "Homepage", i18nc( "Unknown homepage", "Unknown" ) ) ) + "<br />";
infoTxt += "</qt>";
QString pluginName( cnf.readEntry( "Engine", "KSplashX" ).trimmed() );
if( pluginName == "Simple"
|| pluginName == "None"
|| pluginName == "KSplashX"
|| pluginName == "KSplashQML"
)
enabled = true; // these are not plugins
else if ((KServiceTypeTrader::self()->query("KSplash/Plugin", QString("[X-KSplash-PluginName] == '%1'").arg(pluginName))).isEmpty())
{
enabled = false;
error = i18n("This theme requires the plugin %1 which is not installed.", pluginName);
}
else
enabled = true; // Hooray, there is at least one plugin which can handle this theme.
mEngineOfSelected = pluginName;
}
else
{
error = i18n("Could not load theme configuration file.");
}
}
mBtnTest->setEnabled(enabled && themeName != "None" );
mText->setHtml(infoTxt);
if (!enabled)
{
url.setPath( path + '/' + "Preview.png" );
if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, 0))
mPreview->setPixmap(QPixmap(url.path()));
else
mPreview->setText(i18n("(Could not load theme)"));
KMessageBox::sorry(this, error);
}
else
{
url.setPath( path + '/' + "Preview.png" );
if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, 0))
mPreview->setPixmap(QPixmap(url.path()));
else
mPreview->setText(i18n("No preview available."));
emit changed(true);
}
}
mBtnRemove->setEnabled( !path.isEmpty() && QFileInfo(path).isWritable());
}
//-----------------------------------------------------------------------------
void SplashInstaller::slotAdd()
{
static QString path;
if (path.isEmpty()) path = QDir::homePath();
KFileDialog dlg(path, "*.tgz *.tar.gz *.tar.bz2 theme.rc|" + i18n( "KSplash Theme Files" ), this);
dlg.setCaption(i18n("Add Theme"));
if (!dlg.exec())
return;
path = dlg.baseUrl().url();
addNewTheme(dlg.selectedUrl());
}
//-----------------------------------------------------------------------------
void SplashInstaller::slotFilesDropped(const KUrl::List &urls)
{
for(KUrl::List::ConstIterator it = urls.constBegin();
it != urls.end();
++it)
addNewTheme(*it);
}
//-----------------------------------------------------------------------------
int SplashInstaller::findTheme( const QString &theme )
{
// theme is untranslated, but the listbox contains translated items
QString tmp(i18n( theme.toUtf8() ));
int id = mThemesList->count()-1;
while (id >= 0)
{
if (mThemesList->item(id)->text() == tmp)
return id;
id--;
}
return 0;
}
//-----------------------------------------------------------------------------
void SplashInstaller::slotTest()
{
int i = mThemesList->currentRow();
if (i < 0)
return;
QString themeName = mThemesList->text2path[mThemesList->item(i)->text()];
int r = themeName.lastIndexOf('/');
if (r >= 0)
themeName = themeName.mid(r+1);
// special handling for none and simple splashscreens
qDebug() << "the engine is " << mEngineOfSelected << "for" << themeName;
if( mEngineOfSelected == "None" )
return;
else if( mEngineOfSelected == "KSplashX" )
{
if (QProcess::execute("ksplashx", QStringList() << themeName << "--test") != 0)
KMessageBox::error(this,i18n("Failed to successfully test the splash screen."));
return;
}
else if( mEngineOfSelected == "KSplashQML" )
{
if (QProcess::execute("ksplashqml", QStringList() << themeName << "--test") != 0)
KMessageBox::error(this,i18n("Failed to successfully test the splash screen."));
return;
}
else // KSplashML engines
{
if (QProcess::execute("ksplash", QStringList() << "--test" << "--theme" << themeName) != 0)
KMessageBox::error(this,i18n("Failed to successfully test the splash screen."));
}
}
//-----------------------------------------------------------------------------
#include "moc_installer.cpp"

View file

@ -1,90 +0,0 @@
/***************************************************************************
* Copyright Ravikiran Rajagopal 2003 *
* ravi@ee.eng.ohio-state.edu *
* Copyright (c) 1998 Stefan Taferner <taferner@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License (version 2) as *
* published by the Free Software Foundation. *
* *
***************************************************************************/
#ifndef SPLASHINSTALLER_H
#define SPLASHINSTALLER_H
#include <QMap>
#include <QPoint>
#include <QtGui/qevent.h>
#include <QtGui/qevent.h>
#include <QLabel>
#include <QtGui/qevent.h>
#include <klistwidget.h>
#include <kurl.h>
#include <QLabel>
#include <QTextEdit>
#include <QPushButton>
class ThemeListBox;
class SplashInstaller : public QWidget
{
Q_OBJECT
public:
SplashInstaller(QWidget *parent=0, const char *aName=0, bool aInit=false);
~SplashInstaller();
virtual void load();
virtual void save();
virtual void defaults();
Q_SIGNALS:
void changed( bool state );
protected Q_SLOTS:
virtual void slotAdd();
virtual void slotRemove();
virtual void slotTest();
virtual void slotSetTheme(int);
void slotFilesDropped(const KUrl::List &urls);
protected:
/** Scan Themes directory for available theme packages */
virtual void readThemesList();
/** add a theme to the list, returns the list index */
int addTheme(const QString &path, const QString &name);
void addNewTheme(const KUrl &srcURL);
int findTheme( const QString &theme );
private:
bool mGui;
ThemeListBox *mThemesList;
QString mEngineOfSelected;
QPushButton *mBtnAdd, *mBtnRemove, *mBtnTest;
QTextEdit *mText;
QLabel *mPreview;
};
class ThemeListBox: public KListWidget
{
Q_OBJECT
public:
ThemeListBox(QWidget *parent);
QMap<QString, QString> text2path;
Q_SIGNALS:
void filesDropped(const KUrl::List &urls);
protected:
void dragEnterEvent(QDragEnterEvent* event);
void dragMoveEvent(QDragMoveEvent* event);
void dropEvent(QDropEvent* event);
void mouseMoveEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e);
private:
QString mDragFile;
QPoint mOldPos;
};
#endif

View file

@ -1,226 +0,0 @@
[Desktop Entry]
Icon=preferences-system-splash
Exec=kcmshell4 ksplashthememgr
X-DocPath=kcontrol/splashscreen/index.html
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_ksplashthemes
X-KDE-ParentApp=kcontrol
X-KDE-System-Settings-Parent-Category=desktop-appearance
X-KDE-Weight=200
Name=Splash Screen
Name[af]=Spat Skerm
Name[ar]=شاشة البداية
Name[ast]=Pantalla Splash
Name[be]=Застаўка загрузкі
Name[be@latin]=Zastaŭka
Name[bg]=Начален екран
Name[bn]=
Name[br]=Skramm-degemer
Name[bs]=Uvodni ekran
Name[ca]=Pantalla de presentació
Name[ca@valencia]=Pantalla d'inici
Name[cs]=Úvodní obrazovka
Name[csb]=Ekran na przëwitanié
Name[cy]=Sgrîn Croeso
Name[da]=Splashskærm
Name[de]=Startbildschirm
Name[el]=Αρχική οθόνη
Name[en_GB]=Splash Screen
Name[eo]=Salutŝildo
Name[es]=Pantalla anunciadora
Name[et]=Käivitusekraan
Name[eu]=Harrerako pantaila
Name[fa]=رنگپاشی پرده
Name[fi]=Tervetuloruutu
Name[fr]=Écran de démarrage
Name[fy]=Begjinskerm
Name[ga]=Splancscáileán
Name[gl]=Pantalla de benvida
Name[gu]= િ
Name[he]=מצג פתיחה
Name[hi]=
Name[hne]=
Name[hr]=Pozdravni zaslon
Name[hsb]=Powitanka
Name[hu]=Nyitókép-témák
Name[ia]=Schermo de Splash
Name[id]=Layar Splash
Name[is]=Upphafsskjár
Name[kk]=Бейнепердесі
Name[km]=
Name[kn]=
Name[ko]=
Name[ku]=Splash Screen
Name[lt]=Pasveikinimo ekranas
Name[lv]=Šļaksta ekrāns
Name[mai]=
Name[mk]=Поздравен екран
Name[ml]=ി
Name[mr]=
Name[ms]=Splash Screen
Name[nb]=Velkomstbilde
Name[nds]=Startschirm
Name[ne]=
Name[nl]=Opstartscherm
Name[nn]=Velkomst­bilete
Name[pa]=
Name[pl]=Ekran powitalny
Name[pt]=Ecrã Inicial
Name[pt_BR]=Tela de apresentação
Name[ro]=Ecran de întîmpinare
Name[ru]=Заставка
Name[se]=Álgošearbma
Name[si]=
Name[sk]=Úvodná obrazovka
Name[sl]=Pozdravno okno
Name[sr]=Уводни екран
Name[sr@ijekavian]=Уводни екран
Name[sr@ijekavianlatin]=Uvodni ekran
Name[sr@latin]=Uvodni ekran
Name[sv]=Startskärm
Name[ta]= ி
Name[te]=
Name[tg]=Пардаи боркунии экран
Name[th]=
Name[tr]=Açılış ekranı
Name[ug]=مەرھابا ئېكرانى
Name[uk]=Вікно вітання
Name[uz]=Splesh oynasi
Name[uz@cyrillic]=Сплэш ойнаси
Name[vi]=Màn hình Chào mng
Name[wa]=Waitroûle d' enondaedje
Name[x-test]=xxSplash Screenxx
Name[zh_CN]=
Name[zh_TW]=
Comment=Manager for Splash Screen Themes
Comment[af]=Bestuurder vir Spat Skerm Temas
Comment[ar]=مدير سمِات شاشة البداية
Comment[ast]=Xestor pa los temes de la pantalla splash
Comment[be]=Кіраўнік заставак загрузкі
Comment[be@latin]=Kiraŭnik zastavak
Comment[bg]=Управление изгледа на началния екран
Comment[bn]=
Comment[br]=Merour evit gwiskadoù ar skramm degemer
Comment[bs]=Menadžer tema za uvodne ekrane
Comment[ca]=Gestor per als temes de la pantalla de presentació
Comment[ca@valencia]=Gestor per als temes de la pantalla d'inici
Comment[cs]=Správce motivů úvodních obrazovek
Comment[csb]=Menadżera témów ekranu na przëwitanié
Comment[cy]=Rheolydd Themau Sgriniau Croeso
Comment[da]=Håndtering for opstartskærme-temaer
Comment[de]=Verwaltung für Startbildschirmdesigns
Comment[el]=Διαχειριστής για θέματα αρχικής οθόνης
Comment[en_GB]=Manager for Splash Screen Themes
Comment[eo]=Administrilo por la salutŝildaj etosoj
Comment[es]=Gestor para los temas de la pantalla anunciadora
Comment[et]=Käivitusekraani teemade haldur
Comment[eu]=Harrerako pantailako gaien kudeatzailea
Comment[fa]=مدیر چهرههای رنگپاشی پرده
Comment[fi]=Tervetuloruudun asetukset
Comment[fy]=Temabehear foar begjinskerm
Comment[ga]=Bainisteoir Téamaí Splancscáileáin
Comment[gl]=Xestor dos temas da pantalla de benvida
Comment[gu]= િ
Comment[he]=מנהל ערכות־נושא למצג הפתיחה
Comment[hi]= ि
Comment[hne]=
Comment[hr]=Upravitelj tema pozdravnih zaslona
Comment[hsb]=Rjadowar za powitanske temy
Comment[hu]=A nyitókép témájának beállítása
Comment[ia]=Gerente pro themas de schermo Splash
Comment[id]=Manajer untuk Tema Layar Splash
Comment[is]=Stjórna þemum upphafsskjáa
Comment[kk]=Бастау бейнеперде нақыштарының менеджері
Comment[km]=
Comment[kn]= ಿಿಿ ()
Comment[ko]=
Comment[ku]=Gerînendetiya Dirbên Splash Screenê
Comment[lt]=Pasveikinimo ekrano temų tvarkytuvė
Comment[lv]=Šļakstekrāna tēmu pārvaldnieks
Comment[mai]= '
Comment[mk]=Менаџер на теми за поздравни екрани
Comment[ml]=ിി
Comment[mr]= ि
Comment[ms]=Pengurus untuk Tema Splash Screen
Comment[nb]=Behandler for velkomstbildetemaer
Comment[nds]=Startschirmmuster instellen
Comment[ne]= ि ि
Comment[nl]=Themabeheer voor opstartschermen
Comment[nn]=Handsamar for velkomstbilete
Comment[pa]=
Comment[pl]=Zarządca wystrojów ekranu powitalnego
Comment[pt]=Gestor de Temas do Ecrã Inicial
Comment[pt_BR]=Gerencia os temas da tela de apresentação
Comment[ro]=Administrator pentru tematicile imaginii de pornire a KDE
Comment[ru]=Управление темами экрана-заставки
Comment[se]=Álgošearbmafáttáid gieđahalli
Comment[si]=
Comment[sk]=Správca tém pre úvodnú obrazovku
Comment[sl]=Upravljalnik tem pozdravnih oken
Comment[sr]=Менаџер тема за уводне екране
Comment[sr@ijekavian]=Менаџер тема за уводне екране
Comment[sr@ijekavianlatin]=Menadžer tema za uvodne ekrane
Comment[sr@latin]=Menadžer tema za uvodne ekrane
Comment[sv]=Hanterare för startskärmsteman
Comment[ta]= ி
Comment[te]= ిి
Comment[tg]=Мудири мавзӯъҳои пардаи экран
Comment[th]=
Comment[tr]=Açılış Ekran Teması Yöneticisi
Comment[ug]=مەرھابا ئېكران ئۆرنەك باشقۇرغۇچ
Comment[uk]=Керування темами вікон вітання
Comment[uz]=Splesh oynasi uchun mavzularni moslash
Comment[uz@cyrillic]=Сплэш ойнаси учун мавзуларни мослаш
Comment[vi]=Trình qun lý sc thái cho màn hình chào mng
Comment[wa]=Manaedjeu po les tinmes del waitroûle d' enondaedje
Comment[x-test]=xxManager for Splash Screen Themesxx
Comment[zh_CN]=
Comment[zh_TW]=
X-KDE-Keywords=splash screen,splash theme,startup
X-KDE-Keywords[bs]=čuvar zaslona,blijesak teme,pokretanje
X-KDE-Keywords[ca]=pantalla de presentació,tema de presentació,engegar
X-KDE-Keywords[ca@valencia]=pantalla de benvinguda,tema de benvinguda,engegar
X-KDE-Keywords[da]=opstartsbillede,opstartsskærm,splash,opstartstema,opstart
X-KDE-Keywords[de]=Startbildschirm,Design
X-KDE-Keywords[el]=οθόνης εκκίνησης,θέμα εκκίνησης,έναρξη
X-KDE-Keywords[en_GB]=splash screen,splash theme,startup
X-KDE-Keywords[es]=pantalla de bienvenida,tema de bienvenida,inicio
X-KDE-Keywords[et]=tiitelkuva,tiitelkuva teema,käivitamine
X-KDE-Keywords[eu]=harrerako pantaila,harrerako gaia,abioa
X-KDE-Keywords[fi]=aloitusruutu,aloitusteema,käynnistys,käynnistysruutu,käynnistysteema,tervetuloruutu,tervetuloikkuna,tervetuloteema
X-KDE-Keywords[fr]=écran de démarrage, thème de l'écran de démarrage, démarrage
X-KDE-Keywords[ga]=splancscáileán,splancthéama,tosú,tosach
X-KDE-Keywords[gl]=pantalla de benvida, tema de benvida, inicio
X-KDE-Keywords[hu]=indítóképernyő,indítótéma,indulás
X-KDE-Keywords[ia]=schermo splash,thema de splash,initio
X-KDE-Keywords[kk]=splash screen,splash theme,startup
X-KDE-Keywords[km]=
X-KDE-Keywords[ko]=splash screen,splash theme,startup, , ,
X-KDE-Keywords[mr]= , ,
X-KDE-Keywords[nb]=velkomstbilde,velkomstbildetema,oppstart
X-KDE-Keywords[nds]=Startschirm,Startschirm-Muster,Hoochfohren
X-KDE-Keywords[nl]=splash-scherm,splash-thema,opstarten
X-KDE-Keywords[pa]= , ,,
X-KDE-Keywords[pl]=ekran powitalny,motyw ekranu powitalnego,uruchomienie
X-KDE-Keywords[pt]=ecrã inicial,tema inicial,arranque
X-KDE-Keywords[pt_BR]=tela inicial,tema inicial,inicialização
X-KDE-Keywords[ro]=ecran de întîmpinare,ecran de pornire,temă de întîmpinare,pornire
X-KDE-Keywords[ru]=splash screen,splash theme,startup,экранная заставка,тема заставки,запуск
X-KDE-Keywords[sk]=splash screen,splash theme,spustenie
X-KDE-Keywords[sl]=pozdravno okno,pozdravni zaslon,tema pozdravnega zaslona,zagon
X-KDE-Keywords[sr]=splash screen;splash theme;startup;уводни екран;уводна тема;покретање;
X-KDE-Keywords[sr@ijekavian]=splash screen;splash theme;startup;уводни екран;уводна тема;покретање;
X-KDE-Keywords[sr@ijekavianlatin]=splash screen;splash theme;startup;uvodni ekran;uvodna tema;pokretanje;
X-KDE-Keywords[sr@latin]=splash screen;splash theme;startup;uvodni ekran;uvodna tema;pokretanje;
X-KDE-Keywords[sv]=startskärm,starttema,start
X-KDE-Keywords[tr]=açılış ekranı,açılış ekranı teması,başlangıç,açılış,giriş
X-KDE-Keywords[uk]=splash screen,splash theme,startup,вікно,вітання,тема,запуск
X-KDE-Keywords[x-test]=xxsplash screen,splash theme,startupxx
X-KDE-Keywords[zh_CN]=splash screen,splash theme,startup,,,,,
X-KDE-Keywords[zh_TW]=splash screen,splash theme,startup
Categories=Qt;KDE;X-KDE-settings-looknfeel;

View file

@ -1,113 +0,0 @@
/***************************************************************************
* Copyright Ravikiran Rajagopal 2003 *
* ravi@ee.eng.ohio-state.edu *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License (version 2) as *
* published by the Free Software Foundation. *
* *
***************************************************************************/
#include <config-workspace.h>
#include <QLayout>
#include <QTabWidget>
//Added by qt3to4:
#include <QHBoxLayout>
#include <kaboutdata.h>
#include <kcmodule.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include "installer.h"
#include <KPluginFactory>
#include <KPluginLoader>
class KSplashThemeMgr : public KCModule
{
Q_OBJECT
public:
KSplashThemeMgr( QWidget *parent, const QVariantList &/*unused*/);
~KSplashThemeMgr();
QString quickHelp() const;
virtual void init();
virtual void save();
virtual void load();
virtual void defaults();
private:
SplashInstaller *mInstaller;
};
K_PLUGIN_FACTORY(KSplashThemeMgrFactory,
registerPlugin< KSplashThemeMgr>();
)
K_EXPORT_PLUGIN(KSplashThemeMgrFactory("ksplashthemes"))
// -----------------------------------------------------------------------------------------
KSplashThemeMgr::KSplashThemeMgr( QWidget *parent, const QVariantList &args)
: KCModule( KSplashThemeMgrFactory::componentData(), parent, args ), mInstaller(new SplashInstaller(this))
{
init();
#if 0
QHBoxLayout *box = new QHBoxLayout(this);
QTabWidget *tab = new QTabWidget(this); // There will be more tabs in the future.
box->addWidget(tab);
tab->addTab( mInstaller, i18n("&Theme Installer") );
#else
QHBoxLayout *box = new QHBoxLayout(this);
box->setMargin(0);
box->addWidget(mInstaller);
#endif
connect( mInstaller, SIGNAL(changed(bool)), SIGNAL(changed(bool)) );
KAboutData *about = new KAboutData( "kcmksplash"
, 0,ki18n("KDE splash screen theme manager")
,"0.1"
,KLocalizedString()
,KAboutData::License_GPL
,ki18n("(c) 2003 KDE developers") );
about->addAuthor(ki18n("Ravikiran Rajagopal"), KLocalizedString(), "ravi@ee.eng.ohio-state.edu");
about->addCredit(ki18n("Brian Ledbetter"), ki18n("Original KSplash/ML author"), "brian@shadowcom.net");
about->addCredit(ki18n("KDE Theme Manager authors" ), ki18n("Original installer code") );
// Once string freeze is over, replace second argument with "Icon"
about->addCredit(ki18n("Hans Karlsson"), KLocalizedString(), "karlsson.h@home.se" );
setAboutData(about);
//setButtons( KCModule::Default|KCModule::Apply );
}
KSplashThemeMgr::~KSplashThemeMgr()
{
// Do not delete the installer as it is now owned by the tab widget.
}
QString KSplashThemeMgr::quickHelp() const
{
return i18n("<h1>Splash Screen Theme Manager </h1> Install and view splash screen themes.");
}
void KSplashThemeMgr::init()
{
KGlobal::dirs()->addResourceType("ksplashthemes", "data", "ksplash/Themes");
}
void KSplashThemeMgr::save()
{
mInstaller->save();
}
void KSplashThemeMgr::load()
{
mInstaller->load();
}
void KSplashThemeMgr::defaults()
{
mInstaller->defaults();
}
#include "main.moc"

View file

@ -1 +0,0 @@
kde4_install_icons( ${KDE4_ICON_INSTALL_DIR} )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

View file

@ -68,9 +68,7 @@ Startkde also launches kcminit, which performs initialization done by kcontrol
modules. There are three kcminit phases, 0, 1 and 2, controlled
by X-KDE-Init-Phase= in the .desktop file, which defaults to 1. Phase 0 kcminit
modules should be only those that really need to be run early in the startup
process (and those should probably actually use kstartupconfig in startkde
to be done even before kdeinit and daemons). After executing phase 0
modules kcminit returns and waits.
process. After executing phase 0 modules kcminit returns and waits.
When ksmserver is launched, the first thing it does is launching
the window manager, as the WM is necessary before any windows are possibly

View file

@ -252,9 +252,6 @@ private:
KWorkSpace::ShutdownType pendingShutdown_sdtype;
KWorkSpace::ShutdownMode pendingShutdown_sdmode;
// ksplash interface
void upAndRunning( const QString& msg );
// sequential startup
int appsToStart;
int lastAppStarted;

View file

@ -98,7 +98,6 @@ void KSMServer::restoreSession( const QString &sessionName )
int count = configSessionGroup.readEntry( "count", 0 );
appsToStart = count;
upAndRunning( "ksmserver" );
connect( klauncherSignals, SIGNAL(autoStart0Done()), SLOT(autoStart0Done()));
connect( klauncherSignals, SIGNAL(autoStart1Done()), SLOT(autoStart1Done()));
connect( klauncherSignals, SIGNAL(autoStart2Done()), SLOT(autoStart2Done()));
@ -133,7 +132,6 @@ void KSMServer::startDefaultSession()
t.start();
#endif
sessionGroup = "";
upAndRunning( "ksmserver" );
connect( klauncherSignals, SIGNAL(autoStart0Done()), SLOT(autoStart0Done()));
connect( klauncherSignals, SIGNAL(autoStart1Done()), SLOT(autoStart1Done()));
connect( klauncherSignals, SIGNAL(autoStart2Done()), SLOT(autoStart2Done()));
@ -231,7 +229,6 @@ void KSMServer::autoStart0Done()
#ifdef KSMSERVER_STARTUP_DEBUG1
kDebug() << t.elapsed();
#endif
upAndRunning( "desktop" );
state = KcmInitPhase1;
kcminitSignals = new QDBusInterface("org.kde.kcminit", "/kcminit", "org.kde.KCMInit", QDBusConnection::sessionBus(), this );
if( !kcminitSignals->isValid()) {
@ -465,7 +462,6 @@ void KSMServer::finishStartup()
if( waitAutoStart2 || waitKcmInit2 )
return;
upAndRunning( "ready" );
#ifdef KSMSERVER_STARTUP_DEBUG1
kDebug() << t.elapsed();
#endif
@ -535,19 +531,6 @@ void KSMServer::resumeStartupInternal()
}
}
void KSMServer::upAndRunning( const QString& msg )
{
XEvent e;
e.xclient.type = ClientMessage;
e.xclient.message_type = XInternAtom( QX11Info::display(), "_KDE_SPLASH_PROGRESS", False );
e.xclient.display = QX11Info::display();
e.xclient.window = QX11Info::appRootWindow();
e.xclient.format = 8;
assert( strlen( msg.toLatin1()) < 20 );
strcpy( e.xclient.data.b, msg.toLatin1());
XSendEvent( QX11Info::display(), QX11Info::appRootWindow(), False, SubstructureNotifyMask, &e );
}
void KSMServer::restoreSubSession( const QString& name )
{
sessionGroup = "SubSession: " + name;

View file

@ -1,5 +0,0 @@
add_subdirectory( ksplashx )
add_subdirectory( elarun )
add_subdirectory( none )
add_subdirectory( ksplashqml )
add_subdirectory( default )

View file

@ -1,61 +0,0 @@
KDE Splash:
===========
The 'kcm' directory contains the control module for configuring the splashscreen.
Other directories contain various splash implementations:
- 'none' is no splashscreen
- 'simple' is a very simple and fast splashscreen showing a plain progressbar
- 'ksplashx' is a more capable implementation. See its README.
(the KDE3 implementation 'ksplashml' has been removed to /tags/unmaintained)
Theme format:
=============
This is a description of what is shared between the implementations (as needed
by the configuration module and startkde code deciding which implementation to use).
Implementations may have their own additions.
Themes are stored in $KDEDIRS/share/apps/ksplash/Themes/ in a directory specifying
the name of the theme. The directory must contain file 'Theme.rc' describing
the theme and should contain file 'Preview.png' with a preview image. Other contents
are implementation-dependent.
Theme.rc format:
================
The format is the usual ini-style format, e.g.:
[KSplash Theme: Simple]
Name = Simple Splash Screen
Description = Very Simple Optimized Splash Screen
Version = 1.0
Author = Lubos Lunak <l.lunak@kde.org>
Engine = Simple
The group name is [KSplash Theme: <theme name>]. Name, Description, Version and Author
are shown in the configuration module. Engine selects which splash implementation
the theme is for (currently 'None', 'Simple' and 'KSplashX' ). There may be futher
implementation-dependent data in Theme.rc .
Startup states:
===============
These are ksplash states:
- initial - at the beginning
- kded - after kded is running (dbus is ready, etc.)
- kcminit - after configuration setup
- ksmserver - session manager is started
- wm - window manager is running
- desktop - desktop (plasma) is running
- ready - session is ready (not fully actually, still e.g. restoring applications, but splash goes away)
Note however that these states should not be relied on too much:
- they do not represent very accurately what is actually going on
- states may be removed (they'll take 0 time and directly go to another state)
- states may be added
- states may be reordered (waiting for a later state and then a sooner state means the sooner state will take 0 time)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

View file

@ -1,42 +0,0 @@
SCALE ON
BACKGROUND_IMAGE 0 0 background.png
SCALE OFF
# the image is 390x234, make it centered, all icons need the same adjustment too
IMAGE_REL CC 0 0 CC rectangle.png
# these have their relative positions to the rectangle adjusted by -195,-117
# (i.e. half of the rectangle size)
# 3,32
ANIM_REL 1 CC -192 -50 LT 30 icon1_anim.png 85 1
WAIT_STATE kded
# 69,32
ANIM_REL 2 CC -126 -50 LT 30 icon2_anim.png 85 1
WAIT_STATE kcminit
# 135,32
ANIM_REL 3 CC -60 -50 LT 29 icon3_anim.png 85 1
WAIT_STATE ksmserver
# 201,32
ANIM_REL 4 CC 6 -50 LT 30 icon4_anim.png 85 1
WAIT_STATE wm
# 263,15
ANIM_REL 5 CC 68 -88 LT 30 icon5_anim.png 85 1
WAIT_STATE desktop
WAIT_STATE ready
# show the icons fully right before the splash goes away
STOP_ANIM 1
IMAGE_REL CC -192 -50 LT icon1.png
STOP_ANIM 2
IMAGE_REL CC -126 -50 LT icon2.png
STOP_ANIM 3
IMAGE_REL CC -60 -50 LT icon3.png
STOP_ANIM 4
IMAGE_REL CC 6 -50 LT icon4.png
STOP_ANIM 5
IMAGE_REL CC 68 -88 LT icon5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

View file

@ -1,12 +0,0 @@
install( FILES Preview.png Theme.rc DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Default )
install( FILES 1600x1200/description.txt 1600x1200/background.png 1600x1200/rectangle.png
1600x1200/icon1.png 1600x1200/icon2.png 1600x1200/icon3.png
1600x1200/icon4.png 1600x1200/icon5.png
1600x1200/icon1_anim.png 1600x1200/icon2_anim.png 1600x1200/icon3_anim.png
1600x1200/icon4_anim.png 1600x1200/icon5_anim.png
DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Default/1600x1200 )
install( FILES 1024x768/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Default/1024x768 )
install( FILES 1280x1024/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Default/1280x1024 )
install( FILES 1920x1080/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Default/1920x1080 )
install( FILES 1920x1200/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Default/1920x1200 )
install( FILES 800x600/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Default/800x600 )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View file

@ -1,9 +0,0 @@
[KSplash Theme: Default]
Name = Default Splash Screen
Description = Ariya Splash Screen
Version = 1.0
Author = Ivailo Monev <xakepa10@gmail.com>
Homepage = http://www.kde.org
# Theme behaviour settings.
Engine = KSplashX

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 KiB

View file

@ -1,42 +0,0 @@
SCALE ON
BACKGROUND_IMAGE 0 0 background.png
SCALE OFF
# the image is 390x234, make it centered, all icons need the same adjustment too
IMAGE_REL CC 0 0 CC rectangle.png
# these have their relative positions to the rectangle adjusted by -195,-117
# (i.e. half of the rectangle size)
# 3,32
ANIM_REL 1 CC -192 -50 LT 30 icon1_anim.png 85 1
WAIT_STATE kded
# 69,32
ANIM_REL 2 CC -126 -50 LT 30 icon2_anim.png 85 1
WAIT_STATE kcminit
# 135,32
ANIM_REL 3 CC -60 -50 LT 29 icon3_anim.png 85 1
WAIT_STATE ksmserver
# 201,32
ANIM_REL 4 CC 6 -50 LT 30 icon4_anim.png 85 1
WAIT_STATE wm
# 263,15
ANIM_REL 5 CC 68 -88 LT 30 icon5_anim.png 85 1
WAIT_STATE desktop
WAIT_STATE ready
# show the icons fully right before the splash goes away
STOP_ANIM 1
IMAGE_REL CC -192 -50 LT icon1.png
STOP_ANIM 2
IMAGE_REL CC -126 -50 LT icon2.png
STOP_ANIM 3
IMAGE_REL CC -60 -50 LT icon3.png
STOP_ANIM 4
IMAGE_REL CC 6 -50 LT icon4.png
STOP_ANIM 5
IMAGE_REL CC 68 -88 LT icon5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

View file

@ -1,13 +0,0 @@
install( FILES Preview.png Theme.rc DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Elarun )
install( FILES 1600x1200/description.txt 1600x1200/background.png 1600x1200/rectangle.png
1600x1200/icon1.png 1600x1200/icon2.png 1600x1200/icon3.png
1600x1200/icon4.png 1600x1200/icon5.png
1600x1200/icon1_anim.png 1600x1200/icon2_anim.png 1600x1200/icon3_anim.png
1600x1200/icon4_anim.png 1600x1200/icon5_anim.png
DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Elarun/1600x1200 )
install( FILES 1024x768/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Elarun/1024x768 )
install( FILES 1280x1024/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Elarun/1280x1024 )
install( FILES 1920x1080/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Elarun/1920x1080 )
install( FILES 1920x1200/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Elarun/1920x1200 )
install( FILES 600x400/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Elarun/600x400 )
install( FILES 800x600/background.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Elarun/800x600 )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

View file

@ -1,9 +0,0 @@
[KSplash Theme: Elarun]
Name = Elarun Splash Screen
Description = Air and Elarun Splash Screen
Version = 1.0
Author = Nuno Pinheiro <nuno@oxygen-icons.org>, Riccardo Iaconelli <riccardo@kde.org> and Marco Martin <notmart@gmail.com>
Homepage = http://www.kde.org
# Theme behaviour settings.
Engine = KSplashX

View file

@ -1,20 +0,0 @@
project(ksplashqml)
add_subdirectory(themes)
set(ksplashqml_SRCS
main.cpp
SplashApp.cpp
SplashWindow.cpp
)
add_executable(ksplashqml ${ksplashqml_SRCS})
target_link_libraries(ksplashqml
${X11_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTDECLARATIVE_LIBRARY}
${QT_QTGUI_LIBRARY}
)
install(TARGETS ksplashqml ${INSTALL_TARGETS_DEFAULT_ARGS})

View file

@ -1,152 +0,0 @@
/*
* Copyright (C) 2010 Ivan Cukic <ivan.cukic(at)kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* or (at your option) any later version, as published by the Free
* Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "SplashWindow.h"
#include "SplashApp.h"
#include <QDesktopWidget>
#include <QPixmap>
#include <QCursor>
#define TEST_STEP_INTERVAL 2000
SplashApp::SplashApp(Display * display, int &argc, char ** argv)
: QApplication(display, argc, argv),
m_display(display), m_stage(0),
m_testing(false)
{
m_kde_splash_progress = XInternAtom(m_display, "_KDE_SPLASH_PROGRESS", False);
m_testing = arguments().contains("--test");
m_desktop = QApplication::desktop();
screenGeometryChanged(m_desktop->screenCount());
setStage(1);
QPixmap cursor(32, 32);
cursor.fill(QColor(0, 0, 0, 0));
setOverrideCursor(QCursor(cursor));
XSelectInput(display, DefaultRootWindow(display), SubstructureNotifyMask);
if (m_testing) {
m_timer.start(TEST_STEP_INTERVAL, this);
}
connect(m_desktop, SIGNAL(screenCountChanged(int)), this, SLOT(screenGeometryChanged(int)));
connect(m_desktop, SIGNAL(workAreaResized(int)), this, SLOT(screenGeometryChanged(int)));
}
SplashApp::~SplashApp()
{
qDeleteAll(m_windows);
}
Display * SplashApp::display() const
{
return m_display;
}
void SplashApp::timerEvent(QTimerEvent * event)
{
if (event->timerId() == m_timer.timerId()) {
m_timer.stop();
setStage(m_stage + 1);
m_timer.start(TEST_STEP_INTERVAL, this);
}
}
bool SplashApp::x11EventFilter(XEvent * xe)
{
switch (xe->type) {
case ClientMessage:
if (xe->xclient.message_type == m_kde_splash_progress) {
char * message = xe->xclient.data.b;
int stage = -1;
if (strcmp(message, "initial") == 0 && m_stage < 0)
stage = 0; // not actually used
else if (strcmp(message, "kded") == 0 && m_stage < 1)
stage = 1;
else if (strcmp(message, "kcminit") == 0 && m_stage < 2)
stage = 2;
else if (strcmp(message, "ksmserver") == 0 && m_stage < 3)
stage = 3;
else if (strcmp(message, "wm") == 0 && m_stage < 4)
stage = 4;
else if (strcmp(message, "desktop") == 0 && m_stage < 5)
stage = 5;
setStage(stage);
}
}
return false;
}
int SplashApp::x11ProcessEvent(XEvent * xe)
{
Q_UNUSED(xe)
return 0;
}
void SplashApp::setStage(int stage)
{
if (m_stage == 6) {
QApplication::exit(EXIT_SUCCESS);
}
m_stage = stage;
foreach (SplashWindow *w, m_windows) {
w->setStage(stage);
}
}
void SplashApp::screenGeometryChanged(int)
{
int i;
// first iterate over all the new and old ones to set sizes appropriately
for (i = 0; i < m_desktop->screenCount(); i++) {
if (i < m_windows.count()) {
m_windows[i]->setGeometry(m_desktop->availableGeometry(i));
}
else {
SplashWindow *w = new SplashWindow(m_testing);
// When running into a view error at this point it means that the
// theme file could not be loaded. We want to exit as otherwise we
// are exposed to nullptr crashes.
if (w->status() == QDeclarativeView::Error) {
::exit(2);
}
w->setGeometry(m_desktop->availableGeometry(i));
w->setStage(m_stage);
w->show();
m_windows << w;
}
}
// then delete the rest, if there is any
m_windows.erase(m_windows.begin() + i, m_windows.end());
}
#include "moc_SplashApp.cpp"

View file

@ -1,60 +0,0 @@
/*
* Copyright (C) 2010 Ivan Cukic <ivan.cukic(at)kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* or (at your option) any later version, as published by the Free
* Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SPLASH_APP_H_
#define SPLASH_APP_H_
#include <QObject>
#include <QApplication>
#include <QBasicTimer>
#include <X11/Xlib.h>
class SplashWindow;
class SplashApp: public QApplication {
Q_OBJECT
public:
explicit SplashApp(Display * display, int &argc, char ** argv);
virtual ~SplashApp();
Display * display() const;
bool x11EventFilter(XEvent * xe);
int x11ProcessEvent(XEvent * xe);
protected:
void timerEvent(QTimerEvent * event);
void setStage(int stage);
private:
Display * m_display;
int m_stage;
Atom m_kde_splash_progress;
QList<SplashWindow *> m_windows;
bool m_testing;
QBasicTimer m_timer;
QDesktopWidget *m_desktop;
private slots:
void screenGeometryChanged(int newCount);
};
#endif // SPLASH_APP_H_

View file

@ -1,85 +0,0 @@
/*
* Copyright (C) 2010 Ivan Cukic <ivan.cukic(at)kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* or (at your option) any later version, as published by the Free
* Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "SplashWindow.h"
#include <QApplication>
#include <QDeclarativeContext>
#include <QtGui/qgraphicsitem.h>
#include <QtGui/qevent.h>
#include <QtGui/qevent.h>
#include <QTimer>
#include "SystemInfo.h"
SplashWindow::SplashWindow(bool testing)
: QDeclarativeView(),
m_stage(0),
m_testing(testing)
{
setWindowFlags(
Qt::FramelessWindowHint |
Qt::WindowStaysOnTopHint
);
if (m_testing) {
setWindowState(Qt::WindowFullScreen);
} else {
setWindowFlags(Qt::X11BypassWindowManagerHint);
}
rootContext()->setContextProperty("screenSize", size());
setSource(QUrl(themeDir(QApplication::arguments().at(1)) + "/main.qml"));
setStyleSheet("background: #000000; border: none");
setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_NoSystemBackground);
//be sure it will be eventually closed
//FIXME: should never be stuck
QTimer::singleShot(30000, this, SLOT(close()));
}
void SplashWindow::setStage(int stage)
{
m_stage = stage;
rootObject()->setProperty("stage", stage);
}
void SplashWindow::resizeEvent(QResizeEvent *event)
{
Q_UNUSED(event)
rootContext()->setContextProperty("screenSize", size());
centerOn(rootObject());
}
void SplashWindow::keyPressEvent(QKeyEvent *event)
{
QDeclarativeView::keyPressEvent(event);
if (m_testing && !event->isAccepted() && event->key() == Qt::Key_Escape) {
close();
}
}
void SplashWindow::mousePressEvent(QMouseEvent *event)
{
QDeclarativeView::mousePressEvent(event);
if (m_testing && !event->isAccepted()) {
close();
}
}

View file

@ -1,46 +0,0 @@
/*
* Copyright (C) 2010 Ivan Cukic <ivan.cukic(at)kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* or (at your option) any later version, as published by the Free
* Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SPLASH_WINDOW_H_
#define SPLASH_WINDOW_H_
#include <QDeclarativeView>
#include <QResizeEvent>
#include <QMouseEvent>
#include <QKeyEvent>
class SplashWindow: public QDeclarativeView
{
public:
SplashWindow(bool testing);
void setStage(int stage);
protected:
virtual void resizeEvent (QResizeEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
private:
int m_stage;
bool m_testing;
};
#endif // SPLASH_WINDOW_H_

View file

@ -1,60 +0,0 @@
/*
* Copyright (C) 2010 Ivan Cukic <ivan.cukic(at)kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* or (at your option) any later version, as published by the Free
* Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SYSTEM_INFO_H_
#define SYSTEM_INFO_H_
#include <stdlib.h>
#include <config-workspace.h>
#include <QDir>
#include <QString>
QString homeDir()
{
const char * kdehome = getenv("KDEHOME");
const char * home = getenv("HOME");
if (!kdehome || !kdehome[0]) {
return QString() + home + "/" + KDE_DEFAULT_HOME;
}
return kdehome;
}
QString systemDir()
{
return KDE_DATADIR;
}
QString themeDir(QString theme)
{
QString path;
path = homeDir() + "/share/apps/ksplash/Themes/" + theme;
if (!QDir(path).exists()) {
path = systemDir() + "/ksplash/Themes/" + theme;
}
return path;
}
#endif // SYSTEM_INFO_H_

View file

@ -1,68 +0,0 @@
/*
* Copyright (C) 2011 Ivan Cukic <ivan.cukic(at)kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* or (at your option) any later version, as published by the Free
* Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "SplashApp.h"
#include <iostream>
#include <unistd.h>
#include <X11/Xlib.h>
#include <unistd.h>
int main(int argc, char **argv)
{
bool test = false;
bool printPid = false;
for (int i = 1; i < argc; i++) {
if (strcmp("--test", argv[i]) == 0)
test = true;
else if (strcmp("--pid", argv[i]) == 0)
printPid = true;
}
// lets fork and all that...
if (!test) {
pid_t pid = fork();
if (pid < -1) {
return -1;
}
if (pid != 0) {
// this is the parent process, returning pid of the fork
if (printPid) {
std::cout << pid << std::endl;
}
return 0;
}
// close stdin,stdout,stderr, otherwise startkde will block
close(0);
close(1);
close(2);
}
Display * display = XOpenDisplay(NULL);
SplashApp app(display, argc, argv);
return app.exec();
}

View file

@ -1 +0,0 @@
add_subdirectory(Minimalistic)

View file

@ -1,7 +0,0 @@
install(FILES Preview.png Theme.rc main.qml DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Minimalistic)
install(FILES images/kdegear.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Minimalistic/images)
install(FILES images/kdeletter.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Minimalistic/images)
install(FILES images/kdemask.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Minimalistic/images)
install(FILES images/kdelogo.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Minimalistic/images)
install(FILES images/kdelogo-contrast.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksplash/Themes/Minimalistic/images)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -1,9 +0,0 @@
[KSplash Theme: Minimalistic]
Name = Minimalistic splash screen
Description = Animated KDE logo on a black background
Version = 1.0
Author = Ivan Cukic <ivan.cukic at kde.org>
Homepage = http://www.kde.org
# Theme behaviour settings.
Engine = KSplashQML

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,016 B

View file

@ -1,181 +0,0 @@
/* vim:set foldenable foldmethod=marker:
*
* Copyright (C) 2011 Ivan Cukic <ivan.cukic(at)kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* or (at your option) any later version, as published by the Free
* Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 1.0
Item {
id: main
width: screenSize.width
height: screenSize.height
// width: 300
// height: 300
/* property declarations --------------------------{{{ */
property int stage
property int iconSize: (screenSize.width <= 1024) ? 64 : 128
/* }}} */
/* signal declarations ----------------------------{{{ */
/* }}} */
/* JavaScript functions ---------------------------{{{ */
onStageChanged: {
if (stage == 1) {
background.opacity = 1
gear.opacity = 0.5
}
if (stage == 2) {
gear.opacity = 1
mask.opacity = 1
letter.opacity = 1
}
if (stage == 3) {
}
if (stage == 4) {
}
if (stage == 5) {
logo.opacity = 1
}
if (stage == 6) {
}
}
/* }}} */
/* object properties ------------------------------{{{ */
/* }}} */
/* child objects ----------------------------------{{{ */
Rectangle {
color: "black"
anchors.fill: parent
}
Rectangle {
id: background
gradient: Gradient {
GradientStop { position: 0.0; color: "#55555f" }
GradientStop { position: 1.0; color: "#000000" }
}
anchors {
top: parent.top
left: parent.left
right: parent.right
}
height: gear.y - 32
opacity: 0
Behavior on opacity { NumberAnimation { duration: 1000; easing { type: Easing.InOutQuad } } }
}
Image {
id: gear
height: iconSize
width: iconSize
smooth: true
x: (parent.width - width) / 2
y: (parent.height - height) / 2
source: "images/kdegear.png"
opacity: 0
Behavior on opacity { NumberAnimation { duration: 1000; easing { type: Easing.InOutQuad } } }
NumberAnimation {
id: animateRotation
target: gear
properties: "rotation"
from: 0
to: 360
duration: 5000
loops: Animation.Infinite
running: true
}
}
Image {
id: mask
height: iconSize
width: iconSize
smooth: true
x: (parent.width - width) / 2
y: (parent.height - height) / 2
source: "images/kdemask.png"
opacity: 0
Behavior on opacity { NumberAnimation { duration: 1000; easing { type: Easing.InOutQuad } } }
}
Image {
id: letter
height: iconSize
width: iconSize
smooth: true
x: (parent.width - width) / 2
y: (parent.height - height) / 2
source: "images/kdeletter.png"
opacity: 0
Behavior on opacity { NumberAnimation { duration: 1000; easing { type: Easing.InOutQuad } } }
}
Image {
id: logo
height: iconSize
width: iconSize
smooth: true
x: (parent.width - width) / 2
y: (parent.height - height) / 2 - 1
source: "images/kdelogo-contrast.png"
opacity: 0
Behavior on opacity { NumberAnimation { duration: 1000; easing { type: Easing.InOutQuad } } }
}
/* }}} */
/* stages -----------------------------------------{{{ */
/* }}} */
/* transitions ------------------------------------{{{ */
/* }}} */
}

View file

@ -1,52 +0,0 @@
project(ksplashx)
add_subdirectory(scale)
add_subdirectory(utils)
include_directories(
${PNG_INCLUDE_DIRS}
)
include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("
int main() { __asm__(\"pxor %mm0, %mm0\") ; }"
X86_MMX_FOUND
)
########### next target ###############
set(ksplashx_SRCS
main.cpp
qglobal.cpp
qpngio.cpp
qimage.cpp
qsize.cpp
pixmap.cpp
qcolor.cpp
qcolor_x11.cpp
qcolor_p.cpp
x11_defs.cpp
defs.cpp
splash.cpp
qrect.cpp
kcpuinfo.cpp
scale.cpp
)
# this doesn't work on x86_64 so it needs somebody who knows assembly enough to fix it
if(X86_MMX_FOUND AND "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i[3-6]86")
enable_language(ASM)
set(ksplashx_SRCS
${ksplashx_SRCS}
asm_scale.S
)
add_definitions(-DHAVE_X86_MMX)
endif()
add_executable(ksplashx ${ksplashx_SRCS})
target_link_libraries(ksplashx ${X11_LIBRARIES} ${PNG_LIBRARIES})
if(X11_Xinerama_FOUND)
target_link_libraries(ksplashx ${X11_Xinerama_LIB})
endif()
install(TARGETS ksplashx ${INSTALL_TARGETS_DEFAULT_ARGS})

View file

@ -1,12 +0,0 @@
This work, as a whole, is licensed under the terms of the
GNU General Public License version 2 as published by the Free Software
Foundation.
Many files are based on sources of the Qt GUI Toolkit. Please see their
headers for futher information.
All contributions, either in files based on Qt or in original files,
are, and are required to be, compatible with the terms of the GNU General
Public License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. Please
see headers of the individual files for further information.

View file

@ -1,117 +0,0 @@
This is a splashscreen which basically depends only on libX11 and libpng.
It includes few sources from Qt which have been modified to work without
QApplication. Due to almost no link dependencies and no QApplication
initialization this splashscreen has a very fast startup.
Please see file LICENSE for the licensing terms.
LIMITATIONS:
This implementation can only draw images and animations. This means that
e.g. texts need to be pre-rendered into images. i18n support is however
provided by mimicking KLocale's mechanism for localizing non-text resources.
USAGE:
ksplashx <theme> [--test]
NOTES:
Add a comment in description.txt and update it everytime you change anything.
Caching of the splash is done and the timestamp of description.txt is used.
Alternatively, update at least Theme.rc.
New images are alphablended (if needed) with what's in the splash window
and then they replace what's at their position. Animations have all frames
alphablended (if needed) with what's in the splash window but they do not
replace window contents permanently.
In a theme directory there can be a subdirectory for each screen resolution
named the same like the resolution (e.g. "1600x1200"). A best match is searched
for the active screen resolution. It should be usually enough to have just
one set, e.g. 1600x1200; especially with SCALE OFF.
Low color screen depths are supported, with bpp <= 8 a directory called with
"-locolor" (e.g. "1600x1200-locolor") appended is always searched first.
FORMAT:
# comments start with #
# commands are case-sensitive
# whether to enable scaling (SCALE ON) or not (SCALE OFF) to fit current screen resolution
# if enabled, all positions and sizes are scaled by ratio between their primary resolution size
# and current resolution size (e.g. a 80x80 image at 100,0 in 1600x1200
# is scaled to 40x40 at 50,0 for 800x600)
# defaults to ON, it's suggested to always explicitly specify
# it is possible to toggle scaling also several times (e.g. scale background image, not scale the rest)
SCALE ON/OFF
# like SCALE, for only one dimension
SCALEX ON/OFF
SCALEY ON/OFF
# x y w h - geometry of the splash window (screen size by default)
# if x or y are negative, they're relative to the right/bottom side
GEOMETRY x y w h
# geometry of the splash window relatively to the screen
# relative position is specified as x_rel,y_rel offset of reference point of the window
# to reference point of the screen
# reference point is specified as two letters, first being X, second being Y:
# L - left, R - right, C - center, T - top, B - bottom
# e.g. GEOMETRY_REL LC 100 0 CC places window's center 100 pixels to the right of middle of left screen edge
GEOMETRY_REL screen_ref x_rel y_rel window_ref w h
# color to fill the window with (this command also clears the whole window)
# not necessary if image(s) will fill the area entirely
BACKGROUND color
# place an image called name (no path, include extension) at position x,y
IMAGE x y name
# Same as image but this image is painted on every screen in xinerama setups
BACKGROUND_IMAGE x y name
# place an image called name (no path, include extension) at relative position
# see description of GEOMETRY_REL for screen_ref, x_rel, y_rel and image_ref (=window_ref)
IMAGE_REL screen_ref x_rel y_xrel image_ref name
# place animation from file 'name' at position x,y, id is 'number'
# animation is specified in a non-animated file as a sequence of images in rows,
# images wrap at 10 columns
# image contains 'frames' frames and there's 'delay' pause between each frame
# the animation repeats 'repeat' times, with 0 for infinite (optional field defaulting to 0)
ANIM number x y frames name delay [repeat]
# place animation
# see description of ANIM for number, frames, name, delay and repeat
# see description of GEOMETRY_REL for screen_ref, x_rel, y_rel and image_ref (=window_ref)
ANIM_REL number screen_ref x_rel y_rel image_ref frames name delay [repeat]
# stop animation with the given id
# this also clears the animation from the window
STOP_ANIM number
# wait until the specified ksplash state
# see the splash toplevel README file (one directory up)
# specifying "ready" means waiting until whole startup is complete (should be used at the very end)
WAIT_STATE state
HOW TO CREATE ANIM PNG FILE:
Since there's only PNG support, animation have to be prepared as separate frames.
In order to improve performance, all frames are put together in one big PNG file.
Steps:
1. Animation must be prepared as a list of images.
2. In the utils/ directory there's prepareanim utility. Run it as
./prepareanim <frame images>
where
frame images - list of images for animation in their order
3. File result.png will be created.
It is also possible to create the resulting PNG manually - frames are added
in rows, rows wrap at 10th frame.

View file

@ -1,795 +0,0 @@
#define PR_(foo) __##foo
#define PT_(foo,func) __##foo,func
#define SIZE(sym) \
.__end_##sym:; \
.size __##sym,.__end_##sym-__##sym; \
.align 8;
/*\
|*| MMX assembly scaling routine for Imlib2
|*| Written by Willem Monsuwe <willem@stack.nl>
\*/
.text
.align 8
.globl PR_(mimageScale_mmx_AARGBA)
/* .type PT_(mimageScale_mmx_AARGBA,@function) */
/*\ Prototype: __mimageScale_mmx_AARGBA(ImlibScaleInfo *isi, DATA32 *dest,
|*| int dxx, int dyy, int dx, int dy, int dw, int dh, int dow, int sow)
\*/
#define isi 8(%ebp)
#define dest 12(%ebp)
#define dxx 16(%ebp)
#define dyy 20(%ebp)
#define dx 24(%ebp)
#define dy 28(%ebp)
#define dw 32(%ebp)
#define dh 36(%ebp)
#define dow 40(%ebp)
#define sow 44(%ebp)
/*\ Local variables that didn't fit in registers \*/
#define y -4(%ebp)
#define yp -8(%ebp)
#define yap -12(%ebp)
#define xp -16(%ebp)
#define xap -20(%ebp)
#define Cx -24(%ebp)
#define Mx -28(%ebp)
#define Cy -32(%ebp)
#define My -36(%ebp)
#define sow_4 -40(%ebp)
/*\ When %edx points to ImlibScaleInfo, these are the members \*/
#define xpoints (%edx)
#define ypoints 4(%edx)
#define xapoints 8(%edx)
#define yapoints 12(%edx)
#define xup_yup 16(%edx)
PR_(mimageScale_mmx_AARGBA):
pushl %ebp
movl %esp, %ebp
subl $40, %esp
pushl %ebx
pushl %ecx
pushl %edx
pushl %edi
pushl %esi
movl isi, %edx
/*\ Check (dw > 0) && (dh > 0) \*/
cmpl $0, dw
jle .scale_leave
cmpl $0, dh
jle .scale_leave
/*\ X-based array pointers point to the end; we're looping up to 0 \*/
/*\ %edi = dest + dow * dy + dx + dw \*/
movl dow, %eax
imull dy, %eax
addl dx, %eax
addl dw, %eax
movl dest, %edi
leal (%edi, %eax, 4), %edi
/*\ xp = xpoints + dxx + dw \*/
movl dxx, %ebx
addl dw, %ebx
movl xpoints, %eax
leal (%eax, %ebx, 4), %eax
movl %eax, xp
/*\ xap = xapoints + dxx + dw \*/
movl xapoints, %eax
leal (%eax, %ebx, 4), %eax
movl %eax, xap
/*\ y = dh \*/
movl dh, %eax
movl %eax, y
/*\ yp = ypoints + dyy \*/
movl dyy, %ebx
movl ypoints, %eax
leal (%eax, %ebx, 4), %eax
movl %eax, yp
/*\ yap = yapoints + dyy \*/
movl yapoints, %eax
leal (%eax, %ebx, 4), %eax
movl %eax, yap
pxor %mm7, %mm7
/*\ Test xup bit \*/
movl xup_yup, %eax
sarl $1, %eax
jnc .scale_x_down
.scale_x_up:
/*\ Test yup bit \*/
sarl $1, %eax
jnc .scale_x_up_y_down
/*\ Scaling up both ways \*/
.scale_x_up_y_up:
movl sow, %ebx
.up_up_loop_y:
/*\ x = -dw \*/
movl dw, %ecx
negl %ecx
/*\ %eax = *yap << 4 \*/
movl yap, %eax
movl (%eax), %eax
sall $4, %eax
jz .up_up_yap_0
movd %eax, %mm1
punpcklwd %mm1, %mm1
punpckldq %mm1, %mm1
.up_up_loop1_x:
/*\ %esi = *yp + xp[x] \*/
movl yp, %eax
movl (%eax), %esi
movl xp, %eax
movl (%eax, %ecx, 4), %eax
leal (%esi, %eax, 4), %esi
/*\ %eax = xap[x] << 4 \*/
movl xap, %eax
movl (%eax, %ecx, 4), %eax
sall $4, %eax
jz .up_up_xap_0
/*\ %mm0 = xap[x] << 4 \*/
movd %eax, %mm0
punpcklwd %mm0, %mm0
punpckldq %mm0, %mm0
/*\ Load and unpack four pixels in parralel
|*| %mm2 = ptr[0], %mm3 = ptr[1]
|*| %mm4 = ptr[sow], %mm5 = ptr[sow + 1]
\*/
movq (%esi), %mm2
movq (%esi, %ebx, 4), %mm4
movq %mm2, %mm3
movq %mm4, %mm5
punpcklbw %mm7, %mm2
punpcklbw %mm7, %mm4
punpckhbw %mm7, %mm3
punpckhbw %mm7, %mm5
/*\ X interpolation: r = l + (r - l) * xap \*/
psubw %mm2, %mm3
psubw %mm4, %mm5
psllw $4, %mm3
psllw $4, %mm5
pmulhw %mm0, %mm3
pmulhw %mm0, %mm5
paddw %mm2, %mm3
paddw %mm4, %mm5
/*\ Now %mm3 = I(ptr[0], ptr[1]), %mm5 = I(ptr[sow], ptr[sow + 1]) \*/
jmp .up_up_common
.up_up_xap_0:
/*\ Load and unpack two pixels
|*| %mm3 = ptr[0], %mm5 = ptr[sow]
\*/
movd (%esi), %mm3
movd (%esi, %ebx, 4), %mm5
punpcklbw %mm7, %mm3
punpcklbw %mm7, %mm5
.up_up_common:
/*\ Y interpolation: d = u + (d - u) * yap \*/
psubw %mm3, %mm5
psllw $4, %mm5
pmulhw %mm1, %mm5
paddw %mm3, %mm5
packuswb %mm5, %mm5
movd %mm5, (%edi, %ecx, 4)
/*\ while (++x) \*/
incl %ecx
jnz .up_up_loop1_x
jmp .up_up_yap_end
.up_up_yap_0:
.up_up_loop2_x:
/*\ %esi = *yp + xp[x] \*/
movl yp, %eax
movl (%eax), %esi
movl xp, %eax
movl (%eax, %ecx, 4), %eax
leal (%esi, %eax, 4), %esi
/*\ %eax = xap[x] << 4 \*/
movl xap, %eax
movl (%eax, %ecx, 4), %eax
sall $4, %eax
jz .up_up_0
/*\ %mm0 = xap[x] << 4 \*/
movd %eax, %mm0
punpcklwd %mm0, %mm0
punpckldq %mm0, %mm0
/*\ Load and unpack two pixels in parralel
|*| %mm2 = ptr[0], %mm3 = ptr[1]
\*/
movq (%esi), %mm2
movq %mm2, %mm3
punpcklbw %mm7, %mm2
punpckhbw %mm7, %mm3
/*\ X interpolation: r = l + (r - l) * xap \*/
psubw %mm2, %mm3
psllw $4, %mm3
pmulhw %mm0, %mm3
paddw %mm2, %mm3
packuswb %mm3, %mm3
movd %mm3, (%edi, %ecx, 4)
jmp .up_up_1
.up_up_0:
/*\ dptr[x] = *sptr \*/
movl (%esi), %eax
movl %eax, (%edi, %ecx, 4)
.up_up_1:
incl %ecx
jnz .up_up_loop2_x
.up_up_yap_end:
/*\ dptr += dow \*/
movl dow, %eax
leal (%edi, %eax, 4), %edi
/*\ yap++; yp++ \*/
addl $4, yap
addl $4, yp
/*\ while (y--) \*/
decl y
jnz .up_up_loop_y
jmp .scale_leave
/*\ Scaling down vertically \*/
.scale_x_up_y_down:
/*\ sow_4 = sow * 4 \*/
movl sow, %eax
sall $2, %eax
movl %eax, sow_4
.up_down_loop_y:
/*\ Setup My and Cy \*/
movl yap, %eax
movzwl (%eax), %ebx
movl %ebx, My
movzwl 2(%eax), %eax
movl %eax, Cy
/*\ mm4 = Cy \*/
movd %eax, %mm4
punpcklwd %mm4, %mm4
punpckldq %mm4, %mm4
/*\ mm5 = My \*/
movd %ebx, %mm5
punpcklwd %mm5, %mm5
punpckldq %mm5, %mm5
/*\ x = -dw \*/
movl dw, %ecx
negl %ecx
.up_down_loop_x:
/*\ %esi = *yp + xp[x] \*/
movl yp, %eax
movl (%eax), %esi
movl xp, %eax
movl (%eax, %ecx, 4), %eax
leal (%esi, %eax, 4), %esi
movl %esi, %eax
/*\ v = (*p * My) >> 10 \*/
movd (%eax), %mm0
punpcklbw %mm7, %mm0
psllw $6, %mm0
pmulhw %mm5, %mm0
/*\ i = 0x4000 - My \*/
movl $0x4000, %ebx
subl My, %ebx
jbe 5f
jmp 2f
1:
/*\ p += sow; v += (*p * Cy) >> 10 \*/
addl sow_4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $6, %mm1
pmulhw %mm4, %mm1
paddw %mm1, %mm0
/*\ i -= Cy; while (i > Cy) \*/
subl Cy, %ebx
2:
cmpl Cy, %ebx
jg 1b
/*\ mm6 = i \*/
movd %ebx, %mm6
punpcklwd %mm6, %mm6
punpckldq %mm6, %mm6
/*\ p += sow; v += (*p * i) >> 10 \*/
addl sow_4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $6, %mm1
pmulhw %mm6, %mm1
paddw %mm1, %mm0
5:
/*\ %eax = xap[x] << 5 \*/
movl xap, %eax
movl (%eax, %ecx, 4), %eax
sall $5, %eax
jz 6f
/*\ mm3 = xap[x] << 5 \*/
movd %eax, %mm3
punpcklwd %mm3, %mm3
punpckldq %mm3, %mm3
/*\ p + 1 \*/
movl %esi, %eax
addl $4, %eax
/*\ vv = (*p * My) >> 10 \*/
movd (%eax), %mm2
punpcklbw %mm7, %mm2
psllw $6, %mm2
pmulhw %mm5, %mm2
/*\ i = 0x4000 - My \*/
movl $0x4000, %ebx
subl My, %ebx
jbe 5f
jmp 2f
1:
/*\ p += sow; vv += (*p * Cy) >> 10 \*/
addl sow_4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $6, %mm1
pmulhw %mm4, %mm1
paddw %mm1, %mm2
/*\ i -= Cy; while (i > Cy) \*/
subl Cy, %ebx
2:
cmpl Cy, %ebx
jg 1b
/*\ p += sow; v += (*p * i) >> 10 \*/
addl sow_4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $6, %mm1
pmulhw %mm6, %mm1
paddw %mm1, %mm2
5:
/*\ v = v + (vv - v) * xap \*/
psubw %mm0, %mm2
psllw $3, %mm2
pmulhw %mm3, %mm2
paddw %mm2, %mm0
6:
/*\ dest[x] = v >> 4 \*/
psrlw $4, %mm0
packuswb %mm0, %mm0
movd %mm0, (%edi, %ecx, 4)
/*\ while (++x) \*/
incl %ecx
jnz .up_down_loop_x
/*\ dptr += dow \*/
movl dow, %eax
leal (%edi, %eax, 4), %edi
/*\ yap++; yp++ \*/
addl $4, yap
addl $4, yp
/*\ while (y--) \*/
decl y
jnz .up_down_loop_y
jmp .scale_leave
.scale_x_down:
/*\ Test yup bit \*/
sarl $1, %eax
jnc .scale_x_down_y_down
/*\ Scaling down horizontally \*/
.scale_x_down_y_up:
/*\ sow_4 = sow * 4 \*/
movl sow, %eax
sall $2, %eax
movl %eax, sow_4
.down_up_loop_y:
/*\ %eax = *yap << 5 \*/
movl yap, %eax
movl (%eax), %eax
sall $5, %eax
/*\ mm3 = *yap << 5 \*/
movd %eax, %mm3
punpcklwd %mm3, %mm3
punpckldq %mm3, %mm3
/*\ x = -dw \*/
movl dw, %ecx
negl %ecx
.down_up_loop_x:
/*\ %esi = *yp + xp[x] \*/
movl yp, %eax
movl (%eax), %esi
movl xp, %eax
movl (%eax, %ecx, 4), %eax
leal (%esi, %eax, 4), %esi
/*\ Setup Mx and Cx \*/
movl xap, %eax
movzwl (%eax, %ecx, 4), %ebx
movl %ebx, Mx
movzwl 2(%eax, %ecx, 4), %eax
movl %eax, Cx
/*\ mm4 = Cx \*/
movd %eax, %mm4
punpcklwd %mm4, %mm4
punpckldq %mm4, %mm4
/*\ mm5 = Mx \*/
movd %ebx, %mm5
punpcklwd %mm5, %mm5
punpckldq %mm5, %mm5
movl %esi, %eax
/*\ v = (*p * Mx) >> 10 \*/
movd (%eax), %mm0
punpcklbw %mm7, %mm0
psllw $6, %mm0
pmulhw %mm5, %mm0
/*\ i = 0x4000 - Mx \*/
movl $0x4000, %ebx
subl Mx, %ebx
jbe 5f
jmp 2f
1:
/*\ p += sow; v += (*p * Cx) >> 10 \*/
addl $4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $6, %mm1
pmulhw %mm4, %mm1
paddw %mm1, %mm0
/*\ i -= Cx; while (i > Cx) \*/
subl Cx, %ebx
2:
cmpl Cx, %ebx
jg 1b
/*\ mm6 = i \*/
movd %ebx, %mm6
punpcklwd %mm6, %mm6
punpckldq %mm6, %mm6
/*\ p += sow; v += (*p * i) >> 10 \*/
addl $4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $6, %mm1
pmulhw %mm6, %mm1
paddw %mm1, %mm0
5:
movd %mm3, %eax
testl %eax, %eax
jz 6f
/*\ p + sow \*/
movl %esi, %eax
addl sow_4, %eax
/*\ vv = (*p * Mx) >> 10 \*/
movd (%eax), %mm2
punpcklbw %mm7, %mm2
psllw $6, %mm2
pmulhw %mm5, %mm2
/*\ i = 0x4000 - Mx \*/
movl $0x4000, %ebx
subl Mx, %ebx
jbe 5f
jmp 2f
1:
/*\ p += sow; vv += (*p * Cx) >> 10 \*/
addl $4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $6, %mm1
pmulhw %mm4, %mm1
paddw %mm1, %mm2
/*\ i -= Cx; while (i > Cx) \*/
subl Cx, %ebx
2:
cmpl Cx, %ebx
jg 1b
/*\ p += sow; v += (*p * i) >> 10 \*/
addl $4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $6, %mm1
pmulhw %mm6, %mm1
paddw %mm1, %mm2
5:
/*\ v = v + (vv - v) * yap \*/
psubw %mm0, %mm2
psllw $3, %mm2
pmulhw %mm3, %mm2
paddw %mm2, %mm0
6:
/*\ dest[x] = v >> 4 \*/
psrlw $4, %mm0
packuswb %mm0, %mm0
movd %mm0, (%edi, %ecx, 4)
/*\ while (++x) \*/
incl %ecx
jnz .down_up_loop_x
/*\ dptr += dow \*/
movl dow, %eax
leal (%edi, %eax, 4), %edi
/*\ yap++; yp++ \*/
addl $4, yap
addl $4, yp
/*\ while (y--) \*/
decl y
jnz .down_up_loop_y
jmp .scale_leave
/*\ Scaling down both ways \*/
.scale_x_down_y_down:
/*\ sow_4 = sow * 4 \*/
movl sow, %eax
sall $2, %eax
movl %eax, sow_4
.down_down_loop_y:
/*\ Setup My and Cy \*/
movl yap, %eax
movzwl (%eax), %ebx
movl %ebx, My
movzwl 2(%eax), %eax
movl %eax, Cy
/*\ x = -dw \*/
movl dw, %ecx
negl %ecx
.down_down_loop_x:
/*\ %esi = *yp + xp[x] \*/
movl yp, %eax
movl (%eax), %esi
movl xp, %eax
movl (%eax, %ecx, 4), %eax
leal (%esi, %eax, 4), %esi
/*\ Setup Mx and Cx \*/
movl xap, %eax
movzwl (%eax, %ecx, 4), %ebx
movl %ebx, Mx
movzwl 2(%eax, %ecx, 4), %eax
movl %eax, Cx
/*\ mm3 = Cx \*/
movd %eax, %mm3
punpcklwd %mm3, %mm3
punpckldq %mm3, %mm3
/*\ mm5 = Mx \*/
movd %ebx, %mm5
punpcklwd %mm5, %mm5
punpckldq %mm5, %mm5
/*\ p = sptr; v = (*p * Mx) >> 9 \*/
movl %esi, %eax
movd (%eax), %mm0
punpcklbw %mm7, %mm0
psllw $7, %mm0
pmulhw %mm5, %mm0
/*\ i = 0x4000 - Mx \*/
movl $0x4000, %ebx
subl Mx, %ebx
jbe 5f
jmp 2f
1:
/*\ v += (*++p * Cx) >> 9 \*/
addl $4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $7, %mm1
pmulhw %mm3, %mm1
paddw %mm1, %mm0
/*\ i -= Cx; while (i > Cx) \*/
subl Cx, %ebx
2:
cmpl Cx, %ebx
jg 1b
/*\ mm6 = i \*/
movd %ebx, %mm6
punpcklwd %mm6, %mm6
punpckldq %mm6, %mm6
/*\ v += (*++p * i) >> 9 \*/
addl $4, %eax
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $7, %mm1
pmulhw %mm6, %mm1
paddw %mm1, %mm0
5:
/*\ v *= My \*/
movd My, %mm4
punpcklwd %mm4, %mm4
punpckldq %mm4, %mm4
psllw $2, %mm0
pmulhw %mm4, %mm0
/*\ j = 0x4000 - My \*/
movl $0x4000, %edx
subl My, %edx
jbe 6f
jmp 4f
3:
/*\ sptr += sow; p = sptr \*/
addl sow_4, %esi
movl %esi, %eax
/*\ vx = (*p * Mx) >> 9 \*/
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $7, %mm1
pmulhw %mm5, %mm1
/*\ i = 0x4000 - Mx \*/
movl $0x4000, %ebx
subl Mx, %ebx
jbe 5f
jmp 2f
1:
/*\ vx += (*++p * Cx) >> 9 \*/
addl $4, %eax
movd (%eax), %mm2
punpcklbw %mm7, %mm2
psllw $7, %mm2
pmulhw %mm3, %mm2
paddw %mm2, %mm1
/*\ i -= Cx; while (i > Cx) \*/
subl Cx, %ebx
2:
cmpl Cx, %ebx
jg 1b
/*\ vx += (*++p * i) >> 9 \*/
addl $4, %eax
movd (%eax), %mm2
punpcklbw %mm7, %mm2
psllw $7, %mm2
pmulhw %mm6, %mm2
paddw %mm2, %mm1
5:
/*\ v += (vx * Cy) >> 14 \*/
movd Cy, %mm4
punpcklwd %mm4, %mm4
punpckldq %mm4, %mm4
psllw $2, %mm1
pmulhw %mm4, %mm1
paddw %mm1, %mm0
/*\ j -= Cy; while (j > Cy) \*/
subl Cy, %edx
4:
cmpl Cy, %edx
jg 3b
/*\ sptr += sow; p = sptr \*/
addl sow_4, %esi
movl %esi, %eax
/*\ vx = (*p * Mx) >> 9 \*/
movd (%eax), %mm1
punpcklbw %mm7, %mm1
psllw $7, %mm1
pmulhw %mm5, %mm1
/*\ i = 0x4000 - Mx \*/
movl $0x4000, %ebx
subl Mx, %ebx
jbe 5f
jmp 2f
1:
/*\ vx += (*++p * Cx) >> 9 \*/
addl $4, %eax
movd (%eax), %mm2
punpcklbw %mm7, %mm2
psllw $7, %mm2
pmulhw %mm3, %mm2
paddw %mm2, %mm1
/*\ i -= Cx; while (i > Cx) \*/
subl Cx, %ebx
2:
cmpl Cx, %ebx
jg 1b
/*\ vx += (*++p * i) >> 9 \*/
addl $4, %eax
movd (%eax), %mm2
punpcklbw %mm7, %mm2
psllw $7, %mm2
pmulhw %mm6, %mm2
paddw %mm2, %mm1
5:
/*\ v += (vx * j) >> 14 \*/
movd %edx, %mm4
punpcklwd %mm4, %mm4
punpckldq %mm4, %mm4
psllw $2, %mm1
pmulhw %mm4, %mm1
paddw %mm1, %mm0
6:
/*\ dptr[x] = mm0 >> 5 \*/
psrlw $5, %mm0
packuswb %mm0, %mm0
movd %mm0, (%edi, %ecx, 4)
/*\ while (++x) \*/
incl %ecx
jnz .down_down_loop_x
/*\ dptr += dow \*/
movl dow, %eax
leal (%edi, %eax, 4), %edi
/*\ yap++; yp++ \*/
addl $4, yap
addl $4, yp
/*\ while (y--) \*/
decl y
jnz .down_down_loop_y
jmp .scale_leave
.scale_leave:
emms
popl %esi
popl %edi
popl %edx
popl %ecx
popl %ebx
movl %ebp, %esp
popl %ebp
ret
SIZE(mimageScale_mmx_AARGBA)
.section .note.GNU-stack,"",@progbits

View file

@ -1,77 +0,0 @@
/****************************************************************************
**
** This file is based on sources of the Qt GUI Toolkit, used under the terms
** of the GNU General Public License version 2 (see the original copyright
** notice below).
** All further contributions to this file are (and are required to be)
** licensed under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** The original Qt license header follows:
**
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "defs.h"
#include <string.h>
bool freadline( char* buf, int bufsize, FILE* datafile )
{
if( fgets( buf, bufsize, datafile ) == 0 )
{
buf[ 0 ] = '\0';
return false;
}
char* nl = strchr( buf, '\n' );
if( nl != NULL )
*nl = '\0';
return true;
}
void strip_whitespace( char* line )
{
char* dst = line;
char* src = line;
while( *src == ' ' )
++src;
while( ( *dst++ = *src++ ) != '\0' )
;
--dst;
while( dst >= line && *dst == ' ' )
*dst-- = '\0';
}
bool begins_with( const char* line, const char* str )
{
int len = strlen( str );
return strncmp( line, str, len );
}

View file

@ -1,154 +0,0 @@
/****************************************************************************
**
** This file is based on sources of the Qt GUI Toolkit, used under the terms
** of the GNU General Public License version 2 (see the original copyright
** notice below).
** All further contributions to this file are (and are required to be)
** licensed under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** The original Qt license header follows:
**
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef QWINDOWDEFS_H
#define QWINDOWDEFS_H
#include <stdlib.h>
#define Q_WS_X11
#define Q_EXPORT
#define QT_NO_DATASTREAM
#define QT_NO_IMAGE_TEXT
#define QT_NO_IMAGE_TRANSFORMATION
#define QT_NO_IMAGE_MIRROR
#define QT_NO_COMPONENT
#define QT_NO_IMAGEIO
#define QT_NO_MIME
#define QT_NO_QIMAGEIO
#define QT_NO_STRINGLIST
#define QT_NO_XFTFREETYPE
#ifndef QT_NO_STL
#define QT_NO_STL
#endif
#ifndef QT_NO_ASCII_CAST
#define QT_NO_ASCII_CAST
#endif
#ifndef QT_NO_CAST_ASCII
#define QT_NO_CAST_ASCII
#endif
#define QT_STATIC_CONST static const
#define QT_STATIC_CONST_IMPL const
typedef int QCOORD; // coordinate type
const QCOORD QCOORD_MAX = 2147483647;
const QCOORD QCOORD_MIN = -QCOORD_MAX - 1;
typedef unsigned int QRgb; // RGB triplet
#define qMax(a, b) ((b) < (a) ? (a) : (b))
#define qMin(a, b) ((a) < (b) ? (a) : (b))
#define qAbs(a) ((a) >= 0 ? (a) : -(a))
#define Q_UNUSED(x) (void)x;
#define Q_CHECK_PTR(p)
#define Q_ASSERT(x)
typedef unsigned char uchar;
typedef unsigned uint;
typedef signed char Q_INT8; // 8 bit signed
typedef unsigned char Q_UINT8; // 8 bit unsigned
typedef short Q_INT16; // 16 bit signed
typedef unsigned short Q_UINT16; // 16 bit unsigned
typedef int Q_INT32; // 32 bit signed
typedef unsigned int quint32; // 32 bit unsigned
typedef long Q_LONG; // word up to 64 bit signed
typedef unsigned long Q_ULONG; // word up to 64 bit unsigned
#if 0
const QRgb RGB_MASK = 0x00ffffff; // masks RGB values
Q_EXPORT inline int qRed( QRgb rgb ) // get red part of RGB
{ return (int)((rgb >> 16) & 0xff); }
Q_EXPORT inline int qGreen( QRgb rgb ) // get green part of RGB
{ return (int)((rgb >> 8) & 0xff); }
Q_EXPORT inline int qBlue( QRgb rgb ) // get blue part of RGB
{ return (int)(rgb & 0xff); }
Q_EXPORT inline int qAlpha( QRgb rgb ) // get alpha part of RGBA
{ return (int)((rgb >> 24) & 0xff); }
Q_EXPORT inline QRgb qRgb( int r, int g, int b )// set RGB value
{ return (0xff << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
Q_EXPORT inline QRgb qRgba( int r, int g, int b, int a )// set RGBA value
{ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
Q_EXPORT inline int qGray( int r, int g, int b )// convert R,G,B to gray 0..255
{ return (r*11+g*16+b*5)/32; }
Q_EXPORT inline int qGray( QRgb rgb ) // convert RGB to gray 0..255
{ return qGray( qRed(rgb), qGreen(rgb), qBlue(rgb) ); }
#endif
inline
Q_EXPORT void qWarning( const char *, ... ) // print warning message
#if defined(Q_CC_GNU) && !defined(__INSURE__)
__attribute__ ((format (printf, 1, 2)))
#endif
{}
inline
Q_EXPORT void qFatal( const char *, ... ) // print fatal message and exit
#if defined(Q_CC_GNU)
__attribute__ ((format (printf, 1, 2)))
#endif
{
abort();
}
#include <stdio.h>
bool freadline( char* buf, int bufsize, FILE* datafile );
void strip_whitespace( char* line );
bool begins_with( const char* line, const char* str );
#endif

View file

@ -1,88 +0,0 @@
/*
* This file is part of the KDE libraries
* Copyright (C) 2003 Fredrik Hglund <fredrik@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <csignal>
#include <csetjmp>
#include <config-workspace.h>
#include "kcpuinfo.h"
#if defined(__GNUC__)
# define HAVE_GNU_INLINE_ASM
#endif
static int getCpuFeatures()
{
volatile int features = 0;
#if defined( HAVE_GNU_INLINE_ASM ) && defined( __i386__ )
bool haveCPUID = false;
int result = 0;
// First check if the CPU supports the CPUID instruction
__asm__ __volatile__(
// Try to toggle the CPUID bit in the EFLAGS register
"pushf \n\t" // Push the EFLAGS register onto the stack
"popl %%ecx \n\t" // Pop the value into ECX
"movl %%ecx, %%edx \n\t" // Copy ECX to EDX
"xorl $0x00200000, %%ecx \n\t" // Toggle bit 21 (CPUID) in ECX
"pushl %%ecx \n\t" // Push the modified value onto the stack
"popf \n\t" // Pop it back into EFLAGS
// Check if the CPUID bit was successfully toggled
"pushf \n\t" // Push EFLAGS back onto the stack
"popl %%ecx \n\t" // Pop the value into ECX
"xorl %%eax, %%eax \n\t" // Zero out the EAX register
"cmpl %%ecx, %%edx \n\t" // Compare ECX with EDX
"je .Lno_cpuid_support%= \n\t" // Jump if they're identical
"movl $1, %%eax \n\t" // Set EAX to true
".Lno_cpuid_support%=: \n\t"
: "=a"(haveCPUID) : : "%ecx", "%edx" );
// If we don't have CPUID we won't have the other extensions either
if ( ! haveCPUID )
return 0L;
// Execute CPUID with the feature request bit set
__asm__ __volatile__(
"pushl %%ebx \n\t" // Save EBX
"movl $1, %%eax \n\t" // Set EAX to 1 (features request)
"cpuid \n\t" // Call CPUID
"popl %%ebx \n\t" // Restore EBX
: "=d"(result) : : "%eax", "%ecx" );
// Test bit 23 (MMX support)
if ( result & 0x00800000 )
features |= KCPUInfo::IntelMMX;
#endif //HAVE_GNU_INLINE_ASM
return features;
}
unsigned int KCPUInfo::s_features = getCpuFeatures();

View file

@ -1,63 +0,0 @@
/*
* This file is part of the KDE libraries
* Copyright (C) 2003 Fredrik Hglund <fredrik@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef KCPUINFO_H
#define KCPUINFO_H
/**
* This class provides a means for applications to obtain information at
* runtime about processor support for certain architecture extensions,
* such as MMX.
*/
class KCPUInfo
{
public:
/**
* This enum contains the list of architecture extensions you
* can query.
*/
enum Extensions {
IntelMMX = 1 << 0, //!< Intel's MMX instructions.
};
/**
* Returns true if the processor supports @p extension,
* and false otherwise.
*
* @param extension the feature to query.
* @return If true, the processor supports @p extension.
* @see Extensions
*/
static bool haveExtension( unsigned int extension )
{ return s_features & extension; }
private:
static unsigned int s_features;
};
#endif

View file

@ -1,158 +0,0 @@
/********************************************************************
Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org>
Please see file LICENSE for the licensing terms of ksplashx as a whole.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "pixmap.h"
#include "splash.h"
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <math.h>
int screen_number = 0;
int number_of_screens = 1;
static void usage( char* name )
{
fprintf( stderr, "Usage: %s <theme> [--test] [--pid]\n", name );
exit( 1 );
}
int main( int argc, char* argv[] )
{
if( argc != 2 && argc != 3 && argc != 4 )
usage( argv[ 0 ] );
bool test = false;
bool print_pid = false;
int* cpid = 0;
for( int i = 2; // 1 is the theme
i < argc;
++i )
{
if( strcmp( argv[ i ], "--test" ) == 0 )
test = true;
else if( strcmp( argv[ i ], "--pid" ) == 0 )
print_pid = true;
else
usage( argv[ 0 ] );
}
const char* theme = argv[ 1 ];
if( strcmp( theme, "DefaultFullscreen" ) == 0 )
theme = "Default"; // these are now the same
int parent_pipe = -1;
if( print_pid )
{
int pipes[ 2 ];
if( pipe( pipes ) < 0 )
{
perror( "pipe()" );
abort();
}
pid_t pid = fork();
if( pid < 0 )
{
perror( "fork()" );
abort();
}
if( pid == 0 )
{ // child
close( pipes[ 0 ] );
parent_pipe = pipes[ 1 ];
close( 0 ); // close stdin,stdout,stderr, otherwise startkde will block
close( 1 );
close( 2 );
Display* dpy = XOpenDisplay(NULL);
if (!dpy)
{
exit(1);
}
number_of_screens = ScreenCount(dpy);
if (number_of_screens > 1)
{
cpid = (int*)calloc(number_of_screens, sizeof(int));
screen_number = DefaultScreen(dpy);
char* display_name;
display_name = XDisplayString(dpy);
int breakpos = strlen(display_name);
for (int i = strlen(display_name) - 1; i >= 0; i--)
{
if (display_name[i] == '.')
{
breakpos = i;
break;
}
}
// Calculate the array size: part before the dot + length of the screen
// string (which is log10 + 1) + 1 for the dot itself + 8 for "DISPLAY=" + \0
const int envir_len = breakpos + log10(static_cast<double>(number_of_screens)) + 11;
char *envir = new char[envir_len];
char *server_name = new char[breakpos + 1];
strncpy(server_name, display_name, breakpos);
server_name[breakpos] = '\0';
XCloseDisplay(dpy);
dpy = 0;
for (int i = 0; i < number_of_screens; i++)
{
if (i != screen_number)
{
cpid[i] = fork();
if (cpid[i] == 0)
{
screen_number = i;
// Break here because we are the child process, we don't
// want to fork() anymore
break;
}
}
}
snprintf(envir, envir_len, "DISPLAY=%s.%d", server_name, screen_number);
putenv(strdup(envir));
delete[] envir;
delete[] server_name;
}
else
XCloseDisplay(dpy);
}
else
{ // parent
close( pipes[ 1 ] );
char buf;
while( read( pipes[ 0 ], &buf, 1 ) < 0
&& ( errno == EINTR || errno == EAGAIN || errno == ECHILD ))
;
if( print_pid )
printf( "%d\n", pid );
return 0;
}
}
if( !openDisplay())
return 2;
if( test )
XSynchronize( qt_xdisplay(), True );
runSplash( theme, test, parent_pipe );
closeDisplay();
if (number_of_screens > 1)
{
for (int i = 1; i < number_of_screens; i++)
kill(cpid[i], SIGTERM);
}
free(cpid);
}

File diff suppressed because it is too large Load diff

View file

@ -1,81 +0,0 @@
/****************************************************************************
**
** This file is based on sources of the Qt GUI Toolkit, used under the terms
** of the GNU General Public License version 2 (see the original copyright
** notice below).
** All further contributions to this file are (and are required to be)
** licensed under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** The original Qt license header follows:
**
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef PIXMAP_H
#define PIXMAP_H
#include "qnamespace.h"
#include "x11_defs.h"
class QImage;
enum Optimization { DefaultOptim, NoOptim, MemoryOptim=NoOptim,
NormalOptim, BestOptim };
struct PixmapData
{
PixmapData() : hd( None ), optim( NoOptim ), ximage( NULL ) {}
Pixmap hd;
int w;
int h;
int d;
Optimization optim;
XImage* ximage;
};
class PP : public Qt // inherit from Qt to reduce needed code changes in the function
{
public:
static PixmapData convertFromImage( const QImage& img, int conversion_flags );
};
inline
PixmapData imageToPixmap( const QImage& im )
{
return PP::convertFromImage( im, 0 );
}
QImage splash_read_png_image(FILE* f);
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,236 +0,0 @@
/****************************************************************************
**
** This file is based on sources of the Qt GUI Toolkit, used under the terms
** of the GNU General Public License version 2 (see the original copyright
** notice below).
** All further contributions to this file are (and are required to be)
** licensed under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** The original Qt license header follows:
**
**
** Definition of QColor class
**
** Created : 940112
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef QCOLOR_H
#define QCOLOR_H
#ifndef QT_H
#include "qwindowdefs.h"
//##include "qstringlist.h"
#endif // QT_H
const QRgb RGB_MASK = 0x00ffffff; // masks RGB values
Q_EXPORT inline int qRed( QRgb rgb ) // get red part of RGB
{ return (int)((rgb >> 16) & 0xff); }
Q_EXPORT inline int qGreen( QRgb rgb ) // get green part of RGB
{ return (int)((rgb >> 8) & 0xff); }
Q_EXPORT inline int qBlue( QRgb rgb ) // get blue part of RGB
{ return (int)(rgb & 0xff); }
Q_EXPORT inline int qAlpha( QRgb rgb ) // get alpha part of RGBA
{ return (int)((rgb >> 24) & 0xff); }
Q_EXPORT inline QRgb qRgb( int r, int g, int b )// set RGB value
{ return (0xff << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
Q_EXPORT inline QRgb qRgba( int r, int g, int b, int a )// set RGBA value
{ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
Q_EXPORT inline int qGray( int r, int g, int b )// convert R,G,B to gray 0..255
{ return (r*11+g*16+b*5)/32; }
Q_EXPORT inline int qGray( QRgb rgb ) // convert RGB to gray 0..255
{ return qGray( qRed(rgb), qGreen(rgb), qBlue(rgb) ); }
class Q_EXPORT QColor
{
public:
enum Spec { Rgb, Hsv };
QColor();
QColor( int r, int g, int b );
QColor( int x, int y, int z, Spec );
explicit QColor( QRgb rgb, uint pixel=0xffffffff);
#if 0
QColor( const QString& name );
#endif
explicit QColor( const char *name );
QColor( const QColor & );
QColor &operator=( const QColor & );
bool isValid() const;
bool isDirty() const;
#if 0
QString name() const;
void setNamedColor( const QString& name );
#else
void setNamedColor( const char* name );
#endif
QRgb rgb() const;
void setRgb( int r, int g, int b );
void setRgb( QRgb rgb );
void getRgb( int *r, int *g, int *b ) const { rgb( r, g, b ); }
void rgb( int *r, int *g, int *b ) const; // obsolete
int red() const;
int green() const;
int blue() const;
void setHsv( int h, int s, int v );
void getHsv( int *h, int *s, int *v ) const { hsv( h, s, v ); }
void hsv( int *h, int *s, int *v ) const; // obsolete
void getHsv( int &h, int &s, int &v ) const { hsv( &h, &s, &v ); } // obsolete
QColor light( int f = 150 ) const;
QColor dark( int f = 200 ) const;
bool operator==( const QColor &c ) const;
bool operator!=( const QColor &c ) const;
uint alloc();
uint pixel() const;
#if defined(Q_WS_X11)
// ### in 4.0, make this take a default argument of -1 for default screen?
uint alloc( int screen );
uint pixel( int screen ) const;
#endif
static int maxColors();
static int numBitPlanes();
static int enterAllocContext();
static void leaveAllocContext();
static int currentAllocContext();
static void destroyAllocContext( int );
static void initialize();
static void cleanup();
#ifndef QT_NO_STRINGLIST
static QStringList colorNames();
#endif
enum { Dirt = 0x44495254, Invalid = 0x49000000 };
private:
#if 0
void setSystemNamedColor( const QString& name );
#else
void setSystemNamedColor( const char* name );
#endif
void setPixel( uint pixel );
static void initGlobalColors();
static uint argbToPix32(QRgb);
static QColor* globalColors();
static bool color_init;
static bool globals_init;
static enum ColorModel { d8, d32 } colormodel;
union {
QRgb argb;
struct D8 {
QRgb argb;
uchar pix;
uchar invalid;
uchar dirty;
uchar direct;
} d8;
struct D32 {
QRgb argb;
uint pix;
bool invalid() const { return argb == QColor::Invalid && pix == QColor::Dirt; }
bool probablyDirty() const { return pix == QColor::Dirt; }
} d32;
} d;
};
inline QColor::QColor()
{ d.d32.argb = Invalid; d.d32.pix = Dirt; }
inline QColor::QColor( int r, int g, int b )
{
d.d32.argb = Invalid;
d.d32.pix = Dirt;
setRgb( r, g, b );
}
inline QRgb QColor::rgb() const
{ return d.argb; }
inline int QColor::red() const
{ return qRed(d.argb); }
inline int QColor::green() const
{ return qGreen(d.argb); }
inline int QColor::blue() const
{ return qBlue(d.argb); }
inline bool QColor::isValid() const
{
if ( colormodel == d8 )
return !d.d8.invalid;
else
return !d.d32.invalid();
}
inline bool QColor::operator==( const QColor &c ) const
{
return d.argb == c.d.argb && isValid() == c.isValid();
}
inline bool QColor::operator!=( const QColor &c ) const
{
return !operator==(c);
}
/*****************************************************************************
QColor stream functions
*****************************************************************************/
#ifndef QT_NO_DATASTREAM
Q_EXPORT QDataStream &operator<<( QDataStream &, const QColor & );
Q_EXPORT QDataStream &operator>>( QDataStream &, QColor & );
#endif
#endif // QCOLOR_H

View file

@ -1,820 +0,0 @@
/****************************************************************************
**
** This file is based on sources of the Qt GUI Toolkit, used under the terms
** of the GNU General Public License version 2 (see the original copyright
** notice below).
** All further contributions to this file are (and are required to be)
** licensed under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** The original Qt license header follows:
**
**
** Named color support for non-X platforms.
** The color names have been borrowed from X.
**
** Created : 000228
**
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "qglobal.h"
#if defined(Q_CC_BOR)
// needed for qsort() because of a std namespace problem on Borland
#include "qplatformdefs.h"
#endif
#include "qcolor.h"
#ifndef QT_NO_COLORNAMES
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#undef QRGB
#define QRGB(r,g,b) (r*65536 + g*256 + b)
const int rgbTblSize = 657;
static int qstricmp( const char *str1, const char *str2 )
{
const uchar *s1 = (const uchar *)str1;
const uchar *s2 = (const uchar *)str2;
int res;
uchar c;
if ( !s1 || !s2 )
return s1 ? 1 : ( s2 ? -1 : 0 );
for ( ; !(res = (c=tolower(*s1)) - tolower(*s2)); s1++, s2++ )
if ( !c ) // strings are equal
break;
return res;
}
static const struct RGBData {
uint value;
const char *name;
} rgbTbl[] = {
{ QRGB(240,248,255), "aliceblue" },
{ QRGB(250,235,215), "antiquewhite" },
{ QRGB(255,239,219), "antiquewhite1" },
{ QRGB(238,223,204), "antiquewhite2" },
{ QRGB(205,192,176), "antiquewhite3" },
{ QRGB(139,131,120), "antiquewhite4" },
{ QRGB(127,255,212), "aquamarine" },
{ QRGB(127,255,212), "aquamarine1" },
{ QRGB(118,238,198), "aquamarine2" },
{ QRGB(102,205,170), "aquamarine3" },
{ QRGB( 69,139,116), "aquamarine4" },
{ QRGB(240,255,255), "azure" },
{ QRGB(240,255,255), "azure1" },
{ QRGB(224,238,238), "azure2" },
{ QRGB(193,205,205), "azure3" },
{ QRGB(131,139,139), "azure4" },
{ QRGB(245,245,220), "beige" },
{ QRGB(255,228,196), "bisque" },
{ QRGB(255,228,196), "bisque1" },
{ QRGB(238,213,183), "bisque2" },
{ QRGB(205,183,158), "bisque3" },
{ QRGB(139,125,107), "bisque4" },
{ QRGB( 0, 0, 0), "black" },
{ QRGB(255,235,205), "blanchedalmond" },
{ QRGB( 0, 0,255), "blue" },
{ QRGB( 0, 0,255), "blue1" },
{ QRGB( 0, 0,238), "blue2" },
{ QRGB( 0, 0,205), "blue3" },
{ QRGB( 0, 0,139), "blue4" },
{ QRGB(138, 43,226), "blueviolet" },
{ QRGB(165, 42, 42), "brown" },
{ QRGB(255, 64, 64), "brown1" },
{ QRGB(238, 59, 59), "brown2" },
{ QRGB(205, 51, 51), "brown3" },
{ QRGB(139, 35, 35), "brown4" },
{ QRGB(222,184,135), "burlywood" },
{ QRGB(255,211,155), "burlywood1" },
{ QRGB(238,197,145), "burlywood2" },
{ QRGB(205,170,125), "burlywood3" },
{ QRGB(139,115, 85), "burlywood4" },
{ QRGB( 95,158,160), "cadetblue" },
{ QRGB(152,245,255), "cadetblue1" },
{ QRGB(142,229,238), "cadetblue2" },
{ QRGB(122,197,205), "cadetblue3" },
{ QRGB( 83,134,139), "cadetblue4" },
{ QRGB(127,255, 0), "chartreuse" },
{ QRGB(127,255, 0), "chartreuse1" },
{ QRGB(118,238, 0), "chartreuse2" },
{ QRGB(102,205, 0), "chartreuse3" },
{ QRGB( 69,139, 0), "chartreuse4" },
{ QRGB(210,105, 30), "chocolate" },
{ QRGB(255,127, 36), "chocolate1" },
{ QRGB(238,118, 33), "chocolate2" },
{ QRGB(205,102, 29), "chocolate3" },
{ QRGB(139, 69, 19), "chocolate4" },
{ QRGB(255,127, 80), "coral" },
{ QRGB(255,114, 86), "coral1" },
{ QRGB(238,106, 80), "coral2" },
{ QRGB(205, 91, 69), "coral3" },
{ QRGB(139, 62, 47), "coral4" },
{ QRGB(100,149,237), "cornflowerblue" },
{ QRGB(255,248,220), "cornsilk" },
{ QRGB(255,248,220), "cornsilk1" },
{ QRGB(238,232,205), "cornsilk2" },
{ QRGB(205,200,177), "cornsilk3" },
{ QRGB(139,136,120), "cornsilk4" },
{ QRGB( 0,255,255), "cyan" },
{ QRGB( 0,255,255), "cyan1" },
{ QRGB( 0,238,238), "cyan2" },
{ QRGB( 0,205,205), "cyan3" },
{ QRGB( 0,139,139), "cyan4" },
{ QRGB( 0, 0,139), "darkblue" },
{ QRGB( 0,139,139), "darkcyan" },
{ QRGB(184,134, 11), "darkgoldenrod" },
{ QRGB(255,185, 15), "darkgoldenrod1" },
{ QRGB(238,173, 14), "darkgoldenrod2" },
{ QRGB(205,149, 12), "darkgoldenrod3" },
{ QRGB(139,101, 8), "darkgoldenrod4" },
{ QRGB(169,169,169), "darkgray" },
{ QRGB( 0,100, 0), "darkgreen" },
{ QRGB(169,169,169), "darkgrey" },
{ QRGB(189,183,107), "darkkhaki" },
{ QRGB(139, 0,139), "darkmagenta" },
{ QRGB( 85,107, 47), "darkolivegreen" },
{ QRGB(202,255,112), "darkolivegreen1" },
{ QRGB(188,238,104), "darkolivegreen2" },
{ QRGB(162,205, 90), "darkolivegreen3" },
{ QRGB(110,139, 61), "darkolivegreen4" },
{ QRGB(255,140, 0), "darkorange" },
{ QRGB(255,127, 0), "darkorange1" },
{ QRGB(238,118, 0), "darkorange2" },
{ QRGB(205,102, 0), "darkorange3" },
{ QRGB(139, 69, 0), "darkorange4" },
{ QRGB(153, 50,204), "darkorchid" },
{ QRGB(191, 62,255), "darkorchid1" },
{ QRGB(178, 58,238), "darkorchid2" },
{ QRGB(154, 50,205), "darkorchid3" },
{ QRGB(104, 34,139), "darkorchid4" },
{ QRGB(139, 0, 0), "darkred" },
{ QRGB(233,150,122), "darksalmon" },
{ QRGB(143,188,143), "darkseagreen" },
{ QRGB(193,255,193), "darkseagreen1" },
{ QRGB(180,238,180), "darkseagreen2" },
{ QRGB(155,205,155), "darkseagreen3" },
{ QRGB(105,139,105), "darkseagreen4" },
{ QRGB( 72, 61,139), "darkslateblue" },
{ QRGB( 47, 79, 79), "darkslategray" },
{ QRGB(151,255,255), "darkslategray1" },
{ QRGB(141,238,238), "darkslategray2" },
{ QRGB(121,205,205), "darkslategray3" },
{ QRGB( 82,139,139), "darkslategray4" },
{ QRGB( 47, 79, 79), "darkslategrey" },
{ QRGB( 0,206,209), "darkturquoise" },
{ QRGB(148, 0,211), "darkviolet" },
{ QRGB(255, 20,147), "deeppink" },
{ QRGB(255, 20,147), "deeppink1" },
{ QRGB(238, 18,137), "deeppink2" },
{ QRGB(205, 16,118), "deeppink3" },
{ QRGB(139, 10, 80), "deeppink4" },
{ QRGB( 0,191,255), "deepskyblue" },
{ QRGB( 0,191,255), "deepskyblue1" },
{ QRGB( 0,178,238), "deepskyblue2" },
{ QRGB( 0,154,205), "deepskyblue3" },
{ QRGB( 0,104,139), "deepskyblue4" },
{ QRGB(105,105,105), "dimgray" },
{ QRGB(105,105,105), "dimgrey" },
{ QRGB( 30,144,255), "dodgerblue" },
{ QRGB( 30,144,255), "dodgerblue1" },
{ QRGB( 28,134,238), "dodgerblue2" },
{ QRGB( 24,116,205), "dodgerblue3" },
{ QRGB( 16, 78,139), "dodgerblue4" },
{ QRGB(178, 34, 34), "firebrick" },
{ QRGB(255, 48, 48), "firebrick1" },
{ QRGB(238, 44, 44), "firebrick2" },
{ QRGB(205, 38, 38), "firebrick3" },
{ QRGB(139, 26, 26), "firebrick4" },
{ QRGB(255,250,240), "floralwhite" },
{ QRGB( 34,139, 34), "forestgreen" },
{ QRGB(220,220,220), "gainsboro" },
{ QRGB(248,248,255), "ghostwhite" },
{ QRGB(255,215, 0), "gold" },
{ QRGB(255,215, 0), "gold1" },
{ QRGB(238,201, 0), "gold2" },
{ QRGB(205,173, 0), "gold3" },
{ QRGB(139,117, 0), "gold4" },
{ QRGB(218,165, 32), "goldenrod" },
{ QRGB(255,193, 37), "goldenrod1" },
{ QRGB(238,180, 34), "goldenrod2" },
{ QRGB(205,155, 29), "goldenrod3" },
{ QRGB(139,105, 20), "goldenrod4" },
{ QRGB(190,190,190), "gray" },
{ QRGB( 0, 0, 0), "gray0" },
{ QRGB( 3, 3, 3), "gray1" },
{ QRGB( 26, 26, 26), "gray10" },
{ QRGB(255,255,255), "gray100" },
{ QRGB( 28, 28, 28), "gray11" },
{ QRGB( 31, 31, 31), "gray12" },
{ QRGB( 33, 33, 33), "gray13" },
{ QRGB( 36, 36, 36), "gray14" },
{ QRGB( 38, 38, 38), "gray15" },
{ QRGB( 41, 41, 41), "gray16" },
{ QRGB( 43, 43, 43), "gray17" },
{ QRGB( 46, 46, 46), "gray18" },
{ QRGB( 48, 48, 48), "gray19" },
{ QRGB( 5, 5, 5), "gray2" },
{ QRGB( 51, 51, 51), "gray20" },
{ QRGB( 54, 54, 54), "gray21" },
{ QRGB( 56, 56, 56), "gray22" },
{ QRGB( 59, 59, 59), "gray23" },
{ QRGB( 61, 61, 61), "gray24" },
{ QRGB( 64, 64, 64), "gray25" },
{ QRGB( 66, 66, 66), "gray26" },
{ QRGB( 69, 69, 69), "gray27" },
{ QRGB( 71, 71, 71), "gray28" },
{ QRGB( 74, 74, 74), "gray29" },
{ QRGB( 8, 8, 8), "gray3" },
{ QRGB( 77, 77, 77), "gray30" },
{ QRGB( 79, 79, 79), "gray31" },
{ QRGB( 82, 82, 82), "gray32" },
{ QRGB( 84, 84, 84), "gray33" },
{ QRGB( 87, 87, 87), "gray34" },
{ QRGB( 89, 89, 89), "gray35" },
{ QRGB( 92, 92, 92), "gray36" },
{ QRGB( 94, 94, 94), "gray37" },
{ QRGB( 97, 97, 97), "gray38" },
{ QRGB( 99, 99, 99), "gray39" },
{ QRGB( 10, 10, 10), "gray4" },
{ QRGB(102,102,102), "gray40" },
{ QRGB(105,105,105), "gray41" },
{ QRGB(107,107,107), "gray42" },
{ QRGB(110,110,110), "gray43" },
{ QRGB(112,112,112), "gray44" },
{ QRGB(115,115,115), "gray45" },
{ QRGB(117,117,117), "gray46" },
{ QRGB(120,120,120), "gray47" },
{ QRGB(122,122,122), "gray48" },
{ QRGB(125,125,125), "gray49" },
{ QRGB( 13, 13, 13), "gray5" },
{ QRGB(127,127,127), "gray50" },
{ QRGB(130,130,130), "gray51" },
{ QRGB(133,133,133), "gray52" },
{ QRGB(135,135,135), "gray53" },
{ QRGB(138,138,138), "gray54" },
{ QRGB(140,140,140), "gray55" },
{ QRGB(143,143,143), "gray56" },
{ QRGB(145,145,145), "gray57" },
{ QRGB(148,148,148), "gray58" },
{ QRGB(150,150,150), "gray59" },
{ QRGB( 15, 15, 15), "gray6" },
{ QRGB(153,153,153), "gray60" },
{ QRGB(156,156,156), "gray61" },
{ QRGB(158,158,158), "gray62" },
{ QRGB(161,161,161), "gray63" },
{ QRGB(163,163,163), "gray64" },
{ QRGB(166,166,166), "gray65" },
{ QRGB(168,168,168), "gray66" },
{ QRGB(171,171,171), "gray67" },
{ QRGB(173,173,173), "gray68" },
{ QRGB(176,176,176), "gray69" },
{ QRGB( 18, 18, 18), "gray7" },
{ QRGB(179,179,179), "gray70" },
{ QRGB(181,181,181), "gray71" },
{ QRGB(184,184,184), "gray72" },
{ QRGB(186,186,186), "gray73" },
{ QRGB(189,189,189), "gray74" },
{ QRGB(191,191,191), "gray75" },
{ QRGB(194,194,194), "gray76" },
{ QRGB(196,196,196), "gray77" },
{ QRGB(199,199,199), "gray78" },
{ QRGB(201,201,201), "gray79" },
{ QRGB( 20, 20, 20), "gray8" },
{ QRGB(204,204,204), "gray80" },
{ QRGB(207,207,207), "gray81" },
{ QRGB(209,209,209), "gray82" },
{ QRGB(212,212,212), "gray83" },
{ QRGB(214,214,214), "gray84" },
{ QRGB(217,217,217), "gray85" },
{ QRGB(219,219,219), "gray86" },
{ QRGB(222,222,222), "gray87" },
{ QRGB(224,224,224), "gray88" },
{ QRGB(227,227,227), "gray89" },
{ QRGB( 23, 23, 23), "gray9" },
{ QRGB(229,229,229), "gray90" },
{ QRGB(232,232,232), "gray91" },
{ QRGB(235,235,235), "gray92" },
{ QRGB(237,237,237), "gray93" },
{ QRGB(240,240,240), "gray94" },
{ QRGB(242,242,242), "gray95" },
{ QRGB(245,245,245), "gray96" },
{ QRGB(247,247,247), "gray97" },
{ QRGB(250,250,250), "gray98" },
{ QRGB(252,252,252), "gray99" },
{ QRGB( 0,255, 0), "green" },
{ QRGB( 0,255, 0), "green1" },
{ QRGB( 0,238, 0), "green2" },
{ QRGB( 0,205, 0), "green3" },
{ QRGB( 0,139, 0), "green4" },
{ QRGB(173,255, 47), "greenyellow" },
{ QRGB(190,190,190), "grey" },
{ QRGB( 0, 0, 0), "grey0" },
{ QRGB( 3, 3, 3), "grey1" },
{ QRGB( 26, 26, 26), "grey10" },
{ QRGB(255,255,255), "grey100" },
{ QRGB( 28, 28, 28), "grey11" },
{ QRGB( 31, 31, 31), "grey12" },
{ QRGB( 33, 33, 33), "grey13" },
{ QRGB( 36, 36, 36), "grey14" },
{ QRGB( 38, 38, 38), "grey15" },
{ QRGB( 41, 41, 41), "grey16" },
{ QRGB( 43, 43, 43), "grey17" },
{ QRGB( 46, 46, 46), "grey18" },
{ QRGB( 48, 48, 48), "grey19" },
{ QRGB( 5, 5, 5), "grey2" },
{ QRGB( 51, 51, 51), "grey20" },
{ QRGB( 54, 54, 54), "grey21" },
{ QRGB( 56, 56, 56), "grey22" },
{ QRGB( 59, 59, 59), "grey23" },
{ QRGB( 61, 61, 61), "grey24" },
{ QRGB( 64, 64, 64), "grey25" },
{ QRGB( 66, 66, 66), "grey26" },
{ QRGB( 69, 69, 69), "grey27" },
{ QRGB( 71, 71, 71), "grey28" },
{ QRGB( 74, 74, 74), "grey29" },
{ QRGB( 8, 8, 8), "grey3" },
{ QRGB( 77, 77, 77), "grey30" },
{ QRGB( 79, 79, 79), "grey31" },
{ QRGB( 82, 82, 82), "grey32" },
{ QRGB( 84, 84, 84), "grey33" },
{ QRGB( 87, 87, 87), "grey34" },
{ QRGB( 89, 89, 89), "grey35" },
{ QRGB( 92, 92, 92), "grey36" },
{ QRGB( 94, 94, 94), "grey37" },
{ QRGB( 97, 97, 97), "grey38" },
{ QRGB( 99, 99, 99), "grey39" },
{ QRGB( 10, 10, 10), "grey4" },
{ QRGB(102,102,102), "grey40" },
{ QRGB(105,105,105), "grey41" },
{ QRGB(107,107,107), "grey42" },
{ QRGB(110,110,110), "grey43" },
{ QRGB(112,112,112), "grey44" },
{ QRGB(115,115,115), "grey45" },
{ QRGB(117,117,117), "grey46" },
{ QRGB(120,120,120), "grey47" },
{ QRGB(122,122,122), "grey48" },
{ QRGB(125,125,125), "grey49" },
{ QRGB( 13, 13, 13), "grey5" },
{ QRGB(127,127,127), "grey50" },
{ QRGB(130,130,130), "grey51" },
{ QRGB(133,133,133), "grey52" },
{ QRGB(135,135,135), "grey53" },
{ QRGB(138,138,138), "grey54" },
{ QRGB(140,140,140), "grey55" },
{ QRGB(143,143,143), "grey56" },
{ QRGB(145,145,145), "grey57" },
{ QRGB(148,148,148), "grey58" },
{ QRGB(150,150,150), "grey59" },
{ QRGB( 15, 15, 15), "grey6" },
{ QRGB(153,153,153), "grey60" },
{ QRGB(156,156,156), "grey61" },
{ QRGB(158,158,158), "grey62" },
{ QRGB(161,161,161), "grey63" },
{ QRGB(163,163,163), "grey64" },
{ QRGB(166,166,166), "grey65" },
{ QRGB(168,168,168), "grey66" },
{ QRGB(171,171,171), "grey67" },
{ QRGB(173,173,173), "grey68" },
{ QRGB(176,176,176), "grey69" },
{ QRGB( 18, 18, 18), "grey7" },
{ QRGB(179,179,179), "grey70" },
{ QRGB(181,181,181), "grey71" },
{ QRGB(184,184,184), "grey72" },
{ QRGB(186,186,186), "grey73" },
{ QRGB(189,189,189), "grey74" },
{ QRGB(191,191,191), "grey75" },
{ QRGB(194,194,194), "grey76" },
{ QRGB(196,196,196), "grey77" },
{ QRGB(199,199,199), "grey78" },
{ QRGB(201,201,201), "grey79" },
{ QRGB( 20, 20, 20), "grey8" },
{ QRGB(204,204,204), "grey80" },
{ QRGB(207,207,207), "grey81" },
{ QRGB(209,209,209), "grey82" },
{ QRGB(212,212,212), "grey83" },
{ QRGB(214,214,214), "grey84" },
{ QRGB(217,217,217), "grey85" },
{ QRGB(219,219,219), "grey86" },
{ QRGB(222,222,222), "grey87" },
{ QRGB(224,224,224), "grey88" },
{ QRGB(227,227,227), "grey89" },
{ QRGB( 23, 23, 23), "grey9" },
{ QRGB(229,229,229), "grey90" },
{ QRGB(232,232,232), "grey91" },
{ QRGB(235,235,235), "grey92" },
{ QRGB(237,237,237), "grey93" },
{ QRGB(240,240,240), "grey94" },
{ QRGB(242,242,242), "grey95" },
{ QRGB(245,245,245), "grey96" },
{ QRGB(247,247,247), "grey97" },
{ QRGB(250,250,250), "grey98" },
{ QRGB(252,252,252), "grey99" },
{ QRGB(240,255,240), "honeydew" },
{ QRGB(240,255,240), "honeydew1" },
{ QRGB(224,238,224), "honeydew2" },
{ QRGB(193,205,193), "honeydew3" },
{ QRGB(131,139,131), "honeydew4" },
{ QRGB(255,105,180), "hotpink" },
{ QRGB(255,110,180), "hotpink1" },
{ QRGB(238,106,167), "hotpink2" },
{ QRGB(205, 96,144), "hotpink3" },
{ QRGB(139, 58, 98), "hotpink4" },
{ QRGB(205, 92, 92), "indianred" },
{ QRGB(255,106,106), "indianred1" },
{ QRGB(238, 99, 99), "indianred2" },
{ QRGB(205, 85, 85), "indianred3" },
{ QRGB(139, 58, 58), "indianred4" },
{ QRGB(255,255,240), "ivory" },
{ QRGB(255,255,240), "ivory1" },
{ QRGB(238,238,224), "ivory2" },
{ QRGB(205,205,193), "ivory3" },
{ QRGB(139,139,131), "ivory4" },
{ QRGB(240,230,140), "khaki" },
{ QRGB(255,246,143), "khaki1" },
{ QRGB(238,230,133), "khaki2" },
{ QRGB(205,198,115), "khaki3" },
{ QRGB(139,134, 78), "khaki4" },
{ QRGB(230,230,250), "lavender" },
{ QRGB(255,240,245), "lavenderblush" },
{ QRGB(255,240,245), "lavenderblush1" },
{ QRGB(238,224,229), "lavenderblush2" },
{ QRGB(205,193,197), "lavenderblush3" },
{ QRGB(139,131,134), "lavenderblush4" },
{ QRGB(124,252, 0), "lawngreen" },
{ QRGB(255,250,205), "lemonchiffon" },
{ QRGB(255,250,205), "lemonchiffon1" },
{ QRGB(238,233,191), "lemonchiffon2" },
{ QRGB(205,201,165), "lemonchiffon3" },
{ QRGB(139,137,112), "lemonchiffon4" },
{ QRGB(173,216,230), "lightblue" },
{ QRGB(191,239,255), "lightblue1" },
{ QRGB(178,223,238), "lightblue2" },
{ QRGB(154,192,205), "lightblue3" },
{ QRGB(104,131,139), "lightblue4" },
{ QRGB(240,128,128), "lightcoral" },
{ QRGB(224,255,255), "lightcyan" },
{ QRGB(224,255,255), "lightcyan1" },
{ QRGB(209,238,238), "lightcyan2" },
{ QRGB(180,205,205), "lightcyan3" },
{ QRGB(122,139,139), "lightcyan4" },
{ QRGB(238,221,130), "lightgoldenrod" },
{ QRGB(255,236,139), "lightgoldenrod1" },
{ QRGB(238,220,130), "lightgoldenrod2" },
{ QRGB(205,190,112), "lightgoldenrod3" },
{ QRGB(139,129, 76), "lightgoldenrod4" },
{ QRGB(250,250,210), "lightgoldenrodyellow" },
{ QRGB(211,211,211), "lightgray" },
{ QRGB(144,238,144), "lightgreen" },
{ QRGB(211,211,211), "lightgrey" },
{ QRGB(255,182,193), "lightpink" },
{ QRGB(255,174,185), "lightpink1" },
{ QRGB(238,162,173), "lightpink2" },
{ QRGB(205,140,149), "lightpink3" },
{ QRGB(139, 95,101), "lightpink4" },
{ QRGB(255,160,122), "lightsalmon" },
{ QRGB(255,160,122), "lightsalmon1" },
{ QRGB(238,149,114), "lightsalmon2" },
{ QRGB(205,129, 98), "lightsalmon3" },
{ QRGB(139, 87, 66), "lightsalmon4" },
{ QRGB( 32,178,170), "lightseagreen" },
{ QRGB(135,206,250), "lightskyblue" },
{ QRGB(176,226,255), "lightskyblue1" },
{ QRGB(164,211,238), "lightskyblue2" },
{ QRGB(141,182,205), "lightskyblue3" },
{ QRGB( 96,123,139), "lightskyblue4" },
{ QRGB(132,112,255), "lightslateblue" },
{ QRGB(119,136,153), "lightslategray" },
{ QRGB(119,136,153), "lightslategrey" },
{ QRGB(176,196,222), "lightsteelblue" },
{ QRGB(202,225,255), "lightsteelblue1" },
{ QRGB(188,210,238), "lightsteelblue2" },
{ QRGB(162,181,205), "lightsteelblue3" },
{ QRGB(110,123,139), "lightsteelblue4" },
{ QRGB(255,255,224), "lightyellow" },
{ QRGB(255,255,224), "lightyellow1" },
{ QRGB(238,238,209), "lightyellow2" },
{ QRGB(205,205,180), "lightyellow3" },
{ QRGB(139,139,122), "lightyellow4" },
{ QRGB( 50,205, 50), "limegreen" },
{ QRGB(250,240,230), "linen" },
{ QRGB(255, 0,255), "magenta" },
{ QRGB(255, 0,255), "magenta1" },
{ QRGB(238, 0,238), "magenta2" },
{ QRGB(205, 0,205), "magenta3" },
{ QRGB(139, 0,139), "magenta4" },
{ QRGB(176, 48, 96), "maroon" },
{ QRGB(255, 52,179), "maroon1" },
{ QRGB(238, 48,167), "maroon2" },
{ QRGB(205, 41,144), "maroon3" },
{ QRGB(139, 28, 98), "maroon4" },
{ QRGB(102,205,170), "mediumaquamarine" },
{ QRGB( 0, 0,205), "mediumblue" },
{ QRGB(186, 85,211), "mediumorchid" },
{ QRGB(224,102,255), "mediumorchid1" },
{ QRGB(209, 95,238), "mediumorchid2" },
{ QRGB(180, 82,205), "mediumorchid3" },
{ QRGB(122, 55,139), "mediumorchid4" },
{ QRGB(147,112,219), "mediumpurple" },
{ QRGB(171,130,255), "mediumpurple1" },
{ QRGB(159,121,238), "mediumpurple2" },
{ QRGB(137,104,205), "mediumpurple3" },
{ QRGB( 93, 71,139), "mediumpurple4" },
{ QRGB( 60,179,113), "mediumseagreen" },
{ QRGB(123,104,238), "mediumslateblue" },
{ QRGB( 0,250,154), "mediumspringgreen" },
{ QRGB( 72,209,204), "mediumturquoise" },
{ QRGB(199, 21,133), "mediumvioletred" },
{ QRGB( 25, 25,112), "midnightblue" },
{ QRGB(245,255,250), "mintcream" },
{ QRGB(255,228,225), "mistyrose" },
{ QRGB(255,228,225), "mistyrose1" },
{ QRGB(238,213,210), "mistyrose2" },
{ QRGB(205,183,181), "mistyrose3" },
{ QRGB(139,125,123), "mistyrose4" },
{ QRGB(255,228,181), "moccasin" },
{ QRGB(255,222,173), "navajowhite" },
{ QRGB(255,222,173), "navajowhite1" },
{ QRGB(238,207,161), "navajowhite2" },
{ QRGB(205,179,139), "navajowhite3" },
{ QRGB(139,121, 94), "navajowhite4" },
{ QRGB( 0, 0,128), "navy" },
{ QRGB( 0, 0,128), "navyblue" },
{ QRGB(253,245,230), "oldlace" },
{ QRGB(107,142, 35), "olivedrab" },
{ QRGB(192,255, 62), "olivedrab1" },
{ QRGB(179,238, 58), "olivedrab2" },
{ QRGB(154,205, 50), "olivedrab3" },
{ QRGB(105,139, 34), "olivedrab4" },
{ QRGB(255,165, 0), "orange" },
{ QRGB(255,165, 0), "orange1" },
{ QRGB(238,154, 0), "orange2" },
{ QRGB(205,133, 0), "orange3" },
{ QRGB(139, 90, 0), "orange4" },
{ QRGB(255, 69, 0), "orangered" },
{ QRGB(255, 69, 0), "orangered1" },
{ QRGB(238, 64, 0), "orangered2" },
{ QRGB(205, 55, 0), "orangered3" },
{ QRGB(139, 37, 0), "orangered4" },
{ QRGB(218,112,214), "orchid" },
{ QRGB(255,131,250), "orchid1" },
{ QRGB(238,122,233), "orchid2" },
{ QRGB(205,105,201), "orchid3" },
{ QRGB(139, 71,137), "orchid4" },
{ QRGB(238,232,170), "palegoldenrod" },
{ QRGB(152,251,152), "palegreen" },
{ QRGB(154,255,154), "palegreen1" },
{ QRGB(144,238,144), "palegreen2" },
{ QRGB(124,205,124), "palegreen3" },
{ QRGB( 84,139, 84), "palegreen4" },
{ QRGB(175,238,238), "paleturquoise" },
{ QRGB(187,255,255), "paleturquoise1" },
{ QRGB(174,238,238), "paleturquoise2" },
{ QRGB(150,205,205), "paleturquoise3" },
{ QRGB(102,139,139), "paleturquoise4" },
{ QRGB(219,112,147), "palevioletred" },
{ QRGB(255,130,171), "palevioletred1" },
{ QRGB(238,121,159), "palevioletred2" },
{ QRGB(205,104,137), "palevioletred3" },
{ QRGB(139, 71, 93), "palevioletred4" },
{ QRGB(255,239,213), "papayawhip" },
{ QRGB(255,218,185), "peachpuff" },
{ QRGB(255,218,185), "peachpuff1" },
{ QRGB(238,203,173), "peachpuff2" },
{ QRGB(205,175,149), "peachpuff3" },
{ QRGB(139,119,101), "peachpuff4" },
{ QRGB(205,133, 63), "peru" },
{ QRGB(255,192,203), "pink" },
{ QRGB(255,181,197), "pink1" },
{ QRGB(238,169,184), "pink2" },
{ QRGB(205,145,158), "pink3" },
{ QRGB(139, 99,108), "pink4" },
{ QRGB(221,160,221), "plum" },
{ QRGB(255,187,255), "plum1" },
{ QRGB(238,174,238), "plum2" },
{ QRGB(205,150,205), "plum3" },
{ QRGB(139,102,139), "plum4" },
{ QRGB(176,224,230), "powderblue" },
{ QRGB(160, 32,240), "purple" },
{ QRGB(155, 48,255), "purple1" },
{ QRGB(145, 44,238), "purple2" },
{ QRGB(125, 38,205), "purple3" },
{ QRGB( 85, 26,139), "purple4" },
{ QRGB(255, 0, 0), "red" },
{ QRGB(255, 0, 0), "red1" },
{ QRGB(238, 0, 0), "red2" },
{ QRGB(205, 0, 0), "red3" },
{ QRGB(139, 0, 0), "red4" },
{ QRGB(188,143,143), "rosybrown" },
{ QRGB(255,193,193), "rosybrown1" },
{ QRGB(238,180,180), "rosybrown2" },
{ QRGB(205,155,155), "rosybrown3" },
{ QRGB(139,105,105), "rosybrown4" },
{ QRGB( 65,105,225), "royalblue" },
{ QRGB( 72,118,255), "royalblue1" },
{ QRGB( 67,110,238), "royalblue2" },
{ QRGB( 58, 95,205), "royalblue3" },
{ QRGB( 39, 64,139), "royalblue4" },
{ QRGB(139, 69, 19), "saddlebrown" },
{ QRGB(250,128,114), "salmon" },
{ QRGB(255,140,105), "salmon1" },
{ QRGB(238,130, 98), "salmon2" },
{ QRGB(205,112, 84), "salmon3" },
{ QRGB(139, 76, 57), "salmon4" },
{ QRGB(244,164, 96), "sandybrown" },
{ QRGB( 46,139, 87), "seagreen" },
{ QRGB( 84,255,159), "seagreen1" },
{ QRGB( 78,238,148), "seagreen2" },
{ QRGB( 67,205,128), "seagreen3" },
{ QRGB( 46,139, 87), "seagreen4" },
{ QRGB(255,245,238), "seashell" },
{ QRGB(255,245,238), "seashell1" },
{ QRGB(238,229,222), "seashell2" },
{ QRGB(205,197,191), "seashell3" },
{ QRGB(139,134,130), "seashell4" },
{ QRGB(160, 82, 45), "sienna" },
{ QRGB(255,130, 71), "sienna1" },
{ QRGB(238,121, 66), "sienna2" },
{ QRGB(205,104, 57), "sienna3" },
{ QRGB(139, 71, 38), "sienna4" },
{ QRGB(135,206,235), "skyblue" },
{ QRGB(135,206,255), "skyblue1" },
{ QRGB(126,192,238), "skyblue2" },
{ QRGB(108,166,205), "skyblue3" },
{ QRGB( 74,112,139), "skyblue4" },
{ QRGB(106, 90,205), "slateblue" },
{ QRGB(131,111,255), "slateblue1" },
{ QRGB(122,103,238), "slateblue2" },
{ QRGB(105, 89,205), "slateblue3" },
{ QRGB( 71, 60,139), "slateblue4" },
{ QRGB(112,128,144), "slategray" },
{ QRGB(198,226,255), "slategray1" },
{ QRGB(185,211,238), "slategray2" },
{ QRGB(159,182,205), "slategray3" },
{ QRGB(108,123,139), "slategray4" },
{ QRGB(112,128,144), "slategrey" },
{ QRGB(255,250,250), "snow" },
{ QRGB(255,250,250), "snow1" },
{ QRGB(238,233,233), "snow2" },
{ QRGB(205,201,201), "snow3" },
{ QRGB(139,137,137), "snow4" },
{ QRGB( 0,255,127), "springgreen" },
{ QRGB( 0,255,127), "springgreen1" },
{ QRGB( 0,238,118), "springgreen2" },
{ QRGB( 0,205,102), "springgreen3" },
{ QRGB( 0,139, 69), "springgreen4" },
{ QRGB( 70,130,180), "steelblue" },
{ QRGB( 99,184,255), "steelblue1" },
{ QRGB( 92,172,238), "steelblue2" },
{ QRGB( 79,148,205), "steelblue3" },
{ QRGB( 54,100,139), "steelblue4" },
{ QRGB(210,180,140), "tan" },
{ QRGB(255,165, 79), "tan1" },
{ QRGB(238,154, 73), "tan2" },
{ QRGB(205,133, 63), "tan3" },
{ QRGB(139, 90, 43), "tan4" },
{ QRGB(216,191,216), "thistle" },
{ QRGB(255,225,255), "thistle1" },
{ QRGB(238,210,238), "thistle2" },
{ QRGB(205,181,205), "thistle3" },
{ QRGB(139,123,139), "thistle4" },
{ QRGB(255, 99, 71), "tomato" },
{ QRGB(255, 99, 71), "tomato1" },
{ QRGB(238, 92, 66), "tomato2" },
{ QRGB(205, 79, 57), "tomato3" },
{ QRGB(139, 54, 38), "tomato4" },
{ QRGB( 64,224,208), "turquoise" },
{ QRGB( 0,245,255), "turquoise1" },
{ QRGB( 0,229,238), "turquoise2" },
{ QRGB( 0,197,205), "turquoise3" },
{ QRGB( 0,134,139), "turquoise4" },
{ QRGB(238,130,238), "violet" },
{ QRGB(208, 32,144), "violetred" },
{ QRGB(255, 62,150), "violetred1" },
{ QRGB(238, 58,140), "violetred2" },
{ QRGB(205, 50,120), "violetred3" },
{ QRGB(139, 34, 82), "violetred4" },
{ QRGB(245,222,179), "wheat" },
{ QRGB(255,231,186), "wheat1" },
{ QRGB(238,216,174), "wheat2" },
{ QRGB(205,186,150), "wheat3" },
{ QRGB(139,126,102), "wheat4" },
{ QRGB(255,255,255), "white" },
{ QRGB(245,245,245), "whitesmoke" },
{ QRGB(255,255, 0), "yellow" },
{ QRGB(255,255, 0), "yellow1" },
{ QRGB(238,238, 0), "yellow2" },
{ QRGB(205,205, 0), "yellow3" },
{ QRGB(139,139, 0), "yellow4" },
{ QRGB(154,205, 50), "yellowgreen" } };
#if defined(Q_C_CALLBACKS)
extern "C" {
#endif
#ifdef Q_OS_TEMP
static int __cdecl rgb_cmp( const void *d1, const void *d2 )
#else
static int rgb_cmp( const void *d1, const void *d2 )
#endif
{
return qstricmp( ((RGBData *)d1)->name, ((RGBData *)d2)->name );
}
#if defined(Q_C_CALLBACKS)
}
#endif
bool qt_get_named_rgb( const char *name, QRgb* rgb )
{
Q_LONG len = strlen(name)+1;
char *name_no_space = (char *)malloc(len);
for(Q_LONG o=0,i=0; i < len; i++) {
if(name[i] != '\t' && name[i] != ' ')
name_no_space[o++] = name[i];
}
RGBData x;
x.name = name_no_space;
// Function bsearch() is supposed to be
// void *bsearch(const void *key, const void *base, ...
// So why (char*)? Are there broken bsearch() declarations out there?
RGBData *r = (RGBData*)bsearch((char*)&x, (char*)rgbTbl, rgbTblSize,
sizeof(RGBData), rgb_cmp);
free(name_no_space);
if ( r ) {
*rgb = r->value;
return true;
} else {
return false;
}
}
uint qt_get_rgb_val( const char *name )
{
QRgb r;
qt_get_named_rgb(name,&r);
return r;
}
#ifndef QT_NO_STRINGLIST
QStringList QColor::colorNames()
{
int i = 0;
QStringList lst;
for ( i = 0; i < rgbTblSize; i++ )
lst << rgbTbl[i].name;
return lst;
}
#endif
#else
bool qt_get_named_rgb( const char *, QRgb* )
{
return false;
}
uint qt_get_rgb_val( const char * )
{
return 0;
}
#ifndef QT_NO_STRINGLIST
QStringList QColor::colorNames()
{
return QStringList();
}
#endif
#endif // QT_NO_COLORNAMES

Some files were not shown because too many files have changed in this diff Show more