Beispiel #1
0
const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const
{
	const TiXmlNode* node;

	for (	node = NextSibling( _value );
			node;
			node = node->NextSibling( _value ) )
	{
		if ( node->ToElement() )
			return node->ToElement();
	}
	return 0;
}
Beispiel #2
0
TiXmlElement* TiXmlNode::NextSiblingElement( const std::string& value ) const
{
	TiXmlNode* node;

	for (	node = NextSibling( value );
			node;
			node = node->NextSibling( value ) )
	{
		if ( node->ToElement() )
			return node->ToElement();
	}
	return 0;
}
Beispiel #3
0
TiXmlElement* TiXmlNode::NextSiblingElement()
{
	TiXmlNode* node;

	for (	node = NextSibling();
	node;
	node = node->NextSibling() )
	{
		if ( node->ToElement() )
			return node->ToElement();
	}
	return 0;
}
TiXmlElementA* TiXmlNodeA::NextSiblingElement() const
{
	TiXmlNodeA* node;

	for (	node = NextSibling();
	node;
	node = node->NextSibling() )
	{
		if ( node->ToElement() )
			return node->ToElement();
	}
	return 0;
}
Beispiel #5
0
/* Here is where the tree is dumped out in the Manuelian style. */
extern void DumpManuelTree(FILE *f, TREENODE *node)
{
   TREENODE *kid;

   kid = GetChild(node,1);
   while (kid) 
   {
      DumpManuelTree(f,kid);
      kid = NextSibling(kid);
   }
    
   fprintf(f,"%s\n",node->string);
   fprintf(f,"L%d/C%d\n",node->line,node->column);
   fprintf(f,"%d\n",ChildCount(node));
}
static void PaintWindow(HWND hwnd, LWPAINTSTRUCT *ps)
{
	HWND wp;
	
	wp = NextSibling(hwnd);
	if (wp)
	{
		PaintWindow(wp, ps);
	}
	
	PaintWindowNow(hwnd, ps);
	
	wp = Children(hwnd);
	if (wp)
	{
		PaintWindow(wp, ps);
	}
}
void PrintUnmapcount(HWND hWnd)
{
	HWND wp = NULL;
	
	printf("hWnd = %x, unmapcount = %d, shouldPaint = %d, %s\n", hWnd, hWnd->unmapcount, hWnd->shouldPaint, hWnd->pClass->lpszClassName);

	wp = NextSibling(hWnd);
	if (wp != NULL)
	{
		PrintUnmapcount(wp);
	}
	
	wp = Children(hWnd);
	if (wp != NULL)
	{
		PrintUnmapcount(wp);
	}
}
/* Disable clipping for all levels down (children)*/
static void HideChildWindows(HWND hWnd)
{
	HWND wp = NULL;

	wp = Children(hWnd);
	if (wp != NULL)
	{
		++wp->unmapcount;
		HideChildWindows(wp);
	}
	
	wp = NextSibling(hWnd);
	if (wp != NULL)
	{
		++wp->unmapcount;
		HideChildWindows(wp);
	}
}
Beispiel #9
0
/* Make a copy of the entire tree */
TREENODE *DuplicateTree(TREENODE *node)
{
   TREENODE *kid;
   TREENODE *dup;

   assert(node != NULL);

   dup = DuplicateNode(node);

   kid = GetChild(node,1);
   while (kid != 0) 
   {
      AddChild(dup,DuplicateTree(kid));
      kid = NextSibling(kid);
   }

   return dup;
}
Beispiel #10
0
bool CSettingPath::Deserialize(const TiXmlNode *node, bool update /* = false */)
{
  CExclusiveLock lock(m_critical);

  if (!CSettingString::Deserialize(node, update))
    return false;
    
  if (m_control != nullptr &&
     (m_control->GetType() != "button" || (m_control->GetFormat() != "path" && m_control->GetFormat() != "file")))
  {
    CLog::Log(LOGERROR, "CSettingPath: invalid <control> of \"%s\"", m_id.c_str());
    return false;
  }
    
  auto constraints = node->FirstChild(XML_ELM_CONSTRAINTS);
  if (constraints != nullptr)
  {
    // get writable
    XMLUtils::GetBoolean(constraints, "writable", m_writable);

    // get sources
    auto sources = constraints->FirstChild("sources");
    if (sources != nullptr)
    {
      m_sources.clear();
      auto source = sources->FirstChild("source");
      while (source != nullptr)
      {
        std::string strSource = source->FirstChild()->ValueStr();
        if (!strSource.empty())
          m_sources.push_back(strSource);

        source = source->NextSibling("source");
      }
    }

    // get masking
    auto masking = constraints->FirstChild("masking");
    if (masking != nullptr)
      m_masking = masking->FirstChild()->ValueStr();
  }

  return true;
}
/* Shows all levels down (children) */
static void ShowChildWindows(HWND hWnd)
{
	HWND wp = NULL;

	wp = Children(hWnd);
	if (wp != NULL)
	{
		--wp->unmapcount;
		ShowChildWindows(wp);
	}
	
	wp = NextSibling(hWnd);
	if (wp != NULL)
	{
		--wp->unmapcount;
		ShowChildWindows(wp);
	}
	
}
Beispiel #12
0
void
BRadioButton::SetValue(int32 value)
{
	if (value != Value()) {
		BControl::SetValueNoUpdate(value);
		Invalidate();

		if (value == B_CONTROL_ON) {
			for (BView *sibling = NextSibling(); sibling != NULL; sibling = sibling->NextSibling()) {
				BRadioButton *rbtn = cast_as(sibling, BRadioButton);
				if (rbtn != NULL) rbtn->SetValue(B_CONTROL_OFF);
			}
			for (BView *sibling = PreviousSibling(); sibling != NULL; sibling = sibling->PreviousSibling()) {
				BRadioButton *rbtn = cast_as(sibling, BRadioButton);
				if (rbtn != NULL) rbtn->SetValue(B_CONTROL_OFF);
			}
		}
	}
}
NS_IMETHODIMP
inDeepTreeWalker::NextNode(nsIDOMNode **_retval)
{
  // First try our kids
  FirstChild(_retval);

  if (*_retval) {
    return NS_OK;
  }

  // Now keep trying next siblings up the parent chain, but if we
  // discover there's nothing else restore our state.
#ifdef DEBUG
  nsIDOMNode* origCurrentNode = mCurrentNode;
#endif
  uint32_t lastChildCallsToMake = 0;
  while (1) {
    NextSibling(_retval);

    if (*_retval) {
      return NS_OK;
    }

    nsCOMPtr<nsIDOMNode> parent;
    ParentNode(getter_AddRefs(parent));
    if (!parent) {
      // Nowhere else to go; we're done.  Restore our state.
      while (lastChildCallsToMake--) {
        nsCOMPtr<nsIDOMNode> dummy;
        LastChild(getter_AddRefs(dummy));
      }
      NS_ASSERTION(mCurrentNode == origCurrentNode,
                   "Didn't go back to the right node?");
      *_retval = nullptr;
      return NS_OK;
    }
    ++lastChildCallsToMake;
  }

  NS_NOTREACHED("how did we get here?");
  return NS_OK;
}
Beispiel #14
0
void SeqSplitterView::MouseMoved(	BPoint where,
									uint32 code,
									const BMessage* message)
{
	if (code == B_ENTERED_VIEW) {
		if (mDirection == B_VERTICAL && gVrtCursor) SetViewCursor(gVrtCursor);
		if (mDirection == B_HORIZONTAL && gHrzCursor) SetViewCursor(gHrzCursor);
	}
	if( !mMouseDown || !Window() || !Window()->CurrentMessage() ) return;
	BView*	prev = PreviousSibling();
	BView*	next = NextSibling();
	if( !prev || !next ) return;
	
	// The mouse moved message's "where" field is in window
	// coordinates.  We need to use that instead of view
	// coordinates because the changes in this view's frame
	// are asynchronous with the mouse events we receive.
	BPoint	screenWhere;
	Window()->CurrentMessage()->FindPoint("where", &screenWhere);
	Window()->ConvertToScreen(&screenWhere);
	BPoint	delta = screenWhere - mPointDown;
	
	bool	locked = false;
//printf("recived mouse of %f\n", where.x);

if( Window() && Window()->Lock() ) {
	locked = true;
	Window()->BeginViewTransaction();
}
	if( mDirection == B_VERTICAL ) {
		/* Move me
		 */
		float	prevLeft = prev->Frame().left;
		float	nextRight = next->Frame().right;
		float	x = mFrameDown.left + delta.x;
		float	y = mFrameDown.top;
		if( x < prevLeft ) x = prevLeft;
		if( x + Bounds().Width() > nextRight ) x = nextRight - Bounds().Width();
		MoveTo( x, y );
		/* Move prev
		 */
		float	height = prev->Bounds().Height();
		float	prevRight = Frame().left - 1;
		prev->ResizeTo( prevRight - prevLeft, height );
		/* Move next
		 */
		height = next->Bounds().Height();
		float	nextTop = next->Frame().top;
		float	nextLeft = Frame().right + 1;
//printf("\tsending out move to %f\n", nextLeft);
		BRect	f = next->Frame();
		if( f.left != nextLeft ) next->MoveTo( nextLeft, nextTop );
		if( f.Width() != nextRight - nextLeft ) next->ResizeTo( nextRight - nextLeft, height );
#if 0
		next->MoveTo( nextLeft, nextTop );
		next->ResizeTo( nextRight - nextLeft, height );
#endif
	} else {
		/* Move me
		 */
		float	prevTop = prev->Frame().top;
		float	nextBottom = next->Frame().bottom;
		float	x = mFrameDown.left;
		float	y = mFrameDown.top + delta.y;
		if( y < prevTop ) y = prevTop;
		if( y + Bounds().Height() > nextBottom ) y = nextBottom - Bounds().Height();
		MoveTo( x, y );
		/* Move prev
		 */
		float	width = prev->Bounds().Width();
		float	prevBottom = Frame().top - 1;
		prev->ResizeTo( width, prevBottom - prevTop );
		/* Move next
		 */
		width = next->Bounds().Width();
		float	nextLeft = next->Frame().left;
		float	nextTop = Frame().bottom + 1;
		next->MoveTo( nextLeft, nextTop );
		next->ResizeTo( width, nextBottom - nextTop );
	}
if( locked ) {
	Window()->EndViewTransaction();
	Window()->Unlock();
}
}
Beispiel #15
0
	Window()->EndViewTransaction();
	Window()->Unlock();
}
}

