efl

Форк
0
/
elementary_examples_cxx.dox 
5106 строк · 180.9 Кб
1
/**
2
 * @page Examples-cxx Examples with C++ Bindings.
3
 *
4
 * Here is a list of Elementary C++ Examples.
5
 *
6
 * @ref bg_cxx_example_01
7
 *
8
 * @ref bg_cxx_example_02
9
 *
10
 * @ref bubble_cxx_example_01
11
 *
12
 * @ref button_cxx_example_00
13
 * 
14
 * @ref button_cxx_example_01
15
 *
16
 * @ref calendar_cxx_example_01
17
 *
18
 * @ref calendar_cxx_example_02
19
 *
20
 * @ref calendar_cxx_example_03
21
 *
22
 * @ref calendar_cxx_example_04
23
 *
24
 * @ref calendar_cxx_example_05
25
 *
26
 * @ref clock_cxx_example
27
 *
28
 * @ref datetime_cxx_example
29
 *
30
 * @ref glview_cxx_example_01
31
 *
32
 * @ref hoversel_cxx_example_01
33
 *
34
 * @ref icon_cxx_example_01
35
 *
36
 * @ref menu_cxx_example_01
37
 *
38
 * @ref popup_cxx_example_01
39
 *
40
 * @ref radio_cxx_example_01
41
 *
42
 * @ref separator_cxx_example_01
43
 *
44
 * @ref slider_cxx_example
45
 *
46
 * @ref spinner_cxx_example
47
 *
48
 * @ref table_cxx_example_01
49
 *
50
 * @ref table_cxx_example_02
51
 *
52
 * @ref thumb_cxx_example_01
53
 * 
54
 */
55

56
/**
57
 * @page lambda Lambda Functions with Elementary - C++11
58
 
59
 * With this tutorial we'll give you a better view of how the lambda
60
 * function can and will be constantly use in the C++ bindings. For a
61
 * more broad approach you should do a little web research.
62
 
63
 * The syntax adopted for these examples:
64
 
65
 * @c [capture] @c (parameters) @c {body}
66
 
67
 * @a capture: Determinate how and if the capture occurs. Possible
68
 * indicators, two or more should be intercalated by commas:
69

70
 * @li [ ] - Capture nothing
71

72
 * @li [&] - Capture variables by reference
73

74
 * @li [=] - Capture variables by copy
75

76
 * @li [&a, b] - Capture <b> only @a a </b> by reference and <b> only
77
 * @a b </b> by copy
78

79
 * @li [&, a] - Capture variables by reference and <b> only @a a </b>
80
 * by copy
81

82
 * @li [this] - Capture @c this pointer by copy
83

84
 * @a parameters: List of parameters necessary for each specific
85
 * lambda function.
86
 
87
 * @a body: Function body
88

89
 * Let's start with a more simple lambda and later a more complex one,
90
 * all extracted from elementary examples:
91

92
 * <b>First Example</b> - @ref button_cxx_example_00 : 
93
 
94
 * @image html screenshots/button_cxx_example_00.png
95
 * @image latex screenshots/button_cxx_example_00.eps width=\textwidth
96

97
 * @dontinclude button_cxx_example_00.cc
98
 * @skipline btn
99
 * @skip auto
100
 * @until clicked_add
101

102
 * In this example we use a @a lambda function for elm::button
103
 * btn that will be called when that button is clicked in
104
 * callback_clicked_add( on_click ). This lambda will then ask to exit
105
 * Elementary's main loop with @a elm_exit(). If this call is issued,
106
 * it will flag the main loop to cease processing and return back to
107
 * its parent function, usually your elm_main() function.
108

109
 * Now let's analize the sintax used for this lambda:
110

111
 * With @a [] we are signaling that we don't want to capture any
112
 * variables and with @a () we are indicating that this lambda doesn't
113
 * need parameters to work as it should. Now the important part of this
114
 * function it's the @a body represented by @a {} where we are applying
115
 * elm_exit() everytime this lambda is called.
116

117
 * In this case we are using @a std::bind to bind the parameters of
118
 * our lambda function to return as @a std::function object to
119
 * on_click which was declare as auto.
120

121
 * For this example with std::bind we simplified our work simply
122
 * because we didn't have to search in the code or documentation of
123
 * Elementary to look for the parameters and/or values that the
124
 * callback_clicked_add requires of the function we are adding.
125

126
 * <b>Second Example</b> - @ref hoversel_cxx_example_01 : 
127
 
128
 * @image html screenshots/hoversel_cxx_example_01.png
129
 * @image latex screenshots/hoverse_cxx_example_01.eps width=\textwidth
130

131
 * @dontinclude hoversel_cxx_example_01.cc
132
 * @skip add_item
133
 * @until clicked_add
134

135
 * In this example we use a @a lambda function for @a hoversel that
136
 * will be called when that hoversel is clicked in
137
 * callback_clicked_add( add_item ). This lambda will then add an item
138
 * to heversel, note that since we allocate memory for the item we
139
 * need to know when the item dies so we can free that memory.
140

141
 * Now let's analize the sintax used for this lambda:
142

143
 * @li @a [] : signaling that we don't want to capture any
144
 * variables
145

146
 * @li @a (::elm::hoversel obj ) : indicating that this lambda needs
147
 * the parameter @p obj to work as it should. Bbecause we are only
148
 * adding the parameter we need instead of all the parameters this
149
 * callback requires we need to use placeholders in std::bind,
150
 * indicating the place that @obj should occupy in our
151
 * callback_clicked_add.
152

153
 * When the function object returned by bind is called, an argument
154
 * with placeholder _1 is replaced by the first argument in the call,
155
 * _2 is replaced by the second argument in the call, and so on.
156

157
 * @li @a body represented by @a {} where we are adding ervery
158
 * function and local variables that will be needed.
159

160
 * In this case we are using @a std::bind to bind the parameters of
161
 * our lambda function to return as @a std::function object to
162
 * add_item which was declare as auto.
163

164
 * @see Consult all examples from elementary with C++ Bindings @ref
165
 * Examples-cxx "here"
166
 */
167

168
/**
169
 * @page bg_cxx_example_01 elm::bg - Plain color background with C++ binding
170
 * @dontinclude bg_cxx_example_01.cc
171
 
172
 * This example just sets a default background with a plain color.
173

174
 * The first part consists of including the headers. In this case we
175
 * are only working with the Elementary C++ binding and thus we need
176
 * only to include him.
177
  
178
 * @skipline Elementary.hh
179
 
180
 * @attention If necessary the C and/or the C++ headers should be
181
 * include here as well.
182

183
 * Now we need to actually start the code and set the elm_policy,
184
 * which defines for a given policy group/identifier a new policy's
185
 * value, respectively. In this example the only policy we need to
186
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
187

188
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
189
 * automatically;
190
 
191
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
192
 * application's last window is closed;
193
 
194
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
195
 * application's last window is hidden;
196
 
197
 * @skip EAPI_MAIN
198
 * @until elm_policy_set
199
 
200
 * As you can see, the policy we chose was to quit when the last win
201
 * is hidden as opposed to examples with the C bindings where we
202
 * perpetually set it to quit when last win was closed. This changed
203
 * was necessary because in C++ binding as the elm mainloop stop
204
 * running all object are destroyed, references are unreferenced and
205
 * events are stopped at ELM_MAIN().
206
  
207
 * @see For more details consult elm_policy_set
208
 
209
 * Next step is creating an Elementary window, where win calls a
210
 * constructor and sets the type of the win to ELM_WIN_BASIC
211
 * (Elm_Win_Type), which is the indicated type for most of our
212
 * examples. Here we also set the title that will appear at the top of
213
 * our window and then the autohide state for it.
214
 
215
 * The autohide works similarly to @p autodel, automatically handling
216
 * "delete,request" signals when set to @p true, with the difference
217
 * that it will hide the window, instead of destroying it.
218

219
 * It is specially designed to work together with @p
220
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
221
 * Elementary's main loop when all the windows are hidden.
222
 
223
 * @skip ::elm::win
224
 * @until autohide_set
225

226
 * @note @p autodel and @a autohide are not mutually exclusive. The
227
 * window will be destructed if both autodel and autohide is set to @p
228
 * EINA_TRUE or @p true.
229
  
230
 * Now we construct the elm background and for this we use the C++
231
 * method below, setting it's parent.
232

233
 * @skipline ::elm::bg
234

235
 * To better understand, the function @c size_hint_weight_set for C++
236
 * bindings originated from C bindings function
237
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
238
 * With this function we set the hints for an object's weight.  The
239
 * parameters are:
240

241
 * @li x - Nonnegative double value to use as horizontal weight hint.
242

243
 * @li y - Nonnegative double value to use as vertical weight hint.
244

245
 * This is not a size enforcement in any way, it's just a hint that
246
 * should be used whenever appropriate. This is a hint on how a
247
 * container object should resize a given child within its area.
248

249
 * Containers may adhere to the simpler logic of just expanding the
250
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
251
 * helper weight macro in the EFL Evas Documentation) or the complete
252
 * one of taking each child's weight hint as real weights to how much
253
 * of its size to allocate for them in each axis. A container is
254
 * supposed to, after normalizing the weights of its children (with
255
 * weight hints), distribute the space it has to layout them by those
256
 * factors – most weighted children get larger in this process than
257
 * the least ones.
258

259
 * @skipline weight_set
260

261
 * @note Default weight hint values are 0.0, for both axis.
262

263
 * Now we add the background as a resize_object to win informing that
264
 * when the size of the win changes so should the background's
265
 * size. And finally we make it visible.
266
 
267
 * @skip win
268
 * @until visibility_set 
269
 
270
 * @remarks  If a color it's not setted the default color will be used.
271
  
272
 * Now we set the size for the window, making it visible in the end.
273
 
274
 * @skip size_set
275
 * @until visibility_set
276
 
277
 * Finally we just have to start the elm mainloop, starting to handle
278
 * events and drawing operations.
279
 
280
 * @skip elm_run
281
 * @until ELM_MAIN
282
 
283
 * The full code for this example can be found at @ref
284
 * bg_cxx_example_01.cc .
285

286
 * @example bg_cxx_example_01.cc
287
*/
288

289
/**
290
 * @page bg_cxx_example_02 elm::bg - Image background using C++ binding
291
 * @dontinclude bg_cxx_example_02.cc
292

293
 * This is the second background example and shows how to use the
294
 * Elementary background object to set an image as background of your
295
 * application.
296

297
 * The first part consists of including the headers. In this case we
298
 * are only working with the Elementary C++ binding and thus we need
299
 * only to include him.
300
 
301
 * @skipline Elementary.hh
302

303
 * @attention If necessary the C and/or the C++ headers should be
304
 * include here as well.
305

306
 * Now we need to actually start the code and set the elm_policy,
307
 * which defines for a given policy group/identifier a new policy's
308
 * value, respectively.  In this example the only policy we need to
309
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
310

311
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
312
 * automatically;
313

314
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
315
 * application's last window is closed;
316

317
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
318
 * application's last window is hidden;
319

320
 * @skip EAPI_MAIN
321
 * @until elm_policy_set
322

323
 * As you can see, the policy we chose was to quit when the last win
324
 * is hidden as opposed to examples with the C bindings where we
325
 * perpetually set it to quit when last win was closed. This changed
326
 * was necessary because in C++ binding as the elm mainloop stop
327
 * running all object are destroyed, references are unreferenced and
328
 * events are stopped at ELM_MAIN().
329

330
 * @see For more details consult elm_policy_set
331
 
332
 * Next step is creating an Elementary window, where win calls a
333
 * constructor and sets the type of the win to ELM_WIN_BASIC
334
 * (Elm_Win_Type), which is the indicated type for most of our
335
 * examples. Here we also set the title that will appear at the top of
336
 * our window and then the autohide state for it.
337

338
 * The autohide works similarly to @p autodel, automatically handling
339
 * "delete,request" signals when set to @p true, with the difference
340
 * that it will hide the window, instead of destroying it.
341

342
 * It is specially designed to work together with @p
343
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
344
 * Elementary's main loop when all the windows are hidden.
345
 
346
 * @skip ::elm::win
347
 * @until autohide_set
348

349
 * @note @p autodel and @a autohide are not mutually exclusive. The
350
 * window will be destructed if both autodel and autohide is set to @p
351
 * EINA_TRUE or @p true.
352

353
 * Our background will have an image, that will be displayed over the
354
 * background color.
355

356
 * To do so, first we set the directory and archive for the image. And
357
 * create the background that will display it.
358

359
 * @skip elm_app_info_set
360
 * @until ::elm::bg
361
  
362
 * Before loading this image, we set the load size of the image. The
363
 * load size is a hint about the size that we want the image displayed
364
 * in the screen. It's not the exact size that the image will have,
365
 * but usually a bit bigger. The background object can still be scaled
366
 * to a size bigger than the one set here. Setting the image load size
367
 * to something smaller than its real size will reduce the memory used
368
 * to keep the pixmap representation of the image, and the time to
369
 * load it. Here we set the load size to 20x20 pixels, but the image
370
 * is loaded with a size bigger than that (since it's just a hint):
371
 
372
 * @skipline load_size_set
373
 
374
 * And set our background image to be centered, instead of stretched
375
 * or scaled, so the effect of the load_size_set() can be easily
376
 * understood:
377
 
378
 * @skipline option_set
379
 
380
 * We need a filename to set, so we get one from the previous
381
 * installed images in the @c PACKAGE_DATA_DIR, and write its full
382
 * path to a std::stringstream. Then we use this stringstream to set
383
 * the file name in the background object:
384
 
385
 * @skip std::stringstream
386
 * @until file_set
387
 
388
 * Notice that the second argument of the file_set() function is @c
389
 * nullptr, since we are setting an image to this background. This
390
 * function also supports setting an Eet file as background, in which
391
 * case the @c key parameter wouldn't be @c nullptr, but be the name
392
 * of the Eet key instead.
393
 
394
 * To better understand, the function @c size_hint_weight_set for C++
395
 * bindings originated from C bindings function
396
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
397
 * With this function we set the hints for an object's weight.  The
398
 * parameters are:
399

400
 * @li x - Nonnegative double value to use as horizontal weight hint.
401

402
 * @li y - Nonnegative double value to use as vertical weight hint.
403

404
 * This is not a size enforcement in any way, it's just a hint that
405
 * should be used whenever appropriate.
406

407
 * This is a hint on how a container object should resize a given
408
 * child within its area.
409

410
 * Containers may adhere to the simpler logic of just expanding the
411
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
412
 * helper weight macro in the EFL Evas Documentation) or the complete
413
 * one of taking each child's weight hint as real weights to how much
414
 * of its size to allocate for them in each axis. A container is
415
 * supposed to, after normalizing the weights of its children (with
416
 * weight hints), distribute the space it has to layout them by those
417
 * factors – most weighted children get larger in this process than
418
 * the least ones.
419

420
 * @skipline weight_set
421

422
 * @note Default weight hint values are 0.0, for both axis.
423

424
 * Now we add the background as a resize_object to win informing that
425
 * when the size of the win changes so should the background's
426
 * size. And finally we make background.
427

428
 * @skip win
429
 * @until visibility
430

431
 * Now we only have to set the size for our window and make it
432
 * visible.
433
 
434
 * @skip size_set
435
 * @until visibility_set
436

437
 * Finally we just have to start the elm mainloop, starting to handle
438
 * events and drawing operations.
439
 
440
 * @skip elm_run
441
 * @until ELM_MAIN
442

443
 * The full code for this example can be found at @ref
444
 * bg_cxx_example_02.cc .
445

446
 * This example will look like this:
447

448
 * @image html screenshots/bg_cxx_example_02.png
449
 * @image latex screenshots/bg_cxx_example_02.eps width=\textwidth
450
 * @example bg_cxx_example_02.cc
451
 */
452

453
/**
454
 * @page bubble_cxx_example_01 elm::bubble - Simple use with C++ binding
455
 * @dontinclude bubble_cxx_example_01.cc
456

457
 * This example shows a bubble with all fields set - label, info,
458
 * content and icon - and the selected corner changing when the bubble
459
 * is clicked.
460
  
461
 * The first part consists of including the headers. In this case we
462
 * are working with the Elementary and Evas C++ bindings and thus we
463
 * need only to include them.
464
  
465
 * @skip Elementary
466
 * @untilt Evas
467
 
468
 * @attention If necessary the C and/or the C++ headers should be
469
 * include here as well.
470

471
 * Now we need to actually start the code and set the elm_policy,
472
 * which defines for a given policy group/identifier a new policy's
473
 * value, respectively.  In this example the only policy we need to
474
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
475

476
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
477
 * automatically;
478
 
479
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
480
 * application's last window is closed;
481
 
482
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
483
 * application's last window is hidden;
484
 
485
 * @skip EAPI_MAIN
486
 * @until elm_policy_set
487
 
488
 * As you can see, the policy we chose was to quit when the last win
489
 * is hidden as opposed to examples with the C bindings where we
490
 * perpetually set it to quit when last win was closed. This changed
491
 * was necessary because in C++ binding as the elm mainloop stop
492
 * running all object are destroyed, references are unreferenced and
493
 * events are stopped at ELM_MAIN().
494
  
495
 * @see For more details consult elm_policy_set
496

497
 * Next step is creating an Elementary window, where win calls a
498
 * constructor and sets the type of the win to ELM_WIN_BASIC
499
 * (Elm_Win_Type), which is the indicated type for most of our
500
 * examples. Here we also set the title that will appear at the top of
501
 * our window and then the autohide state for it.
502

503
 * The autohide works similarly to @p autodel, automatically handling
504
 * "delete,request" signals when set to @p true, with the difference
505
 * that it will hide the window, instead of destroying it.
506

507
 * It is specially designed to work together with @p
508
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
509
 * Elementary's main loop when all the windows are hidden.
510
 
511
 * @skip ::elm::win
512
 * @until autohide_set
513

514
 * @note @p autodel and @a autohide are not mutually exclusive. The
515
 * window will be destructed if both autodel and autohide is set to @p
516
 * EINA_TRUE or @p true.
517
 
518
 * Now we construct the elm background using the C++ method below,
519
 * setting it's parent.
520

521
 * @skipline elm::bg
522
 
523
 * To better understand, the function @c size_hint_weight_set for C++
524
 * bindings originated from C bindings function
525
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
526
 * With this function we set the hints for an object's weight.
527

528
 * The parameters are:
529

530
 * @li x - Nonnegative double value to use as horizontal weight hint.
531

532
 * @li y - Nonnegative double value to use as vertical weight hint.
533

534
 * This is not a size enforcement in any way, it's just a hint that
535
 * should be used whenever appropriate.
536

537
 * This is a hint on how a container object should resize a given
538
 * child within its area.
539

540
 * Containers may adhere to the simpler logic of just expanding the
541
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
542
 * helper weight macro in the EFL Evas Documentation) or the complete
543
 * one of taking each child's weight hint as real weights to how much
544
 * of its size to allocate for them in each axis. A container is
545
 * supposed to, after normalizing the weights of its children (with
546
 * weight hints), distribute the space it has to layout them by those
547
 * factors – most weighted children get larger in this process than
548
 * the least ones.
549

550
 * @skipline weight_set
551

552
 * @note Default weight hint values are 0.0, for both axis.
553

554
 * Now we add the background as a resize_object to win informing that
555
 * when the size of the win changes so should the background's
556
 * size. And finally we make it visible. 
557

558
 * @skip resize
559
 * @until visibility_set 
560

561
 * @note If a color it's not setted the standard color will be used.
562
 
563
 * Here we are creating an elm::label that is going to be used as the
564
 * content for our bubble:
565

566
 * @skip elm::label
567
 * @until visibility_set
568
 
569
 * Despite it's name the bubble's icon in this case it's actually
570
 * evas::rectangle, that we set it's color to blue and at the end make
571
 * it visible.
572

573
 * @skip evas::rectangle
574
 * @until visibility_set
575
  
576
 * And finally we have the actual bubble creation and the setting of
577
 * it's label, info and content:
578

579
 * @skip elm::bubble
580
 * @until visibility_set
581

582
 * @remark Because we didn't set a corner, the default "top_left" will be used.
583

584
 * To have the selected corner change in a clockwise motion we are going to
585
 * use the following callback using lambda:
586

587
 * @skip auto
588
 * @until });
589
 
590
 * @see To learn more about consult @ref lambda.
591

592
 * Now that we have our bubble and callback all that is left is adding our
593
 * lambda as a clicked callback:
594

595
 * @line callback_clicked_add
596

597
 * This last bubble we created was very complete, so it's pertinent to show
598
 * that most of that stuff is optional a bubble can be created with nothing
599
 * but content:
600

601
 * @skip label2
602
 * @until bubble2.visibility_set
603

604
 * Now we only have to set the size for our window and make it
605
 * visible.
606
 
607
 * @skip size_set
608
 * @until visibility_set
609

610
 * And finally, start the elm mainloop, starting to handle events and
611
 * drawing operations.
612

613
 * @skip elm_run
614
 * @until ELM_MAIN
615

616
 * Our example will look like this:
617

618
 * @image html screenshots/bubble_cxx_example_01.png
619
 * @image latex screenshots/bubble_cxx_example_01.eps width=\textwidth
620

621
 * @see Full source code @ref bubble_cxx_example_01.cc .
622

623
 * @example bubble_cxx_example_01.cc
624
 */
625

