public Xcls_sourceviewscroll sourceviewscroll;
public Xcls_sourceview sourceview;
public Xcls_buffer buffer;
+ public Xcls_keystate keystate;
public Xcls_search_entry search_entry;
public Xcls_search_results search_results;
public Xcls_nextBtn nextBtn;
//listeners
this.el.script_dialog.connect( (dialog) => {
-
-
- if (this.el == null) {
- return true;
- }
-
- var msg = dialog.get_message();
- if (msg.length < 4) {
- return false;
- }
-
- GLib.debug("script dialog got %s", msg);
-
- if (msg.substring(0,4) != "IPC:") {
- return false;
- }
- var ar = msg.split(":", 3);
- if (ar.length < 3) {
- return false;
- }
- switch(ar[1]) {
- case "SAVEHTML":
- GLib.debug("GOT saveHTML %d", ar[2].length);
- _this.file.saveHTML(ar[2]);
- _this.createThumb();
- return true;
- default:
- return false;
- }
+ if (this.el == null) {
+ return true;
+ }
+
+ var msg = dialog.get_message();
+ if (msg.length < 4) {
+ return false;
+ }
+
+ //GLib.debug("script dialog got %s", msg);
+
+ if (msg.substring(0,4) != "IPC:") {
+ return false;
+ }
+ var ar = msg.split(":", 3);
+ if (ar.length < 3) {
+ return false;
+ }
+
+ switch(ar[1]) {
+
+ case "SAVEHTML":
+ // GLib.debug("GOT saveHTML %d", ar[2].length);
+ _this.file.saveHTML(ar[2]);
+ _this.createThumb();
+ return true;
+
+ default:
+ return false;
+ }
});
this.el.ready_to_show.connect( ( ) => {
}
this.refreshRequired = true;
+
}
public void reInit () {
print("reInit?");
{
// this is run every 2 seconds from the init..
-
-
+
if (!this.refreshRequired) {
// print("no refresh required");
return;
uint8[] builderhtml;
try {
- GLib. File.new_for_uri("resources:///html/roo.builder.js").load_contents(null, out builderhtml, null);
+ GLib. File.new_for_uri("resource:///html/roo.builder.js").load_contents(null, out builderhtml, null);
} catch (Error e) {
builderhtml = {};
}
uint8[] inhtml;
var base_template = project.base_template;
- var f = GLib. File.new_for_uri("resources:///html/" + base_template);
+ var f = GLib. File.new_for_uri("resource:///html/" + base_template);
if (base_template.length > 0 && !f.query_exists(null)) {
- GLib.debug("invalid base_template name - using default: %Scanner", base_template);
- f = GLib. File.new_for_uri("resources:///html/roo.builder.html");
+ GLib.debug("invalid base_template name - using default: %s", base_template);
+ f = GLib. File.new_for_uri("resource:///html/roo.builder.html");
}
try {
} catch (Error e) {
+ GLib.debug("error loading %s : %s", f.get_uri(),e.message);
inhtml = {};
}
this.renderedData = js;
var fc = FakeServerCache.factory_with_data(js_src);
this.runjs = fc.fname;
var html = (string) inhtml;
+ html = html == null ? "" : html; // fix null?
+
html = html.replace("</head>", runhtml + this.runhtml +
"<script type=\"text/javascript\" src=\"xhttp://localhost" + fc.fname + "\"></script>" +
// "<script type=\"text/javascript\">\n" +
this.el.vexpand = true;
new Xcls_sourceviewscroll( _this );
this.el.append( _this.sourceviewscroll.el );
- var child_2 = new Xcls_Box17( _this );
+ var child_2 = new Xcls_Box18( _this );
child_2.ref();
this.el.append( child_2.el );
}
this.el.css_classes = { "code-editor" };
new Xcls_buffer( _this );
this.el.set_buffer ( _this.buffer.el );
- var child_2 = new Xcls_EventControllerKey16( _this );
- child_2.ref();
- this.el.add_controller ( child_2.el );
+ new Xcls_keystate( _this );
+ this.el.add_controller ( _this.keystate.el );
+ var child_3 = new Xcls_EventControllerScroll17( _this );
+ child_3.ref();
+ this.el.add_controller( child_3.el );
// init method
}
}
- public class Xcls_EventControllerKey16 : Object
+ public class Xcls_keystate : Object
{
public Gtk.EventControllerKey el;
private Xcls_WindowRooView _this;
// my vars (def)
+ public bool is_control;
// ctor
- public Xcls_EventControllerKey16(Xcls_WindowRooView _owner )
+ public Xcls_keystate(Xcls_WindowRooView _owner )
{
_this = _owner;
+ _this.keystate = this;
this.el = new Gtk.EventControllerKey();
// my vars (dec)
+ this.is_control = false;
// set gobject values
//listeners
+ this.el.key_released.connect( (keyval, keycode, state) => {
+
+
+ if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {
+ this.is_control = false;
+ }
+ });
this.el.key_pressed.connect( (keyval, keycode, state) => {
-
+ if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {
+ this.is_control = true;
+ }
if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
GLib.debug("SAVE: ctrl-g pressed");
// user defined functions
}
+ public class Xcls_EventControllerScroll17 : Object
+ {
+ public Gtk.EventControllerScroll el;
+ private Xcls_WindowRooView _this;
+
+
+ // my vars (def)
+ public double distance;
+
+ // ctor
+ public Xcls_EventControllerScroll17(Xcls_WindowRooView _owner )
+ {
+ _this = _owner;
+ this.el = new Gtk.EventControllerScroll( Gtk.EventControllerScrollFlags.VERTICAL );
+
+ // my vars (dec)
+ this.distance = 0.0f;
+
+ // set gobject values
+
+ //listeners
+ this.el.scroll.connect( (dx, dy) => {
+ if (!_this.keystate.is_control) {
+ return false;
+ }
+ //GLib.debug("scroll %f", dy);
+
+ this.distance += dy;
+ if (this.distance < -1) {
+
+ BuilderApplication.settings.editor_font_size ++;
+ this.distance = 0;
+ }
+ if (this.distance > 1) {
+ BuilderApplication.settings.editor_font_size --;
+ this.distance = 0;
+ }
+
+ return true;
+ });
+ }
+
+ // user defined functions
+ }
+
- public class Xcls_Box17 : Object
+ public class Xcls_Box18 : Object
{
public Gtk.Box el;
private Xcls_WindowRooView _this;
// my vars (def)
// ctor
- public Xcls_Box17(Xcls_WindowRooView _owner )
+ public Xcls_Box18(Xcls_WindowRooView _owner )
{
_this = _owner;
this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
this.el.append( _this.nextBtn.el );
new Xcls_backBtn( _this );
this.el.append( _this.backBtn.el );
- var child_5 = new Xcls_MenuButton23( _this );
+ var child_5 = new Xcls_MenuButton24( _this );
child_5.ref();
this.el.append( child_5.el );
}
this.el.name = "roo-search-entry";
this.el.hexpand = true;
this.el.placeholder_text = "Press enter to search";
- var child_1 = new Xcls_EventControllerKey19( _this );
+ var child_1 = new Xcls_EventControllerKey20( _this );
child_1.ref();
this.el.add_controller( child_1.el );
}
}
- public class Xcls_EventControllerKey19 : Object
+ public class Xcls_EventControllerKey20 : Object
{
public Gtk.EventControllerKey el;
private Xcls_WindowRooView _this;
// my vars (def)
// ctor
- public Xcls_EventControllerKey19(Xcls_WindowRooView _owner )
+ public Xcls_EventControllerKey20(Xcls_WindowRooView _owner )
{
_this = _owner;
this.el = new Gtk.EventControllerKey();
// user defined functions
}
- public class Xcls_MenuButton23 : Object
+ public class Xcls_MenuButton24 : Object
{
public Gtk.MenuButton el;
private Xcls_WindowRooView _this;
public bool always_show_image;
// ctor
- public Xcls_MenuButton23(Xcls_WindowRooView _owner )
+ public Xcls_MenuButton24(Xcls_WindowRooView _owner )
{
_this = _owner;
this.el = new Gtk.MenuButton();
// my vars (dec)
// set gobject values
- var child_1 = new Xcls_Box25( _this );
+ var child_1 = new Xcls_Box26( _this );
+ child_1.ref();
this.el.child = child_1.el;
}
// user defined functions
}
- public class Xcls_Box25 : Object
+ public class Xcls_Box26 : Object
{
public Gtk.Box el;
private Xcls_WindowRooView _this;
// my vars (def)
// ctor
- public Xcls_Box25(Xcls_WindowRooView _owner )
+ public Xcls_Box26(Xcls_WindowRooView _owner )
{
_this = _owner;
this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );