From ab13164aef2b29c3eda085e3a80bd2a2249bf43f Mon Sep 17 00:00:00 2001 From: mzp Date: Mon, 12 Oct 2009 11:30:00 +0900 Subject: [PATCH] Move common type definition(e.g. rect,mtarix) move to SwfBaseType module. Common type definition(e.g. rect,matrix) move to SwfBaseType module. --- swflib/OMakefile | 1 + swflib/swfBaseOut.ml | 7 +------ swflib/swfBaseOut.mli | 8 +------- swflib/swfBaseType.ml | 13 +++++++++++++ swflib/swfOut.ml | 2 +- swflib/swfType.ml | 8 +------- swflib/tagOut.ml | 2 +- 7 files changed, 19 insertions(+), 22 deletions(-) create mode 100644 swflib/swfBaseType.ml diff --git a/swflib/OMakefile b/swflib/OMakefile index 5445e1c..9ff86e8 100644 --- a/swflib/OMakefile +++ b/swflib/OMakefile @@ -22,6 +22,7 @@ FILES[] = bitsOut tagOut swfBaseOut + swfBaseType swfType swfOut swf diff --git a/swflib/swfBaseOut.ml b/swflib/swfBaseOut.ml index c46a51b..20c4b58 100644 --- a/swflib/swfBaseOut.ml +++ b/swflib/swfBaseOut.ml @@ -1,5 +1,6 @@ open Base open StdLabels +open SwfBaseType open ExtString type bit = @@ -21,12 +22,6 @@ type byte = [ | `Bits of bit list ] -type matrix = { - scale: (float * float) option; - rotate: (float * float) option; - translate: (int*int) -} - type compose = [ `Fixed of float | `Fixed8 of float diff --git a/swflib/swfBaseOut.mli b/swflib/swfBaseOut.mli index e68e0da..416b6ed 100644 --- a/swflib/swfBaseOut.mli +++ b/swflib/swfBaseOut.mli @@ -3,12 +3,6 @@ type bit = | UB of int * int | FB of int * float -type matrix = { - scale: (float * float) option; - rotate: (float * float) option; - translate: (int*int) -} - type s = [ `Si8 of int | `Si16 of int @@ -31,7 +25,7 @@ type s = [ | `ARGB of int * int * int * int | `Str of string | `Lang of int -| `Matrix of matrix +| `Matrix of SwfBaseType.matrix ] type backpatch = [ diff --git a/swflib/swfBaseType.ml b/swflib/swfBaseType.ml new file mode 100644 index 0000000..fa647f7 --- /dev/null +++ b/swflib/swfBaseType.ml @@ -0,0 +1,13 @@ +type rect = { + left : int; + right : int; + top : int; + bottom : int; +} + +type matrix = { + scale: (float * float) option; + rotate: (float * float) option; + translate: (int*int) +} + diff --git a/swflib/swfOut.ml b/swflib/swfOut.ml index 401d9d0..b7b781b 100644 --- a/swflib/swfOut.ml +++ b/swflib/swfOut.ml @@ -10,7 +10,7 @@ module Make(Tag : TagType) = struct let char c = `Ui8 (Char.code c) - let of_rect {top; bottom; left; right} = + let of_rect {SwfBaseType.top=top; bottom; left; right} = `Rect(left,right,top,bottom) let of_tag tag = diff --git a/swflib/swfType.ml b/swflib/swfType.ml index d827e52..4f82fe7 100644 --- a/swflib/swfType.ml +++ b/swflib/swfType.ml @@ -1,13 +1,7 @@ -type rect = { - left : int; - right : int; - top : int; - bottom : int; -} type 'a t = { version: int; - frame_size: rect; + frame_size: SwfBaseType.rect; frame_rate: float; frame_count: int; tags : 'a list diff --git a/swflib/tagOut.ml b/swflib/tagOut.ml index 7be628b..44ad0b1 100644 --- a/swflib/tagOut.ml +++ b/swflib/tagOut.ml @@ -15,7 +15,7 @@ type rect = { bottom:int } type t = [ -| `PlaceObject of int * int * SwfBaseOut.matrix +| `PlaceObject of int * int * SwfBaseType.matrix | `FrameLabel of string * bool | `Protect | `End -- 2.11.0