1 #ifndef _ELM_GENERAL_H 2 #define _ELM_GENERAL_H 3 /** 4 * @defgroup Elm_General General 5 * @ingroup Elementary 6 * 7 * @brief General Elementary API. Functions that don't relate to 8 * Elementary objects specifically. 9 * 10 * Here are documented functions which init/shutdown the library, 11 * that apply to generic Elementary objects, that deal with 12 * configuration, et cetera. 13 * 14 * @ref general_functions_example_page "This" example contemplates 15 * some of these functions. 16 */ 17 18 /** 19 * @addtogroup Elm_General 20 * @{ 21 */ 22 23 // Legacy types 24 #include "elm_general.eot.h" 25 26 /** Possible values for the selection policy of some widgets. 27 * 28 * @since 1.7 29 * 30 * @ingroup Elm_Object 31 */ 32 typedef enum 33 { 34 ELM_OBJECT_SELECT_MODE_DEFAULT = 0, /**< default select mode. Once an item is 35 * selected, it would stay highlighted 36 * and not going to call selected 37 * callback again even it was clicked. 38 * Items can get focus. */ 39 ELM_OBJECT_SELECT_MODE_ALWAYS, /**< always select mode. Item selected 40 * callbacks will be called every time for 41 * click events, even after the item was 42 * already selected. Items can get focus. */ 43 ELM_OBJECT_SELECT_MODE_NONE, /**< no select mode. Items will never be 44 * highlighted and selected but the size will be 45 * adjusted by the finger size configuration. 46 * Items can't get focus. */ 47 ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY, /**< no select mode with no finger size 48 * rule. Items will never be highlighted 49 * and selected and ignore the finger 50 * size. So the item size can be reduced 51 * below than the finger size 52 * configuration. Items can't get focus. 53 */ 54 ELM_OBJECT_SELECT_MODE_MAX /**< canary value: any value greater or equal to 55 * ELM_OBJECT_SELECT_MODE_MAX is forbidden. */ 56 } Elm_Object_Select_Mode; 57 58 /** Elementary icon types 59 * 60 * @ingroup Elm_Icon 61 */ 62 typedef enum 63 { 64 ELM_ICON_NONE = 0, /**< Icon has no type set */ 65 ELM_ICON_FILE, /**< Icon is of type file */ 66 ELM_ICON_STANDARD /**< Icon is of type standard */ 67 } Elm_Icon_Type; 68 69 /** Input panel (virtual keyboard) layout types. Type of input panel (virtual 70 * keyboard) to use - this is a hint and may not provide exactly what is 71 * desired. 72 * 73 * @ingroup Elm_Input_Panel 74 */ 75 typedef enum 76 { 77 ELM_INPUT_PANEL_LAYOUT_NORMAL = 0, /**< Default layout. */ 78 ELM_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout. */ 79 ELM_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout. */ 80 ELM_INPUT_PANEL_LAYOUT_URL, /**< URL layout. */ 81 ELM_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout. */ 82 ELM_INPUT_PANEL_LAYOUT_IP, /**< IP layout. */ 83 ELM_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout. */ 84 ELM_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout. */ 85 ELM_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this. */ 86 ELM_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout. */ 87 ELM_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout including 88 * esc, alt, ctrl key, so on (no 89 * auto-correct, no auto-capitalization). */ 90 ELM_INPUT_PANEL_LAYOUT_PASSWORD, /**< Like normal, but no auto-correct, no 91 * auto-capitalization etc. */ 92 ELM_INPUT_PANEL_LAYOUT_DATETIME, /**< Date and time layout 93 * 94 * @since 1.8 */ 95 ELM_INPUT_PANEL_LAYOUT_EMOTICON, /**< Emoticon layout 96 * 97 * @since 1.10 */ 98 ELM_INPUT_PANEL_LAYOUT_VOICE /**< Voice layout, but if the IME does not 99 * support voice layout, then normal layout will 100 * be shown. 101 * 102 * @since 1.19 */ 103 } Elm_Input_Panel_Layout; 104 105 /** Input panel (virtual keyboard) language modes. 106 * 107 * @ingroup Elm_Input_Panel 108 */ 109 typedef enum 110 { 111 ELM_INPUT_PANEL_LANG_AUTOMATIC = 0, /**< Automatic */ 112 ELM_INPUT_PANEL_LANG_ALPHABET /**< Alphabet */ 113 } Elm_Input_Panel_Lang; 114 115 /** Autocapitalization Types. Choose method of auto-capitalization. 116 * 117 * @ingroup Elm_Autocapital 118 */ 119 typedef enum 120 { 121 ELM_AUTOCAPITAL_TYPE_NONE = 0, /**< No auto-capitalization when typing. */ 122 ELM_AUTOCAPITAL_TYPE_WORD, /**< Autocapitalize each word typed. */ 123 ELM_AUTOCAPITAL_TYPE_SENTENCE, /**< Autocapitalize the start of each sentence. 124 */ 125 ELM_AUTOCAPITAL_TYPE_ALLCHARACTER /**< Autocapitalize all letters. */ 126 } Elm_Autocapital_Type; 127 128 /** "Return" Key types on the input panel (virtual keyboard). 129 * 130 * @ingroup Elm_Input_Panel_Return_Key 131 */ 132 typedef enum 133 { 134 ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT = 0, /**< Default. */ 135 ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE, /**< Done. */ 136 ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO, /**< Go. */ 137 ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN, /**< Join. */ 138 ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN, /**< Login. */ 139 ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT, /**< Next. */ 140 ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH, /**< Search string or magnifier icon. 141 */ 142 ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND, /**< Send. */ 143 ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN /**< Sign-in 144 * 145 * @since 1.8 */ 146 } Elm_Input_Panel_Return_Key_Type; 147 148 /** Enumeration that defines the types of Input Hints. 149 * 150 * @since 1.12 151 * 152 * @ingroup Elm_Input 153 */ 154 typedef enum 155 { 156 ELM_INPUT_HINT_NONE = 0, /**< No active hints 157 * 158 * @since 1.12 */ 159 ELM_INPUT_HINT_AUTO_COMPLETE = 1 /* 1 >> 0 */, /**< Suggest word auto 160 * completion 161 * 162 * @since 1.12 */ 163 ELM_INPUT_HINT_SENSITIVE_DATA = 2 /* 1 >> 1 */, /**< Typed text should not be 164 * stored. 165 * 166 * @since 1.12 */ 167 ELM_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_DATE = 256, /**< Autofill hint for a credit card 168 * expiration date 169 * 170 * @since 1.21 */ 171 ELM_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_DAY = 512, /**< Autofill hint for a credit card 172 * expiration day 173 * 174 * @since 1.21 */ 175 ELM_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_MONTH = 768, /**< Autofill hint for a credit card 176 * expiration month 177 * 178 * @since 1.21 */ 179 ELM_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_YEAR = 1024, /**< Autofill hint for a credit card 180 * expiration year 181 * 182 * @since 1.21 */ 183 ELM_INPUT_HINT_AUTOFILL_CREDIT_CARD_NUMBER = 1280, /**< Autofill hint for a 184 * credit card number 185 * 186 * @since 1.21 */ 187 ELM_INPUT_HINT_AUTOFILL_EMAIL_ADDRESS = 1536, /**< Autofill hint for an email 188 * address 189 * 190 * @since 1.21 */ 191 ELM_INPUT_HINT_AUTOFILL_NAME = 1792, /**< Autofill hint for a user's real name 192 * 193 * @since 1.21 */ 194 ELM_INPUT_HINT_AUTOFILL_PHONE = 2048, /**< Autofill hint for a phone number 195 * 196 * @since 1.21 */ 197 ELM_INPUT_HINT_AUTOFILL_POSTAL_ADDRESS = 2304, /**< Autofill hint for a postal 198 * address 199 * 200 * @since 1.21 */ 201 ELM_INPUT_HINT_AUTOFILL_POSTAL_CODE = 2560, /**< Autofill hint for a postal 202 * code 203 * 204 * @since 1.21 */ 205 ELM_INPUT_HINT_AUTOFILL_ID = 2816 /**< Autofill hint for a user's ID 206 * 207 * @since 1.21 */ 208 } Elm_Input_Hints; 209 210 /** Data on the event when an Elementary policy has changed 211 * 212 * @ingroup Elm_Event 213 */ 214 typedef struct _Elm_Event_Policy_Changed 215 { 216 unsigned int policy; /**< the policy identifier */ 217 int new_value; /**< value the policy had before the change */ 218 int old_value; /**< new value the policy got */ 219 } Elm_Event_Policy_Changed; 220 221 /** Policy identifiers. 222 * 223 * @ingroup Elm 224 */ 225 typedef enum 226 { 227 ELM_POLICY_QUIT = 0, /**< under which circumstances the application should 228 * quit automatically. See also @ref ELM_POLICY_QUIT. */ 229 ELM_POLICY_EXIT, /**< defines elm_exit() behaviour. See also 230 * @ref ELM_POLICY_EXIT. 231 * 232 * @since 1.8 */ 233 ELM_POLICY_THROTTLE, /**< defines how throttling should work. See also 234 * @ref ELM_POLICY_THROTTLE 235 * 236 * @since 1.8 */ 237 ELM_POLICY_LAST /**< Sentinel value to indicate last enum field during 238 * iteration */ 239 } Elm_Policy; 240 241 /** Possible values for the @ref ELM_POLICY_QUIT policy 242 * 243 * @ingroup Elm 244 */ 245 typedef enum 246 { 247 ELM_POLICY_QUIT_NONE = 0, /**< never quit the application automatically */ 248 ELM_POLICY_QUIT_LAST_WINDOW_CLOSED, /**< quit when the application's last 249 * window is closed */ 250 ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN /**< quit when the application's last 251 * window is hidden 252 * 253 * @since 1.14 */ 254 } Elm_Policy_Quit; 255 256 /** Possible values for the @ref ELM_POLICY_EXIT policy. 257 * 258 * @since 1.8 259 * 260 * @ingroup Elm 261 */ 262 typedef enum 263 { 264 ELM_POLICY_EXIT_NONE = 0, /**< just quit the main loop on elm_exit() */ 265 ELM_POLICY_EXIT_WINDOWS_DEL /**< delete all the windows after quitting the 266 * main loop */ 267 } Elm_Policy_Exit; 268 269 /** Possible values for the @ref ELM_POLICY_THROTTLE policy. 270 * 271 * @since 1.8 272 * 273 * @ingroup Elm 274 */ 275 typedef enum 276 { 277 ELM_POLICY_THROTTLE_CONFIG = 0, /**< do whatever elementary config is 278 * configured to do */ 279 ELM_POLICY_THROTTLE_HIDDEN_ALWAYS, /**< always throttle when all windows are 280 * no longer visible */ 281 ELM_POLICY_THROTTLE_NEVER /**< never throttle when windows are all hidden, 282 * regardless of config settings */ 283 } Elm_Policy_Throttle; 284 285 /** Possible values for the multi-selection policy of some widgets. 286 * 287 * @since 1.8 288 * 289 * @ingroup Elm_Object 290 */ 291 typedef enum 292 { 293 ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT = 0, /**< default multiple select mode */ 294 ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL, /**< disallow multiple selection 295 * when clicked without control 296 * key pressed */ 297 ELM_OBJECT_MULTI_SELECT_MODE_MAX /**< canary value: any value greater or equal 298 * to ELM_OBJECT_MULTI_SELECT_MODE_MAX is 299 * forbidden. */ 300 } Elm_Object_Multi_Select_Mode; 301 302 /** 303 * @brief Line wrapping types. Type of word or character wrapping to use. 304 * 305 * See also @ref elm_entry_line_wrap_set, @ref 306 * elm_popup_content_text_wrap_type_set, @ref elm_label_line_wrap_set. 307 * 308 * @ingroup Elm_Wrap 309 */ 310 typedef enum 311 { 312 ELM_WRAP_NONE = 0, /**< No wrap - value is zero. */ 313 ELM_WRAP_CHAR, /**< Char wrap - wrap between characters. */ 314 ELM_WRAP_WORD, /**< Word wrap - wrap in allowed wrapping points (as defined in 315 * the unicode standard). */ 316 ELM_WRAP_MIXED, /**< Mixed wrap - Word wrap, and if that fails, char wrap. */ 317 ELM_WRAP_LAST /**< Sentinel value to indicate last enum field during iteration 318 */ 319 } Elm_Wrap_Type; 320 321 /** Text Format types. 322 * 323 * @ingroup Elm 324 */ 325 typedef enum 326 { 327 ELM_TEXT_FORMAT_PLAIN_UTF8 = 0, /**< Plain UTF8 type */ 328 ELM_TEXT_FORMAT_MARKUP_UTF8 /**< Markup UTF8 type */ 329 } Elm_Text_Format; 330 331 /** Enum of entry's copy & paste policy. 332 * 333 * @ingroup Elm 334 */ 335 typedef enum 336 { 337 ELM_CNP_MODE_MARKUP = 0, /**< copy & paste text with markup tag */ 338 ELM_CNP_MODE_NO_IMAGE, /**< copy & paste text without item(image) tag */ 339 ELM_CNP_MODE_PLAINTEXT /**< copy & paste text without markup tag */ 340 } Elm_Cnp_Mode; 341 342 /** Defines if the item is of any special type (has subitems or it's the index 343 * of a group), or is just a simple item. 344 * 345 * @ingroup Elm_Genlist_Item_Group 346 */ 347 typedef enum 348 { 349 ELM_GENLIST_ITEM_NONE = 0, /**< Simple item. */ 350 ELM_GENLIST_ITEM_TREE = 1 /* 1 >> 0 */, /**< This may be expanded and have 351 * child items. */ 352 ELM_GENLIST_ITEM_GROUP = 2 /* 1 >> 1 */, /**< An index item of a group of 353 * items. this item can have child 354 * items. */ 355 ELM_GENLIST_ITEM_MAX = 4 /* 1 >> 2 */ /**< Sentinel value to indicate last 356 * enum field during iteration */ 357 } Elm_Genlist_Item_Type; 358 359 /** Defines the type of the item part Used while updating item's parts It can 360 * be used at updating multi fields. 361 * 362 * @ingroup Elm_Genlist_Item_Group 363 */ 364 typedef enum 365 { 366 ELM_GENLIST_ITEM_FIELD_ALL = 0, /**< Type all */ 367 ELM_GENLIST_ITEM_FIELD_TEXT = 1 /* 1 >> 0 */, /**< Type text */ 368 ELM_GENLIST_ITEM_FIELD_CONTENT = 2 /* 1 >> 1 */, /**< Type content */ 369 ELM_GENLIST_ITEM_FIELD_STATE = 4 /* 1 >> 2 */ /**< Type state */ 370 } Elm_Genlist_Item_Field_Type; 371 372 /** Defines where to position the item in the genlist. 373 * 374 * @ingroup Elm_Genlist_Item_Group 375 */ 376 typedef enum 377 { 378 ELM_GENLIST_ITEM_SCROLLTO_NONE = 0, /**< Nothing will happen, Don't use this 379 * value. */ 380 ELM_GENLIST_ITEM_SCROLLTO_IN = 1 /* 1 >> 0 */, /**< To the nearest viewport. 381 */ 382 ELM_GENLIST_ITEM_SCROLLTO_TOP = 2 /* 1 >> 1 */, /**< To the top of viewport. 383 */ 384 ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = 4 /* 1 >> 2 */, /**< To the middle of 385 * viewport. */ 386 ELM_GENLIST_ITEM_SCROLLTO_BOTTOM = 8 /* 1 >> 3 */ /**< To the bottom of 387 * viewport. */ 388 } Elm_Genlist_Item_Scrollto_Type; 389 390 /** Defines where to position the item in the genlist. 391 * 392 * @ingroup Elm_Gengrid_Item_Group 393 */ 394 typedef enum 395 { 396 ELM_GENGRID_ITEM_SCROLLTO_NONE = 0, /**< No scrollto. */ 397 ELM_GENGRID_ITEM_SCROLLTO_IN = 1 /* 1 >> 0 */, /**< To the nearest viewport. 398 */ 399 ELM_GENGRID_ITEM_SCROLLTO_TOP = 2 /* 1 >> 1 */, /**< To the top of viewport. 400 */ 401 ELM_GENGRID_ITEM_SCROLLTO_MIDDLE = 4 /* 1 >> 2 */, /**< To the middle of 402 * viewport. */ 403 ELM_GENGRID_ITEM_SCROLLTO_BOTTOM = 8 /* 1 >> 3 */ /**< To the bottom of 404 * viewport. */ 405 } Elm_Gengrid_Item_Scrollto_Type; 406 407 /** Defines the type of the item part Used while updating item's parts. It can 408 * be used at updating multi fields. 409 * 410 * @ingroup Elm_Gengrid_Item_Group 411 */ 412 typedef enum 413 { 414 ELM_GENGRID_ITEM_FIELD_ALL = 0, /**< Type all */ 415 ELM_GENGRID_ITEM_FIELD_TEXT = 1 /* 1 >> 0 */, /**< Type text */ 416 ELM_GENGRID_ITEM_FIELD_CONTENT = 2 /* 1 >> 1 */, /**< Type content */ 417 ELM_GENGRID_ITEM_FIELD_STATE = 4 /* 1 >> 2 */ /**< Type state */ 418 } Elm_Gengrid_Item_Field_Type; 419 420 /** 421 * @brief Set list's resizing behavior, transverse axis scrolling and items 422 * cropping. See each mode's description for more details. 423 * 424 * @note Default value is @ref ELM_LIST_SCROLL. 425 * 426 * Values here don't work as bitmasks -- only one can be chosen at a time. 427 * 428 * @ingroup Elm_List 429 */ 430 typedef enum 431 { 432 ELM_LIST_COMPRESS = 0, /**< The list won't set any of its size hints to inform 433 * how a possible container should resize it. Then, if 434 * it's not created as a "resize object", it might end 435 * with zeroed dimensions. The list will respect the 436 * container's geometry and, if any of its items won't 437 * fit into its transverse axis, one won't be able to 438 * scroll it in that direction. */ 439 ELM_LIST_SCROLL, /**< Default value. This is the same as #ELM_LIST_COMPRESS, 440 * with the exception that if any of its items won't fit 441 * into its transverse axis, one will be able to scroll it 442 * in that direction. */ 443 ELM_LIST_LIMIT, /**< Sets a minimum size hint on the list object, so that 444 * containers may respect it (and resize itself to fit the 445 * child properly). More specifically, a minimum size hint 446 * will be set for its transverse axis, so that the largest 447 * item in that direction fits well. This is naturally bound 448 * by the list object's maximum size hints, set externally. 449 */ 450 ELM_LIST_EXPAND, /**< Besides setting a minimum size on the transverse axis, 451 * just like on @ref ELM_LIST_LIMIT, the list will set a 452 * minimum size on the longitudinal axis, trying to reserve 453 * space to all its children to be visible at a time. . This 454 * is naturally bound by the list object's maximum size 455 * hints, set externally. */ 456 ELM_LIST_LAST /**< Indicates error if returned by elm_list_mode_get(). */ 457 } Elm_List_Mode; 458 459 typedef enum 460 { 461 ELM_FOCUS_PREVIOUS = 0, /**< previous direction */ 462 ELM_FOCUS_NEXT = 1, /**< next direction */ 463 ELM_FOCUS_UP = 2, /**< up direction */ 464 ELM_FOCUS_DOWN = 3, /**< down direction */ 465 ELM_FOCUS_RIGHT = 4, /**< right direction */ 466 ELM_FOCUS_LEFT = 5, /**< left direction */ 467 ELM_FOCUS_LAST = 6 /**< last direction */ 468 } Elm_Focus_Direction; 469 470 /** 471 * Defines couple of standard Evas_Object layers to be used 472 * with evas_object_layer_set(). 473 * 474 * @note whenever extending with new values, try to keep some padding 475 * to siblings so there is room for further extensions. 476 */ 477 typedef enum 478 { 479 ELM_OBJECT_LAYER_BACKGROUND = EVAS_LAYER_MIN + 64, /**< where to place backgrounds */ 480 ELM_OBJECT_LAYER_DEFAULT = 0, /**< Evas_Object default layer (and thus for Elementary) */ 481 ELM_OBJECT_LAYER_FOCUS = EVAS_LAYER_MAX - 128, /**< where focus object visualization is */ 482 ELM_OBJECT_LAYER_TOOLTIP = EVAS_LAYER_MAX - 64, /**< where to show tooltips */ 483 ELM_OBJECT_LAYER_CURSOR = EVAS_LAYER_MAX - 32, /**< where to show cursors */ 484 ELM_OBJECT_LAYER_LAST /**< last layer known by Elementary */ 485 } Elm_Object_Layer; 486 487 /** How the focus region should be calculated (not related to input focus). */ 488 typedef enum 489 { 490 ELM_FOCUS_REGION_SHOW_WIDGET = 0, /**< As a widget. */ 491 ELM_FOCUS_REGION_SHOW_ITEM /**< As an item. */ 492 } Elm_Focus_Region_Show_Mode; 493 494 495 /**************************************************************************/ 496 EAPI extern int ELM_ECORE_EVENT_ETHUMB_CONNECT; 497 498 /** 499 * Emitted when the application has reconfigured elementary settings due 500 * to an external configuration tool asking it to. 501 */ 502 EAPI extern int ELM_EVENT_CONFIG_ALL_CHANGED; 503 504 /** 505 * Emitted when any Elementary's policy value is changed. 506 */ 507 EAPI extern int ELM_EVENT_POLICY_CHANGED; 508 509 /** 510 * Emitted when nothing is visible and the process as a whole should go into 511 * a background state. 512 * @since 1.12 513 */ 514 EAPI extern int ELM_EVENT_PROCESS_BACKGROUND; 515 516 /** 517 * Emitted when going from nothing being visible to at least one window 518 * being visible. 519 * @since 1.12 520 */ 521 EAPI extern int ELM_EVENT_PROCESS_FOREGROUND; 522 523 typedef Eina_Bool (*Elm_Event_Cb)(void *data, Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info); /**< Function prototype definition for callbacks on input events happening on Elementary widgets. @a data will receive the user data pointer passed to elm_object_event_callback_add(). @a src will be a pointer to the widget on which the input event took place. @a type will get the type of this event and @a event_info, the struct with details on this event. */ 524 525 EAPI extern double _elm_startup_time; 526 527 #ifndef ELM_LIB_QUICKLAUNCH 528 #define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); ret__ = elm_main(argc, argv); elm_shutdown(); return ret__; } /**< macro to be used after the elm_main() function */ 529 #else 530 /** @deprecated macro to be used after the elm_main() function. 531 * Do not define ELM_LIB_QUICKLAUNCH 532 * Compile your programs with -fpie and -pie -rdynamic instead, to generate a single binary (linkable executable). 533 */ 534 #define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; } 535 #endif 536 537 #define __EFL_UI_IS_REQUIRED 538 539 #include "efl_general.h" 540 541 #ifndef __EFL_UI_IS_DEFINED 542 # error "You have an old efl_general.h installed in your local include/elementary-1/ remove it first." 543 #endif 544 545 /**************************************************************************/ 546 /* General calls */ 547 548 /** 549 * Initialize Elementary 550 * 551 * @param[in] argc System's argument count value 552 * @param[in] argv System's pointer to array of argument strings 553 * @return The init counter value. 554 * 555 * This function initializes Elementary and increments a counter of 556 * the number of calls to it. It returns the new counter's value. 557 * 558 * @warning This call is exported only for use by the @c ELM_MAIN() 559 * macro. There is no need to use this if you use this macro (which 560 * is highly advisable). An elm_main() should contain the entry 561 * point code for your application, having the same prototype as 562 * elm_init(), and @b not being static (putting the @c EAPI_MAIN symbol 563 * in front of its type declaration is advisable). The @c 564 * ELM_MAIN() call should be placed just after it. 565 * 566 * Example: 567 * @dontinclude bg_example_01.c 568 * @skip static void 569 * @until ELM_MAIN 570 * 571 * See the full @ref bg_example_01_c "example". 572 * 573 * @see elm_shutdown(). 574 * @ingroup Elm_General 575 */ 576 EAPI int elm_init(int argc, char **argv); 577 578 /** 579 * Shut down Elementary 580 * 581 * @return The init counter value. 582 * 583 * This should be called at the end of your application, just 584 * before it ceases to do any more processing. This will clean up 585 * any permanent resources your application may have allocated via 586 * Elementary that would otherwise persist. 587 * 588 * @see elm_init() for an example 589 * 590 * @note elm_shutdown() will iterate main loop until all ecore_evas are freed. 591 * There is a possibility to call your ecore callbacks(timer, animator, event, 592 * job, and etc.) in elm_shutdown() 593 * 594 * @ingroup Elm_General 595 */ 596 EAPI int elm_shutdown(void); 597 598 /** 599 * Run Elementary's main loop 600 * 601 * This call should be issued just after all initialization is 602 * completed. This function will not return until elm_exit() is 603 * called. It will keep looping, running the main 604 * (event/processing) loop for Elementary. 605 * 606 * This function should be called once only from the same thread that 607 * initted elementary, (elm_init(), eina_init(), ...) and should never 608 * be nested. Never call it from within an instance of itself. 609 * 610 * @see elm_init() for an example 611 * 612 * @ingroup Elm_General 613 */ 614 EAPI void elm_run(void); 615 616 /** 617 * Ask to exit Elementary's main loop 618 * 619 * If this call is issued, it will flag the main loop to cease 620 * processing and return back to its parent function (usually your 621 * elm_main() function). This does not mean the main loop instantly quits. 622 * So your ecore callbacks(timer, animator, event, job, and etc.) have chances 623 * to be called even after elm_exit(). 624 * 625 * @see elm_init() for an example. There, just after a request to 626 * close the window comes, the main loop will be left. 627 * 628 * @note By using the appropriate #ELM_POLICY_QUIT on your Elementary 629 * applications, you'll be able to get this function called automatically for you. 630 * 631 * @ingroup Elm_General 632 */ 633 EAPI void elm_exit(void); 634 635 /** 636 * Exposed symbol used only by macros and should not be used by apps 637 */ 638 EAPI void elm_quicklaunch_mode_set(Eina_Bool ql_on); 639 640 /** 641 * Exposed symbol used only by macros and should not be used by apps 642 */ 643 EAPI Eina_Bool elm_quicklaunch_mode_get(void); 644 645 /** 646 * Exposed symbol used only by macros and should not be used by apps 647 */ 648 EAPI int elm_quicklaunch_init(int argc, char **argv); 649 650 /** 651 * Exposed symbol used only by macros and should not be used by apps 652 */ 653 EAPI int elm_quicklaunch_sub_init(int argc, char **argv); 654 655 /** 656 * Exposed symbol used only by macros and should not be used by apps 657 */ 658 EAPI int elm_quicklaunch_sub_shutdown(void); 659 660 /** 661 * Exposed symbol used only by macros and should not be used by apps 662 */ 663 EAPI int elm_quicklaunch_shutdown(void); 664 665 /** 666 * Exposed symbol used only by macros and should not be used by apps 667 */ 668 EAPI void elm_quicklaunch_seed(void); 669 670 /** 671 * Exposed symbol used only by macros and should not be used by apps 672 */ 673 EAPI Eina_Bool elm_quicklaunch_prepare(int argc, char **argv, const char *cwd); 674 675 /** 676 * Exposed symbol used only by macros and should not be used by apps 677 */ 678 EAPI Eina_Bool efl_quicklaunch_prepare(int argc, char **argv, const char *cwd); 679 680 /** 681 * Exposed symbol used only by macros and should not be used by apps 682 */ 683 EAPI int elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (*postfork_func) (void *data), void *postfork_data); 684 685 /** 686 * Exposed symbol used only by macros and should not be used by apps 687 */ 688 EAPI void elm_quicklaunch_cleanup(void); 689 690 /** 691 * Exposed symbol used only by macros and should not be used by apps 692 */ 693 EAPI int elm_quicklaunch_fallback(int argc, char **argv); 694 695 /** 696 * Exposed symbol used only by macros and should not be used by apps 697 */ 698 EAPI char *elm_quicklaunch_exe_path_get(const char *exe, const char *cwd); 699 700 /** 701 * Set a new policy's value (for a given policy group/identifier). 702 * 703 * @param policy policy identifier, as in @ref Elm_Policy. 704 * @param value policy value, which depends on the identifier 705 * 706 * @return @c EINA_TRUE on success or @c EINA_FALSE, on error. 707 * 708 * Elementary policies define applications' behavior, 709 * somehow. These behaviors are divided in policy groups 710 * (see #Elm_Policy enumeration). This call will emit the Ecore 711 * event #ELM_EVENT_POLICY_CHANGED, which can be hooked at with 712 * handlers. An #Elm_Event_Policy_Changed struct will be passed, 713 * then. 714 * 715 * @note Currently, we have only one policy identifier/group 716 * (#ELM_POLICY_QUIT), which has two possible values. 717 * 718 * @ingroup Elm_General 719 */ 720 EAPI Eina_Bool elm_policy_set(unsigned int policy, int value); 721 722 /** 723 * Get the policy value for given policy identifier. 724 * 725 * @param policy policy identifier, as in #Elm_Policy. 726 * @return The currently set policy value, for that 727 * identifier. Will be @c 0 if @p policy passed is invalid. 728 * 729 * @ingroup Elm_General 730 */ 731 EAPI int elm_policy_get(unsigned int policy); 732 733 /** 734 * Change the language of the current application 735 * 736 * The @p lang passed must be the full name of the locale to use, for 737 * example "en_US.utf8" or "es_ES@euro". 738 * 739 * Changing language with this function will make Elementary run through 740 * all its widgets, translating strings set with 741 * elm_object_domain_translatable_part_text_set(). This way, an entire 742 * UI can have its language changed without having to restart the program. 743 * 744 * For more complex cases, like having formatted strings that need 745 * translation, widgets will also emit a "language,changed" signal that 746 * the user can listen to and manually translate the text. 747 * 748 * @param lang Language to set, must be the full name of the locale 749 * 750 * @ingroup Elm_General 751 */ 752 EAPI void elm_language_set(const char *lang); 753 754 typedef enum _Elm_Process_State 755 { 756 ELM_PROCESS_STATE_FOREGROUND, /*< The process is in a foreground/active/running state - work as normal. @since 1.12 */ 757 ELM_PROCESS_STATE_BACKGROUND /*< The process is in the bacgkround, so you may want to stop animating, fetching data as often etc. @since 1.12 */ 758 } Elm_Process_State; /** The state of the process as a whole. @since 1.12 */ 759 760 /** 761 * Get the process state as a while 762 * 763 * @return The current process state 764 * 765 * The process may logically be some runnable state. a "foreground" application 766 * runs as normal and may be user-visible or "active" in some way. A 767 * background application is not user-visible or otherwise important and 768 * likely should release resources and not wake up often or process much. 769 * 770 * @ingroup Elm_General 771 * @since 1.12 772 */ 773 EAPI Elm_Process_State elm_process_state_get(void); 774 775 776 /* legacy to eo translation */ 777 778 typedef enum 779 { 780 ELM_FOCUS_AUTOSCROLL_MODE_SHOW = 0, /**< Directly show the focused region 781 * or item automatically. */ 782 ELM_FOCUS_AUTOSCROLL_MODE_NONE, /**< Do not show the focused region or item 783 * automatically. */ 784 ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN /**< Bring in the focused region or item 785 * automatically which might invole the 786 * scrolling. */ 787 } Elm_Focus_Autoscroll_Mode; 788 789 typedef enum 790 { 791 ELM_SOFTCURSOR_MODE_AUTO = 0, /**< Auto-detect if a software cursor should 792 * be used (default). */ 793 ELM_SOFTCURSOR_MODE_ON, /**< Always use a softcursor. */ 794 ELM_SOFTCURSOR_MODE_OFF /**< Never use a softcursor. */ 795 } Elm_Softcursor_Mode; 796 797 typedef enum 798 { 799 ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT = 0, /**< show indicator on mouse 800 * down or change in slider 801 * value */ 802 ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS, /**< Always show the indicator. 803 */ 804 ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS, /**< Show the indicator on 805 * focus */ 806 ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE /**< Never show the indicator */ 807 } Elm_Slider_Indicator_Visible_Mode; 808 809 typedef enum 810 { 811 ELM_FOCUS_MOVE_POLICY_CLICK = 0, /**< Move focus by mouse click or touch. 812 * Elementary focus is set on mouse click 813 * and this is checked at mouse up time. 814 * (default) */ 815 ELM_FOCUS_MOVE_POLICY_IN, /**< Move focus by mouse in. Elementary focus is 816 * set on mouse move when the mouse pointer is 817 * moved into an object. */ 818 ELM_FOCUS_MOVE_POLICY_KEY_ONLY /**< Move focus by key. Elementary focus is 819 * set on key input like Left, Right, Up, 820 * Down, Tab, or Shift+Tab. */ 821 } Elm_Focus_Move_Policy; 822 823 /** 824 * @} 825 */ 826 #endif 827