2018-05-12 16:03:00 +00:00
|
|
|
/*
|
2009-07-28 21:44:22 +00:00
|
|
|
*
|
|
|
|
* Conky, a system monitor, based on torsmo
|
2009-02-22 16:53:30 +00:00
|
|
|
*
|
|
|
|
* Any original torsmo code is licensed under the BSD license
|
|
|
|
*
|
|
|
|
* All code written since the fork of torsmo is licensed under the GPL
|
|
|
|
*
|
|
|
|
* Please see COPYING for details
|
|
|
|
*
|
|
|
|
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
|
2019-01-05 15:52:43 +00:00
|
|
|
* Copyright (c) 2005-2019 Brenden Matthews, Philip Kovacs, et. al.
|
2009-02-22 16:53:30 +00:00
|
|
|
* (see AUTHORS)
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#ifndef _SPECIALS_H
|
|
|
|
#define _SPECIALS_H
|
|
|
|
|
|
|
|
/* special stuff in text_buffer */
|
|
|
|
|
2009-08-07 07:24:24 +00:00
|
|
|
#define SPECIAL_CHAR '\x01'
|
|
|
|
|
2009-05-24 21:53:32 +00:00
|
|
|
// don't use spaces in LOGGRAPH or NORMGRAPH if you change them
|
2009-07-05 03:43:45 +00:00
|
|
|
#define LOGGRAPH "-l"
|
2009-05-24 21:53:32 +00:00
|
|
|
#define TEMPGRAD "-t"
|
2009-02-22 16:53:30 +00:00
|
|
|
|
|
|
|
enum special_types {
|
2018-05-12 16:03:00 +00:00
|
|
|
NONSPECIAL = 0,
|
|
|
|
HORIZONTAL_LINE = 1,
|
|
|
|
STIPPLED_HR,
|
|
|
|
BAR,
|
|
|
|
FG,
|
|
|
|
BG,
|
|
|
|
OUTLINE,
|
|
|
|
ALIGNR,
|
|
|
|
ALIGNC,
|
|
|
|
GAUGE,
|
|
|
|
GRAPH,
|
|
|
|
OFFSET,
|
|
|
|
VOFFSET,
|
2021-01-29 23:25:58 +00:00
|
|
|
SAVE_COORDINATES,
|
2018-05-12 16:03:00 +00:00
|
|
|
FONT,
|
|
|
|
GOTO,
|
|
|
|
TAB
|
2009-02-22 16:53:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct special_t {
|
2018-05-12 16:03:00 +00:00
|
|
|
int type;
|
|
|
|
short height;
|
|
|
|
short width;
|
|
|
|
double arg;
|
|
|
|
double *graph;
|
|
|
|
double scale; /* maximum value */
|
|
|
|
short show_scale;
|
|
|
|
int graph_width;
|
|
|
|
int graph_allocated;
|
2019-10-07 02:29:04 +00:00
|
|
|
int scaled; /* auto adjust maximum */
|
|
|
|
int scale_log;
|
2018-05-12 16:03:00 +00:00
|
|
|
unsigned long first_colour; // for graph gradient
|
|
|
|
unsigned long last_colour;
|
|
|
|
short font_added;
|
|
|
|
char tempgrad;
|
|
|
|
struct special_t *next;
|
2009-02-22 16:53:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* direct access to the registered specials (FIXME: bad encapsulation) */
|
|
|
|
extern struct special_t *specials;
|
2010-04-21 12:54:45 +00:00
|
|
|
extern int special_count;
|
2009-02-22 16:53:30 +00:00
|
|
|
|
2018-05-12 16:03:00 +00:00
|
|
|
/* forward declare to avoid mutual inclusion between specials.h and
|
|
|
|
* text_object.h */
|
2009-10-25 20:47:47 +00:00
|
|
|
struct text_object;
|
|
|
|
|
2009-02-22 16:53:30 +00:00
|
|
|
/* scanning special arguments */
|
2009-12-04 00:11:57 +00:00
|
|
|
const char *scan_bar(struct text_object *, const char *, double);
|
|
|
|
const char *scan_gauge(struct text_object *, const char *, double);
|
2010-01-07 02:38:12 +00:00
|
|
|
#ifdef BUILD_X11
|
2009-11-08 12:46:42 +00:00
|
|
|
void scan_font(struct text_object *, const char *);
|
2009-12-04 00:11:57 +00:00
|
|
|
char *scan_graph(struct text_object *, const char *, double);
|
2009-10-29 02:18:24 +00:00
|
|
|
void scan_tab(struct text_object *, const char *);
|
2018-05-12 16:03:00 +00:00
|
|
|
void scan_stippled_hr(struct text_object *, const char *);
|
2009-02-22 16:53:30 +00:00
|
|
|
|
|
|
|
/* printing specials */
|
2018-08-07 23:22:23 +00:00
|
|
|
void new_font(struct text_object *, char *, unsigned int);
|
2009-11-22 20:12:54 +00:00
|
|
|
void new_graph(struct text_object *, char *, int, double);
|
2018-08-07 23:22:23 +00:00
|
|
|
void new_hr(struct text_object *, char *, unsigned int);
|
|
|
|
void new_stippled_hr(struct text_object *, char *, unsigned int);
|
2010-01-07 02:38:12 +00:00
|
|
|
#endif /* BUILD_X11 */
|
2018-08-08 13:33:13 +00:00
|
|
|
void new_gauge(struct text_object *, char *, unsigned int, double);
|
|
|
|
void new_bar(struct text_object *, char *, unsigned int, double);
|
2018-08-07 23:22:23 +00:00
|
|
|
void new_fg(struct text_object *, char *, unsigned int);
|
|
|
|
void new_bg(struct text_object *, char *, unsigned int);
|
|
|
|
void new_outline(struct text_object *, char *, unsigned int);
|
|
|
|
void new_offset(struct text_object *, char *, unsigned int);
|
|
|
|
void new_voffset(struct text_object *, char *, unsigned int);
|
2021-01-29 23:25:58 +00:00
|
|
|
void new_save_coordinates(struct text_object *, char *, unsigned int);
|
2018-08-07 23:22:23 +00:00
|
|
|
void new_alignr(struct text_object *, char *, unsigned int);
|
|
|
|
void new_alignc(struct text_object *, char *, unsigned int);
|
|
|
|
void new_goto(struct text_object *, char *, unsigned int);
|
|
|
|
void new_tab(struct text_object *, char *, unsigned int);
|
2009-02-22 16:53:30 +00:00
|
|
|
|
2019-06-09 21:24:16 +00:00
|
|
|
void clear_stored_graphs();
|
|
|
|
|
2010-02-16 14:45:32 +00:00
|
|
|
struct special_t *new_special(char *buf, enum special_types t);
|
|
|
|
|
2009-02-22 16:53:30 +00:00
|
|
|
#endif /* _SPECIALS_H */
|