Skip to content

Commit

Permalink
Push From Landun: update SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
libpag-pag committed Sep 18, 2024
1 parent c0dbd9e commit 8ce6172
Show file tree
Hide file tree
Showing 79 changed files with 6,115 additions and 1 deletion.
28 changes: 28 additions & 0 deletions framework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>libpag.framework/libpag</string>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>libpag.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
43 changes: 43 additions & 0 deletions framework/macos-arm64_x86_64/libpag.framework/Headers/CocoaUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/////////////////////////////////////////////////////////////////////////////////////////////////
//
// Tencent is pleased to support the open source community by making libpag available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// unless required by applicable law or agreed to in writing, software distributed under the
// license is distributed on an "as is" basis, without warranties or conditions of any kind,
// either express or implied. see the license for the specific language governing permissions
// and limitations under the license.
//
/////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CocoaUtils_h
#define CocoaUtils_h

#ifdef __APPLE__
#include <TargetConditionals.h>
#endif

#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>

#define CocoaColor UIColor
#define CocoaTextureCacheRef CVOpenGLESTextureCacheRef
#define CocoaTextureRef CVOpenGLESTextureRef

#elif TARGET_OS_MAC

#import <AppKit/AppKit.h>

#define CocoaColor NSColor
#define CocoaTextureCacheRef CVOpenGLTextureCacheRef
#define CocoaTextureRef CVOpenGLTextureRef

#endif

#endif
35 changes: 35 additions & 0 deletions framework/macos-arm64_x86_64/libpag.framework/Headers/PAG.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////////////////////////
//
// Tencent is pleased to support the open source community by making libpag available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// unless required by applicable law or agreed to in writing, software distributed under the
// license is distributed on an "as is" basis, without warranties or conditions of any kind,
// either express or implied. see the license for the specific language governing permissions
// and limitations under the license.
//
/////////////////////////////////////////////////////////////////////////////////////////////////

#import <Foundation/Foundation.h>

#if !defined(PAG_API)
#if defined(PAG_DLL)
#define PAG_API __attribute__((visibility("default")))
#else
#define PAG_API
#endif
#endif

PAG_API @interface PAG : NSObject
/**
* Get SDK version information.
*/
+ (NSString*)SDKVersion;

@end
153 changes: 153 additions & 0 deletions framework/macos-arm64_x86_64/libpag.framework/Headers/PAGComposition.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/////////////////////////////////////////////////////////////////////////////////////////////////
//
// Tencent is pleased to support the open source community by making libpag available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// unless required by applicable law or agreed to in writing, software distributed under the
// license is distributed on an "as is" basis, without warranties or conditions of any kind,
// either express or implied. see the license for the specific language governing permissions
// and limitations under the license.
//
/////////////////////////////////////////////////////////////////////////////////////////////////

#import <Foundation/Foundation.h>
#import "PAGLayer.h"

PAG_API @interface PAGComposition : PAGLayer

/**
* Make a empty PAGComposition with specified size.
*/
+ (PAGComposition*)Make:(CGSize)size;

/**
* Returns the width of the Composition.
*/
- (NSInteger)width;

/**
* Returns the height of the Composition.
*/
- (NSInteger)height;

/**
* Set the size of the Composition.
*/
- (void)setContentSize:(CGSize)size;

/**
* Returns the number of child layers of this composition.
*/
- (NSInteger)numChildren;

/**
* Returns the child layer that exists at the specified index.
* @param index The index position of the child layer.
* @returns The child layer at the specified index position.
*/
- (PAGLayer*)getLayerAt:(int)index;

/**
* Returns the index position of a child layer.
* @param child The layer instance to identify.
* @returns The index position of the child layer to identify.
*/
- (NSInteger)getLayerIndex:(PAGLayer*)child;

