NPAPI:CoreAnimationDrawingModel: Difference between revisions

Jump to navigation Jump to search
(Added clarification for software painting)
Line 45: Line 45:
NPPVpluginCoreAnimationLayer = 1003
NPPVpluginCoreAnimationLayer = 1003


NPPVariable. The value should be treated as a CALayer * pointer, which the plug-in should fill in with a _retained_ layer. For example:
NPPVariable. The value should be treated as a CALayer * pointer, which the plug-in should fill in with a layer. The plug-in should retain a reference to the layer. For example:


  NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
  NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
Line 54: Line 54:
         case NPPVpluginCoreAnimationLayer:
         case NPPVpluginCoreAnimationLayer:
             if (!obj->layer) {
             if (!obj->layer) {
                 obj->layer = makeLayer();
                 obj->layer = getLayer();
                [obj->layer retain];  // should be balanced by a -release in NPP_Destroy
             }
             }
              
              
            // Make sure to return a retained layer
             *((CALayer **)value) = obj->layer;
             *((CALayer **)value) = [obj->layer retain];
 
           
             return NPERR_NO_ERROR;
             return NPERR_NO_ERROR;
              
              
12

edits

Navigation menu