EOM / inc /

main.h

  1. /*
  2. * Samsung API
  3. * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the License);
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/license/
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an AS IS BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17.  
  18. #ifndef __main_H__
  19. #define __main_H__
  20.  
  21. #include <app.h>
  22. #include <Elementary.h>
  23. #include <system_settings.h>
  24. #include <efl_extension.h>
  25. #include <dlog.h>
  26. #include <Ecore.h>
  27. #include <eom.h>
  28.  
  29. #define MAX_LENGTH_PATH 1024
  30.  
  31. typedef struct viewdata{
  32. Evas_Object *box_external;
  33. Evas_Object *bg;
  34. Evas_Object *text1;
  35. Evas_Object *text2;
  36. Evas_Object *text3;
  37. } viewdata_s;
  38.  
  39. typedef struct appdata{
  40. Evas_Object *win;
  41. Evas_Object *external_win;
  42. Evas_Object *layout;
  43. Evas_Object *conform;
  44. Evas_Object *nf;
  45. Evas_Object *btn_mirror;
  46. Evas_Object *btn_presentation;
  47. Eina_Bool start;
  48. Eina_Bool support_external_display;
  49. Eina_Bool connected;
  50. Eina_Bool attribute_set;
  51. eom_output_mode_e mode;
  52. int output_id;
  53.  
  54. viewdata_s *vd;
  55. } appdata_s;
  56.  
  57. static inline const char *get_resource_path(const char * file_path);
  58.  
  59. #if !defined(PACKAGE)
  60. #define PACKAGE "$(packageName)"
  61. #endif
  62.  
  63. #define EDJPATH "edje"
  64. #define LAYOUTEDJ get_resource_path(EDJPATH"/main_view.edj")
  65. #define IMAGE_DIR "/opt/usr/apps/org.example.eom/res/images"
  66.  
  67.  
  68. static inline const char *get_resource_path(const char *file_path)
  69. {
  70. static char absolute_path[MAX_LENGTH_PATH] = {'\0'};
  71.  
  72. static char *res_path_buff = NULL;
  73. if(res_path_buff == NULL)
  74. {
  75. res_path_buff = app_get_resource_path();
  76. }
  77.  
  78. snprintf(absolute_path, MAX_LENGTH_PATH, "%s%s", res_path_buff, file_path);
  79.  
  80. return absolute_path;
  81. }
  82.  
  83. #endif /* __main_H__ */