Пример #1
0
static void code_elem( Telem* elem )
{
  fprintf( outfile, "(\n" );
  indent();
  codeelemparam( elem->params[0] );
  fprintf( outfile, "\n" );
  unindent();
  codeindent();
  fprintf( outfile, ")" );
}
Пример #2
0
static void code_string_elem( Telem* elem )
{
  fprintf( outfile, "( \"%s\",\n", elem->params[0]->data.name );
  indent();
  codeelemparam( elem->params[1] );
  fprintf( outfile, "\n" );
  unindent();
  codeindent();
  fprintf( outfile, ")" );
}
Пример #3
0
static void code_start( Telem* elem )
{
  codeindent();
  if (elem->name && elem->elemidx != IMAGE && elem->elemidx != COLOR)
    generatename( elem );
  if ( codename( elem ) )
    fprintf( outfile, " = " );
  if (elem->name)
    fprintf( outfile, "IupSetAtt( \"%s\", ", elem->name );
  else
    fprintf( outfile, "IupSetAtt( NULL, " );
  codeelemname( elem );
}
Пример #4
0
static void code_elemlist( Telem* elem )
{
  int i=0;
  fprintf( outfile, "(\n" );
  indent();
  for (i=0; i<elem->nparams; i++)
  {
    codeelemparam( elem->params[i] );
    fprintf( outfile, ",\n" ); 
  }
  unindent();
  codeindent();
  fprintf( outfile, "NULL)" );
}
Пример #5
0
static void code_attrs( Telem* elem )
{
  fprintf( outfile, ", " );
  if (elem->attrs)
  {
    Telemlist *p = elem->attrs->first;
    indent();
    while (p)
    {
      fprintf( outfile, "\n" );
      codeindent();
      fprintf( outfile, "\"%s\", \"%s\", ",
               ((Tattr*)(p->data))->name, ((Tattr*)(p->data))->value );
      p = p ->next;
    }
    unindent();
  }
  fprintf( outfile, "NULL )" );
}
Пример #6
0
static void code_decl( Telem *e )
{
  if (e->name || e->attrs)
  {
    code_start( e );
    elems[e->elemidx].code( e ); 
    code_attrs( e );
  }
  else
  {
    codeindent();
    if (e->name && e->elemidx != IMAGE && e->elemidx != COLOR)
      generatename( e );
    if ( codename( e ) )
      fprintf( outfile, " = " );
    codeelemname( e );
    elems[e->elemidx].code( e ); 
  }
}
Пример #7
0
static void code_elemlist2( Telem* elem )
{
  int i=0;
  fprintf( outfile, "(\n" );
  indent();
  for (i=0; i<2; i++)
  {
    if (i < elem->nparams)
      codeelemparam( elem->params[i] );
    else
      fprintf( outfile, "NULL" ); 

    if (i == 1)
      fprintf( outfile, "\n" );
    else
      fprintf( outfile, ",\n" );
  }
  unindent();
  codeindent();
  fprintf( outfile, ")" );
}
Пример #8
0
static void codeelemparam( Tparam* param )
{
  if (param->tag == ELEM_PARAM)
  {
    code_decl( param->data.elem );
  }
  else
  {
    Telem *e = namedelem( param->data.name );
    codeindent();
    if (e)
    {
      codename( e );
      fprintf( outfile, " /* %s */", param->data.name );
    }
    else
    {
      fprintf( outfile, "IupGetHandle( \"%s\" )", param->data.name );
    }
  }
}
Пример #9
0
static void code_iupCpi( Telem* elem )
{
  int i=0;
  indent();
  fprintf( outfile, "( " );
  for (i=0; i<elem->nparams; i++)
  {
    if (elem->params[i]->tag == ELEM_PARAM)
    {
      fprintf( outfile, "\n" );
      codeindent();
      codeelemparam( elem->params[i] );
    }
    else
    {
      fprintf( outfile, "\"%s\"", elem->params[i]->data.name );
    }
    if (i+1<elem->nparams) fprintf( outfile, ", " ); 
  }
  fprintf( outfile, ")" );
  unindent();
}