void FoompButton::draw (HDC buf) { //Create drawing tools HPEN hDefPen = CreatePen(PS_SOLID, 1, getStyles().OuterStyle.TextColor); HPEN hPressedPen = CreatePen(PS_SOLID, 1, getStyles().ButtonStyle.TextColor); HPEN hShadowPen = CreatePen(PS_SOLID, 1, GetShadowColor(getStyles().OuterStyle)); HPEN hPressedShadowPen = CreatePen(PS_SOLID, 1, GetShadowColor(getStyles().ButtonStyle)); //Save current object HGDIOBJ prev = SelectObject(buf,hDefPen); if (pressed) MakeStyleGradient(buf, &hitrect, &getStyles().ButtonStyle, false); if (getSettings().FooShadowsEnabled) { SelectObject(buf,pressed ? hPressedShadowPen : hShadowPen); drawShape(buf,x+1,y+1); } SelectObject(buf,pressed ? hPressedPen : hDefPen); drawShape(buf,x,y); //Revert old object SelectObject(buf, prev); //Destroy drawing tools DeleteObject(hDefPen); DeleteObject(hPressedPen); DeleteObject(hShadowPen); DeleteObject(hPressedShadowPen); }
void IdeSkin::apply(shared_ptr<HtmlPage> page) { OS_ASSERT(page != nullptr); if(page == nullptr || isValid() == false) return; const StringList &styles = getStyles(); // Scorre gli stylesheet dello schema for(StringList::const_iterator i = styles.begin(); i != styles.end(); ++i) { // Nota: i css specifici della skin non devono essere caricati dalla base se non vengono trovati // Inizializza l'url del css String css_url = findResource(*i, true); if(css_url.empty() == false) page->addCss(css_url); } const StringList &scripts = getScripts(); // Scorre gli scripts dello schema for(StringList::const_iterator i = scripts.begin(); i != scripts.end(); ++i) { // Nota: i js specifici della skin non devono essere caricati dalla base se non vengono trovati // Inizializza l'url del js String js_url = findResource(*i, true); if(js_url.empty() == false) page->addJavascript(js_url); } }
void writeGetStyles( QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, QgsServerResponse &response ) { QDomDocument doc = getStyles( serverIface, project, version, request ); response.setHeader( QStringLiteral( "Content-Type" ), QStringLiteral( "text/xml; charset=utf-8" ) ); response.write( doc.toByteArray() ); }
void QgsFieldConditionalFormatWidget::reloadStyles() { mModel->clear(); foreach ( QgsConditionalStyle style, getStyles() ) { QStandardItem* item = new QStandardItem( style.displayText() ); item->setIcon( QIcon( style.renderPreview() ) ); mModel->appendRow( item ); }
void QgsFieldConditionalFormatWidget::saveRule() { QList<QgsConditionalStyle> styles = getStyles(); QgsConditionalStyle style = QgsConditionalStyle(); style.setRule( mRuleEdit->text() ); style.setName( mNameEdit->text() ); QColor backColor = btnBackgroundColor->color(); QColor fontColor = btnTextColor->color(); QFont font = mFontFamilyCmbBx->currentFont(); font.setBold( mFontBoldBtn->isChecked() ); font.setItalic( mFontItalicBtn->isChecked() ); font.setStrikeOut( mFontStrikethroughBtn->isChecked() ); font.setUnderline( mFontUnderlineBtn->isChecked() ); style.setFont( font ); style.setBackgroundColor( backColor ); style.setTextColor( fontColor ); if ( mSymbol && checkIcon->isChecked() ) { style.setSymbol( mSymbol ); } else { style.setSymbol( 0 ); } if ( mEditing ) { styles.replace( mEditIndex, style ); } else { styles.append( style ); } QString fieldName; if ( fieldRadio->isChecked() ) { fieldName = mFieldCombo->currentField(); mLayer->conditionalStyles()->setFieldStyles( fieldName, styles ); } if ( rowRadio->isChecked() ) { mLayer->conditionalStyles()->setRowStyles( styles ); } pages->setCurrentIndex( 0 ); reloadStyles(); emit rulesUpdated( fieldName ); reset(); }
void Settings::updateStyles() { ui->CSS->blockSignals(true); ui->mini_CSS->blockSignals(true); QString css = ui->CSS->currentText(); QString minicss = ui->mini_CSS->currentText(); ui->CSS->clear();; ui->mini_CSS->clear(); QStringList styles = getStyles(); ui->CSS->addItems(styles); QStringList mini_styles = getStyles(QString("mini")); ui->mini_CSS->addItems(mini_styles); ui->CSS->setCurrentText(css); ui->mini_CSS->setCurrentText(minicss); ui->CSS->blockSignals(false); ui->mini_CSS->blockSignals(false); }
void visitElement(const utymap::entities::Element &element, const Coordinates &coordinates) { auto ctags = getTags(element); auto cstyles = getStyles(element); fillVertices(coordinates); elementCallback_(tag_, element.id, ctags.data(), static_cast<int>(ctags.size()), vertices_.data(), static_cast<int>(vertices_.size()), cstyles.data(), static_cast<int>(cstyles.size())); // NOTE clear vectors after raw array data is consumed by external code vertices_.clear(); tagStrings_.clear(); styleStrings_.clear(); }
void QgsFieldConditionalFormatWidget::deleteRule() { QList<QgsConditionalStyle> styles = getStyles(); styles.removeAt( mEditIndex ); QString fieldName; if ( fieldRadio->isChecked() ) { fieldName = mFieldCombo->currentField(); mLayer->conditionalStyles()->setFieldStyles( fieldName, styles ); } if ( rowRadio->isChecked() ) { mLayer->conditionalStyles()->setRowStyles( styles ); } pages->setCurrentIndex( 0 ); reloadStyles(); emit rulesUpdated( fieldName ); }
void QgsFieldConditionalFormatWidget::ruleClicked( QModelIndex index ) { QList<QgsConditionalStyle> styles = getStyles(); QgsConditionalStyle style = styles.at( index.row() ); editStyle( index.row(), style ); }
/** * Main Application. Currently, drawing styles are hardcoded in this method. * Future work may entail reading the styles from a .properties file. */ int main( int argc, const char* argv[] ) { FILE *pfile; LWGEOM *lwgeom; char line [2048]; char *filename; int layerCount; int styleNumber; LAYERSTYLE *styles; getStyles(&styles); if ( argc != 2 ) { lwerror("You must specifiy a wkt filename to convert.\n"); return -1; } if ( (pfile = fopen(argv[1], "r")) == NULL) { perror ( argv[1] ); return -1; } filename = malloc( strlen(argv[1])+11 ); strncpy( filename, "../images/", 10 ); strncat( filename, argv[1], strlen(argv[1])-3 ); strncat( filename, "png", 3 ); printf( "generating %s\n", filename ); layerCount = 0; while ( fgets ( line, sizeof line, pfile ) != NULL && !isspace(*line) ) { char output[2048]; char *ptr = output; char *styleName; int useDefaultStyle; ptr += sprintf( ptr, "convert -size %s xc:none ", imageSize ); useDefaultStyle = getStyleName(&styleName, line); LWDEBUGF( 4, "%s", styleName ); if (useDefaultStyle) { printf(" Warning: using Default style for layer %d\n", layerCount); lwgeom = lwgeom_from_ewkt( line, PARSER_CHECK_NONE ); } else lwgeom = lwgeom_from_ewkt( line+strlen(styleName)+1, PARSER_CHECK_NONE ); LWDEBUGF( 4, "geom = %s", lwgeom_to_ewkt((LWGEOM*)lwgeom,0) ); styleNumber = layerCount % length(styles); ptr += drawGeometry( ptr, lwgeom, getStyle(styles, styleName) ); ptr += sprintf( ptr, "-flip tmp%d.png", layerCount ); lwfree( lwgeom ); LWDEBUGF( 4, "%s", output ); system(output); addHighlight( layerCount ); addDropShadow( layerCount ); layerCount++; free(styleName); } flattenLayers(filename); optimizeImage(filename); fclose(pfile); free(filename); freeStyles(&styles); return 0; }