use ContextMenuActions
[enigma2.git] / lib / gdi / grc.h
index 574391789c70d39ebf3bcefc9a8e998c8e157275..8224348332440c19fd5f29bfa51609b4809e1448 100644 (file)
@@ -14,6 +14,7 @@
 #include <string>
 #include <lib/base/ringbuffer.h>
 #include <lib/base/elock.h>
 #include <string>
 #include <lib/base/ringbuffer.h>
 #include <lib/base/elock.h>
+#include <lib/base/message.h>
 #include <lib/gdi/erect.h>
 #include <lib/gdi/gpixmap.h>
 #include <lib/gdi/region.h>
 #include <lib/gdi/erect.h>
 #include <lib/gdi/gpixmap.h>
 #include <lib/gdi/region.h>
@@ -50,6 +51,10 @@ struct gOpcode
                
                flush,
                
                
                flush,
                
+               waitVSync,
+               flip,
+               notify,
+               
                end,shutdown
        } opcode;
 
                end,shutdown
        } opcode;
 
@@ -128,15 +133,14 @@ struct gOpcode
                        int rel;
                } *setOffset;
        } parm;
                        int rel;
                } *setOffset;
        } parm;
-
-       int flags;
 };
 
                /* gRC is the singleton which controls the fifo and dispatches commands */
 };
 
                /* gRC is the singleton which controls the fifo and dispatches commands */
-class gRC: public iObject
+class gRC: public iObject, public Object
 {
 DECLARE_REF(gRC);
 private:
 {
 DECLARE_REF(gRC);
 private:
+       friend class gPainter;
        static gRC *instance;
        
        static void *thread_wrapper(void *ptr);
        static gRC *instance;
        
        static void *thread_wrapper(void *ptr);
@@ -144,6 +148,9 @@ private:
        void *thread();
 
        queueRingBuffer<gOpcode> queue;
        void *thread();
 
        queueRingBuffer<gOpcode> queue;
+       
+       eFixedMessagePump<int> m_notify_pump;
+       void recv_notify(const int &i);
 public:
        eLock queuelock;
        gRC();
 public:
        eLock queuelock;
        gRC();
@@ -164,6 +171,8 @@ public:
                }
        }
 
                }
        }
 
+       Signal0<void> notify;
+
        static gRC *getInstance();
 };
 
        static gRC *getInstance();
 };
 
@@ -215,6 +224,7 @@ public:
        void blit(gPixmap *pixmap, ePoint pos, const eRect &what=eRect(), int flags=0);
 
        void setPalette(gRGB *colors, int start=0, int len=256);
        void blit(gPixmap *pixmap, ePoint pos, const eRect &what=eRect(), int flags=0);
 
        void setPalette(gRGB *colors, int start=0, int len=256);
+       void setPalette(gPixmap *source);
        void mergePalette(gPixmap *target);
        
        void line(ePoint start, ePoint end);
        void mergePalette(gPixmap *target);
        
        void line(ePoint start, ePoint end);
@@ -228,6 +238,10 @@ public:
        void clippop();
 
        void flush();
        void clippop();
 
        void flush();
+       
+       void waitVSync();
+       void flip();
+       void notify();
 };
 
 class gDC: public iObject
 };
 
 class gDC: public iObject