2 \file GUIRESIZEControl.h
6 #ifndef GUILIB_GUIRESIZECONTROL_H
7 #define GUILIB_GUIRESIZECONTROL_H
12 * Copyright (C) 2005-2013 Team XBMC
15 * This Program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
20 * This Program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with XBMC; see the file COPYING. If not, see
27 * <http://www.gnu.org/licenses/>.
31 #include "GUITexture.h"
32 #include "GUIControl.h"
34 #define DIRECTION_NONE 0
35 #define DIRECTION_UP 1
36 #define DIRECTION_DOWN 2
37 #define DIRECTION_LEFT 3
38 #define DIRECTION_RIGHT 4
44 class CGUIResizeControl : public CGUIControl
47 CGUIResizeControl(int parentID, int controlID,
48 float posX, float posY, float width, float height,
49 const CTextureInfo& textureFocus, const CTextureInfo& textureNoFocus);
51 virtual ~CGUIResizeControl(void);
52 virtual CGUIResizeControl *Clone() const { return new CGUIResizeControl(*this); };
54 virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
55 virtual void Render();
56 virtual bool OnAction(const CAction &action);
58 virtual void OnDown();
59 virtual void OnLeft();
60 virtual void OnRight();
61 virtual void AllocResources();
62 virtual void FreeResources(bool immediately = false);
63 virtual void DynamicResourceAlloc(bool bOnOff);
64 virtual void SetInvalid();
65 virtual void SetPosition(float posX, float posY);
66 void SetLimits(float x1, float y1, float x2, float y2);
67 virtual bool CanFocus() const { return true; };
70 virtual EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event);
71 virtual bool UpdateColors();
72 bool SetAlpha(unsigned char alpha);
73 void UpdateSpeed(int nDirection);
74 void Resize(float x, float y);
75 CGUITexture m_imgFocus;
76 CGUITexture m_imgNoFocus;
77 unsigned int m_frameCounter;
78 unsigned int m_lastMoveTime;
83 float m_fAcceleration;
84 float m_x1, m_x2, m_y1, m_y2;