1#ifndef WALLPAPERENGINE_H
2#define WALLPAPERENGINE_H
40 const QMap<QString, WallPaperEngine::SwitchingMode>
mappings = {
72 throw std::runtime_error(
"Invalid Name");
74 return finder.value();
79 static constexpr unsigned int SWITCH_INTERVAL = 20000;
80 static constexpr unsigned int ANIMATION_DURATION = 2000;
210 QWidget* shoule_be_lower;
211 QLabel* wallpaperLabel {
nullptr };
212 QLabel* bufferpaperLabel {
nullptr };
213 QTimer* invoke_switch_timer;
214 QStringList image_lists;
219 void process_internal_timer_hook();
224 void default_behaviour_of_flush();
227 int animation_durations { ANIMATION_DURATION };
228 QEasingCurve curve { QEasingCurve::InOutCubic };
DesktopMainWindow is the main frontend window of the application. For beginners, this is the starting...
Definition desktopmainwindow.h:33
Engine managing desktop wallpaper switching and animations.
Definition WallPaperEngine.h:20
void fallback_empty_session()
Handles fallback behavior when no wallpaper images are available.
Definition WallPaperEngine.cpp:107
QEasingCurve get_easingcurve() const
get_easingcurve
Definition WallPaperEngine.cpp:99
int animation_speed() const
Gets the current animation speed duration.
Definition WallPaperEngine.h:125
int switch_interval() const
Gets the current wallpaper switch interval.
Definition WallPaperEngine.cpp:41
void reset_defaults()
Resets all settings to default values.
Definition WallPaperEngine.cpp:92
void imagelist_changed(const QStringList &l)
Signal emitted when the wallpaper image list changes.
void process_resize(DesktopMainWindow *window)
Handles resizing events, adjusting wallpaper display accordingly.
Definition WallPaperEngine.cpp:31
void set_animation_duration_second(int secs)
Sets the animation duration in seconds.
Definition WallPaperEngine.cpp:74
void wallpaperChanged(const QPixmap &pixmap)
Signal emitted when the wallpaper pixmap changes.
void set_animation_speed(int msspeed)
Sets the animation speed duration in milliseconds.
Definition WallPaperEngine.h:119
void set_switch_interval(int new_interval)
Sets the interval between wallpaper switches.
Definition WallPaperEngine.cpp:37
void set_image_list(const QStringList &l)
Sets the list of wallpaper image file paths.
Definition WallPaperEngine.cpp:86
SwitchingMode current_mode() const
Gets the current switching mode.
Definition WallPaperEngine.h:143
struct WallPaperEngine::ModeMapping modeMappings
mode mappings for the string <=> mode transfer
void set_easingcurve(const QEasingCurve curveType)
set_easingcurve
Definition WallPaperEngine.cpp:103
SwitchingMode
Enum for wallpaper switching modes.
Definition WallPaperEngine.h:27
@ Fixed
Fixed wallpaper without switching.
@ Movement
Wallpaper switches with movement animation.
@ Gradient
Wallpaper switches with gradient effect.
QPixmap get_current_pixmap() const
Retrieves the currently displayed wallpaper pixmap.
Definition WallPaperEngine.cpp:60
int duration_seconds() const
Gets the animation duration in seconds.
Definition WallPaperEngine.cpp:78
WallPaperEngine()=delete
Deleted default constructor.
void set_showing_pictures(const QPixmap &map)
Sets the pixmap currently showing as wallpaper.
Definition WallPaperEngine.cpp:69
void set_mode(const SwitchingMode mode)
Sets the wallpaper switching mode.
Definition WallPaperEngine.cpp:45
QStringList & get_image_list()
Returns a reference to the wallpaper image file path list.
Definition WallPaperEngine.cpp:82
The WallPaperAnimationHandler class is the animation holder for the wallpaper, it is used to animate ...
Definition wallpaperanimationhandler.h:15
Helper struct for mapping between mode names and enum values.
Definition WallPaperEngine.h:36
QStringList values() const
Returns all mode names as a QStringList.
Definition WallPaperEngine.h:50
QString toString(const WallPaperEngine::SwitchingMode mode)
Converts a SwitchingMode enum to its string representation.
Definition WallPaperEngine.h:59
WallPaperEngine::SwitchingMode fromString(const QString &l)
Converts a string name to the corresponding SwitchingMode enum.
Definition WallPaperEngine.h:69
const QMap< QString, WallPaperEngine::SwitchingMode > mappings
Mapping from string names to SwitchingMode values.
Definition WallPaperEngine.h:40