summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_list_view_private.h
blob: 6b1c632d60f7a3db4a454926e3721064309938ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef EFL_UI_LIST_VIEW_PRIVATE_H
#define EFL_UI_LIST_VIEW_PRIVATE_H

#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif

#include <Elementary.h>
#include "efl_ui_list_view_relayout.eo.h"
#include "elm_priv.h"

typedef struct _Efl_Ui_List_View_Data Efl_Ui_List_View_Data;
int efl_ui_list_view_item_index_get(Efl_Ui_List_View_Layout_Item *item);

#include "efl_ui_list_view_seg_array.h"

struct _Efl_Ui_List_View_Data
{
   Eo                           *obj;
   Eo                           *scrl_mgr;
   Efl_Ui_List_View_Pan         *pan_obj;
   Efl_Model                    *model;

   Eina_Stringshare             *style;

   struct {
      Eina_Future *future;

      int start;
      int count;
   } slice;

   Efl_Ui_Layout_Factory        *factory;
   Eina_List                    *selected_items;

   Efl_Ui_Focus_Manager         *manager;
   Efl_Ui_List_View_Relayout    *relayout;
   Efl_Ui_List_View_Seg_Array    *seg_array;
   int                          seg_array_first;

   Elm_Object_Select_Mode       select_mode;
   Eina_Size2D                  min;

   Eina_Bool                    homogeneous : 1;
   Eina_Bool                    scrl_freeze : 1;
};

typedef struct _Efl_Ui_List_View_Pan_Data Efl_Ui_List_View_Pan_Data;

struct _Efl_Ui_List_View_Pan_Data
{
   Eo                     *wobj;
   Eina_Rect              gmt;
};

#define EFL_UI_LIST_VIEW_DATA_GET(o, ptr) \
  Efl_Ui_List_View_Data * ptr = efl_data_scope_get(o, EFL_UI_LIST_VIEW_CLASS)

#define EFL_UI_LIST_VIEW_DATA_GET_OR_RETURN(o, ptr)       \
  EFL_UI_LIST_VIEW_DATA_GET(o, ptr);                      \
  if (EINA_UNLIKELY(!ptr))                           \
    {                                                \
       ERR("No widget data for object %p (%s)",      \
           o, evas_object_type_get(o));              \
       return;                                       \
    }

#define EFL_UI_LIST_VIEW_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
  EFL_UI_LIST_VIEW_DATA_GET(o, ptr);                         \
  if (EINA_UNLIKELY(!ptr))                              \
    {                                                   \
       ERR("No widget data for object %p (%s)",         \
           o, evas_object_type_get(o));                 \
       return val;                                      \
    }

#endif