File: BarGaugeP.h

package info (click to toggle)
xsysinfo 1.7-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 180 kB
  • ctags: 118
  • sloc: ansic: 787; sh: 129; makefile: 44
file content (88 lines) | stat: -rw-r--r-- 3,077 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
 * BarGauge: Widget to periodically display a value in form of a horizontal bar.
 * based on Athena StripChart Widget.
 *
 * Author: Gabor Herr		herr@iti.informatik.th-darmstadt.de
 *
 * $Id: BarGaugeP.h,v 1.3 1993/02/07 23:54:15 gabor Exp $
 */
 
/***********************************************************
Copyright 1992, 1993 by Gabor Herr
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the names of Gabor Herr or Digital or MIT not
be used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

GABOR HERR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
GABOR HERR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

#ifndef _XgBarGaugeP_h
#define _XgBarGaugeP_h

#include "BarGauge.h"
#include <X11/Xaw/SimpleP.h>

/*
 * max. # of different segments within the bar. Change this only, if you also
 * add new (foreground) resources.
 * FIXME: This should better be a variable or a resource, and the foreground
 * values should be better in a list.
 */
#define XG_NUM_SEGMENTS	8

/* New fields for the barGauge widget instance record */

typedef struct {
	Pixel fgpixel[XG_NUM_SEGMENTS];	/* color index for each bar segments */
	GC	fgGC[XG_NUM_SEGMENTS];	     /* graphics context for fgpixel */

	Boolean auto_adjust;		     /* auto adjust mode */
    
	float max_value;		     /* Max Value in bar */
	int	segments;		     /* # of segments */
	int	segment_gap;		     /* spacing between segments */
  
	double last_values[XG_NUM_SEGMENTS]; /* last displayed values */

	int	update;		             /* update frequence */
	XtCallbackList get_value;            /* proc to call to fetch load pt */
	XtIntervalId interval_id;
} BarGaugePart;

/* Full instance record declaration */
typedef struct _BarGaugeRec {
	CorePart core;
	SimplePart simple;
	BarGaugePart bar_gauge;
} BarGaugeRec;

/* New fields for the BarGauge widget class record */
typedef struct {int dummy;} BarGaugeClassPart;

/* Full class record declaration. */
typedef struct _BarGaugeClassRec {
	CoreClassPart core_class;
	SimpleClassPart simple_class;
	BarGaugeClassPart bar_gauge_class;
} BarGaugeClassRec;

/* Class pointer. */
extern BarGaugeClassRec barGaugeClassRec;

#endif /* _XgBarGaugeP_h */