Flipper Zero Firmware
Loading...
Searching...
No Matches
desktop_i.h
1#pragma once
2
3#include "desktop.h"
4#include "animations/animation_manager.h"
5#include "views/desktop_view_pin_timeout.h"
6#include "views/desktop_view_pin_input.h"
7#include "views/desktop_view_locked.h"
8#include "views/desktop_view_main.h"
9#include "views/desktop_view_lock_menu.h"
10#include "views/desktop_view_debug.h"
11#include "views/desktop_view_slideshow.h"
12#include <desktop/desktop_settings.h>
13
14#include <furi.h>
15#include <gui/gui.h>
16#include <gui/view_stack.h>
17#include <gui/view_dispatcher.h>
18#include <gui/modules/popup.h>
19#include <gui/scene_manager.h>
20
21#include <loader/loader.h>
22#include <notification/notification_app.h>
23
24#define STATUS_BAR_Y_SHIFT 13
25
26typedef enum {
27 DesktopViewIdMain,
28 DesktopViewIdLockMenu,
29 DesktopViewIdLocked,
30 DesktopViewIdDebug,
31 DesktopViewIdPopup,
32 DesktopViewIdPinInput,
33 DesktopViewIdPinTimeout,
34 DesktopViewIdSlideshow,
35 DesktopViewIdTotal,
36} DesktopViewId;
37
38typedef struct {
39 uint8_t hour;
40 uint8_t minute;
41 bool format_12; // 1 - 12 hour, 0 - 24H
43
44struct Desktop {
45 // Scene
46 FuriThread* scene_thread;
47 // GUI
48 Gui* gui;
49 ViewDispatcher* view_dispatcher;
50 SceneManager* scene_manager;
51
52 Popup* popup;
53 DesktopLockMenuView* lock_menu;
54 DesktopDebugView* debug_view;
55 DesktopViewLocked* locked_view;
56 DesktopMainView* main_view;
57 DesktopViewPinTimeout* pin_timeout_view;
58 DesktopSlideshowView* slideshow_view;
59
60 ViewStack* main_view_stack;
61 ViewStack* locked_view_stack;
62
63 DesktopSettings settings;
64 DesktopViewPinInput* pin_input_view;
65
66 ViewPort* lock_icon_viewport;
67 ViewPort* dummy_mode_icon_viewport;
68 ViewPort* clock_viewport;
69 ViewPort* stealth_mode_icon_viewport;
70
71 AnimationManager* animation_manager;
72
73 Loader* loader;
74 NotificationApp* notification;
75
76 FuriPubSubSubscription* app_start_stop_subscription;
77 FuriPubSub* input_events_pubsub;
78 FuriPubSubSubscription* input_events_subscription;
79 FuriTimer* auto_lock_timer;
80 FuriTimer* update_clock_timer;
81
82 FuriPubSub* status_pubsub;
83
84 DesktopClock clock;
85
86 bool in_transition : 1;
87 bool locked : 1;
88
89 FuriSemaphore* animation_semaphore;
90};
91
92Desktop* desktop_alloc(void);
93
94void desktop_free(Desktop* desktop);
95void desktop_lock(Desktop* desktop);
96void desktop_unlock(Desktop* desktop);
97void desktop_set_dummy_mode_state(Desktop* desktop, bool enabled);
98void desktop_set_stealth_mode_state(Desktop* desktop, bool enabled);
GUI: main API.
GUI: Popup view module API.
GUI: SceneManager API.
Definition animation_manager.c:34
Definition desktop_i.h:38
Definition desktop_view_debug.h:11
Definition desktop_i.h:44
Definition desktop_view_lock_menu.h:12
Definition desktop_view_main.c:11
Definition desktop_settings.h:64
Definition desktop_view_slideshow.c:11
Definition desktop_view_locked.c:26
Definition desktop_view_pin_input.c:17
Definition desktop_view_pin_timeout.c:12
Definition pubsub.c:14
Definition pubsub.c:7
Definition semaphore.c:8
Definition thread.c:32
Definition timer.c:8
Gui structure.
Definition gui_i.h:47
Definition loader_i.h:16
Definition notification_app.h:48
Definition popup.c:5
Definition scene_manager_i.h:17
Definition view_dispatcher_i.h:16
Definition view_port_i.h:11
Definition view_stack.c:13
GUI: ViewDispatcher API.
GUI: ViewStack API.