/[webpac]/openisis/current/tcl/lib/mlcm.meta.tcl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /openisis/current/tcl/lib/mlcm.meta.tcl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 237 - (hide annotations)
Mon Mar 8 17:43:12 2004 UTC (18 years, 3 months ago) by dpavlin
File MIME type: application/x-tcl
File size: 5897 byte(s)
initial import of openisis 0.9.0 vendor drop

1 dpavlin 237
2     package require mlcm::menu
3     package require mlcm::profile
4    
5     package provide mlcm::meta 0.1
6    
7     namespace eval mlcm::meta {
8    
9     # fdt records
10    
11     # OPENISIS_FDID = 860, /* tag */
12     # OPENISIS_FDSUB = 861, /* subfield char */
13     # OPENISIS_FDTYPE = 862, /* field type */
14     # OPENISIS_FDREP = 863, /* repeatable flag */
15     # OPENISIS_FDLEN = 865, /* length: 0 variable, >0 maxlen, <0 fixed len */
16     # OPENISIS_FDNAME = 866, /* field name */
17     # OPENISIS_FDDESC = 867, /* field description */
18     # OPENISIS_FDPAT = 868, /* pattern */
19     # OPENISIS_FDDFLT = 869, /* default value */
20     # OPENISIS_FDINFO = 870, /* application specific addons */
21    
22     # meta record
23     set fdtMeta [openIsis::util::buildfdt {
24     {860 1000 862 12 863 0 865 0 866 type 867 {type of entry}}
25     {860 1000 862 31 863 0 865 0 866 profile 867 {profile entry}}
26     {860 1000 862 31 863 0 865 1 866 stub 867 {stub entry}}
27     {860 1000 862 31 863 0 865 2 866 db 867 {db entry}}
28     {860 1000 862 31 863 0 865 3 866 lang 867 {language entry}}
29     {860 1000 862 31 863 0 865 4 866 menu 867 {menu entry}}
30     {860 1001 862 0 863 0 865 0 866 name 867 {id of entry}}
31     {860 1010 862 15 863 1 865 0 866 config 867 {embedded config rec}}
32     {860 1011 862 15 863 0 865 0 866 gui 867 {global gui opts}}
33     {860 1020 862 0 863 0 865 0 866 stub 867 {profile: known stub}}
34     {860 1021 862 0 863 0 865 0 866 db 867 {profile: known db}}
35     {860 1022 862 0 863 0 865 0 866 lang 867 {profile: known lang}}
36     {860 1023 862 0 863 0 865 0 866 menu 867 {profile: known menu}}
37     {860 1030 862 0 863 0 865 0 866 dbname 867 {db,lang: dbid}}
38     {860 1031 862 0 863 0 865 0 866 dbstub 867 {db,lang: stub to use}}
39     {860 1032 862 13 863 0 865 0 866 dbopen 867 {db: open/mount flag}}
40     }]
41    
42     # profile data
43     set fdtProf [openIsis::util::buildfdt {
44     {860 1011 862 15 863 0 865 0 866 gui 867 {global gui opts}}
45     {860 1020 862 0 863 1 865 0 866 stub 867 {known stubs}}
46     {860 1021 862 0 863 1 865 0 866 db 867 {known dbs}}
47     {860 1022 862 0 863 1 865 0 866 lang 867 {known langs}}
48     {860 1023 862 0 863 1 865 0 866 menu 867 {known menus}}
49     {860 2020 862 0 863 0 865 0 866 astub 867 {currently active stub}}
50     {860 2021 862 0 863 0 865 0 866 adb 867 {currently active db}}
51     {860 2022 862 0 863 0 865 0 866 alang 867 {currently active lang}}
52     {860 2023 862 0 863 0 865 0 866 amenu 867 {currently active menu}}
53     }]
54    
55     # menu data
56     set fdtMenu [openIsis::util::buildfdt {
57     {860 3000 862 2 863 0 865 4 866 key 867 {menu key mmss}}
58     {860 3001 862 0 863 0 865 0 866 name 867 {key in lang db}}
59     {860 3002 862 0 863 0 865 0 866 command 867 {menubuttons command}}
60     {860 3003 862 0 863 0 865 0 866 active 867 {active condition}}
61     }]
62    
63     # database
64     set fdtDb [openIsis::util::buildfdt {
65     {860 4000 862 0 863 0 865 32 866 name 867 {db identification}}
66     {860 4001 862 0 863 0 865 32 866 stub 867 {stub to use}}
67     {860 4002 862 0 863 0 865 0 866 config 867 {rec cmd of db metas}}
68     {860 4003 862 15 863 0 865 0 866 gui 867 {db specific gui opts}}
69     {860 4010 862 2 863 0 865 32 866 maxrow 867 {maxrow}}
70     {860 4011 862 2 863 0 865 32 866 num 867 {length of result set}}
71     {860 4012 862 2 863 0 865 32 866 act 867 {act index in result set}}
72     {860 4013 862 2 863 1 865 32 866 mfn 867 {result set}}
73     }]
74    
75     # gui layout data
76     set fdtGui [openIsis::util::buildfdt {
77     {860 5000 862 0 863 0 865 0 866 top 867 {frame/toplevel of gui}}
78     {860 5001 862 0 863 0 865 0 866 db 867 {actual db}}
79     {860 5002 862 0 863 0 865 0 866 stub 867 {stub to use}}
80     {860 5003 862 0 863 0 865 0 866 html 867 {html widget for list.tsp}}
81     }]
82    
83     # default config
84     proc defaults {} {
85     variable fdtMeta
86     return [openIsis::util::buildlst {
87     {type profile name ""
88     menu dfltmenu
89     lang en
90     lang de
91     gui {
92     5000 24
93     }
94     }
95     {type menu name dfltmenu config {
96     3000 0 3001 men/&db
97     }}
98     {type menu name dfltmenu config {
99     3000 1 3001 cmd/db/&open 3002 {
100     puts "cmd open ..."
101     catch {::open_db}
102     }
103     }}
104     {type menu name dfltmenu config {
105     3000 2 3001 cmd/db/&close 3002 {puts "cmd close ..."} 3003 0
106     }}
107     {type menu name dfltmenu config {
108     3000 3 3001 cmd/db/&exit 3002 exit
109     }}
110     {type menu name dfltmenu config {
111     3000 100 3001 men/search
112     }}
113     {type menu name dfltmenu config {
114     3000 102 3001 cmd/search 3002 {puts "cmd search ..."} 3003 { $mlcm::menu::_act }
115     }}
116     {type menu name dfltmenu config {
117     3000 103 3001 cmd/search/hist 3002 {puts "cmd search hist ..."} 3003 { $mlcm::menu::_act }
118     }}
119     {type menu name dfltmenu config {
120     3000 104 3001 cmd/search/result 3002 {puts "cmd search result ..."} 3003 { $mlcm::menu::_act }
121     }}
122     {type menu name dfltmenu config {
123     3000 200 3001 men/edit
124     }}
125     {type menu name dfltmenu config {
126     3000 201 3001 cmd/edit 3002 {puts "cmd edit ..."}
127     }}
128     {type menu name dfltmenu config {
129     3000 300 3001 men/cfg
130     }}
131     {type menu name dfltmenu config {
132     3000 301 3001 cmd/cfg/lang 3002 {puts "cmd lang ..."}
133     }}
134     {type menu name dfltmenu config {
135     3000 302 3001 cmd/cfg/toggle 3002 {
136     puts "toggle ..."
137     mlcm::menu::_test
138     mlcm::menu::notify "" ""
139     }
140     }}
141     {type menu name dfltmenu config {
142     3000 900 3001 men/help
143     }}
144     {type menu name dfltmenu config {
145     3000 901 3001 cmd/help/index 3002 {puts "cmd lang ..."}
146     }}
147     } {config gui} $fdtMeta]
148     }
149    
150     # add config rec
151     proc addconfig rec {
152     switch -- [$rec get type] {
153     0 { puts "add prof [$rec get -tagn]"
154     mlcm::profile::addentry [lindex [$rec get {name ""}] 0] $rec
155     }
156     1 { puts "add stub [$rec get -tagn]"
157     }
158     2 { puts "add db [$rec get -tagn]"
159     }
160     3 { puts "add lang [$rec get -tagn]"
161     }
162     4 { puts "add menu [$rec get -tagn]"
163     mlcm::menu::addentry [lindex [$rec get {name ""}] 0] \
164     [$rec .config]
165     }
166     }
167     }
168     }
169    

  ViewVC Help
Powered by ViewVC 1.1.26