summaryrefslogtreecommitdiff
path: root/src/pmview/main.h
blob: ccd66b093fe53d3b99608b3a1ded4f084a675e93 (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
 * Copyright (c) 2009, Aconex.  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 2 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.
 */
#ifndef MAIN_H
#define MAIN_H

#include "pcp/pmapi.h"
#include "pcp/impl.h"

#include "qed_app.h"
#include "main.h"
#include "viewobj.h"
#include "colorlist.h"
#include "pmview.h"

class QedApp;
class View;
class ModList;
class SoQtExaminerViewer;

typedef void (*TermCB)(int);

typedef struct {
	// Sampling
	double viewDelta;
	bool viewDeltaModified;
	double loggerDelta;
	bool loggerDeltaModified;

	// Colors
	QColor viewBackground;
	QString viewBackgroundName;
	bool viewBackgroundModified;
	QColor viewHighlight;
	QString viewHighlightName;
	bool viewHighlightModified;
	QColor gridBackground;
	QString gridBackgroundName;
	bool gridBackgroundModified;

	// Toolbar
	int initialToolbar;
	bool initialToolbarModified;
	int nativeToolbar;
	bool nativeToolbarModified;
	int toolbarLocation;
	int toolbarLocationModified;
	QStringList toolbarActions;
	bool toolbarActionsModified;
} Settings;

// TODO: old X-resources...
// ! Background color of read-only labels
// !PmView+*readOnlyBackground: Black
// ! Maximum value before saturation
// ! The default of 1.05 allows for 5% error in the time delta when
// ! determining rates, before values are deemed saturated.
// PmView+*saturation: 1.05
// ! Use fast anti-aliasing
// PmView+*antiAliasSmooth: tree
// ! Number of anti-aliasing passes: 1-255. Only 1 pass disables antialiasing.
// PmView+*antiAliasPasses: 1
// ! Grid, Bar and Stack object base borders
// PmView+*baseBorderWidth: 8
// PmView+*baseBorderDepth: 8
// ! Height of Grid, Bar and Stack bases
// PmView+*baseHeight: 2
// ! Color of base plane
// PmView+*baseColor: rgbi:0.15/0.15/0.15
// ! Spacing between Bar blocks
// PmView+*barSpaceWidth: 8
// PmView+*barSpaceDepth: 8
// ! Spacing between Bar base and labels
// PmView+*barSpaceLabel: 6
// ! Width and depth of Bar blocks
// PmView+*barLength: 28
// PmView+*barHeight: 80
// ! Margin around a Label
// PmView+*labelMargin: 5
// ! Color of labels
// PmView+*labelColor: rgbi:1.0/1.0/1.0
// ! Width and depth of Grid columns and rows
// PmView+*gridMinWidth: 20
// PmView+*gridMinDepth: 20

extern Settings globalSettings;
extern void readSettings();
extern void writeSettings();
extern QColor nextColor(const QString &, int *);

extern int Cflag;
extern int Lflag;
extern char *outgeometry;

extern QString	theConfigName;	// Configuration file name
extern FILE	*theConfigFile;	// Configuration file
extern ColorList theColorLists;	// ColorLists generated while parsing config
extern float	theGlobalScale;	// Scale applied to entire scene
extern FILE	*theAltConfig;	// Save the config file here
extern bool	theAltConfigFlag; // True when config is saved to temporary file
extern QString	theAltConfigName; // Name of the saved configuration file

class SceneGroup;
extern SceneGroup *liveGroup;
extern SceneGroup *archiveGroup;
extern SceneGroup *activeGroup;

class PmView;
extern PmView *pmview;

class QedTimeControl;
extern QedTimeControl *pmtime;

extern int genInventor();
extern char lastinput();
extern char input();
extern int markpos();
extern int locateError();

extern ViewObj *rootObj;
extern int errorCount;
extern int yyparse(void);
extern FILE *yyin;

extern float			theScale;	// The scale controls multiplier
extern ModList			*theModList;	// List of modulated objects
extern View			*theView;	// Viewer coordinator
extern QedApp			*theApp;	// Our application object
extern const int		theBufferLen;	// Length of theBuffer
extern char			theBuffer[];	// String buffer for anything
extern const QString		theDefaultFlags;

int setup(const char *appname, int *argc, char **argv, 
	      void *cmdopts, int numOpts, TermCB termCB);

#define _POS_	__FILE__, __LINE__
 
int warningMsg(const char *fileName, int line, const char *msg, ...);
int errorMsg(const char *fileName, int line, const char *msg, ...);
int fatalMsg(const char *fileName, int line, const char *msg, ...);

#endif	// MAIN_H