mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
scroll: convert to callbacks.print
This commit is contained in:
parent
67559fdaca
commit
65effae144
@ -1669,9 +1669,6 @@ void generate_text_internal(char *p, int p_max_size,
|
||||
}
|
||||
snprintf(p, p_max_size, "%s", buf);
|
||||
}
|
||||
OBJ(scroll) {
|
||||
print_scroll(obj, p, p_max_size, cur);
|
||||
}
|
||||
OBJ(combine) {
|
||||
print_combine(obj, p, cur);
|
||||
}
|
||||
|
@ -1357,6 +1357,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
||||
obj->next = new_text_object_internal();
|
||||
#endif /* X11 */
|
||||
parse_scroll_arg(obj, arg, free_at_crash);
|
||||
obj->callbacks.print = &print_scroll;
|
||||
obj->callbacks.free = &free_scroll;
|
||||
END OBJ_ARG(combine, 0, "combine needs arguments: <text1> <text2>")
|
||||
parse_combine_arg(obj, arg, free_at_crash);
|
||||
|
@ -78,7 +78,7 @@ void parse_scroll_arg(struct text_object *obj, const char *arg, void *free_at_cr
|
||||
#endif /* X11 */
|
||||
}
|
||||
|
||||
void print_scroll(struct text_object *obj, char *p, int p_max_size, struct information *cur)
|
||||
void print_scroll(struct text_object *obj, char *p, int p_max_size)
|
||||
{
|
||||
struct scroll_data *sd = obj->data.opaque;
|
||||
unsigned int j, colorchanges = 0, frontcolorchanges = 0, visibcolorchanges = 0, strend;
|
||||
@ -88,7 +88,7 @@ void print_scroll(struct text_object *obj, char *p, int p_max_size, struct infor
|
||||
if (!sd)
|
||||
return;
|
||||
|
||||
generate_text_internal(buf, max_user_text, *obj->sub, cur);
|
||||
generate_text_internal(buf, max_user_text, *obj->sub, &info);
|
||||
for(j = 0; buf[j] != 0; j++) {
|
||||
switch(buf[j]) {
|
||||
case '\n': //place all the lines behind each other with LINESEPARATOR between them
|
||||
|
@ -30,7 +30,7 @@
|
||||
#define _SCROLL_H
|
||||
|
||||
void parse_scroll_arg(struct text_object *, const char *, void *);
|
||||
void print_scroll(struct text_object *, char *, int, struct information *);
|
||||
void print_scroll(struct text_object *, char *, int);
|
||||
void free_scroll(struct text_object *);
|
||||
|
||||
#endif /* _SCROLL_H */
|
||||
|
Loading…
Reference in New Issue
Block a user