/**
* Changes the position of an existing child in the container. This affects the layering of child
* layers.
* @param child The child layer for which you want to change the index number.
* @param index The resulting index number for the child layer.
*/
- (void)setLayerIndex:(NSInteger)index layer:(PAGLayer*)child;

/**
Add PAGLayer to current PAGComposition at the top.
@param pagLayer specified PAGLayer to add
@return return YES if operation succeed, otherwise NO.
*/
- (BOOL)addLayer:(PAGLayer*)pagLayer;

/**
Add PAGLayer to current PAGComposition at the specified index.
@param pagLayer specified PAGLayer to add
@param index specified index where to add
@return return YES if operation succeed,else NO.
*/
- (BOOL)addLayer:(PAGLayer*)pagLayer atIndex:(int)index;

/**
Check whether current PAGComposition cotains the specified pagLayer.
@param pagLayer specified layer to check
@return return YES if the current PAGComposition contains the paglayer,else NO.
*/
- (BOOL)contains:(PAGLayer*)pagLayer;

/**
Remove the specified PAGLayer from current PAGComposition.
@param pagLayer specified PAGLayer to remove
@return return the PAGLayer if remove successfully,else nil.
*/
- (PAGLayer*)removeLayer:(PAGLayer*)pagLayer;

/**
Remove the PAGLayer at specified index from current PAGComposition.
@param index specified index to remove
@return return the PAGLayer if remove successfully,else nil.
*/
- (PAGLayer*)removeLayerAt:(int)index;

/**
Remove all PAGLayers from current PAGComposition.
*/
- (void)removeAllLayers;

/**
Swap the layers.
@param pagLayer1 specified PAGLayer 1 to swap
@param pagLayer2 specified PAGLayer 2 to swap
*/
- (void)swapLayer:(PAGLayer*)pagLayer1 withLayer:(PAGLayer*)pagLayer2;

/**
Swap the layers at the specified index.
@param index1 specified index 1 to swap
@param index2 specified index 2 to swap
*/
- (void)swapLayerAt:(int)index1 withIndex:(int)index2;

/**
* Returns the audio data of this composition, which is an AAC audio in an MPEG-4 container.
*/
- (NSData*)audioBytes;

/**
* Returns when the first frame of the audio plays in the composition's timeline.
*/
- (int64_t)audioStartTime;

/**
* Returns the audio Markers of the composition.
*/
- (NSArray<PAGMarker*>*)audioMarkers;

/**
* Returns an array of layers that match the specified layer name.
*/
- (NSArray<PAGLayer*>*)getLayersByName:(NSString*)layerName;

/**
* Returns an array of layers that lie under the specified point. The point is in pixels and from
* this PAGComposition's local coordinates.
*/
- (NSArray<PAGLayer*>*)getLayersUnderPoint:(CGPoint)point;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////////////////////////
//
// Tencent is pleased to support the open source community by making libpag available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// unless required by applicable law or agreed to in writing, software distributed under the
// license is distributed on an "as is" basis, without warranties or conditions of any kind,
// either express or implied. see the license for the specific language governing permissions
// and limitations under the license.
//
/////////////////////////////////////////////////////////////////////////////////////////////////

#import <Foundation/Foundation.h>
#import "PAG.h"

/**
* Defines methods to manage the disk cache capabilities.
*/
PAG_API @interface PAGDiskCache : NSObject

/**
* Returns the size limit of the disk cache in bytes. The default value is 1 GB.
*/
+ (size_t)MaxDiskSize;

/**
* Sets the size limit of the disk cache in bytes, which will triggers the cache cleanup if the
* disk usage exceeds the limit. The opened files are not removed immediately, even if their disk
* usage exceeds the limit, and they will be rechecked after they are closed.
*/
+ (void)SetMaxDiskSize:(size_t)size;

/**
* Removes all cached files from the disk. All the opened files will be also removed after they
* are closed.
*/
+ (void)RemoveAll;

@end
Loading

0 comments on commit 8ce6172

Please sign in to comment.