Improved ecore_evas_basics example.
authorgastal <gastal@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 1 Mar 2012 13:02:08 +0000 (13:02 +0000)
committergastal <gastal@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 1 Mar 2012 13:02:08 +0000 (13:02 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@68570 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

doc/examples.dox
src/examples/ecore_evas_basics_example.c

index 318facd..ca4adb9 100644 (file)
  * @until ecore_evas_engines_free
  *
  * We then create an Ecore_Evas(window) with the first available engine, on
- * position 0,0 with size 200,200 and no especial flags:
+ * position 0,0 with size 200,200 and no especial flags, set it's title and show
+ * it:
  * @until evas_show
  *
  * We now add some important data to our Ecore_Evas:
  * We now print which Evas engine is being used for our example:
  * @until printf
  *
- * Next we are going to add a background to our window, for which we'll need to
- * get the canvas(Evas) on which to draw it:
+ * We are going to add a background to our window but before we can do that
+ * we'll need to get the canvas(Evas) on which to draw it:
  * @until canvas
  *
  * We then do a sanity check, verifying if the Ecore_Evas of the Evas is the
  * Ecore_Evas from which we got the Evas:
  * @until printf
  *
- * Once all else is done we run our main loop, and when that is done(application
- * is exiting) we free our Ecore_Evas and shutdown the ecore_evas subsystem:
+ * Now we can actually add the background:
+ * @until ecore_evas_object_associate
+ *
+ * To hide and show the windows of this process when the user presses 'h' and
+ * 's' respectively we need to know when the user types something, so we
+ * register a callback for when we can read something from @c stdin:
+ * @until )
+ *
+ * The callback that actually does the hiding and showing is pretty simple, it
+ * does a @c scanf(which we know won't block since there is something to read on
+ * @c stdin) and if the character is an 'h' we iterate over all windows calling
+ * @c ecore_evas_hide on them, if the character is an 's' we call @c
+ * ecore_evas_show instead:
+ * @dontinclude ecore_evas_basics_example.c
+ * @skip static Eina_Bool
+ * @until }
+ * @skip ecore_main_loop_begin
+ *
+ * Once all is done we run our main loop, and when that is done(application is
+ * exiting) we free our Ecore_Evas and shutdown the ecore_evas subsystem:
  * @until shutdown
  *
  * Here you have the full-source of the code:
index 5f0231f..942f9c6 100644 (file)
@@ -77,10 +77,7 @@ main(void)
    evas_object_show(bg);
    ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
 
-   ecore_main_fd_handler_add(STDIN_FILENO,
-              ECORE_FD_READ | ECORE_FD_ERROR,
-              _stdin_cb,
-              NULL, NULL, NULL);
+   ecore_main_fd_handler_add(STDIN_FILENO, ECORE_FD_READ, _stdin_cb, NULL, NULL, NULL);
 
    ecore_main_loop_begin();