626
/**
627
 * @page button_cxx_example_00 Button - Hello, Button!
628
 * @dontinclude button_cxx_example_00.cc
629
 
630
 * Keeping the tradition, this is a simple "Hello, World" button
631
 * example. We will show how to create a button and associate an
632
 * action to be performed when you click on it. 
633
 
634
 * The first part consists of including the headers. In this case we
635
 * are only working with the Elementary C++ binding and thus we need
636
 * only to include him.
637
 
638
 * @skipline Elementary.hh
639

640
 * @attention If necessary the C and/or the C++ headers should be
641
 * include here as well.
642

643
 * Now we need to actually start the code and set the elm_policy,
644
 * which defines for a given policy group/identifier a new policy's
645
 * value, respectively.  In this example the only policy we need to
646
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
647

648
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
649
 * automatically;
650
 
651
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
652
 * application's last window is closed;
653
 
654
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
655
 * application's last window is hidden;
656
 
657
 * @skip EAPI_MAIN
658
 * @until elm_policy_set
659
 
660
 * As you can see, the policy we chose was to quit when the last win
661
 * is hidden as opposed to examples with the C bindings where we
662
 * perpetually set it to quit when last win was closed. This changed
663
 * was necessary because in C++ binding as the elm mainloop stop
664
 * running all object are destroyed, references are unreferenced and
665
 * events are stopped at ELM_MAIN().
666
  
667
 * @see For more details consult elm_policy_set
668
 
669
 * Next step is creating an Elementary window, where win calls a
670
 * constructor and sets the type of the win to ELM_WIN_BASIC
671
 * (Elm_Win_Type), which is the indicated type for most of our
672
 * examples. Here we also set the title that will appear at the top of
673
 * our window and then the autohide state for it.
674
 
675
 * The autohide works similarly to @p autodel, automatically handling
676
 * "delete,request" signals when set to @p true, with the difference
677
 * that it will hide the window, instead of destroying it.
678

679
 * It is specially designed to work together with @p
680
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
681
 * Elementary's main loop when all the windows are hidden.
682
 
683
 * @skip ::elm::win
684
 * @until autohide_set
685

686
 * @note @p autodel and @a autohide are not mutually exclusive. The
687
 * window will be destructed if both autodel and autohide is set to @p
688
 * EINA_TRUE or @p true.
689
  
690
 * Now we construct the elm background and for this we use the C++
691
 * method below, setting it's parent.
692

693
 * @skipline ::elm::bg
694

695
 * The function @c size_hint_weight_set for C++ bindings originated
696
 * from C bindings function evas_object_size_hint_weight_set, that is
697
 * EFL Evas type function. With this function we set the hints for an
698
 * object's weight. The parameters are:
699

700
 * @li x - Nonnegative double value to use as horizontal weight hint.
701

702
 * @li y - Nonnegative double value to use as vertical weight hint.
703

704
 * This is not a size enforcement in any way, it's just a hint that
705
 * should be used whenever appropriate.  This is a hint on how a
706
 * container object should resize a given child within its area.
707

708
 * Containers may adhere to the simpler logic of just expanding the
709
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
710
 * helper weight macro in the EFL Evas Documentation) or the complete
711
 * one of taking each child's weight hint as real weights to how much
712
 * of its size to allocate for them in each axis. A container is
713
 * supposed to, after normalizing the weights of its children (with
714
 * weight hints), distribute the space it has to layout them by those
715
 * factors – most weighted children get larger in this process than
716
 * the least ones.
717

718
 * @skipline weight_set
719

720
 * @note Default weight hint values are 0.0, for both axis.
721

722
 * Now we add the background as a resize_object to win informing that
723
 * when the size of the win changes so should the background's
724
 * size. And finally we make it visible.
725
 
726
 * @skip win
727
 * @until visibility_set 
728
 
729
 * @remarks  If a color it's not setted the default color will be used.
730
  
731
 * There is only one button on this interface. We need to create this
732
 * button with the C++ method, set the text to be displayed, the size,
733
 * position and the size hint for weight.
734

735
 * @skip btn
736
 * @until weight
737

738
 * For alignment we'll use the function @c size_hint_align_set for C++
739
 * bindings originated from C bindings function
740
 * evas_object_size_hint_align_set, that is EFL Evas type
741
 * function. With this function we set the hints for an object's
742
 * alignment. The parameters are:
743
 
744
 * @li x - Double, ranging from 0.0 to 1.0 or with the special value
745
 * EVAS_HINT_FILL, to use as horizontal alignment hint.
746

747
 * @li y - Double, ranging from 0.0 to 1.0 or with the special value
748
 * EVAS_HINT_FILL, to use as vertical alignment hint.
749

750
 * These are hints on how to align an object inside the boundaries of
751
 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
752
 * with the special value EVAS_HINT_FILL used to specify "justify" or
753
 * "fill" by some users. In this case, maximum size hints should be
754
 * enforced with higher priority, if they are set. Also, any padding
755
 * hint set on objects should add up to the alignment space on the
756
 * final scene composition.
757

758
 * For the horizontal component, 0.0 means to the left, 1.0 means to
759
 * the right. Analogously, for the vertical component, 0.0 to the top,
760
 * 1.0 means to the bottom.
761

762
 * This is not a size enforcement in any way, it's just a hint that
763
 * should be used whenever appropriate.
764

765
 * @skipline align
766

767
 * @note Default alignment hint values are 0.5, for both axis.
768

769
 * Continuing with our button we make it visible.
770

771
 * @skipline visibility
772

773
 * This button performs a basic action: close the application. This
774
 * behavior is described by on_click() which is a lambda function,
775
 * that interrupt the program invoking elm_exit(). The lambda function
776
 * on_click is the added as a clicked callback to btn.
777

778
 * @skip on_click
779
 * @until callback
780

781
 * @see For more details consult @ref lambda 
782
 
783
 * Now we set the size for the window, making it visible in the end:
784
 
785
 * @skip size_set
786
 * @until visibility_set
787
 
788
 * Finally we just have to start the elm mainloop, starting to handle
789
 * events and drawing operations.
790

791
 * @skip elm_run
792
 * @until ELM_MAIN
793

794
 * The full code for this example can be found at @ref
795
 * button_cxx_example_00.cc .
796

797
 * This example will look like this:
798
 * @image html screenshots/button_cxx_example_00.png
799
 * @image latex screenshots/button_cxx_example_00.eps width=\textwidth
800
 * @example button_cxx_example_00.cc
801
 */
802

803
/**
804
 * @page button_cxx_example_01 Button - Complete example
805
 * @dontinclude button_cxx_example_01.cc
806

807
 * A button is simple, you click on it and something happens. That said,
808
 * we'll go through an example to show in detail the button API less
809
 * commonly used.
810
 
811
 * The first part consists of including the headers. In this case we
812
 * are only working with the Elementary C++ binding and thus we need
813
 * only to include him.
814
 
815
 * @skipline Elementary.hh
816

817
 * @attention If necessary the C and/or the C++ headers should be
818
 * include here as well.
819

820
 * Now we need to actually start the code and set the elm_policy,
821
 * which defines for a given policy group/identifier a new policy's
822
 * value, respectively.  In this example the only policy we need to
823
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
824

825
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
826
 * automatically;
827
 
828
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
829
 * application's last window is closed;
830
 
831
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
832
 * application's last window is hidden;
833
 
834
 * @skip EAPI_MAIN
835
 * @until elm_policy_set
836
 
837
 * As you can see, the policy we chose was to quit when the last win
838
 * is hidden as opposed to examples with the C bindings where we
839
 * perpetually set it to quit when last win was closed. This changed
840
 * was necessary because in C++ binding as the elm mainloop stop
841
 * running all object are destroyed, references are unreferenced and
842
 * events are stopped at ELM_MAIN().
843
  
844
 * @see For more details consult elm_policy_set
845

846
 * Next step is creating an Elementary window, in this example we use
847
 * the C++ binding method with the elm_win_util_standard_add that is a
848
 * elm_win_legacy function, better explained below. And then we set
849
 * the autohide state for it.
850
 
851
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
852
 * Adds a window object with standard setup.
853
 * Parameters:
854
 
855
 * @li @p name - The name of the window;
856

857
 * @li @p title - The title for the window.
858

859
 * This creates a window but also puts in a standard background with
860
 * @p elm_bg_add(), as well as setting the window title to @p
861
 * title. The window type created is of type @c ELM_WIN_BASIC, with
862
 * the @c NULL as the parent widget. Returns the created object or @c
863
 * NULL on failure.
864

865
 * The autohide works similarly to @p autodel, automatically handling
866
 * "delete,request" signals when set to @p true, with the difference
867
 * that it will hide the window, instead of destroying it.
868

869
 * It is specially designed to work together with @p
870
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
871
 * Elementary's main loop when all the windows are hidden.
872
 
873
 * @skip ::elm::win
874
 * @until autohide_set
875

876
 * @note @p autodel and @a autohide are not mutually exclusive. The
877
 * window will be destructed if both autodel and autohide is set to @p
878
 * EINA_TRUE or @p true.
879
 
880
 * In this example we'll have several buttons that will be arranged in
881
 * two boxes that will be inserted in a bigger box. One of the smaller
882
 * boxes will contain a set of buttons that will set different times
883
 * for the autorepeat timeouts of the buttons that will be contained in
884
 * the other smaller box.
885

886
 * For all this to work, we will construct the three smaller boxes and
887
 * all the button that will be needed. The smaller boxes will be then
888
 * packed in the bigger one.
889

890
 * In this part we'll create our directional buttons, that we'll be
891
 * added in the third smaller box, this is necessary for our callback
892
 * to work properly.
893

894
 * @skip icon
895
 * @until right
896

897
 * Now let's create our bigger box using the C++ method and setting
898
 * it's parent as win.
899

900
 * @skipline box
901

902
 * The function @c size_hint_weight_set for C++ bindings originated
903
 * from C bindings function evas_object_size_hint_weight_set, that is
904
 * EFL Evas type function. With this function we set the hints for an
905
 * object's weight. The parameters are:
906

907
 * @li x - Nonnegative double value to use as horizontal weight hint.
908

909
 * @li y - Nonnegative double value to use as vertical weight hint.
910

911
 * This is not a size enforcement in any way, it's just a hint that
912
 * should be used whenever appropriate.  This is a hint on how a
913
 * container object should resize a given child within its area.
914

915
 * Containers may adhere to the simpler logic of just expanding the
916
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
917
 * helper weight macro in the EFL Evas Documentation) or the complete
918
 * one of taking each child's weight hint as real weights to how much
919
 * of its size to allocate for them in each axis. A container is
920
 * supposed to, after normalizing the weights of its children (with
921
 * weight hints), distribute the space it has to layout them by those
922
 * factors – most weighted children get larger in this process than
923
 * the least ones.
924

925
 * @skipline weight_set
926

927
 * @note Default weight hint values are 0.0, for both axis.
928
 
929
 * Now we add the box as a resize_object to win informing that when
930
 * the size of the win changes so should the box's size. And finally
931
 * we make it visible.
932
 
933
 * @skip win
934
 * @until visibility_set 
935

936
 * Creating our initial box, again using the C++ method, in this case
937
 * we want the arrangement of the objects, that this box will contain,
938
 * to be displayed horizontally and fot this we will set horizontal to
939
 * @p true, vertical by default.
940
 
941
 * @skip box
942
 * @until horizontal
943

944
 * Again we'll set the size hint for weight, but in this box we will
945
 * set the packing method to include this box inside the bigger one.
946

947
 * When using the elm box the packing method of the subobj - box in
948
 * this case - should be defined. There are four possible methods:
949

950
 * @li @c pack_start(subobj_) - Add an object to the beginning of the
951
 * pack list. Pack @c subobj_ into the box obj, placing it first in
952
 * the list of children objects. The actual position the object will
953
 * get on screen depends on the layout used. If no custom layout is
954
 * set, it will be at the top or left, depending if the box is
955
 * vertical or horizontal, respectively.
956

957
 * @li @c pack_end(subobj_) - Add an object at the end of the pack
958
 * list. Pack @c subobj_ into the box obj, placing it last in the list
959
 * of children objects. The actual position the object will get on
960
 * screen depends on the layout used. If no custom layout is set, it
961
 * will be at the bottom or right, depending if the box is vertical or
962
 * horizontal, respectively.
963

964
 * @li @c pack_before(subobj_, before_) - Adds an object to the box
965
 * before the indicated object. This will add the @c subobj_ to the
966
 * box indicated before the object indicated with @c before_. If
967
 * before is not already in the box, results are undefined. Before
968
 * means either to the left of the indicated object or above it
969
 * depending on orientation.
970
 
971
 * @li @c pack_after(subobj_, after_) - Adds an object to the box
972
 * after the indicated object. This will add the @c subobj_ to the box
973
 * indicated after the object indicated with @c after_. If after is
974
 * not already in the box, results are undefined. After means either
975
 * to the right of the indicated object or below it depending on
976
 * orientation.
977

978
 * In this and most examples we use pack_end by choice and
979
 * practicality. In this part of the code we also make calendar
980
 * visible.
981

982
 * @skip pack_end
983
 * @until visibility
984

985
 * Now let's start creating the buttons that will be included in this
986
 * first small box, this will contain the initial timeout button.
987

988
 * We'll use again the C++ method to create this button, set a text,
989
 * packing method for btn and finally make it visible.
990

991
 * @skip btn
992
 * @until visibility
993

994
 * In this part we'll use Lambda type function that will be added in
995
 * the clicked callback for all buttons in the first smaller box,
996
 * that'll identify the current initial and gap to be use in the
997
 * autorepeat timeout that will move the central button.
998

999
 * @skip auto
1000
 * @until callback
1001

1002
 * @note To learn more about Lambda Function and its use in Elementary
1003
 * consult @ref lambda.
1004

1005
 * The second and third button will also set the initial timeout but
1006
 * with different values.
1007

1008
 * @skip btn2
1009
 * @until btn3.callback
1010

1011
 * Now for our gap timeout buttons will create our second smaller box,
1012
 * the same way with the initial box, we'll use the C++ method, set to
1013
 * be horizontal, set the size hint weight, choose the packing method
1014
 * and set the visibility to true.
1015

1016
 * @skip box_gap
1017
 * @until visibility
1018
 
1019
 * For our gap buttons we'll again, use the C++ method, set the texts
1020
 * with the different values for gap, choose the packing method, set
1021
 * the visibility and the clicked callback.
1022

1023
 * @skip btn4
1024
 * @until btn6.callback
1025

1026
 * Now we'll give our directional buttons more options so that it will
1027
 * visible and also have all the caracteristics that is require.
1028

1029
 * For the up button, we'll set to @p true the autorepeat,
1030
 * autorepeat_initial_timeout, autoreapet_gap_timeout, the size hints
1031
 * for weight and alignment, choose our packing method and making out
1032
 * up button visible.
1033

1034
 * @skip up
1035
 * @until visibility
1036

1037
 * For this directional buttons we'll have a different repeated
1038
 * callback that will insure the timeouts of our middle button in the
1039
 * gap and initial timeout that is current setted.
1040

1041
 * @skip auto
1042
 * @until 
1043

1044
 * For our second callback, we'll detail the release of our
1045
 * directional buttons.
1046

1047
 * @skip auto
1048
 * @until callback
1049

1050
 * Finishing our up button, we'll create an icon, that'll will be the
1051
 * standard "arrow_up".
1052

1053
 * @skip icon
1054
 * @until content
1055

1056
 * This last box, will content all the directional buttons and the
1057
 * middle button. As before, we use the C++ method, horizontal set,
1058
 * weight and align hints, chose the packing method and make it
1059
 * visible.
1060

1061
 * @skip box
1062
 * @until visibility
1063

1064
 * Now we'll create all the directional and middle buttons, the same as we did with the up button,
1065
 * changing only the icon.
1066

1067
 * @skip left
1068
 * @until down.content
1069

1070
 * Now we set the size for the window, making it visible in the end:
1071
 
1072
 * @skip size_set
1073
 * @until visibility_set
1074
 
1075
 * Finally we just have to start the elm mainloop, starting to handle
1076
 * events and drawing operations.
1077

1078
 * @skip elm_run
1079
 * @until ELM_MAIN
1080

1081
 * The full code for this example can be found at @ref
1082
 * button_cxx_example_01.cc .
1083
 
1084
 * This example will look like this:
1085
 * @image html screenshots/button_cxx_example_01.png
1086
 * @image latex screenshots/button_cxx_example_01.eps width=\textwidth
1087
 * @example button_cxx_example_01.cc
1088
 */
1089

1090
/**
1091
 * @page calendar_cxx_example_01 Calendar - Simple creation with C++ binding
1092
 * @dontinclude calendar_cxx_example_01.cc
1093

1094
 * As a first example, let's just display a calendar in our window,
1095
 * explaining all steps required to do so.
1096
 
1097
 * The first part consists of including the headers. In this case we
1098
 * are only working with the Elementary C++ binding and thus we need
1099
 * only to include him.
1100
 
1101
 * @skipline Elementary.hh
1102

1103
 * @attention If necessary the C and/or the C++ headers should be
1104
 * include here as well.
1105

1106
 * Now we need to actually start the code and set the elm_policy,
1107
 * which defines for a given policy group/identifier a new policy's
1108
 * value, respectively.  In this example the only policy we need to
1109
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
1110

1111
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
1112
 * automatically;
1113
 
1114
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
1115
 * application's last window is closed;
1116
 
1117
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
1118
 * application's last window is hidden;
1119
 
1120
 * @skip EAPI_MAIN
1121
 * @until elm_policy_set
1122
 
1123
 * As you can see, the policy we chose was to quit when the last win
1124
 * is hidden as opposed to examples with the C bindings where we
1125
 * perpetually set it to quit when last win was closed. This changed
1126
 * was necessary because in C++ binding as the elm mainloop stop
1127
 * running all object are destroyed, references are unreferenced and
1128
 * events are stopped at ELM_MAIN().
1129
  
1130
 * @see For more details consult elm_policy_set
1131

1132
 * Next step is creating an Elementary window, in this example we use
1133
 * the C++ binding method with the elm_win_util_standard_add that is a
1134
 * elm_win_legacy function, better explained below. And then we set
1135
 * the autohide state for it.
1136
 
1137
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
1138
 * Adds a window object with standard setup.
1139
 * Parameters:
1140
 
1141
 * @li @p name - The name of the window;
1142

1143
 * @li @p title - The title for the window.
1144

1145
 * This creates a window but also puts in a standard background with
1146
 * @p elm_bg_add(), as well as setting the window title to @p
1147
 * title. The window type created is of type @c ELM_WIN_BASIC, with
1148
 * the @c NULL as the parent widget. Returns the created object or @c
1149
 * NULL on failure.
1150

1151
 * The autohide works similarly to @p autodel, automatically handling
1152
 * "delete,request" signals when set to @p true, with the difference
1153
 * that it will hide the window, instead of destroying it.
1154

1155
 * It is specially designed to work together with @p
1156
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
1157
 * Elementary's main loop when all the windows are hidden.
1158
 
1159
 * @skip ::elm::win
1160
 * @until autohide_set
1161

1162
 * @note @p autodel and @a autohide are not mutually exclusive. The
1163
 * window will be destructed if both autodel and autohide is set to @p
1164
 * EINA_TRUE or @p true.
1165
 
1166
 * Now, the exciting part, let's create the calendar with the C++
1167
 * binding method, passing our window object as parent.
1168

1169
 * @skipline elm::calendar
1170

1171
 * The function @c size_hint_weight_set for C++ bindings originated
1172
 * from C bindings function evas_object_size_hint_weight_set, that is
1173
 * EFL Evas type function. With this function we set the hints for an
1174
 * object's weight. The parameters are:
1175

1176
 * @li x - Nonnegative double value to use as horizontal weight hint.
1177

1178
 * @li y - Nonnegative double value to use as vertical weight hint.
1179

1180
 * This is not a size enforcement in any way, it's just a hint that
1181
 * should be used whenever appropriate.  This is a hint on how a
1182
 * container object should resize a given child within its area.
1183

1184
 * Containers may adhere to the simpler logic of just expanding the
1185
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
1186
 * helper weight macro in the EFL Evas Documentation) or the complete
1187
 * one of taking each child's weight hint as real weights to how much
1188
 * of its size to allocate for them in each axis. A container is
1189
 * supposed to, after normalizing the weights of its children (with
1190
 * weight hints), distribute the space it has to layout them by those
1191
 * factors – most weighted children get larger in this process than
1192
 * the least ones.
1193

1194
 * @skipline weight_set
1195

1196
 * @note Default weight hint values are 0.0, for both axis.
1197

1198
 * Now we add the calendar as a resize-object to win informing that
1199
 * when the size of the win changes so should the calendar's
1200
 * size. And finally we make it visible.
1201

1202
 * @skip win
1203
 * @until visibility
1204

1205
 * Finally we just have to start the elm mainloop, starting to handle
1206
 * events and drawing operations.
1207
 
1208
 * @skip elm_run
1209
 * @until ELM_MAIN
1210

1211
 * Our example will look like this:
1212

1213
 * @image html screenshots/calendar_cxx_example_01.png
1214

1215
 * @image latex screenshots/calendar_cxx_example_01.eps width=\textwidth
1216

1217
 * See the full source code @ref calendar_cxx_example_01.cc here.
1218

1219
 * @example calendar_cxx_example_01.cc
1220
 */
1221

1222
/**
1223
 * @page calendar_cxx_example_02 Calendar - Layout strings formatting with C++ binding
1224
 * @dontinclude calendar_cxx_example_02.cc
1225
 
1226
 * In this simple example, we'll explain how to format the labels
1227
 * displaying month and year, and also set weekday names.
1228

1229
 * The first part consists of including the headers. In this case we
1230
 * are only working with the Elementary C++ binding and thus we need
1231
 * only to include him.
1232
 
1233
 * @skipline Elementary.hh
1234

1235
 * @attention If necessary the C and/or the C++ headers should be
1236
 * include here as well.
1237

1238
 * Now we will jump to the actual code and later explain the function
1239
 * to make this tutorial more didactical.
1240

1241
 * We must set the elm_policy, which defines for a given policy
1242
 * group/identifier a new policy's value, respectively.  In this
1243
 * example the only policy we need to set a value for is @c
1244
 * ELM_POLICY_QUIT, possibles values for it are:
1245

1246
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
1247
 * automatically;
1248
 
1249
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
1250
 * application's last window is closed;
1251
 
1252
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
1253
 * application's last window is hidden;
1254
 
1255
 * @skip EAPI_MAIN
1256
 * @until elm_policy_set
1257
 
1258
 * As you can see, the policy we chose was to quit when the last win
1259
 * is hidden as opposed to examples with the C bindings where we
1260
 * perpetually set it to quit when last win was closed. This changed
1261
 * was necessary because in C++ binding as the elm mainloop stop
1262
 * running all object are destroyed, references are unreferenced and
1263
 * events are stopped at ELM_MAIN().
1264
  
1265
 * @see For more details consult elm_policy_set
1266

1267
 * Next step is creating an Elementary window, in this example we use
1268
 * the C++ binding method with the elm_win_util_standard_add that is a
1269
 * elm_win_legacy function, better explained below. And then we set
1270
 * the autohide state for it.
1271
 
1272
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
1273
 * Adds a window object with standard setup.
1274
 * Parameters:
1275
 
1276
 * @li @p name - The name of the window;
1277

1278
 * @li @p title - The title for the window.
1279

1280
 * This creates a window but also puts in a standard background with
1281
 * @p elm_bg_add(), as well as setting the window title to @p
1282
 * title. The window type created is of type @c ELM_WIN_BASIC, with
1283
 * the @c NULL as the parent widget. Returns the created object or @c
1284
 * NULL on failure.
1285
 
1286
 * The autohide works similarly to @p autodel, automatically handling
1287
 * "delete,request" signals when set to @p true, with the difference
1288
 * that it will hide the window, instead of destroying it.
1289

1290
 * It is specially designed to work together with @p
1291
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
1292
 * Elementary's main loop when all the windows are hidden.
1293
 
1294
 * @skip ::elm::win
1295
 * @until autohide_set
1296

1297
 * @note @p autodel and @a autohide are not mutually exclusive. The
1298
 * window will be destructed if both autodel and autohide is set to @p
1299
 * EINA_TRUE or @p true.
1300

1301
 * Now let's create the calendar with the C++ binding method, passing
1302
 * our window object as parent.
1303

1304
 * @skipline elm::calendar
1305

1306
 * The function @c size_hint_weight_set for C++ bindings originated
1307
 * from C bindings function evas_object_size_hint_weight_set, that is
1308
 * EFL Evas type function. With this function we set the hints for an
1309
 * object's weight. The parameters are:
1310

1311
 * @li x - Nonnegative double value to use as horizontal weight hint.
1312

1313
 * @li y - Nonnegative double value to use as vertical weight hint.
1314

1315
 * This is not a size enforcement in any way, it's just a hint that
1316
 * should be used whenever appropriate.  This is a hint on how a
1317
 * container object should resize a given child within its area.
1318

1319
 * Containers may adhere to the simpler logic of just expanding the
1320
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
1321
 * helper weight macro in the EFL Evas Documentation) or the complete
1322
 * one of taking each child's weight hint as real weights to how much
1323
 * of its size to allocate for them in each axis. A container is
1324
 * supposed to, after normalizing the weights of its children (with
1325
 * weight hints), distribute the space it has to layout them by those
1326
 * factors – most weighted children get larger in this process than
1327
 * the least ones.
1328

1329
 * @skipline weight_set
1330

1331
 * @note Default weight hint values are 0.0, for both axis.
1332

1333
 * Now we add the calendar as a resize-object to win informing that
1334
 * when the size of the win changes so should the calendar's
1335
 * size.
1336

1337
 * @skipline win
1338

1339
 * To format month and year labels, we need to create a callback
1340
 * function to create a string given the selected time, declared under
1341
 * a <tt> struct tm </tt>.
1342

1343
 * <tt> struct tm </tt>, declared on @c time.h, is a structure
1344
 * composed by nine integers:
1345
 
1346
 * @li <tt> tm_sec   seconds [0,59] </tt>
1347
 * @li <tt> tm_min   minutes [0,59] </tt>
1348
 * @li <tt> tm_hour  hour [0,23] </tt>
1349
 * @li <tt> tm_mday  day of month [1,31] </tt>
1350
 * @li <tt> tm_mon   month of year [0,11] </tt>
1351
 * @li <tt> tm_year  years since 1900 </tt>
1352
 * @li <tt> tm_wday  day of week [0,6] (Sunday = 0) </tt>
1353
 * @li <tt> tm_yday  day of year [0,365] </tt>
1354
 * @li <tt> tm_isdst daylight savings flag </tt>
1355

1356
 * @note Glib version has 2 additional fields.
1357

1358
 * For our function @p _format_month_year , only stuff that matters
1359
 * are <tt>tm_mon</tt> and <tt>tm_year</tt>. But we don't need to
1360
 * access it directly, since there are nice functions to format date
1361
 * and time, as @c strftime.
1362

1363
 * We will get abbreviated month (%b) and year (%y) (check strftime
1364
 * manpage for more) in our example:
1365

1366
 * @dontinclude calendar_cxx_example_02.cc
1367
 * @skip static char
1368
 * @until }
1369

1370
 * We need to alloc the string to be returned, and calendar widget
1371
 * will free it when it's not needed, what is done by @c strdup.
1372

1373
 * So let's register our callback to calendar object:
1374

1375
 * @skipline format_function_set
1376
 
1377
 * To set weekday names, we should declare them as an array of
1378
 * strings:
1379

1380
 * @dontinclude calendar_cxx_example_02.cc
1381
 * @skip weekdays[]
1382
 * @until }
1383

1384
 * And then set them to calendar:
1385
 * @skipline weekdays_names_set
1386

1387
 * Finally we just have to make the calendar and window visible and
1388
 * then start the elm mainloop, starting to handle events and drawing
1389
 * operations.
1390
 
1391
 * @skip visibility
1392
 * @until ELM_MAIN
1393

1394
 * Our example will look like this:
1395

1396
 * @image html screenshots/calendar_cxx_example_02.png
1397
 * @image latex screenshots/calendar_cxx_example_02.eps width=\textwidth
1398
 
1399
 * See the full source code @ref calendar_cxx_example_02.cc here.
1400
 * @example calendar_cxx_example_02.cc
1401
 */
