|
From: Petr M. <mi...@ph...> - 2005-07-21 12:28:38
|
>> Example: I want to add one more to avoid codes like 'if (term->name=="pm")
>
> That's a bad example, because it only occurs in code segments that are
> already conditional on OS2. Making it a terminal entry test instead would
> not actually simplify the call sites. I.e. it would still have to be
> #ifdef OS2
> ... other OS2-specific code ...
> if (term->whatever)
> (term->whatever)(foo);
> #endif
Better example is (see set.c: "set mouse" switches on relevant menu items
in PM terminal):
#if defined(USE_MOUSE) && defined(OS2)
update_menu_items_PM_terminal();
#endif
=>
#if defined(USE_MOUSE)
if (term->interactive) {
term->interactive("mouse", "is", "enabled");
term->interactive("cursor", "is", "whatever");
term->interactive("allow", "q", "hotkey closes window");
}
#endif
>>> /* 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.
>
> Wait. Isn't that exactly the opposite of what you were arguing above
> with respect to "if (terminal is pm)" ?
>
> Anyhow, if you think it is useful to optimize a gradient-filled
> rectangle, why limit it to postscript? libgd and (I think) svg also
> could support this.
Now I see the point. It is OK with me.
---
PM
|