コード例 #1
0
ファイル: CrBattle_Class.cpp プロジェクト: At-sushi/Cresteaju
//---パターンを自動設定
void CrBattleCharacter::SetPatternAuto(void)
{
	if(!GetDrawType()){
		if(IsDown()){
			SetPattern(4);
		} else {
			SetPattern(0);
		}
	} else {
		SetPattern(0);
	}
}
コード例 #2
0
ファイル: painter.c プロジェクト: axelmuhr/Helios-NG
void Painter::Init () {
    if (solid == nil) {
	solid = new Pattern(0xffff);
	clear = new Pattern(0);
	lightgray = new Pattern(0x8020);
	gray = new Pattern(0xa5a5);
	darkgray = new Pattern(0xfafa);
	single = new Brush(0xffff, 0);
    }
    foreground = nil;
    background = nil;
    pattern = nil;
    br = nil;
    font = nil;
    style = 0;
    matrix = nil;
    SetColors(black, white);
    SetPattern(solid);
    FillBg(true);
    SetBrush(single);
    SetFont(stdfont);
    SetStyle(Plain);
    SetOrigin(0, 0);
    MoveTo(0, 0);
}
コード例 #3
0
ファイル: QRoundedRect.cpp プロジェクト: maqiangddb/pc_code
void QRoundedRect::setRectA(const QRectF &rect)
{
    QRectF rectA = rect;
    qreal dDelta = 0.0;

    QPen pen = this->pen();
    int iPenWidth = pen.width();
    if (iPenWidth > 0)
    {
        dDelta = (iPenWidth * 1.0) / 2;
        rectA.setTop(rectA.top() + dDelta);
        rectA.setLeft(rectA.left() + dDelta);
        rectA.setWidth(rectA.width() - dDelta);
        rectA.setHeight(rectA.height() - dDelta);
    }

    qHeight = rectA.height();
    qWidth = rectA.width();
    Rpos.setX(rectA.x());
    Rpos.setY(rectA.y());

    QPainterPath path;
    path.addRoundedRect(rectA,xRadius,yRadius,Qt::AbsoluteSize);
    RectPath = path;
    setPath(RectPath);
    SetPattern(nPatternType);
}
コード例 #4
0
ファイル: qelipseitem.cpp プロジェクト: maqiangddb/pc_code
void QElipseItem::setRectA(const QRectF &rect)
{
    QRectF rectA = rect;
//    qreal dDelta = 0.0;

//    if (this->GetSpanAngle() < 360)
//    {
//        rectA.setHeight(rectA.height() * 2);
//    }

//    QPen pen = this->pen();
//    int iPenWidth = pen.width();
//    if (iPenWidth > 0)
//    {
//        dDelta = (iPenWidth * 1.0) / 2;
//        rectA.setTop(rectA.top() + dDelta);
//        rectA.setLeft(rectA.left() + dDelta);
//        rectA.setWidth(rectA.width() - dDelta);
//        rectA.setHeight(rectA.height() - dDelta);
//    }

    this->setRect(rectA);

//    if (this->GetSpanAngle() < 360)
//    {
//        this->SetStartAngle(this->GetStartAngle());
//        this->SetSpanAngle(this->GetSpanAngle());
//    }

    SetPattern(nPatternType);
}
コード例 #5
0
ファイル: gfxContext.cpp プロジェクト: typ4rk/mozilla-history
void
gfxContext::PixelSnappedRectangleAndSetPattern(const gfxRect& rect,
                                               gfxPattern *pattern)
{
    gfxRect r(rect);

    // Bob attempts to pixel-snap the rectangle, and returns true if
    // the snapping succeeds.  If it does, we need to set up an
    // identity matrix, because the rectangle given back is in device
    // coordinates.
    //
    // We then have to call a translate to dr.pos afterwards, to make
    // sure the image lines up in the right place with our pixel
    // snapped rectangle.
    //
    // If snapping wasn't successful, we just translate to where the
    // pattern would normally start (in app coordinates) and do the
    // same thing.

    gfxMatrix mat = CurrentMatrix();
    if (UserToDevicePixelSnapped(r)) {
        IdentityMatrix();
    }

    Translate(r.TopLeft());
    r.MoveTo(gfxPoint(0, 0));
    Rectangle(r);
    SetPattern(pattern);

    SetMatrix(mat);
}
コード例 #6
0
bool TextInlineFormat_Underline::CompareAndUpdateProperties(const std::wstring& pattern)
{
	if (_wcsicmp(GetPattern().c_str(), pattern.c_str()) != 0)
	{
		SetPattern(pattern);
		return true;
	}

	return false;
}
コード例 #7
0
ファイル: QRoundedRect.cpp プロジェクト: maqiangddb/pc_code
void QRoundedRect::SetyRadius(qreal qyRadius)
{
    yRadius = qyRadius;
    QRectF rc(0,0,qWidth,qHeight);
    QPainterPath path;
    path.addRoundedRect(rc,xRadius,qyRadius,Qt::AbsoluteSize);
    RectPath = path;
    setPath(RectPath);
    SetPattern(nPatternType);
}
コード例 #8
0
ファイル: QRoundedRect.cpp プロジェクト: maqiangddb/pc_code
void QRoundedRect::SetHeight(qreal Height)
{
    qHeight = Height;
    QRectF rc(0,0,qWidth,Height);
    QPainterPath path;
    path.addRoundedRect(rc,xRadius,yRadius,Qt::AbsoluteSize);
    RectPath = path;
    setPath(RectPath);
    SetPattern(nPatternType);
}
コード例 #9
0
bool TextInlineFormat_Color::CompareAndUpdateProperties(const std::wstring& pattern, const Gdiplus::Color& color)
{
	if (_wcsicmp(GetPattern().c_str(), pattern.c_str()) != 0 || m_Color.GetValue() != color.GetValue())
	{
		SetPattern(pattern);
		m_Color = color;
		return true;
	}

	return false;
}
コード例 #10
0
ファイル: Model.cpp プロジェクト: Brooking/pioneer
void Model::Load(Serializer::Reader &rd)
{
	LoadVisitor lv(&rd);
	m_root->Accept(lv);

	for (AnimationContainer::const_iterator i = m_animations.begin(); i != m_animations.end(); ++i)
		(*i)->SetProgress(rd.Double());
	UpdateAnimations();

	SetPattern(rd.Int32());
}
コード例 #11
0
ファイル: QArcItem.cpp プロジェクト: maqiangddb/pc_code
void QArcItem::refreshArc()
{
    QPointF qpMid;
    qpMid.rx() = (m_qrcEllipseBndRect.topLeft().x() + m_qrcEllipseBndRect.bottomRight().x()) / 2;
    qpMid.ry() = (m_qrcEllipseBndRect.topLeft().y() + m_qrcEllipseBndRect.bottomRight().y()) / 2;
    QPainterPath path;
    path.moveTo(qpMid);
    path.arcTo(m_qrcEllipseBndRect, m_dStartAngle, m_dSpanAngle);
    path.lineTo(qpMid);
    m_ArcPath = path;
    setPath(m_ArcPath);
    SetPattern(nPatternType);
}
コード例 #12
0
bool TextInlineFormat_Shadow::CompareAndUpdateProperties(const std::wstring& pattern, const FLOAT& blur,
	const D2D1_POINT_2F& offset, const Gdiplus::Color& color)
{
	if (_wcsicmp(GetPattern().c_str(), pattern.c_str()) != 0 || m_Color.GetValue() != color.GetValue())
	{
		SetPattern(pattern);
		m_Offset = offset;
		m_Color = color;
		return true;
	}

	return false;
}
コード例 #13
0
bool TextInlineFormat_Typography::CompareAndUpdateProperties(
	const std::wstring& pattern, const DWRITE_FONT_FEATURE_TAG& tag, UINT32 parameter)
{
	if (_wcsicmp(GetPattern().c_str(), pattern.c_str()) != 0 || m_Tag != tag || m_Parameter != parameter)
	{
		SetPattern(pattern);
		m_Tag = tag;
		m_Parameter = parameter;
		return true;
	}

	return false;
}
コード例 #14
0
ファイル: painter.cpp プロジェクト: neurodebian/iv-hines
void Painter::Copy(Painter* copy) {
    foreground = nil;
    background = nil;
    pattern = nil;
    br = nil;
    font = nil;
    style = 0;
    matrix = nil;
    SetColors(copy->foreground, copy->background);
    SetPattern(copy->pattern);
    SetBrush(copy->br);
    SetFont(copy->font);
    SetStyle(copy->style);
    SetTransformer(copy->matrix);
    SetOrigin(copy->xoff, copy->yoff);
    MoveTo(copy->curx, copy->cury);
}
コード例 #15
0
ファイル: Model.cpp プロジェクト: zugz/pioneer
Model::Model(const Model &model)
: m_boundingRadius(model.m_boundingRadius)
, m_materials(model.m_materials)
, m_patterns(model.m_patterns)
, m_collMesh(model.m_collMesh) //might have to make this per-instance at some point
, m_renderer(model.m_renderer)
, m_name(model.m_name)
, m_curPattern(model.m_curPattern)
{
	//selective copying of node structure
	CopyVisitor cv;
	model.m_root->Accept(cv);
	assert(cv.root);
	m_root.Reset(cv.root);

	//materials are shared by meshes
	for (unsigned int i=0; i<MAX_DECAL_MATERIALS; i++)
		m_decalMaterials[i] = model.m_decalMaterials[i];
	ClearDecals();

	//create unique color texture, if used
	//patterns are shared
	if (SupportsPatterns()) {
		std::vector<Color4ub> colors;
		colors.push_back(Color4ub::RED);
		colors.push_back(Color4ub::GREEN);
		colors.push_back(Color4ub::BLUE);
		SetColors(colors);
		SetPattern(0);
	}

	//animations need to be copied and retargeted
	for (AnimationContainer::const_iterator it = model.m_animations.begin(); it != model.m_animations.end(); ++it) {
		const Animation *anim = *it;
		m_animations.push_back(new Animation(*anim));
		m_animations.back()->UpdateChannelTargets(m_root.Get());
	}

	//m_tags needs to be updated
	for (TagContainer::const_iterator it = model.m_tags.begin(); it != model.m_tags.end(); ++it) {
		MatrixTransform *t = dynamic_cast<MatrixTransform*>(m_root->FindNode((*it)->GetName()));
		assert(t != 0);
		m_tags.push_back(t);
	}
}
コード例 #16
0
ファイル: painter.cpp プロジェクト: neurodebian/iv-hines
void Painter::Init() {
    foreground = nil;
    background = nil;
    pattern = nil;
    br = nil;
    font = nil;
    style = 0;
    matrix = nil;

    World* w = World::current();
    SetColors(w->foreground(), w->background());
    SetPattern(new Pattern);
    FillBg(true);
    SetBrush(new Brush(0xffff, 0));
    SetFont(w->font());
    SetStyle(Plain);
    SetOrigin(0, 0);
    MoveTo(0, 0);
}
コード例 #17
0
ファイル: ibbitmap.c プロジェクト: LambdaCalculus379/SLS-1.02
void BitmapGraphic::Read (istream& in) {
    Catalog* catalog = unidraw->GetCatalog();
    char* fg_name;

    FillBg(catalog->ReadBgFilled(in));
    SetBrush(catalog->ReadBrush(in));
    PSColor* fg = catalog->ReadColor(in);
    PSColor* bg = catalog->ReadColor(in);
    SetColors(fg, bg);
    SetFont(catalog->ReadFont(in));
    SetPattern(catalog->ReadPattern(in));

    Transformer* t = catalog->ReadTransformer(in);
    SetTransformer(t);
    Unref(t);

    fg_name = catalog->ReadString(in);
    Init(fg_name);
    delete fg_name;
}
コード例 #18
0
ファイル: RemoteDrawingEngine.cpp プロジェクト: mariuz/haiku
void
RemoteDrawingEngine::SetDrawState(const DrawState* state, int32 xOffset,
	int32 yOffset)
{
	SetPenSize(state->PenSize());
	SetDrawingMode(state->GetDrawingMode());
	SetBlendingMode(state->AlphaSrcMode(), state->AlphaFncMode());
	SetPattern(state->GetPattern().GetPattern());
	SetStrokeMode(state->LineCapMode(), state->LineJoinMode(),
		state->MiterLimit());
	SetHighColor(state->HighColor());
	SetLowColor(state->LowColor());
	SetFont(state->Font());

	RemoteMessage message(NULL, fHWInterface->SendBuffer());
	message.Start(RP_SET_OFFSETS);
	message.Add(fToken);
	message.Add(xOffset);
	message.Add(yOffset);
}
コード例 #19
0
ファイル: state.c プロジェクト: axelmuhr/Helios-NG
State::State (Interactor* i) {
    drawingname = nil;
    graphicstate = new FullGraphic;
    gridding = false;
    magnif = 1.0;
    mapibrush = new MapIBrush(i, "brush");
    mapifgcolor = new MapIColor(i, "fgcolor");
    mapibgcolor = new MapIColor(i, "bgcolor");
    mapifont = new MapIFont(i, "font");
    mapipattern = new MapIPattern(i, "pattern");
    modifstatus = Unmodified;
    viewlist = new InteractorList;

    SetBrush(mapibrush->GetInitial());
    SetFgColor(mapifgcolor->GetInitial());
    SetBgColor(mapibgcolor->GetInitial());
    SetFillBg(true);
    SetFont(mapifont->GetInitial());
    SetPattern(mapipattern->GetInitial());
}
コード例 #20
0
ファイル: graphic.cpp プロジェクト: neurodebian/iv-hines
Graphic& Graphic::operator = (Graphic& g) {
    SetColors(g.GetFgColor(), g.GetBgColor());
    FillBg(g.BgFilled());
    SetPattern(g.GetPattern());
    SetBrush(g.GetBrush());
    SetFont(g.GetFont());

    if (g._t == nil) {
        Unref(_t);
        _t = nil;

    } else {
        if (_t == nil) {
            _t = new Transformer(g._t);
        } else {
            *_t = *g._t;
        }
    }
    invalidateCaches();
    return *this;
}
コード例 #21
0
ファイル: _afailed.c プロジェクト: Aliandrana/cc65
void _afailed (char* file, unsigned line)
{
    ExitTurbo();

    drawWindow.top = 0;
    drawWindow.left = 0;
    drawWindow.bot = 15;
    drawWindow.right = 150;
    dispBufferOn = ST_WR_FORE|ST_WR_BACK;
    SetPattern(0);
    Rectangle();
    FrameRectangle(0xff);

    PutString(CBOLDON "file: ", 10, 10);
    PutString(file, 10, r11);
    PutString(CBOLDON "  line: ", 10, r11);
    PutDecimal(0, line, 10, r11);

    DlgBoxOk(CBOLDON "ASSERTION FAILED", "PROGRAM TERMINATED" CPLAINTEXT);

    exit (2);
}
コード例 #22
0
ファイル: RegExp.cpp プロジェクト: AbdelghaniDr/mirror
RegExp::RegExp(const String &p, int options)
{
	Clear();
	SetOptions(options);
	SetPattern(p);
}
コード例 #23
0
ファイル: qsimpletextitem.cpp プロジェクト: mildrock/pc_code
void QSimpleTextItem::setRect(const QRectF &qrcRect)
{
    m_rect = qrcRect;
    SetPattern(nPtternType);
    this->update(m_rect);
}
コード例 #24
0
ファイル: StringMatcher.cpp プロジェクト: louisdem/IMKit
StringMatcher :: StringMatcher(const char * str) : _regExpValid(false)
{
   SetPattern(str);
}
コード例 #25
0
void TagEntry::Create(const wxString& fileName,
                      const wxString& name,
                      int lineNumber,
                      const wxString& pattern,
                      const wxString& kind,
                      std::map<wxString, wxString>& extFields)
{
    m_isCommentForamtted = false;
    m_flags = 0;
    m_isClangTag = false;
    SetName(name);
    SetLine(lineNumber);
    SetKind(kind.IsEmpty() ? wxT("<unknown>") : kind);
    SetPattern(pattern);
    SetFile(fileName);
    SetId(-1);
    m_extFields = extFields;
    wxString path;

    // Check if we can get full name (including path)
    path = GetExtField(wxT("class"));
    if(!path.IsEmpty()) {
        UpdatePath(path);
    } else {
        path = GetExtField(wxT("struct"));
        if(!path.IsEmpty()) {
            UpdatePath(path);
        } else {
            path = GetExtField(wxT("namespace"));
            if(!path.IsEmpty()) {
                UpdatePath(path);
            } else {
                path = GetExtField(wxT("interface"));
                if(!path.IsEmpty()) {
                    UpdatePath(path);
                } else {
                    path = GetExtField(wxT("enum"));
                    if(!path.IsEmpty()) {
                        UpdatePath(path);
                    } else {
                        path = GetExtField(wxT("union"));
                        wxString tmpname = path.AfterLast(wxT(':'));
                        if(!path.IsEmpty()) {
                            if(!tmpname.StartsWith(wxT("__anon"))) {
                                UpdatePath(path);
                            } else {
                                // anonymouse union, remove the anonymous part from its name
                                path = path.BeforeLast(wxT(':'));
                                path = path.BeforeLast(wxT(':'));
                                UpdatePath(path);
                            }
                        }
                    }
                }
            }
        }
    }

    if(!path.IsEmpty()) {
        SetScope(path);
    } else {
        SetScope(wxT("<global>"));
    }

    // If there is no path, path is set to name
    if(GetPath().IsEmpty()) SetPath(GetName());

    // Get the parent name
    StringTokenizer tok(GetPath(), wxT("::"));
    wxString parent;

    (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count() - 2];
    SetParent(parent);
}
コード例 #26
0
ファイル: QArcItem.cpp プロジェクト: maqiangddb/pc_code
void QArcItem::SetFrontColor(QColor nColor)
{
    nFrontColor = nColor;
    SetPattern(nPatternType);
}
コード例 #27
0
void TagEntry::Create(const wxString &fileName,
                      const wxString &name,
                      int lineNumber,
                      const wxString &pattern,
                      const wxString &kind,
                      std::map<wxString, wxString>& extFields)
{
    SetPosition( wxNOT_FOUND );
    SetName( name );
    SetLine( lineNumber );
    SetKind( kind.IsEmpty() ? wxT("<unknown>") : kind );
    SetPattern( pattern );
    SetFile( fileName );
    SetId(-1);
    SetParentId(-1);

    m_extFields = extFields;
    wxString path;

    // Check if we can get full name (including path)
    path = GetExtField(wxT("class"));
    if(!path.IsEmpty()) {
        UpdatePath( path ) ;
    } else {
        path = GetExtField(wxT("struct"));
        if(!path.IsEmpty()) {
            UpdatePath( path ) ;
        } else {
            path = GetExtField(wxT("namespace"));
            if(!path.IsEmpty()) {
                UpdatePath( path ) ;
            } else {
                path = GetExtField(wxT("interface"));
                if(!path.IsEmpty()) {
                    UpdatePath( path ) ;
                } else {
                    path = GetExtField(wxT("enum"));
                    if(!path.IsEmpty()) {
                        UpdatePath( path ) ;
                    } else {
                        path = GetExtField(wxT("union"));
                        if(!path.IsEmpty()) {
                            UpdatePath( path ) ;
                        }
                    }
                }
            }
        }
    }

    if(!path.IsEmpty()) {
        SetScope(path);
    } else {
        SetScope(wxT("<global>"));
    }

    // If there is no path, path is set to name
    if( GetPath().IsEmpty() )
        SetPath( GetName() );

    // Get the parent name
    StringTokenizer tok(GetPath(), wxT("::"));
    wxString parent;

    (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count()-2];
    SetParent(parent);
}
コード例 #28
0
ファイル: RegExp.cpp プロジェクト: AbdelghaniDr/mirror
RegExp::RegExp(const char * p, int options)
{
	Clear();
	SetOptions(options);
	SetPattern(p);
}
コード例 #29
0
ファイル: QArcItem.cpp プロジェクト: maqiangddb/pc_code
void QArcItem::SetBackColor(QColor nColor)
{
    nBackColor = nColor;
    SetPattern(nPatternType);
}
コード例 #30
0
SegmentedStringMatcher :: SegmentedStringMatcher(const String & str, bool simple, const char * sc)
   : _negate(false)
{
   (void) SetPattern(str, simple, sc);
}