1402

1403
/**
1404
 * @page calendar_cxx_example_03 Calendar - Years restrictions with C++ binding
1405
 * @dontinclude calendar_cxx_example_03.cc
1406

1407
 * This example explains how to set max and min year to be displayed
1408
 * by a calendar object. This means that user won't be able to see or
1409
 * select a date before and after selected years.  By default, limits
1410
 * are 1902 and maximum value will depends on platform architecture
1411
 * (year 2037 for 32 bits); You can read more about time functions on
1412
 * @c ctime manpage.
1413

1414
 * The first part consists of including the headers. In this case we
1415
 * are only working with the Elementary C++ binding and thus we need
1416
 * only to include him.
1417
 
1418
 * @skipline Elementary.hh
1419

1420
 * @attention If necessary the C and/or the C++ headers should be
1421
 * include here as well.
1422

1423
 * Now we need to actually start the code and set the elm_policy,
1424
 * which defines for a given policy group/identifier a new policy's
1425
 * value, respectively. In this example the only policy we need to set
1426
 * a value for is @c ELM_POLICY_QUIT, possibles values for it are:
1427
 * function to make this tutorial more didactical.
1428

1429
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
1430
 * automatically;
1431
 
1432
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
1433
 * application's last window is closed;
1434
 
1435
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
1436
 * application's last window is hidden;
1437
 
1438
 * @skip EAPI_MAIN
1439
 * @until elm_policy_set
1440
 
1441
 * As you can see, the policy we chose was to quit when the last win
1442
 * is hidden as opposed to examples with the C bindings where we
1443
 * perpetually set it to quit when last win was closed. This changed
1444
 * was necessary because in C++ binding as the elm mainloop stop
1445
 * running all object are destroyed, references are unreferenced and
1446
 * events are stopped at ELM_MAIN().
1447
  
1448
 * @see For more details consult elm_policy_set
1449

1450
 * Next step is creating an elementary window, in this example we use
1451
 * the C++ binding method with the elm_win_util_standard_add that is a
1452
 * elm_win_legacy function, better explained below. And then we set
1453
 * the autohide state for it.
1454
 
1455
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
1456
 * Adds a window object with standard setup.
1457
 * Parameters:
1458
 
1459
 * @li @p name - The name of the window;
1460

1461
 * @li @p title - The title for the window.
1462

1463
 * This creates a window but also puts in a standard background with
1464
 * @p elm_bg_add(), as well as setting the window title to @p
1465
 * title. The window type created is of type @c ELM_WIN_BASIC, with
1466
 * the @c NULL as the parent widget. Returns the created object or @c
1467
 * NULL on failure.
1468
 
1469
 * The autohide works similarly to @p autodel, automatically handling
1470
 * "delete,request" signals when set to @p true, with the difference
1471
 * that it will hide the window, instead of destroying it.
1472

1473
 * It is specially designed to work together with @p
1474
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
1475
 * Elementary's main loop when all the windows are hidden.
1476
 
1477
 * @skip ::elm::win
1478
 * @until autohide_set
1479

1480
 * @note @p autodel and @a autohide are not mutually exclusive. The
1481
 * window will be destructed if both autodel and autohide is set to @p
1482
 * EINA_TRUE or @p true.
1483

1484
 * Now let's create the calendar with the C++ binding method, passing
1485
 * our window object as parent.
1486

1487
 * @skipline elm::calendar
1488

1489
 * The function @c size_hint_weight_set for C++ bindings originated
1490
 * from C bindings function evas_object_size_hint_weight_set, that is
1491
 * EFL Evas type function. With this function we set the hints for an
1492
 * object's weight. The parameters are:
1493

1494
 * @li x - Nonnegative double value to use as horizontal weight hint.
1495

1496
 * @li y - Nonnegative double value to use as vertical weight hint.
1497

1498
 * This is not a size enforcement in any way, it's just a hint that
1499
 * should be used whenever appropriate.  This is a hint on how a
1500
 * container object should resize a given child within its area.
1501

1502
 * Containers may adhere to the simpler logic of just expanding the
1503
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
1504
 * helper weight macro in the EFL Evas Documentation) or the complete
1505
 * one of taking each child's weight hint as real weights to how much
1506
 * of its size to allocate for them in each axis. A container is
1507
 * supposed to, after normalizing the weights of its children (with
1508
 * weight hints), distribute the space it has to layout them by those
1509
 * factors – most weighted children get larger in this process than
1510
 * the least ones.
1511

1512
 * @skipline weight_set
1513

1514
 * @note Default weight hint values are 0.0, for both axis.
1515

1516
 * Now we add the calendar as a resize-object to win informing that
1517
 * when the size of the win changes so should the calendar's
1518
 * size.
1519

1520
 * @skipline win
1521

1522
 * Straigh to the point, to set it is enough to call
1523
 * min_max_year_set(). First value is minimum year, second is
1524
 * maximum. If first value is negative, it won't apply limit for min
1525
 * year, if the second one is negative, won't apply for max year.
1526
 * Setting both to negative value will clear limits (default state):
1527

1528
 * @skipline min_max_year_set 
1529

1530
 * Finally we just have to make the calendar and window visible and
1531
 * then start the elm mainloop, starting to handle events and drawing
1532
 * operations.
1533
 
1534
 * @skip visibility
1535
 * @until ELM_MAIN
1536

1537
 * Our example will look like this:
1538

1539
 * @image html screenshots/calendar_cxx_example_03.png
1540
 * @image latex screenshots/calendar_cxx_example_03.eps width=\textwidth
1541

1542
 * See the full source code @ref calendar_cxx_example_03.cc here.
1543

1544
 * @example calendar_cxx_example_03.cc
1545
 */
1546

1547
/**
1548
 * @page calendar_cxx_example_04 Calendar - Days selection with C++ binding.
1549
 * @dontinclude calendar_cxx_example_04.cc
1550
 
1551
 * It's possible to disable date selection and to select a date
1552
 * from your program, and that's what we'll see on this example.
1553

1554
 * The first part consists of including the headers. In this case we
1555
 * are only working with the Elementary C++ binding and thus we need
1556
 * only to include him.
1557
 
1558
 * @skipline Elementary.hh
1559

1560
 * @attention If necessary the C and/or the C++ headers should be
1561
 * include here as well.
1562

1563
 * Now we need to actually start the code and set the elm_policy,
1564
 * which defines for a given policy group/identifier a new policy's
1565
 * value, respectively. In this example the only policy we need to set
1566
 * a value for is @c ELM_POLICY_QUIT, possibles values for it are:
1567

1568
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
1569
 * automatically;
1570
 
1571
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
1572
 * application's last window is closed;
1573
 
1574
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
1575
 * application's last window is hidden;
1576
 
1577
 * @skip EAPI_MAIN
1578
 * @until elm_policy_set
1579
 
1580
 * As you can see, the policy we chose was to quit when the last win
1581
 * is hidden as opposed to examples with the C bindings where we
1582
 * perpetually set it to quit when last win was closed. This changed
1583
 * was necessary because in C++ binding as the elm mainloop stop
1584
 * running all object are destroyed, references are unreferenced and
1585
 * events are stopped at ELM_MAIN().
1586
  
1587
 * @see For more details consult elm_policy_set
1588

1589
 * Next step is creating an elementary window, in this example we use
1590
 * the C++ binding method with the elm_win_util_standard_add that is a
1591
 * elm_win_legacy function, better explained below. And then we set
1592
 * the autohide state for it.
1593
 
1594
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
1595
 * Adds a window object with standard setup.
1596
 * Parameters:
1597
 
1598
 * @li @p name - The name of the window;
1599

1600
 * @li @p title - The title for the window.
1601

1602
 * This creates a window but also puts in a standard background with
1603
 * @p elm_bg_add(), as well as setting the window title to @p
1604
 * title. The window type created is of type @c ELM_WIN_BASIC, with
1605
 * the @c NULL as the parent widget. Returns the created object or @c
1606
 * NULL on failure.
1607

1608
 * The autohide works similarly to @p autodel, automatically handling
1609
 * "delete,request" signals when set to @p true, with the difference
1610
 * that it will hide the window, instead of destroying it.
1611

1612
 * It is specially designed to work together with @p
1613
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
1614
 * Elementary's main loop when all the windows are hidden.
1615
 
1616
 * @skip ::elm::win
1617
 * @until autohide_set
1618

1619
 * @note @p autodel and @a autohide are not mutually exclusive. The
1620
 * window will be destructed if both autodel and autohide is set to @p
1621
 * EINA_TRUE or @p true.
1622

1623
 * In this example we'll need to use a elm::box to layout the two
1624
 * calendars that'll be created. A box arranges objects in a linear
1625
 * fashion, governed by a layout function that defines the details of
1626
 * this arrangement. The box will use an internal function
1627
 * to set the layout to a single row, vertical by default.
1628

1629
 * Now let's create the box with the C++ binding method, passing
1630
 * our window object as parent.
1631

1632
 * @skipline elm::box
1633

1634
 * The function @c size_hint_weight_set for C++ bindings originated
1635
 * from C bindings function evas_object_size_hint_weight_set, that is
1636
 * EFL Evas type function. With this function we set the hints for an
1637
 * object's weight. The parameters are:
1638

1639
 * @li x - Nonnegative double value to use as horizontal weight hint.
1640

1641
 * @li y - Nonnegative double value to use as vertical weight hint.
1642

1643
 * This is not a size enforcement in any way, it's just a hint that
1644
 * should be used whenever appropriate.  This is a hint on how a
1645
 * container object should resize a given child within its area.
1646

1647
 * Containers may adhere to the simpler logic of just expanding the
1648
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
1649
 * helper weight macro in the EFL Evas Documentation) or the complete
1650
 * one of taking each child's weight hint as real weights to how much
1651
 * of its size to allocate for them in each axis. A container is
1652
 * supposed to, after normalizing the weights of its children (with
1653
 * weight hints), distribute the space it has to layout them by those
1654
 * factors – most weighted children get larger in this process than
1655
 * the least ones.
1656

1657
 * @skipline weight_set
1658

1659
 * @note Default weight hint values are 0.0, for both axis.
1660

1661
 * Now we add the box as a resize-object to win informing that when
1662
 * the size of the win changes so should the box's size. Remember
1663
 * always to set the box visibility to true.
1664

1665
 * @skip win  
1666
 * @until visibility
1667

1668
 * Now let's create the calendar with the C++ binding method, passing
1669
 * our window object as parent. The function size_hint_weight_set
1670
 * works with calendar the same way as with box, for more, search
1671
 * above.
1672

1673
 * @skip elm::calendar
1674
 * @until weight_set
1675
 
1676
 * The function @c size_hint_align_set for C++ bindings originated
1677
 * from C bindings function evas_object_size_hint_align_set, that is
1678
 * EFL Evas type function. With this function we set the hints for an
1679
 * object's alignment. The parameters are:
1680
 
1681
 * @li x - Double, ranging from 0.0 to 1.0 or with the special value
1682
 * EVAS_HINT_FILL, to use as horizontal alignment hint.
1683

1684
 * @li y - Double, ranging from 0.0 to 1.0 or with the special value
1685
 * EVAS_HINT_FILL, to use as vertical alignment hint.
1686

1687
 * These are hints on how to align an object inside the boundaries of
1688
 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
1689
 * with the special value EVAS_HINT_FILL used to specify "justify" or
1690
 * "fill" by some users. In this case, maximum size hints should be
1691
 * enforced with higher priority, if they are set. Also, any padding
1692
 * hint set on objects should add up to the alignment space on the
1693
 * final scene composition.
1694

1695
 * For the horizontal component, 0.0 means to the left, 1.0 means to
1696
 * the right. Analogously, for the vertical component, 0.0 to the top,
1697
 * 1.0 means to the bottom.
1698

1699
 * This is not a size enforcement in any way, it's just a hint that
1700
 * should be used whenever appropriate.
1701

1702
 * @note Default alignment hint values are 0.5, for both axis.
1703

1704
 * @skipline align_set
1705

1706
 * If isn't required that users could select a day on calendar, only
1707
 * interacting going through months, disabling days selection could be
1708
 * a good idea to avoid confusion. For that:
1709

1710
 * @skipline select_mode_set
1711

1712
 * When using the elm box the packing method of the subobj - calendar
1713
 * in this case - should be defined. There are four possible methods:
1714

1715
 * @li @c pack_start(subobj_) - Add an object to the beginning of the
1716
 * pack list. Pack @c subobj_ into the box obj, placing it first in
1717
 * the list of children objects. The actual position the object will
1718
 * get on screen depends on the layout used. If no custom layout is
1719
 * set, it will be at the top or left, depending if the box is
1720
 * vertical or horizontal, respectively.
1721

1722
 * @li @c pack_end(subobj_) - Add an object at the end of the pack
1723
 * list. Pack @c subobj_ into the box obj, placing it last in the list
1724
 * of children objects. The actual position the object will get on
1725
 * screen depends on the layout used. If no custom layout is set, it
1726
 * will be at the bottom or right, depending if the box is vertical or
1727
 * horizontal, respectively.
1728

1729
 * @li @c pack_before(subobj_, before_) - Adds an object to the box
1730
 * before the indicated object. This will add the @c subobj_ to the
1731
 * box indicated before the object indicated with @c before_. If
1732
 * before is not already in the box, results are undefined. Before
1733
 * means either to the left of the indicated object or above it
1734
 * depending on orientation.
1735
 
1736
 * @li @c pack_after(subobj_, after_) - Adds an object to the box
1737
 * after the indicated object. This will add the @c subobj_ to the box
1738
 * indicated after the object indicated with @c after_. If after is
1739
 * not already in the box, results are undefined. After means either
1740
 * to the right of the indicated object or below it depending on
1741
 * orientation.
1742

1743
 * In this and most examples we use pack_end by choice and
1744
 * practicality. In this part of the code we also make calendar
1745
 * visible.
1746

1747
 * @skip visibility
1748
 * @until pack_end
1749

1750
 * Also, regarding days selection, you could be interested to set a
1751
 * date to be highlighted on calendar from your code, maybe when a
1752
 * specific event happens or after calendar creation. As @c time
1753
 * output is in seconds, we define the number of seconds contained
1754
 * within a day as a constant:
1755

1756
 * @dontinclude calendar_cxx_example_04.cc
1757
 * @skipline SECS_DAY
1758

1759
 * As with the first calendar, we'll also construct cal2, set it's
1760
 * hint_weight and hint_align, make cal2 visible and choose the
1761
 * packing method.
1762
 
1763
 * @skip cal2
1764
 * @until weight
1765
 * @skip visibility
1766
 * @until pack
1767

1768
 * Now let's select two days from current day:
1769

1770
 * @dontinclude calendar_cxx_example_04.cc
1771
 * @skip time(NULL)
1772
 * @until selected_time_set
1773

1774
 * Finally we just have to make window visible and then start the elm
1775
 * mainloop, starting to handle events and drawing operations.
1776
 
1777
 * @skip visibility
1778
 * @until ELM_MAIN
1779

1780
 * Our example will look like this:
1781

1782
 * @image html screenshots/calendar_cxx_example_04.png
1783
 * @image latex screenshots/calendar_cxx_example_04.eps width=\textwidth
1784

1785
 * See the full source code @ref calendar_cxx_example_04.cc here.
1786
 * @example calendar_cxx_example_04.cc
1787
 */
1788

1789
/**
1790
 * @page calendar_cxx_example_05 Calendar - Signal callback and getters with C++ binding.
1791
 * @dontinclude calendar_cxx_example_05.cc
1792

1793
 * Most of setters explained on previous examples have associated
1794
 * getters. That's the subject of this example. We'll add a callback
1795
 * to display all calendar information every time user interacts with
1796
 * the calendar. To be more didatical we'll start with the basics.
1797

1798
 * The first part consists of including the headers. In this case we
1799
 * are only working with the Elementary C++ binding and thus we need
1800
 * only to include him.
1801
 
1802
 * @skipline Elementary.hh
1803

1804
 * @attention If necessary the C and/or the C++ headers should be
1805
 * included here as well.
1806

1807
 * Now we need to actually start the code and set the elm_policy,
1808
 * which defines for a given policy group/identifier a new policy's
1809
 * value, respectively. In this example the only policy we need to set
1810
 * a value for is @c ELM_POLICY_QUIT, possibles values for it are:
1811
 * function to make this tutorial more didactical.
1812

1813
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
1814
 * automatically;
1815
 
1816
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
1817
 * application's last window is closed;
1818
 
1819
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
1820
 * application's last window is hidden;
1821
 
1822
 * @skip EAPI_MAIN
1823
 * @until elm_policy_set
1824
 
1825
 * As you can see, the policy we chose was to quit when the last win
1826
 * is hidden as opposed to examples with the C bindings where we
1827
 * perpetually set it to quit when last win was closed. This changed
1828
 * was necessary because in C++ binding as the elm mainloop stop
1829
 * running all object are destroyed, references are unreferenced and
1830
 * events are stopped at ELM_MAIN().
1831
  
1832
 * @see For more details consult elm_policy_set
1833

1834
 * Next step is creating an elementary window, in this example we use
1835
 * the C++ binding method with the elm_win_util_standard_add that is a
1836
 * elm_win_legacy function, better explained below. And then we set
1837
 * the autohide state for it.
1838
 
1839
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
1840
 * Adds a window object with standard setup.
1841
 * Parameters:
1842
 
1843
 * @li @p name - The name of the window;
1844

1845
 * @li @p title - The title for the window.
1846

1847
 * This creates a window but also puts in a standard background with
1848
 * @p elm_bg_add(), as well as setting the window title to @p
1849
 * title. The window type created is of type @c ELM_WIN_BASIC, with
1850
 * the @c NULL as the parent widget. Returns the created object or @c
1851
 * NULL on failure.
1852
 
1853
 * The autohide works similarly to @p autodel, automatically handling
1854
 * "delete,request" signals when set to @p true, with the difference
1855
 * that it will hide the window, instead of destroying it.
1856

1857
 * It is specially designed to work together with @p
1858
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
1859
 * Elementary's main loop when all the windows are hidden.
1860
 
1861
 * @skip ::elm::win
1862
 * @until autohide_set
1863

1864
 * @note @p autodel and @a autohide are not mutually exclusive. The
1865
 * window will be destructed if both autodel and autohide is set to @p
1866
 * EINA_TRUE or @p true.
1867

1868
 * Now let's create the calendar with the C++ binding method, passing
1869
 * our window object as parent.
1870

1871
 * @skipline elm::calendar
1872

1873
 * The function @c size_hint_weight_set for C++ bindings originated
1874
 * from C bindings function evas_object_size_hint_weight_set, that is
1875
 * EFL Evas type function. With this function we set the hints for an
1876
 * object's weight. The parameters are:
1877

1878
 * @li x - Nonnegative double value to use as horizontal weight hint.
1879

1880
 * @li y - Nonnegative double value to use as vertical weight hint.
1881

1882
 * This is not a size enforcement in any way, it's just a hint that
1883
 * should be used whenever appropriate.  This is a hint on how a
1884
 * container object should resize a given child within its area.
1885

1886
 * Containers may adhere to the simpler logic of just expanding the
1887
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
1888
 * helper weight macro in the EFL Evas Documentation) or the complete
1889
 * one of taking each child's weight hint as real weights to how much
1890
 * of its size to allocate for them in each axis. A container is
1891
 * supposed to, after normalizing the weights of its children (with
1892
 * weight hints), distribute the space it has to layout them by those
1893
 * factors – most weighted children get larger in this process than
1894
 * the least ones.
1895

1896
 * @skipline weight_set
1897

1898
 * @note Default weight hint values are 0.0, for both axis.
1899

1900
 * Now we add the calendar as a resize-object to win informing that
1901
 * when the size of the win changes so should the calendar's
1902
 * size.
1903

1904
 * Let's check our callback function, type lambda:
1905
 * @skip print_cal_info
1906
 * @until double interval;
1907
 
1908
 * To learn more about consult @ref lambda.
1909
 
1910
 * To get selected day, we need to call selected_time_get(), but to
1911
 * assure nothing wrong happened, we must check for function return.
1912
 * It'll return @c EINA_FALSE if fail. Otherwise we can use time set
1913
 * to our structure @p stime.
1914

1915
 * @skip selected_time_get
1916
 * @until return
1917
 
1918
 * Next we'll get information from calendar and place on declared
1919
 * vars:
1920

1921
 * @skip interval
1922
 * @until weekdays_names_get
1923

1924
 * The only tricky part is that last line gets an array of strings
1925
 * (char arrays), one for each weekday.
1926

1927
 * Then we can simple print that with std::cout and finish the lambda
1928
 * function:
1929

1930
 * @skip std::cout
1931
 * @until std::placeholders::_1
1932

1933
 * <tt> struct tm </tt> is declared on @c time.h. You can check @c
1934
 * ctime manpage to read about it.
1935
 
1936
 * To register this callback, that will be called every time user
1937
 * selects a day or goes to next or previous month, just add a
1938
 * callback for signal @b changed.
1939

1940
 * @skipline callback_changed_add
1941

1942
 * Finally we just have to make calendar and window visibles and then
1943
 * start the elm mainloop, starting to handle events and drawing
1944
 * operations.
1945
 
1946
 * @skip visibility
1947
 * @until ELM_MAIN
1948

1949
 * Our example will look like this:
1950

1951
 * @image html screenshots/calendar_cxx_example_05.png
1952
 * @image latex screenshots/calendar_cxx_example_05.eps width=\textwidth
1953

1954
 * See the full source code @ref calendar_cxx_example_05.cc here.
1955
 * @example calendar_cxx_example_05.cc
1956
 */
