forked from bronevet/old_sight
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariant_layout.C
More file actions
executable file
·68 lines (58 loc) · 1.91 KB
/
variant_layout.C
File metadata and controls
executable file
·68 lines (58 loc) · 1.91 KB
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
// Licence information included in file LICENCE
#include "sight_layout.h"
#include "sight_common.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
using namespace std;
using namespace sight::common;
namespace sight {
namespace layout {
// Record the layout handlers in this file
void* variantEnterHandler(properties::iterator props) { variant* v=new variant(props); return v; }
void variantExitHandler(void* obj) { variant* v = static_cast<variant*>(obj); delete v; }
void* interVariantHandler(properties::iterator props) {
dbg.ownerAccessing();
dbg << endl << "</td><td>" << endl;
dbg.userAccessing();
return NULL;
}
variantLayoutHandlerInstantiator::variantLayoutHandlerInstantiator() {
// Called when a group of variants are entered or exited
(*layoutEnterHandlers)["variants"] = &variantEnterHandler;
(*layoutExitHandlers) ["variants"] = &variantExitHandler;
// Called between individual variants within a group
(*layoutEnterHandlers)["inter_variants"] = &interVariantHandler;
}
variantLayoutHandlerInstantiator variantLayoutHandlerInstance;
variant::variant(properties::iterator props) :
scope("Variants",
false, // ownFile
true, // ownColor
false, // labelInteractive
false, // labelShown
true) // summaryEntry
{
numVariants = props.getInt("numSubDirs");
dbg.ownerAccessing();
dbg << "<table border=1 width=\"100\%\"><tr><td colspan=\""<<numVariants<<"\">Variants</td></tr>"<<endl;
dbg << "<tr><td>"<<endl;
//dbg << "<script type=\"text/javascript\">"<<loadCmd<<"</script>"<<endl;
dbg.flush();
dbg.userAccessing();
}
variant::~variant() {
// Close this scope
dbg.ownerAccessing();
dbg << "</td></tr></table>"<<endl;
dbg.userAccessing();
}
}; // namespace layout
}; // namespace sight