gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/mo...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/movie_root.cpp server/mo...
Date: Wed, 23 Apr 2008 15:13:50 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/04/23 15:13:50

Modified files:
        .              : ChangeLog 
        server         : movie_root.cpp movie_root.h 
        server/asobj   : Stage.cpp Stage.h 

Log message:
                * server/movie_root.{h,cpp}: add private members and enums
                  to track stage alignment.
                * server/asobj/Stage.{h,cpp}: set alignment in movie_root
                  when Stage.align changes. Stage is responsible for working
                  out the actual alignment when two competing alignments (L/R,
                  T/B) are set.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6359&r2=1.6360
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.181&r2=1.182
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.122&r2=1.123
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Stage.cpp?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Stage.h?cvsroot=gnash&r1=1.16&r2=1.17

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6359
retrieving revision 1.6360
diff -u -b -r1.6359 -r1.6360
--- ChangeLog   23 Apr 2008 14:55:27 -0000      1.6359
+++ ChangeLog   23 Apr 2008 15:13:48 -0000      1.6360
@@ -1,3 +1,12 @@
+2008-04-23 Benjamin Wolsey <address@hidden>
+
+       * server/movie_root.{h,cpp}: add private members and enums
+         to track stage alignment.
+       * server/asobj/Stage.{h,cpp}: set alignment in movie_root
+         when Stage.align changes. Stage is responsible for working
+         out the actual alignment when two competing alignments (L/R,
+         T/B) are set.
+
 2008-04-23 Sandro Santilli <address@hidden>
 
        * gui/gui.{cpp,h}: Put stage matrix computation in its own

Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -b -r1.181 -r1.182
--- server/movie_root.cpp       23 Apr 2008 13:50:52 -0000      1.181
+++ server/movie_root.cpp       23 Apr 2008 15:13:49 -0000      1.182
@@ -54,8 +54,7 @@
 namespace gnash
 {
 
-gnash::interfaceEventCallback
-movie_root::interfaceHandle = NULL;
+gnash::interfaceEventCallback movie_root::interfaceHandle = NULL;
 
 inline bool
 movie_root::testInvariant() const
@@ -1287,6 +1286,14 @@
 }
 
 void
+movie_root::setStageAlignment(StageHorizontalAlign h, StageVerticalAlign v)
+{
+    _valign = v;
+    _halign = h;
+    log_debug("valign: %d, halign: %d", _valign, _halign);
+}
+
+void
 movie_root::add_invalidated_bounds(InvalidatedRanges& ranges, bool force)
 {
        if ( isInvalidated() )

Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -b -r1.122 -r1.123
--- server/movie_root.h 23 Apr 2008 13:29:54 -0000      1.122
+++ server/movie_root.h 23 Apr 2008 15:13:49 -0000      1.123
@@ -509,6 +509,21 @@
 
     bool testInvariant() const;
 
+    enum StageHorizontalAlign {
+        STAGE_H_ALIGN_C,
+        STAGE_H_ALIGN_L,
+        STAGE_H_ALIGN_R,
+    };
+
+
+    enum StageVerticalAlign {
+        STAGE_V_ALIGN_C,
+        STAGE_V_ALIGN_T,       
+        STAGE_V_ALIGN_B
+    };    
+
+    void setStageAlignment(StageHorizontalAlign v, StageVerticalAlign h);
+
     /// Action priority levels
     enum ActionPriorityLevel {
 
@@ -973,6 +988,9 @@
     /// -1 if none
     ///
     int _hostfd;
+    
+    StageVerticalAlign _valign;
+    StageHorizontalAlign _halign;
 };
 
 

Index: server/asobj/Stage.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Stage.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/asobj/Stage.cpp      13 Mar 2008 16:16:34 -0000      1.37
+++ server/asobj/Stage.cpp      23 Apr 2008 15:13:49 -0000      1.38
@@ -227,6 +227,44 @@
 
 }
 
+void
+Stage::setAlignMode(const std::string& mode)
+{
+    if (_alignMode == mode) return;
+
+    _alignMode = mode;
+    
+    movie_root::StageVerticalAlign v = movie_root::STAGE_V_ALIGN_C;
+    movie_root::StageHorizontalAlign h = movie_root::STAGE_H_ALIGN_C;
+
+    // Order: LTRB. L and T take precedence.
+
+    for (std::string::const_reverse_iterator it = _alignMode.rbegin();
+        it != _alignMode.rend();
+        ++it)
+    {
+        switch (*it)
+        {
+            case 'R':
+                h = movie_root::STAGE_H_ALIGN_R;
+                break;
+            case 'L':
+                h = movie_root::STAGE_H_ALIGN_L;
+                break;
+            case 'B':
+                v = movie_root::STAGE_V_ALIGN_B;
+                break;
+            case 'T':
+                v = movie_root::STAGE_V_ALIGN_T;
+                break;
+        }
+    }
+
+    movie_root& m = VM::get().getRoot();
+    m.setStageAlignment(h, v);   
+
+}
+
 as_value stage_scalemode_getset(const fn_call& fn)
 {
        boost::intrusive_ptr<Stage> stage = ensureType<Stage>(fn.this_ptr);
@@ -301,8 +339,7 @@
        {
 
                const std::string& str = fn.arg(0).to_string();
-
-        std::string alignMode = "";
+        std::string alignMode;
 
         if (str.find_first_of("lL") != std::string::npos)
         {

Index: server/asobj/Stage.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Stage.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- server/asobj/Stage.h        26 Mar 2008 21:34:23 -0000      1.16
+++ server/asobj/Stage.h        23 Apr 2008 15:13:50 -0000      1.17
@@ -35,17 +35,17 @@
 
 public:
 
-       typedef enum {
+       enum ScaleMode {
                showAll,
                noScale,
                exactFill,
                noBorder
-       } ScaleMode;
+       };
     
-    typedef enum {
+    enum DisplayState {
                normal,
                fullScreen
-       } DisplayState;
+       };
 
 
        Stage();
@@ -84,7 +84,7 @@
     const std::string& getAlignMode() const { return _alignMode; }
 
     /// Set align mode
-    void setAlignMode(const std::string& mode) { _alignMode = mode; }
+    void setAlignMode(const std::string& mode);
 
        /// Set display state 
        void setDisplayState(DisplayState state);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]