Make gui_globals less... global
This commit is contained in:
parent
e38f4d2f1a
commit
76d1758d7f
|
@ -47,6 +47,7 @@
|
||||||
#include "netsurf/plot_style.h"
|
#include "netsurf/plot_style.h"
|
||||||
|
|
||||||
#include <proto/exec.h>
|
#include <proto/exec.h>
|
||||||
|
#include <proto/graphics.h>
|
||||||
#include <proto/intuition.h>
|
#include <proto/intuition.h>
|
||||||
#include <proto/layout.h>
|
#include <proto/layout.h>
|
||||||
#include <proto/utility.h>
|
#include <proto/utility.h>
|
||||||
|
|
|
@ -4911,6 +4911,8 @@ static void ami_do_redraw(struct gui_window_2 *gwin)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
/**FIXME: this is broken, only exists for debugging */
|
||||||
ami_plot_ra_set_pen_list(browserglob, gwin->shared_pens);
|
ami_plot_ra_set_pen_list(browserglob, gwin->shared_pens);
|
||||||
temprp = browserglob->rp;
|
temprp = browserglob->rp;
|
||||||
browserglob->rp = gwin->win->RPort;
|
browserglob->rp = gwin->win->RPort;
|
||||||
|
@ -4928,6 +4930,7 @@ static void ami_do_redraw(struct gui_window_2 *gwin)
|
||||||
}
|
}
|
||||||
|
|
||||||
ami_reset_pointer(gwin);
|
ami_reset_pointer(gwin);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/* Tell NetSurf not to bother with the next queued box redraw, as we've redrawn everything. */
|
/* Tell NetSurf not to bother with the next queued box redraw, as we've redrawn everything. */
|
||||||
ami_gui_window_update_box_deferred(gwin->gw, false);
|
ami_gui_window_update_box_deferred(gwin->gw, false);
|
||||||
|
|
|
@ -109,7 +109,7 @@ static void ami_history_redraw(struct history_window *hw)
|
||||||
ami_clearclipreg(hw->gg);
|
ami_clearclipreg(hw->gg);
|
||||||
ami_history_update_extent(hw);
|
ami_history_update_extent(hw);
|
||||||
|
|
||||||
BltBitMapRastPort(hw->gg->bm, 0, 0, hw->win->RPort,
|
BltBitMapRastPort(ami_plot_ra_get_bitmap(hw->gg), 0, 0, hw->win->RPort,
|
||||||
bbox->Left, bbox->Top, bbox->Width, bbox->Height, 0x0C0);
|
bbox->Left, bbox->Top, bbox->Width, bbox->Height, 0x0C0);
|
||||||
|
|
||||||
ami_gui_free_space_box(bbox);
|
ami_gui_free_space_box(bbox);
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
#include <proto/exec.h>
|
#include <proto/exec.h>
|
||||||
#include <proto/intuition.h>
|
#include <proto/intuition.h>
|
||||||
|
#include <proto/layers.h>
|
||||||
|
#include <proto/graphics.h>
|
||||||
|
|
||||||
#include <intuition/intuition.h>
|
#include <intuition/intuition.h>
|
||||||
#include <graphics/rpattr.h>
|
#include <graphics/rpattr.h>
|
||||||
|
@ -82,6 +84,24 @@ struct bez_point {
|
||||||
float y;
|
float y;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct gui_globals {
|
||||||
|
struct BitMap *bm;
|
||||||
|
struct RastPort *rp;
|
||||||
|
struct Layer_Info *layerinfo;
|
||||||
|
APTR areabuf;
|
||||||
|
APTR tmprasbuf;
|
||||||
|
struct Rectangle rect;
|
||||||
|
struct MinList *shared_pens;
|
||||||
|
bool managed_pen_list;
|
||||||
|
bool palette_mapped;
|
||||||
|
ULONG apen;
|
||||||
|
ULONG open;
|
||||||
|
LONG apen_num;
|
||||||
|
LONG open_num;
|
||||||
|
int width; /* size of bm and */
|
||||||
|
int height; /* associated memory */
|
||||||
|
};
|
||||||
|
|
||||||
static int init_layers_count = 0;
|
static int init_layers_count = 0;
|
||||||
static APTR pool_pens = NULL;
|
static APTR pool_pens = NULL;
|
||||||
static bool palette_mapped = true; /* palette-mapped state for the screen */
|
static bool palette_mapped = true; /* palette-mapped state for the screen */
|
||||||
|
@ -260,6 +280,11 @@ void ami_plot_ra_free(struct gui_globals *gg)
|
||||||
free(gg);
|
free(gg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct RastPort *ami_plot_ra_get_rastport(struct gui_globals *gg)
|
||||||
|
{
|
||||||
|
return gg->rp;
|
||||||
|
}
|
||||||
|
|
||||||
struct BitMap *ami_plot_ra_get_bitmap(struct gui_globals *gg)
|
struct BitMap *ami_plot_ra_get_bitmap(struct gui_globals *gg)
|
||||||
{
|
{
|
||||||
return gg->bm;
|
return gg->bm;
|
||||||
|
|
|
@ -20,29 +20,9 @@
|
||||||
#define AMIGA_PLOTTERS_H
|
#define AMIGA_PLOTTERS_H
|
||||||
|
|
||||||
#include "netsurf/plotters.h"
|
#include "netsurf/plotters.h"
|
||||||
#include <proto/layers.h>
|
|
||||||
#include <proto/graphics.h>
|
|
||||||
|
|
||||||
struct IBox;
|
struct IBox;
|
||||||
|
struct gui_globals;
|
||||||
struct gui_globals
|
|
||||||
{
|
|
||||||
struct BitMap *bm;
|
|
||||||
struct RastPort *rp;
|
|
||||||
struct Layer_Info *layerinfo;
|
|
||||||
APTR areabuf;
|
|
||||||
APTR tmprasbuf;
|
|
||||||
struct Rectangle rect;
|
|
||||||
struct MinList *shared_pens;
|
|
||||||
bool managed_pen_list;
|
|
||||||
bool palette_mapped;
|
|
||||||
ULONG apen;
|
|
||||||
ULONG open;
|
|
||||||
LONG apen_num;
|
|
||||||
LONG open_num;
|
|
||||||
int width; /* size of bm and */
|
|
||||||
int height; /* associated memory */
|
|
||||||
};
|
|
||||||
|
|
||||||
extern const struct plotter_table amiplot;
|
extern const struct plotter_table amiplot;
|
||||||
|
|
||||||
|
@ -69,6 +49,13 @@ struct gui_globals *ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit
|
||||||
*/
|
*/
|
||||||
void ami_plot_ra_free(struct gui_globals *gg);
|
void ami_plot_ra_free(struct gui_globals *gg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get RastPort associated with a render area
|
||||||
|
* \param gg render area
|
||||||
|
* \returns pointer to render area BitMap
|
||||||
|
*/
|
||||||
|
struct RastPort *ami_plot_ra_get_rastport(struct gui_globals *gg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a drawing BitMap associated with a render area
|
* Get a drawing BitMap associated with a render area
|
||||||
* \param gg render area
|
* \param gg render area
|
||||||
|
|
|
@ -495,12 +495,10 @@ struct MsgPort *ami_print_get_msgport(void)
|
||||||
|
|
||||||
bool ami_print_begin(struct print_settings *ps)
|
bool ami_print_begin(struct print_settings *ps)
|
||||||
{
|
{
|
||||||
ami_print_info.gg = calloc(1, sizeof(struct gui_globals));
|
|
||||||
if(!ami_print_info.gg) return false;
|
|
||||||
|
|
||||||
ami_print_info.gg = ami_plot_ra_alloc(ami_print_info.PED->ped_MaxXDots,
|
ami_print_info.gg = ami_plot_ra_alloc(ami_print_info.PED->ped_MaxXDots,
|
||||||
ami_print_info.PED->ped_MaxYDots,
|
ami_print_info.PED->ped_MaxYDots,
|
||||||
true, false);
|
true, false);
|
||||||
|
if(!ami_print_info.gg) return false;
|
||||||
|
|
||||||
ami_print_info.page = 0;
|
ami_print_info.page = 0;
|
||||||
|
|
||||||
|
@ -538,7 +536,7 @@ bool ami_print_dump(void)
|
||||||
ami_print_info.PReq->io_Command = PRD_DUMPRPORT;
|
ami_print_info.PReq->io_Command = PRD_DUMPRPORT;
|
||||||
ami_print_info.PReq->io_Flags = 0;
|
ami_print_info.PReq->io_Flags = 0;
|
||||||
ami_print_info.PReq->io_Error = 0;
|
ami_print_info.PReq->io_Error = 0;
|
||||||
ami_print_info.PReq->io_RastPort = ami_print_info.gg->rp;
|
ami_print_info.PReq->io_RastPort = ami_plot_ra_get_rastport(ami_print_info.gg);
|
||||||
ami_print_info.PReq->io_ColorMap = NULL;
|
ami_print_info.PReq->io_ColorMap = NULL;
|
||||||
ami_print_info.PReq->io_Modes = 0;
|
ami_print_info.PReq->io_Modes = 0;
|
||||||
ami_print_info.PReq->io_SrcX = 0;
|
ami_print_info.PReq->io_SrcX = 0;
|
||||||
|
|
Loading…
Reference in New Issue