QsciLexerDefault::QsciLexerDefault(QObject */*parent*/) { #ifdef Q_WS_MAC setDefaultFont(QFont("Monaco", 11)); #endif #ifdef Q_WS_X11 setDefaultFont(QFont("Monospace", 10)); #endif #ifdef Q_WS_WIN setDefaultFont(QFont("Consolas", 11)); #endif }
/************************************************************************* Set the default font to be used by the system *************************************************************************/ void System::setDefaultFont(const String& name) { if (name.empty()) { setDefaultFont(0); } else { setDefaultFont(FontManager::getSingleton().getFont(name)); } }
QsciLexerBin::QsciLexerBin(QObject */*parent*/) { #if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64) setDefaultFont(QFont("Monaco", 11)); #endif #ifdef Q_WS_X11 setDefaultFont(QFont("Monospace", 10)); #endif #ifdef Q_WS_WIN setDefaultFont(QFont("Consolas", 11)); #endif }
QsciLexerCA65::QsciLexerCA65(QObject */*parent*/) { QString regex; int rc; #if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64) setDefaultFont(QFont("Monaco", 11)); #endif #ifdef Q_WS_X11 setDefaultFont(QFont("Monospace", 10)); #endif #ifdef Q_WS_WIN setDefaultFont(QFont("Consolas", 11)); #endif labelRegex = QRegExp("^(\\s*)((\\.|@)?\\w+\\b:)"); numberRegex = QRegExp("(\\b\\d+\\b)|(\\$\\b[0-9A-Fa-f]+\\b)|(\\b[0-9][0-9A-Fa-f]*h\\b)|(%\\b[01]+\\b)"); regex = "\\b("; rc = 0; while ( CA65_mnemonics[rc] ) { regex += CA65_mnemonics[rc]; if ( CA65_mnemonics[rc+1] ) { regex += '|'; } rc++; } regex += ")\\b"; opcodeRegex.setPattern(regex); opcodeRegex.setCaseSensitivity(Qt::CaseInsensitive); regex = "\\.(\\b("; rc = 0; while ( CA65_keyword[rc] ) { regex += CA65_keyword[rc]; if ( CA65_keyword[rc+1] ) { regex += '|'; } rc++; } regex += ")\\b)"; keywordRegex.setPattern(regex); keywordRegex.setCaseSensitivity(Qt::CaseInsensitive); }
int main(int argc,char *argv[]) { QApplication::setStyle("Fusion"); QApplication a(argc,argv); QDir::setCurrent(a.applicationDirPath()); QString locale=QLocale::system().name(); QTranslator myTrans; myTrans.load(locale+".qm","./translations"); QTranslator qtTrans; qtTrans.load(locale+".qt.qm","./translations"); a.installTranslator(&myTrans); a.installTranslator(&qtTrans); Utils::loadConfig(); Shield::init(); Cookie::init(); setDefaultFont(); setToolTipBase(); a.connect(&a,&QApplication::aboutToQuit,[](){ Cookie::free(); Shield::free(); Utils::saveConfig(); }); Interface w; w.show(); return a.exec(); }
QwtRichTextDocument( const QString &text, int flags, const QFont &font ) { setUndoRedoEnabled( false ); setDefaultFont( font ); setHtml( text ); // make sure we have a document layout ( void )documentLayout(); QTextOption option = defaultTextOption(); if ( flags & Qt::TextWordWrap ) option.setWrapMode( QTextOption::WordWrap ); else option.setWrapMode( QTextOption::NoWrap ); option.setAlignment( ( Qt::Alignment ) flags ); setDefaultTextOption( option ); QTextFrame *root = rootFrame(); QTextFrameFormat fm = root->frameFormat(); fm.setBorder( 0 ); fm.setMargin( 0 ); fm.setPadding( 0 ); fm.setBottomMargin( 0 ); fm.setLeftMargin( 0 ); root->setFrameFormat( fm ); adjustSize(); }
void VideoSettings::create() { application.windows.append(this); Window::create(0, 0, 256, 256, "Video Settings"); setDefaultFont(application.proportionalFont); unsigned x = 5, y = 5; colorAdjustmentLabel.create(*this, x, y, 430, Style::LabelHeight, "Color Adjustment :."); y += Style::LabelHeight + 5; colorAdjustmentLabel.setFont(application.proportionalFontBold); contrastLabel.create (*this, x, y, 80, Style::SliderHeight, "Contrast:"); contrastValue.create (*this, x + 80, y, 50, Style::SliderHeight, "100%"); contrastSlider.create (*this, x + 130, y, 300, Style::SliderHeight, 201); y += Style::SliderHeight; brightnessLabel.create (*this, x, y, 80, Style::SliderHeight, "Brightness:"); brightnessValue.create (*this, x + 80, y, 40, Style::SliderHeight, "100%"); brightnessSlider.create(*this, x + 130, y, 300, Style::SliderHeight, 201); y += Style::SliderHeight; gammaLabel.create (*this, x, y, 80, Style::SliderHeight, "Gamma:"); gammaValue.create (*this, x + 80, y, 50, Style::SliderHeight, "100%"); gammaSlider.create (*this, x + 130, y, 300, Style::SliderHeight, 201); y += Style::SliderHeight + 5; gammaRampCheck.create (*this, x, y, 430, 15, "Enable NTSC gamma ramp simulation"); y += 15; setGeometry(160, 160, 440, y + 5); contrastSlider.setPosition(config.video.contrast); brightnessSlider.setPosition(config.video.brightness); gammaSlider.setPosition(config.video.gamma); gammaRampCheck.setChecked(config.video.useGammaRamp); contrastSlider.onChange = brightnessSlider.onChange = gammaSlider.onChange = gammaRampCheck.onTick = { &VideoSettings::adjust, this }; }
bool MainApp::load(){ bool err = false; if (!GL_ARB_shader_objects_supported || !GL_ARB_vertex_shader_supported || !GL_ARB_fragment_shader_supported || !GL_ARB_shading_language_100_supported){ addToLog("No GLSL support (GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_fragment_shader, GL_ARB_shading_language_100)\n"); err = true; } if (!GL_ARB_occlusion_query_supported){ addToLog("No occlusion query support (GL_ARB_occlusion_query)\n"); err = true; } if (err) return false; setDefaultFont("../Textures/Fonts/Future.font", "../Textures/Fonts/Future.dds"); if ((shader = renderer->addShader("shader.shd" )) == SHADER_NONE) return false; if ((base[0] = renderer->addTexture("../Textures/Wood.dds")) == TEXTURE_NONE) return false; if ((bump[0] = renderer->addTexture("../Textures/WoodBump.png", TEX_NORMALMAP)) == TEXTURE_NONE) return false; if ((base[1] = renderer->addTexture("../Textures/laying_rock7.dds")) == TEXTURE_NONE) return false; if ((bump[1] = renderer->addTexture("../Textures/laying_rock7Bump.png", TEX_NORMALMAP)) == TEXTURE_NONE) return false; if ((base[2] = renderer->addTexture("../Textures/victoria.dds")) == TEXTURE_NONE) return false; if ((bump[2] = renderer->addTexture("../Textures/victoriaBump.png", TEX_NORMALMAP)) == TEXTURE_NONE) return false; if ((particle = renderer->addTexture("../Textures/Particle.png")) == TEXTURE_NONE) return false; for (unsigned int i = 0; i < sectors.getCount(); i++){ sectors[i]->init(); } return true; }
QLexerPython::QLexerPython( QObject *parent ) : QsciLexerPython( parent ) { populateKeywords(); setDefaultFont( QFont( "Envy Code R", 9 ) ); setDefaultPaper( QColor( "#000000" ) ); setColor( QColor( "#FFFFFF" ), QsciLexerPython::Default ); setColor( QColor( "#AAAAFF" ), QsciLexerPython::ClassName ); setColor( QColor( "#55AA00" ), QsciLexerPython::Comment ); setColor( QColor( "#55AA00" ), QsciLexerPython::CommentBlock ); setColor( QColor( "#77DDFF" ), QsciLexerPython::Decorator ); setColor( QColor( "#FFFF00" ), QsciLexerPython::DoubleQuotedString ); setColor( QColor( "#FF00FF" ), QsciLexerPython::FunctionMethodName ); setColor( QColor( "#FFAAFF" ), QsciLexerPython::HighlightedIdentifier ); setColor( QColor( "#FFFFFF" ), QsciLexerPython::Identifier ); setColor( QColor( "#8080FF" ), QsciLexerPython::Keyword ); setColor( QColor( "#AC3C90" ), QsciLexerPython::Number ); setColor( QColor( "#FABBAF" ), QsciLexerPython::Operator ); setColor( QColor( "#FFFF00" ), QsciLexerPython::SingleQuotedString ); setColor( QColor( "#FF0000" ), QsciLexerPython::UnclosedString ); setColor( QColor( "#FFFF00" ), QsciLexerPython::TripleDoubleQuotedString ); setColor( QColor( "#FFFF00" ), QsciLexerPython::TripleSingleQuotedString ); setFont( QFont( "Envy Code R", 9 ), -1 ); setFoldComments( true ); setFoldQuotes( true ); };
void pLabel::setParent(Window &parent) { if(hwnd) DestroyWindow(hwnd); hwnd = CreateWindow(L"phoenix_label", L"", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, parent.p.hwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&label); setDefaultFont(); setText(label.state.text); }
int QTextDocument::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 14) qt_static_metacall(this, _c, _id, _a); _id -= 14; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< bool*>(_v) = isUndoRedoEnabled(); break; case 1: *reinterpret_cast< bool*>(_v) = isModified(); break; case 2: *reinterpret_cast< QSizeF*>(_v) = pageSize(); break; case 3: *reinterpret_cast< QFont*>(_v) = defaultFont(); break; case 4: *reinterpret_cast< bool*>(_v) = useDesignMetrics(); break; case 5: *reinterpret_cast< QSizeF*>(_v) = size(); break; case 6: *reinterpret_cast< qreal*>(_v) = textWidth(); break; case 7: *reinterpret_cast< int*>(_v) = blockCount(); break; case 8: *reinterpret_cast< qreal*>(_v) = indentWidth(); break; case 9: *reinterpret_cast< QString*>(_v) = defaultStyleSheet(); break; case 10: *reinterpret_cast< int*>(_v) = maximumBlockCount(); break; case 11: *reinterpret_cast< qreal*>(_v) = documentMargin(); break; } _id -= 12; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setUndoRedoEnabled(*reinterpret_cast< bool*>(_v)); break; case 1: setModified(*reinterpret_cast< bool*>(_v)); break; case 2: setPageSize(*reinterpret_cast< QSizeF*>(_v)); break; case 3: setDefaultFont(*reinterpret_cast< QFont*>(_v)); break; case 4: setUseDesignMetrics(*reinterpret_cast< bool*>(_v)); break; case 6: setTextWidth(*reinterpret_cast< qreal*>(_v)); break; case 8: setIndentWidth(*reinterpret_cast< qreal*>(_v)); break; case 9: setDefaultStyleSheet(*reinterpret_cast< QString*>(_v)); break; case 10: setMaximumBlockCount(*reinterpret_cast< int*>(_v)); break; case 11: setDocumentMargin(*reinterpret_cast< qreal*>(_v)); break; } _id -= 12; } else if (_c == QMetaObject::ResetProperty) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 12; } #endif // QT_NO_PROPERTIES return _id; }
void pButton::constructor() { hwnd = CreateWindow(L"BUTTON", L"", WS_CHILD | WS_TABSTOP, 0, 0, 0, 0, parentWindow->p.hwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&button); setDefaultFont(); setImage(button.state.image, button.state.orientation); //setText(button.state.text); //called by setImage(); synchronize(); }
void EditPreferences::changeDefaultFont() { bool valid = false; QFont fnt = QFontDialog::getFont(&valid, _leDefaultFont->font(), this); if(valid) { setDefaultFont(fnt); } }
QLexerDefault::QLexerDefault( QObject *parent ) : QsciLexerCustom( parent ) { setDefaultFont( QFont( "Envy Code R", 9 ) ); setDefaultPaper( QColor( "#000000" ) ); setColor( QColor( "#FFFFFF" ), 0 ); setFont( QFont( "Envy Code R", 9 ), -1 ); };
void pCheckButton::constructor() { hwnd = CreateWindow(L"BUTTON", L"", WS_CHILD | WS_TABSTOP | BS_CHECKBOX | BS_PUSHLIKE, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&checkButton); setDefaultFont(); setChecked(checkButton.state.checked); setImage(checkButton.state.image, checkButton.state.orientation); //setText(checkButton.state.text); synchronize(); }
void pRadioButton::constructor() { hwnd = CreateWindow( L"BUTTON", L"", WS_CHILD | WS_TABSTOP | BS_RADIOBUTTON, 0, 0, 0, 0, parentWindow->p.hwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&radioButton); setDefaultFont(); if(radioButton.state.checked) setChecked(); setText(radioButton.state.text); synchronize(); }
void pLineEdit::constructor() { hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD | WS_TABSTOP | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&lineEdit); setDefaultFont(); setEditable(lineEdit.state.editable); setText(lineEdit.state.text); synchronize(); }
void pTextEdit::constructor() { hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD | WS_TABSTOP | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_WANTRETURN | (textEdit.state.wordWrap == false ? WS_HSCROLL | ES_AUTOHSCROLL : 0), 0, 0, 0, 0, parentWindow->p.hwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&textEdit); setDefaultFont(); setCursorPosition(textEdit.state.cursorPosition); setEditable(textEdit.state.editable); setText(textEdit.state.text); synchronize(); }
void pConsole::constructor() { hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD | WS_TABSTOP | ES_READONLY | ES_MULTILINE | ES_WANTRETURN, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&console); setDefaultFont(); windowProc = (LRESULT CALLBACK (*)(HWND, UINT, LPARAM, WPARAM))GetWindowLongPtr(hwnd, GWLP_WNDPROC); SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)Console_windowProc); synchronize(); }
Local::Local(int &argc,char **argv): QGuiApplication(argc,argv) { QDir::setCurrent(QStandardPaths::writableLocation(QStandardPaths::DataLocation)); Config::load(); Shield::load(); setDefaultFont(); connect(this,&Local::aboutToQuit,[](){ Shield::save(); Config::save(); }); qsrand(QTime::currentTime().msec()); }
void pComboButton::constructor() { hwnd = CreateWindow( L"COMBOBOX", L"", WS_CHILD | WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS, 0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&comboButton); setDefaultFont(); for(auto& text : comboButton.state.text) append(text); setSelection(comboButton.state.selection); synchronize(); }
int main(int argc,char *argv[]) { QDir::setCurrent(QFileInfo(QString::fromLocal8Bit(argv[0])).absolutePath()); Local::addLibraryPath("./plugins"); Local::setStyle("Fusion"); Local a(argc,argv); Config::load(); int single; if((single=Config::getValue("/Interface/Single",1))){ QLocalSocket socket; socket.connectToServer("BiliLocalInstance"); if(socket.waitForConnected()){ QDataStream s(&socket); s<<a.arguments().mid(1); socket.waitForBytesWritten(); return 0; } } Shield::load(); loadTranslator(); setDefaultFont(); setToolTipBase(); a.connect(&a,&Local::aboutToQuit,[](){ Shield::save(); Config::save(); }); qsrand(QTime::currentTime().msec()); Interface w; Plugin::loadPlugins(); w.show(); w.tryLocal(a.arguments().mid(1)); QLocalServer *server=NULL; if(single){ server=new QLocalServer(qApp); server->listen("BiliLocalInstance"); QObject::connect(server,&QLocalServer::newConnection,[&](){ QLocalSocket *r=server->nextPendingConnection(); r->waitForReadyRead(); QDataStream s(r); QStringList args; s>>args; r->deleteLater(); w.tryLocal(args); }); }
void pListView::constructor() { lostFocus = false; hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, WC_LISTVIEW, L"", WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | LVS_NOCOLUMNHEADER, 0, 0, 0, 0, parentWindow->p.hwnd, (HMENU)id, GetModuleHandle(0), 0 ); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&listView); setDefaultFont(); setHeaderText(listView.state.headerText); setHeaderVisible(listView.state.headerVisible); setCheckable(listView.state.checkable); for(auto &text : listView.state.text) append(text); for(unsigned n = 0; n < listView.state.checked.size(); n++) setChecked(n, listView.state.checked[n]); setImageList(); if(listView.state.selected) setSelection(listView.state.selection); autoSizeColumns(); synchronize(); }
Document::Document (const QString& filename, QObject *plugin) : DocURL_ (QUrl::fromLocalFile (filename)) , Plugin_ (plugin) { SetSettings (); QFile file (filename); if (!file.open (QIODevice::ReadOnly)) { qWarning () << Q_FUNC_INFO << "unable to open file" << file.fileName () << file.errorString (); return; } QDomDocument doc; if (!doc.setContent (file.readAll (), true)) { qWarning () << Q_FUNC_INFO << "malformed XML in" << filename; return; } FB2Converter conv (this, doc); auto textDoc = conv.GetResult (); const auto& defaultFont = XmlSettingsManager::Instance () .property ("DefaultFont").value<QFont> (); textDoc->setDefaultFont (defaultFont); textDoc->setPageSize (QSize { XmlSettingsManager::Instance ().property ("PageWidth").toInt (), XmlSettingsManager::Instance ().property ("PageHeight").toInt () }); SetDocument (textDoc); Info_ = conv.GetDocumentInfo (); TOC_ = conv.GetTOC (); }
////////////////////////////////////////////////////////////////////////////////////////// // RtfWriter::writeHeader //! Writes RTF header //! //! \param[in] font - Font name //! //! \throw wtl::domain_error - I/O error occurred ////////////////////////////////////////////////////////////////////////////////////////// void writeHeader(const char* font) { // Header writeString("{\\rtf1\\ansi"); // Set codepage + language setCodePage(1250); setDefaultFont(0); setLanguage(2057); // English UK (0x0809 == 2057) // Font table writeString("{\\fonttbl{\\f0\\fswiss\\fcharset0 "); write(font); writeString(";}}\n"); // Colour table writeString("{\\colortbl"); writeString(";"); // Define colour 0 as 'auto-colour' for (COLORREF c : Colours) writeColour(c); writeString("}\n"); // Unknown previous formatting: //\\sa200\\sl276\\slmult1 // // \saN == spacing after // \slN == space between lines // \smult == Line spacing multiple // \pard == reset paragraph formatting // Set view: 0==None, 1==Page Layout view, 2==Outline view, 3==Master Document view, 4==Normal view, 5==Online Layout view writeString("\\viewkind4"); // Set unicode destination (not sure) writeString("\\uc1 "); // Reset paragraph resetParagraph(); }
void PrefInterface::setData(Preferences * pref) { setLanguage( pref->language ); setIconSet( pref->iconset ); setResizeMethod( pref->resize_method ); setSaveSize( pref->save_window_size_on_exit ); #ifdef SINGLE_INSTANCE setUseSingleInstance(pref->use_single_instance); #endif setRecentsMaxItems(pref->history_recents->maxItems()); setSeeking1(pref->seeking1); setSeeking2(pref->seeking2); setSeeking3(pref->seeking3); setSeeking4(pref->seeking4); setUpdateWhileDragging(pref->update_while_seeking); setRelativeSeeking(pref->relative_seeking); setPreciseSeeking(pref->precise_seeking); setDefaultFont(pref->default_font); setHideVideoOnAudioFiles(pref->hide_video_window_on_audio_files); #if STYLE_SWITCHING setStyle( pref->style ); #endif setGUI(pref->gui); setFloatingAnimated(pref->floating_control_animated); setFloatingWidth(pref->floating_control_width); setFloatingMargin(pref->floating_control_margin); setDisplayFloatingInCompactMode(pref->floating_display_in_compact_mode); #ifndef Q_OS_WIN setFloatingBypassWindowManager(pref->bypass_window_manager); #endif }
int main(int argc, char *argv[]) { Local a(argc, argv); int single; if ((single = Config::getValue("/Interface/Single", 1))){ QLocalSocket socket; socket.connectToServer("BiliLocalInstance"); if (socket.waitForConnected()){ QDataStream s(&socket); s << a.arguments().mid(1); socket.waitForBytesWritten(); return 0; } } loadTranslator(); setDefaultFont(); setToolTipBase(); Interface w; Plugin::loadPlugins(); if (!w.testAttribute(Qt::WA_WState_ExplicitShowHide)){ w.show(); } w.tryLocal(a.arguments().mid(1)); QLocalServer *server = nullptr; if (single){ server = new QLocalServer(lApp); server->listen("BiliLocalInstance"); QObject::connect(server, &QLocalServer::newConnection, [&](){ QLocalSocket *r = server->nextPendingConnection(); r->waitForReadyRead(); QDataStream s(r); QStringList args; s >> args; delete r; w.tryLocal(args); }); }
void GUIFontManager::setDefaultFont(size_t index) { setDefaultFont(getFont(index)); }
void RGLView::setFontUseFreeType(bool useFreeType) { setDefaultFont(getFontFamily(), getFontStyle(), getFontCex(), useFreeType); }
void RGLView::setFontCex(double cex) { setDefaultFont(getFontFamily(), getFontStyle(), cex, getFontUseFreeType()); }