Revert shared pens support to previously-working state

This commit is contained in:
Chris Young 2015-02-02 18:28:21 +00:00
parent 7d41e04b61
commit 2d157857e1
3 changed files with 16 additions and 40 deletions

View File

@ -2877,7 +2877,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
return;
}
ami_plot_release_pens(&browserglob.shared_pens);
ami_plot_release_pens(&gwin->shared_pens);
ami_update_buttons(gwin);
ami_menu_update_disabled(gwin->gw, browser_window_get_content(gwin->gw->bw));
@ -4193,7 +4193,7 @@ static void gui_window_destroy(struct gui_window *g)
return;
}
ami_plot_release_pens(&browserglob.shared_pens);
ami_plot_release_pens(&g->shared->shared_pens);
ami_schedule_redraw_remove(g->shared);
ami_schedule(-1, ami_gui_refresh_favicon, g->shared);
@ -5072,7 +5072,7 @@ static void gui_window_new_content(struct gui_window *g)
g->shared->oldh = 0;
g->shared->oldv = 0;
g->favicon = NULL;
ami_plot_release_pens(&browserglob.shared_pens);
ami_plot_release_pens(&g->shared->shared_pens);
ami_menu_update_disabled(g, c);
ami_gui_update_hotlist_button(g->shared);
ami_gui_scroller_update(g->shared);

View File

@ -216,6 +216,7 @@ void ami_plot_release_pens(struct MinList *shared_pens)
struct ami_plot_pen *node;
struct ami_plot_pen *nnode;
if(shared_pens == NULL) return;
if(IsMinListEmpty(shared_pens)) return;
node = (struct ami_plot_pen *)GetHead((struct List *)shared_pens);
@ -265,7 +266,7 @@ void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox)
}
bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
static bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] Entered ami_rectangle()"));
@ -310,7 +311,7 @@ bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
return true;
}
bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
static bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] Entered ami_line()"));
@ -345,7 +346,7 @@ bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
return true;
}
bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
static bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] Entered ami_polygon()"));
@ -368,7 +369,7 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
}
bool ami_clip(const struct rect *clip)
static bool ami_clip(const struct rect *clip)
{
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] Entered ami_clip()"));
@ -395,7 +396,7 @@ bool ami_clip(const struct rect *clip)
return true;
}
bool ami_text(int x, int y, const char *text, size_t length,
static bool ami_text(int x, int y, const char *text, size_t length,
const plot_font_style_t *fstyle)
{
#ifdef AMI_PLOTTER_DEBUG
@ -413,7 +414,7 @@ bool ami_text(int x, int y, const char *text, size_t length,
return true;
}
bool ami_disc(int x, int y, int radius, const plot_style_t *style)
static bool ami_disc(int x, int y, int radius, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] Entered ami_disc()"));
@ -458,7 +459,7 @@ static void ami_arc_gfxlib(int x, int y, int radius, int angle1, int angle2)
}
}
bool ami_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_t *style)
static bool ami_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] Entered ami_arc()"));
@ -561,7 +562,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
return true;
}
bool ami_bitmap_tile(int x, int y, int width, int height,
static bool ami_bitmap_tile(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg,
bitmap_flags_t flags)
{
@ -723,40 +724,13 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba
}
#endif
bool ami_group_start(const char *name)
{
/** optional */
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] Entered ami_group_start()"));
#endif
return false;
}
bool ami_group_end(void)
{
/** optional */
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] Entered ami_group_end()"));
#endif
return false;
}
bool ami_flush(void)
{
#ifdef AMI_PLOTTER_DEBUG
LOG(("[ami_plotter] Entered ami_flush()"));
#endif
return true;
}
static void ami_bezier(struct bez_point *a, struct bez_point *b, struct bez_point *c,
struct bez_point *d, double t, struct bez_point *p) {
p->x = pow((1 - t), 3) * a->x + 3 * t * pow((1 -t), 2) * b->x + 3 * (1-t) * pow(t, 2)* c->x + pow (t, 3)* d->x;
p->y = pow((1 - t), 3) * a->y + 3 * t * pow((1 -t), 2) * b->y + 3 * (1-t) * pow(t, 2)* c->y + pow (t, 3)* d->y;
}
bool ami_path(const float *p, unsigned int n, colour fill, float width,
static bool ami_path(const float *p, unsigned int n, colour fill, float width,
colour c, const float transform[6])
{
unsigned int i;

View File

@ -22,6 +22,8 @@
#include <proto/layers.h>
#include <proto/graphics.h>
struct IBox;
struct gui_globals
{
struct BitMap *bm;
@ -30,7 +32,7 @@ struct gui_globals
APTR areabuf;
APTR tmprasbuf;
struct Rectangle rect;
struct MinList *shared_pens; /**\todo move this to gui_window_2 */
struct MinList *shared_pens;
};
extern const struct plotter_table amiplot;