예제 #1
0
파일: box.cpp 프로젝트: PNCG/neuron
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);
        }
    }
}
예제 #2
0
// GetAllocationInfo
void
Attribute::GetAllocationInfo(AllocationInfo &info)
{
	DataContainer::GetAllocationInfo(info);
	info.AddAttributeAllocation(GetSize());
	info.AddStringAllocation(fName.GetLength());
}
예제 #3
0
파일: Entry.cpp 프로젝트: AmirAbrams/haiku
// GetAllocationInfo
void
Entry::GetAllocationInfo(AllocationInfo &info)
{
	info.AddEntryAllocation();
	info.AddStringAllocation(fName.GetLength());
	fNode->GetAllocationInfo(info);
}
예제 #4
0
파일: box.cpp 프로젝트: PNCG/neuron
void Box::allotment(GlyphIndex index, DimensionName d, Allotment& a) const {
    AllocationTable* table = impl_->allocations_;
    if (table != nil) {
        AllocationInfo* info = table->most_recent();
        if (info != nil) {
            Allocation* allocations = info->component_allocations();
            a = allocations[index].allotment(d);
        }
    }
}
예제 #5
0
// GetAllocationInfo
void
NodeTable::GetAllocationInfo(AllocationInfo &info)
{
	info.AddNodeTableAllocation(fNodes.ArraySize(), fNodes.VectorSize(),
								sizeof(NodeHashElement),
								fNodes.CountElements());
}
예제 #6
0
// GetAllocationInfo
void
Volume::GetAllocationInfo(AllocationInfo &info)
{
	// tables
	info.AddOtherAllocation(sizeof(NodeTable));
	fNodeTable->GetAllocationInfo(info);
	info.AddOtherAllocation(sizeof(DirectoryEntryTable));
	fDirectoryEntryTable->GetAllocationInfo(info);
	info.AddOtherAllocation(sizeof(NodeAttributeTable));
	fNodeAttributeTable->GetAllocationInfo(info);
	// node hierarchy
	fRootDirectory->GetAllocationInfo(info);
	// name
	info.AddStringAllocation(fName.GetLength());
	// block allocator
	info.AddOtherAllocation(sizeof(BlockAllocator));
	fBlockAllocator->GetAllocationInfo(info);
}
예제 #7
0
파일: box.cpp 프로젝트: PNCG/neuron
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);
        }
    }
}
예제 #8
0
파일: box.cpp 프로젝트: PNCG/neuron
AllocationInfo& BoxImpl::info(Canvas* c, const Allocation& a, Extension& ext) {
    if (allocations_ == nil) {
        allocations_ = new AllocationTable(box_->count());
    }
    AllocationInfo* info = allocations_->find(c, a);
    if (info == nil) {
        Coord dx, dy;
        info = allocations_->find_same_size(c, a, dx, dy);
        if (info != nil) {
            info->extension(ext);
            offset_allocate(*info, dx, dy);
        } else {
            info = allocations_->allocate(c, a);
            info->extension(ext);
            full_allocate(*info);
        }
    }
    ext = info->extension();
    return *info;
}
예제 #9
0
파일: File.cpp 프로젝트: AmirAbrams/haiku
// GetAllocationInfo
void
File::GetAllocationInfo(AllocationInfo &info)
{
	info.AddFileAllocation(GetSize());
}
예제 #10
0
// GetAllocationInfo
void
SymLink::GetAllocationInfo(AllocationInfo &info)
{
	info.AddSymLinkAllocation(GetSize());
}