1957

1958
/**
1959
 * @page clock_cxx_example Clock widget example wit C++ binding.
1960
 * @dontinclude clock_cxx_example.cc
1961
 
1962
 * This code places five Elementary clock widgets on a window, each of
1963
 * them exemplifying a part of the widget's API. Before explaining
1964
 * each clock to be more didatical let's start with the basics.
1965

1966
 * The first part consists of including the headers. In this
1967
 * case we are only working with the Elementary C++ binding and thus
1968
 * we need only to include him.
1969
  
1970
 * @skipline Elementary.hh
1971
 
1972
 * @attention If necessary the C and/or the C++ headers should be
1973
 * include here as well.
1974

1975
 * Now we need to actually start the code and set the elm_policy,
1976
 * which defines for a given policy group/identifier a new policy's
1977
 * value, respectively.  In this example the only policy we need to
1978
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
1979

1980
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
1981
 * automatically;
1982
 
1983
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
1984
 * application's last window is closed;
1985
 
1986
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
1987
 * application's last window is hidden;
1988
 
1989
 * @skip EAPI_MAIN
1990
 * @until elm_policy_set
1991
 
1992
 * As you can see, the policy we chose was to quit when the last win
1993
 * is hidden as opposed to examples with the C bindings where we
1994
 * perpetually set it to quit when last win was closed. This changed
1995
 * was necessary because in C++ binding as the elm mainloop stop
1996
 * running all object are destroyed, references are unreferenced and
1997
 * events are stopped at ELM_MAIN().
1998
  
1999
 * @see For more details consult elm_policy_set
2000
 
2001
 * Next step is creating an Elementary window, in this example we use
2002
 * the C++ binding method with the elm_win_util_standard_add that is a
2003
 * elm_win_legacy function, better explained below. And then we set
2004
 * the autohide state for it.
2005
 
2006
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
2007
 * Adds a window object with standard setup.
2008
 * Parameters:
2009
 
2010
 * @li @p name - The name of the window;
2011

2012
 * @li @p title - The title for the window.
2013

2014
 * This creates a window but also puts in a standard background with
2015
 * @p elm_bg_add(), as well as setting the window title to @p
2016
 * title. The window type created is of type @c ELM_WIN_BASIC, with
2017
 * the @c NULL as the parent widget. Returns the created object or @c
2018
 * NULL on failure.
2019

2020
 * And we also set the autohide state for win, autohide works
2021
 * similarly to @p autodel, automatically handling "delete,request"
2022
 * signals when set to @p true, with the difference that it will hide
2023
 * the window, instead of destroying it.
2024

2025
 * It is specially designed to work together with @p
2026
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
2027
 * Elementary's main loop when all the windows are hidden.
2028
 
2029
 * @skip ::elm::win
2030
 * @until autohide_set
2031

2032
 * @note @p autodel and @a autohide are not mutually exclusive. The
2033
 * window will be destructed if both autodel and autohide is set to @p
2034
 * EINA_TRUE or @p true.
2035
  
2036
 * @see For more details consult elm::win::autohide_set().
2037

2038
 * A box arranges objects in a linear fashion, governed by a layout
2039
 * function that defines the details of this arrangement. The box will
2040
 * use an internal function to set the layout to a single row,
2041
 * vertical by default.
2042

2043
 * Now let's create the box with the C++ binding method, passing our
2044
 * window object as parent.
2045

2046
 * @skipline elm::box
2047

2048
 * To better understand, the function @c size_hint_weight_set for C++
2049
 * bindings originated from C bindings function
2050
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
2051
 * With this function we set the hints for an object's weight.  The
2052
 * parameters are:
2053

2054
 * @li x - Nonnegative double value to use as horizontal weight hint.
2055

2056
 * @li y - Nonnegative double value to use as vertical weight hint.
2057

2058
 * This is not a size enforcement in any way, it's just a hint that
2059
 * should be used whenever appropriate. This is a hint on how a
2060
 * container object should resize a given child within its area.
2061

2062
 * Containers may adhere to the simpler logic of just expanding the
2063
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
2064
 * helper weight macro in the EFL Evas Documentation) or the complete
2065
 * one of taking each child's weight hint as real weights to how much
2066
 * of its size to allocate for them in each axis. A container is
2067
 * supposed to, after normalizing the weights of its children (with
2068
 * weight hints), distribute the space it has to layout them by those
2069
 * factors – most weighted children get larger in this process than
2070
 * the least ones.
2071

2072
 * @skipline weight_set
2073

2074
 * @note Default weight hint values are 0.0, for both axis.
2075

2076
 * Then we add the box as a resize-object to win informing that when
2077
 * the size of the win changes so should the box's size. Remember
2078
 * always to set the box visibility to true.
2079

2080
 * @skip win  
2081
 * @until visibility
2082

2083
 * We create each clock with the C++ binding method, passing our
2084
 * window object as parent. The first of them is the pristine clock,
2085
 * using the defaults for a clock, which are military time with no
2086
 * seconds shown.
2087
 
2088
 * @skipline clock
2089

2090
 * When using the elm::box the packing method of the subobj - clock
2091
 * in this case - should be defined. There are four possible methods:
2092

2093
 * @li @c pack_start(subobj_) - Add an object to the beginning of the
2094
 * pack list. Pack @c subobj_ into the box obj, placing it first in
2095
 * the list of children objects. The actual position the object will
2096
 * get on screen depends on the layout used. If no custom layout is
2097
 * set, it will be at the top or left, depending if the box is
2098
 * vertical or horizontal, respectively.
2099

2100
 * @li @c pack_end(subobj_) - Add an object at the end of the pack
2101
 * list. Pack @c subobj_ into the box obj, placing it last in the list
2102
 * of children objects. The actual position the object will get on
2103
 * screen depends on the layout used. If no custom layout is set, it
2104
 * will be at the bottom or right, depending if the box is vertical or
2105
 * horizontal, respectively.
2106

2107
 * @li @c pack_before(subobj_, before_) - Adds an object to the box
2108
 * before the indicated object. This will add the @c subobj_ to the
2109
 * box indicated before the object indicated with @c before_. If
2110
 * before is not already in the box, results are undefined. Before
2111
 * means either to the left of the indicated object or above it
2112
 * depending on orientation.
2113
 
2114
 * @li @c pack_after(subobj_, after_) - Adds an object to the box
2115
 * after the indicated object. This will add the @c subobj_ to the box
2116
 * indicated after the object indicated with @c after_. If after is
2117
 * not already in the box, results are undefined. After means either
2118
 * to the right of the indicated object or below it depending on
2119
 * orientation.
2120

2121
 * In this and most examples we use pack_end by choice and
2122
 * practicality. In this part of the code we also make clock
2123
 * visible.
2124

2125
 * @skip pack_end
2126
 * @until visibility
2127

2128
 * The second clock shows the am/pm time, that we also create with
2129
 * the C++ binding method, passing our window object as
2130
 * parent. Setting show_am_pm to true and again choosing the packing
2131
 * method and making clock visible.
2132

2133
 * @skip clock
2134
 * @until visibility
2135

2136
 * The third one will show the seconds digits, which will flip in
2137
 * synchrony with system time. Note, besides, that the time itself is
2138
 * @b different from the system's -- it was customly set with
2139
 * time_set():
2140

2141
 * @skip ck3
2142
 * @until visibility
2143

2144
 * In both fourth and fifth ones, we turn on the <b>edition
2145
 * mode</b>. See how you can change each of the sheets on it, and be
2146
 * sure to try holding the mouse pressed over one of the sheet
2147
 * arrows. The forth one also starts with a custom time set:
2148

2149
 * @skip ck4
2150
 * @until visibility
2151

2152
 * The fifth, besides editable, has only the time @b units editable,
2153
 * for hours, minutes and seconds. This exemplifies edit_mode_set():
2154

2155
 * @skip ck5
2156
 * @until visibility
2157

2158
 * Finally we just have to make our window visible and then run the
2159
 * elm mainloop, starting to handle events and drawing operations.
2160
 
2161
 * @skip visibility
2162
 * @until ELM_MAIN
2163

2164
 * See the full @ref clock_cxx_example.cc, whose window should look
2165
 * like this picture:
2166

2167
 * @image html screenshots/clock_cxx_example.png
2168
 * @image latex screenshots/clock_cxx_example.eps width=\textwidth
2169
 * @example clock_cxx_example.cc
2170
 */
2171

2172
 /**
2173
 * @page datetime_cxx_example Datetime Example with C++ binding
2174
 * @dontinclude datetime_cxx_example.cc
2175

2176
 * This example places three Elementary Datetime widgets on a window,
2177
 * each of them exemplifying the widget's different usage.
2178

2179
 * The first part consists of including the headers. In this
2180
 * case we are only working with the Elementary C++ binding and thus
2181
 * we need only to include him.
2182
  
2183
 * @skipline Elementary.hh
2184
 
2185
 * @attention If necessary the C and/or the C++ headers should be
2186
 * include here as well.
2187

2188
 * Now we need to actually start the code and set the elm_policy,
2189
 * which defines for a given policy group/identifier a new policy's
2190
 * value, respectively.  In this example the only policy we need to
2191
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
2192

2193
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
2194
 * automatically;
2195
 
2196
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
2197
 * application's last window is closed;
2198
 
2199
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
2200
 * application's last window is hidden;
2201
 
2202
 * @skip EAPI_MAIN
2203
 * @until elm_policy_set
2204
 
2205
 * As you can see, the policy we chose was to quit when the last win
2206
 * is hidden as opposed to examples with the C bindings where we
2207
 * perpetually set it to quit when last win was closed. This changed
2208
 * was necessary because in C++ binding as the elm mainloop stop
2209
 * running all object are destroyed, references are unreferenced and
2210
 * events are stopped at ELM_MAIN().
2211
  
2212
 * @see For more details consult elm_policy_set
2213
 
2214
 * Next step is creating an Elementary window, where win calls a
2215
 * constructor and sets the type of the win to ELM_WIN_BASIC
2216
 * (Elm_Win_Type), which is the indicated type for most of our
2217
 * examples. Here we also set the title that will appear at the top of
2218
 * our window and then the autohide state for win.
2219
 
2220
 * The autohide works similarly to @p autodel, automatically handling
2221
 * "delete,request" signals when set to @p true, with the difference
2222
 * that it will hide the window, instead of destroying it.
2223

2224
 * It is specially designed to work together with @p
2225
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
2226
 * Elementary's main loop when all the windows are hidden.
2227
 
2228
 * @skip ::elm::win
2229
 * @until autohide_set
2230

2231
 * @note @p autodel and @a autohide are not mutually exclusive. The
2232
 * window will be destructed if both autodel and autohide is set to @p
2233
 * EINA_TRUE or @p true.
2234
  
2235
 * Now we construct the elm background and for this we use the C++
2236
 * method below, setting it's parent.
2237

2238
 * @skipline ::elm::bg
2239

2240
 * To better understand, the function @c size_hint_weight_set for C++
2241
 * bindings originated from C bindings function
2242
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
2243
 * With this function we set the hints for an object's weight.  The
2244
 * parameters are:
2245

2246
 * @li x - Nonnegative double value to use as horizontal weight hint.
2247

2248
 * @li y - Nonnegative double value to use as vertical weight hint.
2249

2250
 * This is not a size enforcement in any way, it's just a hint that
2251
 * should be used whenever appropriate. This is a hint on how a
2252
 * container object should resize a given child within its area.
2253

2254
 * Containers may adhere to the simpler logic of just expanding the
2255
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
2256
 * helper weight macro in the EFL Evas Documentation) or the complete
2257
 * one of taking each child's weight hint as real weights to how much
2258
 * of its size to allocate for them in each axis. A container is
2259
 * supposed to, after normalizing the weights of its children (with
2260
 * weight hints), distribute the space it has to layout them by those
2261
 * factors – most weighted children get larger in this process than
2262
 * the least ones.
2263

2264
 * @skipline weight_set
2265

2266
 * @note Default weight hint values are 0.0, for both axis.
2267

2268
 * Now we add the background as a resize_object to win informing that
2269
 * when the size of the win changes so should the background's
2270
 * size. And finally we make it visible.
2271
 
2272
 * @skip win
2273
 * @until visibility_set 
2274
 
2275
 * @remarks  If a color it's not setted the default color will be used.
2276

2277
 * A box arranges objects in a linear fashion, governed by a layout
2278
 * function that defines the details of this arrangement. The box will
2279
 * use an internal function to set the layout to a single row,
2280
 * vertical by default.
2281

2282
 * Now let's create the box with the C++ binding method, passing our
2283
 * window object as parent. Using Evas weight_set function again to
2284
 * hint on how a container object should resize a given child within
2285
 * its area. 
2286

2287
 * @skipline elm::box
2288
 * @until weight_set
2289

2290
 * Then we add the box as a resize-object to win informing that when
2291
 * the size of the win changes so should the box's size. Remember
2292
 * always to set the box visibility to true.
2293

2294
 * @skip win  
2295
 * @until visibility
2296

2297
 * The first of them is <b>"only Date display"</b>. We will create it
2298
 * using the C++ method below. The weight hint works with datetime the
2299
 * same as it did with background and box.
2300

2301
 * @skip datetime
2302
 * @until weight
2303

2304
 * Now we have to The function @c size_hint_align_set for C++ bindings
2305
 * originated from C bindings function
2306
 * evas_object_size_hint_align_set, that is EFL Evas type
2307
 * function. With this function we set the hints for an object's
2308
 * alignment. The parameters are:
2309
 
2310
 * @li x - Double, ranging from 0.0 to 1.0 or with the special value
2311
 * EVAS_HINT_FILL, to use as horizontal alignment hint.
2312

2313
 * @li y - Double, ranging from 0.0 to 1.0 or with the special value
2314
 * EVAS_HINT_FILL, to use as vertical alignment hint.
2315

2316
 * These are hints on how to align an object inside the boundaries of
2317
 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
2318
 * with the special value EVAS_HINT_FILL used to specify "justify" or
2319
 * "fill" by some users. In this case, maximum size hints should be
2320
 * enforced with higher priority, if they are set. Also, any padding
2321
 * hint set on objects should add up to the alignment space on the
2322
 * final scene composition.
2323

2324
 * For the horizontal component, 0.0 means to the left, 1.0 means to
2325
 * the right. Analogously, for the vertical component, 0.0 to the top,
2326
 * 1.0 means to the bottom.
2327

2328
 * This is not a size enforcement in any way, it's just a hint that
2329
 * should be used whenever appropriate.
2330

2331
 * @skipline align
2332

2333
 * @note Default alignment hint values are 0.5, for both axis.
2334

2335
 * An important feature for the datetime is the setting of what we
2336
 * want it to display. We can achieve that by using:
2337

2338
 * @p field_visible_set ( Elm_Datetime_Field_Type fieldtype_, bool
2339
 *		         visible_)
2340
 
2341
 * Parameters are:
2342

2343
 * @li @p fieldtype_: type of the field, supports 6 fields: 
2344
      
2345
 * @p ELM_DATETIME_YEAR: Indicates Year field.
2346

2347
 * @p ELM_DATETIME_MONTH: Indicates Month field.
2348

2349
 * @p ELM_DATETIME_DATE: Indicates Date field.
2350

2351
 * @p ELM_DATETIME_HOUR: Indicates Hour field,
2352
 
2353
 * @p ELM_DATETIME_MINUTE: Indicates Minute field.
2354

2355
 * @p ELM_DATETIME_AMPM: Indicates AM/PM field.
2356

2357
 * @li @p visible_: @p true field can be visible, @p false otherwise.
2358

2359
 * @attention Setting this API True does not ensure that the field is
2360
 * visible, apart from this, the field's format must be present in
2361
 * Datetime overall format. If a field's visibility is set to False
2362
 * then it won't appear even though its format is present in overall
2363
 * format. So if and only if this API is set true and the
2364
 * corresponding field's format is present in Datetime format, the
2365
 * field is visible.
2366

2367
 * @note By default the field visibility is set to @p true.
2368

2369
 * For this first datetime we are setting the HOUR, MINUTE and AM/PM
2370
 * to not be visible, doing this we'll display in our datetime the
2371
 * year, month and date.
2372

2373
 * @note Hour format 12hr(1-12) or 24hr(0-23) display can be selected
2374
 * by setting the corresponding user format. The corresponding Month
2375
 * and AM/PM strings are displayed according to the system’s language
2376
 * settings.
2377

2378
 * @skip HOUR
2379
 * @until AMPM
2380
 
2381
 * When using the elm box the packing method of the subobj - datetime
2382
 * in this case - should be defined. There are four possible methods:
2383

2384
 * @li @c pack_start(subobj_) - Add an object to the beginning of the
2385
 * pack list. Pack @c subobj_ into the box obj, placing it first in
2386
 * the list of children objects. The actual position the object will
2387
 * get on screen depends on the layout used. If no custom layout is
2388
 * set, it will be at the top or left, depending if the box is
2389
 * vertical or horizontal, respectively.
2390

2391
 * @li @c pack_end(subobj_) - Add an object at the end of the pack
2392
 * list. Pack @c subobj_ into the box obj, placing it last in the list
2393
 * of children objects. The actual position the object will get on
2394
 * screen depends on the layout used. If no custom layout is set, it
2395
 * will be at the bottom or right, depending if the box is vertical or
2396
 * horizontal, respectively.
2397

2398
 * @li @c pack_before(subobj_, before_) - Adds an object to the box
2399
 * before the indicated object. This will add the @c subobj_ to the
2400
 * box indicated before the object indicated with @c before_. If
2401
 * before is not already in the box, results are undefined. Before
2402
 * means either to the left of the indicated object or above it
2403
 * depending on orientation.
2404
 
2405
 * @li @c pack_after(subobj_, after_) - Adds an object to the box
2406
 * after the indicated object. This will add the @c subobj_ to the box
2407
 * indicated after the object indicated with @c after_. If after is
2408
 * not already in the box, results are undefined. After means either
2409
 * to the right of the indicated object or below it depending on
2410
 * orientation.
2411

2412
 * In this and most examples we use pack_end by choice and
2413
 * practicality. In this part of the code we also make datetime
2414
 * visible.
2415

2416
 * @skip pack_end
2417
 * @until visibility
2418

2419
 * For our second datetime, we'll also set the size hints weight and
2420
 * align, but in this case, the fields YEAR, MONTH and DATE will be not
2421
 * visible, and thus displaying in our datetime the hour, minute and
2422
 * AM/PM. Finally we choose it's packing method and set the visibility
2423
 * of datetime to @p true.
2424

2425
 * @skip datetime2
2426
 * @until visibility
2427

2428
 * For our third and last datetime, we setted the weight and align as
2429
 * before, chose our packing method and made it visible. Note that in
2430
 * this case we didn't exclude any type of field leaving all visible.
2431
 
2432
 * @skip datetime3
2433
 * @until visibility
2434

2435
 * And finally, we set our win's visibility and start the elm
2436
 * mainloop, starting to handle events and drawing operations.
2437

2438
 * @skip win
2439
 * @until ELM_MAIN
2440

2441
 * See the full @ref datetime_cxx_example.cc .
2442

2443
 * This example should look like:
2444

2445
 * @image html screenshots/datetime_cxx_example.png
2446
 * @image latex screenshots/datetime_cxx_example.eps width=\textwidth
2447

2448
 * @example datetime_cxx_example.cc
2449
 */
2450

