|
From: Petr M. <mi...@ph...> - 2005-07-20 08:13:11
|
> new options. In recent posts you have expressed great > concern about code bloat and the resulting size of the gnuplot > binary. Since every new terminal API call introduces a function > pointer slot into ~50 driver entry tables, I would have thought you > to oppose proliferation of new terminal API functions. And to I would also prefer to reduce the terminal API bloat by having more generic APIs. Example: there are currently 4 APIs for USE_MOUSE. I want to add one more to avoid codes like 'if (term->name=="pm") ...' -- but I would have to edit all PM3D supporting *.trm because #ifdef PM3D follows #ifdef USE_MOUSE there. I think I will rather let set_ruler, set_cursor and set_something_new coalesce. > But if that's the way you prefer to go, then I see an argument for > at least three new API calls to cover existing use: > > /* This is the one that triggered the discussion. > * Used by epslatex for front/back text. > * Might be used by other terminal types if it were available > */ > term->layer(int layer); OK > /* Used by postscript to flag code sections for postprocessing by awk. > * Also requested multiple times as an enhancement for storing plot > * info (scaling, axis origin) in bitmap output formats > */ > term->comment(TBOOLEAN global_or_inline, const char *comment_text) > > /* Used by post.trm to optimize the color box (called from color.c) > * Could be generalized to draw arbitrary rectangles with gradient > * fill. > */ > term->gradient_fill(int xl, int xh, int yl, int yh, struct gradient *g) I don't think that's necessary. Only those few pieces needing this can use "if (terminal is postscript) ..." as it is now. > Yes, exactly. That is functionally how the current code in color.c > works, but the routines are not wrapped as terminal entry calls. > It has a generic default routine for any terminal that supports > pm3d filled rectangles: > draw_inside_color_smooth_box_bitmap() > and a special case for the postscript driver: > draw_inside_color_smooth_box_postscript() yes, that's it --- PM |