Question
I need to create custom UI controls in Tizen with specific behaviors that cannot be achieved using existing containers or EDJE. While EFL appears to support custom control creation, some required APIs (like evas_object_smart_clipped_class_get or evas_smart_class_new) seem unavailable in Tizen.
What are the recommended approaches for implementing truly custom UI controls in Tizen when standard customization methods are insufficient?
Answer
Problem Understanding
The user wants to create custom UI controls with unique behaviors that go beyond what standard Tizen UI controls and EDJE-based styling can provide. They've identified that while EFL supports custom control creation, some necessary APIs appear unavailable in Tizen.
Solution Methods
-
Custom Styles via EDC Files:
- Create custom styles in EDC files to modify existing controls
- Apply these styles using elm_object_style_set()
- This approach allows modification of control appearance and basic behaviors
-
Custom Smart Objects:
- While some EFL smart object APIs might be restricted, Tizen does support creating custom smart objects through alternative methods
- Implement custom Evas smart objects by subclassing existing controls
- Override default behaviors by implementing custom event handlers
-
Composite Controls:
- Combine multiple existing controls into a new composite control
- Manage the composite behavior through custom logic while leveraging standard controls
Code Examples
// Example: Applying a custom style to a button
Evas_Object *btn = elm_button_add(parent);
elm_object_style_set(btn, "MY_CUSTOM_STYLE");
// Example: Creating a simple custom smart object
Evas_Smart_Class *sc = evas_smart_class_new("MyCustomControl");
// Implement required smart object callbacks
evas_smart_add(evas, evas_smart_class_new(sc));
Additional Tips
- When creating custom controls, consider performance implications
- Test thoroughly on target devices as custom implementations may behave differently across hardware
- For complex behaviors, consider implementing a state machine within your custom control
- Document your custom control's API and behavior clearly for future maintenance