gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/Stage.cpp server/a...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/asobj/Stage.cpp server/a...
Date: Wed, 12 Mar 2008 11:47:56 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/03/12 11:47:56

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

Log message:
                * server/asobj/Stage.cpp: don't call align 'width'; implement
                  getting and setting Stage.align, though it won't do anything.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5886&r2=1.5887
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Stage.cpp?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Stage.h?cvsroot=gnash&r1=1.12&r2=1.13

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5886
retrieving revision 1.5887
diff -u -b -r1.5886 -r1.5887
--- ChangeLog   12 Mar 2008 11:18:50 -0000      1.5886
+++ ChangeLog   12 Mar 2008 11:47:55 -0000      1.5887
@@ -1,3 +1,8 @@
+2008-03-12 Benjamin Wolsey <address@hidden>
+
+       * server/asobj/Stage.cpp: don't call align 'width'; implement
+         getting and setting Stage.align, though it won't do anything.
+
 2008-03-12 Sandro Santilli <address@hidden>
 
        * backend/render_handler_agg.cpp,

Index: server/asobj/Stage.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Stage.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/asobj/Stage.cpp      6 Mar 2008 15:29:57 -0000       1.31
+++ server/asobj/Stage.cpp      12 Mar 2008 11:47:56 -0000      1.32
@@ -61,7 +61,7 @@
        getset = stage_align_getset;
        vm.registerNative(getset, 666, 3);
        vm.registerNative(getset, 666, 4);
-       o.init_property("width", getset, getset);
+       o.init_property("align", getset, getset);
 
        // Stage.width getter-setter
        getset = stage_width_getset;
@@ -86,7 +86,8 @@
 Stage::Stage()
        :
        as_object(getObjectInterface()),
-       _scaleMode(showAll)
+       _scaleMode(showAll),
+       _alignMode(ALIGN_MODE_NONE)
 {
        attachStageInterface(*this);
 
@@ -148,6 +149,23 @@
        return modeName[_scaleMode];
 }
 
+const char*
+Stage::getAlignModeString()
+{
+       static const char* alignName[] = {
+               "T",
+               "B",
+               "L",
+               "R",
+               "LT",
+               "TR",
+               "LB",
+               "RB",
+               "" };
+
+       return alignName[_alignMode];
+}
+
 void
 Stage::setScaleMode(ScaleMode mode)
 {
@@ -168,6 +186,22 @@
        }
 }
 
+void
+Stage::setAlignMode(AlignMode mode)
+{
+       if ( _alignMode == mode ) return; // nothing to do
+
+       _alignMode = mode;
+
+       static bool warned = false;
+       if ( ! warned ) {
+               log_unimpl("Stage.align goes through "
+                           "the motions but is not implemented");
+               warned = true;
+       }
+
+}
+
 as_value stage_scalemode_getset(const fn_call& fn)
 {
        boost::intrusive_ptr<Stage> stage = ensureType<Stage>(fn.this_ptr);
@@ -233,20 +267,26 @@
 
        if ( fn.nargs == 0 ) // getter
        {
-               static bool warned=false;
-               if ( ! warned ) {
-                       log_unimpl("Stage.align getter");
-                       warned=true;
-               }
-               return as_value();
+           return as_value (stage->getAlignModeString());
        }
        else // setter
        {
-               static bool warned=false;
-               if ( ! warned ) {
-                       log_unimpl("Stage.align setter");
-                       warned=true;
-               }
+               Stage::AlignMode mode;
+
+               const std::string& str = fn.arg(0).to_string();
+
+               if ( str == "T" ) mode = Stage::T;
+               else if ( str == "B" ) mode = Stage::B;
+               else if ( str == "L" ) mode = Stage::L;
+               else if ( str == "R" ) mode = Stage::R;
+               else if ( str == "LT" || str == "TL" ) mode = Stage::LT;
+               else if ( str == "TR" || str == "RT" ) mode = Stage::TR;
+               else if ( str == "LB" || str == "BL" ) mode = Stage::LB;
+               else if ( str == "RB" || str == "BR" ) mode = Stage::RB;
+        else mode = Stage::ALIGN_MODE_NONE;
+        
+               stage->setAlignMode(mode);
+
                return as_value();
        }
 }

Index: server/asobj/Stage.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Stage.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- server/asobj/Stage.h        21 Jan 2008 20:55:58 -0000      1.12
+++ server/asobj/Stage.h        12 Mar 2008 11:47:56 -0000      1.13
@@ -46,6 +46,18 @@
                noBorder
        } ScaleMode;
 
+    typedef enum {
+               T,
+               B,
+               L,
+               R,
+               LT,
+               TR,
+               LB,
+               RB,
+        ALIGN_MODE_NONE      
+    } AlignMode;
+
        Stage();
 
        // override from as_object ?
@@ -78,12 +90,19 @@
        ///
        const char* getScaleModeString();
 
+       /// Set align mode 
+       void setAlignMode(AlignMode mode);
+       
+       const char* getAlignModeString();
+
 private:
 
        /// Notify all listeners about a resize event
        void notifyResize();
 
        ScaleMode _scaleMode;
+       
+       AlignMode _alignMode;
 };
 
 




reply via email to

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