2009-07-28 21:44:22 +00:00
|
|
|
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
|
|
|
|
*
|
|
|
|
* 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
|
2009-03-30 04:55:30 +00:00
|
|
|
* Copyright (c) 2005-2009 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
|
|
|
|
|
2009-12-10 04:05:32 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2009-02-22 16:53:30 +00:00
|
|
|
/* special stuff in text_buffer */
|
|
|
|
|
2009-08-07 07:24:24 +00:00
|
|
|
#define SPECIAL_CHAR '\x01'
|
|
|
|
|
2009-05-25 05:31:35 +00:00
|
|
|
#define MAX_GRAPH_DEPTH 512
|
2009-02-22 16:53:30 +00:00
|
|
|
|
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 {
|
2009-10-27 19:56:00 +00:00
|
|
|
NONSPECIAL = 0,
|
2009-07-18 19:46:36 +00:00
|
|
|
HORIZONTAL_LINE = 1,
|
2009-02-22 16:53:30 +00:00
|
|
|
STIPPLED_HR,
|
|
|
|
BAR,
|
|
|
|
FG,
|
|
|
|
BG,
|
|
|
|
OUTLINE,
|
|
|
|
ALIGNR,
|
|
|
|
ALIGNC,
|
2009-03-11 00:37:24 +00:00
|
|
|
GAUGE,
|
2009-02-22 16:53:30 +00:00
|
|
|
GRAPH,
|
|
|
|
OFFSET,
|
|
|
|
VOFFSET,
|
|
|
|
FONT,
|
|
|
|
GOTO,
|
|
|
|
TAB,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct special_t {
|
|
|
|
int type;
|
|
|
|
short height;
|
|
|
|
short width;
|
2009-12-04 00:11:57 +00:00
|
|
|
double arg;
|
2009-02-22 16:53:30 +00:00
|
|
|
double *graph;
|
2009-12-01 23:55:20 +00:00
|
|
|
double scale; /* maximum value */
|
2009-02-22 16:53:30 +00:00
|
|
|
short show_scale;
|
|
|
|
int graph_width;
|
2009-12-01 23:55:20 +00:00
|
|
|
int scaled; /* auto adjust maximum */
|
2009-02-22 16:53:30 +00:00
|
|
|
unsigned long first_colour; // for graph gradient
|
|
|
|
unsigned long last_colour;
|
|
|
|
short font_added;
|
2009-05-24 21:53:32 +00:00
|
|
|
char tempgrad;
|
2009-02-22 16:53:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* direct access to the registered specials (FIXME: bad encapsulation) */
|
|
|
|
extern struct special_t *specials;
|
2009-05-29 03:22:04 +00:00
|
|
|
extern int special_count;
|
2009-02-22 16:53:30 +00:00
|
|
|
|
2009-04-09 22:00:40 +00:00
|
|
|
extern int default_bar_width;
|
|
|
|
extern int default_bar_height;
|
2009-05-16 22:37:22 +00:00
|
|
|
#ifdef X11
|
2009-04-09 22:00:40 +00:00
|
|
|
extern int default_graph_width;
|
|
|
|
extern int default_graph_height;
|
|
|
|
extern int default_gauge_width;
|
|
|
|
extern int default_gauge_height;
|
2009-05-11 16:37:12 +00:00
|
|
|
#endif
|
2009-04-09 22:00:40 +00:00
|
|
|
|
2009-10-25 20:47:47 +00:00
|
|
|
/* forward declare to avoid mutual inclusion between specials.h and text_object.h */
|
|
|
|
struct text_object;
|
|
|
|
|
2009-02-22 16:53:30 +00:00
|
|
|
/* max number of specials allowed (TODO: use linked list instead) */
|
2009-05-29 03:22:04 +00:00
|
|
|
extern int max_specials;
|
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);
|
2009-11-22 22:05:08 +00:00
|
|
|
#ifdef 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 *);
|
2009-10-29 02:22:58 +00:00
|
|
|
void scan_stippled_hr(struct text_object *, const char*);
|
2009-02-22 16:53:30 +00:00
|
|
|
|
|
|
|
/* printing specials */
|
2009-11-29 18:42:29 +00:00
|
|
|
void new_font(struct text_object *, char *, int);
|
2009-11-22 20:12:54 +00:00
|
|
|
void new_graph(struct text_object *, char *, int, double);
|
2009-11-08 13:49:27 +00:00
|
|
|
void new_hr(struct text_object *, char *, int);
|
|
|
|
void new_stippled_hr(struct text_object *, char *, int);
|
2009-05-11 16:37:12 +00:00
|
|
|
#endif
|
2009-12-04 00:11:57 +00:00
|
|
|
void new_gauge(struct text_object *, char *, int, double);
|
|
|
|
void new_bar(struct text_object *, char *, int, double);
|
2009-11-08 13:49:27 +00:00
|
|
|
void new_fg(struct text_object *, char *, int);
|
|
|
|
void new_bg(struct text_object *, char *, int);
|
|
|
|
void new_outline(struct text_object *, char *, int);
|
|
|
|
void new_offset(struct text_object *, char *, int);
|
|
|
|
void new_voffset(struct text_object *, char *, int);
|
|
|
|
void new_alignr(struct text_object *, char *, int);
|
|
|
|
void new_alignc(struct text_object *, char *, int);
|
|
|
|
void new_goto(struct text_object *, char *, int);
|
|
|
|
void new_tab(struct text_object *, char *, int);
|
2009-02-22 16:53:30 +00:00
|
|
|
|
2009-12-10 04:05:32 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-02-22 16:53:30 +00:00
|
|
|
#endif /* _SPECIALS_H */
|