2012-08-01 14:03:05 -07:00
|
|
|
#ifndef ELM_WIDGET_CHECK_H
|
|
|
|
#define ELM_WIDGET_CHECK_H
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "Elementary.h"
|
2012-08-01 14:03:05 -07:00
|
|
|
|
2014-08-07 09:26:47 -07:00
|
|
|
/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
|
|
|
|
* CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
|
|
|
|
* FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
|
|
|
|
* IT AT RUNTIME.
|
|
|
|
*/
|
|
|
|
|
2012-08-01 14:03:05 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Widget
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @section elm-check-class The Elementary Check Class
|
|
|
|
*
|
|
|
|
* Elementary, besides having the @ref Check widget, exposes its
|
|
|
|
* foundation -- the Elementary Check Class -- in order to create other
|
|
|
|
* widgets which are a check with some more logic on top.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base layout smart data extended with check instance data.
|
|
|
|
*/
|
2014-03-20 01:27:21 -07:00
|
|
|
typedef struct _Elm_Check_Data Elm_Check_Data;
|
|
|
|
struct _Elm_Check_Data
|
2012-08-01 14:03:05 -07:00
|
|
|
{
|
checkbox: Adding third state (Indeterminate) support in checkbox
Summary:
Checkbox should support a third state "indeterminate" along with "Checked" and "Unchecked"
This third state is a state of checkbox which is shown when checkbox is neither Checked nor Unchecked.
- Added this new feature on the basis of a boolean variable's value.
- By default this boolean variable is disabled and checkbox will treat like old way.
- While adding this, I kept in mind, that applications which are already using checkbox, should not be affected, so I used 0=False=Unchecked, 1=True=Checked, and 2=Indeterminate
- Also added an example check_example_o2.c, which is using checkbox with both ways, using boolean, and using enum.
- Now also values can be set using boolean values, but it will give a type casting warning. As a boolean doen't support third state, so I used an enum int like.
- Added APIs to enable disable third state mode. elm_check_three_state_mode_set(check_obj, bool_val), and elm_check_three_state_mode_get(check_obj)
- Modified old APIs which were setting or getting states of checkbox.
- Added a state in theme of checkbox, with third state image.
Reviewers: seoz, raster, Sergeant_Whitespace, Hermet
Subscribers: Hermet, Sergeant_Whitespace, sachin.dev
Differential Revision: https://phab.enlightenment.org/D2249
2015-04-17 01:11:28 -07:00
|
|
|
Check_State state;
|
|
|
|
Check_State *statep;
|
|
|
|
Eina_Bool three_state_mode;
|
2012-08-01 14:03:05 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define ELM_CHECK_DATA_GET(o, sd) \
|
2014-06-03 03:35:28 -07:00
|
|
|
Elm_Check_Data * sd = eo_data_scope_get(o, ELM_CHECK_CLASS)
|
2012-08-01 14:03:05 -07:00
|
|
|
|
|
|
|
#define ELM_CHECK_DATA_GET_OR_RETURN(o, ptr) \
|
|
|
|
ELM_CHECK_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-08-01 14:03:05 -07:00
|
|
|
{ \
|
2014-01-15 10:33:40 -08:00
|
|
|
CRI("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
2012-08-01 14:03:05 -07:00
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ELM_CHECK_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
|
|
|
ELM_CHECK_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-08-01 14:03:05 -07:00
|
|
|
{ \
|
2014-01-15 10:33:40 -08:00
|
|
|
CRI("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
2012-08-01 14:03:05 -07:00
|
|
|
return val; \
|
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#define ELM_CHECK_CHECK(obj) \
|
2014-06-03 03:35:28 -07:00
|
|
|
if (EINA_UNLIKELY(!eo_isa((obj), ELM_CHECK_CLASS))) \
|
2012-08-01 14:03:05 -07:00
|
|
|
return
|
|
|
|
|
|
|
|
#endif
|