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 class Xcls_VBox2 : Object 
47     {
48         public Gtk.VBox el;
49         private Xcls_DialogPluginWebkit  _this;
50
51
52             // my vars (def)
53
54         // ctor 
55         public Xcls_VBox2(Xcls_DialogPluginWebkit _owner )
56         {
57             _this = _owner;
58             this.el = new Gtk.VBox( true, 0 );
59
60             // my vars (dec)
61
62             // set gobject values
63             var child_0 = new Xcls_ScrolledWindow3( _this );
64             child_0.ref();
65             this.el.pack_end (  child_0.el , true,true,0 );
66         }
67
68         // user defined functions 
69     }
70     public class Xcls_ScrolledWindow3 : Object 
71     {
72         public Gtk.ScrolledWindow el;
73         private Xcls_DialogPluginWebkit  _this;
74
75
76             // my vars (def)
77
78         // ctor 
79         public Xcls_ScrolledWindow3(Xcls_DialogPluginWebkit _owner )
80         {
81             _this = _owner;
82             this.el = new Gtk.ScrolledWindow( null, null );
83
84             // my vars (dec)
85
86             // set gobject values
87             var child_0 = new Xcls_patchview( _this );
88             child_0.ref();
89             this.el.add (  child_0.el  );
90
91             // init method 
92
93             this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
94         }
95
96         // user defined functions 
97     }
98     public class Xcls_patchview : Object 
99     {
100         public WebKit.WebView el;
101         private Xcls_DialogPluginWebkit  _this;
102
103
104             // my vars (def)
105
106         // ctor 
107         public Xcls_patchview(Xcls_DialogPluginWebkit _owner )
108         {
109             _this = _owner;
110             _this.patchview = this;
111             this.el = new WebKit.WebView();
112
113             // my vars (dec)
114
115             // set gobject values
116
117             // init method 
118
119             {
120                 // this may not work!?
121                 var settings =  this.el.get_settings();
122                 
123                  
124                 //var fs= new FakeServer(this.el);
125                 //fs.ref();
126                 // this was an attempt to change the url perms.. did not work..
127                 // settings.enable_file_access_from_file_uris = true;
128                 // settings.enable_offline_web_application_cache - true;
129                 // settings.enable_universal_access_from_file_uris = true;
130                
131                  
132                 
133                 
134                 
135             
136                  // FIXME - base url of script..
137                  // we need it so some of the database features work.
138                 this.el.load_html( "Render not ready" , 
139                         //fixme - should be a config option!
140                         // or should we catch stuff and fix it up..
141                         "xhttp://localhost/app.Builder/"
142                 );
143                     
144                     
145                 
146                 
147             }
148         }
149
150         // user defined functions 
151     }
152 }