[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/button_character_instanc...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/button_character_instanc... |
Date: |
Sat, 09 Dec 2006 23:14:50 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/12/09 23:14:50
Modified files:
. : ChangeLog
server : button_character_instance.cpp
button_character_instance.h
Log message:
* server/button_character_instance.{cpp,h}: added missing
get_width() and get_height() overrides.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1907&r2=1.1908
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.cpp?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.h?cvsroot=gnash&r1=1.7&r2=1.8
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1907
retrieving revision 1.1908
diff -u -b -r1.1907 -r1.1908
--- ChangeLog 9 Dec 2006 22:59:53 -0000 1.1907
+++ ChangeLog 9 Dec 2006 23:14:49 -0000 1.1908
@@ -1,5 +1,7 @@
2006-12-09 Sandro Santilli <address@hidden>
+ * server/button_character_instance.{cpp,h}: added missing
+ get_width() and get_height() overrides.
* server/button_character_instance.cpp, server/dlist.cpp,
server/parser/action_buffer.cpp: cleanup debugging lines.
Index: server/button_character_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/button_character_instance.cpp 9 Dec 2006 22:59:53 -0000
1.21
+++ server/button_character_instance.cpp 9 Dec 2006 23:14:49 -0000
1.22
@@ -676,6 +676,32 @@
}
case M_WIDTH: // _width
{
+ float width = get_width();
+ if ( width ) width = TWIPS_TO_PIXELS(width);
+ val->set_double(width);
+ return true;
+ }
+ case M_HEIGHT: // _height
+ {
+ float width = get_height();
+ if ( width ) width = TWIPS_TO_PIXELS(width);
+ val->set_double(width);
+ return true;
+ }
+ } // end of switch
+
+ return false;
+}
+
+void
+button_character_instance::get_invalidated_bounds(rect* bounds, bool force)
+{
+ if (!m_visible) return; // not visible anyway
+
+ bounds->expand_to_rect(m_old_invalidated_bounds);
+
+ // TODO: Instead of using these for loops again and again, wouldn't it be a
+ // good idea to have a generic "get_record_character()" method?
for (unsigned int i = 0; i < m_def->m_button_records.size();
i++)
{
button_record& rec = m_def->m_button_records[i];
@@ -687,18 +713,17 @@
|| (m_mouse_state == DOWN && rec.m_down)
|| (m_mouse_state == OVER && rec.m_over))
{
-
val->set_double(TWIPS_TO_PIXELS(m_record_character[i]->get_width()));
- // @@ evan: should we return here?
- return true;
+
/*bounds->expand_to_transformed_rect(get_world_matrix(),
+ m_record_character[i]->get_bound());*/
+ m_record_character[i]->get_invalidated_bounds(bounds,
+ force||m_invalidated);
}
}
+}
- // from the experiments with macromedia flash player
- val->set_double(0);
- return true;
- }
- case M_HEIGHT: // _height
- {
+float
+button_character_instance::get_width() const
+{
for (unsigned int i = 0; i < m_def->m_button_records.size();
i++)
{
button_record& rec = m_def->m_button_records[i];
@@ -710,30 +735,15 @@
|| (m_mouse_state == DOWN && rec.m_down)
|| (m_mouse_state == OVER && rec.m_over))
{
-
val->set_double(TWIPS_TO_PIXELS(m_record_character[i]->get_height()));
- // @@ evan: should we return here?
- return true;
+ return m_record_character[i]->get_width();
}
}
-
- // from the experiments with macromedia flash player
- val->set_double(0);
- return true;
- }
- } // end of switch
-
- return false;
+ return 0.0;
}
-void
-button_character_instance::get_invalidated_bounds(rect* bounds, bool force)
+float
+button_character_instance::get_height() const
{
- if (!m_visible) return; // not visible anyway
-
- bounds->expand_to_rect(m_old_invalidated_bounds);
-
- // TODO: Instead of using these for loops again and again, wouldn't it be a
- // good idea to have a generic "get_record_character()" method?
for (unsigned int i = 0; i < m_def->m_button_records.size(); i++)
{
button_record& rec = m_def->m_button_records[i];
@@ -745,12 +755,10 @@
|| (m_mouse_state == DOWN && rec.m_down)
|| (m_mouse_state == OVER && rec.m_over))
{
-
/*bounds->expand_to_transformed_rect(get_world_matrix(),
- m_record_character[i]->get_bound());*/
- m_record_character[i]->get_invalidated_bounds(bounds,
- force||m_invalidated);
+ return m_record_character[i]->get_height();
}
}
+ return 0.0;
}
} // end of namespace gnash
Index: server/button_character_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/button_character_instance.h 28 Nov 2006 15:59:30 -0000 1.7
+++ server/button_character_instance.h 9 Dec 2006 23:14:49 -0000 1.8
@@ -5,7 +5,7 @@
// SWF buttons. Mouse-sensitive update/display, actions, etc.
-/* $Id: button_character_instance.h,v 1.7 2006/11/28 15:59:30 strk Exp $ */
+/* $Id: button_character_instance.h,v 1.8 2006/12/09 23:14:49 strk Exp $ */
#ifndef GNASH_BUTTON_CHARACTER_INSTANCE_H
#define GNASH_BUTTON_CHARACTER_INSTANCE_H
@@ -112,6 +112,11 @@
// not sure if we need to override this one.
//virtual const char* get_text_value() const { return NULL; } //
edit_text_character overrides this
+
+ virtual float get_width() const;
+
+ virtual float get_height() const;
+
};
} // end namespace gnash