Exemple #1
0
// Wait until the DRO bit changes to 0
void CocoDisk::waitDR() {
  int i=0;
  loadStatus();
  while (fdcstat & 0x02) {
    loadStatus();
  }
}
void CSSFontFace::load(const FontDescription& fontDescription)
{
    if (loadStatus() == FontFace::Unloaded)
        setLoadStatus(FontFace::Loading);
    ASSERT(loadStatus() == FontFace::Loading);

    while (!m_sources.isEmpty()) {
        OwnPtrWillBeMember<CSSFontFaceSource>& source = m_sources.first();
        if (source->isValid()) {
            if (source->isLocal()) {
                if (source->isLocalFontAvailable(fontDescription)) {
                    setLoadStatus(FontFace::Loaded);
                    return;
                }
            } else {
                if (!source->isLoaded())
                    source->beginLoadIfNeeded();
                else
                    setLoadStatus(FontFace::Loaded);
                return;
            }
        }
        m_sources.removeFirst();
    }
    setLoadStatus(FontFace::Error);
}
bool CSSFontFace::maybeScheduleFontLoad(const FontDescription& fontDescription, UChar32 character)
{
    if (m_ranges.contains(character)) {
        if (loadStatus() == FontFace::Unloaded)
            load(fontDescription);
        return true;
    }
    return false;
}
bool CSSFontFace::maybeScheduleFontLoad(const FontDescription& fontDescription, const FontDataRange& range)
{
    if (m_ranges.contains(range) || (range.isEntireRange() && m_ranges.isEntireRange())) {
        if (loadStatus() == FontFace::Unloaded) {
            load(fontDescription);
        }
        return true;
    }
    return false;
}
PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontDescription)
{
    if (!isValid())
        return nullptr;

    while (!m_sources.isEmpty()) {
        OwnPtrWillBeMember<CSSFontFaceSource>& source = m_sources.first();
        if (RefPtr<SimpleFontData> result = source->getFontData(fontDescription)) {
            if (loadStatus() == FontFace::Unloaded && (source->isLoading() || source->isLoaded()))
                setLoadStatus(FontFace::Loading);
            if (loadStatus() == FontFace::Loading && source->isLoaded())
                setLoadStatus(FontFace::Loaded);
            return result.release();
        }
        m_sources.removeFirst();
    }

    if (loadStatus() == FontFace::Unloaded)
        setLoadStatus(FontFace::Loading);
    if (loadStatus() == FontFace::Loading)
        setLoadStatus(FontFace::Error);
    return nullptr;
}
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , m_tabWidget(0)
    , m_updater(0)
    , m_fileBrowser(0)
    , m_resultView(0)
    , m_chartView(0)
{
    setObjectName("MainWindow");
    setWindowIcon(QIcon(":/Icon/Logo32x32.png"));
    setMinimumSize(MIMNUM_WIDTH, MIMNUM_HEIGHT);
    setContextMenuPolicy(Qt::NoContextMenu);

    loadStatus();

    init();
}
Exemple #7
0
void CSSFontFace::fontLoaded(RemoteFontFaceSource* source)
{
    if (!isValid() || source != m_sources.first())
        return;

    if (loadStatus() == FontFace::Loading) {
        if (source->ensureFontData()) {
            setLoadStatus(FontFace::Loaded);
        } else {
            m_sources.removeFirst();
            load();
        }
    }

    if (m_segmentedFontFace)
        m_segmentedFontFace->fontLoaded(this);
}
void CSSFontFace::fontLoaded(RemoteFontFaceSource* source)
{
    if (!isValid() || source != m_sources.first())
        return;

    if (loadStatus() == FontFace::Loading) {
        if (source->isValid()) {
            setLoadStatus(FontFace::Loaded);
        } else if (source->displayPeriod() == RemoteFontFaceSource::FailurePeriod) {
            m_sources.clear();
            setLoadStatus(FontFace::Error);
        } else {
            m_sources.removeFirst();
            load();
        }
    }

    if (m_segmentedFontFace)
        m_segmentedFontFace->fontFaceInvalidated();
}
Exemple #9
0
void CSSFontFace::fontLoaded(RemoteFontFaceSource* source)
{
    if (m_segmentedFontFace)
        m_segmentedFontFace->fontSelector()->fontFaceInvalidated();

    if (!isValid() || source != m_sources.first())
        return;

    if (loadStatus() == FontFace::Loading) {
        if (source->ensureFontData()) {
            setLoadStatus(FontFace::Loaded);
            Document* document = m_segmentedFontFace ? m_segmentedFontFace->fontSelector()->document() : 0;
            if (document && source->isSVGFontFaceSource())
                UseCounter::count(*document, UseCounter::SVGFontInCSS);
        } else {
            m_sources.removeFirst();
            load();
        }
    }

    if (m_segmentedFontFace)
        m_segmentedFontFace->fontLoaded(this);
}
void CSSFontFace::didBeginLoad()
{
    if (loadStatus() == FontFace::Unloaded)
        setLoadStatus(FontFace::Loading);
}
Exemple #11
0
MainWindow::MainWindow(bool verbose, QWindow *parent) : QQuickView(parent) {

	connect(this, SIGNAL(statusChanged(QQuickView::Status)), this, SLOT(loadStatus(QQuickView::Status)));

#ifdef Q_OS_WIN
	QtWin::enableBlurBehindWindow(this);
#endif

	// Settings and variables
	settingsPerSession = new SettingsSession;
	settingsPermanent = new Settings;
	fileformats = new FileFormats(verbose);
	variables = new Variables;
	shortcuts = new Shortcuts;
	touch = new TouchHandler;

	variables->verbose = verbose;

	overrideCursorHowOftenSet = 0;

	this->setMinimumSize(QSize(800,600));

	// Add image providers
	this->engine()->addImageProvider("thumb",new ImageProviderThumbnail);
	this->engine()->addImageProvider("full",new ImageProviderFull);
	this->engine()->addImageProvider("icon",new ImageProviderIcon);

	// Add settings access to QML
	qmlRegisterType<Settings>("Settings", 1, 0, "Settings");
	qmlRegisterType<FileFormats>("FileFormats", 1, 0, "FileFormats");
	qmlRegisterType<SettingsSession>("SettingsSession", 1, 0, "SettingsSession");
	qmlRegisterType<GetMetaData>("GetMetaData", 1, 0, "GetMetaData");
	qmlRegisterType<GetAndDoStuff>("GetAndDoStuff", 1, 0, "GetAndDoStuff");
	qmlRegisterType<ThumbnailManagement>("ThumbnailManagement", 1, 0, "ThumbnailManagement");
	qmlRegisterType<ToolTip>("ToolTip", 1, 0, "ToolTip");
	qmlRegisterType<ShortcutsNotifier>("ShortcutsNotifier", 1, 0, "ShortcutsNotifier");
	qmlRegisterType<Colour>("Colour", 1, 0, "Colour");

	// Load QML
	this->setSource(QUrl("qrc:/qml/mainwindow.qml"));
	this->setColor(QColor(Qt::transparent));

	// Get object (for signals and stuff)
	object = this->rootObject();

	// Class to load a new directory
	loadDir = new LoadDir(verbose);

	// Scrolled view
	connect(object, SIGNAL(thumbScrolled(int)), this, SLOT(handleThumbnails(int)));


	connect(object, SIGNAL(reloadDirectory(QString,QString)), this, SLOT(handleOpenFileEvent(QString,QString)));
	connect(object, SIGNAL(loadMoreThumbnails()), this, SLOT(loadMoreThumbnails()));
	connect(object, SIGNAL(didntLoadThisThumbnail(int)), this, SLOT(didntLoadThisThumbnail(int)));
	connect(object, SIGNAL(setOverrideCursor()), this, SLOT(setOverrideCursor()));
	connect(object, SIGNAL(restoreOverrideCursor()), this, SLOT(restoreOverrideCursor()));
	connect(object, SIGNAL(stopThumbnails()), this, SLOT(stopThumbnails()));
	connect(object, SIGNAL(reloadThumbnails()), this, SLOT(reloadThumbnails()));

	connect(object, SIGNAL(verboseMessage(QString,QString)), this, SLOT(qmlVerboseMessage(QString,QString)));

	// Hide/Quit window
	connect(object, SIGNAL(hideToSystemTray()), this, SLOT(hideToSystemTray()));
	connect(object, SIGNAL(quitPhotoQt()), this, SLOT(quitPhotoQt()));

	// React to some settings...
	connect(settingsPermanent, SIGNAL(trayiconChanged(int)), this, SLOT(showTrayIcon()));
	connect(settingsPermanent, SIGNAL(trayiconChanged(int)), this, SLOT(hideTrayIcon()));
	connect(settingsPermanent, SIGNAL(windowmodeChanged(bool)), this, SLOT(updateWindowGeometry()));
	connect(settingsPermanent, SIGNAL(windowDecorationChanged(bool)), this, SLOT(updateWindowGeometry()));

	connect(this, SIGNAL(xChanged(int)), this, SLOT(updateWindowXandY()));
	connect(this, SIGNAL(yChanged(int)), this, SLOT(updateWindowXandY()));

	// Pass on touchevent
	connect(touch, SIGNAL(receivedTouchEvent(QPointF,QPointF,qint64,int,QStringList)), this, SLOT(passOnTouchEvent(QPointF,QPointF,qint64,int,QStringList)));
	connect(touch, SIGNAL(setImageInteractiveMode(bool)), this, SLOT(setImageInteractiveMode(bool)));

	showTrayIcon();

	// We need to call this with a little delay, as the automatic restoration of the window geometry at startup when window mode
	// is enabled doesn't update the actualy window x/y (and thus PhotoQt might be detected on the wrong screen which messes up
	// calculations involving local cursor coordinates (e.g., for 'close on click on grey'))
	QTimer::singleShot(100,this, SLOT(updateWindowXandY()));

}