Ejemplo n.º 1
0
bool CIwGameXmlParser::PreParse()
{
//CIwGameError::LogError("CIwGameXmlParser::PreParse ****");
	Marker = TagPool + NextFreePoolTagIndex;
	while (1)
	{
		if (m_pDataInput->IsEOF())
			break;

		int tag_pos = 0;
		int tag_len = m_pDataInput->GetNextTagOrValue('<', '>', m_pDataInput->Remaining(), tag_pos);
		if (tag_len > 0)
		{
//CIwGameError::LogError("CIwGameXmlParser::PreParse - Marker - ", CIwGameString(m_pDataInput->getData(), tag_pos, tag_len).c_str());
			CIwGameXmlTagMarker* tag_marker = AllocTag();
			if (tag_marker == NULL)
			{
				return false;
			}
			tag_marker->Start = tag_pos;
			tag_marker->Length = tag_len;
			MarkerCount++;
			
//			CIwGameString* tag = new CIwGameString(m_pDataInput->getData(), tag_pos, tag_len);
//			TempElements.push_back(tag);

//s3eDebugOutputString(tag->c_str());
		}
	}

	return true;
}
Ejemplo n.º 2
0
EvasCanvas::EvasCanvas( Evas* evas )
    :Trackable( "EvasCanvas" )
{
    AllocTag( this, "EvasCanvas" );
    Dout( dc::notice, "EvasCanvas::EvasCanvas - attaching to Evas" );
    o = evas;
}
Ejemplo n.º 3
0
EvasCanvas::EvasCanvas()
    :Trackable( "EvasCanvas" )
{
    AllocTag( this, "EvasCanvas" );
    Dout( dc::notice, "EvasCanvas::EvasCanvas - creating new Evas" );
    o = evas_new();
}
Ejemplo n.º 4
0
void Object::connect (const std::string &emission, const std::string &source, const SignalSlot& slot)
{
  SignalSignal* signal = new SignalSignal();
	mSignalList[std::pair <std::string, std::string> (emission, source)] = signal;
  AllocTag( signal, emission );
  signal->connect( slot );
  edje_object_signal_callback_add( o, emission.c_str (), source.c_str (), &_edje_signal_handler_callback, static_cast<void*>( signal ) );
}
Ejemplo n.º 5
0
EvasCanvas::EvasCanvas( int width, int height )
    :Trackable( "EvasCanvas" )
{
    AllocTag( this, "EvasCanvas" );
    Dout( dc::notice, "EvasCanvas::EvasCanvas - creating new Evas" );
    o = evas_new();
    resize( width, height );
    setViewport( 0, 0, width, height );
}
Ejemplo n.º 6
0
bool CzXmlParser::PreParse()
{
	// Count number of tags and attriibutes
	int num_tags, num_attribs;
	m_pDataInput->CountXmlEntities(num_tags, num_attribs);
	num_tags++;	// Add one on for root
  //debug std::cout << "PreParse::::::  num_tags is " << num_tags << std::endl;
	// Allocate buffers
	TagPool = new CzXmlTagMarker[num_tags]();
	NodePool = new CzXmlNode[num_tags]();
	AttributePool = new CzXmlAttribute[num_attribs]();
    MaxPoolTags = num_tags;//marco hack
    MaxPoolNodes = num_tags;//marco hack
	MaxPoolAttributes = num_attribs;
	NextFreePoolNodeIndex = 0;
	NextFreePoolTagIndex = 0;
	NextFreePoolAttributeIndex = 0;

	Marker = TagPool + NextFreePoolTagIndex;
	int line_num = 0;
	while (1)
	{
		if (m_pDataInput->isEOF())
			break;

		int tag_pos = 0;
		int pos = m_pDataInput->getPos();
      
      //debug std::cout << "*** Starting with position : " << pos  << std::endl;
      
		if (pos >= m_pDataInput->getLength())
			return true;
      
      //debug std::cout << "*** Remaining char to visit: " << m_pDataInput->Remaining()  << std::endl;
      //debug std::cout << "*** We are at line number  : " << line_num  << std::endl;

		int tag_len = m_pDataInput->getNextTagOrValue('<', '>', m_pDataInput->Remaining(), tag_pos);
      //debug std::cout << "*** The length of this tag : " << tag_len  << std::endl;
      //debug std::cout << "*** Now we are at position : " << m_pDataInput->getPos()  << std::endl;
      
		if (tag_len < 0)
		{
			if (tag_len == -1)
			{
				ShowError(XmlErrorMissingEndTag, line_num);
				//return false;
			}
			else
				return true;
		}
		int pos2 = m_pDataInput->getPos() - 1;

		// Calculate line number
		if (pos2 > pos)
		{
			int d = pos2 - pos;
			char* data = m_pDataInput->getData() + pos;
			for (int t = 0; t < pos2 - pos; t++)
			{
				if (*data++ == '\n')
					line_num++;
			}
		}

		if (tag_len > 0)
		{
			CzXmlTagMarker* tag_marker = AllocTag();
          //debug std::cout << "AllocTag called. NextFreePoolTagIndex is now: " << NextFreePoolTagIndex << std::endl;
			if (tag_marker == NULL)
			{
				return false;
			}
			tag_marker->Start = tag_pos;
			tag_marker->Length = tag_len;
			tag_marker->Line = line_num;
			MarkerCount++;
          //debug std::cout << "PreParse::::::  Tag created at position  " << tag_pos   << std::endl;
          //debug std::cout << "PreParse::::::  MarkerCount is " << MarkerCount << std::endl;

			
//			CzString* tag = new CzString(m_pDataInput->getData(), tag_pos, tag_len);
//			TempElements.push_back(tag);

//CzDebug::Log(tag->c_str());
		}
	}

	return true;
}