2451
/**
2452
 * @page glview_cxx_example_01 Glview example with C++ Binding
2453
 * @dontinclude glview_cxx_example_01.cc
2454
 
2455
 * In this example we'll illustrate how to use Glview and it's
2456
 * features.
2457

2458
 * The first part consists of including the headers. In this case we
2459
 * need to include @p Elementary.hh, @p Evas_GL.h and @p stdio.h.
2460

2461
 *@li @p Elementary.hh: library for Elementary with support for C++
2462
 * language;
2463

2464
 *@li @p Evas_GL.h: has functions that are used to do OpenGL rendering
2465
 * on Evas, Evas allows us to use OpenGL to render to specially set up
2466
 * image objects, which act as render target surfaces. 
2467

2468
 *@li @p stdio.h is a C library with functions tha perform
2469
 * Input/Output operations.
2470

2471
 * @skip Elementary.hh
2472
 * @until stdio
2473
 
2474
 * Continuing with the code, at this point we create a GL related
2475
 * struct:
2476

2477
 *@li @p Evas_GL_API that is the structure type of the Evas GL API object
2478
 * that contains the GL APIs to be used in Evas GL.
2479

2480
 *@li @p GLuint one of the pre-defined types of OpenGL which is a unsigned binary integer.
2481

2482
 *@li @p int AKA @p int.
2483

2484
 * @skip typedef
2485
 * @until };
2486

2487
 * Here we're simply initializing a type float, that we named red.
2488
 
2489
 * @skipline red
2490

2491
 * In this example we'll need a type C helper function to load shaders
2492
 * from a shader source.
2493

2494
 * @skip static
2495
 * @until GLint
2496

2497
 * Inside this function we create the shader objectand load/compile
2498
 * shader source.
2499

2500
 * @skip shader
2501
 * @until return shader;
2502

2503
 * Completing our load shader function.
2504
 
2505
 * @skipline }
2506

2507
 * This example will also need a function to initialize the shader and
2508
 * program object.
2509

2510
 * @skip static
2511
 * @until linked
2512

2513
 * In this function we load the vertex/fragment shaders, create the
2514
 * program object and finish our function.
2515

2516
 * @skip gld
2517
 * @until return 1;
2518
 * @skiline }
2519

2520
 * We need the following callbacks:
2521

2522
 * @li initialize callback: that get called once for
2523
 * initialization;
2524

2525
 * @skip void
2526
 * @until BufferData
2527
 * @skipline }
2528

2529
 * @li delete callback: gets called when glview is deleted;
2530

2531
 * @skip void
2532
 * @until free
2533
 * @skipline }
2534

2535
 * @li resize callback: gets called every time object is resized;
2536

2537
 * @skip void
2538
 * @skipline }
2539

2540
 * @li draw callback: is where all the main GL rendering happens.
2541

2542
 * @skip void
2543
 * @until COLOR_BUFFER
2544

2545
 * Inside this callback, we'll draw a triangle.
2546
 
2547
 * @skip gl
2548
 * @until DrawArrays
2549

2550
 * Still inside as an option we are going to flush the GL pipeline and
2551
 * end our callback.
2552

2553
 * @skip Finish
2554
 * @until }
2555

2556
 * We create @p _anim to notify that glview has changed so it can
2557
 * render.
2558

2559
 * @skip static
2560
 * @until }
2561

2562
 * Now that we finished with the GL preparations, we'll start the main
2563
 * code and initialize our GLData pointer object to NULL and run a
2564
 * check just in case.
2565

2566
 * @skip EAPI_MAIN
2567
 * @until if
2568

2569
 * Let's set the elm_policy, which defines for a given policy
2570
 * group/identifier a new policy's value, respectively. In this
2571
 * example the only policy we need to set a value for is @c
2572
 * ELM_POLICY_QUIT, possibles values for it are:
2573

2574
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
2575
 * automatically;
2576
 
2577
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
2578
 * application's last window is closed;
2579
 
2580
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
2581
 * application's last window is hidden;
2582
 
2583
 * @skipline elm_policy_set
2584
 
2585
 * As you can see, the policy we chose was to quit when the last win
2586
 * is hidden as opposed to examples with the C bindings where we
2587
 * perpetually set it to quit when last win was closed. This changed
2588
 * was necessary because in C++ binding as the elm mainloop stop
2589
 * running all object are destroyed, references are unreferenced and
2590
 * events are stopped at ELM_MAIN().
2591
  
2592
 * @see For more details consult elm_policy_set
2593

2594
 * Next step is creating an elementary window, in this example we use
2595
 * the C++ binding method with the elm_win_util_standard_add that is a
2596
 * elm_win_legacy function, better explained below. And then we set
2597
 * the autohide state for it.
2598
 
2599
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
2600
 * Adds a window object with standard setup.
2601
 * Parameters:
2602
 
2603
 * @li @p name - The name of the window;
2604

2605
 * @li @p title - The title for the window.
2606

2607
 * This creates a window but also puts in a standard background with
2608
 * @p elm_bg_add(), as well as setting the window title to @p
2609
 * title. The window type created is of type @c ELM_WIN_BASIC, with
2610
 * the @c NULL as the parent widget. Returns the created object or @c
2611
 * NULL on failure.
2612

2613
 * The autohide works similarly to @p autodel, automatically handling
2614
 * "delete,request" signals when set to @p true, with the difference
2615
 * that it will hide the window, instead of destroying it.
2616

2617
 * It is specially designed to work together with @p
2618
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
2619
 * Elementary's main loop when all the windows are hidden.
2620
 
2621
 * @skip ::elm::win
2622
 * @until autohide_set
2623

2624
 * @note @p autodel and @a autohide are not mutually exclusive. The
2625
 * window will be destructed if both autodel and autohide is set to @p
2626
 * EINA_TRUE or @p true.
2627

2628
 * Now let's create a box with the C++ binding method, passing our
2629
 * window object as parent, we'll use this box to contain our glview
2630
 * object.
2631

2632
 * @skipline bx
2633

2634
 * To better understand, the function @c size_hint_weight_set for C++
2635
 * bindings originated from C bindings function
2636
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
2637
 * With this function we set the hints for an object's weight.  The
2638
 * parameters are:
2639

2640
 * @li x - Nonnegative double value to use as horizontal weight hint.
2641

2642
 * @li y - Nonnegative double value to use as vertical weight hint.
2643

2644
 * This is not a size enforcement in any way, it's just a hint that
2645
 * should be used whenever appropriate. This is a hint on how a
2646
 * container object should resize a given child within its area.
2647

2648
 * Containers may adhere to the simpler logic of just expanding the
2649
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
2650
 * helper weight macro in the EFL Evas Documentation) or the complete
2651
 * one of taking each child's weight hint as real weights to how much
2652
 * of its size to allocate for them in each axis. A container is
2653
 * supposed to, after normalizing the weights of its children (with
2654
 * weight hints), distribute the space it has to layout them by those
2655
 * factors – most weighted children get larger in this process than
2656
 * the least ones.
2657

2658
 * @skipline weight_set
2659

2660
 * @note Default weight hint values are 0.0, for both axis.
2661

2662
 * Then we add the box as a resize-object to win informing that when
2663
 * the size of the win changes so should the box's size. Remember
2664
 * always to set the box visibility to true.
2665

2666
 * @skip win
2667
 * @until visibility
2668

2669
 * In this part we'll create a new elm glview, using the C++ method,
2670
 * in this case it requires that we set @p Evas_GL_Context_Version
2671
 * with the version_constructor. @p Evas_GL_Context_Version is a
2672
 * enumeration that defines the available OpenGL ES version numbers,
2673
 * it can be used to create OpenGL-ES 1.1 contexts.
2674

2675
 * @skip glview
2676
 * @until glapi
2677

2678
 * The function size_hint_weight_set works with glview the same way as
2679
 * with box, for more, search above.
2680

2681
 * The function @c size_hint_align_set for C++ bindings originated
2682
 * from C bindings function evas_object_size_hint_align_set, that is
2683
 * EFL Evas type function. With this function we set the hints for an
2684
 * object's alignment. The parameters are:
2685
 
2686
 * @li x - Double, ranging from 0.0 to 1.0 or with the special value
2687
 * EVAS_HINT_FILL, to use as horizontal alignment hint.
2688

2689
 * @li y - Double, ranging from 0.0 to 1.0 or with the special value
2690
 * EVAS_HINT_FILL, to use as vertical alignment hint.
2691

2692
 * These are hints on how to align an object inside the boundaries of
2693
 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
2694
 * with the special value EVAS_HINT_FILL used to specify "justify" or
2695
 * "fill" by some users. In this case, maximum size hints should be
2696
 * enforced with higher priority, if they are set. Also, any padding
2697
 * hint set on objects should add up to the alignment space on the
2698
 * final scene composition.
2699

2700
 * For the horizontal component, 0.0 means to the left, 1.0 means to
2701
 * the right. Analogously, for the vertical component, 0.0 to the top,
2702
 * 1.0 means to the bottom.
2703

2704
 * This is not a size enforcement in any way, it's just a hint that
2705
 * should be used whenever appropriate.
2706

2707
 * @note Default alignment hint values are 0.5, for both axis.
2708

2709
 * @skipline align_set
2710

2711
 * Mode is simply for supporting alpha, depth buffering and stencil
2712
 * buffering.
2713

2714
 * @skip mode
2715
 * @until mode_set
2716

2717
 * Resize policy tells glview what to do with the surface when it
2718
 * resizes. ELM_VIEW_RESIZE_POLICY_RECREATE will tell it to destroy
2719
 * the current surface and recreate it to the new size.
2720

2721
 * @skipline resize
2722

2723
 * Render policy tells glview how it would like glview to render gl
2724
 * code. ELM_GLVIEW_RENDER_POLICY_ON_DEMAND will have the gl calls
2725
 * called in the pixel_get callback, which only gets called if the
2726
 * object is visible, hence ON_DEMAND. ALWAYS mode renders it despite
2727
 * the visibility of the object.
2728

2729
 * @skipline render
2730

2731
 * Now we'll register our callbacks.
2732

2733
 * @skip init
2734
 * @until draw
2735

2736
 * When using the elm box the packing method of the subobj - glview in
2737
 * this case - should be defined. There are four possible methods:
2738

2739
 * @li @c pack_start(subobj_) - Add an object to the beginning of the
2740
 * pack list. Pack @c subobj_ into the box obj, placing it first in
2741
 * the list of children objects. The actual position the object will
2742
 * get on screen depends on the layout used. If no custom layout is
2743
 * set, it will be at the top or left, depending if the box is
2744
 * vertical or horizontal, respectively.
2745

2746
 * @li @c pack_end(subobj_) - Add an object at the end of the pack
2747
 * list. Pack @c subobj_ into the box obj, placing it last in the list
2748
 * of children objects. The actual position the object will get on
2749
 * screen depends on the layout used. If no custom layout is set, it
2750
 * will be at the bottom or right, depending if the box is vertical or
2751
 * horizontal, respectively.
2752

2753
 * @li @c pack_before(subobj_, before_) - Adds an object to the box
2754
 * before the indicated object. This will add the @c subobj_ to the
2755
 * box indicated before the object indicated with @c before_. If
2756
 * before is not already in the box, results are undefined. Before
2757
 * means either to the left of the indicated object or above it
2758
 * depending on orientation.
2759
 
2760
 * @li @c pack_after(subobj_, after_) - Adds an object to the box
2761
 * after the indicated object. This will add the @c subobj_ to the box
2762
 * indicated after the object indicated with @c after_. If after is
2763
 * not already in the box, results are undefined. After means either
2764
 * to the right of the indicated object or below it depending on
2765
 * orientation.
2766

2767
 * In this and most examples we use pack_end by choice and
2768
 * practicality, in this part of the code we also make glview visible
2769
 * and set to focus.
2770

2771
 * @skip pack_end
2772
 * @until focus
2773

2774
 * For a simple demonstration of the animation we'll have to use
2775
 * ecore::animator. As long as tou trigger an update on the image via
2776
 * @p changed_set() it will be updated.
2777
 
2778
 * @skip ani
2779
 * @until "gld"
2780

2781
 * If you delete gl, this animator will keep running trying to access
2782
 * gl so it's better to delete this animator with
2783
 * ecore_animator_del(), as seen inside the lambda function.
2784
 
2785
 * @skipline callback_del
2786

2787
 * @note To learn more about Lambda Function and its use in Elementary
2788
 * consult @ref lambda.
2789

2790
 * We're going to add a "OK" button to end the program. First step is
2791
 * to create it using the C++ method, setting it's parent.
2792

2793
 * @skipline button
2794
 
2795
 * Second, set the text, alignment and weight hints, the hints work
2796
 * the same as with box and glview.
2797
 
2798
 * @skip text
2799
 * @until weight
2800

2801
 * Pack our button in the same box as glview and set the visibility for
2802
 * it.
2803
 
2804
 * @skip pack
2805
 * @until visibility
2806

2807
 * As a final step for our button, we are going to add a clicked
2808
 * callback, using again Lambda Type Function.
2809

2810
 * @skipline clicked
2811

2812
 * @note To learn more about Lambda Function and its use in Elementary
2813
 * consult @ref lambda.
2814

2815
 * Now we only have to set the size for our window and make it
2816
 * visible.
2817
 
2818
 * @skip size_set
2819
 * @until visibility_set
2820

2821
 * And finally, start the elm mainloop, starting to handle events and
2822
 * drawing operations.
2823

2824
 * @skip elm_run
2825
 * @until ELM_MAIN
2826

2827
 * See full code for this example @ref glview_cxx_example_01.cc "here" .
2828

2829
 * @example glview_cxx_example_01.cc
2830
 */
2831

2832
/**
2833
 * @page hoversel_cxx_example_01 Hoversel example with C++ Binding
2834
 * @dontinclude hoversel_cxx_example_01.cc
2835
 
2836
 * In this example we'll create a hoversel with 3 items, one with a
2837
 * label but no icon and two with both a label and an icon. Every item
2838
 * that is clicked will be deleted, but everytime the hoversel is
2839
 * activated we will also add an item. In addition our first item will
2840
 * print all items when clicked and our third item will clear all
2841
 * items in the hoversel.
2842
 
2843
 * The first part consists of including the headers. We'll include @p
2844
 * Elementary.hh, @p Eina.hh and @p Evas.hh, that are C++ bindings
2845
 * that are needed in this example.
2846

2847
 * @skip Elementary
2848
 * @until Evas
2849

2850
 * Before our main code we'll need the following callbacks:
2851

2852
 *@li @p _print_items: callback for our first item which prints all
2853
 * items in the hoversel.
2854

2855
 * @until print
2856

2857
 *@li @p _free: callback that frees the allocated memory.
2858
 
2859
 * @until free
2860

2861
 * Starting the main code and initializing Eina C++ Lybrary, always
2862
 * initiate Eina when included.
2863

2864
 * @skip EAPI
2865
 * @until eina
2866

2867
 * Now let's set the elm_policy, which defines for a given policy
2868
 * group/identifier a new policy's value, respectively. In this
2869
 * example the only policy we need to set a value for is @c
2870
 * ELM_POLICY_QUIT, possibles values for it are:
2871

2872
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
2873
 * automatically;
2874
 
2875
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
2876
 * application's last window is closed;
2877
 
2878
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
2879
 * application's last window is hidden;
2880
 
2881
 * @skipline elm_policy_set
2882
 
2883
 * As you can see, the policy we chose was to quit when the last win
2884
 * is hidden as opposed to examples with the C bindings where we
2885
 * perpetually set it to quit when last win was closed. This changed
2886
 * was necessary because in C++ binding as the elm mainloop stop
2887
 * running all object are destroyed, references are unreferenced and
2888
 * events are stopped at ELM_MAIN().
2889
  
2890
 * @see For more details consult elm_policy_set
2891

2892
 * Next step is creating an elementary window, in this example we use
2893
 * the C++ binding method with the elm_win_util_standard_add that is a
2894
 * elm_win_legacy function, better explained below. And then we set
2895
 * the autohide state for it.
2896
 
2897
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
2898
 * Adds a window object with standard setup.
2899
 * Parameters:
2900
 
2901
 * @li @p name - The name of the window;
2902

2903
 * @li @p title - The title for the window.
2904

2905
 * This creates a window but also puts in a standard background with
2906
 * @p elm_bg_add(), as well as setting the window title to @p
2907
 * title. The window type created is of type @c ELM_WIN_BASIC, with
2908
 * the @c NULL as the parent widget. Returns the created object or @c
2909
 * NULL on failure.
2910

2911
 * The autohide works similarly to @p autodel, automatically handling
2912
 * "delete,request" signals when set to @p true, with the difference
2913
 * that it will hide the window, instead of destroying it.
2914

2915
 * It is specially designed to work together with @p
2916
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
2917
 * Elementary's main loop when all the windows are hidden.
2918
 
2919
 * @skip ::elm::win
2920
 * @until autohide_set
2921

2922
 * @note @p autodel and @a autohide are not mutually exclusive. The
2923
 * window will be destructed if both autodel and autohide is set to @p
2924
 * EINA_TRUE or @p true.
2925

2926
 * Next we'll create a red evas::rectangle to use as the icon of our
2927
 * hoversel, for thus using the C++ method, setting the color and
2928
 * making it visible.
2929

2930
 * @skip evas
2931
 * @until visibility
2932

2933
 * And now we create our hoversel and set some of it's properties. We
2934
 * set @p win as its parent, set it to be vertical and give it a label
2935
 * and content, that will work as icon:
2936

2937
 * @skip hoversel
2938
 * @until content
2939
 
2940
 * Next we will add callbacks to be called for the first and third:
2941

2942
 * @skip item
2943
 * @until "Option 2"
2944
 
2945
 * We also set a pair of callbacks to be called whenever any item is
2946
 * selected or when the hoversel is activated, for this we'll use
2947
 * Lambda type function, @p add_item is called when the hoversel is
2948
 * activated and adds an item to the hoversel. Note that since we
2949
 * allocate memory for the item we need to know when the item dies so
2950
 * we can free that memory.
2951

2952
 * @skip add
2953
 * @until clicked
2954

2955
 * @see For more on Lambda check @ref lambda "here"
2956
 
2957
 * Finishing with hoversel we set its size, position and make it
2958
 * visible.
2959

2960
 * @skip size
2961
 * @until visibility
2962
 
2963
 * In our second hoversel we'll add a button and for this we need
2964
 * create it using C++ method, set a text, add a callback for when
2965
 * button is clicked. This callback is type Lambda, it will clear
2966
 * hoversel when clicked.
2967

2968
 * @skip button
2969
 * @until callback
2970

2971
 * Concluding our button options, we will set the size, position and
2972
 * visibility.
2973

2974
 * @skip size
2975
 * @until visibility
2976

2977
 * Now we set the size for the window, making it visible in the end:
2978
 
2979
 * @skip size_set
2980
 * @until visibility_set
2981
 
2982
 * Finally we just have to start the elm mainloop, starting to handle
2983
 * events and drawing operations.
2984

2985
 * @skip elm_run
2986
 * @until ELM_MAIN
2987

2988
 * Our example will look like this:
2989
 
2990
 * @image html screenshots/hoversel_cxx_example_01.png
2991
 * @image latex screenshots/hoversel_cxx_example_01.eps width=\textwidth
2992
 
2993
 * @example hoversel_cxx_example_01.cc
2994
 */
2995

2996
/**
2997
 * @page icon_cxx_example_01 Icon Example with C++ binding
2998
 * @dontinclude icon_cxx_example_01.cc
2999

3000
 * This example is as simple as possible. An icon object will be added
3001
 * to the window over a blank background, and set to be resizable
3002
 * together with the window. All the options set through the example
3003
 * will affect the behavior of this icon.
3004
 
3005
 * The first part consists of including the headers. In this case we
3006
 * are only working with the Elementary C++ binding and thus we need
3007
 * only to include him.
3008
 
3009
 * @skipline Elementary.hh
3010

3011
 * @attention If necessary the C and/or the C++ headers should be
3012
 * include here as well.
3013

3014
 * Now we need to actually start the code and set the elm_policy,
3015
 * which defines for a given policy group/identifier a new policy's
3016
 * value, respectively. In this example the only policy we need to set
3017
 * a value for is @c ELM_POLICY_QUIT, possibles values for it are:
3018

3019
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
3020
 * automatically;
3021
 
3022
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
3023
 * application's last window is closed;
3024
 
3025
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
3026
 * application's last window is hidden;
3027
 
3028
 * @skip EAPI_MAIN
3029
 * @until elm_policy_set
3030
 
3031
 * As you can see, the policy we chose was to quit when the last win
3032
 * is hidden as opposed to examples with the C bindings where we
3033
 * perpetually set it to quit when last win was closed. This changed
3034
 * was necessary because in C++ binding as the elm mainloop stop
3035
 * running all object are destroyed, references are unreferenced and
3036
 * events are stopped at ELM_MAIN().
3037
  
3038
 * @see For more details consult elm_policy_set
3039

3040
 * Next step is creating an elementary window, in this example we use
3041
 * the C++ binding method with the elm_win_util_standard_add that is a
3042
 * elm_win_legacy function, better explained below. And then we set
3043
 * the autohide state for it.
3044
 
3045
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
3046
 * Adds a window object with standard setup.
3047
 * Parameters:
3048
 
3049
 * @li @p name - The name of the window;
3050

3051
 * @li @p title - The title for the window.
3052

3053
 * This creates a window but also puts in a standard background with
3054
 * @p elm_bg_add(), as well as setting the window title to @p
3055
 * title. The window type created is of type @c ELM_WIN_BASIC, with
3056
 * the @c NULL as the parent widget. Returns the created object or @c
3057
 * NULL on failure.
3058

3059
 * The autohide works similarly to @p autodel, automatically handling
3060
 * "delete,request" signals when set to @p true, with the difference
3061
 * that it will hide the window, instead of destroying it.
3062

3063
 * It is specially designed to work together with @p
3064
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
3065
 * Elementary's main loop when all the windows are hidden.
3066
 
3067
 * @skip ::elm::win
3068
 * @until autohide_set
3069

3070
 * @note @p autodel and @a autohide are not mutually exclusive. The
3071
 * window will be destructed if both autodel and autohide is set to @p
3072
 * EINA_TRUE or @p true.
3073

3074
 * Now we construct the elm icon and for this we use the C++ method
3075
 * below, setting it's parent. An icon object is used to display
3076
 * standard icon images ("delete", "edit", "arrows", etc.) or images
3077
 * coming from a custom file (PNG, JPG, EDJE, etc.), on icon contexts.
3078

3079
 * @skipline ::elm::icon
3080

3081
 * The icon image requested can be in the Elementary theme in use, or
3082
 * in the freedesktop.org theme paths. It's possible to set the order
3083
 * of preference from where an image will be fetched and for that
3084
 * we'll use the function @ order_lookup_set(order_) that will be use
3085
 * by standard_set. Possibles values for @p order_ are:
3086

3087
 * @li @p ELM_ICON_LOOKUP_FDO_THEME: icon look up order is freedesktop
3088
 * then theme;
3089

3090
 * @li @p ELM_ICON_LOOKUP_THEME_FDO: icon look up order is theme then
3091
 * freedesktop;
3092

3093
 * @li @p ELM_ICON_LOOKUP_FDO: icon look up order is only freedesktop;
3094

3095
 * @li @p ELM_ICON_LOOKUP_THEME: icon look up order is only theme;
3096
 
3097
 * @skipline order
3098
 
3099
 * Now that we setted the order value we can set the standard "home"
3100
 * icon, chosen for this example.
3101
  
3102
 * @skipline standard
3103

3104
 * An interesting thing is that after setting this, it's possible to
3105
 * check where in the filesystem is the theme used by this icon, and
3106
 * the name of the group used, using file_get.
3107
 
3108
 * @skip file
3109
 * @until std::cout
3110

3111
 * We can also get the name of the standard icon that we setted
3112
 * before.
3113

3114
 * @skip name
3115
 * @until std::cout
3116

3117
 * We can now go setting our options.
3118
 
3119
 * no_scale_set() is used just to set this value to true as we don't
3120
 * actually want to scale our icon, just resize it.
3121
 
3122
 * resizable_set() is used to allow the icon to be resized to a size
3123
 * smaller than the original one, but not to a size bigger than it.
3124
 
3125
 * smooth_set() will disable the smooth scaling, so the scale
3126
 * algorithm used to scale the icon to the new object size is going to
3127
 * be faster, but with a lower quality.
3128
 
3129
 * fill_outside_set() is used to ensure that the icon will fill the
3130
 * entire area available to it, even if keeping the aspect ratio. The
3131
 * icon will overflow its width or height (any of them that is
3132
 * necessary) to the object area, instead of resizing the icon down
3133
 * until it can fit entirely in this area.
3134
 
3135
 * This is the code for setting these options:
3136
 
3137
 * @until fill_outside
3138
 
3139
 * However, if you try this example you may notice that this image is
3140
 * not being affected by all of these options. This happens because
3141
 * the used icon will be from elementary theme, and thus it has its
3142
 * own set of options like smooth scaling and fill_outside
3143
 * options. You can change the "home" icon to use some image (from
3144
 * your system) and see that then those options will be respected.
3145
 
3146
 * To better understand, the function @c size_hint_weight_set for C++
3147
 * bindings originated from C bindings function
3148
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
3149
 * With this function we set the hints for an object's weight.  The
3150
 * parameters are:
3151

3152
 * @li x - Nonnegative double value to use as horizontal weight hint.
3153

3154
 * @li y - Nonnegative double value to use as vertical weight hint.
3155

3156
 * This is not a size enforcement in any way, it's just a hint that
3157
 * should be used whenever appropriate.
3158

3159
 * This is a hint on how a container object should resize a given
3160
 * child within its area.
3161

3162
 * Containers may adhere to the simpler logic of just expanding the
3163
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
3164
 * helper weight macro in the EFL Evas Documentation) or the complete
3165
 * one of taking each child's weight hint as real weights to how much
3166
 * of its size to allocate for them in each axis. A container is
3167
 * supposed to, after normalizing the weights of its children (with
3168
 * weight hints), distribute the space it has to layout them by those
3169
 * factors – most weighted children get larger in this process than
3170
 * the least ones.
3171

3172
 * @skipline weight_set
3173

3174
 * @note Default weight hint values are 0.0, for both axis.
3175

3176
 * Now we add the icon as a resize_object to win informing that
3177
 * when the size of the win changes so should the icon's
3178
 * size. And finally we make icon visible. 
3179

3180
 * Now we set the size for the window, making it visible in the end:
3181
 
3182
 * @skip size_set
3183
 * @until visibility_set
3184
 
3185
 * Finally we just have to start the elm mainloop, starting to handle
3186
 * events and drawing operations.
3187

3188
 * @skip elm_run
3189
 * @until ELM_MAIN
3190
 
3191
 * The full code for this example can be found at @ref icon_cxx_example_01.cc
3192
 
3193
 * This example will look like this:
3194
 
3195
 * @image html screenshots/icon_cxx_example_01.png
3196
 * @image latex screenshots/icon_cxx_example_01.eps width=\textwidth
3197
 
3198
 * @example icon_cxx_example_01.cc
3199
 */
3200

