~sil2100/compiz-core/fix-1019337.2-0.9.7

« back to all changes in this revision

Viewing changes to src/privatestackdebugger.h

  • Committer: Łukasz 'sil2100' Zemczak
  • Date: 2012-06-22 16:31:07 UTC
  • mfrom: (3104.5.1 cherry_3243)
  • Revision ID: lukasz.zemczak@canonical.com-20120622163107-7o9ddejrobd7s0cs
Cherry-picked from compiz trunk (rev 3243):
Avoid needless STL operations leading to expensive heap operations.
(LP: #1006335)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 * so that this can be come a truly standalone
28
28
 * object */
29
29
#include <core/core.h>
 
30
#include <list>
30
31
 
31
32
#ifndef _COMPIZ_PRIVATESTACKDEBUGGER_H
32
33
#define _COMPIZ_PRIVATESTACKDEBUGGER_H
33
34
 
 
35
class FetchXEventInterface;
 
36
 
34
37
class StackDebugger
35
38
{
36
39
    public:
37
40
 
38
 
        typedef std::list<XEvent> eventList;
 
41
        typedef std::vector<XEvent> eventList;
39
42
 
40
 
        StackDebugger (Display *, Window, boost::function<eventList ()> evProc);
 
43
        StackDebugger (Display *, Window, FetchXEventInterface *fetchXEvent);
41
44
        ~StackDebugger ();
42
45
 
43
 
        eventList loadStack (CompWindowList &serverWindows, bool wait = false);
 
46
        void loadStack (CompWindowList &serverWindows, bool wait = false);
44
47
        void windowsChanged (bool change) { mWindowsChanged = change; };
45
48
        void serverWindowsChanged (bool change) { mServerWindowsChanged = change; };
46
49
        bool windowsChanged () { return mWindowsChanged; }
54
57
                       CompWindowList &serverWindows,
55
58
                       bool verbose = false);
56
59
        bool timedOut ();
 
60
        bool getNextEvent (XEvent &);
57
61
 
58
62
        bool checkSanity (CompWindowList &serverWindows, bool verbose = false);
59
63
 
70
74
        bool         mServerWindowsChanged;
71
75
        Window       mRoot;
72
76
        Display      *mDpy;
73
 
        boost::function<eventList ()> getEventsProc;
 
77
        FetchXEventInterface *mFetchXEvent;
74
78
        bool         mTimeoutRequired;
75
79
        CompWindowList mLastServerWindows;
 
80
        std::list <XEvent> mEvents;
76
81
};
77
82
 
78
83
#endif