2010-01-07 03:45:19 +00:00
|
|
|
/* -*- mode: c++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
|
|
|
|
* vim: ts=4 sw=4 noet ai cindent syntax=cpp
|
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
|
2010-01-01 23:46:17 +00:00
|
|
|
* Copyright (c) 2005-2010 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 {
|
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,
|
2009-12-17 21:17:15 +00:00
|
|
|
TAB
|
2009-02-22 16:53:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
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;
|
2010-04-21 16:03:53 +00:00
|
|
|
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
|
|
|
|
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
|
|
|
/* 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 *);
|
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);
|
2010-01-07 02:38:12 +00:00
|
|
|
#endif /* BUILD_X11 */
|
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
|
|
|
|
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 */
|