5
#include <Nux/BaseWindow.h>
6
#include "LauncherIcon.h"
7
#include "NuxGraphics/IOpenGLAsmShader.h"
8
#include "Nux/TimerProc.h"
12
class Launcher : public nux::View
15
Launcher(NUX_FILE_LINE_PROTO);
18
virtual long ProcessEvent(nux::IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
19
virtual void Draw(nux::GraphicsContext& GfxContext, bool force_draw);
20
virtual void DrawContent(nux::GraphicsContext& GfxContext, bool force_draw);
21
virtual void PostDraw(nux::GraphicsContext& GfxContext, bool force_draw);
23
LauncherIcon* GetActiveTooltipIcon() {return m_ActiveTooltipIcon;}
24
LauncherIcon* GetActiveMenuIcon() {return m_ActiveMenuIcon;}
26
bool TooltipNotify(LauncherIcon* Icon);
27
bool MenuNotify(LauncherIcon* Icon);
29
void SetIconSize(int tile_size, int icon_size, nux::BaseWindow *parent);
30
void NotifyMenuTermination(LauncherIcon* Icon);
32
void SetModel (LauncherModel *model);
34
virtual void RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags);
35
virtual void RecvMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags);
36
virtual void RecvMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
37
virtual void RecvMouseEnter(int x, int y, unsigned long button_flags, unsigned long key_flags);
38
virtual void RecvMouseLeave(int x, int y, unsigned long button_flags, unsigned long key_flags);
39
virtual void RecvMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
40
virtual void RecvMouseWheel(int x, int y, int wheel_delta, unsigned long button_flags, unsigned long key_flags);
54
} LauncherActionState;
56
void OnIconAdded (void *icon_pointer);
57
void OnIconRemoved (void *icon_pointer);
58
void OnOrderChanged ();
61
void OnIconNeedsRedraw (void *icon);
63
void FoldingCallback(void* v);
64
void RevealCallback(void* v);
66
void RenderIcon (nux::GraphicsContext& GfxContext, LauncherIcon* launcher_view);
67
void RenderIconImage(nux::GraphicsContext& GfxContext, LauncherIcon* launcher_view);
68
void UpdateIconXForm ();
69
LauncherIcon* MouseIconIntersection (int x, int y);
71
void MouseDownLogic ();
74
void SlideDown(float stepy, int mousedy);
75
void SlideUp(float stepy, int mousedy);
77
virtual void PreLayoutManagement();
78
virtual long PostLayoutManagement(long LayoutResult);
79
virtual void PositionChildLayout(float offsetX, float offsetY);
81
void OrderRevealedIcons();
82
void OrderFoldedIcons(int FocusIconIndex);
83
void ScheduleRevealAnimation ();
84
void ScheduleFoldAnimation ();
86
nux::HLayout* m_Layout;
89
LauncherIcon* m_ActiveTooltipIcon;
90
LauncherIcon* m_ActiveMenuIcon;
94
float _timer_intervals;
95
int _space_between_icons;
98
float _neg_folded_angle;
99
float _folded_z_distance;
100
float _launcher_top_y;
101
float _launcher_bottom_y;
102
LauncherState _launcher_state;
103
LauncherActionState _launcher_action_state;
104
LauncherIcon* _icon_under_mouse;
105
LauncherIcon* _icon_mouse_down;
107
int _icon_image_size;
108
int _icon_image_size_delta;
109
nux::BaseTexture* _icon_bkg_texture;
110
nux::BaseTexture* _icon_outline_texture;
114
nux::TimerFunctor* _folding_functor;
115
nux::TimerHandle _folding_timer_handle;
116
nux::TimerFunctor* _reveal_functor;
117
nux::TimerHandle _reveal_timer_handle;
119
nux::Matrix4 _view_matrix;
120
nux::Matrix4 _projection_matrix;
121
nux::Point2 _mouse_position;
122
nux::IntrusiveSP<nux::IOpenGLShaderProgram> _shader_program_uv_persp_correction;
123
nux::IntrusiveSP<nux::IOpenGLAsmShaderProgram> _AsmShaderProg;
124
nux::BaseTexture* m_RunningIndicator;
125
nux::BaseTexture* m_ActiveIndicator;
126
nux::AbstractPaintLayer* m_BackgroundLayer;
127
LauncherModel* _model;