3201
/**
3202
 * @page menu_cxx_example_01 Menu Example with C++ Binding
3203
 * @dontinclude menu_cxx_example_01.cc
3204
 
3205
 * This example shows how to create a menu with regular items, object
3206
 * items, submenus and how to delete items from a menu.
3207
 
3208
 * The first part consists of including the headers. We'll include @p
3209
 * Elementary.hh, @p Eina.hh and @p Evas.hh, that are C++ bindings
3210
 * that are needed in this example.
3211

3212
 * @skip Elementary
3213
 * @until Evas
3214

3215
 * Starting the main code and initializing Eina C++ Lybrary, always
3216
 * initiate Eina when included. We'll also initialize a couple of
3217
 * pointers.
3218

3219
 * @skip EAPI
3220
 * @until menu_it
3221

3222
 * Now let's set the elm_policy, which defines for a given policy
3223
 * group/identifier a new policy's value, respectively. In this
3224
 * example the only policy we need to set a value for is @c
3225
 * ELM_POLICY_QUIT, possibles values for it are:
3226

3227
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
3228
 * automatically;
3229
 
3230
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
3231
 * application's last window is closed;
3232
 
3233
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
3234
 * application's last window is hidden;
3235
 
3236
 * @skipline elm_policy_set
3237
 
3238
 * As you can see, the policy we chose was to quit when the last win
3239
 * is hidden as opposed to examples with the C bindings where we
3240
 * perpetually set it to quit when last win was closed. This changed
3241
 * was necessary because in C++ binding as the elm mainloop stop
3242
 * running all object are destroyed, references are unreferenced and
3243
 * events are stopped at ELM_MAIN().
3244
  
3245
 * @see For more details consult elm_policy_set
3246

3247
 * Next step is creating an elementary window, in this example we use
3248
 * the C++ binding method with the elm_win_util_standard_add that is a
3249
 * elm_win_legacy function, better explained below. And then we set
3250
 * the autohide state for it.
3251
 
3252
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
3253
 * Adds a window object with standard setup.
3254
 * Parameters:
3255
 
3256
 * @li @p name - The name of the window;
3257

3258
 * @li @p title - The title for the window.
3259

3260
 * This creates a window but also puts in a standard background with
3261
 * @p elm_bg_add(), as well as setting the window title to @p
3262
 * title. The window type created is of type @c ELM_WIN_BASIC, with
3263
 * the @c NULL as the parent widget. Returns the created object or @c
3264
 * NULL on failure.
3265

3266
 * The autohide works similarly to @p autodel, automatically handling
3267
 * "delete,request" signals when set to @p true, with the difference
3268
 * that it will hide the window, instead of destroying it.
3269

3270
 * It is specially designed to work together with @p
3271
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
3272
 * Elementary's main loop when all the windows are hidden.
3273
 
3274
 * @skip ::elm::win
3275
 * @until autohide_set
3276

3277
 * @note @p autodel and @a autohide are not mutually exclusive. The
3278
 * window will be destructed if both autodel and autohide is set to @p
3279
 * EINA_TRUE or @p true.
3280

3281
 * Next we'll create a evas::rectangle to use as the icon of our menu
3282
 * for thus using the C++ method, adding our rect as a resize-object
3283
 * to win informing that when the size of the win changes so should
3284
 * the box's size. 
3285
 
3286
 * @skip evas
3287
 * @until resize
3288

3289
 * We'll also set, for rect, the hint for it's minimum size, it's
3290
 * color and making it visible.
3291

3292
 * @skip size
3293
 * @until visibility
3294

3295
 * Creating the menu using the C++ method, setting it's parent and
3296
 * adding an item to this menu. We are going to add more items, but
3297
 * these icons are going to have a parent, which will put them in a
3298
 * sub-menu.
3299

3300
 * @skip menu
3301
 * @until "menu 1"
3302

3303
 * We'll add a button to a menu_item, where this button will delete
3304
 * the first item of our sub-menu when clicked, we'll do this
3305
 * using @p elm_object_item_content_set().
3306
 
3307
 * @skip button
3308
 * @until content_set
3309

3310
 * Now, for the callback that will be used in this button we're use
3311
 * lambda type function and then add as clicked callback to button.
3312

3313
 * @skip del_it
3314
 * @until clicked
3315

3316
 * @see To learn more about consult @ref lambda.
3317

3318
 * We now add a separator and three more regular items:
3319

3320
 * @until item_add
3321
 * @until item_add
3322
 * @until item_add
3323
 
3324
 * We now add another item, however this time it won't go the sub-menu
3325
 * and it'll be disabled:
3326

3327
 * @until disabled_set
3328
 
3329
 * To make sure that our menu is shown whenever the window is
3330
 * clicked, we use the following callback, also lambda:
3331

3332
 * @skip show
3333
 * @until ( show );
3334

3335
 * Finally. we just make menu visible, set a size for our window
3336
 * making it visible and then start the elm mainloop, starting to
3337
 * handle events and drawing operations.
3338

3339
 * @skip visibility
3340
 * @until ELM_MAIN
3341
 
3342
 * Our example will look like this:
3343
 
3344
 * @image html screenshots/menu_cxx_example_01.png
3345
 * @image latex screenshots/menu_cxx_example_01.eps width=\textwidth
3346
 
3347
 * @example menu_cxx_example_01.cc
3348
 */
3349

3350
/**
3351
 * @page popup_cxx_example_01 Popup example with C++ Binding
3352
 * @dontinclude popup_cxx_example_01.cc
3353

3354
 * The first part consists of including the headers. In this
3355
 * case we are only working with the Elementary C++ binding and thus
3356
 * we need only to include him.
3357
  
3358
 * @skipline Elementary.hh
3359
 
3360
 * @attention If necessary the C and/or the C++ headers should be
3361
 * include here as well.
3362

3363
 * Now we need to actually start the code and set the elm_policy,
3364
 * which defines for a given policy group/identifier a new policy's
3365
 * value, respectively.  In this example the only policy we need to
3366
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
3367

3368
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
3369
 * automatically;
3370
 
3371
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
3372
 * application's last window is closed;
3373
 
3374
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
3375
 * application's last window is hidden;
3376
 
3377
 * @skip EAPI_MAIN
3378
 * @until elm_policy_set
3379
 
3380
 * As you can see, the policy we chose was to quit when the last win
3381
 * is hidden as opposed to examples with the C bindings where we
3382
 * perpetually set it to quit when last win was closed. This changed
3383
 * was necessary because in C++ binding as the elm mainloop stop
3384
 * running all object are destroyed, references are unreferenced and
3385
 * events are stopped at ELM_MAIN().
3386
  
3387
 * @see For more details consult elm_policy_set
3388

3389
 * Next step is creating an Elementary window, in this example we use
3390
 * the C++ binding method with the elm_win_util_standard_add that is a
3391
 * elm_win_legacy function, better explained below. And then we set
3392
 * the autohide state for it.
3393
 
3394
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
3395
 * Adds a window object with standard setup.
3396

3397
 * Parameters:
3398
 
3399
 * @li @p name - The name of the window;
3400

3401
 * @li @p title - The title for the window.
3402

3403
 * This creates a window but also puts in a standard background with
3404
 * @p elm_bg_add(), as well as setting the window title to @p
3405
 * title. The window type created is of type @c ELM_WIN_BASIC, with
3406
 * the @c NULL as the parent widget. Returns the created object or @c
3407
 * NULL on failure.
3408

3409
 * The autohide works similarly to @p autodel, automatically handling
3410
 * "delete,request" signals when set to @p true, with the difference
3411
 * that it will hide the window, instead of destroying it.
3412

3413
 * It is specially designed to work together with @p
3414
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
3415
 * Elementary's main loop when all the windows are hidden.
3416
 
3417
 * @skip ::elm::win
3418
 * @until autohide_set
3419

3420
 * @note @p autodel and @a autohide are not mutually exclusive. The
3421
 * window will be destructed if both autodel and autohide is set to @p
3422
 * EINA_TRUE or @p true.
3423

3424
 * Now let's create the label with the C++ binding method, passing our
3425
 * window object as parent. We'll also set to this label the text that
3426
 * we'll use later on the popup.
3427

3428
 * @skip elm::label
3429
 * @until text
3430

3431
 * Using the same method we'll create our popup passing our window
3432
 * object as parent. We'll also set the timeout to 3.0 seconds, label
3433
 * as content, the title and visibility true for our popup.
3434

3435
 * @skip elm::popup
3436
 * @until visibility
3437

3438
 * Our popup will hide every time the lambda type function is called.
3439
 * The lambda function get the popup object by reference and set it's
3440
 * visibility to false, making it invisible. In this example we are
3441
 * using @a std::bind to bind the parameters of our lambda function to
3442
 * return as @a std::function object to popup_hide which was declare
3443
 * as auto.
3444

3445
 * @skip popup_hide
3446
 * @until });
3447

3448
 * To learn more consult @ref lambda.
3449

3450
 * In this example we'll add the popup_hide in the timeout callback
3451
 * and the block_clicked callback. This results in hiding the popup in
3452
 * maximum of 3.0 seconds or when the popup block is clicked.
3453

3454
 * @skip timeout
3455
 * @until block 
3456

3457
 * Finally we just have to make our window visible and set it's size,
3458
 * then run the elm mainloop, starting to handle events and drawing
3459
 * operations.
3460
 
3461
 * @skip visibility
3462
 * @until ELM_MAIN
3463

3464
 * This example will initially look like this:
3465

3466
 * @image html screenshots/popup_cxx_example_01.png
3467
 * @image latex screenshots/popup_cxx_example_01.eps width=\textwidth
3468

3469
 * Once the popup is hidden after timeout:
3470

3471
 * @image html screenshots/popup_cxx_example_01_a.png
3472
 * @image latex screenshots/popup_cxx_example_01_a.eps width=\textwidth
3473
 
3474
 * @example popup_cxx_example_01.cc
3475
 */
3476

3477
/**
3478
 * @page radio_cxx_example_01 Radio example with C++ Binding
3479
 * @dontinclude radio_cxx_example_01.cc
3480
 
3481
 * In this example we will create 4 radios, and add them to the same
3482
 * group. We will also have the radios in the group change the value
3483
 * of a variable directly and have then print it when the value
3484
 * changes.
3485
 
3486
 * The first part consists of including the headers. In this
3487
 * case we are only working with the Elementary C++ binding and thus
3488
 * we need only to include him.
3489
  
3490
 * @skipline Elementary.hh
3491
 
3492
 * @attention If necessary the C and/or the C++ headers should be
3493
 * include here as well.
3494

3495
 * Now we need to actually start the code and set the elm_policy,
3496
 * which defines for a given policy group/identifier a new policy's
3497
 * value, respectively. In this example the only policy we need to
3498
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
3499

3500
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
3501
 * automatically;
3502
 
3503
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
3504
 * application's last window is closed;
3505
 
3506
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
3507
 * application's last window is hidden;
3508
 
3509
 * @skip EAPI_MAIN
3510
 * @until elm_policy_set
3511
 
3512
 * As you can see, the policy we chose was to quit when the last win
3513
 * is hidden as opposed to examples with the C bindings where we
3514
 * perpetually set it to quit when last win was closed. This changed
3515
 * was necessary because in C++ binding as the elm mainloop stop
3516
 * running all object are destroyed, references are unreferenced and
3517
 * events are stopped at ELM_MAIN().
3518
  
3519
 * @see For more details consult elm_policy_set
3520

3521
 * And move right to declaring a static variable, the one whose value
3522
 * the radios will change:
3523
 
3524
 * @skipline static
3525

3526
 * Next step is creating an Elementary window, in this example we use
3527
 * the C++ binding method with the elm_win_util_standard_add that is a
3528
 * elm_win_legacy function, better explained below. And then we set
3529
 * the autohide state for it.
3530
 
3531
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
3532
 * Adds a window object with standard setup.
3533

3534
 * Parameters:
3535
 
3536
 * @li @p name - The name of the window;
3537

3538
 * @li @p title - The title for the window.
3539

3540
 * This creates a window but also puts in a standard background with
3541
 * @p elm_bg_add(), as well as setting the window title to @p
3542
 * title. The window type created is of type @c ELM_WIN_BASIC, with
3543
 * the @c NULL as the parent widget. Returns the created object or @c
3544
 * NULL on failure. 
3545

3546
 * The autohide works similarly to @p autodel, automatically handling
3547
 * "delete,request" signals when set to @p true, with the difference
3548
 * that it will hide the window, instead of destroying it. 
3549

3550
 * It is specially designed to work together with @p
3551
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
3552
 * Elementary's main loop when all the windows are hidden.
3553
 
3554
 * @skip ::elm::win
3555
 * @until autohide_set
3556

3557
 * @note @p autodel and @a autohide are not mutually exclusive. The
3558
 * window will be destructed if both autodel and autohide is set to @p
3559
 * EINA_TRUE or @p true.
3560

3561
 * A box arranges objects in a linear fashion, governed by a layout
3562
 * function that defines the details of this arrangement. The box will
3563
 * use an internal function to set the layout to a single row,
3564
 * vertical by default.
3565

3566
 * Now let's create the box with the C++ binding method, passing our
3567
 * window object as parent and then setting box's layout as
3568
 * horizontal.
3569

3570
 * @skipline elm::box
3571
 * @until horizontal
3572

3573
 * To better understand, the function @c size_hint_weight_set for C++
3574
 * bindings originated from C bindings function
3575
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
3576
 * With this function we set the hints for an object's weight.  The
3577
 * parameters are:
3578

3579
 * @li x - Nonnegative double value to use as horizontal weight hint.
3580

3581
 * @li y - Nonnegative double value to use as vertical weight hint.
3582

3583
 * This is not a size enforcement in any way, it's just a hint that
3584
 * should be used whenever appropriate. This is a hint on how a
3585
 * container object should resize a given child within its area.
3586

3587
 * Containers may adhere to the simpler logic of just expanding the
3588
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
3589
 * helper weight macro in the EFL Evas Documentation) or the complete
3590
 * one of taking each child's weight hint as real weights to how much
3591
 * of its size to allocate for them in each axis. A container is
3592
 * supposed to, after normalizing the weights of its children (with
3593
 * weight hints), distribute the space it has to layout them by those
3594
 * factors – most weighted children get larger in this process than
3595
 * the least ones.
3596

3597
 * @skipline weight_set
3598

3599
 * @note Default weight hint values are 0.0, for both axis.
3600

3601
 * Now we add the box as a resize_object to win informing that when
3602
 * the size of the win changes so should the box's size. And finally
3603
 * we make it visible.
3604
 
3605
 * @skip win
3606
 * @until visibility_set 
3607

3608
 * Radio is a widget that allows for one or more options to be
3609
 * displayed and have the user choose only one of them. It contains an
3610
 * indicator, an optional label and an optional icon object. While
3611
 * it's possible to have a group of only one radio they, are normally
3612
 * used in groups of 2 or more.
3613

3614
 * We will create the box with the C++ binding method, passing our
3615
 * window object as parent and then setting box's layout as
3616
 * horizontal.
3617

3618
 * And now we create a radio with the C++ binding method, passing our
3619
 * window object as parent. Since this is the first radio in our group
3620
 * we set the group to be the radio, so we can set the other radios in
3621
 * the same group.
3622

3623
 * @skip radio
3624
 * @until radio;
3625

3626
 * We also set the text, then state value of this radio to 1 and
3627
 * the value pointer to @p val, since val is @p 1 this has the
3628
 * additional effect of setting the radio value to @p 1.
3629
 
3630
 * @skip text
3631
 * @until pointer
3632

3633
 * For this radio we choose the standard home icon, the icon will be
3634
 * created with the same method and setting the icon as content of
3635
 * radio.
3636

3637
 * @skip icon
3638
 * @until content
3639

3640
 * When using the elm::box the packing method of the subobj - radio
3641
 * in this case - should be defined. There are four possible methods:
3642

3643
 * @li @c pack_start(subobj_) - Add an object to the beginning of the
3644
 * pack list. Pack @c subobj_ into the box obj, placing it first in
3645
 * the list of children objects. The actual position the object will
3646
 * get on screen depends on the layout used. If no custom layout is
3647
 * set, it will be at the top or left, depending if the box is
3648
 * vertical or horizontal, respectively.
3649

3650
 * @li @c pack_end(subobj_) - Add an object at the end of the pack
3651
 * list. Pack @c subobj_ into the box obj, placing it last in the list
3652
 * of children objects. The actual position the object will get on
3653
 * screen depends on the layout used. If no custom layout is set, it
3654
 * will be at the bottom or right, depending if the box is vertical or
3655
 * horizontal, respectively.
3656

3657
 * @li @c pack_before(subobj_, before_) - Adds an object to the box
3658
 * before the indicated object. This will add the @c subobj_ to the
3659
 * box indicated before the object indicated with @c before_. If
3660
 * before is not already in the box, results are undefined. Before
3661
 * means either to the left of the indicated object or above it
3662
 * depending on orientation.
3663
 
3664
 * @li @c pack_after(subobj_, after_) - Adds an object to the box
3665
 * after the indicated object. This will add the @c subobj_ to the box
3666
 * indicated after the object indicated with @c after_. If after is
3667
 * not already in the box, results are undefined. After means either
3668
 * to the right of the indicated object or below it depending on
3669
 * orientation.
3670

3671
 * In this and most examples we use pack_end by choice and
3672
 * practicality.
3673

3674
 * @skipline pack_end
3675
 
3676
 * The function size_hint_weight_set works with radio the same way
3677
 * as with box, as above.
3678

3679
 * @skipline weight_set
3680
 
3681
 * The function @c size_hint_align_set for C++ bindings originated
3682
 * from C bindings function evas_object_size_hint_align_set, that is
3683
 * EFL Evas type function. With this function we set the hints for an
3684
 * object's alignment. The parameters are:
3685
 
3686
 * @li x - Double, ranging from 0.0 to 1.0 or with the special value
3687
 * EVAS_HINT_FILL, to use as horizontal alignment hint.
3688

3689
 * @li y - Double, ranging from 0.0 to 1.0 or with the special value
3690
 * EVAS_HINT_FILL, to use as vertical alignment hint.
3691

3692
 * These are hints on how to align an object inside the boundaries of
3693
 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
3694
 * with the special value EVAS_HINT_FILL used to specify "justify" or
3695
 * "fill" by some users. In this case, maximum size hints should be
3696
 * enforced with higher priority, if they are set. Also, any padding
3697
 * hint set on objects should add up to the alignment space on the
3698
 * final scene composition.
3699

3700
 * For the horizontal component, 0.0 means to the left, 1.0 means to
3701
 * the right. Analogously, for the vertical component, 0.0 to the top,
3702
 * 1.0 means to the bottom.
3703

3704
 * This is not a size enforcement in any way, it's just a hint that
3705
 * should be used whenever appropriate.
3706

3707
 * @skipline align_set
3708

3709
 * @note Default alignment hint values are 0.5, for both axis.
3710

3711
 * To end the settings of radio we'll make it visible and with our
3712
 * lambda type function we output the current value of @p val. In this
3713
 * example we are using @a std::bind to bind the parameters of our
3714
 * lambda function to return as @a std::function object to @p cb_val
3715
 * which was declare as @p auto. Now we just have to add @p cb_val as
3716
 * changed radio callback of our radio.
3717

3718
 * @skip visibility
3719
 * @until changed
3720

3721
 * @see To learn more consult @ref lambda.
3722

3723
 * The creation of our second radio is almost identical, using the
3724
 * same method we create radio2 passing win as parent. We also set the
3725
 * text, then state value of this radio to 2 and the value pointer to
3726
 * @p val. This radio will be added in the same group as the first
3727
 * radio.
3728
 
3729
 * @skip text
3730
 * @until group
3731

3732
 * Then we set the standard file icon, the icon will be created with
3733
 * the same method and then set the icon as content of radio.
3734

3735
 * @skip ic2
3736
 * @until content
3737

3738
 * As before, we set packing method of radio2 in the box, the weight,
3739
 * alignment and visibility of radio2. Then add cb_val as callback
3740
 * when the radio changes.
3741

3742
 * @skip pack
3743
 * @until changed
3744

3745
 * For our third and fourth radios we'll omit the icon and set the
3746
 * value to 3 and 4, respectively, we'll also add them to the group of
3747
 * the first radio:
3748

3749
 * @skip radio3
3750
 * @until radio4.callback
3751

3752
 * Finally we just have to make our window visible and set it's size,
3753
 * then run the elm mainloop, starting to handle events and drawing
3754
 * operations.
3755
 
3756
 * @skip visibility
3757
 * @until ELM_MAIN
3758

3759
 * The full code for this example can be found at @ref radio_cxx_example_01.cc
3760

3761
 * The example will look like this:
3762

3763
 * @image html screenshots/radio_cxx_example_01.png
3764
 * @image latex screenshots/radio_cxx_example_01.eps width=\textwidth
3765

3766
 * @example radio_cxx_example_01.cc
3767
 */
3768

