PieDock 1.6.0

src/PieMenuWindow.h

00001 /*
00002  *   O         ,-
00003  *  ° o    . -´  '     ,-
00004  *   °  .´        ` . ´,´
00005  *     ( °   ))     . (
00006  *      `-;_    . -´ `.`.
00007  *          `._'       ´
00008  *
00009  * Copyright (c) 2007-2010 Markus Fisch <mf@markusfisch.de>
00010  *
00011  * Licensed under the MIT license:
00012  * http://www.opensource.org/licenses/mit-license.php
00013  */
00014 #ifndef _PieDock_PieMenuWindow_
00015 #define _PieDock_PieMenuWindow_
00016 
00017 #include "TransparentWindow.h"
00018 #include "PieMenu.h"
00019 #include "Text.h"
00020 #include "Cartouche.h"
00021 
00022 #include <time.h>
00023 
00024 namespace PieDock
00025 {
00031     class PieMenuWindow : public TransparentWindow
00032     {
00033         public:
00034             enum Placement
00035             {
00036                 AroundCursor,
00037                 IconBelowCursor
00038             };
00039 
00040             PieMenuWindow( Application & );
00041             virtual ~PieMenuWindow();
00042             bool appear( std::string = "", Placement = AroundCursor );
00043             void draw();
00044             bool processEvent( XEvent & );
00045 
00046         protected:
00047             typedef std::map<int, Cartouche *> CartoucheMap;
00048 
00049             virtual void show( Placement = AroundCursor );
00050             virtual void hide();
00051             virtual void updateWithText();
00052             virtual bool performAction( Settings::Action );
00053             virtual void place( Placement );
00054 
00055         private:
00056             static const std::string ShowMessage;
00057             PieMenu menu;
00058             Pixmap textCanvas;
00059             Text *text;
00060             CartoucheMap cartoucheMap;
00061     };
00062 }
00063 
00064 #endif