1 static Xcls_GtkView _GtkView;
3 public class Xcls_GtkView : Object
6 private Xcls_GtkView _this;
8 public static Xcls_GtkView singleton()
10 if (_GtkView == null) {
11 _GtkView= new Xcls_GtkView();
15 public Xcls_notebook notebook;
16 public Xcls_label_preview label_preview;
17 public Xcls_label_code label_code;
18 public Xcls_view_layout view_layout;
19 public Xcls_container container;
20 public Xcls_sourceviewscroll sourceviewscroll;
21 public Xcls_sourceview sourceview;
22 public Xcls_buffer buffer;
23 public Xcls_search_entry search_entry;
24 public Xcls_search_results search_results;
25 public Xcls_nextBtn nextBtn;
26 public Xcls_backBtn backBtn;
27 public Xcls_search_settings search_settings;
28 public Xcls_case_sensitive case_sensitive;
29 public Xcls_regex regex;
30 public Xcls_multiline multiline;
33 public Gtk.Widget lastObj;
34 public Gtk.CssProvider css;
35 public Xcls_MainWindow main_window;
36 public GtkSource.SearchContext searchcontext;
37 public int last_search_end;
38 public JsRender.JsRender file;
44 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
48 this.last_search_end = 0;
52 this.el.hexpand = true;
53 this.el.vexpand = true;
54 new Xcls_notebook( _this );
55 this.el.append( _this.notebook.el );
61 this.css = new Gtk.CssProvider();
63 this.css.load_from_string(
64 "#gtkview-view-layout { background-color: #ccc; }"
67 Gtk.StyleContext.add_provider_for_display(
68 this.el.get_display(),
70 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
77 // user defined functions
78 public void loadFile (JsRender.JsRender file)
82 if (file.tree == null) {
85 this.notebook.el.page = 0;// gtk preview
90 this.sourceview.loadFile();
91 this.searchcontext = null;
94 if (this.lastObj != null) {
95 this.container.el.remove(this.lastObj);
98 // hide the compile view at present..
101 var w = this.el.get_width();
102 var h = this.el.get_height();
104 print("ALLOC SET SIZES %d, %d\n", w,h);
106 // set the container size min to 500/500 or 20 px less than max..
107 w = int.max (w-20, 500);
108 h = int.max (h-20, 500);
110 print("SET SIZES %d, %d\n", w,h);
111 _this.container.el.set_size_request(w,h);
113 _this.view_layout.el.set_size_request(w,h);
114 // should be baded on calc.. -- see update_scrolled.
116 var fc = this.container.el.get_first_child();
118 this.container.el.remove(fc);
121 var xmlstr = JsRender.NodeToGlade.mungeFile( file);
122 var builder = new Gtk.Builder.from_string (xmlstr, xmlstr.length);
123 var obj = (Gtk.Widget) builder.get_object("w"+ file.tree.oid.to_string());
124 this.container.el.append(obj);
130 var x = new JsRender.NodeToGtk((Project.Gtk) file.project, file.tree);
131 var obj = x.munge() as Gtk.Widget;
138 this.container.el.append(obj);
144 public void highlightNodeAtLine (int ln) {
146 // this is done from clicking on the editor..
151 var node = _this.file.lineToNode(ln+1);
154 //print("can not find node\n");
157 var prop = node.lineToProp(ln+1);
158 print("prop : %s", prop == null ? "???" : prop.name);
161 // ---------- this selects the tree's node...
163 var ltree = _this.main_window.windowstate.left_tree;
164 ltree.model.selectNode(node);
165 //var tp = ltree.model.treePathFromNode(node);
167 //print("got tree path %s\n", tp);
171 //_this.sourceview.allow_node_scroll = false; /// block node scrolling..
174 //print("changing cursor on tree..\n");
178 // let's try allowing editing on the methods.
179 // a little klunky at present..
180 _this.sourceview.prop_selected = "";
183 //see if we can find it..
184 var kv = prop.split(":");
187 //var k = prop.get_key(kv[1]);
188 // fixme -- need to determine if it's an editable property...
189 _this.sourceview.prop_selected = prop;
191 } else if (kv[0] == "l") {
192 _this.sourceview.prop_selected = prop;
197 //ltree.view.setCursor(tp, "editor");
198 // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false);
199 _this.sourceview.nodeSelected(node,false);
201 // scrolling is disabled... as node selection calls scroll 10ms after it changes.
202 // GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {
203 // this.allow_node_scroll = true;
219 public void forwardSearch (bool change_focus) {
221 if (this.searchcontext == null) {
224 this.notebook.el.page = 1;
225 Gtk.TextIter beg, st,en;
226 bool has_wrapped_around;
227 var buf = this.sourceview.el.get_buffer();
228 buf.get_iter_at_offset(out beg, this.last_search_end);
229 if (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {
230 this.last_search_end = 0;
233 this.last_search_end = en.get_offset();
235 this.sourceview.el.grab_focus();
237 buf.place_cursor(st);
241 this.sourceview.el.scroll_to_iter(st, 0.0f, true, 0.0f, 0.5f);
244 var ln = st.get_line();
246 this.highlightNodeAtLine(ln);
248 public void backSearch (bool change_focus) {
250 if (this.searchcontext == null) {
254 Gtk.TextIter beg, st,en;
255 bool has_wrapped_around;
256 this.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );
258 if (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {
260 this.last_search_end = 0;
263 this.last_search_end = en.get_offset();
265 this.sourceview.el.grab_focus();
267 this.buffer.el.place_cursor(st);
268 this.sourceview.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);
269 var ln = st.get_line();
270 this.highlightNodeAtLine(ln);
273 public int search (string in_txt) {
274 this.notebook.el.page = 1;
278 var s = new GtkSource.SearchSettings();
279 s.case_sensitive = _this.case_sensitive.el.active;
280 s.regex_enabled = _this.regex.el.active;
281 s.wrap_around = false;
283 this.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);
284 this.searchcontext.set_highlight(true);
287 if (_this.multiline.el.active) {
288 txt = in_txt.replace("\\n", "\n");
291 s.set_search_text(txt);
292 Gtk.TextIter beg, st,en;
293 bool has_wrapped_around;
294 this.buffer.el.get_start_iter(out beg);
295 this.searchcontext.forward(beg, out st, out en, out has_wrapped_around);
296 this.last_search_end = 0;
298 return this.searchcontext.get_occurrences_count();
304 public void createThumb () {
307 if (this.file == null) {
310 // only screenshot the gtk preview..
311 if (this.notebook.el.page > 0 ) {
316 this.file.widgetToIcon(this.container.el);
325 // should we hold until it's printed...
331 public void updateErrorMarks (string category) {
335 var buf = _this.buffer.el;
338 buf.get_bounds (out start, out end);
340 buf.remove_source_marks (start, end, category);
342 GLib.debug("highlight errors");
344 // we should highlight other types of errors..
349 if (_this.file == null) {
350 GLib.debug("file is null?");
354 var ar = this.file.getErrors(category);
355 if (ar == null || ar.get_n_items() < 1) {
356 GLib.debug("higjlight %s has no errors", category);
364 var tlines = buf.get_line_count () +1;
368 for (var i = 0; i < ar.get_n_items();i++) {
369 var err = (Palete.CompileError) ar.get_item(i);
372 // print("get inter\n");
373 var eline = err.line + 1;
374 GLib.debug("GOT ERROR on line %d -- converted to %d ",
378 if (eline > tlines || eline < 0) {
383 buf.get_iter_at_line( out iter, eline);
386 var msg = "Line: %d %s : %s".printf(eline+1, err.category, err.msg);
387 buf.create_source_mark( msg, err.category, iter);
388 GLib.debug("set line %d to %s", eline, msg);
389 //this.marks.set(eline, msg);
398 public void scroll_to_line (int line) {
401 GLib.Timeout.add(100, () => {
404 this.notebook.el.set_current_page(1);
406 var buf = this.sourceview.el.get_buffer();
408 var sbuf = (GtkSource.Buffer) buf;
412 sbuf.get_iter_at_line(out iter, line);
413 this.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);
419 public class Xcls_notebook : Object
421 public Gtk.Notebook el;
422 private Xcls_GtkView _this;
428 public Xcls_notebook(Xcls_GtkView _owner )
431 _this.notebook = this;
432 this.el = new Gtk.Notebook();
436 // set gobject values
437 this.el.overflow = Gtk.Overflow.VISIBLE;
438 new Xcls_label_preview( _this );
439 new Xcls_label_code( _this );
440 var child_3 = new Xcls_ScrolledWindow5( _this );
442 this.el.append_page ( child_3.el , _this.label_preview.el );
443 var child_4 = new Xcls_Box8( _this );
445 this.el.append_page ( child_4.el , _this.label_code.el );
448 // user defined functions
450 public class Xcls_label_preview : Object
453 private Xcls_GtkView _this;
459 public Xcls_label_preview(Xcls_GtkView _owner )
462 _this.label_preview = this;
463 this.el = new Gtk.Label( "Preview" );
467 // set gobject values
470 // user defined functions
473 public class Xcls_label_code : Object
476 private Xcls_GtkView _this;
482 public Xcls_label_code(Xcls_GtkView _owner )
485 _this.label_code = this;
486 this.el = new Gtk.Label( "Preview Generated Code" );
490 // set gobject values
493 // user defined functions
496 public class Xcls_ScrolledWindow5 : Object
498 public Gtk.ScrolledWindow el;
499 private Xcls_GtkView _this;
505 public Xcls_ScrolledWindow5(Xcls_GtkView _owner )
508 this.el = new Gtk.ScrolledWindow();
512 // set gobject values
513 new Xcls_view_layout( _this );
514 this.el.set_child ( _this.view_layout.el );
517 // user defined functions
519 public class Xcls_view_layout : Object
522 private Xcls_GtkView _this;
528 public Xcls_view_layout(Xcls_GtkView _owner )
531 _this.view_layout = this;
532 this.el = new Gtk.Fixed();
536 // set gobject values
537 this.el.name = "gtkview-view-layout";
538 new Xcls_container( _this );
539 this.el.put ( _this.container.el , 10,10 );
542 // user defined functions
544 public class Xcls_container : Object
547 private Xcls_GtkView _this;
553 public Xcls_container(Xcls_GtkView _owner )
556 _this.container = this;
557 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
561 // set gobject values
564 // user defined functions
569 public class Xcls_Box8 : Object
572 private Xcls_GtkView _this;
578 public Xcls_Box8(Xcls_GtkView _owner )
581 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
585 // set gobject values
586 new Xcls_sourceviewscroll( _this );
587 this.el.append( _this.sourceviewscroll.el );
588 var child_2 = new Xcls_Box13( _this );
590 this.el.append( child_2.el );
593 // user defined functions
595 public class Xcls_sourceviewscroll : Object
597 public Gtk.ScrolledWindow el;
598 private Xcls_GtkView _this;
604 public Xcls_sourceviewscroll(Xcls_GtkView _owner )
607 _this.sourceviewscroll = this;
608 this.el = new Gtk.ScrolledWindow();
612 // set gobject values
613 this.el.vexpand = true;
614 new Xcls_sourceview( _this );
615 this.el.set_child ( _this.sourceview.el );
618 // user defined functions
620 public class Xcls_sourceview : Object
622 public GtkSource.View el;
623 private Xcls_GtkView _this;
628 public bool zallow_node_scroll;
629 public string prop_selected;
630 public Gtk.CssProvider css;
631 public JsRender.Node? node_selected;
634 public Xcls_sourceview(Xcls_GtkView _owner )
637 _this.sourceview = this;
638 this.el = new GtkSource.View();
641 this.loading = false;
642 this.zallow_node_scroll = true;
643 this.prop_selected = "";
645 // set gobject values
646 this.el.name = "gtkview-view";
647 this.el.editable = false;
648 this.el.show_line_marks = true;
649 this.el.show_line_numbers = true;
650 this.el.tab_width = 4;
651 new Xcls_buffer( _this );
652 this.el.set_buffer ( _this.buffer.el );
653 var child_2 = new Xcls_EventControllerKey12( _this );
655 this.el.add_controller( child_2.el );
662 this.css = new Gtk.CssProvider();
664 this.css.load_from_string("#gtkview-view { font: 10px monospace ;}");
666 Gtk.StyleContext.add_provider_for_display(
667 this.el.get_display(),
669 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
677 var attrs = new GtkSource.MarkAttributes();
678 var pink = Gdk.RGBA();
679 pink.parse ( "pink");
680 attrs.set_background ( pink);
681 attrs.set_icon_name ( "process-stop");
682 attrs.query_tooltip_text.connect(( mark) => {
683 //print("tooltip query? %s\n", mark.name);
687 this.el.set_mark_attributes ("ERR", attrs, 1);
689 var wattrs = new GtkSource.MarkAttributes();
690 var blue = Gdk.RGBA();
691 blue.parse ( "#ABF4EB");
692 wattrs.set_background ( blue);
693 wattrs.set_icon_name ( "process-stop");
694 wattrs.query_tooltip_text.connect(( mark) => {
695 //print("tooltip query? %s\n", mark.name);
699 this.el.set_mark_attributes ("WARN", wattrs, 1);
703 var dattrs = new GtkSource.MarkAttributes();
704 var purple = Gdk.RGBA();
705 purple.parse ( "#EEA9FF");
706 dattrs.set_background ( purple);
707 dattrs.set_icon_name ( "process-stop");
708 dattrs.query_tooltip_text.connect(( mark) => {
709 //print("tooltip query? %s\n", mark.name);
713 this.el.set_mark_attributes ("DEPR", dattrs, 1);
716 var gattrs = new GtkSource.MarkAttributes();
717 var grey = Gdk.RGBA();
718 grey.parse ( "#ccc");
719 gattrs.set_background ( grey);
722 this.el.set_mark_attributes ("grey", gattrs, 1);
732 this.el.query_tooltip.connect( (x, y, keyboard_tooltip, tooltip) => {
734 //GLib.debug("query tooltip");
738 var yoff = (int) _this.sourceviewscroll.el.vadjustment.value;
740 this.el.get_iter_at_position (out iter, out trailing, x, y + yoff);
742 var l = iter.get_line();
743 // GLib.debug("query tooltip line %d", (int) l);
744 var marks = _this.buffer.el.get_source_marks_at_line(l, "ERR");
745 if (marks.is_empty()) {
746 marks = _this.buffer.el.get_source_marks_at_line(l, "WARN");
748 if (marks.is_empty()) {
749 marks = _this.buffer.el.get_source_marks_at_line(l, "DEPR");
752 // GLib.debug("query tooltip line marks %d", (int) marks.length());
754 marks.@foreach((m) => {
755 //GLib.debug("got mark %s", m.name);
756 str += (str.length > 0 ? "\n" : "") + m.name;
759 // true if there is a mark..
760 tooltip.set_text( str);
761 return str.length > 0 ? true : false;
766 // user defined functions
767 public void loadFile ( ) {
769 var buf = this.el.get_buffer();
771 var sbuf = (GtkSource.Buffer) buf;
772 var cpos = buf.cursor_position;
774 print("BEFORE LOAD cursor = %d\n", cpos);
775 var vadj_pos = this.el.get_vadjustment().get_value();
777 if (_this.file == null || _this.file.xtype != "Gtk") {
778 print("xtype != Gtk");
779 this.loading = false;
785 var regex = new Regex("\\.bjs$");
788 valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
789 } catch (GLib.RegexError e) {
790 this.loading = false;
795 if (!FileUtils.test(valafn,FileTest.IS_REGULAR) ) {
796 print("File path has no errors\n");
797 this.loading = false;
804 GLib.FileUtils.get_contents (valafn, out str);
806 this.loading = false;
810 var str = _this.file.toSource();
812 // print("setting str %d\n", str.length);
813 buf.set_text(str, str.length);
814 var lm = GtkSource.LanguageManager.get_default();
816 //?? is javascript going to work as js?
818 ((GtkSource.Buffer)(buf)) .set_language(lm.get_language(_this.file.language));
821 _this.main_window.windowstate.updateErrorMarksAll();
822 // restore the cursor position?
823 // after reloading the contents.
824 GLib.Timeout.add(500, () => {
825 _this.buffer.in_cursor_change = true;
826 print("RESORTING cursor to = %d\n", cpos);
827 Gtk.TextIter cpos_iter;
828 buf.get_iter_at_offset(out cpos_iter, cpos);
829 buf.place_cursor(cpos_iter);
831 this.el.get_vadjustment().set_value(vadj_pos);;
832 _this.buffer.in_cursor_change = false;
836 //_this.buffer.checkSyntax();
841 this.loading = false;
843 public void nodeSelected (JsRender.Node? sel, bool scroll) {
849 // this is connected in widnowstate
850 print("Roo-view - node selected\n");
851 var buf = this.el.get_buffer();
853 var sbuf = (GtkSource.Buffer) buf;
859 // clear all the marks..
863 sbuf.get_bounds (out start, out end);
864 sbuf.remove_source_marks (start, end, "grey");
866 this.node_selected = sel;
872 sbuf.get_iter_at_line(out iter, sel.line_start);
875 Gtk.TextIter cur_iter;
876 sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);
879 if (!_this.buffer.in_cursor_change) {
881 this.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);
886 for (var i = 0; i < buf.get_line_count();i++) {
887 if (i < sel.line_start || i > sel.line_end) {
889 sbuf.get_iter_at_line(out iter, i);
890 sbuf.create_source_mark(null, "grey", iter);
898 public string toString () {
901 this.el.get_buffer().get_start_iter(out s);
902 this.el.get_buffer().get_end_iter(out e);
903 var ret = this.el.get_buffer().get_text(s,e,true);
904 //print("TO STRING? " + ret);
908 public class Xcls_buffer : Object
910 public GtkSource.Buffer el;
911 private Xcls_GtkView _this;
915 public int error_line;
916 public bool in_cursor_change;
918 public int last_line;
921 public Xcls_buffer(Xcls_GtkView _owner )
925 this.el = new GtkSource.Buffer( null );
928 this.error_line = -1;
929 this.in_cursor_change = false;
933 // set gobject values
936 this.el.cursor_moved.connect( ( ) => {
937 GLib.debug("cursor moved called");
940 if (this.in_cursor_change ) {
941 GLib.debug("cursor changed : %d [ignoring nested call)", this.el.cursor_position);
945 GLib.debug("cursor changed : %d", this.el.cursor_position);
947 this.el.get_iter_at_offset(out cpos, this.el.cursor_position);
949 var ln = cpos.get_line();
950 if (this.last_line == ln ){
954 var node = _this.file.lineToNode(ln);
957 print("can not find node\n");
960 this.in_cursor_change = true;
961 var ltree = _this.main_window.windowstate.left_tree;
962 ltree.model.selectNode(node);
963 this.in_cursor_change = false;
967 // user defined functions
970 public class Xcls_EventControllerKey12 : Object
972 public Gtk.EventControllerKey el;
973 private Xcls_GtkView _this;
979 public Xcls_EventControllerKey12(Xcls_GtkView _owner )
982 this.el = new Gtk.EventControllerKey();
986 // set gobject values
989 this.el.key_pressed.connect( (keyval, keycode, state) => {
993 if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
994 GLib.debug("SAVE: ctrl-g pressed");
995 _this.forwardSearch(true);
998 if (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
999 GLib.debug("SAVE: ctrl-f pressed");
1000 _this.search_entry.el.grab_focus();
1008 // user defined functions
1013 public class Xcls_Box13 : Object
1016 private Xcls_GtkView _this;
1022 public Xcls_Box13(Xcls_GtkView _owner )
1025 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1029 // set gobject values
1030 this.el.homogeneous = false;
1031 this.el.vexpand = false;
1032 new Xcls_search_entry( _this );
1033 this.el.append( _this.search_entry.el );
1034 new Xcls_search_results( _this );
1035 this.el.append( _this.search_results.el );
1036 new Xcls_nextBtn( _this );
1037 this.el.append( _this.nextBtn.el );
1038 new Xcls_backBtn( _this );
1039 this.el.append( _this.backBtn.el );
1040 var child_5 = new Xcls_MenuButton19( _this );
1042 this.el.append( child_5.el );
1045 // user defined functions
1047 public class Xcls_search_entry : Object
1049 public Gtk.SearchEntry el;
1050 private Xcls_GtkView _this;
1054 public Gtk.CssProvider css;
1057 public Xcls_search_entry(Xcls_GtkView _owner )
1060 _this.search_entry = this;
1061 this.el = new Gtk.SearchEntry();
1065 // set gobject values
1066 this.el.name = "gtkview-search-entry";
1067 this.el.hexpand = true;
1068 this.el.placeholder_text = "Press enter to search";
1069 this.el.search_delay = 3;
1070 var child_1 = new Xcls_EventControllerKey15( _this );
1072 this.el.add_controller( child_1.el );
1076 this.css = new Gtk.CssProvider();
1078 this.css.load_from_string("
1079 #gtkview-search-entry { font: 10px monospace ;}"
1082 Gtk.StyleContext.add_provider_for_display(
1083 this.el.get_display(),
1085 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
1089 this.el.search_changed.connect( () => {
1091 _this.search(_this.search_entry.el.text);
1092 _this.search_results.updateResults();
1094 GLib.Timeout.add_seconds(1,() => {
1095 _this.search_results.updateResults();
1104 // user defined functions
1105 public void forwardSearch (bool change_focus) {
1108 _this.forwardSearch(change_focus);
1112 switch(_this.windowstate.state) {
1113 case WindowState.State.CODEONLY:
1114 //case WindowState.State.CODE:
1115 // search the code being edited..
1116 _this.windowstate.code_editor_tab.forwardSearch(change_focus);
1119 case WindowState.State.PREVIEW:
1120 if (_this.windowstate.file.xtype == "Gtk") {
1121 _this.windowstate.window_gladeview.forwardSearch(change_focus);
1123 _this.windowstate.window_rooview.forwardSearch(change_focus);
1132 public class Xcls_EventControllerKey15 : Object
1134 public Gtk.EventControllerKey el;
1135 private Xcls_GtkView _this;
1141 public Xcls_EventControllerKey15(Xcls_GtkView _owner )
1144 this.el = new Gtk.EventControllerKey();
1148 // set gobject values
1151 this.el.key_pressed.connect( (keyval, keycode, state) => {
1153 if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
1154 GLib.debug("SAVE: ctrl-g pressed");
1155 _this.forwardSearch(true);
1160 if (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {
1161 _this.forwardSearch(true);
1167 // print(event.key.keyval)
1173 // user defined functions
1177 public class Xcls_search_results : Object
1179 public Gtk.Label el;
1180 private Xcls_GtkView _this;
1186 public Xcls_search_results(Xcls_GtkView _owner )
1189 _this.search_results = this;
1190 this.el = new Gtk.Label( "No Results" );
1194 // set gobject values
1195 this.el.margin_end = 4;
1196 this.el.margin_start = 4;
1199 // user defined functions
1200 public void updateResults () {
1201 this.el.visible = true;
1203 var res = _this.searchcontext.get_occurrences_count();
1205 _this.search_results.el.label = "??? Matches";
1209 _this.nextBtn.el.sensitive = false;
1210 _this.backBtn.el.sensitive = false;
1213 _this.search_results.el.label = "%d Matches".printf(res);
1214 _this.nextBtn.el.sensitive = true;
1215 _this.backBtn.el.sensitive = true;
1218 _this.search_results.el.label = "No Matches";
1223 public class Xcls_nextBtn : Object
1225 public Gtk.Button el;
1226 private Xcls_GtkView _this;
1230 public bool always_show_image;
1233 public Xcls_nextBtn(Xcls_GtkView _owner )
1236 _this.nextBtn = this;
1237 this.el = new Gtk.Button();
1240 this.always_show_image = true;
1242 // set gobject values
1243 this.el.icon_name = "go-down";
1244 this.el.sensitive = false;
1247 this.el.clicked.connect( ( ) => {
1248 _this.forwardSearch(true);
1254 // user defined functions
1257 public class Xcls_backBtn : Object
1259 public Gtk.Button el;
1260 private Xcls_GtkView _this;
1264 public bool always_show_image;
1267 public Xcls_backBtn(Xcls_GtkView _owner )
1270 _this.backBtn = this;
1271 this.el = new Gtk.Button();
1274 this.always_show_image = true;
1276 // set gobject values
1277 this.el.icon_name = "go-up";
1278 this.el.sensitive = false;
1281 this.el.clicked.connect( ( ) => {
1283 _this.backSearch(true);
1288 // user defined functions
1291 public class Xcls_MenuButton19 : Object
1293 public Gtk.MenuButton el;
1294 private Xcls_GtkView _this;
1298 public bool always_show_image;
1301 public Xcls_MenuButton19(Xcls_GtkView _owner )
1304 this.el = new Gtk.MenuButton();
1307 this.always_show_image = true;
1309 // set gobject values
1310 this.el.icon_name = "emblem-system";
1311 this.el.always_show_arrow = true;
1312 new Xcls_search_settings( _this );
1313 this.el.popover = _this.search_settings.el;
1316 // user defined functions
1318 public class Xcls_search_settings : Object
1320 public Gtk.PopoverMenu el;
1321 private Xcls_GtkView _this;
1327 public Xcls_search_settings(Xcls_GtkView _owner )
1330 _this.search_settings = this;
1331 this.el = new Gtk.PopoverMenu.from_model(null);
1335 // set gobject values
1336 var child_1 = new Xcls_Box21( _this );
1338 this.el.set_child ( child_1.el );
1341 // user defined functions
1343 public class Xcls_Box21 : Object
1346 private Xcls_GtkView _this;
1352 public Xcls_Box21(Xcls_GtkView _owner )
1355 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1359 // set gobject values
1360 new Xcls_case_sensitive( _this );
1361 this.el.append( _this.case_sensitive.el );
1362 new Xcls_regex( _this );
1363 this.el.append( _this.regex.el );
1364 new Xcls_multiline( _this );
1365 this.el.append( _this.multiline.el );
1368 // user defined functions
1370 public class Xcls_case_sensitive : Object
1372 public Gtk.CheckButton el;
1373 private Xcls_GtkView _this;
1379 public Xcls_case_sensitive(Xcls_GtkView _owner )
1382 _this.case_sensitive = this;
1383 this.el = new Gtk.CheckButton();
1387 // set gobject values
1388 this.el.label = "Case Sensitive";
1391 // user defined functions
1394 public class Xcls_regex : Object
1396 public Gtk.CheckButton el;
1397 private Xcls_GtkView _this;
1403 public Xcls_regex(Xcls_GtkView _owner )
1407 this.el = new Gtk.CheckButton();
1411 // set gobject values
1412 this.el.label = "Regex";
1415 // user defined functions
1418 public class Xcls_multiline : Object
1420 public Gtk.CheckButton el;
1421 private Xcls_GtkView _this;
1427 public Xcls_multiline(Xcls_GtkView _owner )
1430 _this.multiline = this;
1431 this.el = new Gtk.CheckButton();
1435 // set gobject values
1436 this.el.label = "Multi-line (add \\n)";
1439 // user defined functions