void SeqSplitterView::SetDrawingFlags(uint32 flags)
{
	mDrawingFlags = flags;
}

void SeqSplitterView::MoveVerticalSplitter(float left)
{
	ArpVALIDATE(mDirection == B_VERTICAL, return);
	
	BView*		prev = PreviousSibling();
	BView*		next = NextSibling();
	if (!prev || !next) return;
	/* Move me
	 */
	float		prevLeft = prev->Frame().left;
	float		nextRight = next->Frame().right;
	float		x = left;
	float		y = Frame().top;
	if (x < prevLeft) x = prevLeft;
	if (x + Bounds().Width() > nextRight ) x = nextRight - Bounds().Width();
	MoveTo(x, y);
	/* Move prev
	 */
	float		height = prev->Bounds().Height();
	float		prevRight = Frame().left - 1;
	prev->ResizeTo(prevRight - prevLeft, height);
Beispiel #16
0
void XMLParagraph::Join(const XMLParagraph &rstInput)
{
    if(rstInput.m_XMLDocument.FirstChild() == nullptr){
        return;
    }

    for(auto pNode = rstInput.m_XMLDocument.FirstChild()->FirstChild(); pNode; pNode = pNode->NextSibling()){
        m_XMLDocument.FirstChild()->InsertEndChild(pNode->DeepClone(m_XMLDocument.GetDocument()));
    }
}