aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx
diff options
context:
space:
mode:
authorFilippos Karapetis2009-06-02 14:16:59 +0000
committerFilippos Karapetis2009-06-02 14:16:59 +0000
commit98f64cfa2f76a5faa1cdea5c47e175aea2e75940 (patch)
tree76ba60fd185c638b4360b9efe1698213c69df232 /engines/sci/gfx
parentc1d01223aa7283e18d42ee0b2680b6b3bc0afe8f (diff)
downloadscummvm-rg350-98f64cfa2f76a5faa1cdea5c47e175aea2e75940.tar.gz
scummvm-rg350-98f64cfa2f76a5faa1cdea5c47e175aea2e75940.tar.bz2
scummvm-rg350-98f64cfa2f76a5faa1cdea5c47e175aea2e75940.zip
Removed the gfxw_new_visual and gfxw_new_port wrappers, moved _kfuncTable inside the Kernel class and moved gfxw_find_port inside the GfxVisual struct
svn-id: r41125
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r--engines/sci/gfx/gfx_gui.cpp2
-rw-r--r--engines/sci/gfx/gfx_state_internal.h14
-rw-r--r--engines/sci/gfx/gfx_widgets.cpp15
-rw-r--r--engines/sci/gfx/gfx_widgets.h30
4 files changed, 15 insertions, 46 deletions
diff --git a/engines/sci/gfx/gfx_gui.cpp b/engines/sci/gfx/gfx_gui.cpp
index d4df4d9ff3..f73a13d6dd 100644
--- a/engines/sci/gfx/gfx_gui.cpp
+++ b/engines/sci/gfx/gfx_gui.cpp
@@ -171,7 +171,7 @@ GfxPort *sciw_new_window(EngineState *s,
area.height -= 1; // Normal windows are drawn one pixel too small.
sciw_make_window_fit(&area, s->wm_port);
- win = gfxw_new_port(visual, s->wm_port, area, color, bgcolor);
+ win = new GfxPort(visual, area, color, bgcolor);
win->_font = font;
win->title_text = title;
diff --git a/engines/sci/gfx/gfx_state_internal.h b/engines/sci/gfx/gfx_state_internal.h
index 8b1c443e86..c184492054 100644
--- a/engines/sci/gfx/gfx_state_internal.h
+++ b/engines/sci/gfx/gfx_state_internal.h
@@ -345,6 +345,10 @@ public:
virtual int draw(const Common::Point &pos);
virtual void print(int indentation) const;
virtual int setVisual(GfxVisual *);
+
+ GfxPort *getPort(int portId) {
+ return (portId < 0 || portId >= (int)_portRefs.size()) ? NULL : _portRefs[portId];
+ }
};
#define GFXW_IS_PORT(widget) ((widget)->_type == GFXW_PORT)
@@ -361,6 +365,16 @@ struct GfxPort : public GfxContainer {
byte gray_text; /**< Whether text is 'grayed out' (dithered) */
public:
+ /* Creates a new port widget with the default settings
+ ** Paramaters: (GfxVisual *) visual: The visual the port is added to
+ ** (GfxPort *) predecessor: The port's predecessor
+ ** (rect_t) area: The screen area covered by the port (absolute position)
+ ** (gfx_color_t) fgcolor: Foreground drawing color
+ ** (gfx_color_t) bgcolor: Background color
+ ** A port differentiates itself from a list in that it contains additional information,
+ ** and an optional title (stored in a display list).
+ ** Ports are assigned implicit IDs identifying their position within the port stack.
+ */
GfxPort(GfxVisual *visual, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor);
~GfxPort();
diff --git a/engines/sci/gfx/gfx_widgets.cpp b/engines/sci/gfx/gfx_widgets.cpp
index ad0b235115..ad9464811e 100644
--- a/engines/sci/gfx/gfx_widgets.cpp
+++ b/engines/sci/gfx/gfx_widgets.cpp
@@ -1440,10 +1440,6 @@ void _gfxw_set_ops_VISUAL(GfxContainer *visual) {
_gfxwop_container_add_dirty, _gfxwop_container_add);
}
-GfxVisual *gfxw_new_visual(GfxState *state, int font) {
- return new GfxVisual(state, font);
-}
-
GfxVisual::GfxVisual(GfxState *state, int font)
: GfxContainer(gfx_rect(0, 0, 320, 200), GFXW_VISUAL) {
@@ -1609,10 +1605,6 @@ void _gfxw_set_ops_PORT(GfxContainer *widget) {
_gfxwop_port_add_dirty, _gfxwop_port_add);
}
-GfxPort *gfxw_new_port(GfxVisual *visual, GfxPort *predecessor, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor) {
- return new GfxPort(visual, area, fgcolor, bgcolor);
-}
-
GfxPort::GfxPort(GfxVisual *visual_, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor_)
: GfxContainer(area, GFXW_PORT) {
VERIFY_WIDGET(visual_);
@@ -1659,13 +1651,6 @@ GfxPort *gfxw_remove_port(GfxVisual *visual, GfxPort *port) {
return parent;
}
-GfxPort *gfxw_find_port(GfxVisual *visual, int ID) {
- if (ID < 0 || ID >= (int)visual->_portRefs.size())
- return NULL;
-
- return visual->_portRefs[ID];
-}
-
GfxPort *gfxw_find_default_port(GfxVisual *visual) {
int id = visual->_portRefs.size();
diff --git a/engines/sci/gfx/gfx_widgets.h b/engines/sci/gfx/gfx_widgets.h
index 57c2b43c87..5b43c2cad6 100644
--- a/engines/sci/gfx/gfx_widgets.h
+++ b/engines/sci/gfx/gfx_widgets.h
@@ -311,36 +311,6 @@ GfxList *gfxw_new_list(rect_t area, int sorted);
** List widgets are also referred to as Display Lists.
*/
-GfxVisual *gfxw_new_visual(GfxState *state, int font);
-/* Creates a new visual widget
-** Parameters: (GfxState *) state: The graphics state
-** (int) font: The default font number for contained ports
-** Returns : (GfxList *) A newly allocated visual widget
-** Visual widgets are containers for port widgets.
-*/
-
-
-GfxPort *gfxw_new_port(GfxVisual *visual, GfxPort *predecessor, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor);
-/* Creates a new port widget with the default settings
-** Paramaters: (GfxVisual *) visual: The visual the port is added to
-** (GfxPort *) predecessor: The port's predecessor
-** (rect_t) area: The screen area covered by the port (absolute position)
-** (gfx_color_t) fgcolor: Foreground drawing color
-** (gfx_color_t) bgcolor: Background color
-** Returns : (GfxPort *) A newly allocated port widget
-** A port differentiates itself from a list in that it contains additional information,
-** and an optional title (stored in a display list).
-** Ports are assigned implicit IDs identifying their position within the port stack.
-*/
-
-GfxPort *gfxw_find_port(GfxVisual *visual, int ID);
-/* Retrieves a port with the specified ID
-** Parameters: (GfxVisual *) visual: The visual the port is to be retrieved from
-** (int) ID: The port's ID
-** Returns : (GfxPort *) The requested port, or NULL if it didn't exist
-** This function is O(1).
-*/
-
GfxPort *gfxw_find_default_port(GfxVisual *visual);
/* Retrieves the default port from a visual
** Parameters: (GfxVisual *) visual: The visual the port should be retrieved from