OSDN Git Service

Move common type definition(e.g. rect,mtarix) move to SwfBaseType module.
authormzp <mzpppp@gmail.com>
Mon, 12 Oct 2009 02:30:00 +0000 (11:30 +0900)
committermzp <mzpppp@gmail.com>
Mon, 12 Oct 2009 02:30:00 +0000 (11:30 +0900)
Common type definition(e.g. rect,matrix) move to SwfBaseType module.

swflib/OMakefile
swflib/swfBaseOut.ml
swflib/swfBaseOut.mli
swflib/swfBaseType.ml [new file with mode: 0644]
swflib/swfOut.ml
swflib/swfType.ml
swflib/tagOut.ml

index 5445e1c..9ff86e8 100644 (file)
@@ -22,6 +22,7 @@ FILES[] =
        bitsOut
        tagOut
        swfBaseOut
+       swfBaseType
        swfType
        swfOut
        swf
index c46a51b..20c4b58 100644 (file)
@@ -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
index e68e0da..416b6ed 100644 (file)
@@ -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 (file)
index 0000000..fa647f7
--- /dev/null
@@ -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)
+}
+
index 401d9d0..b7b781b 100644 (file)
@@ -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 =
index d827e52..4f82fe7 100644 (file)
@@ -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
index 7be628b..44ad0b1 100644 (file)
@@ -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