Migrate TactilityC and LVGL functionality (#588)
lvgl-module - Move and rename source and include files - Fix bug with missing lvgl unlock - New widgets: spinner, toolbar, sliderbox TactilityC - Removed tt_lock, tt_lvgl_\*
This commit is contained in:
committed by
GitHub
parent
cd2d9d6158
commit
b98a813f3c
@@ -1,48 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <freertos/FreeRTOS.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** A handle that represents a lock instance. A lock could be a Mutex or similar construct */
|
||||
typedef void* LockHandle;
|
||||
|
||||
typedef enum {
|
||||
MutexTypeNormal,
|
||||
MutexTypeRecursive
|
||||
} TtMutexType;
|
||||
|
||||
/**
|
||||
* Allocate a lock for a file or folder.
|
||||
* Locking is required before reading files for filesystems that are on a shared bus (e.g. SPI SD card sharing the bus with the display)
|
||||
* @param path the path to create the lock for
|
||||
* @return the allocated lock handle
|
||||
*/
|
||||
LockHandle tt_lock_alloc_for_path(const char* path);
|
||||
|
||||
/**
|
||||
* Attempt to lock the lock.
|
||||
* @param[in] handle the handle that represents the mutex instance
|
||||
* @param[in] timeout the maximum amount of ticks to wait when trying to lock
|
||||
* @return true when the lock was acquired
|
||||
*/
|
||||
bool tt_lock_acquire(LockHandle handle, TickType_t timeout);
|
||||
|
||||
/**
|
||||
* Attempt to unlock the lock.
|
||||
* @param[in] handle the handle that represents the mutex instance
|
||||
*/
|
||||
void tt_lock_release(LockHandle handle);
|
||||
|
||||
/** Free the memory for this lock
|
||||
* This does not auto-release the lock.
|
||||
* @param[in] handle the handle that represents the mutex instance
|
||||
*/
|
||||
void tt_lock_free(LockHandle handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,55 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Show the on-screen keyboard.
|
||||
* @param[in] textarea the textarea to focus the input for
|
||||
*/
|
||||
void tt_lvgl_software_keyboard_show(lv_obj_t* textarea);
|
||||
|
||||
/**
|
||||
* Hide the on-screen keyboard.
|
||||
* Has no effect when the keyboard is not visible.
|
||||
*/
|
||||
void tt_lvgl_software_keyboard_hide();
|
||||
|
||||
/**
|
||||
* The on-screen keyboard is only shown when both of these conditions are true:
|
||||
* - there is no hardware keyboard
|
||||
* - TT_CONFIG_FORCE_ONSCREEN_KEYBOARD is set to true in tactility_config.h
|
||||
* @return if we should show a on-screen keyboard for text input inside our apps
|
||||
*/
|
||||
bool tt_lvgl_software_keyboard_is_enabled();
|
||||
|
||||
/**
|
||||
* Activate the keypad for a widget group.
|
||||
* @param group
|
||||
*/
|
||||
void tt_lvgl_software_keyboard_activate(lv_group_t* group);
|
||||
|
||||
/**
|
||||
* Deactivate the keypad for the current widget group (if any).
|
||||
* You don't have to call this after calling _activate() because widget
|
||||
* cleanup automatically removes itself from the group it belongs to.
|
||||
*/
|
||||
void tt_lvgl_software_keyboard_deactivate();
|
||||
|
||||
/**
|
||||
* @return true if LVGL is configured with a keypad
|
||||
*/
|
||||
bool tt_lvgl_hardware_keyboard_is_available();
|
||||
|
||||
/**
|
||||
* Set the keypad.
|
||||
* @param device the keypad device
|
||||
*/
|
||||
void tt_lvgl_hardware_keyboard_set_indev(lv_indev_t* device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Create a spinner widget. */
|
||||
lv_obj_t* tt_lvgl_spinner_create(lv_obj_t* parent);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,72 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "tt_app.h"
|
||||
#include <lvgl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Create a toolbar widget that shows the app name as title */
|
||||
lv_obj_t* tt_lvgl_toolbar_create_for_app(lv_obj_t* parent, AppHandle context);
|
||||
|
||||
/** Create a toolbar widget with the provided title*/
|
||||
lv_obj_t* tt_lvgl_toolbar_create(lv_obj_t* parent, const char* title);
|
||||
|
||||
/** Sets the toolbar title */
|
||||
void tt_lvgl_toolbar_set_title(lv_obj_t* obj, const char* title);
|
||||
|
||||
/** Sets the navigation action of the toolbar (button on the top-left)
|
||||
* @param[in] obj the toolbar instance
|
||||
* @param[in] icon the icon to set on the button
|
||||
* @param[in] callback the callback for the click action of the button
|
||||
* @param[in] callbackEventUserData the user data that is attached to the callback event object
|
||||
*/
|
||||
void tt_lvgl_toolbar_set_nav_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callback, void* callbackEventUserData);
|
||||
|
||||
/**
|
||||
* Create and add an action button with an image to the toolbar (aligned to the right of the toolbar)
|
||||
* @param[in] obj the toolbar instance
|
||||
* @param[in] imagePath the path to an image file to shown on the button
|
||||
* @param[in] callback the callback for the click action of the button
|
||||
* @param[in] callbackUserData the user data that is passed to the callback
|
||||
* @return an lv_button instance
|
||||
|
||||
*/
|
||||
lv_obj_t* tt_lvgl_toolbar_add_image_button_action(lv_obj_t* obj, const char* imagePath, lv_event_cb_t callback, void* callbackUserData);
|
||||
|
||||
/**
|
||||
* Create and add an action button with text to the toolbar (aligned to the right of the toolbar)
|
||||
* @param[in] obj the toolbar instance
|
||||
* @param[in] text the button text
|
||||
* @param[in] callback the callback for the click action of the button
|
||||
* @param[in] callbackUserData the user data that is passed to the callback
|
||||
* @return an lv_button instance
|
||||
|
||||
*/
|
||||
lv_obj_t* tt_lvgl_toolbar_add_text_button_action(lv_obj_t* obj, const char* text, lv_event_cb_t callback, void* callbackUserData);
|
||||
|
||||
/**
|
||||
* Create and add a switch to the toolbar actions.
|
||||
* @param[in] obj the toolbar instance
|
||||
* @return an instance created by lv_switch_create()
|
||||
*/
|
||||
lv_obj_t* tt_lvgl_toolbar_add_switch_action(lv_obj_t* obj);
|
||||
|
||||
/**
|
||||
* Create and add a spinner to the toolbar actions.
|
||||
* @param[in] obj the toolbar instance
|
||||
* @return an instance created by Tactility's spinner_create()
|
||||
*/
|
||||
lv_obj_t* tt_lvgl_toolbar_add_spinner_action(lv_obj_t* obj);
|
||||
|
||||
|
||||
/**
|
||||
* Remove all actions from the toolbar
|
||||
* @param[in] obj the toolbar instance
|
||||
*/
|
||||
void tt_lvgl_toolbar_clear_actions(lv_obj_t* obj);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user