World Clock Widget / inc /

view.h

  1. /*
  2. * Copyright (c) 2015 Samsung Electronics Co., Ltd
  3. *
  4. * Licensed under the Flora License, Version 1.1 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://floralicense.org/license/
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16.  
  17. #include <Elementary.h>
  18. #include <widget_app.h>
  19.  
  20. typedef struct widget_instance_data {
  21. Evas_Object *win;
  22. Evas_Object *bg;
  23. Evas_Object *content;
  24.  
  25. int root_width;
  26. int root_height;
  27. } widget_instance_data_s;
  28.  
  29. /**
  30. * Identifier of callbacks to be set for Widget.
  31. *
  32. * @see view_set_event_callback()
  33. */
  34. typedef enum _widget_event_type {
  35. WIDGET_EVENT_PRESSED, /* Touch Press Event */
  36. WIDGET_EVENT_RELEASED, /* Touch Release Event */
  37. WIDGET_EVENT_CLICKED /* Touch Click Event */
  38. } widget_event_type;
  39.  
  40. /* Widget event callback function signature */
  41. typedef void (*widget_event_cb)(widget_instance_data_s *wid);
  42.  
  43. void view_set_image(void *user_data, const char *part, const char *file_name);
  44. void view_set_text(void *data, const char *part, const char *text);
  45. widget_instance_data_s *view_create(widget_context_h context, int w, int h);
  46. void view_destroy(void *user_data);
  47. void view_resize(void *user_data, int w, int h);
  48. void view_set_event_callback(void *user_data, const char *part_name, widget_event_type type, void *func);