Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

sdlwindow.h

Go to the documentation of this file.
00001 /*
00002     ParaGUI - crossplatform widgetset
00003     Copyright (C) 2000  Alexander Pipelka
00004  
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009  
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014  
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  
00019     Alexander Pipelka
00020     pipelka@teleweb.at
00021  
00022     Last Update:      $Author: pipelka $
00023     Update Date:      $Date: 2001/01/31 17:23:17 $
00024     Source File:      $Source: /usr/local/CVSROOT/linux/paragui/doc/html/sdlwindow_h-source.html,v $
00025     CVS/RCS Revision: $Revision: 1.34 $
00026     Status:           $State: Exp $
00027 */
00028 
00029 #ifndef SDLWINDOW_H
00030 #define SDLWINDOW_H
00031 
00032 #ifdef SWIG
00033 %include "swigcommon.h"
00034 %module sdlwindow
00035 %{
00036 #include "sdlwindow.h"
00037 %}
00038 #endif
00039 
00040 #include "sdlgradientwidget.h"
00041 #include "sdlbutton.h"
00042 
00051 /* Should this even exist? It would be much better for people to create a whole
00052  * new 'real' window, than little fake ones that can't be moves from the current
00053  * window (and move really slowly too :) ). Non-window-manager environments
00054  * may have to be considered though :/
00055  */
00056 
00057 class DECLSPEC SDLWindow : public SDLGradientWidget  {
00058 public:
00059     
00061     SDLWindow(SDLWidget* parent, SDL_Rect& r, char* windowtext);
00062     
00064     ~SDLWindow();
00065 
00066     void LoadThemeStyle(const char* widgettype);
00067 
00068     void SetColorTitlebar(Uint32 color);
00069     
00070 protected:
00071 
00073     void eventDraw(SDL_Surface* surface, SDL_Rect* rect);
00074     
00076     void eventSizeWindow(int w, int h);
00077     
00079     bool eventButtonClick(int id, SDLWidget* widget);
00080 
00082     bool eventMouseButtonDown(const SDL_MouseButtonEvent* button);
00083 
00085     bool eventMouseButtonUp(const SDL_MouseButtonEvent* button);
00086     
00088     bool eventMouseMotion(const SDL_MouseMotionEvent* motion);
00089 
00090 private:
00091 
00092     SDL_Rect my_rectTitlebar;
00093     SDL_Surface* my_srfTitlebar;
00094     SDL_Gradient my_gradientTitlebar;
00095     SDL_Color my_colorTitlebar;
00096     char my_text[255];
00097     Uint8 my_heightTitlebar;
00098     SDL_Surface* my_backgroundTitlebar;
00099     int my_backmodeTitlebar;
00100     int my_blendTitlebar;
00101     int my_bordersizeTitlebar;
00102     
00103     SDLButton* my_buttonClose;
00104     bool my_moveMode;
00105     Uint8 my_moveTransparency;
00106     SDL_Point my_moveDelta;
00107 
00108 private: // disable the copy operators
00109     SDLWindow(const SDLWindow&);
00110     SDLWindow& operator=(const SDLWindow&);
00111 };
00112 
00113 #endif // SDLWINDOW_H