Exemple #1
0
ISymbol::ISymbol()
{
	Parsed()=0; 
	Visited()=0; 
	Type()=(SymbolType) -1; 
	ListType()=unknown_; 
	Dimension()=0;
	SimpleType()=true;
	Required()=false;
	Abstract()=false;
	Compositor()=0;
	DerivedType() = XercesAdditions::DERIVATION_NONE;
	XercesType() = XercesAdditions::NO_DECLARATION;
	Global()=false;
	SqlCount()=0;
	SubstitutionGroupAffiliation().clear();
	symbols.push_back(this);
	Variable()=NULL;
	SimpleContent()=false;
	List()=false;
	Atomic()=false;
	Level()=0;
	ListSize()=0;
	intrusive_ptr_add_ref((IExpress *) symbols.back().get());
}
Exemple #2
0
/**
 * Removes all elements. Invalidates all iterators.
 * Do it in a non-throwing way and also make
 * sure we really free the allocated memory.
 */
void List::clear()
{
    ListType().swap(d->list);

    // Free device list
    if (d->devlist)
    {
        ftdi_list_free(&d->devlist);
        d->devlist = 0;
    }
}
Exemple #3
0
void ISymbol::MergeTypeInfo(ISymbolPtr c)
{
	c->TypeName() = Name();
	// Ignore, Name(), Namespace(), and Type()

	c->Abstract() = Abstract();
	c->Atomic() = Atomic();
	c->Attributes() = Attributes();
	c->BaseTypeName() = BaseTypeName();
	c->Compositor() = Compositor();
	c->DerivedType() = DerivedType();
	c->Enumerations() = Enumerations();
	c->FacetKinds() = FacetKinds();
	c->Facets() = Facets();
	c->Global() = Global();
	c->Level() = Level();
	c->List() = List();
	c->ListSize() = ListSize();
	c->ListType() = ListType();
	c->Optional() = Optional();
	c->Parent() = Parent();
	c->Parsed() = Parsed();
	c->PrimitiveType() = PrimitiveType();
	c->Required() = Required();
	c->SimpleContent() = SimpleContent();
	c->SimpleType() = SimpleType();
	c->SqlCount() = SqlCount();
	c->SqlType() = SqlType();
	c->SubstitutionGroupAffiliation() = SubstitutionGroupAffiliation();
	c->SubstitutionList() = SubstitutionList();
	c->SubTypes() = SubTypes();
	c->SuperTypes() =  SuperTypes();

	c->Variable() = Variable();
	c->Visited() = Visited();
	c->XercesType() = XercesType();
	
	// These are element particle definitions
	// c->Dimension() = Dimension(); // always 1
	//c->LowerBounds() = LowerBounds();
	//c->UpperBounds() = UpperBounds();
	//c->OuterElementName() = OuterElementName();
	// c->OuterElementTypeName() = OuterElementTypeName();

}
Exemple #4
0
void ISymbol::DeepCopy(ISymbolPtr c)
{
	c->Name()=Name();

	c->Abstract() = Abstract();
	c->Atomic() = Atomic();
	c->Attributes() = Attributes();
	c->BaseTypeName() = BaseTypeName();
	c->Compositor() = Compositor();
	c->DerivedType() = DerivedType();
	c->Dimension() = Dimension();
	c->Enumerations() = Enumerations();
	c->FacetKinds() = FacetKinds();
	c->Facets() = Facets();
	c->Global() = Global();
	c->Level() = Level();
	c->List() = List();
	c->ListSize() = ListSize();
	c->ListType() = ListType();
	c->LowerBounds() = LowerBounds();
	c->Namespace() = Namespace();
	c->Optional() = Optional();
	c->OuterElementName() = OuterElementName();
	c->OuterElementTypeName() = OuterElementTypeName();
	c->Parent() = Parent();
	c->Parsed() = Parsed();
	c->PrimitiveType() = PrimitiveType();
	c->Required() = Required();
	c->SimpleContent() = SimpleContent();
	c->SimpleType() = SimpleType();
	c->SqlCount() = SqlCount();
	c->SqlType() = SqlType();
	c->SubstitutionGroupAffiliation() = SubstitutionGroupAffiliation();
	c->SubstitutionList() = SubstitutionList();
	c->SubTypes() = SubTypes();
	c->SuperTypes() =  SuperTypes();
	c->Type() = Type();
	c->TypeName() = TypeName();
	c->UpperBounds() = UpperBounds();
	c->Variable() = Variable();
	c->Visited() = Visited();
	c->XercesType() = XercesType();
}
Exemple #5
0
// MouseDown
void
DragSortableListView::MouseDown(BPoint where)
{
	int32 clicks = 1;
	uint32 buttons = 0;
	Window()->CurrentMessage()->FindInt32("clicks", &clicks);
	Window()->CurrentMessage()->FindInt32("buttons", (int32*)&buttons);
	int32 clickedIndex = -1;
	for (int32 i = 0; BListItem* item = ItemAt(i); i++) {
		if (ItemFrame(i).Contains(where)) {
			if (clicks == 2) {
				// only do something if user clicked the same item twice
				if (fLastClickedItem == item)
					DoubleClicked(i);
			} else {
				// remember last clicked item
				fLastClickedItem = item;
			}
			clickedIndex = i;
			break;
		}
	}
	if (clickedIndex == -1)
		fLastClickedItem = NULL;

	BListItem* item = ItemAt(clickedIndex);
	if (ListType() == B_MULTIPLE_SELECTION_LIST
		&& item && (buttons & B_SECONDARY_MOUSE_BUTTON)) {
		if (item->IsSelected())
			Deselect(clickedIndex);
		else
			Select(clickedIndex, true);
	} else {
		BListView::MouseDown(where);
	}
}
Exemple #6
0
Atlas::Message::Element EntityEditor::createListElement()
{
	return Element(ListType());
}
void Benchmark::setListType(const int type)
{
    m_listType = ListType(type);
}
Exemple #8
0
void
BOutlineListView::ExpandOrCollapse(BListItem* item, bool expand)
{
	if (item->IsExpanded() == expand || !FullListHasItem(item))
		return;

	item->fExpanded = expand;

	// TODO: merge these cases together, they are pretty similar

	if (expand) {
		uint32 level = item->fLevel;
		int32 fullIndex = FullListIndexOf(item);
		int32 index = IndexOf(item) + 1;
		int32 startIndex = index;
		int32 count = FullListCountItems() - fullIndex - 1;
		BListItem** items = (BListItem**)fFullList.Items() + fullIndex + 1;

		BFont font;
		GetFont(&font);
		while (count-- > 0) {
			item = items[0];
			if (item->fLevel <= level)
				break;

			if (!item->IsItemVisible()) {
				// fix selection hints
				if (index <= fFirstSelected)
					fFirstSelected++;
				if (index <= fLastSelected)
					fLastSelected++;

				fList.AddItem(item, index++);
				item->Update(this, &font);
				item->SetItemVisible(true);
			}

			if (item->HasSubitems() && !item->IsExpanded()) {
				// Skip hidden children
				uint32 subLevel = item->fLevel;
				items++;

				while (--count > 0 && items[0]->fLevel > subLevel)
					items++;
			} else
				items++;
		}
		_RecalcItemTops(startIndex);
	} else {
		// collapse
		uint32 level = item->fLevel;
		int32 fullIndex = FullListIndexOf(item);
		int32 index = IndexOf(item);
		int32 startIndex = index;
		int32 max = FullListCountItems() - fullIndex - 1;
		int32 count = 0;
		bool selectionChanged = false;

		BListItem** items = (BListItem**)fFullList.Items() + fullIndex + 1;

		while (max-- > 0) {
			item = items[0];
			if (item->fLevel <= level)
				break;

			if (item->IsItemVisible()) {
				fList.RemoveItem(item);
				item->SetItemVisible(false);
				if (item->IsSelected()) {
					selectionChanged = true;
					item->Deselect();
				}
				count++;
			}

			items++;
		}

		_RecalcItemTops(startIndex);
		// fix selection hints
		// if the selected item was just removed by collapsing, select its
		// parent
		if (ListType() == B_SINGLE_SELECTION_LIST && selectionChanged)
			fFirstSelected = fLastSelected = index;
		if (index < fFirstSelected && index + count < fFirstSelected) {
				// all items removed were higher than the selection range,
				// adjust the indexes to correspond to their new visible positions
				fFirstSelected -= count;
				fLastSelected -= count;
		}			

		int32 maxIndex = fList.CountItems() - 1;
		if (fFirstSelected > maxIndex)
			fFirstSelected = maxIndex;
		if (fLastSelected > maxIndex)
			fLastSelected = maxIndex;
		if (selectionChanged)
			SelectionChanged();
	}

	_FixupScrollBar();
	Invalidate();
}