[Top][All Lists]
[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: |
Thu, 13 Mar 2008 16:16:35 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/03/13 16:16:35
Modified files:
. : ChangeLog
server/asobj : Stage.cpp Stage.h
Log message:
* server/asobj/Stage.{h,cpp}: make Stage.align methods work
properly.
It's still not really implemented. More swfdec passes.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5902&r2=1.5903
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Stage.cpp?cvsroot=gnash&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Stage.h?cvsroot=gnash&r1=1.14&r2=1.15
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5902
retrieving revision 1.5903
diff -u -b -r1.5902 -r1.5903
--- ChangeLog 13 Mar 2008 16:11:34 -0000 1.5902
+++ ChangeLog 13 Mar 2008 16:16:33 -0000 1.5903
@@ -2,6 +2,8 @@
* testsuite/actionscript.all/Stage.as: More tests for Stage.align.
It's obvious what it does now.
+ * server/asobj/Stage.{h,cpp}: make Stage.align methods work properly.
+ It's still not really implemented. More swfdec passes.
2008-03-13 Benjamin Wolsey <address@hidden>
Index: server/asobj/Stage.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Stage.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- server/asobj/Stage.cpp 13 Mar 2008 15:05:03 -0000 1.36
+++ server/asobj/Stage.cpp 13 Mar 2008 16:16:34 -0000 1.37
@@ -109,7 +109,7 @@
:
as_object(getObjectInterface()),
_scaleMode(showAll),
- _alignMode(ALIGN_MODE_NONE),
+ _alignMode(""),
_displayState(normal)
{
attachStageInterface(*this);
@@ -190,23 +190,6 @@
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)
{
@@ -225,22 +208,6 @@
}
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;
- }
-
-}
-
-void
Stage::setDisplayState(DisplayState state)
{
if ( _displayState == state ) return; // nothing to do
@@ -260,7 +227,6 @@
}
-
as_value stage_scalemode_getset(const fn_call& fn)
{
boost::intrusive_ptr<Stage> stage = ensureType<Stage>(fn.this_ptr);
@@ -324,41 +290,41 @@
{
boost::intrusive_ptr<Stage> stage = ensureType<Stage>(fn.this_ptr);
+ log_unimpl(_("Stage.alignMode goes through the motions but is not "
+ "properly implemented."));
+
if ( fn.nargs == 0 ) // getter
{
- return as_value (stage->getAlignModeString());
+ return as_value (stage->getAlignMode());
}
else // setter
{
- Stage::AlignMode mode;
const std::string& str = fn.arg(0).to_string();
- StringNoCaseEqual noCaseCompare;
+ std::string alignMode = "";
- if ( noCaseCompare(str, "T") ) mode = Stage::T;
- else if ( noCaseCompare(str, "B") ) mode = Stage::B;
- else if ( noCaseCompare(str, "L") ) mode = Stage::L;
- else if ( noCaseCompare(str, "R") ) mode = Stage::R;
- else if ( noCaseCompare(str, "LT") || noCaseCompare(str, "TL") )
+ if (str.find_first_of("lL") != std::string::npos)
{
- mode = Stage::LT;
+ alignMode.push_back('L');
}
- else if ( noCaseCompare(str, "TR") || noCaseCompare(str, "RT") )
+
+ if (str.find_first_of("tT") != std::string::npos)
{
- mode = Stage::TR;
+ alignMode.push_back('T');
}
- else if ( noCaseCompare(str, "LB") || noCaseCompare(str, "BL") )
+
+ if (str.find_first_of("rR") != std::string::npos)
{
- mode = Stage::LB;
+ alignMode.push_back('R');
}
- else if ( noCaseCompare(str, "RB") || noCaseCompare(str, "BR") )
+
+ if (str.find_first_of("bB") != std::string::npos)
{
- mode = Stage::RB;
+ alignMode.push_back('B');
}
- else mode = Stage::ALIGN_MODE_NONE;
- stage->setAlignMode(mode);
+ stage->setAlignMode(alignMode);
return as_value();
}
Index: server/asobj/Stage.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Stage.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/asobj/Stage.h 13 Mar 2008 12:23:07 -0000 1.14
+++ server/asobj/Stage.h 13 Mar 2008 16:16:35 -0000 1.15
@@ -47,18 +47,6 @@
} ScaleMode;
typedef enum {
- T,
- B,
- L,
- R,
- LT,
- TR,
- LB,
- RB,
- ALIGN_MODE_NONE
- } AlignMode;
-
- typedef enum {
normal,
fullScreen
} DisplayState;
@@ -96,10 +84,11 @@
///
const char* getScaleModeString();
- /// Set align mode
- void setAlignMode(AlignMode mode);
+ /// Get present align mode
+ const std::string& getAlignMode() const { return _alignMode; }
- const char* getAlignModeString();
+ /// Set align mode
+ void setAlignMode(const std::string& mode) { _alignMode = mode; }
/// Set display state
void setDisplayState(DisplayState state);
@@ -113,7 +102,7 @@
ScaleMode _scaleMode;
- AlignMode _alignMode;
+ std::string _alignMode;
DisplayState _displayState;
};