src/Builder4/DialogPluginWebkit.bjs
[app.Builder.js] / src / Builder4 / DialogPluginWebkit.vala
1 static Xcls_DialogPluginWebkit  _DialogPluginWebkit;
2
3 public class Xcls_DialogPluginWebkit : Object 
4 {
5     public Gtk.Dialog el;
6     private Xcls_DialogPluginWebkit  _this;
7
8     public static Xcls_DialogPluginWebkit singleton()
9     {
10         if (_DialogPluginWebkit == null) {
11             _DialogPluginWebkit= new Xcls_DialogPluginWebkit();
12         }
13         return _DialogPluginWebkit;
14     }
15     public Xcls_patchview patchview;
16
17         // my vars (def)
18
19     // ctor 
20     public Xcls_DialogPluginWebkit()
21     {
22         _this = this;
23         this.el = new Gtk.Dialog();
24
25         // my vars (dec)
26
27         // set gobject values
28         this.el.title = "Add / Edit Component";
29         this.el.default_height = 500;
30         this.el.default_width = 500;
31         this.el.deletable = true;
32         this.el.modal = true;
33         var child_0 = new Xcls_VBox2( _this );
34         child_0.ref();
35         this.el.get_content_area().add (  child_0.el  );
36
37         // listeners 
38         this.el.delete_event.connect( (self, event) => {
39             this.el.hide();
40             return true; 
41             //test  
42         });
43     }
44
45     // user defined functions 
46     public return_type XXXX () {
47     
48     }
49     public class Xcls_VBox2 : Object 
50     {
51         public Gtk.VBox el;
52         private Xcls_DialogPluginWebkit  _this;
53
54
55             // my vars (def)
56
57         // ctor 
58         public Xcls_VBox2(Xcls_DialogPluginWebkit _owner )
59         {
60             _this = _owner;
61             this.el = new Gtk.VBox( true, 0 );
62
63             // my vars (dec)
64
65             // set gobject values
66             var child_0 = new Xcls_ScrolledWindow3( _this );
67             child_0.ref();
68             this.el.pack_end (  child_0.el , true,true,0 );
69         }
70
71         // user defined functions 
72     }
73     public class Xcls_ScrolledWindow3 : Object 
74     {
75         public Gtk.ScrolledWindow el;
76         private Xcls_DialogPluginWebkit  _this;
77
78
79             // my vars (def)
80
81         // ctor 
82         public Xcls_ScrolledWindow3(Xcls_DialogPluginWebkit _owner )
83         {
84             _this = _owner;
85             this.el = new Gtk.ScrolledWindow( null, null );
86
87             // my vars (dec)
88
89             // set gobject values
90             var child_0 = new Xcls_patchview( _this );
91             child_0.ref();
92             this.el.add (  child_0.el  );
93
94             // init method 
95
96             this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
97         }
98
99         // user defined functions 
100     }
101     public class Xcls_patchview : Object 
102     {
103         public WebKit.WebView el;
104         private Xcls_DialogPluginWebkit  _this;
105
106
107             // my vars (def)
108
109         // ctor 
110         public Xcls_patchview(Xcls_DialogPluginWebkit _owner )
111         {
112             _this = _owner;
113             _this.patchview = this;
114             this.el = new WebKit.WebView();
115
116             // my vars (dec)
117
118             // set gobject values
119
120             // init method 
121
122             {
123                 // this may not work!?
124                 var settings =  this.el.get_settings();
125                 
126                  
127                 //var fs= new FakeServer(this.el);
128                 //fs.ref();
129                 // this was an attempt to change the url perms.. did not work..
130                 // settings.enable_file_access_from_file_uris = true;
131                 // settings.enable_offline_web_application_cache - true;
132                 // settings.enable_universal_access_from_file_uris = true;
133                
134                  
135                 
136                 
137                 
138             
139                  // FIXME - base url of script..
140                  // we need it so some of the database features work.
141                 this.el.load_html( "Render not ready" , 
142                         //fixme - should be a config option!
143                         // or should we catch stuff and fix it up..
144                         "xhttp://localhost/app.Builder/"
145                 );
146                     
147                     
148                 
149                 
150             }
151         }
152
153         // user defined functions 
154     }
155 }