mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-28 04:34:50 +00:00
SCI: Renamed gfxw_widget_t and subtypes to GfxWidget etc.
svn-id: r40104
This commit is contained in:
parent
86b3657476
commit
9445439c4f
@ -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 {
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
|
@ -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) {
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
struct GfxWidget;
|
||||
struct GfxContainer;
|
||||
struct GfxVisual;
|
||||
struct GfxPort;
|
||||
|
||||
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 *);
|
||||
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 gfxw_widget_t {
|
||||
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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user