From 9445439c4ff745ef90c38403d82035abadf87ef2 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 24 Apr 2009 10:46:20 +0000 Subject: SCI: Renamed gfxw_widget_t and subtypes to GfxWidget etc. svn-id: r40104 --- engines/sci/engine/game.cpp | 2 +- engines/sci/engine/kevent.cpp | 2 +- engines/sci/engine/kgraphics.cpp | 120 ++++----- engines/sci/engine/kmenu.cpp | 4 +- engines/sci/engine/kpathing.cpp | 16 +- engines/sci/engine/kscripts.cpp | 2 +- engines/sci/engine/savegame.cpp | 2 +- engines/sci/engine/scriptdebug.cpp | 6 +- engines/sci/engine/state.h | 24 +- engines/sci/gfx/gfx_gui.cpp | 100 ++++---- engines/sci/gfx/gfx_gui.h | 54 ++-- engines/sci/gfx/gfx_state_internal.h | 86 +++---- engines/sci/gfx/gfx_widgets.cpp | 470 +++++++++++++++++------------------ engines/sci/gfx/gfx_widgets.h | 218 ++++++++-------- engines/sci/gfx/menubar.cpp | 4 +- engines/sci/gfx/menubar.h | 2 +- 16 files changed, 556 insertions(+), 556 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index 046d089d1a..939321df92 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -32,7 +32,7 @@ #include "sci/engine/kernel.h" #include "sci/engine/kernel_types.h" #include "sci/gfx/gfx_widgets.h" -#include "sci/gfx/gfx_state_internal.h" // required for gfxw_port_t, gfxw_visual_t +#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxVisual #include "sci/gfx/menubar.h" namespace Sci { diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 5b06855e54..4d6fbd08c0 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -26,7 +26,7 @@ #include "sci/engine/state.h" #include "sci/engine/kernel.h" #include "sci/gfx/gfx_widgets.h" -#include "sci/gfx/gfx_state_internal.h" // required for gfxw_port_t, gfxw_visual_t +#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxVisual namespace Sci { diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 132bead6d1..7500062d2d 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -30,7 +30,7 @@ #include "sci/engine/kernel.h" #include "sci/gfx/gfx_gui.h" #include "sci/gfx/gfx_widgets.h" -#include "sci/gfx/gfx_state_internal.h" // required for gfxw_container_t, gfxw_port_t, gfxw_visual_t +#include "sci/gfx/gfx_state_internal.h" // required for GfxContainer, GfxPort, GfxVisual namespace Sci { @@ -137,7 +137,7 @@ static void assert_primary_widget_lists(EngineState *s) { } } -static void reparentize_primary_widget_lists(EngineState *s, gfxw_port_t *newport) { +static void reparentize_primary_widget_lists(EngineState *s, GfxPort *newport) { if (!newport) newport = s->picture_port; @@ -224,7 +224,7 @@ void graph_restore_box(EngineState *s, reg_t handle) { while (port_nr > 2 && !(s->port->_flags & GFXW_FLAG_IMMUNE_TO_SNAPSHOTS) && (gfxw_widget_matches_snapshot(*ptr, GFXW(s->port)))) { // This shouldn't ever happen, actually, since windows (ports w/ ID > 2) should all be immune - gfxw_port_t *newport = gfxw_find_port(s->visual, port_nr); + GfxPort *newport = gfxw_find_port(s->visual, port_nr); SCIkwarn(SCIkERROR, "Port %d is not immune against snapshots!\n", s->port->_ID); port_nr--; if (newport) @@ -232,7 +232,7 @@ void graph_restore_box(EngineState *s, reg_t handle) { } if (s->dyn_views && gfxw_widget_matches_snapshot(*ptr, GFXW(s->dyn_views->_parent))) { - gfxw_container_t *parent = s->dyn_views->_parent; + GfxContainer *parent = s->dyn_views->_parent; do { parent = parent->_parent; @@ -243,7 +243,7 @@ void graph_restore_box(EngineState *s, reg_t handle) { BREAKPOINT(); } - reparentize_primary_widget_lists(s, (gfxw_port_t *) parent); + reparentize_primary_widget_lists(s, (GfxPort *) parent); } @@ -454,8 +454,8 @@ void _k_redraw_box(EngineState *s, int x1, int y1, int x2, int y2) { } void _k_graph_rebuild_port_with_color(EngineState *s, gfx_color_t newbgcolor) { - gfxw_port_t *port = s->port; - gfxw_port_t *newport; + GfxPort *port = s->port; + GfxPort *newport; newport = sciw_new_window(s, port->zone, port->font_nr, port->_color, newbgcolor, s->titlebar_port->font_nr, s->ega_colors[15], s->ega_colors[8], @@ -463,7 +463,7 @@ void _k_graph_rebuild_port_with_color(EngineState *s, gfx_color_t newbgcolor) { if (s->dyn_views) { int found = 0; - gfxw_container_t *parent = s->dyn_views->_parent; + GfxContainer *parent = s->dyn_views->_parent; while (parent && !(found |= (GFXW(parent) == GFXW(port)))) parent = parent->_parent; @@ -481,7 +481,7 @@ static int port_origin_y = 0; reg_t kGraph(EngineState *s, int funct_nr, int argc, reg_t *argv) { rect_t area; - gfxw_port_t *port = s->port; + GfxPort *port = s->port; int redraw_port = 0; area = gfx_rect(SKPV(2), SKPV(1) , SKPV(4), SKPV(3)); @@ -771,7 +771,7 @@ reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t * argv) { reg_t obj = argv[0]; reg_t cliplist_ref = KP_ALT(1, NULL_REG); List *cliplist = NULL; - gfxw_port_t *port = s->picture_port; + GfxPort *port = s->picture_port; uint16 signal; int retval; @@ -806,7 +806,7 @@ reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t * argv) { if ((illegal_bits & 0x8000) // If we are vulnerable to those views at all... && s->dyn_views) { // ...check against all stop-updated dynviews - gfxw_dyn_view_t *widget = (gfxw_dyn_view_t *) s->dyn_views->contents; + GfxDynView *widget = (GfxDynView *) s->dyn_views->contents; SCIkdebug(SCIkBRESEN, "Checking vs dynviews:\n"); @@ -817,7 +817,7 @@ reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t * argv) { if (collides_with(s, abs_zone, make_reg(widget->_ID, widget->_subID), 1, GASEOUS_VIEW_MASK_ACTIVE, funct_nr, argc, argv)) return not_register(s, NULL_REG); - widget = (gfxw_dyn_view_t *) widget->_next; + widget = (GfxDynView *) widget->_next; } } @@ -1700,7 +1700,7 @@ static void _k_draw_control(EngineState *s, reg_t obj, int inverse) { static void draw_rect_to_control_map(EngineState *s, Common::Rect abs_zone) { - gfxw_box_t *box; + GfxBox *box; gfx_color_t color; gfxop_set_color(s->gfx_state, &color, -1, -1, -1, -1, -1, 0xf); @@ -1715,7 +1715,7 @@ static void draw_rect_to_control_map(EngineState *s, Common::Rect abs_zone) { ADD_TO_CURRENT_PICTURE_PORT(box); } -static void draw_obj_to_control_map(EngineState *s, gfxw_dyn_view_t *view) { +static void draw_obj_to_control_map(EngineState *s, GfxDynView *view) { reg_t obj = make_reg(view->_ID, view->_subID); if (!is_object(s, obj)) @@ -1727,8 +1727,8 @@ static void draw_obj_to_control_map(EngineState *s, gfxw_dyn_view_t *view) { } } -static void _k_view_list_do_postdraw(EngineState *s, gfxw_list_t *list) { - gfxw_dyn_view_t *widget = (gfxw_dyn_view_t *) list->contents; +static void _k_view_list_do_postdraw(EngineState *s, GfxList *list) { + GfxDynView *widget = (GfxDynView *) list->contents; while (widget) { reg_t obj = make_reg(widget->_ID, widget->_subID); @@ -1776,14 +1776,14 @@ static void _k_view_list_do_postdraw(EngineState *s, gfxw_list_t *list) { *((reg_t *)(widget->signalp)) = make_reg(0, widget->signal & 0xffff); /* Write back signal */ } - widget = (gfxw_dyn_view_t *) widget->_next; + widget = (GfxDynView *) widget->_next; } } void _k_view_list_mark_free(EngineState *s, reg_t off) { if (s->dyn_views) { - gfxw_dyn_view_t *w = (gfxw_dyn_view_t *) s->dyn_views->contents; + GfxDynView *w = (GfxDynView *) s->dyn_views->contents; while (w) { if (w->_ID == off.segment @@ -1791,14 +1791,14 @@ void _k_view_list_mark_free(EngineState *s, reg_t off) { w->under_bitsp = NULL; } - w = (gfxw_dyn_view_t *) w->_next; + w = (GfxDynView *) w->_next; } } } static int _k_animate_ran = 0; -int _k_view_list_dispose_loop(EngineState *s, List *list, gfxw_dyn_view_t *widget, int funct_nr, int argc, reg_t *argv) { +int _k_view_list_dispose_loop(EngineState *s, List *list, GfxDynView *widget, int funct_nr, int argc, reg_t *argv) { // disposes all list members flagged for disposal; funct_nr is the invoking kfunction // returns non-zero IFF views were dropped int signal; @@ -1809,7 +1809,7 @@ int _k_view_list_dispose_loop(EngineState *s, List *list, gfxw_dyn_view_t *widge if (widget) { int retval; // Recurse: - retval = _k_view_list_dispose_loop(s, list, (gfxw_dyn_view_t *) widget->_next, funct_nr, argc, argv); + retval = _k_view_list_dispose_loop(s, list, (GfxDynView *) widget->_next, funct_nr, argc, argv); if (retval == -1) // Bail out on annihilation, rely on re-start from Animate() return -1; @@ -1888,7 +1888,7 @@ int _k_view_list_dispose_loop(EngineState *s, List *list, gfxw_dyn_view_t *widge #define _K_MAKE_VIEW_LIST_CALC_PRIORITY 2 #define _K_MAKE_VIEW_LIST_DRAW_TO_CONTROL_MAP 4 -static gfxw_dyn_view_t *_k_make_dynview_obj(EngineState *s, reg_t obj, int options, int nr, int funct_nr, int argc, reg_t *argv) { +static GfxDynView *_k_make_dynview_obj(EngineState *s, reg_t obj, int options, int nr, int funct_nr, int argc, reg_t *argv) { short oldloop, oldcel; int cel, loop, view_nr = GET_SEL32SV(obj, view); int palette; @@ -1897,7 +1897,7 @@ static gfxw_dyn_view_t *_k_make_dynview_obj(EngineState *s, reg_t obj, int optio reg_t *under_bitsp, *signalp; Common::Point pos; int z; - gfxw_dyn_view_t *widget; + GfxDynView *widget; SCIkdebug(SCIkGRAPHICS, " - Adding "PREG"\n", PRINT_REG(obj)); @@ -1955,7 +1955,7 @@ static gfxw_dyn_view_t *_k_make_dynview_obj(EngineState *s, reg_t obj, int optio widget = gfxw_new_dyn_view(s->gfx_state, pos, z, view_nr, loop, cel, palette, -1, -1, ALIGN_CENTER, ALIGN_BOTTOM, nr); if (widget) { - widget = (gfxw_dyn_view_t *) gfxw_set_id(GFXW(widget), obj.segment, obj.offset); + widget = (GfxDynView *) gfxw_set_id(GFXW(widget), obj.segment, obj.offset); widget = gfxw_dyn_view_set_params(widget, under_bits.segment, under_bitsp, signal, signalp); widget->_flags |= GFXW_FLAG_IMMUNE_TO_SNAPSHOTS; // Only works the first time 'round' @@ -1966,14 +1966,14 @@ static gfxw_dyn_view_t *_k_make_dynview_obj(EngineState *s, reg_t obj, int optio } } -static void _k_make_view_list(EngineState *s, gfxw_list_t **widget_list, List *list, int options, int funct_nr, int argc, reg_t *argv) { +static void _k_make_view_list(EngineState *s, GfxList **widget_list, List *list, int options, int funct_nr, int argc, reg_t *argv) { /* Creates a view_list from a node list in heap space. Returns the list, stores the ** number of list entries in *list_nr. Calls doit for each entry if cycle is set. ** argc, argv, funct_nr should be the same as in the calling kernel function. */ Node *node; int sequence_nr = 0; - gfxw_dyn_view_t *widget; + GfxDynView *widget; if (!*widget_list) { SCIkwarn(SCIkERROR, "make_view_list with widget_list == ()\n"); @@ -1993,7 +1993,7 @@ static void _k_make_view_list(EngineState *s, gfxw_list_t **widget_list, List *l while (node) { reg_t obj = node->value; // The object we're using reg_t next_node; - gfxw_dyn_view_t *tempWidget; + GfxDynView *tempWidget; if (options & _K_MAKE_VIEW_LIST_CYCLE) { unsigned int signal = GET_SEL32V(obj, signal); @@ -2017,18 +2017,18 @@ static void _k_make_view_list(EngineState *s, gfxw_list_t **widget_list, List *l node = LOOKUP_NODE(next_node); // Next node } - widget = (gfxw_dyn_view_t *)(*widget_list)->contents; + widget = (GfxDynView *)(*widget_list)->contents; while (widget) { // Read back widget values if (widget->signalp) widget->signal = ((reg_t *)(widget->signalp))->offset; - widget = (gfxw_dyn_view_t *) widget->_next; + widget = (GfxDynView *) widget->_next; } } -static void _k_prepare_view_list(EngineState *s, gfxw_list_t *list, int options) { - gfxw_dyn_view_t *view = (gfxw_dyn_view_t *) list->contents; +static void _k_prepare_view_list(EngineState *s, GfxList *list, int options) { + GfxDynView *view = (GfxDynView *) list->contents; while (view) { reg_t obj = make_reg(view->_ID, view->_subID); int priority, _priority; @@ -2107,13 +2107,13 @@ static void _k_prepare_view_list(EngineState *s, gfxw_list_t *list, int options) fprintf(stderr, "Unsetting magic StopUpd for view "PREG"\n", PRINT_REG(obj)); } */ - view = (gfxw_dyn_view_t *) view->_next; + view = (GfxDynView *) view->_next; } } -static void _k_update_signals_in_view_list(gfxw_list_t *old_list, gfxw_list_t *new_list) { +static void _k_update_signals_in_view_list(GfxList *old_list, GfxList *new_list) { // O(n^2)... a bit painful, but much faster than the redraws it helps prevent - gfxw_dyn_view_t *old_widget = (gfxw_dyn_view_t *) old_list->contents; + GfxDynView *old_widget = (GfxDynView *) old_list->contents; /* Traverses all old widgets, updates them with signals from the new widgets. ** This is done to avoid evil hacks in widget.c; widgets with unique IDs are @@ -2122,12 +2122,12 @@ static void _k_update_signals_in_view_list(gfxw_list_t *old_list, gfxw_list_t *n */ while (old_widget) { - gfxw_dyn_view_t *new_widget = (gfxw_dyn_view_t *) new_list->contents; + GfxDynView *new_widget = (GfxDynView *) new_list->contents; while (new_widget && (new_widget->_ID != old_widget->_ID || new_widget->_subID != old_widget->_subID)) - new_widget = (gfxw_dyn_view_t *) new_widget->_next; + new_widget = (GfxDynView *) new_widget->_next; if (new_widget) { int carry = old_widget->signal & _K_VIEW_SIG_FLAG_STOPUPD; @@ -2146,20 +2146,20 @@ static void _k_update_signals_in_view_list(gfxw_list_t *old_list, gfxw_list_t *n old_widget->signal = new_widget->signal |= carry; } - old_widget = (gfxw_dyn_view_t *) old_widget->_next; + old_widget = (GfxDynView *) old_widget->_next; } } -static void _k_view_list_kryptonize(gfxw_widget_t *v) { +static void _k_view_list_kryptonize(GfxWidget *v) { if (v) { v->_flags &= ~GFXW_FLAG_IMMUNE_TO_SNAPSHOTS; _k_view_list_kryptonize(v->_next); } } -static void _k_raise_topmost_in_view_list(EngineState *s, gfxw_list_t *list, gfxw_dyn_view_t *view) { +static void _k_raise_topmost_in_view_list(EngineState *s, GfxList *list, GfxDynView *view) { if (view) { - gfxw_dyn_view_t *next = (gfxw_dyn_view_t *)view->_next; + GfxDynView *next = (GfxDynView *)view->_next; // step 11 if ((view->signal & (_K_VIEW_SIG_FLAG_NO_UPDATE | _K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)) == 0) { @@ -2184,8 +2184,8 @@ static void _k_raise_topmost_in_view_list(EngineState *s, gfxw_list_t *list, gfx } } -static void _k_redraw_view_list(EngineState *s, gfxw_list_t *list) { - gfxw_dyn_view_t *view = (gfxw_dyn_view_t *) list->contents; +static void _k_redraw_view_list(EngineState *s, GfxList *list) { + GfxDynView *view = (GfxDynView *) list->contents; while (view) { SCIkdebug(SCIkGRAPHICS, " dv["PREG"]: signal %04x\n", make_reg(view->_ID, view->_subID), view->signal); @@ -2221,7 +2221,7 @@ static void _k_redraw_view_list(EngineState *s, gfxw_list_t *list) { SCIkdebug(SCIkGRAPHICS, " -> signal %04x\n", view->signal); - view = (gfxw_dyn_view_t *) view->_next; + view = (GfxDynView *) view->_next; } } @@ -2235,9 +2235,9 @@ static void _k_redraw_view_list(EngineState *s, gfxw_list_t *list) { // Draw as picviews #define _K_DRAW_VIEW_LIST_PICVIEW 8 -void _k_draw_view_list(EngineState *s, gfxw_list_t *list, int flags) { +void _k_draw_view_list(EngineState *s, GfxList *list, int flags) { // Draws list_nr members of list to s->pic. - gfxw_dyn_view_t *widget = (gfxw_dyn_view_t *) list->contents; + GfxDynView *widget = (GfxDynView *) list->contents; if (GFXWC(s->port) != GFXWC(s->dyn_views->_parent)) return; // Return if the pictures are meant for a different port @@ -2274,20 +2274,20 @@ void _k_draw_view_list(EngineState *s, gfxw_list_t *list, int flags) { // disposeables and this one isn't disposeable } - widget = (gfxw_dyn_view_t *) widget->_next; + widget = (GfxDynView *) widget->_next; } // while (widget) } reg_t kAddToPic(EngineState *s, int funct_nr, int argc, reg_t *argv) { - gfxw_list_t *pic_views; + GfxList *pic_views; reg_t list_ref = argv[0]; assert_primary_widget_lists(s); if (argc > 1) { int view, cel, loop, x, y, priority, control; - gfxw_widget_t *widget; + GfxWidget *widget; view = KP_UINT(argv[0]); loop = KP_UINT(argv[1]); @@ -2308,7 +2308,7 @@ reg_t kAddToPic(EngineState *s, int funct_nr, int argc, reg_t *argv) { Common::Rect abs_zone = nsrect_clip(s, y, calculate_nsrect(s, x, y, view, loop, cel), priority); draw_rect_to_control_map(s, abs_zone); } - ADD_TO_CURRENT_PICTURE_PORT(gfxw_picviewize_dynview((gfxw_dyn_view_t *) widget)); + ADD_TO_CURRENT_PICTURE_PORT(gfxw_picviewize_dynview((GfxDynView *) widget)); } } else { List *list; @@ -2352,7 +2352,7 @@ reg_t kSetPort(EngineState *s, int funct_nr, int argc, reg_t *argv) { switch (argc) { case 1 : { unsigned int port_nr = SKPV(0); - gfxw_port_t *new_port; + GfxPort *new_port; /* We depart from official semantics here, sorry! Reasoning: Sierra SCI does not clip ports while we do. @@ -2408,7 +2408,7 @@ reg_t kDrawCel(EngineState *s, int funct_nr, int argc, reg_t *argv) { int x = SKPV(3); int y = SKPV(4); int priority = SKPV_OR_ALT(5, -1); - gfxw_view_t *new_view; + GfxView *new_view; /* if (!view) { @@ -2435,8 +2435,8 @@ reg_t kDrawCel(EngineState *s, int funct_nr, int argc, reg_t *argv) { reg_t kDisposeWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) { unsigned int goner_nr = SKPV(0); - gfxw_port_t *goner; - gfxw_port_t *pred; + GfxPort *goner; + GfxPort *pred; int id = s->visual->port_refs_nr; goner = gfxw_find_port(s->visual, goner_nr); @@ -2446,7 +2446,7 @@ reg_t kDisposeWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) { } if (s->dyn_views && GFXWC(s->dyn_views->_parent) == GFXWC(goner)) { - reparentize_primary_widget_lists(s, (gfxw_port_t *) goner->_parent); + reparentize_primary_widget_lists(s, (GfxPort *) goner->_parent); } if (s->drop_views && GFXWC(s->drop_views->_parent) == GFXWC(goner)) @@ -2473,7 +2473,7 @@ reg_t kDisposeWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) { } reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) { - gfxw_port_t *window; + GfxPort *window; int x, y, xl, yl, flags; gfx_color_t bgcolor; gfx_color_t fgcolor; @@ -2998,7 +2998,7 @@ reg_t kAnimate(EngineState *s, int funct_nr, int argc, reg_t *argv) { reparentize_primary_widget_lists(s, s->port); if (cast_list) { - gfxw_list_t *templist = gfxw_new_list(s->dyn_views->_bounds, 0); + GfxList *templist = gfxw_new_list(s->dyn_views->_bounds, 0); _k_make_view_list(s, &(templist), cast_list, (cycle ? _K_MAKE_VIEW_LIST_CYCLE : 0) | _K_MAKE_VIEW_LIST_CALC_PRIORITY, funct_nr, argc, argv); @@ -3028,7 +3028,7 @@ reg_t kAnimate(EngineState *s, int funct_nr, int argc, reg_t *argv) { _k_update_signals_in_view_list(s->dyn_views, templist); s->dyn_views->tag(GFXW(s->dyn_views)); - _k_raise_topmost_in_view_list(s, s->dyn_views, (gfxw_dyn_view_t *)templist->contents); + _k_raise_topmost_in_view_list(s, s->dyn_views, (GfxDynView *)templist->contents); templist->widfree(GFXW(templist)); s->dyn_views->free_tagged(GFXWC(s->dyn_views)); // Free obsolete dynviews @@ -3052,7 +3052,7 @@ reg_t kAnimate(EngineState *s, int funct_nr, int argc, reg_t *argv) { _k_view_list_do_postdraw(s, s->dyn_views); // _k_view_list_dispose_loop() returns -1 if it requested a re-start, so we do just that. - while ((retval = _k_view_list_dispose_loop(s, cast_list, (gfxw_dyn_view_t *) s->dyn_views->contents, funct_nr, argc, argv) < 0)) + while ((retval = _k_view_list_dispose_loop(s, cast_list, (GfxDynView *) s->dyn_views->contents, funct_nr, argc, argv) < 0)) reparentize = 1; if (s->drop_views->contents) { @@ -3136,7 +3136,7 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) { bool save_under = false; gfx_color_t transparent = { PaletteEntry(), 0, -1, -1, 0 }; char *text; - gfxw_port_t *port = (s->port) ? s->port : s->picture_port; + GfxPort *port = (s->port) ? s->port : s->picture_port; bool update_immediately = true; gfx_color_t color0, *color1, bg_color; @@ -3144,7 +3144,7 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) { rect_t area = gfx_rect(port->draw_pos.x, port->draw_pos.y, 320 - port->draw_pos.x, 200 - port->draw_pos.y); int gray = port->gray_text; int font_nr = port->font_nr; - gfxw_text_t *text_handle; + GfxText *text_handle; color0 = port->_color; bg_color = port->_bgcolor; diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index 57ccde7dd2..2dd7fe8c9d 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -28,7 +28,7 @@ #include "sci/engine/kernel.h" #include "sci/gfx/gfx_gui.h" #include "sci/gfx/menubar.h" -#include "sci/gfx/gfx_state_internal.h" // required for gfxw_port_t, gfxw_visual_t +#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxVisual namespace Sci { @@ -184,7 +184,7 @@ reg_t kMenuSelect(EngineState *s, int funct_nr, int argc, reg_t *argv) { if (menu_mode) { int old_item; int old_menu; - gfxw_port_t *port = NULL; + GfxPort *port = NULL; item_nr = -1; diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 942e948b92..267f57392f 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -26,7 +26,7 @@ #include "sci/engine/state.h" #include "sci/engine/kernel.h" #include "sci/gfx/gfx_widgets.h" -#include "sci/gfx/gfx_state_internal.h" // required for gfxw_port_t, gfxw_container_t +#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxContainer #include "common/list.h" @@ -319,8 +319,8 @@ static void draw_line(EngineState *s, Common::Point p1, Common::Point p2, int ty // Yellow: Contained access int poly_colors[][3] = {{0, 255, 0}, {0, 0, 255}, {255, 0, 0}, {255, 255, 0}}; gfx_color_t col; - gfxw_list_t *decorations = s->picture_port->decorations; - gfxw_primitive_t *line; + GfxList *decorations = s->picture_port->decorations; + GfxPrimitive *line; col.visual = PaletteEntry(poly_colors[type][0], poly_colors[type][1], poly_colors[type][2]); col.alpha = 0; @@ -332,7 +332,7 @@ static void draw_line(EngineState *s, Common::Point p1, Common::Point p2, int ty p2.y += 10; line = gfxw_new_line(p1, p2, col, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL); - decorations->add((gfxw_container_t *)decorations, (gfxw_widget_t *)line); + decorations->add((GfxContainer *)decorations, (GfxWidget *)line); } static void draw_point(EngineState *s, Common::Point p, int start) { @@ -341,8 +341,8 @@ static void draw_point(EngineState *s, Common::Point p, int start) { // Blue: Starting point int point_colors[][3] = {{0, 255, 0}, {0, 0, 255}}; gfx_color_t col; - gfxw_list_t *decorations = s->picture_port->decorations; - gfxw_box_t *box; + GfxList *decorations = s->picture_port->decorations; + GfxBox *box; col.visual = PaletteEntry(point_colors[start][0], point_colors[start][1], point_colors[start][2]); col.alpha = 0; @@ -351,7 +351,7 @@ static void draw_point(EngineState *s, Common::Point p, int start) { col.mask = GFX_MASK_VISUAL | GFX_MASK_PRIORITY; box = gfxw_new_box(s->gfx_state, gfx_rect(p.x - 1, p.y - 1 + 10, 3, 3), col, col, GFX_BOX_SHADE_FLAT); - decorations->add((gfxw_container_t *) decorations, (gfxw_widget_t *) box); + decorations->add((GfxContainer *) decorations, (GfxWidget *) box); } static void draw_polygon(EngineState *s, reg_t polygon) { @@ -1539,7 +1539,7 @@ reg_t kAvoidPath(EngineState *s, int funct_nr, int argc, reg_t *argv) { Common::Point start = Common::Point(SKPV(0), SKPV(1)); if (s->debug_mode & (1 << SCIkAVOIDPATH_NR)) { - gfxw_port_t *port = s->picture_port; + GfxPort *port = s->picture_port; if (!port->decorations) { port->decorations = gfxw_new_list(gfx_rect(0, 0, 320, 200), 0); diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index 4e72401222..df40781c95 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -218,7 +218,7 @@ reg_t kDisposeClone(EngineState *s, int funct_nr, int argc, reg_t *argv) { } #if 0 if (s->dyn_views) { // Free any widget associated with the clone - gfxw_widget_t *widget = gfxw_set_id(gfxw_remove_ID(s->dyn_views, offset), GFXW_NO_ID); + GfxWidget *widget = gfxw_set_id(gfxw_remove_ID(s->dyn_views, offset), GFXW_NO_ID); if (widget && s->bg_widgets) s->bg_widgets->add(GFXWC(s->bg_widgets), widget); diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index cf5ef2b0ee..e912c4ab4d 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -33,7 +33,7 @@ #include "sci/sci_memory.h" #include "sci/gfx/operations.h" #include "sci/gfx/menubar.h" -#include "sci/gfx/gfx_state_internal.h" // required for gfxw_port_t, gfxw_container_t +#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxContainer #include "sci/sfx/core.h" #include "sci/sfx/iterator.h" #include "sci/engine/state.h" diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index f9afa36ae5..1e31bc06ed 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -34,7 +34,7 @@ #include "sci/engine/savegame.h" #include "sci/gfx/gfx_widgets.h" #include "sci/gfx/gfx_gui.h" -#include "sci/gfx/gfx_state_internal.h" // required for gfxw_container_t, gfxw_port_t, gfxw_visual_t +#include "sci/gfx/gfx_state_internal.h" // required for GfxContainer, GfxPort, GfxVisual #include "sci/scicore/resource.h" #include "sci/scicore/sciconsole.h" #include "sci/scicore/vocabulary.h" @@ -1669,7 +1669,7 @@ static int c_gfx_current_port(EngineState *s) { } static int c_gfx_print_port(EngineState *s) { - gfxw_port_t *port; + GfxPort *port; if (!_debugstate_valid) { sciprintf("Not in debug state\n"); @@ -1781,7 +1781,7 @@ static int c_gfx_drawpic(EngineState *s) { } #ifdef GFXW_DEBUG_WIDGETS -extern gfxw_widget_t *debug_widgets[]; +extern GfxWidget *debug_widgets[]; extern int debug_widget_pos; static int c_gfx_print_widget(EngineState *s) { diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index 0f73deb76c..670277def7 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -51,10 +51,10 @@ class Menubar; struct kfunct_sig_pair_t; // from kernel.h struct gfx_state_t; -struct gfxw_port_t; -struct gfxw_visual_t; -struct gfxw_container_t; -struct gfxw_list_t; +struct GfxPort; +struct GfxVisual; +struct GfxContainer; +struct GfxList; class DirSeeker { @@ -161,25 +161,25 @@ public: int save_mouse_pointer_cel; /* Temporary storage for mouse pointer resource, when the pointer is hidden */ int port_serial; /* Port serial number, for save/restore */ - gfxw_port_t *port; /* The currently active port */ + GfxPort *port; /* The currently active port */ gfx_color_t ega_colors[16]; /* The 16 EGA colors- for SCI0(1) */ - gfxw_visual_t *visual; /* A visual widget, containing all ports */ + GfxVisual *visual; /* A visual widget, containing all ports */ - gfxw_port_t *titlebar_port; /* Title bar viewport (0,0,9,319) */ - gfxw_port_t *wm_port; /* window manager viewport and designated &heap[0] view (10,0,199,319) */ - gfxw_port_t *picture_port; /* The background picture viewport (10,0,199,319) */ - gfxw_port_t *iconbar_port; /* Full-screen port used for non-clipped icon bar draw in SCI1 */ + GfxPort *titlebar_port; /* Title bar viewport (0,0,9,319) */ + GfxPort *wm_port; /* window manager viewport and designated &heap[0] view (10,0,199,319) */ + GfxPort *picture_port; /* The background picture viewport (10,0,199,319) */ + GfxPort *iconbar_port; /* Full-screen port used for non-clipped icon bar draw in SCI1 */ gfx_map_mask_t pic_visible_map; /* The number of the map to display in update commands */ int pic_animate; /* The animation used by Animate() to display the picture */ int dyn_views_list_serial; /* Used for save/restore */ - gfxw_list_t *dyn_views; /* Pointers to pic and dynamic view lists */ + GfxList *dyn_views; /* Pointers to pic and dynamic view lists */ int drop_views_list_serial; /* Used for save/restore */ - gfxw_list_t *drop_views; /* A list Animate() can dump dropped dynviews into */ + GfxList *drop_views; /* A list Animate() can dump dropped dynviews into */ long animation_delay; /* A delay factor for pic opening animations. Defaults to 500. */ int animation_granularity; /* Number of animation steps to perform betwen updates for transition animations */ diff --git a/engines/sci/gfx/gfx_gui.cpp b/engines/sci/gfx/gfx_gui.cpp index 9483aa9b63..81845602a5 100644 --- a/engines/sci/gfx/gfx_gui.cpp +++ b/engines/sci/gfx/gfx_gui.cpp @@ -38,7 +38,7 @@ namespace Sci { #define SCI_SPECIAL_CHAR_ARROW_UP 0x18 #define SCI_SPECIAL_CHAR_ARROW_DOWN 0x19 -static void clear_titlebar(gfxw_port_t *titlebar) { +static void clear_titlebar(GfxPort *titlebar) { if (titlebar->contents) { titlebar->contents->widfree(titlebar->contents); titlebar->contents = NULL; @@ -46,35 +46,35 @@ static void clear_titlebar(gfxw_port_t *titlebar) { } } -static gfxw_list_t *make_titlebar_list(EngineState *s, rect_t bounds, gfxw_port_t *status_bar) { +static GfxList *make_titlebar_list(EngineState *s, rect_t bounds, GfxPort *status_bar) { gfx_color_t color = status_bar->_bgcolor; - gfxw_list_t *list; - gfxw_box_t *bgbox; + GfxList *list; + GfxBox *bgbox; list = gfxw_new_list(status_bar->_bounds, 0); bgbox = gfxw_new_box(s->gfx_state, gfx_rect(0, 0, status_bar->_bounds.width, status_bar->_bounds.height - 1), color, color, GFX_BOX_SHADE_FLAT); - list->add((gfxw_container_t *) list, (gfxw_widget_t *) bgbox); + list->add((GfxContainer *) list, (GfxWidget *) bgbox); return list; } -static gfxw_list_t *finish_titlebar_list(EngineState *s, gfxw_list_t *list, gfxw_port_t *status_bar) { +static GfxList *finish_titlebar_list(EngineState *s, GfxList *list, GfxPort *status_bar) { gfx_color_t black = s->ega_colors[0]; - gfxw_primitive_t *line; + GfxPrimitive *line; line = gfxw_new_line(Common::Point(0, status_bar->_bounds.height - 1), Common::Point(status_bar->_bounds.width, status_bar->_bounds.height - 1), black, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL); - list->add((gfxw_container_t *)list, (gfxw_widget_t *)line); + list->add((GfxContainer *)list, (GfxWidget *)line); return list; } -void sciw_set_status_bar(EngineState *s, gfxw_port_t *status_bar, const Common::String &text, int fgcolor, int bgcolor) { +void sciw_set_status_bar(EngineState *s, GfxPort *status_bar, const Common::String &text, int fgcolor, int bgcolor) { gfx_state_t *state; - gfxw_list_t *list; + GfxList *list; gfx_color_t bg = status_bar->_bgcolor; gfx_color_t fg = status_bar->_color; gfx_color_t black = s->ega_colors[0]; @@ -94,21 +94,21 @@ void sciw_set_status_bar(EngineState *s, gfxw_port_t *status_bar, const Common:: clear_titlebar(status_bar); if (!text.empty()) { - gfxw_text_t *textw = gfxw_new_text(state, gfx_rect(0, 0, status_bar->_bounds.width, status_bar->_bounds.height), + GfxText *textw = gfxw_new_text(state, gfx_rect(0, 0, status_bar->_bounds.width, status_bar->_bounds.height), status_bar->font_nr, text.c_str(), ALIGN_LEFT, ALIGN_CENTER, fg, fg, bg, kFontNoNewlines); list = make_titlebar_list(s, status_bar->_bounds, status_bar); - list->add((gfxw_container_t *)list, (gfxw_widget_t *)textw); + list->add((GfxContainer *)list, (GfxWidget *)textw); } else { - gfxw_box_t *bgbox = gfxw_new_box(state, gfx_rect(0, 0, status_bar->_bounds.width, status_bar->_bounds.height - 1), + GfxBox *bgbox = gfxw_new_box(state, gfx_rect(0, 0, status_bar->_bounds.width, status_bar->_bounds.height - 1), black, black, GFX_BOX_SHADE_FLAT); list = gfxw_new_list(status_bar->_bounds, 0); - list->add((gfxw_container_t *)list, (gfxw_widget_t *)bgbox); + list->add((GfxContainer *)list, (GfxWidget *)bgbox); } list->add(GFXWC(status_bar), GFXW(list)); @@ -118,7 +118,7 @@ void sciw_set_status_bar(EngineState *s, gfxw_port_t *status_bar, const Common:: gfxop_update(state); } -static void sciw_make_window_fit(rect_t *rect, gfxw_port_t *parent) { +static void sciw_make_window_fit(rect_t *rect, GfxPort *parent) { // This window is meant to cover the whole screen, so we allow it to go through. if (rect->width == 319 && rect->height == 189) return; @@ -129,19 +129,19 @@ static void sciw_make_window_fit(rect_t *rect, gfxw_port_t *parent) { rect->y -= (rect->y + rect->height) - (parent->_bounds.y + parent->_bounds.height) + 2; } -gfxw_port_t *sciw_new_window(EngineState *s, +GfxPort *sciw_new_window(EngineState *s, rect_t area, int font, gfx_color_t color, gfx_color_t bgcolor, int title_font, gfx_color_t title_color, gfx_color_t title_bgcolor, const char *title, int flags) { - gfxw_visual_t *visual = s->visual; + GfxVisual *visual = s->visual; gfx_state_t *state = s->gfx_state; int shadow_offset = 2; rect_t frame; gfx_color_t black; gfxop_set_color(state, &black, 0, 0, 0, 0, 0, 0); - gfxw_port_t *win; - gfxw_list_t *decorations; + GfxPort *win; + GfxList *decorations; // int xextra = !(flags & kWindowNoFrame) ? 1 : 0; // int yextra = !(flags & kWindowNoFrame) ? 2 : 0; @@ -196,9 +196,9 @@ gfxw_port_t *sciw_new_window(EngineState *s, if (!(flags & kWindowTransparent)) { // Draw window background - win->port_bg = (gfxw_widget_t *)gfxw_new_box(state, gfx_rect(1, (flags & kWindowTitle) ? 10 : 1, + win->port_bg = (GfxWidget *)gfxw_new_box(state, gfx_rect(1, (flags & kWindowTitle) ? 10 : 1, area.width, area.height), bgcolor, bgcolor, GFX_BOX_SHADE_FLAT); - decorations->add((gfxw_container_t *) decorations, win->port_bg); + decorations->add((GfxContainer *) decorations, win->port_bg); win->_flags |= GFXW_FLAG_OPAQUE; } @@ -206,10 +206,10 @@ gfxw_port_t *sciw_new_window(EngineState *s, // Add window title rect_t title_rect = gfx_rect(1, 1, area.width, 8); - decorations->add((gfxw_container_t *)decorations, (gfxw_widget_t *) + decorations->add((GfxContainer *)decorations, (GfxWidget *) gfxw_new_box(state, title_rect, title_bgcolor, title_bgcolor, GFX_BOX_SHADE_FLAT)); - decorations->add((gfxw_container_t *)decorations, (gfxw_widget_t *) + decorations->add((GfxContainer *)decorations, (GfxWidget *) gfxw_new_text(state, title_rect, title_font, title, ALIGN_CENTER, ALIGN_CENTER, title_color, title_color, title_bgcolor, kFontNoNewlines)); } @@ -223,11 +223,11 @@ gfxw_port_t *sciw_new_window(EngineState *s, return NULL; } - decorations->add((gfxw_container_t *)decorations, (gfxw_widget_t *) + decorations->add((GfxContainer *)decorations, (GfxWidget *) gfxw_new_box(state, gfx_rect(shadow_offset + 1, frame.height - 1, frame.width - 4, shadow_offset), black, black, GFX_BOX_SHADE_FLAT)); - decorations->add((gfxw_container_t *)decorations, (gfxw_widget_t *) + decorations->add((GfxContainer *)decorations, (GfxWidget *) gfxw_new_box(state, gfx_rect(frame.width - 1, shadow_offset + 1, shadow_offset, frame.height - 2), black, black, GFX_BOX_SHADE_FLAT)); } @@ -241,14 +241,14 @@ gfxw_port_t *sciw_new_window(EngineState *s, if (!(flags & kWindowNoDropShadow)) { - decorations->add((gfxw_container_t *)decorations, (gfxw_widget_t *) + decorations->add((GfxContainer *)decorations, (GfxWidget *) gfxw_new_rect(gfx_rect(0, 0, frame.width - 1, frame.height - 1), black, GFX_LINE_MODE_FINE, GFX_LINE_STYLE_NORMAL)); if (flags & kWindowTitle) - decorations->add((gfxw_container_t *)decorations, (gfxw_widget_t *)gfxw_new_line(Common::Point(1, 9), + decorations->add((GfxContainer *)decorations, (GfxWidget *)gfxw_new_line(Common::Point(1, 9), Common::Point(frame.width - 2, 9), black, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL)); } else { - decorations->add((gfxw_container_t *)decorations, (gfxw_widget_t *) + decorations->add((GfxContainer *)decorations, (GfxWidget *) gfxw_new_rect(gfx_rect(0, 0, frame.width, frame.height), black, GFX_LINE_MODE_FINE, GFX_LINE_STYLE_NORMAL)); } } @@ -265,7 +265,7 @@ static rect_t _move_and_extend_rect(rect_t rect, Common::Point point, int yplus) return gfx_rect(rect.x + point.x, rect.y + point.y, rect.width + 1, rect.height + yplus); } -gfxw_list_t *_sciw_add_text_to_list(gfxw_list_t *list, gfxw_port_t *port, rect_t zone, char *text, +GfxList *_sciw_add_text_to_list(GfxList *list, GfxPort *port, rect_t zone, char *text, int font, gfx_alignment_t align, char framed, char inverse, int flags, char gray_text) { gfx_color_t *color1, *color2, *bgcolor; @@ -293,9 +293,9 @@ gfxw_list_t *_sciw_add_text_to_list(gfxw_list_t *list, gfxw_port_t *port, rect_t return list; } -gfxw_list_t *sciw_new_button_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int font, char selected, char inverse, char grayed_out) { +GfxList *sciw_new_button_control(GfxPort *port, reg_t ID, rect_t zone, char *text, int font, char selected, char inverse, char grayed_out) { gfx_color_t *frame_col = (inverse) ? &(port->_bgcolor) : &(port->_color); - gfxw_list_t *list; + GfxList *list; zone.x--; zone.y--; @@ -331,9 +331,9 @@ gfxw_list_t *sciw_new_button_control(gfxw_port_t *port, reg_t ID, rect_t zone, c return list; } -gfxw_list_t *sciw_new_text_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int font, +GfxList *sciw_new_text_control(GfxPort *port, reg_t ID, rect_t zone, char *text, int font, gfx_alignment_t align, char framed, char inverse) { - gfxw_list_t *list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 2), 0); + GfxList *list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 2), 0); gfxw_set_id(GFXW(list), ID.segment, ID.offset); @@ -343,11 +343,11 @@ gfxw_list_t *sciw_new_text_control(gfxw_port_t *port, reg_t ID, rect_t zone, cha return _sciw_add_text_to_list(list, port, zone, text, font, align, framed, inverse, 0, port->gray_text); } -gfxw_list_t *sciw_new_edit_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int font, unsigned int cursor, +GfxList *sciw_new_edit_control(GfxPort *port, reg_t ID, rect_t zone, char *text, int font, unsigned int cursor, char inverse) { - gfxw_text_t *text_handle; + GfxText *text_handle; - gfxw_list_t *list; + GfxList *list; int cursor_height = gfxop_get_font_height(port->_visual->gfx_state, font); zone.x--; @@ -410,10 +410,10 @@ gfxw_list_t *sciw_new_edit_control(gfxw_port_t *port, reg_t ID, rect_t zone, cha return list; } -gfxw_list_t *sciw_new_icon_control(gfxw_port_t *port, reg_t ID, rect_t zone, int view, int loop, int cel, +GfxList *sciw_new_icon_control(GfxPort *port, reg_t ID, rect_t zone, int view, int loop, int cel, char frame, char inverse) { - gfxw_list_t *list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 1), 0); - gfxw_widget_t *icon; + GfxList *list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 1), 0); + GfxWidget *icon; gfxw_set_id(GFXW(list), ID.segment, ID.offset); if (!port->_visual) { @@ -439,9 +439,9 @@ gfxw_list_t *sciw_new_icon_control(gfxw_port_t *port, reg_t ID, rect_t zone, int return list; } -gfxw_list_t *sciw_new_list_control(gfxw_port_t *port, reg_t ID, rect_t zone, int font_nr, char **entries_list, +GfxList *sciw_new_list_control(GfxPort *port, reg_t ID, rect_t zone, int font_nr, char **entries_list, int entries_nr, int list_top, int selection, char inverse) { - gfxw_list_t *list; + GfxList *list; char arr_up[2], arr_down[2]; int i; @@ -526,8 +526,8 @@ gfxw_list_t *sciw_new_list_control(gfxw_port_t *port, reg_t ID, rect_t zone, int return list; } -void sciw_set_menubar(EngineState *s, gfxw_port_t *status_bar, Menubar *menubar, int selection) { - gfxw_list_t *list = make_titlebar_list(s, status_bar->_bounds, status_bar); +void sciw_set_menubar(EngineState *s, GfxPort *status_bar, Menubar *menubar, int selection) { + GfxList *list = make_titlebar_list(s, status_bar->_bounds, status_bar); int offset = MENU_LEFT_BORDER; int i; @@ -554,8 +554,8 @@ void sciw_set_menubar(EngineState *s, gfxw_port_t *status_bar, Menubar *menubar, finish_titlebar_list(s, list, status_bar); } -gfxw_port_t *sciw_new_menu(EngineState *s, gfxw_port_t *status_bar, Menubar *menubar, int selection) { - gfxw_port_t *retval; +GfxPort *sciw_new_menu(EngineState *s, GfxPort *status_bar, Menubar *menubar, int selection) { + GfxPort *retval; Menu *menu = &menubar->_menus[selection]; rect_t area = gfx_rect(MENU_LEFT_BORDER, 10, 0, 0); int i; @@ -594,10 +594,10 @@ static gfx_color_t un_prioritize(gfx_color_t col) { return col; } -gfxw_widget_t *_make_menu_entry(MenuItem *item, int offset, int width, gfxw_port_t *port, gfx_color_t color, gfx_color_t bgcolor, int ID, int gray) { +GfxWidget *_make_menu_entry(MenuItem *item, int offset, int width, GfxPort *port, gfx_color_t color, gfx_color_t bgcolor, int ID, int gray) { rect_t area = gfx_rect(MENU_BOX_LEFT_PADDING, 0, width - MENU_BOX_LEFT_PADDING, 10); rect_t list_area = gfx_rect(port->zone.x, area.y + offset + port->zone.y, width, area.height); - gfxw_list_t *list = (gfxw_list_t *) gfxw_set_id(GFXW(gfxw_new_list(list_area, 0)), ID, GFXW_NO_ID); + GfxList *list = (GfxList *) gfxw_set_id(GFXW(gfxw_new_list(list_area, 0)), ID, GFXW_NO_ID); gfx_color_t xcolor = { PaletteEntry(), 0, 0, 0, 0}; color = un_prioritize(color); @@ -618,10 +618,10 @@ gfxw_widget_t *_make_menu_entry(MenuItem *item, int offset, int width, gfxw_port return GFXW(list); } -gfxw_widget_t *_make_menu_hbar(int offset, int width, gfxw_port_t *port, gfx_color_t color, gfx_color_t bgcolor, int ID) { +GfxWidget *_make_menu_hbar(int offset, int width, GfxPort *port, gfx_color_t color, gfx_color_t bgcolor, int ID) { rect_t area = gfx_rect(0, 0, width, 10); rect_t list_area = gfx_rect(area.x + port->zone.x, area.y + offset + port->zone.y, area.width, area.height); - gfxw_list_t *list = (gfxw_list_t *) gfxw_set_id(GFXW(gfxw_new_list(list_area, 0)), ID, GFXW_NO_ID); + GfxList *list = (GfxList *) gfxw_set_id(GFXW(gfxw_new_list(list_area, 0)), ID, GFXW_NO_ID); color = un_prioritize(color); bgcolor = un_prioritize(bgcolor); @@ -633,7 +633,7 @@ gfxw_widget_t *_make_menu_hbar(int offset, int width, gfxw_port_t *port, gfx_col return GFXW(list); } -gfxw_port_t *sciw_toggle_item(gfxw_port_t *menu_port, Menu *menu, int selection, bool selected) { +GfxPort *sciw_toggle_item(GfxPort *menu_port, Menu *menu, int selection, bool selected) { if (selection < 0 || selection >= (int)menu->_items.size()) return menu_port; diff --git a/engines/sci/gfx/gfx_gui.h b/engines/sci/gfx/gfx_gui.h index 29e0a8da11..e712d30660 100644 --- a/engines/sci/gfx/gfx_gui.h +++ b/engines/sci/gfx/gfx_gui.h @@ -53,15 +53,15 @@ enum controlStateFlags { kControlStateDitherFramed = 0x1000 // 0001 0000 0000 0000 - widgets surrounded by a dithered frame (used in kgraphics) }; -void sciw_set_status_bar(EngineState *s, gfxw_port_t *status_bar, const Common::String &text, int fgcolor, int bgcolor); +void sciw_set_status_bar(EngineState *s, GfxPort *status_bar, const Common::String &text, int fgcolor, int bgcolor); /* Sets the contents of a port used as status bar ** Parmeters: (EngineState *) s: The affected game state -** (gfxw_port_t *) status_bar: The status bar port +** (GfxPort *) status_bar: The status bar port ** (const char *) text: The text to draw ** Returns : (void) */ -gfxw_port_t *sciw_new_window(EngineState *s, rect_t area, int font, gfx_color_t color, gfx_color_t bgcolor, +GfxPort *sciw_new_window(EngineState *s, rect_t area, int font, gfx_color_t color, gfx_color_t bgcolor, int title_font, gfx_color_t title_color, gfx_color_t title_bg_color, const char *title, int flags); /* Creates a new SCI style window @@ -75,16 +75,16 @@ gfxw_port_t *sciw_new_window(EngineState *s, rect_t area, int font, gfx_color_t ** (gfx_color_t) title_bg_color: Color to use for the title bar background ** (const char *) title: The text to write into the title bar ** (int) flags: Any ORred combination of window flags -** Returns : (gfxw_port_t *) A newly allocated port with the requested characteristics +** Returns : (GfxPort *) A newly allocated port with the requested characteristics */ /*---------------------*/ /*** Control widgets ***/ /*---------------------*/ -gfxw_list_t *sciw_new_button_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int font, char selected, char inverse, char gray); +GfxList *sciw_new_button_control(GfxPort *port, reg_t ID, rect_t zone, char *text, int font, char selected, char inverse, char gray); /* Creates a new button control list -** Parameters: (gfxw_port_t *) port: The port containing the color values to use for the +** Parameters: (GfxPort *) port: The port containing the color values to use for the ** button (the button is /not/ appended to the port there) ** (reg_t) ID: Button's ID ** (rect_t) zone: The area occupied by the button @@ -93,13 +93,13 @@ gfxw_list_t *sciw_new_button_control(gfxw_port_t *port, reg_t ID, rect_t zone, c ** (char) selected: Whether the button should be marked as being selected by the keyboard focus ** (char) inverse: Whether to inverse the color scheme ** (char) gray: Whether the button should be grayed out -** Returns : (gfxw_list_t *) The button +** Returns : (GfxList *) The button */ -gfxw_list_t *sciw_new_text_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int font, +GfxList *sciw_new_text_control(GfxPort *port, reg_t ID, rect_t zone, char *text, int font, gfx_alignment_t align, char frame, char inverse); /* Creates a new text control list -** Parameters: (gfxw_port_t *) port: The port containing the color values to use +** Parameters: (GfxPort *) port: The port containing the color values to use ** (reg_t) ID: Text widget ID ** (rect_t) zone: Area occupied by the text ** (char *) text: The text @@ -107,38 +107,38 @@ gfxw_list_t *sciw_new_text_control(gfxw_port_t *port, reg_t ID, rect_t zone, cha ** (gfx_alignment_t) align: Horizontal text alignment to use ** (char) frame: Whether a dithered frame should surround the text ** (char) inverse: Whether the text colors should be inversed -** Returns : (gfxw_list_t *) The text control widget list +** Returns : (GfxList *) The text control widget list */ -gfxw_list_t *sciw_new_edit_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int font, unsigned int cursor, +GfxList *sciw_new_edit_control(GfxPort *port, reg_t ID, rect_t zone, char *text, int font, unsigned int cursor, char inverse); /* Creates a new edit control list -** Parameters: (gfxw_port_t *) port: The port containing the color values to use +** Parameters: (GfxPort *) port: The port containing the color values to use ** (reg_t) ID: Text widget ID ** (rect_t) zone: Area occupied by the text ** (char *) text: The text ** (int) font: The font the text is to be drawn in ** (int) cursor: Cursor position ** (char) inverse: Whether the edit widget should be reversed -** Returns : (gfxw_list_t *) An appropriate widget list +** Returns : (GfxList *) An appropriate widget list */ -gfxw_list_t *sciw_new_icon_control(gfxw_port_t *port, reg_t ID, rect_t zone, int view, int loop, int cel, +GfxList *sciw_new_icon_control(GfxPort *port, reg_t ID, rect_t zone, int view, int loop, int cel, char frame, char inverse); /* Creates a new icon control list -** Parameters: (gfxw_port_t *) port: The port containing the color values to use +** Parameters: (GfxPort *) port: The port containing the color values to use ** (reg_t) ID: Text widget ID ** (rect_t) zone: Area occupied by the text ** (int x int x int) view, loop, cel: The cel to display ** (char) frame: Whether the widget should be surrounded by a frame ** (char) lina inverse: Whether colors should be inversed -** Returns : (gfxw_list_t *) An appropriate widget list +** Returns : (GfxList *) An appropriate widget list */ -gfxw_list_t *sciw_new_list_control(gfxw_port_t *port, reg_t ID, rect_t zone, int font_nr, char **entries_list, +GfxList *sciw_new_list_control(GfxPort *port, reg_t ID, rect_t zone, int font_nr, char **entries_list, int entries_nr, int list_top, int selection, char inverse); /* Creates a new list control list -** Parameters: (gfxw_port_t *) port: The port containing the color values to use +** Parameters: (GfxPort *) port: The port containing the color values to use ** (int) ID: Text widget ID ** (rect_t) zone: Area occupied by the text ** (int) font_nr: number of the font to use @@ -147,38 +147,38 @@ gfxw_list_t *sciw_new_list_control(gfxw_port_t *port, reg_t ID, rect_t zone, int ** (int) list_top: First list item that is visible ** (int) selection: The list item that is selected ** (char) invserse: The usual meaning -** Returns : (gfxw_list_t *) An appropriate widget list +** Returns : (GfxList *) An appropriate widget list */ /*---------------------*/ /*** Menubar widgets ***/ /*---------------------*/ -void sciw_set_menubar(EngineState *s, gfxw_port_t *status_bar, Menubar *menubar, int selection); +void sciw_set_menubar(EngineState *s, GfxPort *status_bar, Menubar *menubar, int selection); /* Draws the menu bar ** Parameters: (EngineState *) s: The state to operate on -** (gfxw_port_t *) status_bar: The status bar port to modify +** (GfxPort *) status_bar: The status bar port to modify ** (Menubar *) menubar: The menu bar to use ** (int) selection: Number of the menu to hightlight, or -1 for 'none' ** Returns : (void) */ -gfxw_port_t *sciw_new_menu(EngineState *s, gfxw_port_t *status_bar, Menubar *menubar, int selection); +GfxPort *sciw_new_menu(EngineState *s, GfxPort *status_bar, Menubar *menubar, int selection); /* Creates a menu port ** Parameters: (EngineState *) s: The state to operate on -** (gfxw_port_t *) status_bar: The status bar +** (GfxPort *) status_bar: The status bar ** (Menubar *) menubar: The menu bar to use ** (int) selection: Number of the menu to interpret -** Returns : (gfxw_port_t *) The result port +** Returns : (GfxPort *) The result port */ -gfxw_port_t *sciw_toggle_item(gfxw_port_t *menu_port, Menu *menu, int selection, bool selected); +GfxPort *sciw_toggle_item(GfxPort *menu_port, Menu *menu, int selection, bool selected); /* Toggle the selection of a menu item from a menu port -** Parameters: (gfxw_port_t *) menu_port: The port to modify +** Parameters: (GfxPort *) menu_port: The port to modify ** (Menu *) menu: The menu the menu port corresponds to ** (int) selection: Number of the menu entry to unselect, or -1 to do a NOP ** (bool) selected: Whether to set the item's state to selected or not -** Returns : (gfxw_port_t *) The modified menu +** Returns : (GfxPort *) The modified menu */ } // End of namespace Sci diff --git a/engines/sci/gfx/gfx_state_internal.h b/engines/sci/gfx/gfx_state_internal.h index f434a966eb..6fcabf7f38 100644 --- a/engines/sci/gfx/gfx_state_internal.h +++ b/engines/sci/gfx/gfx_state_internal.h @@ -75,28 +75,28 @@ enum gfxw_widget_type_t { #define GFXW_NO_ID -1 -struct gfxw_widget_t; -struct gfxw_container_t; -struct gfxw_visual_t; -struct gfxw_port_t; - -typedef int gfxw_point_op(gfxw_widget_t *, Common::Point); -typedef int gfxw_visual_op(gfxw_widget_t *, gfxw_visual_t *); -typedef int gfxw_op(gfxw_widget_t *); -typedef int gfxw_op_int(gfxw_widget_t *, int); -typedef int gfxw_bin_op(gfxw_widget_t *, gfxw_widget_t *); - -struct gfxw_widget_t { +struct GfxWidget; +struct GfxContainer; +struct GfxVisual; +struct GfxPort; + +typedef int gfxw_point_op(GfxWidget *, Common::Point); +typedef int gfxw_visual_op(GfxWidget *, GfxVisual *); +typedef int gfxw_op(GfxWidget *); +typedef int gfxw_op_int(GfxWidget *, int); +typedef int gfxw_bin_op(GfxWidget *, GfxWidget *); + +struct GfxWidget { int _magic; /* Extra check after typecasting */ int _serial; /* Serial number */ int _flags; /* Widget flags */ gfxw_widget_type_t _type; rect_t _bounds; /* Boundaries */ - gfxw_widget_t *_next; /* Next widget in widget list */ + GfxWidget *_next; /* Next widget in widget list */ int _ID; /* Unique ID or GFXW_NO_ID */ int _subID; /* A 'sub-ID', or GFXW_NO_ID */ - gfxw_container_t *_parent; /* The parent widget, or NULL if not owned */ - gfxw_visual_t *_visual; /* The owner visual */ + GfxContainer *_parent; /* The parent widget, or NULL if not owned */ + GfxVisual *_visual; /* The owner visual */ int _widgetPriority; /* Drawing priority, or -1 */ public: @@ -111,26 +111,26 @@ public: gfxw_bin_op *superarea_of; /* a superarea_of b <=> for each pixel of b there exists an opaque pixel in a at the same location */ gfxw_visual_op *set_visual; /* Sets the visual the widget belongs to */ - gfxw_widget_t(gfxw_widget_type_t type); + GfxWidget(gfxw_widget_type_t type); }; #define GFXW_IS_BOX(widget) ((widget)->_type == GFXW_BOX) -struct gfxw_box_t : public gfxw_widget_t { +struct GfxBox : public GfxWidget { gfx_color_t _color1, _color2; gfx_box_shade_t _shadeType; - gfxw_box_t(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type); + GfxBox(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type); }; #define GFXW_IS_PRIMITIVE(widget) ((widget)->_type == GFXW_RECT || (widget)->_type == GFXW_LINE) -struct gfxw_primitive_t : public gfxw_widget_t { +struct GfxPrimitive : public GfxWidget { gfx_color_t _color; gfx_line_mode_t _lineMode; gfx_line_style_t _lineStyle; - gfxw_primitive_t(rect_t area, gfx_color_t color, gfx_line_mode_t mode, + GfxPrimitive(rect_t area, gfx_color_t color, gfx_line_mode_t mode, gfx_line_style_t style, gfxw_widget_type_t type); }; @@ -138,18 +138,18 @@ struct gfxw_primitive_t : public gfxw_widget_t { #define GFXW_IS_VIEW(widget) ((widget)->_type == GFXW_VIEW || (widget)->_type == GFXW_STATIC_VIEW \ || (widget)->_type == GFXW_DYN_VIEW || (widget)->_type == GFXW_PIC_VIEW) -struct gfxw_view_t : public gfxw_widget_t { - Common::Point _pos; /* Implies the value of 'bounds' in gfxw_widget_t */ +struct GfxView : public GfxWidget { + Common::Point _pos; /* Implies the value of 'bounds' in GfxWidget */ gfx_color_t _color; int _view, _loop, _cel; int _palette; - gfxw_view_t(gfx_state_t *state, Common::Point pos, int view_nr, int loop, int cel, int palette, int priority, int control, + GfxView(gfx_state_t *state, Common::Point pos, int view_nr, int loop, int cel, int palette, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int flags); }; #define GFXW_IS_DYN_VIEW(widget) ((widget)->_type == GFXW_DYN_VIEW || (widget)->_type == GFXW_PIC_VIEW) -struct gfxw_dyn_view_t : public gfxw_view_t { +struct GfxDynView : public GfxView { /* FIXME: This code is specific to SCI */ rect_t draw_bounds; /* The correct position to draw to */ void *under_bitsp, *signalp; @@ -158,14 +158,14 @@ struct gfxw_dyn_view_t : public gfxw_view_t { int sequence; /* Sequence number: For sorting */ int force_precedence; /* Precedence enforcement variable for sorting- defaults to 0 */ - gfxw_dyn_view_t(gfx_state_t *state, Common::Point pos, int z, int view, int loop, int cel, int palette, int priority, int control, + GfxDynView(gfx_state_t *state, Common::Point pos, int z, int view, int loop, int cel, int palette, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int sequence); }; #define GFXW_IS_TEXT(widget) ((widget)->_type == GFXW_TEXT) -struct gfxw_text_t : public gfxw_widget_t { +struct GfxText : public GfxWidget { int font_nr; int lines_nr, lineheight, lastline_width; char *text; @@ -175,23 +175,23 @@ struct gfxw_text_t : public gfxw_widget_t { int width, height; /* Real text width and height */ gfx_text_handle_t *text_handle; - gfxw_text_t(gfx_state_t *state, rect_t area, int font, const char *text, gfx_alignment_t halign, + GfxText(gfx_state_t *state, rect_t area, int font, const char *text, gfx_alignment_t halign, gfx_alignment_t valign, gfx_color_t color1, gfx_color_t color2, gfx_color_t bgcolor, int text_flags); }; /* Container widgets */ -typedef int gfxw_unary_container_op(gfxw_container_t *); -typedef int gfxw_container_op(gfxw_container_t *, gfxw_widget_t *); -typedef int gfxw_rect_op(gfxw_container_t *, rect_t, int); +typedef int gfxw_unary_container_op(GfxContainer *); +typedef int gfxw_container_op(GfxContainer *, GfxWidget *); +typedef int gfxw_rect_op(GfxContainer *, rect_t, int); -struct gfxw_container_t : public gfxw_widget_t { +struct GfxContainer : public GfxWidget { rect_t zone; /* The writeable zone (absolute) for contained objects */ gfx_dirty_rect_t *dirty; /* List of dirty rectangles */ - gfxw_widget_t *contents; - gfxw_widget_t **nextpp; /* Pointer to the 'next' pointer in the last entry in contents */ + GfxWidget *contents; + GfxWidget **nextpp; /* Pointer to the 'next' pointer in the last entry in contents */ public: // TODO: Replace the following with virtual methods @@ -201,7 +201,7 @@ public: gfxw_rect_op *add_dirty_rel; /* Add a relative dirty rectangle */ gfxw_container_op *add; /* Append widget to an appropriate position (for view and control lists) */ - gfxw_container_t(rect_t area, gfxw_widget_type_t type); + GfxContainer(rect_t area, gfxw_widget_type_t type); }; @@ -211,24 +211,24 @@ public: #define GFXW_IS_LIST(widget) ((widget)->_type == GFXW_LIST || (widget)->_type == GFXW_SORTED_LIST) #define GFXW_IS_SORTED_LIST(widget) ((widget)->_type == GFXW_SORTED_LIST) -struct gfxw_list_t : public gfxw_container_t { - gfxw_list_t(rect_t area, bool sorted); +struct GfxList : public GfxContainer { + GfxList(rect_t area, bool sorted); }; #define GFXW_IS_VISUAL(widget) ((widget)->_type == GFXW_VISUAL) -struct gfxw_visual_t : public gfxw_container_t { - gfxw_port_t **port_refs; /* References to ports */ +struct GfxVisual : public GfxContainer { + GfxPort **port_refs; /* References to ports */ int port_refs_nr; int font_nr; /* Default font */ gfx_state_t *gfx_state; - gfxw_visual_t(gfx_state_t *state, int font); + GfxVisual(gfx_state_t *state, int font); }; #define GFXW_IS_PORT(widget) ((widget)->_type == GFXW_PORT) -struct gfxw_port_t : public gfxw_container_t { - gfxw_list_t *decorations; /* optional window decorations- drawn before the contents */ - gfxw_widget_t *port_bg; /* Port background widget or NULL */ +struct GfxPort : public GfxContainer { + GfxList *decorations; /* optional window decorations- drawn before the contents */ + GfxWidget *port_bg; /* Port background widget or NULL */ gfx_color_t _color, _bgcolor; int font_nr; Common::Point draw_pos; /* Drawing position */ @@ -238,7 +238,7 @@ struct gfxw_port_t : public gfxw_container_t { const char *title_text; byte gray_text; /* Whether text is 'grayed out' (dithered) */ - gfxw_port_t(gfxw_visual_t *visual, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor); + GfxPort(GfxVisual *visual, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor); }; } // End of namespace Sci diff --git a/engines/sci/gfx/gfx_widgets.cpp b/engines/sci/gfx/gfx_widgets.cpp index d9793ca7c8..015c4f6880 100644 --- a/engines/sci/gfx/gfx_widgets.cpp +++ b/engines/sci/gfx/gfx_widgets.cpp @@ -45,10 +45,10 @@ static int widget_serial_number_counter = 0x10000; // Avoid confusion with IDs #ifdef GFXW_DEBUG_WIDGETS -gfxw_widget_t *debug_widgets[GFXW_DEBUG_WIDGETS]; +GfxWidget *debug_widgets[GFXW_DEBUG_WIDGETS]; int debug_widget_pos = 0; -static void _gfxw_debug_add_widget(gfxw_widget_t *widget) { +static void _gfxw_debug_add_widget(GfxWidget *widget) { if (debug_widget_pos == GFXW_DEBUG_WIDGETS) { GFXERROR("WIDGET DEBUG: Allocated the maximum number of %d widgets- Aborting!\n", GFXW_DEBUG_WIDGETS); BREAKPOINT(); @@ -56,12 +56,12 @@ static void _gfxw_debug_add_widget(gfxw_widget_t *widget) { debug_widgets[debug_widget_pos++] = widget; } -static void _gfxw_debug_remove_widget(gfxw_widget_t *widget) { +static void _gfxw_debug_remove_widget(GfxWidget *widget) { int i; int found = 0; for (i = 0; i < debug_widget_pos; i++) { if (debug_widgets[i] == widget) { - memmove(debug_widgets + i, debug_widgets + i + 1, (sizeof(gfxw_widget_t *)) * (debug_widget_pos - i - 1)); + memmove(debug_widgets + i, debug_widgets + i + 1, (sizeof(GfxWidget *)) * (debug_widget_pos - i - 1)); debug_widgets[debug_widget_pos--] = NULL; found++; } @@ -88,7 +88,7 @@ static void indent(int indentation) { sciprintf(" "); } -static void _gfxw_print_widget(gfxw_widget_t *widget, int indentation) { +static void _gfxw_print_widget(GfxWidget *widget, int indentation) { unsigned int i; char flags_list[] = "VOCDTMI"; @@ -122,14 +122,14 @@ static void _gfxw_print_widget(gfxw_widget_t *widget, int indentation) { sciprintf(" "); } -static int _gfxwop_print_empty(gfxw_widget_t *widget, int indentation) { +static int _gfxwop_print_empty(GfxWidget *widget, int indentation) { _gfxw_print_widget(widget, indentation); sciprintf("", widget->_type); return 0; } -gfxw_widget_t::gfxw_widget_t(gfxw_widget_type_t type_) { +GfxWidget::GfxWidget(gfxw_widget_type_t type_) { _magic = GFXW_MAGIC_VALID; _serial = widget_serial_number_counter++; @@ -158,7 +158,7 @@ gfxw_widget_t::gfxw_widget_t(gfxw_widget_type_t type_) { _gfxw_debug_add_widget(this); } -static int verify_widget(gfxw_widget_t *widget) { +static int verify_widget(GfxWidget *widget) { if (!widget) { GFXERROR("Attempt to use NULL widget\n"); #ifdef GFXW_DEBUG_WIDGETS @@ -180,11 +180,11 @@ static int verify_widget(gfxw_widget_t *widget) { } #define VERIFY_WIDGET(w) \ - if (verify_widget((gfxw_widget_t *)(w))) { GFXERROR("Error occured while validating widget\n"); } + if (verify_widget((GfxWidget *)(w))) { GFXERROR("Error occured while validating widget\n"); } -static void _gfxw_unallocate_widget(gfx_state_t *state, gfxw_widget_t *widget) { +static void _gfxw_unallocate_widget(gfx_state_t *state, GfxWidget *widget) { if (GFXW_IS_TEXT(widget)) { - gfxw_text_t *text = (gfxw_text_t *) widget; + GfxText *text = (GfxText *) widget; if (text->text_handle) { if (!state) { @@ -265,7 +265,7 @@ static int _color_equals(gfx_color_t a, gfx_color_t b) { return 1; } -static int _gfxwop_basic_set_visual(gfxw_widget_t *widget, gfxw_visual_t *visual) { +static int _gfxwop_basic_set_visual(GfxWidget *widget, GfxVisual *visual) { widget->_visual = visual; if (widget->_parent) { @@ -276,11 +276,11 @@ static int _gfxwop_basic_set_visual(gfxw_widget_t *widget, gfxw_visual_t *visual return 0; } -static int _gfxwop_basic_should_replace(gfxw_widget_t *widget, gfxw_widget_t *other) { +static int _gfxwop_basic_should_replace(GfxWidget *widget, GfxWidget *other) { return 0; } -static void _gfxw_set_ops(gfxw_widget_t *widget, gfxw_point_op *draw, gfxw_op *free, gfxw_op *tag, gfxw_op_int *print, +static void _gfxw_set_ops(GfxWidget *widget, gfxw_point_op *draw, gfxw_op *free, gfxw_op *tag, gfxw_op_int *print, gfxw_bin_op *compare_to, gfxw_bin_op *equals, gfxw_bin_op *superarea_of) { widget->draw = draw; widget->widfree = free; @@ -294,8 +294,8 @@ static void _gfxw_set_ops(gfxw_widget_t *widget, gfxw_point_op *draw, gfxw_op *f widget->set_visual = _gfxwop_basic_set_visual; } -void gfxw_remove_widget_from_container(gfxw_container_t *container, gfxw_widget_t *widget) { - gfxw_widget_t **seekerp; +void gfxw_remove_widget_from_container(GfxContainer *container, GfxWidget *widget) { + GfxWidget **seekerp; if (!container) { GFXERROR("Attempt to remove widget from NULL container!\n"); @@ -305,8 +305,8 @@ void gfxw_remove_widget_from_container(gfxw_container_t *container, gfxw_widget_ seekerp = &(container->contents); if (GFXW_IS_LIST(widget) && GFXW_IS_PORT(container)) { - gfxw_port_t *port = (gfxw_port_t *) container; - if (port->decorations == (gfxw_list_t *) widget) { + GfxPort *port = (GfxPort *) container; + if (port->decorations == (GfxList *) widget) { port->decorations = NULL; return; } @@ -333,8 +333,8 @@ void gfxw_remove_widget_from_container(gfxw_container_t *container, gfxw_widget_ widget->_next = NULL; } -static int _gfxwop_basic_free(gfxw_widget_t *widget) { - gfxw_visual_t *visual = widget->_visual; +static int _gfxwop_basic_free(GfxWidget *widget) { + GfxVisual *visual = widget->_visual; gfx_state_t *state = (visual) ? visual->gfx_state : NULL; DDIRTY(stderr, "BASIC-FREE: SomeAddDirty\n"); @@ -353,21 +353,21 @@ static int _gfxwop_basic_free(gfxw_widget_t *widget) { return 0; } -static int _gfxwop_basic_tag(gfxw_widget_t *widget) { +static int _gfxwop_basic_tag(GfxWidget *widget) { widget->_flags |= GFXW_FLAG_TAGGED; return 0; } -static int _gfxwop_basic_compare_to(gfxw_widget_t *widget, gfxw_widget_t *other) { +static int _gfxwop_basic_compare_to(GfxWidget *widget, GfxWidget *other) { return 1; } -static int _gfxwop_basic_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { +static int _gfxwop_basic_equals(GfxWidget *widget, GfxWidget *other) { return 0; } -static int _gfxwop_basic_superarea_of(gfxw_widget_t *widget, gfxw_widget_t *other) { +static int _gfxwop_basic_superarea_of(GfxWidget *widget, GfxWidget *other) { return (widget == other); } @@ -388,22 +388,22 @@ static Common::Point _move_point(rect_t rect, Common::Point point) { return Common::Point(rect.x + point.x, rect.y + point.y); } -static int _gfxwop_box_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_box_t *box = (gfxw_box_t *) widget; +static int _gfxwop_box_draw(GfxWidget *widget, Common::Point pos) { + GfxBox *box = (GfxBox *) widget; DRAW_ASSERT(widget, GFXW_BOX); GFX_ASSERT(gfxop_draw_box(box->_visual->gfx_state, _move_rect(box->_bounds, pos), box->_color1, box->_color2, box->_shadeType)); return 0; } -static int _gfxwop_box_print(gfxw_widget_t *widget, int indentation) { +static int _gfxwop_box_print(GfxWidget *widget, int indentation) { _gfxw_print_widget(widget, indentation); sciprintf("BOX"); return 0; } -static int _gfxwop_box_superarea_of(gfxw_widget_t *widget, gfxw_widget_t *other) { - gfxw_box_t *box = (gfxw_box_t *) widget; +static int _gfxwop_box_superarea_of(GfxWidget *widget, GfxWidget *other) { + GfxBox *box = (GfxBox *) widget; if (box->_color1.alpha) return 0; @@ -421,12 +421,12 @@ static int _gfxwop_box_superarea_of(gfxw_widget_t *widget, gfxw_widget_t *other) return 1; } -static int _gfxwop_box_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { - gfxw_box_t *wbox = (gfxw_box_t *)widget, *obox; +static int _gfxwop_box_equals(GfxWidget *widget, GfxWidget *other) { + GfxBox *wbox = (GfxBox *)widget, *obox; if (other->_type != GFXW_BOX) return 0; - obox = (gfxw_box_t *) other; + obox = (GfxBox *) other; if (!toCommonRect(wbox->_bounds).equals(toCommonRect(obox->_bounds))) return 0; @@ -444,7 +444,7 @@ static int _gfxwop_box_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { return 1; } -void _gfxw_set_ops_BOX(gfxw_widget_t *widget) { +void _gfxw_set_ops_BOX(GfxWidget *widget) { _gfxw_set_ops(GFXW(widget), _gfxwop_box_draw, _gfxwop_basic_free, _gfxwop_basic_tag, _gfxwop_box_print, _gfxwop_basic_compare_to, _gfxwop_box_equals, _gfxwop_box_superarea_of); } @@ -453,12 +453,12 @@ static int _gfxw_color_get_priority(gfx_color_t color) { return (color.mask & GFX_MASK_PRIORITY) ? color.priority : -1; } -gfxw_box_t *gfxw_new_box(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type) { - return new gfxw_box_t(state, area, color1, color2, shade_type); +GfxBox *gfxw_new_box(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type) { + return new GfxBox(state, area, color1, color2, shade_type); } -gfxw_box_t::gfxw_box_t(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type) - : gfxw_widget_t(GFXW_BOX) { +GfxBox::GfxBox(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type) + : GfxWidget(GFXW_BOX) { _widgetPriority = _gfxw_color_get_priority(color1); _bounds = area; @@ -474,9 +474,9 @@ gfxw_box_t::gfxw_box_t(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_ _gfxw_set_ops_BOX(this); } -gfxw_primitive_t::gfxw_primitive_t(rect_t area, gfx_color_t color_, gfx_line_mode_t mode, +GfxPrimitive::GfxPrimitive(rect_t area, gfx_color_t color_, gfx_line_mode_t mode, gfx_line_style_t style, gfxw_widget_type_t type_) - : gfxw_widget_t(type_) { + : GfxWidget(type_) { _widgetPriority = _gfxw_color_get_priority(color_); _bounds = area; @@ -489,16 +489,16 @@ gfxw_primitive_t::gfxw_primitive_t(rect_t area, gfx_color_t color_, gfx_line_mod //*** Rectangles *** -struct gfxw_rect_t : public gfxw_primitive_t { +struct gfxw_rect_t : public GfxPrimitive { gfxw_rect_t(rect_t rect, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style); }; -static int _gfxwop_primitive_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { - gfxw_primitive_t *wprim = (gfxw_primitive_t *) widget, *oprim; +static int _gfxwop_primitive_equals(GfxWidget *widget, GfxWidget *other) { + GfxPrimitive *wprim = (GfxPrimitive *) widget, *oprim; if (widget->_type != other->_type) return 0; - oprim = (gfxw_primitive_t *) other; + oprim = (GfxPrimitive *) other; // Check if the two primitives are equal (note: the primitives aren't always rectangles, so // the "width" and the "height" here could be negative) @@ -518,8 +518,8 @@ static int _gfxwop_primitive_equals(gfxw_widget_t *widget, gfxw_widget_t *other) return 1; } -static int _gfxwop_rect_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_primitive_t *rect = (gfxw_primitive_t *) widget; +static int _gfxwop_rect_draw(GfxWidget *widget, Common::Point pos) { + GfxPrimitive *rect = (GfxPrimitive *) widget; DRAW_ASSERT(widget, GFXW_RECT); GFX_ASSERT(gfxop_draw_rectangle(rect->_visual->gfx_state, gfx_rect(rect->_bounds.x + pos.x, rect->_bounds.y + pos.y, @@ -527,24 +527,24 @@ static int _gfxwop_rect_draw(gfxw_widget_t *widget, Common::Point pos) { return 0; } -static int _gfxwop_rect_print(gfxw_widget_t *rect, int indentation) { +static int _gfxwop_rect_print(GfxWidget *rect, int indentation) { _gfxw_print_widget(GFXW(rect), indentation); sciprintf("RECT"); return 0; } -void _gfxw_set_ops_RECT(gfxw_widget_t *prim) { +void _gfxw_set_ops_RECT(GfxWidget *prim) { _gfxw_set_ops(GFXW(prim), _gfxwop_rect_draw, _gfxwop_basic_free, _gfxwop_basic_tag, _gfxwop_rect_print, _gfxwop_basic_compare_to, _gfxwop_primitive_equals, _gfxwop_basic_superarea_of); } -gfxw_primitive_t *gfxw_new_rect(rect_t rect, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { +GfxPrimitive *gfxw_new_rect(rect_t rect, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { return new gfxw_rect_t(rect, color, line_mode, line_style); } gfxw_rect_t::gfxw_rect_t(rect_t rect, gfx_color_t color_, gfx_line_mode_t line_mode_, gfx_line_style_t line_style_) - : gfxw_primitive_t(rect, color_, line_mode_, line_style_, GFXW_RECT) { + : GfxPrimitive(rect, color_, line_mode_, line_style_, GFXW_RECT) { _bounds.width++; _bounds.height++; // Since it is actually one pixel bigger in each direction @@ -554,12 +554,12 @@ gfxw_rect_t::gfxw_rect_t(rect_t rect, gfx_color_t color_, gfx_line_mode_t line_m //*** Lines *** -struct gfxw_line_t : public gfxw_primitive_t { +struct gfxw_line_t : public GfxPrimitive { gfxw_line_t(Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style); }; -static int _gfxwop_line_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_primitive_t *line = (gfxw_primitive_t *)widget; +static int _gfxwop_line_draw(GfxWidget *widget, Common::Point pos) { + GfxPrimitive *line = (GfxPrimitive *)widget; rect_t linepos = widget->_bounds; Common::Point p1, p2; @@ -573,32 +573,32 @@ static int _gfxwop_line_draw(gfxw_widget_t *widget, Common::Point pos) { return 0; } -static int _gfxwop_line_print(gfxw_widget_t *widget, int indentation) { +static int _gfxwop_line_print(GfxWidget *widget, int indentation) { _gfxw_print_widget(widget, indentation); return 0; } -void _gfxw_set_ops_LINE(gfxw_widget_t *prim) { +void _gfxw_set_ops_LINE(GfxWidget *prim) { _gfxw_set_ops(GFXW(prim), _gfxwop_line_draw, _gfxwop_basic_free, _gfxwop_basic_tag, _gfxwop_line_print, _gfxwop_basic_compare_to, _gfxwop_primitive_equals, _gfxwop_basic_superarea_of); } -gfxw_primitive_t *gfxw_new_line(Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { +GfxPrimitive *gfxw_new_line(Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { return new gfxw_line_t(start, end, color, line_mode, line_style); } gfxw_line_t::gfxw_line_t(Common::Point start, Common::Point end, gfx_color_t color_, gfx_line_mode_t line_mode_, gfx_line_style_t line_style_) - : gfxw_primitive_t(gfx_rect(start.x, start.y, end.x - start.x + 1, end.y - start.y + 1), color_, line_mode_, line_style_, GFXW_LINE) { + : GfxPrimitive(gfx_rect(start.x, start.y, end.x - start.x + 1, end.y - start.y + 1), color_, line_mode_, line_style_, GFXW_LINE) { _gfxw_set_ops_LINE(this); } //*** Views and static views *** -gfxw_view_t::gfxw_view_t(gfx_state_t *state, Common::Point pos_, int view_, int loop_, int cel_, int palette_, int priority, int control, +GfxView::GfxView(gfx_state_t *state, Common::Point pos_, int view_, int loop_, int cel_, int palette_, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int flags_) - : gfxw_widget_t((flags_ & GFXW_VIEW_FLAG_STATIC) ? GFXW_STATIC_VIEW : GFXW_VIEW) { + : GfxWidget((flags_ & GFXW_VIEW_FLAG_STATIC) ? GFXW_STATIC_VIEW : GFXW_VIEW) { int width, height; Common::Point offset; @@ -637,8 +637,8 @@ gfxw_view_t::gfxw_view_t(gfx_state_t *state, Common::Point pos_, int view_, int _flags |= GFXW_FLAG_VISIBLE; } -int _gfxwop_view_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_view_t *view = (gfxw_view_t *)widget; +int _gfxwop_view_draw(GfxWidget *widget, Common::Point pos) { + GfxView *view = (GfxView *)widget; DRAW_ASSERT(widget, GFXW_VIEW); GFX_ASSERT(gfxop_draw_cel(view->_visual->gfx_state, view->_view, view->_loop, view->_cel, @@ -647,8 +647,8 @@ int _gfxwop_view_draw(gfxw_widget_t *widget, Common::Point pos) { return 0; } -static int _gfxwop_static_view_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_view_t *view = (gfxw_view_t *)widget; +static int _gfxwop_static_view_draw(GfxWidget *widget, Common::Point pos) { + GfxView *view = (GfxView *)widget; DRAW_ASSERT(widget, GFXW_VIEW); GFX_ASSERT(gfxop_draw_cel_static(view->_visual->gfx_state, view->_view, view->_loop, @@ -657,8 +657,8 @@ static int _gfxwop_static_view_draw(gfxw_widget_t *widget, Common::Point pos) { return 0; } -static int _w_gfxwop_view_print(gfxw_widget_t *widget, const char *name, int indentation) { - gfxw_view_t *view = (gfxw_view_t *)widget; +static int _w_gfxwop_view_print(GfxWidget *widget, const char *name, int indentation) { + GfxView *view = (GfxView *)widget; _gfxw_print_widget(widget, indentation); sciprintf("%s", name); @@ -669,23 +669,23 @@ static int _w_gfxwop_view_print(gfxw_widget_t *widget, const char *name, int ind return 0; } -static int _gfxwop_view_print(gfxw_widget_t *widget, int indentation) { +static int _gfxwop_view_print(GfxWidget *widget, int indentation) { return _w_gfxwop_view_print(widget, "VIEW", indentation); } -static int _gfxwop_static_view_print(gfxw_widget_t *widget, int indentation) { +static int _gfxwop_static_view_print(GfxWidget *widget, int indentation) { return _w_gfxwop_view_print(widget, "PICVIEW", indentation); } -void _gfxw_set_ops_VIEW(gfxw_widget_t *view, char stat) { +void _gfxw_set_ops_VIEW(GfxWidget *view, char stat) { _gfxw_set_ops(GFXW(view), (stat) ? _gfxwop_static_view_draw : _gfxwop_view_draw, _gfxwop_basic_free, _gfxwop_basic_tag, (stat) ? _gfxwop_static_view_print : _gfxwop_view_print, _gfxwop_basic_compare_to, _gfxwop_basic_equals, _gfxwop_basic_superarea_of); } -gfxw_view_t *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view_nr, int loop, int cel, int palette, int priority, int control, +GfxView *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view_nr, int loop, int cel, int palette, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int flags) { - gfxw_view_t *view; + GfxView *view; if (flags & GFXW_VIEW_FLAG_DONT_MODIFY_OFFSET) { int foo; @@ -695,7 +695,7 @@ gfxw_view_t *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view_nr, i pos.y += offset.y; } - view = new gfxw_view_t(state, pos, view_nr, loop, cel, palette, priority, control, halign, valign, + view = new GfxView(state, pos, view_nr, loop, cel, palette, priority, control, halign, valign, (flags & GFXW_VIEW_FLAG_STATIC) ? GFXW_STATIC_VIEW : GFXW_VIEW); _gfxw_set_ops_VIEW(view, (char)(flags & GFXW_VIEW_FLAG_STATIC)); @@ -705,8 +705,8 @@ gfxw_view_t *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view_nr, i //*** Dynamic Views *** -static int _gfxwop_dyn_view_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_dyn_view_t *view = (gfxw_dyn_view_t *) widget; +static int _gfxwop_dyn_view_draw(GfxWidget *widget, Common::Point pos) { + GfxDynView *view = (GfxDynView *) widget; DRAW_ASSERT(widget, GFXW_DYN_VIEW); GFX_ASSERT(gfxop_draw_cel(view->_visual->gfx_state, view->_view, view->_loop, @@ -725,12 +725,12 @@ static int _gfxwop_dyn_view_draw(gfxw_widget_t *widget, Common::Point pos) { } -static int _gfxwop_draw_nop(gfxw_widget_t *widget, Common::Point pos) { +static int _gfxwop_draw_nop(GfxWidget *widget, Common::Point pos) { return 0; } -static int _gfxwop_pic_view_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_dyn_view_t *view = (gfxw_dyn_view_t *) widget; +static int _gfxwop_pic_view_draw(GfxWidget *widget, Common::Point pos) { + GfxDynView *view = (GfxDynView *) widget; DRAW_ASSERT(widget, GFXW_PIC_VIEW); GFX_ASSERT(gfxop_set_clip_zone(view->_visual->gfx_state, view->_parent->zone)); @@ -747,8 +747,8 @@ static int _gfxwop_pic_view_draw(gfxw_widget_t *widget, Common::Point pos) { return 0; } -static int _gfxwop_some_view_print(gfxw_widget_t *widget, int indentation, const char *type_string) { - gfxw_dyn_view_t *view = (gfxw_dyn_view_t *)widget; +static int _gfxwop_some_view_print(GfxWidget *widget, int indentation, const char *type_string) { + GfxDynView *view = (GfxDynView *)widget; _gfxw_print_widget(widget, indentation); @@ -761,20 +761,20 @@ static int _gfxwop_some_view_print(gfxw_widget_t *widget, int indentation, const return 0; } -static int _gfxwop_dyn_view_print(gfxw_widget_t *widget, int indentation) { +static int _gfxwop_dyn_view_print(GfxWidget *widget, int indentation) { return _gfxwop_some_view_print(widget, indentation, "DYNVIEW"); } -static int _gfxwop_pic_view_print(gfxw_widget_t *widget, int indentation) { +static int _gfxwop_pic_view_print(GfxWidget *widget, int indentation) { return _gfxwop_some_view_print(widget, indentation, "PICVIEW"); } -static int _gfxwop_dyn_view_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { - gfxw_dyn_view_t *wview = (gfxw_dyn_view_t *)widget, *oview; +static int _gfxwop_dyn_view_equals(GfxWidget *widget, GfxWidget *other) { + GfxDynView *wview = (GfxDynView *)widget, *oview; if (!GFXW_IS_DYN_VIEW(other)) return 0; - oview = (gfxw_dyn_view_t *)other; + oview = (GfxDynView *)other; if (wview->_pos.x != oview->_pos.x || wview->_pos.y != oview->_pos.y || wview->_z != oview->_z) return 0; @@ -791,13 +791,13 @@ static int _gfxwop_dyn_view_equals(gfxw_widget_t *widget, gfxw_widget_t *other) return 1; } -static int _gfxwop_dyn_view_compare_to(gfxw_widget_t *widget, gfxw_widget_t *other) { +static int _gfxwop_dyn_view_compare_to(GfxWidget *widget, GfxWidget *other) { int retval; - gfxw_dyn_view_t *wview = (gfxw_dyn_view_t *) widget, *oview; + GfxDynView *wview = (GfxDynView *) widget, *oview; if (!GFXW_IS_DYN_VIEW(other)) return 1; - oview = (gfxw_dyn_view_t *) other; + oview = (GfxDynView *) other; retval = wview->force_precedence - oview->force_precedence; if (retval) @@ -814,26 +814,26 @@ static int _gfxwop_dyn_view_compare_to(gfxw_widget_t *widget, gfxw_widget_t *oth return -(wview->sequence - oview->sequence); } -void _gfxw_set_ops_DYNVIEW(gfxw_widget_t *widget) { +void _gfxw_set_ops_DYNVIEW(GfxWidget *widget) { _gfxw_set_ops(GFXW(widget), _gfxwop_dyn_view_draw, _gfxwop_basic_free, _gfxwop_basic_tag, _gfxwop_dyn_view_print, _gfxwop_dyn_view_compare_to, _gfxwop_dyn_view_equals, _gfxwop_basic_superarea_of); } -void _gfxw_set_ops_PICVIEW(gfxw_widget_t *widget) { +void _gfxw_set_ops_PICVIEW(GfxWidget *widget) { _gfxw_set_ops_DYNVIEW(widget); widget->draw = _gfxwop_pic_view_draw; widget->print = _gfxwop_pic_view_print; } -gfxw_dyn_view_t *gfxw_new_dyn_view(gfx_state_t *state, Common::Point pos, int z, int view, int loop, int cel, int palette, int priority, int control, +GfxDynView *gfxw_new_dyn_view(gfx_state_t *state, Common::Point pos, int z, int view, int loop, int cel, int palette, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int sequence) { - return new gfxw_dyn_view_t(state, pos, z, view, loop, cel, palette, priority, control, halign, valign, sequence); + return new GfxDynView(state, pos, z, view, loop, cel, palette, priority, control, halign, valign, sequence); } -gfxw_dyn_view_t::gfxw_dyn_view_t(gfx_state_t *state, Common::Point pos_, int z_, int view_, int loop_, int cel_, int palette_, int priority, int control, +GfxDynView::GfxDynView(gfx_state_t *state, Common::Point pos_, int z_, int view_, int loop_, int cel_, int palette_, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int sequence_) - : gfxw_view_t(state, pos_, view_, loop_, cel_, palette_, priority, control, halign, valign, 0) { + : GfxView(state, pos_, view_, loop_, cel_, palette_, priority, control, halign, valign, 0) { int width, height; int xalignmod, yalignmod; Common::Point offset; @@ -894,15 +894,15 @@ gfxw_dyn_view_t::gfxw_dyn_view_t(gfx_state_t *state, Common::Point pos_, int z_, //*** Text *** -static int _gfxwop_text_free(gfxw_widget_t *widget) { - gfxw_text_t *text = (gfxw_text_t *)widget; +static int _gfxwop_text_free(GfxWidget *widget) { + GfxText *text = (GfxText *)widget; free(text->text); return _gfxwop_basic_free(widget); } -static int _gfxwop_text_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_text_t *text = (gfxw_text_t *)widget; +static int _gfxwop_text_draw(GfxWidget *widget, Common::Point pos) { + GfxText *text = (GfxText *)widget; DRAW_ASSERT(widget, GFXW_TEXT); GFX_ASSERT(gfxop_draw_text(text->_visual->gfx_state, text->text_handle, _move_rect(text->_bounds, pos))); @@ -910,8 +910,8 @@ static int _gfxwop_text_draw(gfxw_widget_t *widget, Common::Point pos) { return 0; } -static int _gfxwop_text_alloc_and_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_text_t *text = (gfxw_text_t *)widget; +static int _gfxwop_text_alloc_and_draw(GfxWidget *widget, Common::Point pos) { + GfxText *text = (GfxText *)widget; DRAW_ASSERT(widget, GFXW_TEXT); text->text_handle = gfxop_new_text(widget->_visual->gfx_state, text->font_nr, text->text, text->_bounds.width, @@ -922,19 +922,19 @@ static int _gfxwop_text_alloc_and_draw(gfxw_widget_t *widget, Common::Point pos) return _gfxwop_text_draw(widget, pos); } -static int _gfxwop_text_print(gfxw_widget_t *widget, int indentation) { +static int _gfxwop_text_print(GfxWidget *widget, int indentation) { _gfxw_print_widget(widget, indentation); - sciprintf("TEXT:'%s'", ((gfxw_text_t *)widget)->text); + sciprintf("TEXT:'%s'", ((GfxText *)widget)->text); return 0; } -static int _gfxwop_text_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { - gfxw_text_t *wtext = (gfxw_text_t *)widget, *otext; +static int _gfxwop_text_equals(GfxWidget *widget, GfxWidget *other) { + GfxText *wtext = (GfxText *)widget, *otext; if (other->_type != GFXW_TEXT) return 0; - otext = (gfxw_text_t *)other; + otext = (GfxText *)other; if ((wtext->_bounds.x != otext->_bounds.x) || (wtext->_bounds.y != otext->_bounds.y)) return 0; @@ -955,36 +955,36 @@ static int _gfxwop_text_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { return 1; } -static int _gfxwop_text_should_replace(gfxw_widget_t *widget, gfxw_widget_t *other) { - gfxw_text_t *wtext = (gfxw_text_t *)widget, *otext; +static int _gfxwop_text_should_replace(GfxWidget *widget, GfxWidget *other) { + GfxText *wtext = (GfxText *)widget, *otext; if (other->_type != GFXW_TEXT) return 0; - otext = (gfxw_text_t *)other; + otext = (GfxText *)other; return strcmp(wtext->text, otext->text); } -static int _gfxwop_text_compare_to(gfxw_widget_t *widget, gfxw_widget_t *other) { +static int _gfxwop_text_compare_to(GfxWidget *widget, GfxWidget *other) { return 1; } -void _gfxw_set_ops_TEXT(gfxw_widget_t *widget) { +void _gfxw_set_ops_TEXT(GfxWidget *widget) { _gfxw_set_ops(GFXW(widget), _gfxwop_text_alloc_and_draw, _gfxwop_text_free, _gfxwop_basic_tag, _gfxwop_text_print, _gfxwop_text_compare_to, _gfxwop_text_equals, _gfxwop_basic_superarea_of); widget->should_replace = _gfxwop_text_should_replace; } -gfxw_text_t *gfxw_new_text(gfx_state_t *state, rect_t area, int font, const char *text, gfx_alignment_t halign, +GfxText *gfxw_new_text(gfx_state_t *state, rect_t area, int font, const char *text, gfx_alignment_t halign, gfx_alignment_t valign, gfx_color_t color1, gfx_color_t color2, gfx_color_t bgcolor, int text_flags) { - return new gfxw_text_t(state, area, font, text, halign, valign, color1, color2, bgcolor, text_flags); + return new GfxText(state, area, font, text, halign, valign, color1, color2, bgcolor, text_flags); } -gfxw_text_t::gfxw_text_t(gfx_state_t *state, rect_t area, int font, const char *text_, gfx_alignment_t halign_, +GfxText::GfxText(gfx_state_t *state, rect_t area, int font, const char *text_, gfx_alignment_t halign_, gfx_alignment_t valign_, gfx_color_t color1_, gfx_color_t color2_, gfx_color_t bgcolor_, int text_flags_) - : gfxw_widget_t(GFXW_TEXT) { + : GfxWidget(GFXW_TEXT) { _widgetPriority = _gfxw_color_get_priority(color1_); font_nr = font; @@ -1019,7 +1019,7 @@ gfxw_text_t::gfxw_text_t(gfx_state_t *state, rect_t area, int font, const char * _gfxw_set_ops_TEXT(this); } -void gfxw_text_info(gfx_state_t *state, gfxw_text_t *text, int *lines, int *lineheight, int *offset) { +void gfxw_text_info(gfx_state_t *state, GfxText *text, int *lines, int *lineheight, int *offset) { if (lines) *lines = text->lines_nr; if (lineheight) @@ -1030,12 +1030,12 @@ void gfxw_text_info(gfx_state_t *state, gfxw_text_t *text, int *lines, int *line //-- Container types -- -static int _gfxwop_container_add_dirty_rel(gfxw_container_t *cont, rect_t rect, int propagate) { +static int _gfxwop_container_add_dirty_rel(GfxContainer *cont, rect_t rect, int propagate) { DDIRTY(stderr, "->container_add_dirty_rel(%d,%d,%d,%d, %d)\n", GFX_PRINT_RECT(rect), propagate); return cont->add_dirty_abs(cont, _move_rect(rect, Common::Point(cont->zone.x, cont->zone.y)), propagate); } -static void _gfxw_set_container_ops(gfxw_container_t *container, gfxw_point_op *draw, gfxw_op *free, gfxw_op *tag, +static void _gfxw_set_container_ops(GfxContainer *container, gfxw_point_op *draw, gfxw_op *free, gfxw_op *tag, gfxw_op_int *print, gfxw_bin_op *compare_to, gfxw_bin_op *equals, gfxw_bin_op *superarea_of, gfxw_visual_op *set_visual, gfxw_unary_container_op *free_tagged, gfxw_unary_container_op *free_contents, @@ -1050,8 +1050,8 @@ static void _gfxw_set_container_ops(gfxw_container_t *container, gfxw_point_op * container->set_visual = set_visual; } -static int _w_gfxwop_container_print_contents(const char *name, gfxw_widget_t *widget, int indentation) { - gfxw_widget_t *seeker = widget; +static int _w_gfxwop_container_print_contents(const char *name, GfxWidget *widget, int indentation) { + GfxWidget *seeker = widget; indent(indentation); @@ -1066,9 +1066,9 @@ static int _w_gfxwop_container_print_contents(const char *name, gfxw_widget_t *w return 0; } -static int _w_gfxwop_container_print(gfxw_widget_t *widget, int indentation) { +static int _w_gfxwop_container_print(GfxWidget *widget, int indentation) { gfx_dirty_rect_t *dirty; - gfxw_container_t *container = (gfxw_container_t *)widget; + GfxContainer *container = (GfxContainer *)widget; if (!GFXW_IS_CONTAINER(widget)) { GFXERROR("_w_gfxwop_container_print() called on type %d widget\n", widget->_type); return 1; @@ -1093,8 +1093,8 @@ static int _w_gfxwop_container_print(gfxw_widget_t *widget, int indentation) { } -gfxw_container_t::gfxw_container_t(rect_t area, gfxw_widget_type_t type_) - : gfxw_widget_t(type_) { +GfxContainer::GfxContainer(rect_t area, gfxw_widget_type_t type_) + : GfxWidget(type_) { _bounds = zone = area; contents = NULL; nextpp = &contents; @@ -1123,10 +1123,10 @@ static int _gfxw_dirty_rect_overlaps_normal_rect(rect_t port_zone, rect_t bounds return gfx_rects_overlap(bounds, dirty); } -static int _gfxwop_container_draw_contents(gfxw_widget_t *widget, gfxw_widget_t *contents) { - gfxw_container_t *container = (gfxw_container_t *)widget; +static int _gfxwop_container_draw_contents(GfxWidget *widget, GfxWidget *contents) { + GfxContainer *container = (GfxContainer *)widget; gfx_dirty_rect_t *dirty = container->dirty; - gfx_state_t *gfx_state = (widget->_visual) ? widget->_visual->gfx_state : ((gfxw_visual_t *) widget)->gfx_state; + gfx_state_t *gfx_state = (widget->_visual) ? widget->_visual->gfx_state : ((GfxVisual *) widget)->gfx_state; int draw_ports; rect_t nullzone = {0, 0, 0, 0}; @@ -1134,7 +1134,7 @@ static int _gfxwop_container_draw_contents(gfxw_widget_t *widget, gfxw_widget_t return 0; while (dirty) { - gfxw_widget_t *seeker = contents; + GfxWidget *seeker = contents; while (seeker) { if (_gfxw_dirty_rect_overlaps_normal_rect(GFXW_IS_CONTAINER(seeker) ? nullzone : container->zone, @@ -1143,7 +1143,7 @@ static int _gfxwop_container_draw_contents(gfxw_widget_t *widget, gfxw_widget_t if (GFXW_IS_CONTAINER(seeker)) {// Propagate dirty rectangles /upwards/ DDIRTY(stderr, "container_draw_contents: propagate upwards (%d,%d,%d,%d ,0)\n", GFX_PRINT_RECT(dirty->rect)); - ((gfxw_container_t *)seeker)->add_dirty_abs((gfxw_container_t *)seeker, dirty->rect, 0); + ((GfxContainer *)seeker)->add_dirty_abs((GfxContainer *)seeker, dirty->rect, 0); } seeker->_flags |= GFXW_FLAG_DIRTY; @@ -1160,7 +1160,7 @@ static int _gfxwop_container_draw_contents(gfxw_widget_t *widget, gfxw_widget_t dirty = container->dirty; while (dirty) { - gfxw_widget_t *seeker = contents; + GfxWidget *seeker = contents; while (seeker && (draw_ports || !GFXW_IS_PORT(seeker))) { rect_t small_rect; byte draw_noncontainers; @@ -1193,12 +1193,12 @@ static int _gfxwop_container_draw_contents(gfxw_widget_t *widget, gfxw_widget_t return 0; } -static int _gfxwop_container_free(gfxw_widget_t *widget) { - gfxw_container_t *container = (gfxw_container_t *)widget; - gfxw_widget_t *seeker = container->contents; +static int _gfxwop_container_free(GfxWidget *widget) { + GfxContainer *container = (GfxContainer *)widget; + GfxWidget *seeker = container->contents; while (seeker) { - gfxw_widget_t *next = seeker->_next; + GfxWidget *next = seeker->_next; seeker->widfree(seeker); seeker = next; } @@ -1209,9 +1209,9 @@ static int _gfxwop_container_free(gfxw_widget_t *widget) { return _gfxwop_basic_free(widget); } -static int _gfxwop_container_tag(gfxw_widget_t *widget) { - gfxw_container_t *container = (gfxw_container_t *) widget; - gfxw_widget_t *seeker = container->contents; +static int _gfxwop_container_tag(GfxWidget *widget) { + GfxContainer *container = (GfxContainer *) widget; + GfxWidget *seeker = container->contents; while (seeker) { seeker->tag(seeker); @@ -1221,7 +1221,7 @@ static int _gfxwop_container_tag(gfxw_widget_t *widget) { return 0; } -static int _w_gfxwop_container_set_visual_contents(gfxw_widget_t *contents, gfxw_visual_t *visual) { +static int _w_gfxwop_container_set_visual_contents(GfxWidget *contents, GfxVisual *visual) { while (contents) { contents->set_visual(contents, visual); contents = contents->_next; @@ -1229,8 +1229,8 @@ static int _w_gfxwop_container_set_visual_contents(gfxw_widget_t *contents, gfxw return 0; } -static int _gfxwop_container_set_visual(gfxw_widget_t *widget, gfxw_visual_t *visual) { - gfxw_container_t *container = (gfxw_container_t *) widget; +static int _gfxwop_container_set_visual(GfxWidget *widget, GfxVisual *visual) { + GfxContainer *container = (GfxContainer *) widget; container->_visual = visual; if (widget->_parent) { @@ -1243,11 +1243,11 @@ static int _gfxwop_container_set_visual(gfxw_widget_t *widget, gfxw_visual_t *vi return _w_gfxwop_container_set_visual_contents(container->contents, visual); } -static int _gfxwop_container_free_tagged(gfxw_container_t *container) { - gfxw_widget_t *seekerp = (container->contents); +static int _gfxwop_container_free_tagged(GfxContainer *container) { + GfxWidget *seekerp = (container->contents); while (seekerp) { - gfxw_widget_t *redshirt = seekerp; + GfxWidget *redshirt = seekerp; if (redshirt->_flags & GFXW_FLAG_TAGGED) { seekerp = (redshirt->_next); @@ -1259,25 +1259,25 @@ static int _gfxwop_container_free_tagged(gfxw_container_t *container) { return 0; } -static int _gfxwop_container_free_contents(gfxw_container_t *container) { - gfxw_widget_t *seeker = container->contents; +static int _gfxwop_container_free_contents(GfxContainer *container) { + GfxWidget *seeker = container->contents; while (seeker) { - gfxw_widget_t *next = seeker->_next; + GfxWidget *next = seeker->_next; seeker->widfree(seeker); seeker = next; } return 0; } -static void _gfxw_dirtify_container(gfxw_container_t *container, gfxw_widget_t *widget) { +static void _gfxw_dirtify_container(GfxContainer *container, GfxWidget *widget) { if (GFXW_IS_CONTAINER(widget)) container->add_dirty_abs(GFXWC(container), widget->_bounds, 1); else container->add_dirty_rel(GFXWC(container), widget->_bounds, 1); } -static int _parentize_widget(gfxw_container_t *container, gfxw_widget_t *widget) { +static int _parentize_widget(GfxContainer *container, GfxWidget *widget) { if (widget->_parent) { GFXERROR("_gfxwop_container_add(): Attempt to give second parent node to widget!\nWidget:"); widget->print(GFXW(widget), 3); @@ -1290,15 +1290,15 @@ static int _parentize_widget(gfxw_container_t *container, gfxw_widget_t *widget) widget->_parent = GFXWC(container); if (GFXW_IS_VISUAL(container)) - widget->set_visual(widget, (gfxw_visual_t *) container); + widget->set_visual(widget, (GfxVisual *) container); else if (container->_visual) widget->set_visual(widget, container->_visual); return 0; } -static int _gfxw_container_id_equals(gfxw_container_t *container, gfxw_widget_t *widget) { - gfxw_widget_t **seekerp = &(container->contents); +static int _gfxw_container_id_equals(GfxContainer *container, GfxWidget *widget) { + GfxWidget **seekerp = &(container->contents); if (GFXW_IS_PORT(widget)) return 0; @@ -1323,7 +1323,7 @@ static int _gfxw_container_id_equals(gfxw_container_t *container, gfxw_widget_t } } -static int _gfxwop_container_add_dirty(gfxw_container_t *container, rect_t dirty, int propagate) { +static int _gfxwop_container_add_dirty(GfxContainer *container, rect_t dirty, int propagate) { #if 0 // This code has been disabled because containers may contain sub-containers with // bounds greater than their own. @@ -1336,7 +1336,7 @@ static int _gfxwop_container_add_dirty(gfxw_container_t *container, rect_t dirty return 0; } -static int _gfxwop_container_add(gfxw_container_t *container, gfxw_widget_t *widget) { +static int _gfxwop_container_add(GfxContainer *container, GfxWidget *widget) { if (_gfxw_container_id_equals(container, widget)) return 0; @@ -1356,10 +1356,10 @@ static int _gfxwop_container_add(gfxw_container_t *container, gfxw_widget_t *wid //*** Lists and sorted lists *** -static int _gfxwop_list_draw(gfxw_widget_t *list, Common::Point pos) { +static int _gfxwop_list_draw(GfxWidget *list, Common::Point pos) { DRAW_ASSERT(list, GFXW_LIST); - _gfxwop_container_draw_contents(list, ((gfxw_list_t *)list)->contents); + _gfxwop_container_draw_contents(list, ((GfxList *)list)->contents); recursively_free_dirty_rects(GFXWC(list)->dirty); GFXWC(list)->dirty = NULL; list->_flags &= ~GFXW_FLAG_DIRTY; @@ -1367,34 +1367,34 @@ static int _gfxwop_list_draw(gfxw_widget_t *list, Common::Point pos) { return 0; } -static int _gfxwop_sorted_list_draw(gfxw_widget_t *list, Common::Point pos) { +static int _gfxwop_sorted_list_draw(GfxWidget *list, Common::Point pos) { DRAW_ASSERT(list, GFXW_SORTED_LIST); - _gfxwop_container_draw_contents(list, ((gfxw_list_t *)list)->contents); + _gfxwop_container_draw_contents(list, ((GfxList *)list)->contents); recursively_free_dirty_rects(GFXWC(list)->dirty); GFXWC(list)->dirty = NULL; return 0; } -static int _w_gfxwop_list_print(gfxw_widget_t *list, const char *name, int indentation) { +static int _w_gfxwop_list_print(GfxWidget *list, const char *name, int indentation) { _gfxw_print_widget(list, indentation); sciprintf("%s", name); return _w_gfxwop_container_print(list, indentation); } -static int _gfxwop_list_print(gfxw_widget_t *list, int indentation) { +static int _gfxwop_list_print(GfxWidget *list, int indentation) { return _w_gfxwop_list_print(list, "LIST", indentation); } -static int _gfxwop_sorted_list_print(gfxw_widget_t *list, int indentation) { +static int _gfxwop_sorted_list_print(GfxWidget *list, int indentation) { return _w_gfxwop_list_print(list, "SORTED_LIST", indentation); } -static int _gfxwop_list_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { +static int _gfxwop_list_equals(GfxWidget *widget, GfxWidget *other) { // Requires identical order of list elements. - gfxw_list_t *wlist, *olist; + GfxList *wlist, *olist; if (widget->_type != other->_type) return 0; @@ -1406,8 +1406,8 @@ static int _gfxwop_list_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { return 0; } - wlist = (gfxw_list_t *)widget; - olist = (gfxw_list_t *)other; + wlist = (GfxList *)widget; + olist = (GfxList *)other; if (memcmp(&(wlist->_bounds), &(olist->_bounds), sizeof(rect_t))) return 0; @@ -1426,7 +1426,7 @@ static int _gfxwop_list_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { return (!widget && !other); // True if both are finished now } -static int _gfxwop_list_add_dirty(gfxw_container_t *container, rect_t dirty, int propagate) { +static int _gfxwop_list_add_dirty(GfxContainer *container, rect_t dirty, int propagate) { // Lists add dirty boxes to both themselves and their parenting port/visual container->_flags |= GFXW_FLAG_DIRTY; @@ -1441,9 +1441,9 @@ static int _gfxwop_list_add_dirty(gfxw_container_t *container, rect_t dirty, int return _gfxwop_container_add_dirty(container, dirty, propagate); } -int _gfxwop_ordered_add(gfxw_container_t *container, gfxw_widget_t *widget, int compare_all) { +int _gfxwop_ordered_add(GfxContainer *container, GfxWidget *widget, int compare_all) { // O(n) - gfxw_widget_t **seekerp = &(container->contents); + GfxWidget **seekerp = &(container->contents); if (widget->_next) { GFXERROR("_gfxwop_sorted_list_add(): Attempt to add widget to two lists!\nWidget:"); @@ -1486,13 +1486,13 @@ int _gfxwop_ordered_add(gfxw_container_t *container, gfxw_widget_t *widget, int return _parentize_widget(container, widget); } -static int _gfxwop_sorted_list_add(gfxw_container_t *container, gfxw_widget_t *widget) { +static int _gfxwop_sorted_list_add(GfxContainer *container, GfxWidget *widget) { // O(n) return _gfxwop_ordered_add(container, widget, 0); } -void _gfxw_set_ops_LIST(gfxw_container_t *list, char sorted) { - _gfxw_set_container_ops((gfxw_container_t *)list, sorted ? _gfxwop_sorted_list_draw : _gfxwop_list_draw, +void _gfxw_set_ops_LIST(GfxContainer *list, char sorted) { + _gfxw_set_container_ops((GfxContainer *)list, sorted ? _gfxwop_sorted_list_draw : _gfxwop_list_draw, _gfxwop_container_free, _gfxwop_container_tag, sorted ? _gfxwop_sorted_list_print : _gfxwop_list_print, _gfxwop_basic_compare_to, sorted ? _gfxwop_basic_equals : _gfxwop_list_equals, @@ -1501,12 +1501,12 @@ void _gfxw_set_ops_LIST(gfxw_container_t *list, char sorted) { _gfxwop_list_add_dirty, sorted ? _gfxwop_sorted_list_add : _gfxwop_container_add); } -gfxw_list_t *gfxw_new_list(rect_t area, int sorted) { - return new gfxw_list_t(area, sorted); +GfxList *gfxw_new_list(rect_t area, int sorted) { + return new GfxList(area, sorted); } -gfxw_list_t::gfxw_list_t(rect_t area, bool sorted) - : gfxw_container_t(area, sorted ? GFXW_SORTED_LIST : GFXW_LIST) { +GfxList::GfxList(rect_t area, bool sorted) + : GfxContainer(area, sorted ? GFXW_SORTED_LIST : GFXW_LIST) { _gfxw_set_ops_LIST(this, sorted); } @@ -1515,8 +1515,8 @@ gfxw_list_t::gfxw_list_t(rect_t area, bool sorted) //*** Visuals *** -static int _gfxwop_visual_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_visual_t *visual = (gfxw_visual_t *) widget; +static int _gfxwop_visual_draw(GfxWidget *widget, Common::Point pos) { + GfxVisual *visual = (GfxVisual *) widget; gfx_dirty_rect_t *dirty = visual->dirty; DRAW_ASSERT(widget, GFXW_VISUAL); @@ -1542,9 +1542,9 @@ static int _gfxwop_visual_draw(gfxw_widget_t *widget, Common::Point pos) { return 0; } -static int _gfxwop_visual_free(gfxw_widget_t *widget) { - gfxw_visual_t *visual = (gfxw_visual_t *) widget; - gfxw_port_t **portrefs; +static int _gfxwop_visual_free(GfxWidget *widget) { + GfxVisual *visual = (GfxVisual *) widget; + GfxPort **portrefs; int retval; if (!GFXW_IS_VISUAL(visual)) { @@ -1562,10 +1562,10 @@ static int _gfxwop_visual_free(gfxw_widget_t *widget) { return 0; } -static int _gfxwop_visual_print(gfxw_widget_t *widget, int indentation) { +static int _gfxwop_visual_print(GfxWidget *widget, int indentation) { int i; int comma = 0; - gfxw_visual_t *visual = (gfxw_visual_t *) widget; + GfxVisual *visual = (GfxVisual *) widget; if (!GFXW_IS_VISUAL(visual)) { GFXERROR("_gfxwop_visual_print() called on non-visual!Widget was: "); @@ -1589,7 +1589,7 @@ static int _gfxwop_visual_print(gfxw_widget_t *widget, int indentation) { return _w_gfxwop_container_print(widget, indentation); } -static int _gfxwop_visual_set_visual(gfxw_widget_t *self, gfxw_visual_t *visual) { +static int _gfxwop_visual_set_visual(GfxWidget *self, GfxVisual *visual) { if (self != GFXW(visual)) { GFXWARN("Attempt to set a visual's parent visual to something else!\n"); } else { @@ -1599,31 +1599,31 @@ static int _gfxwop_visual_set_visual(gfxw_widget_t *self, gfxw_visual_t *visual) return 1; } -void _gfxw_set_ops_VISUAL(gfxw_container_t *visual) { - _gfxw_set_container_ops((gfxw_container_t *)visual, _gfxwop_visual_draw, _gfxwop_visual_free, +void _gfxw_set_ops_VISUAL(GfxContainer *visual) { + _gfxw_set_container_ops((GfxContainer *)visual, _gfxwop_visual_draw, _gfxwop_visual_free, _gfxwop_container_tag, _gfxwop_visual_print, _gfxwop_basic_compare_to, _gfxwop_basic_equals, _gfxwop_basic_superarea_of, _gfxwop_visual_set_visual, _gfxwop_container_free_tagged, _gfxwop_container_free_contents, _gfxwop_container_add_dirty, _gfxwop_container_add); } -gfxw_visual_t *gfxw_new_visual(gfx_state_t *state, int font) { - return new gfxw_visual_t(state, font); +GfxVisual *gfxw_new_visual(gfx_state_t *state, int font) { + return new GfxVisual(state, font); } -gfxw_visual_t::gfxw_visual_t(gfx_state_t *state, int font) - : gfxw_container_t(gfx_rect(0, 0, 320, 200), GFXW_VISUAL) { +GfxVisual::GfxVisual(gfx_state_t *state, int font) + : GfxContainer(gfx_rect(0, 0, 320, 200), GFXW_VISUAL) { font_nr = font; gfx_state = state; port_refs_nr = 16; - port_refs = (gfxw_port_t **)sci_calloc(sizeof(gfxw_port_t), port_refs_nr); // FIXME: Isn't this bogus??? + port_refs = (GfxPort **)sci_calloc(sizeof(GfxPort), port_refs_nr); // FIXME: Isn't this bogus??? _gfxw_set_ops_VISUAL(this); } -static int _visual_find_free_ID(gfxw_visual_t *visual) { +static int _visual_find_free_ID(GfxVisual *visual) { int id = 0; int newports = 16; @@ -1632,14 +1632,14 @@ static int _visual_find_free_ID(gfxw_visual_t *visual) { if (id == visual->port_refs_nr) { // Out of ports? visual->port_refs_nr += newports; - visual->port_refs = (gfxw_port_t**)sci_realloc(visual->port_refs, visual->port_refs_nr); // FIXME: Isn't this bogus??? - memset(visual->port_refs + id, 0, newports * sizeof(gfxw_port_t *)); // Clear new port refs + visual->port_refs = (GfxPort**)sci_realloc(visual->port_refs, visual->port_refs_nr); // FIXME: Isn't this bogus??? + memset(visual->port_refs + id, 0, newports * sizeof(GfxPort *)); // Clear new port refs } return id; } -static int _gfxwop_add_dirty_rects(gfxw_container_t *dest, gfx_dirty_rect_t *src) { +static int _gfxwop_add_dirty_rects(GfxContainer *dest, gfx_dirty_rect_t *src) { DDIRTY(stderr, "Adding multiple dirty to #%d\n", dest->_ID); if (src) { dest->dirty = gfxdr_add_dirty(dest->dirty, src->rect, GFXW_DIRTY_STRATEGY); @@ -1651,8 +1651,8 @@ static int _gfxwop_add_dirty_rects(gfxw_container_t *dest, gfx_dirty_rect_t *src //*** Ports *** -static int _gfxwop_port_draw(gfxw_widget_t *widget, Common::Point pos) { - gfxw_port_t *port = (gfxw_port_t *) widget; +static int _gfxwop_port_draw(GfxWidget *widget, Common::Point pos) { + GfxPort *port = (GfxPort *) widget; DRAW_ASSERT(widget, GFXW_PORT); if (port->decorations) { @@ -1674,11 +1674,11 @@ static int _gfxwop_port_draw(gfxw_widget_t *widget, Common::Point pos) { return 0; } -static int _gfxwop_port_free(gfxw_widget_t *widget) { - gfxw_port_t *port = (gfxw_port_t *) widget; +static int _gfxwop_port_free(GfxWidget *widget) { + GfxPort *port = (GfxPort *) widget; if (port->_visual) { - gfxw_visual_t *visual = port->_visual; + GfxVisual *visual = port->_visual; int ID = port->_ID; if (ID < 0 || ID >= visual->port_refs_nr) { @@ -1699,8 +1699,8 @@ static int _gfxwop_port_free(gfxw_widget_t *widget) { return _gfxwop_container_free(widget); } -static int _gfxwop_port_print(gfxw_widget_t *widget, int indentation) { - gfxw_port_t *port = (gfxw_port_t *)widget; +static int _gfxwop_port_print(GfxWidget *widget, int indentation) { + GfxPort *port = (GfxPort *)widget; _gfxw_print_widget(widget, indentation); sciprintf("PORT"); @@ -1712,8 +1712,8 @@ static int _gfxwop_port_print(gfxw_widget_t *widget, int indentation) { return _w_gfxwop_container_print_contents("decorations", GFXW(port->decorations), indentation); } -static int _gfxwop_port_superarea_of(gfxw_widget_t *self, gfxw_widget_t *other) { - gfxw_port_t *port = (gfxw_port_t *) self; +static int _gfxwop_port_superarea_of(GfxWidget *self, GfxWidget *other) { + GfxPort *port = (GfxPort *) self; if (!port->port_bg) return _gfxwop_basic_superarea_of(self, other); @@ -1721,8 +1721,8 @@ static int _gfxwop_port_superarea_of(gfxw_widget_t *self, gfxw_widget_t *other) return port->port_bg->superarea_of(port->port_bg, other); } -static int _gfxwop_port_set_visual(gfxw_widget_t *widget, gfxw_visual_t *visual) { - gfxw_list_t *decorations = ((gfxw_port_t *) widget)->decorations; +static int _gfxwop_port_set_visual(GfxWidget *widget, GfxVisual *visual) { + GfxList *decorations = ((GfxPort *) widget)->decorations; widget->_visual = visual; if (decorations) @@ -1735,8 +1735,8 @@ static int _gfxwop_port_set_visual(gfxw_widget_t *widget, gfxw_visual_t *visual) return _gfxwop_container_set_visual(widget, visual); } -static int _gfxwop_port_add_dirty(gfxw_container_t *widget, rect_t dirty, int propagate) { - gfxw_port_t *self = (gfxw_port_t *) widget; +static int _gfxwop_port_add_dirty(GfxContainer *widget, rect_t dirty, int propagate) { + GfxPort *self = (GfxPort *) widget; self->_flags |= GFXW_FLAG_DIRTY; @@ -1748,13 +1748,13 @@ static int _gfxwop_port_add_dirty(gfxw_container_t *widget, rect_t dirty, int pr #if 0 // FIXME: This is a worthwhile optimization if (self->port_bg) { - gfxw_widget_t foo; + GfxWidget foo; foo.bounds = dirty; // Yeah, sub-elegant, I know foo.bounds.x -= self->zone.x; foo.bounds.y -= self->zone.y; if (self->port_bg->superarea_of(self->port_bg, &foo)) { - gfxw_container_t *parent = self->_parent; + GfxContainer *parent = self->_parent; while (parent) { fprintf(stderr, "Dirtifying parent id %d\n", parent->_ID); parent->_flags |= GFXW_FLAG_DIRTY; @@ -1774,24 +1774,24 @@ static int _gfxwop_port_add_dirty(gfxw_container_t *widget, rect_t dirty, int pr return 0; } -static int _gfxwop_port_add(gfxw_container_t *container, gfxw_widget_t *widget) { +static int _gfxwop_port_add(GfxContainer *container, GfxWidget *widget) { // O(n) return _gfxwop_ordered_add(container, widget, 1); } -void _gfxw_set_ops_PORT(gfxw_container_t *widget) { - _gfxw_set_container_ops((gfxw_container_t *)widget, _gfxwop_port_draw, _gfxwop_port_free, _gfxwop_container_tag, +void _gfxw_set_ops_PORT(GfxContainer *widget) { + _gfxw_set_container_ops((GfxContainer *)widget, _gfxwop_port_draw, _gfxwop_port_free, _gfxwop_container_tag, _gfxwop_port_print, _gfxwop_basic_compare_to, _gfxwop_basic_equals, _gfxwop_port_superarea_of, _gfxwop_port_set_visual, _gfxwop_container_free_tagged, _gfxwop_container_free_contents, _gfxwop_port_add_dirty, _gfxwop_port_add); } -gfxw_port_t *gfxw_new_port(gfxw_visual_t *visual, gfxw_port_t *predecessor, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor) { - return new gfxw_port_t(visual, area, fgcolor, bgcolor); +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); } -gfxw_port_t::gfxw_port_t(gfxw_visual_t *visual_, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor_) - : gfxw_container_t(area, GFXW_PORT) { +GfxPort::GfxPort(GfxVisual *visual_, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor_) + : GfxContainer(area, GFXW_PORT) { VERIFY_WIDGET(visual_); port_bg = NULL; @@ -1809,13 +1809,13 @@ gfxw_port_t::gfxw_port_t(gfxw_visual_t *visual_, rect_t area, gfx_color_t fgcolo _gfxw_set_ops_PORT(this); } -void gfxw_port_auto_restore_background(gfxw_visual_t *visual, gfxw_port_t *window, rect_t auto_rect) { +void gfxw_port_auto_restore_background(GfxVisual *visual, GfxPort *window, rect_t auto_rect) { window->port_flags |= kWindowAutoRestore; window->restore_snap = gfxw_make_snapshot(visual, auto_rect); } -gfxw_port_t *gfxw_remove_port(gfxw_visual_t *visual, gfxw_port_t *port) { - gfxw_port_t *parent; +GfxPort *gfxw_remove_port(GfxVisual *visual, GfxPort *port) { + GfxPort *parent; VERIFY_WIDGET(visual); VERIFY_WIDGET(port); @@ -1824,7 +1824,7 @@ gfxw_port_t *gfxw_remove_port(gfxw_visual_t *visual, gfxw_port_t *port) { return NULL; } - parent = (gfxw_port_t *)port->_parent; + parent = (GfxPort *)port->_parent; if (port->port_flags & kWindowAutoRestore) gfxw_restore_snapshot(visual, port->restore_snap); @@ -1832,23 +1832,23 @@ gfxw_port_t *gfxw_remove_port(gfxw_visual_t *visual, gfxw_port_t *port) { return parent; while (parent && !GFXW_IS_PORT(parent)) - parent = (gfxw_port_t *)parent->_parent; // Ascend through ancestors + parent = (GfxPort *)parent->_parent; // Ascend through ancestors return parent; } -gfxw_port_t *gfxw_find_port(gfxw_visual_t *visual, int ID) { +GfxPort *gfxw_find_port(GfxVisual *visual, int ID) { if (ID < 0 || ID >= visual->port_refs_nr) return NULL; return visual->port_refs[ID]; } -gfxw_port_t *gfxw_find_default_port(gfxw_visual_t *visual) { +GfxPort *gfxw_find_default_port(GfxVisual *visual) { int id = visual->port_refs_nr; while (id--) { - gfxw_port_t *port = visual->port_refs[id]; + GfxPort *port = visual->port_refs[id]; if (port) return port; @@ -1859,7 +1859,7 @@ gfxw_port_t *gfxw_find_default_port(gfxw_visual_t *visual) { // - other functions - -gfxw_widget_t *gfxw_set_id(gfxw_widget_t *widget, int ID, int subID) { +GfxWidget *gfxw_set_id(GfxWidget *widget, int ID, int subID) { if (widget) { widget->_ID = ID; widget->_subID = subID; @@ -1868,7 +1868,7 @@ gfxw_widget_t *gfxw_set_id(gfxw_widget_t *widget, int ID, int subID) { return widget; } -gfxw_dyn_view_t *gfxw_dyn_view_set_params(gfxw_dyn_view_t *widget, int under_bits, void *under_bitsp, int signal, void *signalp) { +GfxDynView *gfxw_dyn_view_set_params(GfxDynView *widget, int under_bits, void *under_bitsp, int signal, void *signalp) { if (!widget) return NULL; @@ -1880,12 +1880,12 @@ gfxw_dyn_view_t *gfxw_dyn_view_set_params(gfxw_dyn_view_t *widget, int under_bit return widget; } -gfxw_widget_t *gfxw_remove_id(gfxw_container_t *container, int ID, int subID) { - gfxw_widget_t **wp = &(container->contents); +GfxWidget *gfxw_remove_id(GfxContainer *container, int ID, int subID) { + GfxWidget **wp = &(container->contents); while (*wp) { if ((*wp)->_ID == ID && (subID == GFXW_NO_ID || (*wp)->_subID == subID)) { - gfxw_widget_t *widget = *wp; + GfxWidget *widget = *wp; *wp = (*wp)->_next; widget->_next = NULL; @@ -1901,7 +1901,7 @@ gfxw_widget_t *gfxw_remove_id(gfxw_container_t *container, int ID, int subID) { return NULL; } -gfxw_widget_t *gfxw_hide_widget(gfxw_widget_t *widget) { +GfxWidget *gfxw_hide_widget(GfxWidget *widget) { if (widget->_flags & GFXW_FLAG_VISIBLE) { widget->_flags &= ~GFXW_FLAG_VISIBLE; @@ -1912,7 +1912,7 @@ gfxw_widget_t *gfxw_hide_widget(gfxw_widget_t *widget) { return widget; } -gfxw_widget_t *gfxw_show_widget(gfxw_widget_t *widget) { +GfxWidget *gfxw_show_widget(GfxWidget *widget) { if (!(widget->_flags & GFXW_FLAG_VISIBLE)) { widget->_flags |= GFXW_FLAG_VISIBLE; @@ -1923,7 +1923,7 @@ gfxw_widget_t *gfxw_show_widget(gfxw_widget_t *widget) { return widget; } -gfxw_snapshot_t *gfxw_make_snapshot(gfxw_visual_t *visual, rect_t area) { +gfxw_snapshot_t *gfxw_make_snapshot(GfxVisual *visual, rect_t area) { gfxw_snapshot_t *retval = (gfxw_snapshot_t*)sci_malloc(sizeof(gfxw_snapshot_t)); retval->serial = widget_serial_number_counter++; @@ -1938,7 +1938,7 @@ gfxw_snapshot_t *gfxw_make_snapshot(gfxw_visual_t *visual, rect_t area) { return retval; } -int gfxw_widget_matches_snapshot(gfxw_snapshot_t *snapshot, gfxw_widget_t *widget) { +int gfxw_widget_matches_snapshot(gfxw_snapshot_t *snapshot, GfxWidget *widget) { int free_below = (snapshot->serial < widget_serial_number_counter) ? 0 : widget_serial_number_counter; int free_above_eq = snapshot->serial; rect_t bounds = widget->_bounds; @@ -1958,11 +1958,11 @@ int gfxw_widget_matches_snapshot(gfxw_snapshot_t *snapshot, gfxw_widget_t *widge #define MAGIC_FREE_NUMBER -42 -void _gfxw_free_contents_appropriately(gfxw_container_t *container, gfxw_snapshot_t *snapshot, int priority) { - gfxw_widget_t *widget = container->contents; +void _gfxw_free_contents_appropriately(GfxContainer *container, gfxw_snapshot_t *snapshot, int priority) { + GfxWidget *widget = container->contents; while (widget) { - gfxw_widget_t *next = widget->_next; + GfxWidget *next = widget->_next; if (gfxw_widget_matches_snapshot(snapshot, widget) && !(widget->_flags & GFXW_FLAG_IMMUNE_TO_SNAPSHOTS) && (priority == MAGIC_FREE_NUMBER || priority <= widget->_widgetPriority || widget->_widgetPriority == -1)) { @@ -1976,14 +1976,14 @@ void _gfxw_free_contents_appropriately(gfxw_container_t *container, gfxw_snapsho } } -gfxw_snapshot_t *gfxw_restore_snapshot(gfxw_visual_t *visual, gfxw_snapshot_t *snapshot) { +gfxw_snapshot_t *gfxw_restore_snapshot(GfxVisual *visual, gfxw_snapshot_t *snapshot) { _gfxw_free_contents_appropriately(GFXWC(visual), snapshot, MAGIC_FREE_NUMBER); return snapshot; } -void gfxw_annihilate(gfxw_widget_t *widget) { - gfxw_visual_t *visual = widget->_visual; +void gfxw_annihilate(GfxWidget *widget) { + GfxVisual *visual = widget->_visual; int widget_priority = 0; int free_overdrawn = 0; @@ -2003,7 +2003,7 @@ void gfxw_annihilate(gfxw_widget_t *widget) { _gfxw_free_contents_appropriately(GFXWC(visual), &snapshot, widget_priority); } -gfxw_dyn_view_t *gfxw_picviewize_dynview(gfxw_dyn_view_t *dynview) { +GfxDynView *gfxw_picviewize_dynview(GfxDynView *dynview) { dynview->_type = GFXW_PIC_VIEW; dynview->_flags |= GFXW_FLAG_DIRTY; diff --git a/engines/sci/gfx/gfx_widgets.h b/engines/sci/gfx/gfx_widgets.h index 7800227e4b..20e970fa99 100644 --- a/engines/sci/gfx/gfx_widgets.h +++ b/engines/sci/gfx/gfx_widgets.h @@ -36,17 +36,17 @@ namespace Sci { struct gfx_state_t; -struct gfxw_box_t; -struct gfxw_dyn_view_t; -struct gfxw_container_t; -struct gfxw_list_t; -struct gfxw_port_t; -struct gfxw_primitive_t; +struct GfxBox; +struct GfxDynView; +struct GfxContainer; +struct GfxList; +struct GfxPort; +struct GfxPrimitive; struct gfxw_snapshot_t; -struct gfxw_text_t; -struct gfxw_view_t; -struct gfxw_visual_t; -struct gfxw_widget_t; +struct GfxText; +struct GfxView; +struct GfxVisual; +struct GfxWidget; /* Enable the next line to keep a list of pointers to all widgets, with up to the specified amount @@ -83,9 +83,9 @@ struct gfxw_widget_t; #define GFXW(foo) (foo) -/* Typecast an arbitrary widget to gfxw_widget_t*. Might eventually be changed to do tests as well. */ +/* Typecast an arbitrary widget to GfxWidget*. Might eventually be changed to do tests as well. */ -#define GFXWC(foo) ((gfxw_container_t *) foo) +#define GFXWC(foo) ((GfxContainer *) foo) /* Typecasts a container widget to gfxw_container_widget_t *. */ /* gfxw_point_zero is declared in gfx/widgets.c */ @@ -100,9 +100,9 @@ extern Common::Point gfxw_point_zero; ** ** ** -** -- draw(gfxw_widget_t *self, Common::Point pos) +** -- draw(GfxWidget *self, Common::Point pos) ** Draws the widget. -** Parameters: (gfxw_widget_t *) self: self reference +** Parameters: (GfxWidget *) self: self reference ** (Common::Point) pos: The position to draw to (added to the widget's ** internal position) ** Returns : (int) 0 @@ -110,46 +110,46 @@ extern Common::Point gfxw_point_zero; ** a container widget will recursively draw all of its contents. ** ** -** -- widfree(gfxw_widget_t *self) +** -- widfree(GfxWidget *self) ** Frees all memory associated to the widget -** Parameters: (gfxw_widget_t *) self: self reference +** Parameters: (GfxWidget *) self: self reference ** Returns : (int) 0 ** The widget automatically removes itself from its owner, if it has one. ** Invoking this operation on a container will recursively free all of its ** contents. ** ** -** -- tag(gfxw_widget_t *self) +** -- tag(GfxWidget *self) ** Tags the specified widget -** Parameters: (gfxw_widget_t *) self: self reference +** Parameters: (GfxWidget *) self: self reference ** Returns : (int) 0 ** If invoked on a container widget, this will also tag all of the container's ** contents (but not the contents' contents!) ** ** -** -- print(gfxw_widget_t *self, int indentation) +** -- print(GfxWidget *self, int indentation) ** Prints a string representation of the widget with sciprintf -** Parameters: (gfxw_widget_t *) self: self reference +** Parameters: (GfxWidget *) self: self reference ** (int) indentation: Number of double spaces to indent ** Returns ; (int) 0 ** Will recursively print all of the widget's contents if the widget contains ** further sub-widgets ** ** -** -- compare_to(gfxw_widget_t *self, gfxw_widget_t *other) +** -- compare_to(GfxWidget *self, GfxWidget *other) ** Compares two compareable widgets by their screen position -** Parameters: (gfxw_widget_t *) self: self reference -** (gfxw_widget_t *) other: other widget +** Parameters: (GfxWidget *) self: self reference +** (GfxWidget *) other: other widget ** Returns : (int) <0, 0, or >0 if other is, respectively, less than, equal ** to, or greater than self ** This comparison only applies to some widgets; compare_to(a,a)=0 is not ** guaranteed. It may be used for sorting for all widgets. ** ** -** -- equals(gfxw_widget_t *self, gfxw_widget_t *other) +** -- equals(GfxWidget *self, GfxWidget *other) ** Compares two compareable widgets for equality -** Parameters: (gfxw_widget_t *) self: self reference -** (gfxw_widget_t *) other: other widget +** Parameters: (GfxWidget *) self: self reference +** (GfxWidget *) other: other widget ** Returns : (int) 0 if the widgets are not equal, != 0 if they match ** This operation checks whether two widgets describe the same graphical data. ** It is used to determine whether a new widget should be discarded because it @@ -158,10 +158,10 @@ extern Common::Point gfxw_point_zero; ** order. ** ** -** -- should_replace(gfxw_widget_t *self, gfxw_widget_t *other) +** -- should_replace(GfxWidget *self, GfxWidget *other) ** Compares two compareable widgets for equality -** Parameters: (gfxw_widget_t *) self: self reference -** (gfxw_widget_t *) other: other widget +** Parameters: (GfxWidget *) self: self reference +** (GfxWidget *) other: other widget ** Returns : (int) 0 if 'self' should be kept, != 0 if it should be replaced ** by the 'other' ** When 'equals' returns true, this means that no new widget will be added. @@ -170,16 +170,16 @@ extern Common::Point gfxw_point_zero; ** function. ** ** -** -- superarea_of(gfxw_widget_t *self, gfxw_widget_t *other) +** -- superarea_of(GfxWidget *self, GfxWidget *other) ** Tests whether drawing self after other would reduce all traces of other -** Parameters: (gfxw_widget_t *) self: self reference +** Parameters: (GfxWidget *) self: self reference ** (gxfw_widget_t *) other: The widget to compare for containment ** Returns : (int) 1 if self is superarea_of other, 0 otherwise ** ** -** -- set_visual(gfxw_widget_t *self) +** -- set_visual(GfxWidget *self) ** Sets the visual for the widget -** Parameters: (gfxw_widget_t *) self: self reference +** Parameters: (GfxWidget *) self: self reference ** Returns : (int) 0 ** This function is called by container->add() and need not be invoked explicitly. ** It also makes sure that dirty rectangles are passed to parent containers. @@ -191,22 +191,22 @@ extern Common::Point gfxw_point_zero; ** ************************** ** ** -** -- free_tagged(gfxw_container_t *self) +** -- free_tagged(GfxContainer *self) ** Frees all tagged resources in the container -** Parameters: (gfxw_container_t *) self: self reference +** Parameters: (GfxContainer *) self: self reference ** Returns : (int) 0 ** The container itself is never freed in this way. ** ** -** -- free_contents(gfxw_container_t *self) +** -- free_contents(GfxContainer *self) ** Frees all resources contained in the container -** Parameters: (gfxw_container_t *) self: self reference +** Parameters: (GfxContainer *) self: self reference ** Returns : (int) 0 ** ** -** -- add_dirty_abs(gfxw_container_t *self, rect_t dirty, int propagate) +** -- add_dirty_abs(GfxContainer *self, rect_t dirty, int propagate) ** Adds a dirty rectangle to the container's list of dirty rects -** Parameters: (gfxw_container_t *) self: self reference +** Parameters: (GfxContainer *) self: self reference ** (rect_t) dirty: The rectangular screen area that is to be flagged ** as dirty, absolute to the screen ** (int) propagate: Whether the dirty rect should be propagated to the @@ -218,9 +218,9 @@ extern Common::Point gfxw_point_zero; ** GFXW_DIRTY_STRATEGY. ** ** -** -- add_dirty_rel(gfxw_container_t *self, rect_t dirty, int propagate) +** -- add_dirty_rel(GfxContainer *self, rect_t dirty, int propagate) ** Adds a dirty rectangle to the container's list of dirty rects -** Parameters: (gfxw_container_t *) self: self reference +** Parameters: (GfxContainer *) self: self reference ** (rect_t) dirty: The rectangular screen area that is to be flagged ** as dirty, relative to the widget ** (int) propagate: Whether the dirty rect should be propagated to the @@ -232,10 +232,10 @@ extern Common::Point gfxw_point_zero; ** GFXW_DIRTY_STRATEGY. ** ** -** -- add(gfxw_container_t *self, gfxw_widget_t *widget) +** -- add(GfxContainer *self, GfxWidget *widget) ** Adds a widget to the list of contained widgets -** Parameters: (gfxw_container_t *) self: self reference -** (gfxw_widget_t *) widget: The widget to add +** Parameters: (GfxContainer *) self: self reference +** (GfxWidget *) widget: The widget to add ** Returns : (int) 0 ** Sorted lists sort their content into the list rather than adding it to the ** end. @@ -248,33 +248,33 @@ extern Common::Point gfxw_point_zero; /*-- Primitive types --*/ -gfxw_box_t *gfxw_new_box(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type); +GfxBox *gfxw_new_box(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type); /* Creates a new box ** Parameters: (gfx_state_t *) state: The (optional) state ** (rect_t) area: The box's dimensions, relative to its container widget ** (gfx_color_t) color1: The primary color ** (gfx_color_t) color1: The secondary color (ignored if shading is disabled) ** (gfx_box_shade_t) shade_type: The shade type for the box -** Returns : (gfxw_box_t *) The resulting box widget +** Returns : (GfxBox *) The resulting box widget ** The graphics state- if non-NULL- is used here for some optimizations. */ -gfxw_primitive_t *gfxw_new_rect(rect_t rect, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style); +GfxPrimitive *gfxw_new_rect(rect_t rect, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style); /* Creates a new rectangle ** Parameters: (rect_t) rect: The rectangle area ** (gfx_color_t) color: The rectangle's color ** (gfx_line_mode_t) line_mode: The line mode for the lines that make up the rectangle ** (gfx_line_style_t) line_style: The rectangle's lines' style -** Returns : (gfxw_primitive_t *) The newly allocated rectangle widget (a Primitive) +** Returns : (GfxPrimitive *) The newly allocated rectangle widget (a Primitive) */ -gfxw_primitive_t *gfxw_new_line(Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style); +GfxPrimitive *gfxw_new_line(Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style); /* Creates a new line ** Parameters: (Common::Point * Common::Point) (start, line): The line origin and end point ** (gfx_color_t) color: The line's color ** (gfx_line_mode_t) line_mode: The line mode to use for drawing ** (gfx_line_style_t) line_style: The line style -** Returns : (gfxw_primitive_t *) The newly allocated line widget (a Primitive) +** Returns : (GfxPrimitive *) The newly allocated line widget (a Primitive) */ @@ -284,7 +284,7 @@ gfxw_primitive_t *gfxw_new_line(Common::Point start, Common::Point end, gfx_colo /* Whether the view should _not_ apply its x/y offset modifyers */ #define GFXW_VIEW_FLAG_DONT_MODIFY_OFFSET (1 << 1) -gfxw_view_t *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view, int loop, int cel, int palette, int priority, int control, +GfxView *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view, int loop, int cel, int palette, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int flags); /* Creates a new view (a cel, actually) ** Parameters: (gfx_state_t *) state: The graphics state @@ -298,7 +298,7 @@ gfxw_view_t *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view, int ** Returns : (gfxw_cel_t *) A newly allocated cel according to the specs */ -gfxw_dyn_view_t *gfxw_new_dyn_view(gfx_state_t *state, Common::Point pos, int z, int view, int loop, int cel, int palette, +GfxDynView *gfxw_new_dyn_view(gfx_state_t *state, Common::Point pos, int z, int view, int loop, int cel, int palette, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int sequence); /* Creates a new dyn view ** Parameters: (gfx_state_t *) state: The graphics state @@ -316,7 +316,7 @@ gfxw_dyn_view_t *gfxw_new_dyn_view(gfx_state_t *state, Common::Point pos, int z, ** optimizations when they move or change shape. */ -gfxw_text_t *gfxw_new_text(gfx_state_t *state, rect_t area, int font, const char *text, gfx_alignment_t halign, +GfxText *gfxw_new_text(gfx_state_t *state, rect_t area, int font, const char *text, gfx_alignment_t halign, gfx_alignment_t valign, gfx_color_t color1, gfx_color_t color2, gfx_color_t bgcolor, int flags); /* Creates a new text widget @@ -330,10 +330,10 @@ gfxw_text_t *gfxw_new_text(gfx_state_t *state, rect_t area, int font, const char ** The foreground is dithered between them) ** (gfx_color_t) bgcolor: Text background color ** (int) flags: GFXR_FONT_FLAGs, orred together (see gfx_resource.h) -** Returns : (gfxw_text_t *) The resulting text widget +** Returns : (GfxText *) The resulting text widget */ -void gfxw_text_info(gfx_state_t *state, gfxw_text_t *text, int *lines_nr, +void gfxw_text_info(gfx_state_t *state, GfxText *text, int *lines_nr, int *lineheight, int *offset); /* Determines text widget meta-information ** Parameters: (gfx_state_t *) state: The state to operate on @@ -344,51 +344,51 @@ void gfxw_text_info(gfx_state_t *state, gfxw_text_t *text, int *lines_nr, ** last character in the last line */ -gfxw_widget_t *gfxw_set_id(gfxw_widget_t *widget, int ID, int subID); +GfxWidget *gfxw_set_id(GfxWidget *widget, int ID, int subID); /* Sets a widget's ID -** Parmaeters: (gfxw_widget_t *) widget: The widget whose ID should be set +** Parmaeters: (GfxWidget *) widget: The widget whose ID should be set ** (int x int) ID, subID: The ID to set -** Returns : (gfxw_widget_t *) widget +** Returns : (GfxWidget *) widget ** A widget ID is unique within the container it is stored in, if and only if it was ** added to that container with gfxw_add(). ** This function handles widget = NULL gracefully (by doing nothing and returning NULL). */ -gfxw_widget_t *gfxw_remove_id(gfxw_container_t *container, int ID, int subID); +GfxWidget *gfxw_remove_id(GfxContainer *container, int ID, int subID); /* Finds a widget with a specific ID in a container and removes it from there -** Parameters: (gfxw_container_t *) container: The container to search in +** Parameters: (GfxContainer *) container: The container to search in ** (int) ID: The ID to look for ** (int) subID: The subID to look for, or GFXW_NO_ID for any -** Returns : (gfxw_widget_t *) The resulting widget or NULL if no match was found +** Returns : (GfxWidget *) The resulting widget or NULL if no match was found ** Search is non-recursive; widgets with IDs hidden in subcontainers will not be found. */ -gfxw_dyn_view_t *gfxw_dyn_view_set_params(gfxw_dyn_view_t *widget, int under_bits, void *under_bitsp, int signal, void *signalp); +GfxDynView *gfxw_dyn_view_set_params(GfxDynView *widget, int under_bits, void *under_bitsp, int signal, void *signalp); /* Initializes a dyn view's interpreter attributes -** Parameters: (gfxw_dyn_view_t *) widget: The widget affected +** Parameters: (GfxDynView *) widget: The widget affected ** (int x void * x int x void *) under_bits, inder_bitsp, signal, signalp: Interpreter-dependant data -** Returns : (gfxw_dyn_view_t *) widget +** Returns : (GfxDynView *) widget */ -gfxw_widget_t *gfxw_hide_widget(gfxw_widget_t *widget); +GfxWidget *gfxw_hide_widget(GfxWidget *widget); /* Makes a widget invisible without removing it from the list of widgets -** Parameters: (gfxw_widget_t *) widget: The widget to invisibilize -** Returns : (gfxw_widget_t *) widget +** Parameters: (GfxWidget *) widget: The widget to invisibilize +** Returns : (GfxWidget *) widget ** Has no effect on invisible widgets */ -gfxw_widget_t *gfxw_show_widget(gfxw_widget_t *widget); +GfxWidget *gfxw_show_widget(GfxWidget *widget); /* Makes an invisible widget reappear -** Parameters: (gfxw_widget_t *) widget: The widget to show again -** Returns : (gfxw_widget_t *) widget +** Parameters: (GfxWidget *) widget: The widget to show again +** Returns : (GfxWidget *) widget ** Does not affect visible widgets */ -gfxw_widget_t *gfxw_abandon_widget(gfxw_widget_t *widget); +GfxWidget *gfxw_abandon_widget(GfxWidget *widget); /* Marks a widget as "abandoned" -** Parameters: (gfxw_widget_t *) widget: The widget to abandon -** Returns : (gfxw_widget_t *) widget +** Parameters: (GfxWidget *) widget: The widget to abandon +** Returns : (GfxWidget *) widget */ /*-- Container types --*/ @@ -396,77 +396,77 @@ gfxw_widget_t *gfxw_abandon_widget(gfxw_widget_t *widget); #define GFXW_LIST_UNSORTED 0 #define GFXW_LIST_SORTED 1 -gfxw_list_t *gfxw_new_list(rect_t area, int sorted); +GfxList *gfxw_new_list(rect_t area, int sorted); /* Creates a new list widget ** Parameters: (rect_t) area: The area covered by the list (absolute position) ** (int) sorted: Whether the list should be a sorted list -** Returns : (gfxw_list_t *) A newly allocated list widget +** Returns : (GfxList *) A newly allocated list widget ** List widgets are also referred to as Display Lists. */ -gfxw_visual_t *gfxw_new_visual(gfx_state_t *state, int font); +GfxVisual *gfxw_new_visual(gfx_state_t *state, int font); /* Creates a new visual widget ** Parameters: (gfx_state_t *) state: The graphics state ** (int) font: The default font number for contained ports -** Returns : (gfxw_list_t *) A newly allocated visual widget +** Returns : (GfxList *) A newly allocated visual widget ** Visual widgets are containers for port widgets. */ -gfxw_port_t *gfxw_new_port(gfxw_visual_t *visual, gfxw_port_t *predecessor, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor); +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: (gfxw_visual_t *) visual: The visual the port is added to -** (gfxw_port_t *) predecessor: The port's predecessor +** 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 : (gfxw_port_t *) A newly allocated port widget +** 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. */ -gfxw_port_t *gfxw_find_port(gfxw_visual_t *visual, int ID); +GfxPort *gfxw_find_port(GfxVisual *visual, int ID); /* Retrieves a port with the specified ID -** Parameters: (gfxw_visual_t *) visual: The visual the port is to be retrieved from +** Parameters: (GfxVisual *) visual: The visual the port is to be retrieved from ** (int) ID: The port's ID -** Returns : (gfxw_port_t *) The requested port, or NULL if it didn't exist +** Returns : (GfxPort *) The requested port, or NULL if it didn't exist ** This function is O(1). */ -gfxw_port_t *gfxw_find_default_port(gfxw_visual_t *visual); +GfxPort *gfxw_find_default_port(GfxVisual *visual); /* Retrieves the default port from a visual -** Parameters: (gfxw_visual_t *) visual: The visual the port should be retrieved from -** Returns : (gfxw_port_t *) The default port, or NULL if no port is present +** Parameters: (GfxVisual *) visual: The visual the port should be retrieved from +** Returns : (GfxPort *) The default port, or NULL if no port is present ** The 'default port' is the last port to be instantiated; usually the topmost ** or highest-ranking port. */ -void gfxw_port_set_auto_restore(gfxw_visual_t *visual, gfxw_port_t *window, rect_t auto_rect); +void gfxw_port_set_auto_restore(GfxVisual *visual, GfxPort *window, rect_t auto_rect); /* Sets rectangle to be restored upon port removal ** Parameters: (state_t *) s: The state to operate on -** (gfxw_port_t *) window: The affected window +** (GfxPort *) window: The affected window ** (rect_t) auto_rect: The area to restore ** Returns : (void) */ -gfxw_port_t *gfxw_remove_port(gfxw_visual_t *visual, gfxw_port_t *port); +GfxPort *gfxw_remove_port(GfxVisual *visual, GfxPort *port); /* Removes a port from a visual -** Parameters: (gfxw_visual_t *) visual: The visual the port should be removed from -** (gfxw_port_t *) port: The port to remove -** Returns : (gfxw_port_t *) port's parent port, or NULL if it had none +** Parameters: (GfxVisual *) visual: The visual the port should be removed from +** (GfxPort *) port: The port to remove +** Returns : (GfxPort *) port's parent port, or NULL if it had none */ -void gfxw_remove_widget_from_container(gfxw_container_t *container, gfxw_widget_t *widget); +void gfxw_remove_widget_from_container(GfxContainer *container, GfxWidget *widget); /* Removes the widget from the specified port -** Parameters: (gfxw_container_t *) container: The container it should be removed from -** (gfxw_widget_t *) widget: The widget to remove +** Parameters: (GfxContainer *) container: The container it should be removed from +** (GfxWidget *) widget: The widget to remove ** Returns : (void) */ -gfxw_snapshot_t *gfxw_make_snapshot(gfxw_visual_t *visual, rect_t area); +gfxw_snapshot_t *gfxw_make_snapshot(GfxVisual *visual, rect_t area); /* Makes a "snapshot" of a visual -** Parameters: (gfxw_visual_t *) visual: The visual a snapshot is to be taken of +** Parameters: (GfxVisual *) visual: The visual a snapshot is to be taken of ** (rect_t) area: The area a snapshot should be taken of ** Returns : (gfxw_snapshot_t *) The resulting, newly allocated snapshot ** It's not really a full qualified snaphot, though. See gfxw_restore_snapshot @@ -474,41 +474,41 @@ gfxw_snapshot_t *gfxw_make_snapshot(gfxw_visual_t *visual, rect_t area); ** This operation also increases the global serial number counter by one. */ -int gfxw_widget_matches_snapshot(gfxw_snapshot_t *snapshot, gfxw_widget_t *widget); +int gfxw_widget_matches_snapshot(gfxw_snapshot_t *snapshot, GfxWidget *widget); /* Predicate to test whether a widget would be destroyed by applying a snapshot ** Parameters: (gfxw_snapshot_t *) snapshot: The snapshot to test against -** (gfxw_widget_t *) widget: The widget to test +** (GfxWidget *) widget: The widget to test ** Retunrrs : (int) An appropriate boolean value */ -gfxw_snapshot_t *gfxw_restore_snapshot(gfxw_visual_t *visual, gfxw_snapshot_t *snapshot); +gfxw_snapshot_t *gfxw_restore_snapshot(GfxVisual *visual, gfxw_snapshot_t *snapshot); /* Restores a snapshot to a visual -** Parameters: (gfxw_visual_t *) visual: The visual to operate on +** Parameters: (GfxVisual *) visual: The visual to operate on ** (gfxw_snapshot_t *) snapshot: The snapshot to restore ** Returns : (gfxw_snapshot_t *) snapshot (still needs to be freed) ** The snapshot is not really restored; only more recent widgets touching ** the snapshotted area are destroyed. */ -void gfxw_annihilate(gfxw_widget_t *widget); +void gfxw_annihilate(GfxWidget *widget); /* As widget->widfree(widget), but destroys all overlapping widgets -** Parameters: (gfxw_widget_t *) widget: The widget to use +** Parameters: (GfxWidget *) widget: The widget to use ** Returns : (void) ** This operation calls widget->widfree(widget), but it also destroys ** all widgets with a higher or equal priority drawn after this widget. */ -gfxw_dyn_view_t *gfxw_picviewize_dynview(gfxw_dyn_view_t *dynview); +GfxDynView *gfxw_picviewize_dynview(GfxDynView *dynview); /* Turns a dynview into a picview -** Parameters: (gfxw_dyn_view_t *) dynview: The victim -** Returns : (gfxw_dyn_view_t *) The victim, after his transformation +** Parameters: (GfxDynView *) dynview: The victim +** Returns : (GfxDynView *) The victim, after his transformation ** The only changes are in function and type variables, actually. */ -void gfxw_port_auto_restore_background(gfxw_visual_t *visual, gfxw_port_t *window, rect_t auto_rect); +void gfxw_port_auto_restore_background(GfxVisual *visual, GfxPort *window, rect_t auto_rect); /* Tags a window widget as automatically restoring the visual background upon removal ** Parameters: (gfx_visual_t *) visual: The base visual -** (gfxw_port_t *) window: The window to tag +** (GfxPort *) window: The window to tag ** (rect_t) auto_rect: The background to remember ** Also records the specified background rectangle, for later recovery */ diff --git a/engines/sci/gfx/menubar.cpp b/engines/sci/gfx/menubar.cpp index cbd27b9573..fc0ba00d8e 100644 --- a/engines/sci/gfx/menubar.cpp +++ b/engines/sci/gfx/menubar.cpp @@ -32,7 +32,7 @@ #include "sci/engine/state.h" #include "sci/gfx/menubar.h" #include "sci/engine/kernel.h" -#include "sci/gfx/gfx_state_internal.h" // required for gfxw_port_t +#include "sci/gfx/gfx_state_internal.h" // required for GfxPort namespace Sci { @@ -387,7 +387,7 @@ bool Menubar::itemValid(int menu_nr, int item_nr) const { return false; // May not be selected } -bool Menubar::mapPointer(const Common::Point &pointerPos, int &menu_nr, int &item_nr, gfxw_port_t *port) const { +bool Menubar::mapPointer(const Common::Point &pointerPos, int &menu_nr, int &item_nr, GfxPort *port) const { if (pointerPos.y <= 10) { // Re-evaulate menu int x = MENU_LEFT_BORDER; diff --git a/engines/sci/gfx/menubar.h b/engines/sci/gfx/menubar.h index 8d66085bbc..7269470874 100644 --- a/engines/sci/gfx/menubar.h +++ b/engines/sci/gfx/menubar.h @@ -210,7 +210,7 @@ public: * @param port the port of the currently active menu (if any) * @return true if the pointer is outside a valid port, false otherwise. */ - bool mapPointer(const Common::Point &pointerPos, int &menu_nr, int &item_nr, gfxw_port_t *port) const; + bool mapPointer(const Common::Point &pointerPos, int &menu_nr, int &item_nr, GfxPort *port) const; }; -- cgit v1.2.3