Ejemplo n.º 1
0
int main( int argc, const char **argv )
{
    /* Create the application object */
    efl::EcoreApplication* app = new efl::EcoreApplication( argc, argv, "Ecore Paint Example" );

    /* Create the main window, a window with an embedded canvas */
    efl::EcoreEvasWindowSoftwareX11* mw = new efl::EcoreEvasWindowSoftwareX11( WIDTH, HEIGHT );
    mw->setAlpha (true);
  
    mw->show ();
  
    /* Create some objects on the canvas */
    efl::EvasCanvas* evas = mw->canvas();

    Size s = evas->size();
    cout << "PA: Size = " << s << endl;

    efl::EvasRectangle* bg = new efl::EvasRectangle( 0, 0, s.width(), s.height(), evas );
    bg->setColor( 50, 50, 50, 128 );
    bg->setLayer( 0 );
    bg->show();

    PaintArea* p = new PaintArea( evas );
    p->setGeometry( 0, 0, s.width(), s.height() );
    p->setLayer( 1 );
    p->show();

    /* Enter the application main loop */
    app->exec();

    /* Delete the application */
    delete app;

    return 0;
}
Ejemplo n.º 2
0
Archivo: main.cpp Proyecto: Limsik/e17
int main( int argc, const char **argv )
{
  /* Create the application object */
  Ecorexx::Application* app = new Ecorexx::Application( argc, argv, "Ecore Paint Example" );

  /* Create the main window, a window with an embedded canvas */
  Ecorexx::EvasWindowSoftwareX11* mw = new Ecorexx::EvasWindowSoftwareX11( Size (WIDTH, HEIGHT) );
  mw->setAlpha (true);

  mw->show ();

  /* Create some objects on the canvas */
  Evasxx::Canvas &evas = mw->getCanvas();

  Size s = evas.getSize();
  cout << "PA: Size = " << s << endl;

  Evasxx::Rectangle* bg = new Evasxx::Rectangle( evas, s );
  bg->setColor( Color (50, 50, 50, 128) );
  bg->setLayer( 0 );
  bg->show();

  PaintArea* p = new PaintArea( evas );
  p->resize( s );
  p->setLayer( 1 );
  p->show();

  /* Enter the application main loop */
  app->exec();

  /* Delete the application */
  delete app;

  return 0;
}