스킨 작업을 위한 몇가지...
2008. 2. 6. 21:06

 <skin name="" bg_bitmap="" button_bitmap="">
 <item name="" action= left= top= right= bottom= pushedleft= pushedright= enable= visible= draw= >
  <option source_position= count= init_value= margin_left= margin_top= margin_right= margin_bottom= />
  <image type= left= top= right= bottom= pushedleft= pushedright= margin_left= margin_top= margin_right= margin_bottom= source_position= />
  <font face="" size= color= selected_color= />
 </item>
</skin>


1. <skin> </skin> 항목
 - 태그가 짝을 이룬다.
 - 모든 속성이 필히 들어가야 한다.
 - 여러개의 <item> 을 가질 수 있다.
 - 한 화면(윈도우 하나?) 당 하나의 <skin></skin>을 가진다.
 
 
2. <item> </item> 항목
 - 태그가 짝을 이룬다.
 - 사용자 인터페이스가 필요한 항목당 하나의 <item></item>을 가진다.
 - 필수 속성 : name, action, button_bitmap 안에서의 좌표(left, top, right, bottom), 화면에서의 좌표 (pushedleft, pushedright)
 - 선택 속성 : enable(0,1:1), visible(0,1:1), draw(0,1,2,3,4:0)
 - action의 종류 : 디폴트 값은 button 이다.
   button(0) - <option/> 태그가 필요 없다.
   toggle(1) - count 속성을 가지는 <option/> 태그가 필요, count 만큼의 <image/> 태그 필요
   multiselect(2) - <option/> 태그가 필요 없다.
   focus_display(3) -
   static(4) - 마우스 클릭에 의한 동작 없이 그림만 그림
   .....
  

3. <option/>
 - 하나의 태그 안에 모든  속성이 들어간다.
 - 필수 속성 없이 모든 속성이 선택이다.
 - 속성 종류
   margin (left, top, right, bottom)
   source_position
   count
   init_value -
   rgn(0) - 사각형 모양이 아닌 다른 형식의 버튼을 만든다.
   transparent(0xff00ff) - draw 속성이 transparent일 때
  
4. <image/>


5. <font/>



---------------------------------------------------------------------
---------------------------------------------------------------------

class CTag
{
 TCHAR*  m_pSzName;
 INT   m_nType;
}

class CTagList
{
 CTag  m_Tag;
 
 CTag*  m_pPrevTag;
 CTag*  m_pNextTag;
}

class CAttr
{
 TCHAR*  m_pSzKey;
 INT   m_nValue;
}

class CAttrList
{
 CAttr  m_Attr;
 
 CAttr*  m_pPrevAttr;
 CAttr*  m_pNextAttr;
}

---------------------------------------------------------------------
---------------------------------------------------------------------
CTagList m_TagList
CAttrList m_AttrList;
CTheme  m_Theme


CTag*  m_pTag = NULL
INT   nCount = 0

while ( ! eof )
{
 read text ( from < to > )
 m_pTag = new CTag
 
 m_TagList.Put( &m_pTag )
 m_pTag = NULL
 nCount++;
}


CTag*  m_pStartTag
CTag*  m_pEndTag

while ( i < nCount )
{
 find start tag( skin )
 
 if ( found )
 {
  CTagList.Get( &m_pStartTag )
  break;
 }
}

while ( i < nCount )
{
 find end tag( skin )
 
 if ( found )
 {
  CTagList.Get( &m_pEndTag )
  break;
 }
}


CSkin*  m_pSkin = NULL
CAttr*  m_pAttr = NULL

if ( m_pStartTag != NULL && m_pEndTag != NULL )
{
 m_pSkin = new CSkin;
 m_Theme.Put( &m_pSkin )
 
 
 while ( attribute extract from m_pStartTag )
 {
  m_pAttr = new CAttr
  m_AttrList.Put( &m_pAttr )
  m_pAttr = NULL
 }
}


%%
PhotoCE 만들 때 하려던 스킨 작업 일부

써드아이
써드아이