Loading...
Searching...
No Matches
desktop_i.h
1#pragma once
2
3#include "desktop.h"
4#include "desktop_settings.h"
5
6#include "animations/animation_manager.h"
7#include "views/desktop_view_pin_timeout.h"
8#include "views/desktop_view_pin_input.h"
9#include "views/desktop_view_locked.h"
10#include "views/desktop_view_main.h"
11#include "views/desktop_view_lock_menu.h"
12#include "views/desktop_view_debug.h"
13#include "views/desktop_view_slideshow.h"
14
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 FuriThread* scene_thread;
46
47 Gui* gui;
48 ViewDispatcher* view_dispatcher;
49 SceneManager* scene_manager;
50
51 Popup* popup;
52 DesktopLockMenuView* lock_menu;
53 DesktopDebugView* debug_view;
54 DesktopViewLocked* locked_view;
55 DesktopMainView* main_view;
56 DesktopViewPinTimeout* pin_timeout_view;
57 DesktopSlideshowView* slideshow_view;
58 DesktopViewPinInput* pin_input_view;
59
60 ViewStack* main_view_stack;
61 ViewStack* locked_view_stack;
62
63 ViewPort* lock_icon_viewport;
64 ViewPort* dummy_mode_icon_viewport;
65 ViewPort* clock_viewport;
66 ViewPort* stealth_mode_icon_viewport;
67
68 Loader* loader;
69 Storage* storage;
70 NotificationApp* notification;
71
72 FuriPubSub* status_pubsub;
73 FuriPubSub* input_events_pubsub;
74 FuriPubSubSubscription* input_events_subscription;
75
76 FuriTimer* auto_lock_timer;
77 FuriTimer* update_clock_timer;
78
79 AnimationManager* animation_manager;
80 FuriSemaphore* animation_semaphore;
81
82 DesktopClock clock;
83 DesktopSettings settings;
84
85 bool in_transition;
86 bool app_running;
87 bool locked;
88};
89
90void desktop_lock(Desktop* desktop);
91void desktop_unlock(Desktop* desktop);
92void desktop_set_dummy_mode_state(Desktop* desktop, bool enabled);
93void 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:25
Definition desktop_view_slideshow.c:11
Definition desktop_view_locked.c:25
Definition desktop_view_pin_input.c:19
Definition desktop_view_pin_timeout.c:8
Definition pubsub.c:14
Definition pubsub.c:7
Definition semaphore.c:15
Definition thread.c:33
Definition timer.c:9
Gui structure.
Definition gui_i.h:47
Definition loader_i.h:16
Definition notification_app.h:49
Definition popup.c:5
Definition scene_manager_i.h:17
Definition storage_i.h:23
Definition view_dispatcher_i.h:16
Definition view_port_i.h:11
Definition view_stack.c:13
GUI: ViewDispatcher API.
GUI: ViewStack API.