3769
/**
3770
 * @page separator_cxx_example_01  Separator with C++ Binding
3771
 * @dontinclude separator_cxx_example_01.cc
3772

3773
 * Separator is a very thin object used to separate other objects,
3774
 * which can be vertical or horizontal.
3775

3776
 * This example shows how to create a window and separate in two
3777
 * parts, each one will be filled with a background color to show the
3778
 * division. The @a separator is used to visually mark the division
3779
 * between two parts.
3780

3781
 * The first part consists of including the headers. In this case we
3782
 * are only working with the Elementary and Evas C++ bindings.
3783
  
3784
 * @skip Elementary.hh
3785
 * @until Evas
3786
 
3787
 * @attention If necessary the C and/or the C++ headers should be
3788
 * include here as well.
3789

3790
 * Now we need to actually start the code and set the elm_policy,
3791
 * which defines for a given policy group/identifier a new policy's
3792
 * value, respectively. In this example the only policy we need to
3793
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
3794

3795
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
3796
 * automatically;
3797

3798
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
3799
 * application's last window is closed;
3800
 
3801
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
3802
 * application's last window is hidden;
3803
   
3804
 * @n @skip EAPI_MAIN int
3805
 * @until elm_policy_set
3806
 
3807
 * As you can see, the policy we chose was to quit when the last win
3808
 * is hidden as opposed to examples with the C bindings where we
3809
 * perpetually set it to quit when last win was closed. This changed
3810
 * was necessary because in C++ binding as the elm mainloop stop
3811
 * running all object are destroyed, references are unreferenced and
3812
 * events at ELM_MAIN() because of this. ??
3813
  
3814
 * @see  elm_policy_set()
3815
 
3816
 * Next step is creating an Elementary window, where win calls a
3817
 * constructor and sets the type of the win to ELM_WIN_BASIC
3818
 * (Elm_Win_Type), which is the indicated type for most of our
3819
 * examples. Here we also set the title that will appear at the top of
3820
 * our window and then the autohide state for it.
3821
 
3822
 * The autohide works similarly to @p autodel, automatically handling
3823
 * "delete,request" signals when set to @p true, with the difference
3824
 * that it will hide the window, instead of destroying it.
3825

3826
 * It is specially designed to work together with @p
3827
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
3828
 * Elementary's main loop when all the windows are hidden.
3829
 
3830
 * @skip ::elm::win
3831
 * @until autohide_set
3832

3833
 * @note @p autodel and @a autohide are not mutually exclusive. The
3834
 * window will be destructed if both autodel and autohide is set to @p
3835
 * EINA_TRUE or @p true.
3836

3837
 * Now let's create the background with the C++ binding method, passing
3838
 * our window as parent.
3839

3840
 * @skipline elm::bg
3841

3842
 * The function @c size_hint_weight_set for C++ bindings originated
3843
 * from C bindings function evas_object_size_hint_weight_set, that is
3844
 * EFL Evas type function. With this function we set the hints for an
3845
 * object's weight. The parameters are:
3846

3847
 * @li x - Nonnegative double value to use as horizontal weight hint.
3848

3849
 * @li y - Nonnegative double value to use as vertical weight hint.
3850

3851
 * This is not a size enforcement in any way, it's just a hint that
3852
 * should be used whenever appropriate.  This is a hint on how a
3853
 * container object should resize a given child within its area.
3854

3855
 * Containers may adhere to the simpler logic of just expanding the
3856
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
3857
 * helper weight macro in the EFL Evas Documentation) or the complete
3858
 * one of taking each child's weight hint as real weights to how much
3859
 * of its size to allocate for them in each axis. A container is
3860
 * supposed to, after normalizing the weights of its children (with
3861
 * weight hints), distribute the space it has to layout them by those
3862
 * factors – most weighted children get larger in this process than
3863
 * the least ones.
3864

3865
 * @skipline weight_set
3866

3867
 * @note Default weight hint values are 0.0, for both axis.
3868

3869
 * Now we add the background as a resize-object to win informing that
3870
 * when the size of the win changes so should the background's size
3871
 * and setting it's visibility. You can change the background's color
3872
 * using color_set, if not, the default color will be used.
3873
 
3874
 * @skip win
3875
 * @until visibility_set 
3876
 
3877
 * To put a box in the window we also need to set it's parent. By
3878
 * default, box object arranges their contents vertically from top to
3879
 * bottom. By calling this function with horizontal as @a true, the
3880
 * box will become horizontal, arranging contents from left to right.
3881

3882
 * @skip ::elm::box
3883
 * @until horizontal
3884

3885
 * The value that we set EFL Evas function size_hint_weight_set
3886
 * expands the box to cover all win's area and adding it as a
3887
 * resize_object to win informing that when the size of the win
3888
 * changes so should the box's size. In the end we make the box
3889
 * visible.
3890
 
3891
 * @skip weight
3892
 * @until visibility
3893
  
3894
 * Now we create a retangle, like before, we just need to setting it's
3895
 * parent. After created, we set the color to show the difference
3896
 * between the next rectangle and define the minimun size of each side
3897
 * by using size_hint_min_set(minimum width, minimum height).
3898

3899
 * @skip rect
3900
 * @until min_set
3901

3902
 * As in the background, the value we set EFL Evas function
3903
 * size_hint_weight_set expands the background to cover all area
3904
 * defined in size_hint_min_set. We also need to expand the rectangle
3905
 * to fill the area if the win's size change, if not, win can change
3906
 * it's size and the rectangle will only fill it's own previous area.
3907

3908
 * @until weight
3909
 
3910
 * The function @c size_hint_align_set for C++ bindings originated
3911
 * from C bindings function evas_object_size_hint_align_set, that is
3912
 * EFL Evas type function. With this function we set the hints for an
3913
 * object's alignment. The parameters are:
3914
 
3915
 * @li x - Double, ranging from 0.0 to 1.0 or with the special value
3916
 * EVAS_HINT_FILL, to use as horizontal alignment hint.
3917

3918
 * @li y - Double, ranging from 0.0 to 1.0 or with the special value
3919
 * EVAS_HINT_FILL, to use as vertical alignment hint.
3920

3921
 * These are hints on how to align an object inside the boundaries of
3922
 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
3923
 * with the special value EVAS_HINT_FILL used to specify "justify" or
3924
 * "fill" by some users. In this case, maximum size hints should be
3925
 * enforced with higher priority, if they are set. Also, any padding
3926
 * hint set on objects should add up to the alignment space on the
3927
 * final scene composition.
3928

3929
 * For the horizontal component, 0.0 means to the left, 1.0 means to
3930
 * the right. Analogously, for the vertical component, 0.0 to the top,
3931
 * 1.0 means to the bottom.
3932

3933
 * This is not a size enforcement in any way, it's just a hint that
3934
 * should be used whenever appropriate.
3935

3936
 * @skipline align_set
3937

3938
 * @note Default alignment hint values are 0.5, for both axis.
3939

3940
 * Now we only need to set the visibility of the rectangle and add our
3941
 * retangle to box with the packing method of the subobj - rectangle
3942
 * in this case. There are four possible methods:
3943

3944
 * @li @c pack_start(subobj_) - Add an object to the beginning of the
3945
 * pack list. Pack @c subobj_ into the box obj, placing it first in
3946
 * the list of children objects. The actual position the object will
3947
 * get on screen depends on the layout used. If no custom layout is
3948
 * set, it will be at the top or left, depending if the box is
3949
 * vertical or horizontal, respectively.
3950

3951
 * @li @c pack_end(subobj_) - Add an object at the end of the pack
3952
 * list. Pack @c subobj_ into the box obj, placing it last in the list
3953
 * of children objects. The actual position the object will get on
3954
 * screen depends on the layout used. If no custom layout is set, it
3955
 * will be at the bottom or right, depending if the box is vertical or
3956
 * horizontal, respectively.
3957

3958
 * @li @c pack_before(subobj_, before_) - Adds an object to the box
3959
 * before the indicated object. This will add the @c subobj_ to the
3960
 * box indicated before the object indicated with @c before_. If
3961
 * before is not already in the box, results are undefined. Before
3962
 * means either to the left of the indicated object or above it
3963
 * depending on orientation.
3964
 
3965
 * @li @c pack_after(subobj_, after_) - Adds an object to the box
3966
 * after the indicated object. This will add the @c subobj_ to the box
3967
 * indicated after the object indicated with @c after_. If after is
3968
 * not already in the box, results are undefined. After means either
3969
 * to the right of the indicated object or below it depending on
3970
 * orientation.
3971

3972
 * In this and most examples we use pack_end by choice and
3973
 * practicality. In this part of the code we also make rectangle
3974
 * visible.
3975
 
3976
 * @skip visibility
3977
 * @until pack
3978
 
3979
 * Once we have our first rectangle in the box we create and add our
3980
 * separator. Using the same approach, we setting it's parent. Since
3981
 * our box is in horizontal mode it's a good idea to set the separator
3982
 * to be horizontal too. Finishing with the visibility and packing
3983
 * method.
3984

3985
 * @skip elm::separator
3986
 * @until pack
3987

3988
 * After all this, we just need to create another rectangle, setting
3989
 * the color, size hints, make rect2 visible and packing in the
3990
 * box. Don't forget to set the win's visibility as true.
3991

3992
 * @skip rect2
3993
 * @until win.visibility
3994

3995
 * Finally we just have to start the elm mainloop, starting to handle
3996
 * events and drawing operations.
3997

3998
 * @skip elm_run
3999
 * @until ELM_MAIN()
4000
 
4001
 * The full code for this example can be found at @ref separator_cxx_example_01.cc .
4002

4003
 * This example will look like:
4004

4005
 * @image html screenshots/separator_cxx_example_01.png
4006
 * @image latex screenshots/separator_cxx_example_01.eps width=\textwidth
4007

4008
 * @example separator_cxx_example_01.cc
4009
 */
4010

4011
/**
4012
 * @page slider_cxx_example Slider widget example with C++ Binding
4013
 * @dontinclude slider_cxx_example.cc 
4014

4015
 * This code places seven Elementary slider widgets on a window, each of
4016
 * them exemplifying a part of the widget's API.
4017
 
4018
 * The first part consists of including the headers. In this
4019
 * case we are only working with the Elementary C++ binding and thus
4020
 * we need only to include him.
4021
  
4022
 * @skipline Elementary.hh
4023
 
4024
 * @attention If necessary the C and/or the C++ headers should be
4025
 * include here as well.
4026

4027
 * Now we need to actually start the code and set the elm_policy,
4028
 * which defines for a given policy group/identifier a new policy's
4029
 * value, respectively.  In this example the only policy we need to
4030
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
4031

4032
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
4033
 * automatically;
4034
 
4035
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
4036
 * application's last window is closed;
4037
 
4038
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
4039
 * application's last window is hidden;
4040
 
4041
 * @skip EAPI_MAIN
4042
 * @until elm_policy_set
4043
 
4044
 * As you can see, the policy we chose was to quit when the last win
4045
 * is hidden as opposed to examples with the C bindings where we
4046
 * perpetually set it to quit when last win was closed. This changed
4047
 * was necessary because in C++ binding as the elm mainloop stop
4048
 * running all object are destroyed, references are unreferenced and
4049
 * events are stopped at ELM_MAIN().
4050
  
4051
 * @see For more details consult elm_policy_set
4052

4053
 * Next step is creating an Elementary window, in this example we use
4054
 * the C++ binding method with the elm_win_util_standard_add that is a
4055
 * elm_win_legacy function, better explained below. And then we set
4056
 * the autohide state for it.
4057
 
4058
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
4059
 * Adds a window object with standard setup.
4060

4061
 * Parameters:
4062
 
4063
 * @li @p name - The name of the window;
4064

4065
 * @li @p title - The title for the window.
4066

4067
 * This creates a window but also puts in a standard background with
4068
 * @p elm_bg_add(), as well as setting the window title to @p
4069
 * title. The window type created is of type @c ELM_WIN_BASIC, with
4070
 * the @c NULL as the parent widget. Returns the created object or @c
4071
 * NULL on failure.
4072

4073
 * The autohide works similarly to @p autodel, automatically handling
4074
 * "delete,request" signals when set to @p true, with the difference
4075
 * that it will hide the window, instead of destroying it.
4076

4077
 * It is specially designed to work together with @p
4078
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
4079
 * Elementary's main loop when all the windows are hidden.
4080
 
4081
 * @skip ::elm::win
4082
 * @until autohide_set
4083

4084
 * @note @p autodel and @a autohide are not mutually exclusive. The
4085
 * window will be destructed if both autodel and autohide is set to @p
4086
 * EINA_TRUE or @p true.
4087

4088
 * Now let's create a box with the C++ binding method, passing our
4089
 * window object as parent, we'll use this box to contain our slider
4090
 * object.
4091

4092
 * @skipline bx
4093

4094
 * To better understand, the function @c size_hint_weight_set for C++
4095
 * bindings originated from C bindings function
4096
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
4097
 * With this function we set the hints for an object's weight.  The
4098
 * parameters are:
4099

4100
 * @li x - Nonnegative double value to use as horizontal weight hint.
4101

4102
 * @li y - Nonnegative double value to use as vertical weight hint.
4103

4104
 * This is not a size enforcement in any way, it's just a hint that
4105
 * should be used whenever appropriate. This is a hint on how a
4106
 * container object should resize a given child within its area.
4107

4108
 * Containers may adhere to the simpler logic of just expanding the
4109
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
4110
 * helper weight macro in the EFL Evas Documentation) or the complete
4111
 * one of taking each child's weight hint as real weights to how much
4112
 * of its size to allocate for them in each axis. A container is
4113
 * supposed to, after normalizing the weights of its children (with
4114
 * weight hints), distribute the space it has to layout them by those
4115
 * factors – most weighted children get larger in this process than
4116
 * the least ones.
4117

4118
 * @skipline weight_set
4119

4120
 * @note Default weight hint values are 0.0, for both axis.
4121

4122
 * Then we add the box as a resize-object to win informing that when
4123
 * the size of the win changes so should the box's size. Remember
4124
 * always to set the box visibility to true.
4125

4126
 * @skip win
4127
 * @until visibility
4128

4129
 * Now we'll create our slider, using the C++ binding method and set
4130
 * it's size hint that works with slider the same way as with box, for
4131
 * more, look above. This is the default slider.
4132

4133
 * @skip slider
4134
 * @until weight
4135

4136
 * The function @c size_hint_align_set for C++ bindings originated
4137
 * from C bindings function evas_object_size_hint_align_set, that is
4138
 * EFL Evas type function. With this function we set the hints for an
4139
 * object's alignment. The parameters are:
4140
 
4141
 * @li x - Double, ranging from 0.0 to 1.0 or with the special value
4142
 * EVAS_HINT_FILL, to use as horizontal alignment hint.
4143

4144
 * @li y - Double, ranging from 0.0 to 1.0 or with the special value
4145
 * EVAS_HINT_FILL, to use as vertical alignment hint.
4146

4147
 * These are hints on how to align an object inside the boundaries of
4148
 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
4149
 * with the special value EVAS_HINT_FILL used to specify "justify" or
4150
 * "fill" by some users. In this case, maximum size hints should be
4151
 * enforced with higher priority, if they are set. Also, any padding
4152
 * hint set on objects should add up to the alignment space on the
4153
 * final scene composition.
4154

4155
 * For the horizontal component, 0.0 means to the left, 1.0 means to
4156
 * the right. Analogously, for the vertical component, 0.0 to the top,
4157
 * 1.0 means to the bottom.
4158

4159
 * This is not a size enforcement in any way, it's just a hint that
4160
 * should be used whenever appropriate.
4161

4162
 * @skipline align
4163

4164
 * @note Default alignment hint values are 0.5, for both axis.
4165

4166
 * When using the elm box the packing method of the subobj - slider
4167
 * in this case - should be defined. There are four possible methods:
4168

4169
 * @li @c pack_start(subobj_) - Add an object to the beginning of the
4170
 * pack list. Pack @c subobj_ into the box obj, placing it first in
4171
 * the list of children objects. The actual position the object will
4172
 * get on screen depends on the layout used. If no custom layout is
4173
 * set, it will be at the top or left, depending if the box is
4174
 * vertical or horizontal, respectively.
4175

4176
 * @li @c pack_end(subobj_) - Add an object at the end of the pack
4177
 * list. Pack @c subobj_ into the box obj, placing it last in the list
4178
 * of children objects. The actual position the object will get on
4179
 * screen depends on the layout used. If no custom layout is set, it
4180
 * will be at the bottom or right, depending if the box is vertical or
4181
 * horizontal, respectively.
4182

4183
 * @li @c pack_before(subobj_, before_) - Adds an object to the box
4184
 * before the indicated object. This will add the @c subobj_ to the
4185
 * box indicated before the object indicated with @c before_. If
4186
 * before is not already in the box, results are undefined. Before
4187
 * means either to the left of the indicated object or above it
4188
 * depending on orientation.
4189
 
4190
 * @li @c pack_after(subobj_, after_) - Adds an object to the box
4191
 * after the indicated object. This will add the @c subobj_ to the box
4192
 * indicated after the object indicated with @c after_. If after is
4193
 * not already in the box, results are undefined. After means either
4194
 * to the right of the indicated object or below it depending on
4195
 * orientation.
4196

4197
 * In this and most examples we use pack_end by choice and
4198
 * practicality, in this part of the code we also make slider visible.
4199

4200
 * @skip pack
4201
 * @until visibility
4202

4203
 * As you see, the defaults for a slider are:
4204
 * @li horizontal
4205
 * @li no label
4206
 * @li no values on indicator or unit labels
4207

4208
 * Actually it's pretty useless this way. So let's learn how to
4209
 * improve it.
4210

4211
 * Creating the second slider, the difference being that we set a text
4212
 * and two icons.
4213

4214
 * @skip slider
4215
 * @until text
4216

4217
 * Creating the first icon as standard "home" and not resizable and
4218
 * finally add icon as content for the second slider.
4219

4220
 * @skip icon
4221
 * @until content
4222

4223
 * Our second icon is the standard "folder", also not resizable and
4224
 * with add it also to the second slider.
4225

4226
 * @skip ic2
4227
 * @until content
4228

4229
 * The same as before, the size hints weight, align will be setted and
4230
 * the packing method for the second slider. Also making it visible.
4231

4232
 * @skip align
4233
 * @until visibility
4234

4235
 * If the bar size need to be changed, it can be done with span set function,
4236
 * that doesn't accounts other widget's parts size. Also the bar can starts
4237
 * with a not default value (0.0), as we done on third slider:
4238

4239
 * @skip slider
4240
 * @until visibility
4241

4242
 * So far, users won't be able to see the slider value. If it's required,
4243
 * it can be displayed in two different areas, units label or above
4244
 * the indicator.
4245

4246
 * Let's place a units label on our widget, and also let's set minimum and
4247
 * maximum value, by default it uses 0.0 and 1.0:
4248

4249
 * @skip slider
4250
 * @until visibility
4251

4252
 * If above the indicator is the place to display the value, just set
4253
 * it. Also, is possible to invert a bar, as you can see:
4254

4255
 * @skip slider
4256
 * @until visibility
4257

4258
 * But if you require to use a function a bit more customized to show
4259
 * the value, is possible to registry a callback function that will be
4260
 * called to display unit or indicator label. For this we suggest you
4261
 * use a lambda type function.
4262
 
4263
 * @skip slider
4264
 * @until };
4265

4266
 * In this case, a function to free this will be required, also a
4267
 * Lambda.
4268
 
4269
 * @skipline auto
4270

4271
 * @see To learn more consult @ref lambda.
4272

4273
 * Now we add our two labdas as indicators for our sixth slider and
4274
 * set the hints, packing method and visibility for our slider.
4275

4276
 * @skip indicator
4277
 * @until visibility
4278

4279
 * For our seventh slider we'll show that slider can also be displayed
4280
 * vertically:
4281
 
4282
 * @skip slider
4283
 * @until visibility
4284

4285
 * Finally the last slider will exemplify how to listen to slider's
4286
 * signals, <tt> changed </tt> and <tt> delay,changed </tt>. First we
4287
 * need to implement callback functions that will simply print
4288
 * slider's value, using lambda again:
4289

4290
 * @skip changed
4291
 * @until }
4292
 * @until }
4293
 
4294
 * The first callback function should be called everytime value changes,
4295
 * the second one only after user stops to increment or decrement. Try
4296
 * to keep arrows pressed and check the difference.
4297

4298
 * @skip callback
4299
 * @until callback_delay
4300

4301
 * Finally we just have to make our window visible. Then run the elm
4302
 * mainloop, starting to handle events and drawing operations.
4303
 
4304
 * @skip visibility
4305
 * @until ELM_MAIN
4306
 
4307
 * See the full @ref slider_cxx_example.cc "example", whose window should
4308
 * look like this picture:
4309
 
4310
 * @image html screenshots/slider_cxx_example.png
4311
 * @image latex screenshots/slider_cxx_example.eps width=\textwidth
4312
 
4313
 * @example slider_cxx_example.cc
4314
 */
4315

