Source
36
36
# include <QObject>
37
37
#include <graphics/X11/X_exit.h>
38
38
39
39
namespace casa { //# NAMESPACE CASA - BEGIN
40
40
41
41
class QtDBusViewerAdaptor;
42
42
class QtDisplayPanelGui;
43
43
class QtCleanPanelGui;
44
44
class QtCleanPanelGui2;
45
45
46
+
#if defined(WITHOUT_DBUS)
47
+
class grpcViewerState;
48
+
#endif
49
+
46
50
// <summary>
47
51
// Qt implementation of main viewer supervisory object -- Gui level.
48
52
// </summary>
49
53
50
54
// <synopsis>
51
55
// A QtViewer app should use just one QtViewer object, in all
52
56
// Probability; the rest of the objects will coordinate through it.
53
57
//
54
58
// The viewer is structured with a functional layer and a gui layer.
55
59
// In principle the former can operate without the latter.
69
73
// </synopsis>
70
74
71
75
class QtViewer : public QtViewerBase {
72
76
73
77
Q_OBJECT //# Allows slot/signal definition. Must only occur in
74
78
//# implement/.../*.h files; also, makefile must include
75
79
//# name of this file in 'mocs' section.
76
80
77
81
public:
78
82
79
-
QtViewer( const std::list<std::string> &args, bool is_server=false, const char *dbus_name=0 );
83
+
// When DBus is used "server_string" is the DBus name for the viewer on the message bus, but
84
+
// when gRPC is used "server_string" is the gRPC URL which should be used to register the
85
+
// viewer server.
86
+
QtViewer( const std::list<std::string> &args, bool is_server=false, const char *server_string=0 );
80
87
~QtViewer();
81
88
82
89
// Called from casaviewer.cc, true indicates that this application has been activated,
83
90
// false indicates that it has been deactivated. The application (with OSX anyway)
84
91
// becomes deactivated when it looses application focus, e.g. when the user moves
85
92
// to "mission control" etc. This is useful for signaling that the mouse has left
86
93
// the display window... (in these cases where it leaves without dragging out)
87
94
void activate( bool );
88
95
89
96
// name used to initialize connection to dbus
98
105
virtual QtCleanPanelGui2 *createInteractiveCleanGui2( );
99
106
100
107
// Exits Qt loop. (Note that the loop can be restarted (and is, in
101
108
// interactive clean, e.g.), with existing widgets intact. This
102
109
// does not in itself delete objects or exit the process, although
103
110
// the driver program might do that). Also, some of the panels may
104
111
// have WA_DeleteOnClose set, which would cause their deletion (see,
105
112
// e.g., createDPG()).
106
113
virtual void quit();
107
114
115
+
#if defined(WITHOUT_DBUS)
116
+
void grpc_panel( const QString &, bool, int );
117
+
118
+
signals:
119
+
void grpc_panel_result( QtDisplayPanelGui*, int );
120
+
121
+
#endif
108
122
109
123
private:
110
124
friend class QtDisplayPanelGui;
111
125
void dpgDeleted(QtDisplayPanelGui*);
112
126
113
127
protected:
114
128
115
129
#if ! defined(WITHOUT_DBUS)
116
130
QtDBusViewerAdaptor* dbus_;
131
+
#else
132
+
std::shared_ptr<grpcViewerState> grpc_;
117
133
#endif
118
134
std::list<std::string> args_;
119
135
120
136
private:
121
137
static QString name_;
122
-
QString dbus_name_;
138
+
QString server_string_;
123
139
bool is_server_;
124
140
typedef std::vector<QtDisplayPanelGui*> panel_list_t;
125
141
panel_list_t panels;
126
142
127
143
};
128
144
129
145
130
146
131
147
} //# NAMESPACE CASA - END
132
148