| 1 | /* |
|---|
| 2 | * SubParsing.h |
|---|
| 3 | * Created by Alexander Strange on 7/25/07. |
|---|
| 4 | * |
|---|
| 5 | * This file is part of Perian. |
|---|
| 6 | * |
|---|
| 7 | * This library is free software; you can redistribute it and/or |
|---|
| 8 | * modify it under the terms of the GNU Lesser General Public |
|---|
| 9 | * License as published by the Free Software Foundation; either |
|---|
| 10 | * version 2.1 of the License, or (at your option) any later version. |
|---|
| 11 | * |
|---|
| 12 | * This library is distributed in the hope that it will be useful, |
|---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 15 | * Lesser General Public License for more details. |
|---|
| 16 | * |
|---|
| 17 | * You should have received a copy of the GNU Lesser General Public |
|---|
| 18 | * License along with FFmpeg; if not, write to the Free Software |
|---|
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | #import <Cocoa/Cocoa.h> |
|---|
| 23 | #import "SubContext.h" |
|---|
| 24 | |
|---|
| 25 | #ifdef __cplusplus |
|---|
| 26 | extern "C" |
|---|
| 27 | { |
|---|
| 28 | #endif |
|---|
| 29 | |
|---|
| 30 | @class SubSerializer, SubRenderer; |
|---|
| 31 | |
|---|
| 32 | @interface SubRenderDiv : NSObject { |
|---|
| 33 | @public; |
|---|
| 34 | NSMutableString *text; |
|---|
| 35 | SubStyle *styleLine; |
|---|
| 36 | unsigned marginL, marginR, marginV; |
|---|
| 37 | NSMutableArray *spans; |
|---|
| 38 | |
|---|
| 39 | int posX, posY; |
|---|
| 40 | UInt8 alignH, alignV, wrapStyle, render_complexity; |
|---|
| 41 | BOOL positioned; |
|---|
| 42 | |
|---|
| 43 | unsigned layer; |
|---|
| 44 | } |
|---|
| 45 | -(SubRenderDiv*)nextDivWithDelegate:(SubRenderer*)delegate; |
|---|
| 46 | @end |
|---|
| 47 | |
|---|
| 48 | @interface SubRenderSpan : NSObject { |
|---|
| 49 | @public; |
|---|
| 50 | UniCharArrayOffset offset; |
|---|
| 51 | id ex; |
|---|
| 52 | SubRenderer *delegate; |
|---|
| 53 | } |
|---|
| 54 | +(SubRenderSpan*)startingSpanForDiv:(SubRenderDiv*)div delegate:(SubRenderer*)delegate; |
|---|
| 55 | -(SubRenderSpan*)cloneWithDelegate:(SubRenderer*)delegate; |
|---|
| 56 | @end |
|---|
| 57 | |
|---|
| 58 | extern void SubParseSSAFile(NSString *ssa, NSDictionary **headers, NSArray **styles, NSArray **subs); |
|---|
| 59 | extern NSArray *SubParsePacket(NSString *packet, SubContext *context, SubRenderer *delegate); |
|---|
| 60 | |
|---|
| 61 | #ifdef __cplusplus |
|---|
| 62 | } |
|---|
| 63 | #endif |
|---|