/*
 * Copyright (c) 2016 martin_id@vodafone.co.nz
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#include <cluttermm.h>

int main(int argc, char** argv)
{
  Clutter::init(&argc, &argv);

 ClutterActor *stage = clutter_stage_new ();
 clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);

 //ClutterActor *actor = clutter_actor_new (); //this allows delegated layout

 //but this doesn't:
 Glib::RefPtr< Clutter::Actor > cppactor = Clutter::Actor::create();
 ClutterActor *actor = cppactor->gobj();

 // set the bounding box of the actor
 clutter_actor_set_position (actor, 0, 0);
 clutter_actor_set_size (actor, 480, 640);

 // set the background color of the actor
 clutter_actor_set_background_color (actor, CLUTTER_COLOR_Orange);

 // add a child; set the bounding box of the child, relative to the parent
 ClutterActor *child = clutter_actor_new ();

 clutter_actor_set_position (child, 20, 20);
 clutter_actor_set_size (child, 80, 240);

 // set the background color of the child
 clutter_actor_set_background_color (child, CLUTTER_COLOR_Blue);

 // add the child to the actor
 clutter_actor_add_child (stage, actor);
 clutter_actor_add_child (actor, child);

  // Show the stage:
  clutter_actor_show(stage);

  // Start the main loop, so we can respond to events:
  Clutter::main();

  return 0;
}
