Logo
  • Main Page
  • Related Pages
  • Modules
  • Classes
  • Files

mmswindow.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005-2007 Stefan Schwarzer, Jens Schneider,             *
00003  *                           Matthias Hardt, Guido Madaus                  *
00004  *                                                                         *
00005  *   Copyright (C) 2007-2008 BerLinux Solutions GbR                        *
00006  *                           Stefan Schwarzer & Guido Madaus               *
00007  *                                                                         *
00008  *   Copyright (C) 2009-2013 BerLinux Solutions GmbH                       *
00009  *                                                                         *
00010  *   Authors:                                                              *
00011  *      Stefan Schwarzer   <stefan.schwarzer@diskohq.org>,                 *
00012  *      Matthias Hardt     <matthias.hardt@diskohq.org>,                   *
00013  *      Jens Schneider     <jens.schneider@diskohq.org>,                   *
00014  *      Guido Madaus       <guido.madaus@diskohq.org>,                     *
00015  *      Patrick Helterhoff <patrick.helterhoff@diskohq.org>,               *
00016  *      René Bählkow       <rene.baehlkow@diskohq.org>                     *
00017  *                                                                         *
00018  *   This library is free software; you can redistribute it and/or         *
00019  *   modify it under the terms of the GNU Lesser General Public            *
00020  *   License version 2.1 as published by the Free Software Foundation.     *
00021  *                                                                         *
00022  *   This library is distributed in the hope that it will be useful,       *
00023  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00024  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00025  *   Lesser General Public License for more details.                       *
00026  *                                                                         *
00027  *   You should have received a copy of the GNU Lesser General Public      *
00028  *   License along with this library; if not, write to the                 *
00029  *   Free Software Foundation, Inc.,                                       *
00030  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
00031  **************************************************************************/
00032 
00033 #ifndef MMSWINDOW_H_
00034 #define MMSWINDOW_H_
00035 
00036 #include "mmsgui/mmswidget.h"
00037 #include "mmsgui/mmswindowaction.h"
00038 #include "mmsgui/mmsimagemanager.h"
00039 #include "mmsgui/mmsfontmanager.h"
00040 #include "mmsgui/mmsfbmanager.h"
00041 #include "mmsgui/interfaces/immswindowmanager.h"
00042 #include "mmstools/mmsmutex.h"
00043 #include "mmstools/mmspulser.h"
00044 
00045 // support old renamed methods
00046 #define searchForWindow     findWindow
00047 #define searchForWidget     findWidget
00048 #define searchForWidgetType findWidgetType
00049 
00050 //! The available types of windows.
00051 typedef enum {
00052     /*!
00053     Main windows will be displayed over the root window.
00054     Only one main window can be shown at the same time.
00055     If a main window appears the currently shown main window will be disappear.
00056     */
00057     MMSWINDOWTYPE_MAINWINDOW = 0,
00058     /*!
00059     Popup windows will be displayed over root and main windows.
00060     The popup window which appears finally is on the top of the screen.
00061     */
00062     MMSWINDOWTYPE_POPUPWINDOW,
00063     /*!
00064     Root windows will be displayed in the background.
00065     Only one root window can be shown at the same time.
00066     If a root window appears the currently shown root window will be disappear.
00067     */
00068     MMSWINDOWTYPE_ROOTWINDOW,
00069     /*!
00070     Child windows are parts of main, popup and root windows.
00071     The full window functionality is given.
00072     */
00073     MMSWINDOWTYPE_CHILDWINDOW
00074 } MMSWINDOWTYPE;
00075 
00076 //! The available window flags.
00077 typedef enum {
00078     //! none
00079     MMSW_NONE               = 0x00000000,
00080     //! The window displays a video stream and should be on the video layer if it exists.
00081     MMSW_VIDEO              = 0x00000001,
00082     //! The window should use the graphics layer.
00083     MMSW_USEGRAPHICSLAYER   = 0x00000002
00084 } MMSWINDOW_FLAGS;
00085 
00086 class MMSChildWindow;
00087 
00088 //! current mode of the pulser
00089 typedef enum {
00090     //! show action
00091     MMSWINDOW_PULSER_MODE_SHOW = 0,
00092     //! hide action
00093     MMSWINDOW_PULSER_MODE_HIDE
00094 } MMSWINDOW_PULSER_MODE;
00095 
00096 //! This class is the base class for all windows.
00097 /*!
00098 This class includes the base functionality available for all windows within MMSGUI.
00099 This class cannot be constructed. Only windows which are derived from this class can be constructed.
00100 \author Jens Schneider
00101 */
00102 class MMSWindow {
00103     private:
00104 
00105         //! describes a child window
00106         typedef struct {
00107             //! points to the child window
00108             MMSWindow       *window;
00109             //! region of the window within parent window
00110             MMSFBRegion     region;
00111             //! opacity of the window
00112             unsigned char   opacity;
00113             //! old opacity of the window
00114             unsigned char   oldopacity;
00115             //! save the last focused widget here
00116             unsigned int    focusedWidget;
00117             //! special blit done
00118             bool            special_blit;
00119         } CHILDWINS;
00120 
00121         //! status area for the arrow widgets
00122         typedef struct {
00123             //! currently navigate up is possible?
00124             bool up;
00125             //! currently navigate down is possible?
00126             bool down;
00127             //! currently navigate left is possible?
00128             bool left;
00129             //! currently navigate right is possible?
00130             bool right;
00131         } ARROW_WIDGET_STATUS;
00132 
00133         //! type of the window
00134         MMSWINDOWTYPE type;
00135 
00136         //! access to the theme which is used
00137         MMSTheme            *theme;
00138 
00139         //! base attributes of the window
00140         /*!
00141         This can be initialization values from theme.cpp
00142         or from theme.xml (NOT a <class/> definition, but e.g. tag <mainwindow/>).
00143         */
00144         MMSWindowClass      *baseWindowClass;
00145 
00146         //! attributes set by <class/> tag in theme.xml
00147         /*!
00148         Is NULL, if window has no theme class definition.
00149         Attributes set here, prevails over attributes from baseWindowClass.
00150         */
00151         MMSWindowClass      *windowClass;
00152 
00153         //! attributes of the window which will be set during the runtime
00154         /*!
00155         The runtime attributes set here (e.g. window->setAlignment(...) ), prevails over attributes
00156         from windowClass and baseWindowClass.
00157         */
00158         MMSWindowClass      myWindowClass;
00159 
00160         //! window creation flags
00161         MMSWINDOW_FLAGS     flags;
00162 
00163         //! to make it thread-safe :)
00164         MMSMutex            Lock;
00165 
00166         //! save the id of the thread which has locked the window
00167         unsigned long       TID;
00168 
00169         //! count the number of times the thread has call lock() because it is not a problem, that the same thread calls lock() several times
00170         unsigned long       Lock_cnt;
00171 
00172         //! special draw lock
00173         MMSMutex            drawLock;
00174 
00175         //! special flip lock
00176         MMSMutex            flipLock;
00177 
00178         //! lock the pre-calculation of the navigation
00179         MMSMutex            preCalcNaviLock;
00180 
00181         //! is window initialized?
00182         bool                initialized;
00183 
00184         //! pre-calc navigation done?
00185         bool                precalcnav;
00186 
00187         //! name of the window
00188         string              name;
00189 
00190         //! parent window (if window is a child window) or NULL
00191         MMSWindow           *parent;
00192 
00193         //! toplevel parent window (if window is a child window) or NULL
00194         MMSWindow           *toplevel_parent;
00195 
00196         //! image manager for the window (layer 1)
00197         static MMSImageManager  *im1;
00198 
00199         //! layer for im1
00200         static MMSFBLayer       *im1_layer;
00201 
00202         //! image manager for the window (layer 2)
00203         static MMSImageManager  *im2;
00204 
00205         //! layer for im2
00206         static MMSFBLayer       *im2_layer;
00207 
00208         //! image manager for the window
00209         MMSImageManager     *im;
00210 
00211         //! font manager for the window
00212         static MMSFontManager   *fm;
00213 
00214         //! window action thread (used for animations)
00215         MMSWindowAction     *action;
00216 
00217         //! background image
00218         MMSFBSurface        *bgimage;
00219 
00220         //! background image set by application
00221         bool                bgimage_from_external;
00222 
00223         //! border images
00224         MMSFBSurface        *borderimages[MMSBORDER_IMAGE_NUM_SIZE];
00225 
00226         //! border geometry
00227         MMSFBRectangle      bordergeom[MMSBORDER_IMAGE_NUM_SIZE];
00228 
00229         //! border geometry set?
00230         bool                bordergeomset;
00231 
00232         //! access to the MMSFBLayer on which the window has to be displayed
00233         MMSFBLayer          *layer;
00234 
00235         //! a full screen MMSFBWindow as buffer for all MMSRootWindow objects with own_surface=false
00236         static MMSFBWindow  *fullscreen_root_window;
00237 
00238         //! use count for fullscreen_root_window
00239         static int          fullscreen_root_window_use_count;
00240 
00241         //! a full screen MMSFBWindow as buffer for all MMSMainWindow objects with own_surface=false
00242         static MMSFBWindow  *fullscreen_main_window;
00243 
00244         //! use count for fullscreen_main_window
00245         static int          fullscreen_main_window_use_count;
00246 
00247         //! access to the MMSFBWindow which is behind of this class
00248         MMSFBWindow         *window;
00249 
00250         //! access to the MMSFBSurface of the window
00251         MMSFBSurface        *surface;
00252 
00253         //! visible screen area (that means the visible area e.g. on the TV set), see the initialization of the MMSWindowManager
00254         MMSFBRectangle      vrect;
00255 
00256         //! x-movement of the window based on the alignment attribute
00257         int                 dxpix;
00258 
00259         //! y-movement of the window based on the alignment attribute
00260         int                 dypix;
00261 
00262         //! geometry of the window based on the margin attribute
00263         MMSFBRectangle        geom;
00264 
00265         //! inner geometry of the window based on the border margin attribute
00266         MMSFBRectangle        innerGeom;
00267 
00268         //! check and recalc the geometry of the widgets during the next draw()?
00269         bool                draw_setgeom;
00270 
00271         //! widgets of the window
00272         vector<MMSWidget *> children;
00273 
00274         //! focused widget or NULL
00275         MMSWidget           *focusedwidget;
00276 
00277         //! is window shown?
00278         bool                shown;
00279 
00280         //! is show animation running?
00281         bool                willshow;
00282 
00283         //! is hide animation running?
00284         bool                willhide;
00285 
00286         //! focus set the first time?
00287         bool                firstfocusset;
00288 
00289         //! child windows of the window
00290         vector<CHILDWINS>   childwins;
00291 
00292         //! focused child window
00293         unsigned int        focusedChildWin;
00294 
00295         //! widget which has to be selected if it is possible to navigate up
00296         MMSWidget           *upArrowWidget;
00297 
00298         //! widget which has to be selected if it is possible to navigate down
00299         MMSWidget           *downArrowWidget;
00300 
00301         //! widget which has to be selected if it is possible to navigate left
00302         MMSWidget           *leftArrowWidget;
00303 
00304         //! widget which has to be selected if it is possible to navigate right
00305         MMSWidget           *rightArrowWidget;
00306 
00307         //! up/down/left/right arrow widgets updated the first time?
00308         bool                initialArrowsDrawn;
00309 
00310         //! child window which is to be focused if user navigates up
00311         MMSWindow           *navigateUpWindow;
00312 
00313         //! child window which is to be focused if user navigates down
00314         MMSWindow           *navigateDownWindow;
00315 
00316         //! child window which is to be focused if user navigates left
00317         MMSWindow           *navigateLeftWindow;
00318 
00319         //! child window which is to be focused if user navigates right
00320         MMSWindow           *navigateRightWindow;
00321 
00322         //! widget on which the user has pressed the (mouse) button
00323         MMSWidget           *buttonpress_widget;
00324 
00325         //! child window on which the user has pressed the (mouse) button
00326         MMSWindow           *buttonpress_childwin;
00327 
00328         //! window will be stretched to the layer or the parent window using stretchBlit(), default is false
00329         bool                stretchmode;
00330 
00331         //! stretch the window to X percent of the window WIDTH to the left side
00332         //! the value is valid, if window is in stretch mode
00333         //! a value of 25600 means 100% (normal blit() will be used)
00334         int                 stretchLeft;
00335 
00336         //! stretch the window to X percent of the window HEIGHT to the up side
00337         //! the value is valid, if window is in stretch mode
00338         //! a value of 25600 means 100% (normal blit() will be used)
00339         int                 stretchUp;
00340 
00341         //! stretch the window to X percent of the window WIDTH to the right side
00342         //! the value is valid, if window is in stretch mode
00343         //! a value of 25600 means 100% (normal blit() will be used)
00344         int                 stretchRight;
00345 
00346         //! stretch the window to X percent of the window HEIGHT to the down side
00347         //! the value is valid, if window is in stretch mode
00348         //! a value of 25600 means 100% (normal blit() will be used)
00349         int                 stretchDown;
00350 
00351 
00352         //! index in childwins vector for the first window with the always on top flag
00353         unsigned int        always_on_top_index;
00354 
00355 
00356         //! Pulser for e.g. fade/move animations during show/hide
00357         MMSPulser               pulser;
00358 
00359         //! connection object for MMSPulser::onBeforeAnimation callback
00360         sigc::connection        onBeforeAnimation_connection;
00361 
00362         //! connection object for MMSPulser::onAnimation callback
00363         sigc::connection        onAnimation_connection;
00364 
00365         //! connection object for MMSPulser::onAfterAnimation callback
00366         sigc::connection        onAfterAnimation_connection;
00367 
00368         //! current pulser mode
00369         MMSWINDOW_PULSER_MODE   pulser_mode;
00370 
00371 
00372         unsigned int    anim_opacity;
00373         MMSFBRectangle  anim_rect;
00374         bool            anim_fade;
00375         MMSDIRECTION    anim_move;
00376         unsigned int    anim_opacity_step;
00377         int             anim_move_step;
00378 
00379 
00380         bool            need_redraw;
00381 
00382         int zbaselevel;
00383 
00384 
00385         //! Internal method: Creates the window.
00386         bool create(string dx, string dy, string w, string h, MMSALIGNMENT alignment, MMSWINDOW_FLAGS flags,
00387                     bool *own_surface, bool *backbuffer);
00388 
00389         //! Internal method: Creates the window.
00390         bool create(string w, string h, MMSALIGNMENT alignment, MMSWINDOW_FLAGS flags,
00391                     bool *own_surface, bool *backbuffer);
00392 
00393         //! Internal method: Resize the window.
00394         bool resize(bool refresh = true);
00395 
00396         //! Internal method: Add a child window.
00397         bool addChildWindow(MMSWindow *childwin);
00398 
00399         //! Internal method: Remove a child window.
00400         bool removeChildWindow(MMSWindow *childwin);
00401 
00402         //! Internal method: Set the opacity of a child window.
00403         bool setChildWindowOpacity(MMSWindow *childwin, unsigned char opacity, bool refresh = true);
00404 
00405         //! Internal method: Set the region of a child window.
00406         bool setChildWindowRegion(MMSWindow *childwin, bool refresh = true);
00407 
00408         //! Internal method: Move a child window.
00409         bool moveChildWindow(MMSWindow *childwin, int x, int y, bool refresh = true);
00410 
00411         //! Internal method: Draw a child window.
00412         void drawChildWindows(MMSFBSurface *dst_surface, MMSFBRegion *region = NULL, int offsX = 0, int offsY = 0);
00413 
00414         //! Internal method: Flip a window.
00415         bool flipWindow(MMSWindow *win = NULL, MMSFBRegion *region = NULL,
00416                         MMSFBFlipFlags flags = MMSFB_FLIP_NONE,
00417                         bool flipChildSurface = true, bool locked = false);
00418 
00419         //! Internal method: Remove the focus from a child window.
00420         void removeFocusFromChildWindow();
00421 
00422         //! Internal method: Load widgets for up/down/left/right arrows.
00423         void loadArrowWidgets();
00424 
00425         //! Internal method: Get the navigation status. With this infos we can select/unselect the arrow widgets.
00426         void getArrowWidgetStatus(ARROW_WIDGET_STATUS *setarrows);
00427 
00428         //! Internal method: Update the status of the arrow widgets.
00429         void switchArrowWidgets();
00430 
00431         //! Internal method: Init navigation.
00432         bool initnav();
00433 
00434         //! Internal method: Load images and setup other things.
00435         virtual bool init();
00436 
00437         //! Internal method: Release images and other things.
00438         virtual bool release();
00439 
00440         //! Internal method: Draw me.
00441         virtual void draw(bool toRedrawOnly = false, MMSFBRectangle *rect2update = NULL,
00442                           bool clear = true, unsigned char opacity = 255);
00443 
00444 
00445         //! tbd
00446         bool buffered_shown;
00447 
00448         //! tbd
00449         void showBufferedShown();
00450 
00451 
00452         //! Internal method: Draw my border.
00453         void drawMyBorder(unsigned char opacity = 255);
00454 
00455         //! Internal method: Focus one widget/child window for the first time.
00456         bool setFirstFocus(bool cw = false);
00457 
00458         //! Internal method: Used to find best candidate to navigate up from currPos.
00459         double calculateDistGradCode_Up(MMSFBRectangle currPos, MMSFBRectangle candPos);
00460 
00461         //! Internal method: Used to find best candidate to navigate down from currPos.
00462         double calculateDistGradCode_Down(MMSFBRectangle currPos, MMSFBRectangle candPos);
00463 
00464         //! Internal method: Used to find best candidate to navigate left from currPos.
00465         double calculateDistGradCode_Left(MMSFBRectangle currPos, MMSFBRectangle candPos);
00466 
00467         //! Internal method: Used to find best candidate to navigate right from currPos.
00468         double calculateDistGradCode_Right(MMSFBRectangle currPos, MMSFBRectangle candPos);
00469 
00470         //! Internal method: Handle widget navigation (up/down/left/right).
00471         bool handleNavigationForWidgets(MMSInputEvent *inputevent);
00472 
00473         //! Internal method: Remove the focus from the currently focused child window. Goal: Change status of widgets.
00474         void removeChildWinFocus();
00475 
00476         //! Internal method: Restore the focus to the currently focused child window. Goal: Change status of widgets.
00477         bool restoreChildWinFocus(MMSInputEvent *inputevent = NULL);
00478 
00479         //! Internal method: Handle child window navigation (up/down/left/right).
00480         bool handleNavigationForChildWins(MMSInputEvent *inputevent);
00481 
00482         //! Internal method: Do the pre-calculation of the navigation routes.
00483         void preCalcNavigation();
00484 
00485         //! Internal method: Lock the window. Will be used by the widgets.
00486         void lock();
00487 
00488         //! Internal method: Unlock the window. Will be used by the widgets.
00489         void unlock();
00490 
00491         bool onBeforeAnimation(MMSPulser *pulser);
00492         bool onAnimation(MMSPulser *pulser);
00493         void onAfterAnimation(MMSPulser *pulser);
00494 
00495         virtual bool beforeShowAction(MMSPulser *pulser);
00496         virtual bool showAction(MMSPulser *pulser);
00497         virtual void afterShowAction(MMSPulser *pulser);
00498 
00499         virtual bool beforeHideAction(MMSPulser *pulser);
00500         virtual bool hideAction(MMSPulser *pulser);
00501         virtual void afterHideAction(MMSPulser *pulser);
00502 
00503 
00504         //! Internal method: Will be called from the MMSWindowAction thread if the window should disappear.
00505 //        virtual bool hideAction(bool *stopaction);
00506 
00507         //! Internal method: Refresh a part of a window. Will be used by the widgets.
00508         void refreshFromChild(MMSWidget *child, MMSFBRectangle *rect2update = NULL, bool check_shown = true);
00509 
00510         //! Internal method: Set the focused widget.
00511         void setFocusedWidget(MMSWidget *child, bool set, bool switchfocus = false, bool refresh = true);
00512 
00513         //! Internal method: Will be called by MMSInputManager if the window has the input focus.
00514         bool handleInput(MMSInputEvent *inputevent);
00515 
00516         //! Internal method: (Re-)calculate the position and size of all widgets.
00517         void recalculateChildren();
00518 
00519         //! Internal method: Show the window without animation.
00520         void instantShow();
00521 
00522         //! Internal method: Hide the window without animation.
00523         void instantHide();
00524 
00525         //! Internal method: Give window a recalculation hint used for next draw().
00526         void setWidgetGeometryOnNextDraw();
00527 
00528         //! Internal method: Inform the window, that the language has changed.
00529         void targetLangChanged(MMSLanguage lang, bool refresh = true);
00530 
00531         //! Internal method: Inform the window, that the theme has changed.
00532         void themeChanged(string &themeName, bool refresh = true);
00533 
00534     protected:
00535 
00536         //! interface to the window manager
00537         static class IMMSWindowManager  *windowmanager;
00538 
00539     public:
00540 
00541         //! The base constructor for all window types.
00542         /*! This will internally used by the supported window types/classes (see MMSWINDOWTYPE).
00543         */
00544         MMSWindow();
00545 
00546         //! The base destructor for this class.
00547         virtual ~MMSWindow();
00548 
00549         //! Get the type of the window.
00550         /*!
00551         \return type of the window
00552         */
00553         MMSWINDOWTYPE getType();
00554 
00555         //! Get the name of the window.
00556         /*!
00557         \return name of the window
00558         */
00559         string getName();
00560 
00561         //! Set the name of the window.
00562         /*!
00563         \param name     name of the window
00564         */
00565         void   setName(string name);
00566 
00567         //! Find a window over its name.
00568         /*!
00569         \param name     name of the window
00570         \return pointer to the MMSWindow object or NULL
00571         */
00572         MMSWindow* findWindow(string name);
00573 
00574         //! Return last window in the stack.
00575         /*!
00576         \return pointer to the MMSWindow object or NULL
00577         */
00578         MMSWindow* getLastWindow();
00579 
00580         //! Makes a window visible.
00581         /*!
00582         \return true if the show action successfully started
00583         \note The MMSWindowAction thread will be started here and show() returnes immediately!
00584         */
00585         virtual bool show();
00586 
00587         //! Hide a visible window.
00588         /*!
00589         \param goback   this parameter will be routed to the onHide callback, so the application can
00590                         decide which if and which window should appear afterwards
00591         \param wait     waiting until hideAction is finished?
00592         \return true if the hide action successfully started
00593         \note The MMSWindowAction thread will be started here and hide() returnes immediately if wait=false!
00594         */
00595         virtual bool hide(bool goback = false, bool wait = false);
00596 
00597         //! Can be called after show() waiting for end of showAction thread.
00598         void waitUntilShown();
00599 
00600         //! Can be called after hide() waiting for end of hideAction thread.
00601         void waitUntilHidden();
00602 
00603         //! Get the geometry of the window.
00604         /*!
00605         \return the rectangle of the window on the layer or parent window
00606         */
00607         MMSFBRectangle getGeometry();
00608 
00609         //! Get the geometry of the window based on the layer.
00610         /*!
00611         \return the rectangle of the window on the layer
00612         */
00613         MMSFBRectangle getRealGeometry();
00614 
00615         //! Add a widget to the window.
00616         /*!
00617         \param child    pointer to a widget
00618         */
00619         void add(MMSWidget *child);
00620 
00621         //! Remove a widget from the window.
00622         /*!
00623         \param child    pointer to a widget
00624         */
00625         void remove(MMSWidget *child);
00626 
00627         //! Get the currently focused widget.
00628         /*!
00629         \return pointer to the focused widget
00630         */
00631         MMSWidget *getFocusedWidget();
00632 
00633         //! Get the number of focusable widgets.
00634         /*!
00635         \param cw   go recursive through child windows if set to true
00636         \return number of focusable widgets
00637         */
00638         int getNumberOfFocusableWidgets(bool cw = false);
00639 
00640         //! Get the number of focusable child windows.
00641         /*!
00642         \return number of focusable child windows
00643         */
00644         int getNumberOfFocusableChildWins();
00645 
00646         //! Refresh (redraw) the whole window or a part of it.
00647         /*!
00648         It is possible to update window attributes without refresh.
00649         In this case you have to refresh() the window 'manually' to make the changes visible.
00650         \param region   region of the window which is to refresh, default NULL means the whole window
00651 
00652         For example you can call:
00653 
00654           a) setOpacity(100) and setBgColor(bgcolor)
00655 
00656          or
00657 
00658           b) setOpacity(100, false), setBgColor(bgcolor, false) and then refresh()
00659 
00660         With variant b) you have a better performance because only one refresh will be done.
00661 
00662         This works also for widgets. You can update a few widgets without direct refresh
00663         and call window->refresh() afterwards.
00664         */
00665         void refresh(MMSFBRegion *region = NULL);
00666 
00667         //! Flip the surface of the window to make changes visible.
00668         /*!
00669         \return true if successfully flipped
00670         \note You have to call this method ONLY, if you are drawing own things direct on the window surface!
00671         \note Please do NOT use this method within the 'normal' GUI context! There is NO need!
00672         \note If you want to flip, you can also use the flip() method of the MMSFBSurface. But this window flip method handles also childwindows.
00673         */
00674         bool flip(void);
00675 
00676         //! Get access to the layer of the window.
00677         /*!
00678         \return pointer to the MMSFBLayer object
00679         */
00680         MMSFBLayer *getLayer();
00681 
00682         //! Get access to the surface of the window needed to display video streams.
00683         /*!
00684         \return pointer to the surface class
00685         */
00686         MMSFBSurface *getSurface();
00687 
00688         //! Get the parent window.
00689         /*!
00690         \param toplevel     if true the toplevel parent will be returned
00691         \return pointer to the parent window or NULL if the window has no parent
00692         */
00693         MMSWindow *getParent(bool toplevel = false);
00694 
00695         //! Set the window manager.
00696         /*!
00697         \param wm   interface to the window manager
00698         */
00699         void setWindowManager(IMMSWindowManager *wm);
00700 
00701         //! Is the window shown?
00702         /*!
00703         \param checkparents     if true the parent(s) will be check too
00704         \param checkopacity     if true the opacity of window(s) will be check too
00705         \return true, if the window is shown
00706         */
00707         bool isShown(bool checkparents = false, bool checkopacity = false);
00708 
00709         //! Is the hide action running?
00710         /*!
00711         \return true, if the window action thread is going to hide the window
00712         */
00713         bool willHide();
00714 
00715         //! Set the focus to this window.
00716         void setFocus();
00717 
00718         //! Is the window focused?
00719         /*!
00720         \param checkparents     if true the parent(s) will be check too
00721         \return true, if the window is focused
00722         */
00723         bool getFocus(bool checkparents = false);
00724 
00725         //! Find a widget with a given name.
00726         /*!
00727         \param name     name of the widget
00728         \return pointer to the widget which was found or NULL
00729         */
00730         MMSWidget* findWidget(string name);
00731 
00732         //! Find a widget with a given type.
00733         /*!
00734         \param type     type of the widget
00735         \return pointer to the widget which was found or NULL
00736         */
00737         MMSWidget* findWidgetType(MMSWIDGETTYPE type);
00738 
00739         //! Find a widget with a given name and type.
00740         /*!
00741         Find a root widget with the given name. If the found widget has not the
00742         given type, then it searches for the given type under the root widget node.
00743         \param name     name of the widget
00744         \param type     type of the widget
00745         \return pointer to the widget which was found or NULL
00746         */
00747         MMSWidget* findWidgetAndType(string name, MMSWIDGETTYPE type);
00748 
00749         //! Operator [] which you can use to find a widget.
00750         /*!
00751         \param name     name of the widget
00752         \return pointer to the widget which was found or NULL
00753         \see findWidget()
00754         */
00755         MMSWidget* operator[](string name);
00756 
00757         //! Get the window to which the GUI navigates if the user press up.
00758         /*!
00759         \return pointer to the window or NULL
00760         */
00761         MMSWindow *getNavigateUpWindow();
00762 
00763         //! Get the window to which the GUI navigates if the user press down.
00764         /*!
00765         \return pointer to the window or NULL
00766         */
00767         MMSWindow *getNavigateDownWindow();
00768 
00769         //! Get the window to which the GUI navigates if the user press left.
00770         /*!
00771         \return pointer to the window or NULL
00772         */
00773         MMSWindow *getNavigateLeftWindow();
00774 
00775         //! Get the window to which the GUI navigates if the user press right.
00776         /*!
00777         \return pointer to the window or NULL
00778         */
00779         MMSWindow *getNavigateRightWindow();
00780 
00781         //! Set the window to which the GUI navigates if the user press up.
00782         /*!
00783         \param upWindow     pointer to the window or NULL
00784         */
00785         void setNavigateUpWindow(MMSWindow *upWindow);
00786 
00787         //! Set the window to which the GUI navigates if the user press down.
00788         /*!
00789         \param downWindow   pointer to the window or NULL
00790         */
00791         void setNavigateDownWindow(MMSWindow *downWindow);
00792 
00793         //! Set the window to which the GUI navigates if the user press left.
00794         /*!
00795         \param leftWindow   pointer to the window or NULL
00796         */
00797         void setNavigateLeftWindow(MMSWindow *leftWindow);
00798 
00799         //! Set the window to which the GUI navigates if the user press right.
00800         /*!
00801         \param rightWindow  pointer to the window or NULL
00802         */
00803         void setNavigateRightWindow(MMSWindow *rightWindow);
00804 
00805 
00806 
00807         bool raiseToTop(int zlevel = 0);
00808         bool lowerToBottom();
00809 
00810         bool moveTo(int x, int y, bool refresh = true);
00811 
00812 
00813 
00814 
00815         //! Stretch the window to the layer or the parent window using stretchBlit().
00816         /*!
00817         \param left     stretch the window to X percent of the window WIDTH to the left side,
00818                         a value of 100 means 100%
00819         \param up       stretch the window to X percent of the window HEIGHT to the up side,
00820                         a value of 100 means 100%
00821         \param right    stretch the window to X percent of the window WIDTH to the right side,
00822                         a value of 100 means 100%
00823         \param down     stretch the window to X percent of the window HEIGHT to the down side,
00824                         a value of 100 means 100%
00825         \return true, if the values are accepted
00826         \note Call stretch() or stretch(100, 100, 100, 100) to switch-of the stretch mode.
00827         \note The formulas (((left-100)+(right-100)+100) > 0) and (((up-100)+(down-100)+100) > 0)
00828               need to be met! Else nothing is to be displayed!
00829         \note This function was implemented to get cool effects. If you display windows permanently in
00830               stretch mode the performance will be drastically decreased.
00831         */
00832         bool stretch(double left = 100, double up = 100, double right = 100, double down = 100);
00833 
00834 
00835 
00836         //! Set one or more callbacks for the onBeforeShow event.
00837         /*!
00838         The connected callbacks will be called during show().
00839         If at least one of the callbacks returns false, the show process of the window
00840         will be stopped and the window will not appear.
00841 
00842         A callback method must be defined like this:
00843 
00844             bool myclass::mycallbackmethod(MMSWindow *win);
00845 
00846             \param win  is the pointer to the window which is to be shown
00847 
00848             \return true if the show process should continue, else false if the window should not appear
00849 
00850         To connect your callback to onBeforeShow do this:
00851 
00852             sigc::connection connection;
00853             connection = mywindow->onBeforeShow->connect(sigc::mem_fun(myobject,&myclass::mycallbackmethod));
00854 
00855         To disconnect your callback do this:
00856 
00857             connection.disconnect();
00858 
00859         Please note:
00860 
00861             You HAVE TO disconnect myobject from onBeforeShow BEFORE myobject will be deleted!!!
00862             Else an abnormal program termination can occur.
00863             You HAVE TO call the disconnect() method of sigc::connection explicitly. The destructor will NOT do this!!!
00864         */
00865         sigc::signal<bool, MMSWindow*>::accumulated<bool_accumulator> *onBeforeShow;
00866 
00867         //! Set one or more callbacks for the onAfterShow event.
00868         /*!
00869         The connected callbacks will be called during show().
00870 
00871         A callback method must be defined like this:
00872 
00873             void myclass::mycallbackmethod(MMSWindow *win, bool already_shown);
00874 
00875             \param win              is the pointer to the window which is shown now
00876             \param already_shown    the window was already shown?
00877 
00878         To connect your callback to onAfterShow do this:
00879 
00880             sigc::connection connection;
00881             connection = mywindow->onAfterShow->connect(sigc::mem_fun(myobject,&myclass::mycallbackmethod));
00882 
00883         To disconnect your callback do this:
00884 
00885             connection.disconnect();
00886 
00887         Please note:
00888 
00889             You HAVE TO disconnect myobject from onAfterShow BEFORE myobject will be deleted!!!
00890             Else an abnormal program termination can occur.
00891             You HAVE TO call the disconnect() method of sigc::connection explicitly. The destructor will NOT do this!!!
00892         */
00893         sigc::signal<void, MMSWindow*, bool> *onAfterShow;
00894 
00895         //! Set one or more callbacks for the onBeforeHide event.
00896         /*!
00897         The connected callbacks will be called during hide().
00898         If at least one of the callbacks returns false, the hide process of the window
00899         will be stopped and the window will not disappear.
00900 
00901         A callback method must be defined like this:
00902 
00903             bool myclass::mycallbackmethod(MMSWindow *win, bool goback);
00904 
00905             \param win      is the pointer to the window which is to be hidden
00906             \param goback   the application can decide, what to do if true/false, see hide()
00907 
00908             \return true if the hide process should continue, else false if the window should not disappear
00909 
00910         To connect your callback to onBeforeHide do this:
00911 
00912             sigc::connection connection;
00913             connection = mywindow->onBeforeHide->connect(sigc::mem_fun(myobject,&myclass::mycallbackmethod));
00914 
00915         To disconnect your callback do this:
00916 
00917             connection.disconnect();
00918 
00919         Please note:
00920 
00921             You HAVE TO disconnect myobject from onBeforeHide BEFORE myobject will be deleted!!!
00922             Else an abnormal program termination can occur.
00923             You HAVE TO call the disconnect() method of sigc::connection explicitly. The destructor will NOT do this!!!
00924         */
00925         sigc::signal<bool, MMSWindow*, bool>::accumulated<bool_accumulator> *onBeforeHide;
00926 
00927         //! Set one or more callbacks for the onHide event.
00928         /*!
00929         The connected callbacks will be called during hide().
00930 
00931         A callback method must be defined like this:
00932 
00933             void myclass::mycallbackmethod(MMSWindow *win, bool goback);
00934 
00935             \param win      is the pointer to the window which is hidden now
00936             \param goback   the application can decide, what to do if true/false, see hide()
00937 
00938         To connect your callback to onHide do this:
00939 
00940             sigc::connection connection;
00941             connection = mywindow->onHide->connect(sigc::mem_fun(myobject,&myclass::mycallbackmethod));
00942 
00943         To disconnect your callback do this:
00944 
00945             connection.disconnect();
00946 
00947         Please note:
00948 
00949             You HAVE TO disconnect myobject from onHide BEFORE myobject will be deleted!!!
00950             Else an abnormal program termination can occur.
00951             You HAVE TO call the disconnect() method of sigc::connection explicitly. The destructor will NOT do this!!!
00952         */
00953         sigc::signal<void, MMSWindow*, bool> *onHide;
00954 
00955         //! Set one or more callbacks for the onHandleInput event.
00956         /*!
00957         The connected callbacks will be called if an input event was raised.
00958 
00959         A callback method must be defined like this:
00960 
00961             bool myclass::mycallbackmethod(MMSWindow *win, MMSInputEvent *inputevent);
00962 
00963             \param win          is the pointer to the window
00964             \param inputevent   the input event
00965 
00966             \return callback should return true if the input was handled, else false
00967 
00968         To connect your callback to onHandleInput do this:
00969 
00970             sigc::connection connection;
00971             connection = mywindow->onHandleInput->connect(sigc::mem_fun(myobject,&myclass::mycallbackmethod));
00972 
00973         To disconnect your callback do this:
00974 
00975             connection.disconnect();
00976 
00977         Please note:
00978 
00979             You HAVE TO disconnect myobject from onHandleInput BEFORE myobject will be deleted!!!
00980             Else an abnormal program termination can occur.
00981             You HAVE TO call the disconnect() method of sigc::connection explicitly. The destructor will NOT do this!!!
00982         */
00983         sigc::signal<bool, MMSWindow*, MMSInputEvent*>::accumulated<neg_bool_accumulator> *onHandleInput;
00984 
00985         //! Set one or more callbacks for the onBeforeHandleInput event.
00986         /*!
00987         The connected callbacks will be called if an input event was raised, before any standard operation took place
00988 
00989         A callback method must be defined like this:
00990 
00991             bool myclass::mycallbackmethod(MMSWindow *win, MMSInputEvent *inputevent);
00992 
00993             \param win          is the pointer to the window
00994             \param inputevent   the input event
00995 
00996             \return callback should return true if the input was handled, else false
00997 
00998         To connect your callback to onHandleInput do this:
00999 
01000             sigc::connection connection;
01001             connection = mywindow->onHandleInput->connect(sigc::mem_fun(myobject,&myclass::mycallbackmethod));
01002 
01003         To disconnect your callback do this:
01004 
01005             connection.disconnect();
01006 
01007         Please note:
01008 
01009             You HAVE TO disconnect myobject from onHandleInput BEFORE myobject will be deleted!!!
01010             Else an abnormal program termination can occur.
01011             You HAVE TO call the disconnect() method of sigc::connection explicitly. The destructor will NOT do this!!!
01012         */
01013         sigc::signal<bool, MMSWindow*, MMSInputEvent*>::accumulated<neg_bool_accumulator> *onBeforeHandleInput;
01014 
01015 
01016         //! Set one or more callbacks for the onDraw event.
01017         /*!
01018         The connected callbacks will be called if the window will be drawn.
01019 
01020         A callback method must be defined like this:
01021 
01022             bool myclass::mycallbackmethod(MMSFBSurface *surface, bool clear);
01023 
01024             \param surface      is the pointer to window's surface
01025             \param clear        if true, the callback should clear the surface before drawing
01026 
01027             \return callback should return true if it has drawn to the surface, else false
01028 
01029         To connect your callback to onDraw do this:
01030 
01031             sigc::connection connection;
01032             connection = mywindow->onDraw->connect(sigc::mem_fun(myobject,&myclass::mycallbackmethod));
01033 
01034         To disconnect your callback do this:
01035 
01036             connection.disconnect();
01037 
01038         Please note:
01039 
01040             You HAVE TO disconnect myobject from onDraw BEFORE myobject will be deleted!!!
01041             Else an abnormal program termination can occur.
01042             You HAVE TO call the disconnect() method of sigc::connection explicitly. The destructor will NOT do this!!!
01043         */
01044         sigc::signal<bool, MMSFBSurface*, bool>::accumulated<neg_bool_accumulator> *onDraw;
01045 
01046 
01047 
01048 
01049 
01050 
01051 
01052 
01053         unsigned int printStack(char *buffer, int space = 0);
01054 
01055     public:
01056         /* begin of theme access methods *************************************/
01057 
01058         //! Get the alignment of the window.
01059         /*!
01060         \param alignment    returns the alignment
01061         \return true, if alignment is successfully returned
01062         */
01063         bool getAlignment(MMSALIGNMENT &alignment);
01064 
01065         //! Get the x-movement of the window.
01066         /*!
01067         \param dx   returns the x-movement
01068         \return true, if dx is successfully returned
01069         */
01070         bool getDx(string &dx);
01071 
01072         //! Get the x-movement of the window as integer in pixel.
01073         /*!
01074         \return the x-movement
01075         */
01076         int getDxPix();
01077 
01078         //! Get the y-movement of the window.
01079         /*!
01080         \param dy   returns the y-movement
01081         \return true, if dy is successfully returned
01082         */
01083         bool getDy(string &dy);
01084 
01085         //! Get the y-movement of the window as integer in pixel.
01086         /*!
01087         \return the y-movement
01088         */
01089         int getDyPix();
01090 
01091         //! Get the width of the window.
01092         /*!
01093         \param width    returns the width
01094         \return true, if width is successfully returned
01095         */
01096         bool getWidth(string &width);
01097 
01098         //! Get the height of the window.
01099         /*!
01100         \param height   returns the height
01101         \return true, if height is successfully returned
01102         */
01103         bool getHeight(string &height);
01104 
01105         //! Get the background color of the window.
01106         /*!
01107         \param bgcolor  returns the bgcolor
01108         \return true, if bgcolor is successfully returned
01109         */
01110         bool getBgColor(MMSFBColor &bgcolor);
01111 
01112         //! Get the path to the background image of the window.
01113         /*!
01114         \param bgimagepath  returns the path
01115         \return true, if bgimagepath is successfully returned
01116         */
01117         bool getBgImagePath(string &bgimagepath);
01118 
01119         //! Get the name of the background image.
01120         /*!
01121         \param bgimagename  returns the name
01122         \return true, if bgimagename is successfully returned
01123         */
01124         bool getBgImageName(string &bgimagename);
01125 
01126         //! Get the opacity of the window.
01127         /*!
01128         \param opacity  returns the opacity
01129         \return true, if opacity is successfully returned
01130         */
01131         bool getOpacity(unsigned int &opacity);
01132 
01133         //! Detect if the window has to fade-in during the show action.
01134         /*!
01135         \param fadein   returns the fadein status
01136         \return true, if fadein is successfully returned
01137         */
01138         bool getFadeIn(bool &fadein);
01139 
01140         //! Detect if the window has to fade-out during the hide action.
01141         /*!
01142         \param fadeout  returns the fadeout status
01143         \return true, if fadeout is successfully returned
01144         */
01145         bool getFadeOut(bool &fadeout);
01146 
01147         //! Detect if the window has to draw debug rectangles around its widgets.
01148         /*!
01149         \param debug    returns the debug status
01150         \return true, if debug is successfully returned
01151         */
01152         bool getDebug(bool &debug);
01153 
01154         //! Get the margin of the window.
01155         /*!
01156         The margin of a window is the space around the window border.
01157         If you have for example a 640x480 window with an margin 10, the window content will be drawed within 620x460.
01158         \param margin   returns the margin
01159         \return true, if margin is successfully returned
01160         */
01161         bool getMargin(unsigned int &margin);
01162 
01163         //! Get the name of the uparrow widget.
01164         /*!
01165         If the user can navigate up to a other widget or child window,
01166         the uparrow widget will be selected, else unselected.
01167         \param uparrow  returns the name
01168         \return true, if uparrow is successfully returned
01169         */
01170         bool getUpArrow(string &uparrow);
01171 
01172         //! Get the name of the downarrow widget.
01173         /*!
01174         If the user can navigate down to a other widget or child window,
01175         the downarrow widget will be selected, else unselected.
01176         \param downarrow    returns the name
01177         \return true, if downarrow is successfully returned
01178         */
01179         bool getDownArrow(string &downarrow);
01180 
01181         //! Get the name of the leftarrow widget.
01182         /*!
01183         If the user can navigate left to a other widget or child window,
01184         the leftarrow widget will be selected, else unselected.
01185         \param leftarrow    returns the name
01186         \return true, if leftarrow is successfully returned
01187         */
01188         bool getLeftArrow(string &leftarrow);
01189 
01190         //! Get the name of the rightarrow widget.
01191         /*!
01192         If the user can navigate right to a other widget or child window,
01193         the rightarrow widget will be selected, else unselected.
01194         \param rightarrow   returns the name
01195         \return true, if rightarrow is successfully returned
01196         */
01197         bool getRightArrow(string &rightarrow);
01198 
01199         //! Get the name of the navigateup window.
01200         /*!
01201         This is the child window which is to be focused if user navigates up.
01202         If it is not set, the GUI is searching automatically for the best route.
01203         \param navigateup   returns the name
01204         \return true, if navigateup is successfully returned
01205         */
01206         bool getNavigateUp(string &navigateup);
01207 
01208         //! Get the name of the navigatedown window.
01209         /*!
01210         This is the child window which is to be focused if user navigates down.
01211         If it is not set, the GUI is searching automatically for the best route.
01212         \param navigatedown returns the name
01213         \return true, if navigatedown is successfully returned
01214         */
01215         bool getNavigateDown(string &navigatedown);
01216 
01217         //! Get the name of the navigateleft window.
01218         /*!
01219         This is the child window which is to be focused if user navigates left.
01220         If it is not set, the GUI is searching automatically for the best route.
01221         \param navigateleft returns the name
01222         \return true, if navigateleft is successfully returned
01223         */
01224         bool getNavigateLeft(string &navigateleft);
01225 
01226         //! Get the name of the navigateright window.
01227         /*!
01228         This is the child window which is to be focused if user navigates right.
01229         If it is not set, the GUI is searching automatically for the best route.
01230         \param navigateright    returns the name
01231         \return true, if navigateright is successfully returned
01232         */
01233         bool getNavigateRight(string &navigateright);
01234 
01235         //! Detect if the window has an own surface.
01236         /*!
01237         If the window has no own surface, the drawing functions will be directly work on the parent surface.
01238         This can save a lot of memory.
01239         \param ownsurface   returns the ownsurface status
01240         \return true, if ownsurface is successfully returned
01241         */
01242         bool getOwnSurface(bool &ownsurface);
01243 
01244         //! Get the move-in direction of the window which is used during the show action.
01245         /*!
01246         \param movein   returns the movein direction
01247         \return true, if movein is successfully returned
01248         */
01249         bool getMoveIn(MMSDIRECTION &movein);
01250 
01251         //! Get the move-out direction of the window which is used during the hide action.
01252         /*!
01253         \param moveout  returns the moveout direction
01254         \return true, if moveout is successfully returned
01255         */
01256         bool getMoveOut(MMSDIRECTION &moveout);
01257 
01258         //! Detect if the window has to be modal if it is focused.
01259         /*!
01260         \param modal    returns the modal status
01261         \return true, if modal is successfully returned
01262         */
01263         bool getModal(bool &modal);
01264 
01265         //! Detect if the window automatically changes the zorder of child windows during show() or setFocus()
01266         /*!
01267         \param staticzorder returns the static zorder flag
01268         \return true, if value is successfully returned
01269         */
01270         bool getStaticZOrder(bool &staticzorder);
01271 
01272         //! Detect if the window will be permanently displayed at the top of the window stack.
01273         /*!
01274         \param alwaysontop  returns the always on top flag
01275         \return true, if value is successfully returned
01276         */
01277         bool getAlwaysOnTop(bool &alwaysontop);
01278 
01279         //! Detect if the window can be focused.
01280         /*!
01281         \param focusable    returns the focusable flag
01282         \return true, if value is successfully returned
01283         */
01284         bool getFocusable(bool &focusable);
01285 
01286         //! Detect if the window has an backbuffer.
01287         /*!
01288         \param backbuffer   returns the backbuffer flag
01289         \return true, if value is successfully returned
01290         */
01291         bool getBackBuffer(bool &backbuffer);
01292 
01293         //! Detect if the window is loading images, fonts etc. during initialization.
01294         /*!
01295         \param initialload  returns the initial load flag
01296         \return true, if value is successfully returned
01297         \note Per default initial load is false. That means that the window and it's widgets
01298               will load images, fonts etc. during the first show().
01299         */
01300         bool getInitialLoad(bool &initialload);
01301 
01302         //! Get the color of the window border.
01303         /*!
01304         \param color    returns the border color
01305         \return true, if color is successfully returned
01306         */
01307         bool getBorderColor(MMSFBColor &color);
01308 
01309         //! Get the path to the window border images.
01310         /*!
01311         \param imagepath    returns the path
01312         \return true, if imagepath is successfully returned
01313         */
01314         bool getBorderImagePath(string &imagepath);
01315 
01316         //! Get the name of a border image.
01317         /*!
01318         \param num          number of image, see MMSBORDER_IMAGE_NUM
01319         \param imagename    returns the name
01320         \return true, if imagename is successfully returned
01321         */
01322         bool getBorderImageNames(MMSBORDER_IMAGE_NUM num, string &imagename);
01323 
01324         //! Get the border thickness.
01325         /*!
01326         \param thickness    returns the border thickness
01327         \return true, if thickness is successfully returned
01328         */
01329         bool getBorderThickness(unsigned int &thickness);
01330 
01331         //! Get the border margin.
01332         /*!
01333         The border margin is the space between the border an the inner rectangle of the window on which the
01334         widgets or child windows will be drawn.
01335         \param margin   returns the border margin
01336         \return true, if margin is successfully returned
01337         */
01338         bool getBorderMargin(unsigned int &margin);
01339 
01340         //! Detect if the border has round corners.
01341         /*!
01342         \param rcorners returns the round corners status
01343         \return true, if rcorners is successfully returned
01344         */
01345         bool getBorderRCorners(bool &rcorners);
01346 
01347 
01348         //! Set the alignment of the window.
01349         /*!
01350         \param alignment    the alignment
01351         \param refresh      refresh the window after changing the alignment?
01352         \param resize       resize the window after changing the alignment?
01353         */
01354         void setAlignment(MMSALIGNMENT alignment, bool refresh = true, bool resize = true);
01355 
01356         //! Set the x-movement of the window.
01357         /*!
01358         \param dx       the x-movement
01359         \param refresh  refresh the window after changing the dx?
01360         \param resize   resize the window after changing the dx?
01361         */
01362         void setDx(string dx, bool refresh = false, bool resize = true);
01363 
01364         //! Set the x-movement of the window as integer in pixel.
01365         /*!
01366         \param dx       the x-movement in pixel
01367         \param refresh  refresh the window after changing the dx?
01368         \param resize   resize the window after changing the dx?
01369         */
01370         void setDxPix(int dx, bool refresh = false, bool resize = true);
01371 
01372         //! Set the y-movement of the window.
01373         /*!
01374         \param dy       the y-movement
01375         \param refresh  refresh the window after changing the dy?
01376         \param resize   resize the window after changing the dy?
01377         */
01378         void setDy(string dy, bool refresh = false, bool resize = true);
01379 
01380         //! Set the y-movement of the window as integer in pixel.
01381         /*!
01382         \param dy       the y-movement in pixel
01383         \param refresh  refresh the window after changing the dy?
01384         \param resize   resize the window after changing the dy?
01385         */
01386         void setDyPix(int dy, bool refresh = false, bool resize = true);
01387 
01388         //! Set the width of the window.
01389         /*!
01390         \param width    the width
01391         \param refresh  refresh the window after changing the width?
01392         \param resize   resize the window after changing the width?
01393         */
01394         void setWidth(string width, bool refresh = true, bool resize = true);
01395 
01396         //! Set the height of the window.
01397         /*!
01398         \param height   the height
01399         \param refresh  refresh the window after changing the height?
01400         \param resize   resize the window after changing the height?
01401         */
01402         void setHeight(string height, bool refresh = true, bool resize = true);
01403 
01404         //! Set the background color of the window.
01405         /*!
01406         \param bgcolor  the bgcolor
01407         \param refresh  refresh the window after changing the bgcolor?
01408         */
01409         void setBgColor(MMSFBColor bgcolor, bool refresh = true);
01410 
01411         //! Set the path to the background image of the window.
01412         /*!
01413         \param bgimagepath  the path
01414         \param load         reload the bgimage after changing the bgimagepath?
01415         \param refresh      refresh the window after changing the bgimagepath?
01416         */
01417         void setBgImagePath(string bgimagepath, bool load = true, bool refresh = true);
01418 
01419         //! Set the name of the background image.
01420         /*!
01421         \param bgimagename  the name
01422         \param load         reload the bgimage after changing the bgimagename?
01423         \param refresh      refresh the window after changing the bgimagename?
01424         */
01425         void setBgImageName(string bgimagename, bool load = true, bool refresh = true);
01426 
01427         //! Set background image already loaded by the application
01428         /*!
01429         \param bgimage      pointer to surface or NULL
01430         \param refresh      refresh the window after changing?
01431         */
01432         void setBgImage(MMSFBSurface *bgimage, bool refresh = true);
01433 
01434         //! Set the opacity of the window.
01435         /*!
01436         \param opacity  the opacity
01437         \param refresh  refresh the window after changing the opacity?
01438         */
01439         void setOpacity(unsigned int opacity, bool refresh = true);
01440 
01441         //! Set the fadein status needed during the show action.
01442         /*!
01443         \param fadein   if true, the window is fading in during the next show()
01444         */
01445         void setFadeIn(bool fadein);
01446 
01447         //! Set the fadeout status needed during the hide action.
01448         /*!
01449         \param fadeout  if true, the window is fading out during the next hide()
01450         */
01451         void setFadeOut(bool fadeout);
01452 
01453         //! Should the window draw debug rectangles around its widgets?
01454         /*!
01455         \param debug    the debug status
01456         \param refresh  refresh the window after changing the debug status?
01457         */
01458         void setDebug(bool debug, bool refresh = true);
01459 
01460         //! Set the margin of the window.
01461         /*!
01462         The margin of a window is the space around the window border.
01463         If you have for example a 640x480 window with an margin 10, the window content will be drawed within 620x460.
01464         \param margin   the margin
01465         \param refresh  refresh the window after changing the margin?
01466         \param resize   resize the window after changing the margin?
01467         */
01468         void setMargin(unsigned int margin, bool refresh = true, bool resize = true);
01469 
01470         //! Set the name of the uparrow widget.
01471         /*!
01472         If the user can navigate up to a other widget or child window,
01473         the uparrow widget will be selected, else unselected.
01474         \param uparrow  the name
01475         \param refresh  refresh the window after changing the uparrow?
01476         */
01477         void setUpArrow(string uparrow, bool refresh = true);
01478 
01479         //! Set the name of the downarrow widget.
01480         /*!
01481         If the user can navigate down to a other widget or child window,
01482         the downarrow widget will be selected, else unselected.
01483         \param downarrow    the name
01484         \param refresh      refresh the window after changing the downarrow?
01485         */
01486         void setDownArrow(string downarrow, bool refresh = true);
01487 
01488         //! Set the name of the leftarrow widget.
01489         /*!
01490         If the user can navigate left to a other widget or child window,
01491         the leftarrow widget will be selected, else unselected.
01492         \param leftarrow    the name
01493         \param refresh      refresh the window after changing the leftarrow?
01494         */
01495         void setLeftArrow(string leftarrow, bool refresh = true);
01496 
01497         //! Set the name of the rightarrow widget.
01498         /*!
01499         If the user can navigate right to a other widget or child window,
01500         the rightarrow widget will be selected, else unselected.
01501         \param rightarrow   the name
01502         \param refresh      refresh the window after changing the rightarrow?
01503         */
01504         void setRightArrow(string rightarrow, bool refresh = true);
01505 
01506         //! Set the name of the navigateup window.
01507         /*!
01508         This is the child window which is to be focused if user navigates up.
01509         If it is not set, the GUI is searching automatically for the best route.
01510         \param navigateup   the name
01511         */
01512         void setNavigateUp(string navigateup);
01513 
01514         //! Set the name of the navigatedown window.
01515         /*!
01516         This is the child window which is to be focused if user navigates down.
01517         If it is not set, the GUI is searching automatically for the best route.
01518         \param navigatedown the name
01519         */
01520         void setNavigateDown(string navigatedown);
01521 
01522         //! Set the name of the navigateleft window.
01523         /*!
01524         This is the child window which is to be focused if user navigates left.
01525         If it is not set, the GUI is searching automatically for the best route.
01526         \param navigateleft the name
01527         */
01528         void setNavigateLeft(string navigateleft);
01529 
01530         //! Set the name of the navigateright window.
01531         /*!
01532         This is the child window which is to be focused if user navigates right.
01533         If it is not set, the GUI is searching automatically for the best route.
01534         \param navigateright    the name
01535         */
01536         void setNavigateRight(string navigateright);
01537 
01538         //! Should the window working with an own surface?
01539         /*!
01540         If the window has no own surface, the drawing functions will be directly work on the parent surface.
01541         This can save a lot of memory.
01542         \param ownsurface   the ownsurface status
01543         */
01544         void setOwnSurface(bool ownsurface);
01545 
01546         //! Set the move-in direction of the window which is used during the show action.
01547         /*!
01548         \param movein   the movein direction
01549         */
01550         void setMoveIn(MMSDIRECTION movein);
01551 
01552         //! Set the move-out direction of the window which is used during the hide action.
01553         /*!
01554         \param moveout  the moveout direction
01555         */
01556         void setMoveOut(MMSDIRECTION moveout);
01557 
01558         //! Set the modal status of the window.
01559         /*!
01560         \param modal    if true, the window is marked as modal
01561         */
01562         void setModal(bool modal);
01563 
01564         //! Set the zorder status of the window.
01565         /*!
01566         \param staticzorder if true, the window automatically changes the zorder of child window during show() / setFocus()
01567         */
01568         void setStaticZOrder(bool staticzorder);
01569 
01570         //! Set the always on top flag of the window.
01571         /*!
01572         \param alwaysontop  if true, the window will be permanently displayed at the top of the window stack
01573         */
01574         void setAlwaysOnTop(bool alwaysontop);
01575 
01576         //! Set the focusable flag of the window.
01577         /*!
01578         \param focusable    if true, the window will can get the focus
01579         */
01580         void setFocusable(bool focusable);
01581 
01582         //! Set the backbuffer flag of the window.
01583         /*!
01584         \param backbuffer   if true, the window surface has a front and a backbuffer
01585         */
01586         void setBackBuffer(bool backbuffer);
01587 
01588         //! Set the initial load flag of the window.
01589         /*!
01590         \param initialload  if true, the window is loading images, fonts etc. during initialization
01591         */
01592         void setInitialLoad(bool initialload);
01593 
01594         //! Set the color of the window border.
01595         /*!
01596         \param color    the border color
01597         \param refresh  refresh the window after changing the border color?
01598         */
01599         void setBorderColor(MMSFBColor color, bool refresh = true);
01600 
01601         //! Set the path to the window border images.
01602         /*!
01603         \param imagepath    returns the path
01604         \param load         reload the border images after changing the imagepath?
01605         \param refresh      refresh the window after changing the imagepath?
01606         */
01607         void setBorderImagePath(string imagepath, bool load = true, bool refresh = true);
01608 
01609         //! Set the names of the window border images.
01610         /*!
01611         \param imagename_1  the top-left image
01612         \param imagename_2  the top image
01613         \param imagename_3  the top-right image
01614         \param imagename_4  the right image
01615         \param imagename_5  the bottom-right image
01616         \param imagename_6  the bottom image
01617         \param imagename_7  the bottom-left imagethis->focusedChildWin
01618         \param imagename_8  the left image
01619         \param load         reload the border images after changing the image names?
01620         \param refresh      refresh the window after changing the image names?
01621         */
01622         void setBorderImageNames(string imagename_1, string imagename_2, string imagename_3, string imagename_4,
01623                                  string imagename_5, string imagename_6, string imagename_7, string imagename_8,
01624                                  bool load = true, bool refresh = true);
01625 
01626         //! Set the border thickness.
01627         /*!
01628         \param thickness    the border thickness
01629         \param refresh      refresh the window after changing the thickness?
01630         \param resize       resize the window after changing the thickness?
01631         */
01632         void setBorderThickness(unsigned int thickness, bool refresh = true, bool resize = true);
01633 
01634         //! Set the border margin.
01635         /*!
01636         The border margin is the space between the border an the inner rectangle of the window on which the
01637         widgets or child windows will be drawn.
01638         \param margin       the border margin
01639         \param refresh      refresh the window after changing the margin?
01640         \param resize       resize the window after changing the margin?
01641         */
01642         void setBorderMargin(unsigned int margin, bool refresh = true, bool resize = true);
01643 
01644         //! Should the window border uses round corners?
01645         /*!
01646         \param rcorners the round corners status
01647         \param refresh  refresh the window after changing the rcorners?
01648         */
01649         void setBorderRCorners(bool rcorners, bool refresh = true);
01650 
01651         //! Update the current window settings with settings from another theme class.
01652         /*!
01653         \param themeClass   source theme class
01654         \note Only this parameters which are set within the source theme class will be updated.
01655         */
01656         void updateFromThemeClass(MMSWindowClass *themeClass);
01657 
01658     // friends
01659     friend class MMSWindowManager;
01660     friend class MMSInputManager;
01661     friend class MMSWindowAction;
01662     friend class MMSMainWindow;
01663     friend class MMSPopupWindow;
01664     friend class MMSRootWindow;
01665     friend class MMSChildWindow;
01666     friend class MMSWidget;
01667     friend class MMSHBoxWidget;
01668     friend class MMSVBoxWidget;
01669     friend class MMSLabelWidget;
01670     friend class MMSButtonWidget;
01671     friend class MMSImageWidget;
01672     friend class MMSProgressBarWidget;
01673     friend class MMSMenuWidget;
01674     friend class MMSTextBoxWidget;
01675     friend class MMSArrowWidget;
01676     friend class MMSSliderWidget;
01677     friend class MMSInputWidget;
01678     friend class MMSCheckBoxWidget;
01679     friend class MMSCanvasWidget;
01680 };
01681 
01682 #endif /*MMSWINDOW_H_*/

Generated by doxygen