当前位置: 首页>>代码示例>>C++>>正文


C++ Glyph::allocate方法代码示例

本文整理汇总了C++中Glyph::allocate方法的典型用法代码示例。如果您正苦于以下问题:C++ Glyph::allocate方法的具体用法?C++ Glyph::allocate怎么用?C++ Glyph::allocate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Glyph的用法示例。


在下文中一共展示了Glyph::allocate方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: allocate

void LayoutLayer::allocate(Canvas* c, const Allocation& a, Extension& ext) {
    if (under_ != nil) {
	under_->allocate(c, a, ext);
    }
    MonoGlyph::allocate(c, a, ext);
    if (over_ != nil) {
	over_->allocate(c, a, ext);
    }
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:9,代码来源:layout.c

示例2: allocate

void BevelFrame::allocate(Canvas* c, const Allocation& a, Extension& ext) {
    Glyph* g = body();
    if (g != nil) {
	if (hmargin_ || vmargin_) {
	    Allocation interior(a);
	    allocate_body(g, thickness(c), interior);
	    g->allocate(c, interior, ext);
	} else {
	    g->allocate(c, a, ext);
	}
    }
    ext.merge(c, a);
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:13,代码来源:bevel.cpp

示例3: full_allocate

void BoxImpl::full_allocate(AllocationInfo& info) {
    Canvas* c = info.canvas();
    GlyphIndex n = box_->count();
    Allocation* a = info.component_allocations();
    Requisition* r = new Requisition[n];
    GlyphIndex i;
    for (i = 0; i < n; i++) {
        Glyph* g = box_->component(i);
        if (g != nil) {
            g->request(r[i]);
        }
    }
    layout_->allocate(info.allocation(), n, r, a);
    delete [] r;

    Extension& box = info.extension();
    Extension child;
    for (i = 0; i < n; i++) {
        Glyph* g = box_->component(i);
        if (g != nil) {
            child.clear();
            g->allocate(c, a[i], child);
            box.merge(child);
        }
    }
}
开发者ID:PNCG,项目名称:neuron,代码行数:26,代码来源:box.cpp

示例4: allocate

void Layer::allocate( const Allocation & a)
{
    for( GlyphIndex i = 0; i < getCount(); i++ )
    {
        Glyph* g = getComponent( i );
        if( g )
            g->allocate( a );
    }
}
开发者ID:rochus-keller,项目名称:NAF,代码行数:9,代码来源:Layer.cpp

示例5: interior

void StripRuler2D::allocate( const Allocation& a ) 
{
    Glyph* g = getBody();
    if( g != nil ) 
	{
	    Allocation interior( a );
	    allocateBody( g, interior );
	    g->allocate( interior );
    }
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:10,代码来源:SpecRuler2D.cpp

示例6: allocate

void Deck::allocate(Canvas* c, const Allocation& a, Extension& ext) {
    allocation_ = a;
    if (card_ >= 0 && card_ < count()) {
	Glyph* g = component(card_);
	if (g != nil) {
	    g->allocate(c, a, ext);
	}
	ext.merge(c, a);
    }
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:10,代码来源:deck.cpp

示例7: allocate

void Border::allocate( const Allocation& a ) 
{
    Glyph* g = getBody();
    if( g != nil ) 
	{
	    Allocation interior( a );
	    allocateBody( g, d_thickness, interior );
	    g->allocate( interior );
    }
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:10,代码来源:Border.cpp

示例8: reallocate

void TBScrollBoxImpl::reallocate() {
    if (canvas_ == nil) {
	return;
    }
    ScrollBox* s = scrollbox_;
    GlyphIndex n = s->count();
    end_ = n;
    TBScrollBoxList& list = visible_;
    list.remove_all();
    Requisition req;
    TBScrollBoxInfo info;
    Extension e_i;
    const Requirement& r = req.y_requirement();
    Coord p = allocation_.top();
    Coord bottom = allocation_.bottom();
    bool found_start = false;
    for (GlyphIndex i = start_; i < n; i++) {
	Glyph* g = s->component(i);
	if (g != nil) {
	    g->request(req);
	    Coord span = r.natural();
	    if (!Math::equal(span, Coord(0), float(1e-2))) {
		if (!found_start) {
		    start_ = i;
		    found_start = true;
		}
		Coord alignment = r.alignment();
		p -= span;
		if (p < bottom) {
		    end_ = i;
		    break;
		}
		info.glyph_ = g;
		Allotment& ax = info.allocation_.x_allotment();
		ax = allocation_.x_allotment();
		Allotment& ay = info.allocation_.y_allotment();
		ay.span(span);
		ay.origin(p + Coord(alignment * span));
		ay.alignment(alignment);
		list.append(info);
		g->allocate(canvas_, info.allocation_, e_i);
	    }
	}
    }
}
开发者ID:PNCG,项目名称:neuron,代码行数:45,代码来源:scrbox.cpp

示例9: offset_allocate

void BoxImpl::offset_allocate(AllocationInfo& info, Coord dx, Coord dy) {
    Canvas* c = info.canvas();
    Allocation* a = info.component_allocations();
    Extension& box = info.extension();
    Extension child;
    GlyphIndex n = box_->count();
    for (GlyphIndex i = 0; i < n; i++) {
        Glyph* g = box_->component(i);
        if (g != nil) {
            Allocation& a_i = a[i];
            Allotment& ax = a_i.x_allotment();
            Allotment& ay = a_i.y_allotment();
            ax.offset(dx);
            ay.offset(dy);
            child.clear();
            g->allocate(c, a_i, child);
            box.merge(child);
        }
    }
}
开发者ID:PNCG,项目名称:neuron,代码行数:20,代码来源:box.cpp


注:本文中的Glyph::allocate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。