~smspillaz/compiz-core/compiz-core.width-height-for-border

« back to all changes in this revision

Viewing changes to src/pluginclasshandler/include/core/pluginclasshandler.h

  • Committer: smspillaz
  • Date: 2012-04-03 01:10:50 UTC
  • mfrom: (2974.2.110 trunk)
  • Revision ID: sam.spilsbury@canonical.com-20120403011050-nebzo1u275zvyw64
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
         * on this base class if there wasn't one already and then
87
87
         * storing that index inside of ValueHolder
88
88
         */
89
 
        static bool initializeIndex ();
 
89
        static bool initializeIndex (Tb *base);
90
90
        static inline Tp * getInstance (Tb *base);
91
91
 
92
92
    private:
120
120
        /* The index for this plugin class hasn't been initiated
121
121
         * so do that (done once per plugin) */
122
122
        if (!mIndex.initiated)
123
 
            mFailed = !initializeIndex ();
 
123
            mFailed = !initializeIndex (base);
124
124
 
125
125
        /* Increase the reference count of this plugin class index
126
126
         * for this plugin on this base object for each attached
135
135
 
136
136
template<class Tp, class Tb, int ABI>
137
137
bool
138
 
PluginClassHandler<Tp,Tb,ABI>::initializeIndex ()
 
138
PluginClassHandler<Tp,Tb,ABI>::initializeIndex (Tb *base)
139
139
{
140
140
    /* Allocate a new storage space index in the array of CompPrivate's
141
141
     * specified in the base class */
142
 
    mIndex.index = Tb::allocPluginClassIndex ();
 
142
    mIndex.index = base->allocPluginClassIndex ();
143
143
    if (mIndex.index != (unsigned)~0)
144
144
    {
145
145
        /* Allocation was successful, this is the most recently allocated
196
196
         *  won't be fresh) */
197
197
        if (mIndex.refCount == 0)
198
198
        {
199
 
            Tb::freePluginClassIndex (mIndex.index);
 
199
            mBase->freePluginClassIndex (mIndex.index);
200
200
            mIndex.initiated = false;
201
201
            mIndex.failed = false;
202
202
            mIndex.pcIndex = pluginClassHandlerIndex;
248
248
    /* Always ensure that the index is initialized before
249
249
     * calls to ::get */
250
250
    if (!mIndex.initiated)
251
 
        initializeIndex ();
 
251
        initializeIndex (base);
252
252
    /* If pluginClassHandlerIndex == mIndex.pcIndex it means that our
253
253
     * mIndex.index is fresh and can be used directly without needing
254
254
     * to fetch it from ValueHolder */