4316
/**
4317
 * @page spinner_cxx_example Spinner widget example with C++ Binding
4318
 * @dontinclude spinner_cxx_example.cc
4319

4320
 * This code places seven Elementary spinner widgets on a window, each of
4321
 * them exemplifying a part of the widget's API.
4322
 
4323
 * The first part consists of including the headers. In this
4324
 * case we are only working with the Elementary C++ binding and thus
4325
 * we need only to include him.
4326
  
4327
 * @skipline Elementary.hh
4328
 
4329
 * @attention If necessary the C and/or the C++ headers should be
4330
 * include here as well.
4331

4332
 * Now we need to actually start the code and set the elm_policy,
4333
 * which defines for a given policy group/identifier a new policy's
4334
 * value, respectively. In this example the only policy we need to
4335
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
4336

4337
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
4338
 * automatically;
4339
 
4340
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
4341
 * application's last window is closed;
4342
 
4343
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
4344
 * application's last window is hidden;
4345
 
4346
 * @skip EAPI_MAIN
4347
 * @until elm_policy_set
4348
 
4349
 * As you can see, the policy we chose was to quit when the last win
4350
 * is hidden as opposed to examples with the C bindings where we
4351
 * perpetually set it to quit when last win was closed. This changed
4352
 * was necessary because in C++ binding as the elm mainloop stop
4353
 * running all object are destroyed, references are unreferenced and
4354
 * events are stopped at ELM_MAIN().
4355
  
4356
 * @see For more details consult elm_policy_set
4357

4358
 * Next step is creating an Elementary window, in this example we use
4359
 * the C++ binding method with the elm_win_util_standard_add that is a
4360
 * elm_win_legacy function, better explained below. And then we set
4361
 * the autohide state for it.
4362
 
4363
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
4364
 * Adds a window object with standard setup.
4365

4366
 * Parameters:
4367
 
4368
 * @li @p name - The name of the window;
4369

4370
 * @li @p title - The title for the window.
4371

4372
 * This creates a window but also puts in a standard background with
4373
 * @p elm_bg_add(), as well as setting the window title to @p
4374
 * title. The window type created is of type @c ELM_WIN_BASIC, with
4375
 * the @c NULL as the parent widget. Returns the created object or @c
4376
 * NULL on failure. 
4377

4378
 * The autohide works similarly to @p autodel, automatically handling
4379
 * "delete,request" signals when set to @p true, with the difference
4380
 * that it will hide the window, instead of destroying it. 
4381

4382
 * It is specially designed to work together with @p
4383
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
4384
 * Elementary's main loop when all the windows are hidden.
4385
 
4386
 * @skip ::elm::win
4387
 * @until autohide_set
4388

4389
 * @note @p autodel and @a autohide are not mutually exclusive. The
4390
 * window will be destructed if both autodel and autohide is set to @p
4391
 * EINA_TRUE or @p true.
4392

4393
 * A box arranges objects in a linear fashion, governed by a layout
4394
 * function that defines the details of this arrangement. The box will
4395
 * use an internal function to set the layout to a single row,
4396
 * vertical by default.
4397

4398
 * Now let's create the box with the C++ binding method, passing our
4399
 * window object as parent.
4400

4401
 * @skipline elm::box
4402

4403
 * To better understand, the function @c size_hint_weight_set for C++
4404
 * bindings originated from C bindings function
4405
 * evas_object_size_hint_weight_set, that is EFL Evas type function.
4406
 * With this function we set the hints for an object's weight.  The
4407
 * parameters are:
4408

4409
 * @li x - Nonnegative double value to use as horizontal weight hint.
4410

4411
 * @li y - Nonnegative double value to use as vertical weight hint.
4412

4413
 * This is not a size enforcement in any way, it's just a hint that
4414
 * should be used whenever appropriate. This is a hint on how a
4415
 * container object should resize a given child within its area.
4416

4417
 * Containers may adhere to the simpler logic of just expanding the
4418
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
4419
 * helper weight macro in the EFL Evas Documentation) or the complete
4420
 * one of taking each child's weight hint as real weights to how much
4421
 * of its size to allocate for them in each axis. A container is
4422
 * supposed to, after normalizing the weights of its children (with
4423
 * weight hints), distribute the space it has to layout them by those
4424
 * factors – most weighted children get larger in this process than
4425
 * the least ones.
4426

4427
 * @skipline weight_set
4428

4429
 * @note Default weight hint values are 0.0, for both axis.
4430

4431
 * Now we add the box as a resize_object to win informing that
4432
 * when the size of the win changes so should the box's
4433
 * size. And finally we make it visible.
4434
 
4435
 * @skip win
4436
 * @until visibility_set 
4437

4438
 * Now we create our spinner with the C++ method, this first one will
4439
 * the default spinner.
4440

4441
 * @skipline spinner
4442

4443
 * As you see, the defaults for a spinner are:
4444

4445
 * @li no wrap
4446

4447
 * @li min value set to 0
4448

4449
 * @li max value set to 100
4450

4451
 * @li step value set to 1
4452

4453
 * @li label format set to "%0.f"
4454

4455
 * The function size_hint_weight_set works with spinner the same way
4456
 * as with box, as seem above.
4457

4458
 * @skipline weight_set
4459
 
4460
 * The function @c size_hint_align_set for C++ bindings originated
4461
 * from C bindings function evas_object_size_hint_align_set, that is
4462
 * EFL Evas type function. With this function we set the hints for an
4463
 * object's alignment. The parameters are:
4464
 
4465
 * @li x - Double, ranging from 0.0 to 1.0 or with the special value
4466
 * EVAS_HINT_FILL, to use as horizontal alignment hint.
4467

4468
 * @li y - Double, ranging from 0.0 to 1.0 or with the special value
4469
 * EVAS_HINT_FILL, to use as vertical alignment hint.
4470

4471
 * These are hints on how to align an object inside the boundaries of
4472
 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
4473
 * with the special value EVAS_HINT_FILL used to specify "justify" or
4474
 * "fill" by some users. In this case, maximum size hints should be
4475
 * enforced with higher priority, if they are set. Also, any padding
4476
 * hint set on objects should add up to the alignment space on the
4477
 * final scene composition.
4478

4479
 * For the horizontal component, 0.0 means to the left, 1.0 means to
4480
 * the right. Analogously, for the vertical component, 0.0 to the top,
4481
 * 1.0 means to the bottom.
4482

4483
 * This is not a size enforcement in any way, it's just a hint that
4484
 * should be used whenever appropriate.
4485

4486
 * @skipline align_set
4487

4488
 * @note Default alignment hint values are 0.5, for both axis.
4489

4490
 * When using the elm::box the packing method of the subobj - spinner
4491
 * in this case - should be defined. There are four possible methods:
4492

4493
 * @li @c pack_start(subobj_) - Add an object to the beginning of the
4494
 * pack list. Pack @c subobj_ into the box obj, placing it first in
4495
 * the list of children objects. The actual position the object will
4496
 * get on screen depends on the layout used. If no custom layout is
4497
 * set, it will be at the top or left, depending if the box is
4498
 * vertical or horizontal, respectively.
4499

4500
 * @li @c pack_end(subobj_) - Add an object at the end of the pack
4501
 * list. Pack @c subobj_ into the box obj, placing it last in the list
4502
 * of children objects. The actual position the object will get on
4503
 * screen depends on the layout used. If no custom layout is set, it
4504
 * will be at the bottom or right, depending if the box is vertical or
4505
 * horizontal, respectively.
4506

4507
 * @li @c pack_before(subobj_, before_) - Adds an object to the box
4508
 * before the indicated object. This will add the @c subobj_ to the
4509
 * box indicated before the object indicated with @c before_. If
4510
 * before is not already in the box, results are undefined. Before
4511
 * means either to the left of the indicated object or above it
4512
 * depending on orientation.
4513
 
4514
 * @li @c pack_after(subobj_, after_) - Adds an object to the box
4515
 * after the indicated object. This will add the @c subobj_ to the box
4516
 * indicated after the object indicated with @c after_. If after is
4517
 * not already in the box, results are undefined. After means either
4518
 * to the right of the indicated object or below it depending on
4519
 * orientation.
4520

4521
 * In this and most examples we use pack_end by choice and
4522
 * practicality. In this part of the code we also make spinner
4523
 * visible.
4524

4525
 * @skip pack_end
4526
 * @until visibility
4527

4528
 * In our second spinner we are altering the format. It will put a
4529
 * text before and after the value, and also format value to display
4530
 * two decimals. As with the first spinner, we create the second with
4531
 * the same C++ method, set the alignment and the weight, choose the
4532
 * packing method and make it visible.
4533
 
4534
 * @skip spinner
4535
 * @until visibility
4536
 
4537
 * The third one will use a customized step, define new minimum and maximum
4538
 * values and enable wrap, so when value reaches minimum it jumps to maximum,
4539
 * or jumps to minimum after maximum value is reached. Format is set to display
4540
 * a decimal:
4541

4542
 * @skip spinner
4543
 * @until visibility
4544
 
4545
 * The fourth uses @c vertical style, so instead of left and right arrows,
4546
 * top and bottom are displayed. Also the change interval is reduced, so
4547
 * user can change value faster.
4548

4549
 * @skip spinner
4550
 * @until visibility
4551
 
4552
 * In the fifth the user won't be allowed to set value directly, i.e., will
4553
 * be obligate change value only using arrows:
4554

4555
 * @skip spinner
4556
 * @until visibility
4557
 
4558
 * The sixth widget will receive a lot of special values, so
4559
 * instead of reading numeric values, user will see labels for each one.
4560
 * Also direct edition is disabled, otherwise users would see the numeric
4561
 * value on edition mode. User will be able to select a month in this widget:
4562

4563
 * @skip spinner
4564
 * @until visibility
4565
 
4566
 * Finally the last widget will exemplify how to listen to widget's
4567
 * signals, <tt> changed </tt> and <tt> delay_changed </tt>.
4568

4569
 * We start the same way as previously, creating spinner, setting
4570
 * alignment and weight, choosing the packing method, making it
4571
 * visible and editable.
4572

4573
 * @skip spinner
4574
 * @until editable
4575

4576
 * Our spinner will output it's value or delay value every time the
4577
 * std::function object is called. In this example we are using @a
4578
 * std::bind to bind the parameters of each lambda function, that
4579
 * captures sp7 by reference and then get it's value or delay value to
4580
 * finally output it.
4581

4582
 * The first function changed, that was declare as auto, will output
4583
 * the new value. For this we need to add it to the
4584
 * @p callback_changed
4585

4586
 * @skip changed
4587
 * @until callback
4588

4589
 * The second function changed, that was also declare as auto, will
4590
 * output the new delay value. For this we need to add it to the @p
4591
 * callback_delay_changed.
4592

4593
 * @skip delay
4594
 * @until callback
4595

4596
 * To learn more consult @ref lambda.
4597

4598
 * The first callback function should be called everytime value
4599
 * changes, the second one only after user stops to increment or
4600
 * decrement. Try to keep arrows pressed and check the difference.
4601

4602
 * Finally we just have to make our window visible. Then run the elm
4603
 * mainloop, starting to handle events and drawing operations.
4604
 
4605
 * @skip visibility
4606
 * @until ELM_MAIN
4607

4608
 * See the full code for this example at @ref spinner_cxx_example.cc .
4609

4610
 * This example will look like this:
4611

4612
 * @image html screenshots/spinner_cxx_example.png
4613
 * @image latex screenshots/spinner_cxx_example.eps width=\textwidth
4614
 * @example spinner_cxx_example.cc
4615
 */
4616

4617
/**
4618
 * @page table_cxx_example_01 Table Example with C++ binding - Homogeneous
4619
 * @dontinclude table_cxx_example_01.cc
4620

4621
 * In this example we add four labels to a homogeneous table that has a padding
4622
 * of 5px between cells.
4623
 
4624
 * The first part consists of including the headers. In this
4625
 * case we are only working with the Elementary C++ binding and thus
4626
 * we need only to include him.
4627
  
4628
 * @skipline Elementary.hh
4629
 
4630
 * @attention If necessary the C and/or the C++ headers should be
4631
 * include here as well.
4632

4633
 * Now we need to actually start the code and set the elm_policy,
4634
 * which defines for a given policy group/identifier a new policy's
4635
 * value, respectively.  In this example the only policy we need to
4636
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
4637

4638
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
4639
 * automatically;
4640
 
4641
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
4642
 * application's last window is closed;
4643
 
4644
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
4645
 * application's last window is hidden;
4646
 
4647
 * @skip EAPI_MAIN
4648
 * @until elm_policy_set
4649
 
4650
 * As you can see, the policy we chose was to quit when the last win
4651
 * is hidden as opposed to examples with the C bindings where we
4652
 * perpetually set it to quit when last win was closed. This changed
4653
 * was necessary because in C++ binding as the elm mainloop stop
4654
 * running all object are destroyed, references are unreferenced and
4655
 * events are stopped at ELM_MAIN().
4656
  
4657
 * @see For more details consult elm_policy_set
4658
 
4659
 * Next step is creating an Elementary window, in this example we use
4660
 * the C++ binding method with the elm_win_util_standard_add that is a
4661
 * elm_win_legacy function, better explained below. And then we set
4662
 * the autohide state for it.
4663
 
4664
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
4665
 * Adds a window object with standard setup.
4666
 * Parameters:
4667
 
4668
 * @li @p name - The name of the window;
4669

4670
 * @li @p title - The title for the window.
4671

4672
 * This creates a window but also puts in a standard background with
4673
 * @p elm_bg_add(), as well as setting the window title to @p
4674
 * title. The window type created is of type @c ELM_WIN_BASIC, with
4675
 * the @c NULL as the parent widget. Returns the created object or @c
4676
 * NULL on failure.
4677

4678
 * And we also set the autohide state for win, autohide works
4679
 * similarly to @p autodel, automatically handling "delete,request"
4680
 * signals when set to @p true, with the difference that it will hide
4681
 * the window, instead of destroying it.
4682

4683
 * It is specially designed to work together with @p
4684
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
4685
 * Elementary's main loop when all the windows are hidden.
4686
 
4687
 * @skip ::elm::win
4688
 * @until autohide_set
4689

4690
 * @note @p autodel and @a autohide are not mutually exclusive. The
4691
 * window will be destructed if both autodel and autohide is set to @p
4692
 * EINA_TRUE or @p true.
4693
    
4694
 * Now we construct the elm table and for this we use the C++ method
4695
 * below, setting it's parent.
4696

4697
 * @skipline ::elm::table
4698

4699
 * We then add table as a resize_object to win informing that when the
4700
 * size of the win changes so should the box's size and make it
4701
 * visible.
4702

4703
 * @skip resize
4704
 * @until visibility
4705

4706
 * Next step is to set the padding, in this case 5px and as we chosen
4707
 * for this example homogeneous_set to true.
4708

4709
 * @skip padding
4710
 * @until homogeneous
4711

4712
 * We'll create for each cell on this table a simple elm_lable, using
4713
 * the C++ method below, setting it's parent. Set the text for the
4714
 * labels and make each visible. The parameters for packing the labels
4715
 * in our table will be better explain below.
4716

4717
 * @skip elm::label
4718
 * @until (label3,
4719

4720
 * When using pack in our table we are adding a child to a packing
4721
 * location of the table. The parameters are:
4722

4723
 * pack (evas::object @a subobj,
4724
 *       int @a column,
4725
 *       int @a row,
4726
 *       int @a colspan,
4727
 *       int @a rowspan)
4728
  
4729
 * @li subobj - The subobject to be added to the table 
4730

4731
 * @li column - Column number 
4732

4733
 * @li row - Row number
4734

4735
 * @li colspan - Number of columns that the subobj will occupy
4736

4737
 * @li rowspan - Number of rows that the subobj will occupy
4738
 
4739
 * @note All positioning inside the table is relative to rows and
4740
 * columns, so a value of 0 for @a column and @a row, means the top
4741
 * left cell of the table. And for example, value of 2 for @a colspan and @a
4742
 * rowspan indicates that the subobj will occupy two columns and two rows,
4743
 * thus occupying 4 cells in total.
4744

4745
 * Finally we just have to make our window visible. Then run the elm
4746
 * mainloop, starting to handle events and drawing operations.
4747
 
4748
 * @skip visibility
4749
 * @until ELM_MAIN
4750

4751
 * @See Full code for this example: @ref table_cxx_example_01.cc .
4752
 
4753
 * Our example will look like this:
4754
 
4755
 * @image html screenshots/table_cxx_example_01.png
4756
 * @image latex screenshots/table_cxx_example_01.eps width=\textwidth
4757
 * @example table_cxx_example_01.cc
4758
 */
4759

4760
/**
4761
 * @page table_cxx_example_02 Table Example with C++ binding - Heterogeneous
4762
 * @dontinclude table_cxx_example_02.cc
4763

4764
 * For our second example we'll create a table with 4 rectangles in
4765
 * it. Since our rectangles are of different sizes our table won't be
4766
 * homogeneous.
4767

4768
 * The first part consists of including the headers. In this
4769
 * case we are only working with the Elementary C++ binding and thus
4770
 * we need only to include him.
4771
  
4772
 * @skipline Elementary.hh
4773
 
4774
 * @attention If necessary the C and/or the C++ headers should be
4775
 * include here as well.
4776

4777
 * Now we need to actually start the code and set the elm_policy,
4778
 * which defines for a given policy group/identifier a new policy's
4779
 * value, respectively.  In this example the only policy we need to
4780
 * set a value for is @c ELM_POLICY_QUIT, possibles values for it are:
4781

4782
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
4783
 * automatically;
4784
 
4785
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
4786
 * application's last window is closed;
4787
 
4788
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
4789
 * application's last window is hidden;
4790
 
4791
 * @skip EAPI_MAIN
4792
 * @until elm_policy_set
4793
 
4794
 * As you can see, the policy we chose was to quit when the last win
4795
 * is hidden as opposed to examples with the C bindings where we
4796
 * perpetually set it to quit when last win was closed. This changed
4797
 * was necessary because in C++ binding as the elm mainloop stop
4798
 * running all object are destroyed, references are unreferenced and
4799
 * events are stopped at ELM_MAIN().
4800
  
4801
 * @see For more details consult elm_policy_set
4802
 
4803
 * Next step is creating an Elementary window, in this example we use
4804
 * the C++ binding method with the elm_win_util_standard_add that is a
4805
 * elm_win_legacy function, better explained below. And then we set
4806
 * the autohide state for it.
4807
 
4808
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
4809
 * Adds a window object with standard setup.
4810
 * Parameters:
4811
 
4812
 * @li @p name - The name of the window;
4813

4814
 * @li @p title - The title for the window.
4815

4816
 * This creates a window but also puts in a standard background with
4817
 * @p elm_bg_add(), as well as setting the window title to @p
4818
 * title. The window type created is of type @c ELM_WIN_BASIC, with
4819
 * the @c NULL as the parent widget. Returns the created object or @c
4820
 * NULL on failure.
4821

4822
 * And we also set the autohide state for win, autohide works
4823
 * similarly to @p autodel, automatically handling "delete,request"
4824
 * signals when set to @p true, with the difference that it will hide
4825
 * the window, instead of destroying it.
4826

4827
 * It is specially designed to work together with @p
4828
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
4829
 * Elementary's main loop when all the windows are hidden.
4830
 
4831
 * @skip ::elm::win
4832
 * @until autohide_set
4833

4834
 * @note @p autodel and @a autohide are not mutually exclusive. The
4835
 * window will be destructed if both autodel and autohide is set to @p
4836
 * EINA_TRUE or @p true.
4837
  
4838
 * Now we construct the elm table and for this we use the C++ method
4839
 * below, passing windows as it's parent.
4840

4841
 * @skipline ::elm::table
4842

4843
 * We then add table as a resize_object to win informing that when the
4844
 * size of the win changes so should the table's size and make it
4845
 * visible. The last configuration for table is to set homogeneous as
4846
 * false.
4847

4848
 * @skip resize
4849
 * @until homogeneous
4850

4851
 * For each cell of this table we are going to create a unique @p
4852
 * evas::rectangle, each with different colors and sizes.
4853

4854
 * Let's see a snip of the code on how we constructed our rectangles
4855
 * and setted the colors.
4856

4857
 * @skip evas
4858
 * @until color
4859

4860
 * @skip evas
4861
 * @until color
4862

4863
 * @skip evas
4864
 * @until color
4865

4866
 * @skip evas
4867
 * @until color
4868

4869
 * For each rectangle we also setted the size_hint_min that hints for
4870
 * an object's minimum size. This is not a size enforcement in any
4871
 * way, it's just a hint that should be used whenever appropriate.
4872

4873
 * @dontinclude table_cxx_example_02.cc
4874
 * @skipline size_hint
4875

4876
 * @skipline size_hint
4877

4878
 * @skipline size_hint
4879

4880
 * @skipline size_hint
4881
 
4882
 * When using pack in our table we are adding a child to a packing
4883
 * location of the table. The parameters are:
4884

4885
 * pack (evas::object @a subobj,
4886
 *       int @a column,
4887
 *       int @a row,
4888
 *       int @a colspan,
4889
 *       int @a rowspan)
4890
  
4891
 * @li subobj - The subobject to be added to the table 
4892

4893
 * @li column - Column number 
4894

4895
 * @li row - Row number
4896

4897
 * @li colspan - Number of columns that the subobj will occupy
4898

4899
 * @li rowspan - Number of rows that the subobj will occupy
4900
 
4901
 * @note All positioning inside the table is relative to rows and
4902
 * columns, so a value of 0 for @a column and @a row, means the top
4903
 * left cell of the table. And for example, value of 2 for @a colspan
4904
 * and @a rowspan indicates that the subobj will occupy two column
4905
 * and two rows, thus occupying 4 cells in total.
4906

4907
 * So for each rectangle we are setting a specific location and how
4908
 * many cells it's occupying, better seem below:
4909

4910
 * @dontinclude table_cxx_example_02.cc
4911
 * @skipline pack
4912

4913
 * @skipline pack
4914

4915
 * @skipline pack
4916

4917
 * @skipline pack 
4918

4919
 * Finally we just have to make our window visible. Then run the elm
4920
 * mainloop, starting to handle events and drawing operations.
4921
 
4922
 * @skip visibility
4923
 * @until ELM_MAIN
4924

4925
 * @See Full code for this example: @ref table_cxx_example_02.cc .
4926
 
4927
 * Our example will look like this:
4928
 
4929
 * @image html screenshots/table_cxx_example_02.png
4930
 * @image latex screenshots/table_cxx_example_02.eps width=\textwidth
4931
 
4932
 * @example table_cxx_example_02.cc
4933
 */
4934

4935
/**
4936
 * @page thumb_cxx_example_01 Thumb - Generating thumbnails with C++ Binding
4937
 * @dontinclude thumb_cxx_example_01.cc 
4938

4939
 * This example shows how to create a simple thumbnail object with
4940
 * Elementary C++ Binding.
4941
 
4942
 * The first part consists of including the headers. In this case we
4943
 * need Elementary C++ binding, iostream and sstream libraries.
4944
  
4945
 * @skip Elementary.hh
4946
 * @until sstream
4947
 
4948
 * @attention All necessary Enlightenment, Elementary, C and/or C++
4949
 * headers should be include here as well.
4950

4951
 * Starting the main code and telling elementary that we need Ethumb
4952
 * to generate the thumbnails:
4953
 
4954
 * @skip EAPI
4955
 * @until elm_need_ethumb
4956
 
4957
 * Then, we use app_info_set to access the image that we are using for
4958
 * this example.
4959
 
4960
 * @skipline app
4961
  
4962
 * Now let's set the elm_policy, which defines for a given policy
4963
 * group/identifier a new policy's value, respectively. In this
4964
 * example the only policy we need to set a value for is @c
4965
 * ELM_POLICY_QUIT, possibles values for it are:
4966

4967
 * @li @p ELM_POLICY_QUIT_NONE: Never quit the application
4968
 * automatically;
4969
 
4970
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
4971
 * application's last window is closed;
4972
 
4973
 * @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
4974
 * application's last window is hidden;
4975
 
4976
 * @skipline elm_policy_set
4977
 
4978
 * As you can see, the policy we chose was to quit when the last win
4979
 * is hidden as opposed to examples with the C bindings where we
4980
 * perpetually set it to quit when last win was closed. This changed
4981
 * was necessary because in C++ binding as the elm mainloop stop
4982
 * running all object are destroyed, references are unreferenced and
4983
 * events are stopped at ELM_MAIN().
4984
  
4985
 * @see For more details consult elm_policy_set
4986

4987
 * Next step is creating an elementary window, in this example we use
4988
 * the C++ binding method with the elm_win_util_standard_add that is a
4989
 * elm_win_legacy function, better explained below. And then we set
4990
 * the autohide state for it.
4991
 
4992
 * @p elm_win_util_standard_add (const char *name, const char *tittle)
4993
 * Adds a window object with standard setup.
4994
 * Parameters:
4995
 
4996
 * @li @p name - The name of the window;
4997

4998
 * @li @p title - The title for the window.
4999

5000
 * This creates a window but also puts in a standard background with
5001
 * @p elm_bg_add(), as well as setting the window title to @p
5002
 * title. The window type created is of type @c ELM_WIN_BASIC, with
5003
 * the @c NULL as the parent widget. Returns the created object or @c
5004
 * NULL on failure.
5005

5006
 * The autohide works similarly to @p autodel, automatically handling
5007
 * "delete,request" signals when set to @p true, with the difference
5008
 * that it will hide the window, instead of destroying it.
5009

5010
 * It is specially designed to work together with @p
5011
 * ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
5012
 * Elementary's main loop when all the windows are hidden.
5013
 
5014
 * @skip ::elm::win
5015
 * @until autohide_set
5016

5017
 * @note @p autodel and @a autohide are not mutually exclusive. The
5018
 * window will be destructed if both autodel and autohide is set to @p
5019
 * EINA_TRUE or @p true.
5020

5021
 * Creating our thumb and setting it's parent, using C++ method.
5022

5023
 * @skipline thumb
5024

5025
 * For our callbacks we are using lambda type functions to create
5026
 * then, note that all three only show a message, for when our thumb
5027
 * generation is starting, stoping and it's return error.
5028

5029
 * @skip auto
5030
 * @until generate_error
5031

5032
 * @note To learn more about Lambda Function and its use in Elementary
5033
 * consult @ref lambda.
5034

5035
 * Continuing with our thumb, we'll set a size, set it to not be
5036
 * editable, set the file and after that, we can start creating
5037
 * thumbnail objects. They are very similar to image or icon objects:
5038
  
5039
 * @skip size
5040
 * @until reload
5041
 
5042
 * As you can see, the main different function here is reload(), which
5043
 * will check if the options of the Ethumb client have changed. If so,
5044
 * it will re-generate the thumbnail, and show the new one.
5045
 
5046
 * Notice in this example that the thumbnail object is displayed on
5047
 * the size of the window (320x320 pixels), but the thumbnail
5048
 * generated and stored has size 160x160 pixels. That's why the
5049
 * picture seems upscaled.
5050

5051
 * Ideally, you will be generating thumbnails with the size that you
5052
 * will be using them.
5053
 
5054
 * Finishing with thumb we set the weight hint. To better understand,
5055
 * the function @c size_hint_weight_set for C++ bindings originated
5056
 * from C bindings function evas_object_size_hint_weight_set, that is
5057
 * EFL Evas type function.  With this function we set the hints for an
5058
 * object's weight.
5059
 * The parameters are:
5060

5061
 * @li x - Nonnegative double value to use as horizontal weight hint.
5062

5063
 * @li y - Nonnegative double value to use as vertical weight hint.
5064

5065
 * This is not a size enforcement in any way, it's just a hint that
5066
 * should be used whenever appropriate. This is a hint on how a
5067
 * container object should resize a given child within its area.
5068

5069
 * Containers may adhere to the simpler logic of just expanding the
5070
 * child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
5071
 * helper weight macro in the EFL Evas Documentation) or the complete
5072
 * one of taking each child's weight hint as real weights to how much
5073
 * of its size to allocate for them in each axis. A container is
5074
 * supposed to, after normalizing the weights of its children (with
5075
 * weight hints), distribute the space it has to layout them by those
5076
 * factors – most weighted children get larger in this process than
5077
 * the least ones.
5078

5079
 * @skipline weight_set
5080

5081
 * @note Default weight hint values are 0.0, for both axis.
5082

5083
 * Then we add the thumb as a resize-object to win informing that when
5084
 * the size of the win changes so should the thumb's size. Remember
5085
 * always to set the thumb visibility to true.
5086

5087
 * @skip win
5088
 * @until visibility
5089

5090
 * Now we only have to set the size for our window and make it
5091
 * visible.
5092
 
5093
 * @skip size_set
5094
 * @until visibility_set
5095

5096
 * And finally, start the elm mainloop, starting to handle events and
5097
 * drawing operations.
5098

5099
 * @skip elm_run
5100
 * @until ELM_MAIN
5101

5102
 * The full source code can be found at @ref thumb_cxx_example_01.cc
5103

5104
 * @image latex screenshots/thumb_cxx_example_01.eps width=\textwidth
5105
 * @example thumb_cxx_example_01.cc
5106
 */
5107

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.