mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-15 19:56:55 +00:00
new_font: convert to common signature
This commit is contained in:
parent
e5b25fd30a
commit
95b92d6cff
@ -791,7 +791,7 @@ void generate_text_internal(char *p, int p_max_size,
|
||||
NORM_ERR("not implemented obj type %d", obj->type);
|
||||
#ifdef X11
|
||||
OBJ(font) {
|
||||
new_font(p, obj->data.s);
|
||||
new_font(obj, p, p_max_size);
|
||||
}
|
||||
#endif /* X11 */
|
||||
OBJ(text) {
|
||||
|
@ -284,24 +284,25 @@ void new_gauge(struct text_object *obj, char *p, int p_max_size, int usage)
|
||||
}
|
||||
|
||||
#ifdef X11
|
||||
void new_font(char *buf, char *args)
|
||||
void new_font(struct text_object *obj, char *p, int p_max_size)
|
||||
{
|
||||
struct special_t *s;
|
||||
int tmp = selected_font;
|
||||
|
||||
if ((output_methods & TO_X) == 0)
|
||||
return;
|
||||
|
||||
if (args) {
|
||||
struct special_t *s = new_special(buf, FONT);
|
||||
if (!p_max_size)
|
||||
return;
|
||||
|
||||
if (s->font_added > font_count || !s->font_added || (strncmp(args, fonts[s->font_added].name, DEFAULT_TEXT_BUFFER_SIZE) != EQUAL) ) {
|
||||
int tmp = selected_font;
|
||||
s = new_special(p, FONT);
|
||||
|
||||
selected_font = s->font_added = add_font(args);
|
||||
if (obj->data.s) {
|
||||
if (s->font_added > font_count || !s->font_added || (strncmp(obj->data.s, fonts[s->font_added].name, DEFAULT_TEXT_BUFFER_SIZE) != EQUAL) ) {
|
||||
selected_font = s->font_added = add_font(obj->data.s);
|
||||
selected_font = tmp;
|
||||
}
|
||||
} else {
|
||||
struct special_t *s = new_special(buf, FONT);
|
||||
int tmp = selected_font;
|
||||
|
||||
selected_font = s->font_added = 0;
|
||||
selected_font = tmp;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ void scan_tab(struct text_object *, const char *);
|
||||
void scan_stippled_hr(struct text_object *, const char*);
|
||||
|
||||
/* printing specials */
|
||||
void new_font(char *, char *);
|
||||
void new_font(struct text_object *, char *, int);
|
||||
void new_graph(struct text_object *, char *, int, double);
|
||||
void new_hr(struct text_object *, char *, int);
|
||||
void new_stippled_hr(struct text_object *, char *, int);
|
||||
|
Loading…
Reference in New Issue
Block a user