new_bg(p, obj->data.l);
}
OBJ(stippled_hr) {
- new_stippled_hr(p, obj->data.pair.a, obj->data.pair.b);
+ new_stippled_hr(obj, p);
}
#endif /* X11 */
OBJ(swap) {
#endif /* X11 */
END OBJ(stippled_hr, 0)
#ifdef X11
- int a = get_stippled_borders(), b = 1;
-
- if (arg) {
- if (sscanf(arg, "%d %d", &a, &b) != 2) {
- sscanf(arg, "%d", &b);
- }
- }
- if (a <= 0) {
- a = 1;
- }
- obj->data.pair.a = a;
- obj->data.pair.b = b;
+ scan_stippled_hr(obj, arg);
#endif /* X11 */
END OBJ(swap, &update_meminfo)
END OBJ(swapfree, &update_meminfo)
char tempgrad;
};
+struct stippled_hr {
+ int height, arg;
+};
+
struct tab {
int width, arg;
};
new_special(buf, HORIZONTAL_LINE)->height = a;
}
-void new_stippled_hr(char *buf, int a, int b)
+void scan_stippled_hr(struct text_object *obj, const char *arg)
+{
+ struct stippled_hr *sh;
+
+ sh = malloc(sizeof(struct stippled_hr));
+ memset(sh, 0, sizeof(struct stippled_hr));
+
+ sh->arg = get_stippled_borders();
+ sh->height = 1;
+
+ if (arg) {
+ if (sscanf(arg, "%d %d", &sh->arg, &sh->height) != 2) {
+ sscanf(arg, "%d", &sh->height);
+ }
+ }
+ if (sh->arg <= 0) {
+ sh->arg = 1;
+ }
+ obj->special_data = sh;
+}
+
+void new_stippled_hr(struct text_object *obj, char *buf)
{
struct special_t *s = 0;
+ struct stippled_hr *sh = obj->special_data;
if ((output_methods & TO_X) == 0)
return;
+ if (!sh)
+ return;
+
s = new_special(buf, STIPPLED_HR);
- s->height = b;
- s->arg = a;
+ s->height = sh->height;
+ s->arg = sh->arg;
}
#endif /* X11 */
char *scan_font(const char *);
char *scan_graph(struct text_object *, const char *);
void scan_tab(struct text_object *, const char *);
+void scan_stippled_hr(struct text_object *, const char*);
/* printing specials */
void new_gauge(struct text_object *, char *, int);
void new_font(char *, char *);
void new_graph(struct text_object *, char *, double);
void new_hr(char *, int);
-void new_stippled_hr(char *, int, int);
+void new_stippled_hr(struct text_object *, char *);
#endif
void new_bar_in_shell(struct text_object *, char *, int, double);
void new_fg(char *, long);