3 public class Editor : Object
8 public static Editor singleton()
10 if (_Editor == null) {
11 _Editor= new Editor();
15 public Xcls_save_button save_button;
16 public Xcls_close_btn close_btn;
17 public Xcls_RightEditor RightEditor;
18 public Xcls_view view;
19 public Xcls_buffer buffer;
20 public Xcls_search_entry search_entry;
21 public Xcls_search_results search_results;
22 public Xcls_nextBtn nextBtn;
23 public Xcls_backBtn backBtn;
24 public Xcls_search_settings search_settings;
25 public Xcls_case_sensitive case_sensitive;
26 public Xcls_regex regex;
27 public Xcls_multiline multiline;
30 public Xcls_MainWindow window;
31 public int pos_root_x;
33 public int pos_root_y;
35 public Gtk.SourceSearchContext searchcontext;
36 public int last_search_end;
37 public JsRender.NodeProp? prop;
38 public JsRender.JsRender? file;
39 public JsRender.Node node;
40 public signal void save ();
41 public string activeEditor;
47 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
53 this.searchcontext = null;
54 this.last_search_end = 0;
58 this.activeEditor = "";
61 this.el.homogeneous = false;
62 this.el.hexpand = true;
63 this.el.vexpand = true;
64 var child_0 = new Xcls_Box2( _this );
66 this.el.pack_start ( child_0.el , false,true );
67 var child_1 = new Xcls_RightEditor( _this );
69 this.el.add( child_1.el );
70 var child_2 = new Xcls_Box12( _this );
72 this.el.add( child_2.el );
75 // user defined functions
76 public bool saveContents () {
79 if (_this.file == null) {
85 var str = _this.buffer.toString();
87 _this.buffer.checkSyntax();
91 // LeftPanel.model.changed( str , false);
93 _this.save_button.el.sensitive = false;
95 // find the text for the node..
96 if (_this.file.xtype != "PlainFile") {
97 // in theory these properties have to exist!?!
99 this.window.windowstate.left_props.reload();
101 _this.file.setSource( str );
110 public void forwardSearch (bool change_focus) {
112 if (this.searchcontext == null) {
116 Gtk.TextIter beg, st,en;
117 bool has_wrapped_around;
118 this.buffer.el.get_iter_at_offset(out beg, this.last_search_end);
119 if (!this.searchcontext.forward2(beg, out st, out en, out has_wrapped_around)) {
121 this.last_search_end = 0; // not sure if this should happen
123 if (has_wrapped_around) {
127 this.last_search_end = en.get_offset();
129 this.view.el.grab_focus();
131 this.buffer.el.place_cursor(st);
132 this.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);
136 public void show (JsRender.JsRender file, JsRender.Node? node, JsRender.NodeProp? prop)
141 if (file.xtype != "PlainFile") {
145 // find the text for the node..
146 this.view.load( prop.val );
147 this.close_btn.el.show();
150 this.view.load( file.toSource() );
151 this.close_btn.el.hide();
155 public void backSearch (bool change_focus) {
157 if (this.searchcontext == null) {
161 Gtk.TextIter beg, st,en;
162 bool has_wrapped_around;
163 this.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );
165 if (!this.searchcontext.backward2(beg, out st, out en, out has_wrapped_around)) {
167 this.last_search_end = 0;
169 this.last_search_end = en.get_offset();
171 this.view.el.grab_focus();
173 this.buffer.el.place_cursor(st);
174 this.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);
178 public int search (string in_txt) {
180 var s = new Gtk.SourceSearchSettings();
181 s.case_sensitive = _this.case_sensitive.el.active;
182 s.regex_enabled = _this.regex.el.active;
183 s.wrap_around = false;
185 this.searchcontext = new Gtk.SourceSearchContext(this.buffer.el,s);
186 this.searchcontext.set_highlight(true);
189 if (_this.multiline.el.active) {
190 txt = in_txt.replace("\\n", "\n");
193 s.set_search_text(txt);
194 Gtk.TextIter beg, st,en;
196 this.buffer.el.get_start_iter(out beg);
197 bool has_wrapped_around;
198 this.searchcontext.forward2(beg, out st, out en, out has_wrapped_around);
199 this.last_search_end = 0;
201 return this.searchcontext.get_occurrences_count();
207 public void reset () {
212 this.searchcontext = null;
215 public void scroll_to_line (int line) {
217 GLib.Timeout.add(500, () => {
219 var buf = this.view.el.get_buffer();
221 var sbuf = (Gtk.SourceBuffer) buf;
225 sbuf.get_iter_at_line(out iter, line);
226 this.view.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);
230 public class Xcls_Box2 : Object
233 private Editor _this;
239 public Xcls_Box2(Editor _owner )
242 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
246 // set gobject values
247 this.el.homogeneous = false;
248 var child_0 = new Xcls_save_button( _this );
250 this.el.add ( child_0.el );
251 var child_1 = new Xcls_Label5( _this );
253 this.el.add ( child_1.el );
254 var child_2 = new Xcls_Scale6( _this );
256 this.el.add ( child_2.el );
257 var child_3 = new Xcls_close_btn( _this );
259 this.el.add ( child_3.el );
262 // user defined functions
264 public class Xcls_save_button : Object
266 public Gtk.Button el;
267 private Editor _this;
273 public Xcls_save_button(Editor _owner )
276 _this.save_button = this;
277 this.el = new Gtk.Button();
281 // set gobject values
282 this.el.always_show_image = true;
283 this.el.label = "Save";
284 var child_0 = new Xcls_Image4( _this );
286 this.el.image = child_0.el;
289 this.el.clicked.connect( () => {
290 _this.saveContents();
294 // user defined functions
296 public class Xcls_Image4 : Object
299 private Editor _this;
305 public Xcls_Image4(Editor _owner )
308 this.el = new Gtk.Image();
312 // set gobject values
313 this.el.icon_name = "document-save";
316 // user defined functions
320 public class Xcls_Label5 : Object
323 private Editor _this;
329 public Xcls_Label5(Editor _owner )
332 this.el = new Gtk.Label( null );
336 // set gobject values
337 this.el.hexpand = true;
340 // user defined functions
343 public class Xcls_Scale6 : Object
346 private Editor _this;
352 public Xcls_Scale6(Editor _owner )
355 this.el = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL,6, 30, 1);
359 // set gobject values
360 this.el.width_request = 200;
361 this.el.has_origin = true;
362 this.el.draw_value = true;
364 this.el.sensitive = true;
369 this.el.set_range(6,30);
370 this.el.set_value(8);
374 this.el.change_value.connect( (st, val ) => {
377 _this.view.css.load_from_data(
378 "#editor-view { font: %dpx Monospace; }".printf((int)val)
385 // user defined functions
388 public class Xcls_close_btn : Object
390 public Gtk.Button el;
391 private Editor _this;
397 public Xcls_close_btn(Editor _owner )
400 _this.close_btn = this;
401 this.el = new Gtk.Button();
405 // set gobject values
406 this.el.always_show_image = true;
407 var child_0 = new Xcls_Image8( _this );
409 this.el.image = child_0.el;
412 this.el.clicked.connect( () => {
413 _this.saveContents();
414 _this.window.windowstate.switchState(WindowState.State.PREVIEW);
418 // user defined functions
420 public class Xcls_Image8 : Object
423 private Editor _this;
429 public Xcls_Image8(Editor _owner )
432 this.el = new Gtk.Image();
436 // set gobject values
437 this.el.icon_name = "window-close";
440 // user defined functions
445 public class Xcls_RightEditor : Object
447 public Gtk.ScrolledWindow el;
448 private Editor _this;
454 public Xcls_RightEditor(Editor _owner )
457 _this.RightEditor = this;
458 this.el = new Gtk.ScrolledWindow( null, null );
462 // set gobject values
463 this.el.vexpand = true;
464 var child_0 = new Xcls_view( _this );
466 this.el.add ( child_0.el );
470 this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
473 // user defined functions
475 public class Xcls_view : Object
477 public Gtk.SourceView el;
478 private Editor _this;
482 public Gtk.CssProvider css;
485 public Xcls_view(Editor _owner )
489 this.el = new Gtk.SourceView();
494 // set gobject values
495 this.el.auto_indent = true;
496 this.el.indent_width = 4;
497 this.el.name = "editor-view";
498 this.el.show_line_marks = true;
499 this.el.insert_spaces_instead_of_tabs = true;
500 this.el.show_line_numbers = true;
501 this.el.tab_width = 4;
502 this.el.highlight_current_line = true;
503 var child_0 = new Xcls_buffer( _this );
505 this.el.set_buffer ( child_0.el );
509 this.css = new Gtk.CssProvider();
511 this.css.load_from_data("#editor-view { font: 10px Monospace;}");
513 this.el.get_style_context().add_provider(this.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
518 this.el.completion.add_provider(new Palete.CompletionProvider(_this));
519 } catch (GLib.Error e) {}
521 this.el.completion.unblock_interactive();
522 this.el.completion.select_on_show = true; // select
523 this.el.completion.show_headers = false;
524 this.el.completion.remember_info_visibility = true;
527 var attrs = new Gtk.SourceMarkAttributes();
528 var pink = Gdk.RGBA();
529 pink.parse ( "pink");
530 attrs.set_background ( pink);
531 attrs.set_icon_name ( "process-stop");
532 attrs.query_tooltip_text.connect(( mark) => {
533 //print("tooltip query? %s\n", mark.name);
537 this.el.set_mark_attributes ("ERR", attrs, 1);
539 var wattrs = new Gtk.SourceMarkAttributes();
540 var blue = Gdk.RGBA();
541 blue.parse ( "#ABF4EB");
542 wattrs.set_background ( blue);
543 wattrs.set_icon_name ( "process-stop");
544 wattrs.query_tooltip_text.connect(( mark) => {
545 //print("tooltip query? %s\n", mark.name);
549 this.el.set_mark_attributes ("WARN", wattrs, 1);
553 var dattrs = new Gtk.SourceMarkAttributes();
554 var purple = Gdk.RGBA();
555 purple.parse ( "#EEA9FF");
556 dattrs.set_background ( purple);
557 dattrs.set_icon_name ( "process-stop");
558 dattrs.query_tooltip_text.connect(( mark) => {
559 //print("tooltip query? %s\n", mark.name);
563 this.el.set_mark_attributes ("DEPR", dattrs, 1);
566 this.el.get_space_drawer().set_matrix(null);
567 this.el.get_space_drawer().set_types_for_locations(
568 Gtk.SourceSpaceLocationFlags.ALL,
569 Gtk.SourceSpaceTypeFlags.ALL
571 this.el.get_space_drawer().set_enable_matrix(true);
573 Gtk.SourceDrawSpacesFlags.LEADING +
574 Gtk.SourceDrawSpacesFlags.TRAILING +
575 Gtk.SourceDrawSpacesFlags.TAB +
576 Gtk.SourceDrawSpacesFlags.SPACE
580 this.el.key_release_event.connect( (event) => {
582 if (event.keyval == Gdk.Key.s && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
583 GLib.debug("SAVE: ctrl-S pressed");
584 _this.saveContents();
588 if (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
589 GLib.debug("SAVE: ctrl-g pressed");
590 _this.forwardSearch(true);
593 if (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
594 GLib.debug("SAVE: ctrl-f pressed");
595 _this.search_entry.el.grab_focus();
599 // print(event.key.keyval)
606 // user defined functions
607 public void load (string str) {
609 // show the help page for the active node..
610 //this.get('/Help').show();
613 // this.get('/BottomPane').el.set_current_page(0);
614 var buf = (Gtk.SourceBuffer)this.el.get_buffer();
615 buf.set_text(str, str.length);
616 buf.set_undo_manager(null);
618 var lm = Gtk.SourceLanguageManager.get_default();
620 if (_this.file != null) {
621 lang = _this.file.language;
623 print("lang=%s, content_type = %s\n", lang, _this.file.content_type);
624 var lg = _this.file.content_type.length > 0 ?
625 lm.guess_language(_this.file.path, _this.file.content_type) :
626 lm.get_language(lang);
629 ((Gtk.SourceBuffer)(this.el.get_buffer())) .set_language(lg);
631 this.el.insert_spaces_instead_of_tabs = true;
633 print("sourcelanguage = %s\n", lg.name);
634 if (lg.name == "Vala") {
635 this.el.insert_spaces_instead_of_tabs = false;
639 this.el.grab_focus();
640 _this.save_button.el.sensitive = false;
643 public class Xcls_buffer : Object
645 public Gtk.SourceBuffer el;
646 private Editor _this;
650 public int error_line;
651 public bool check_queued;
652 public bool check_running;
655 public Xcls_buffer(Editor _owner )
659 this.el = new Gtk.SourceBuffer( null );
662 this.error_line = -1;
663 this.check_queued = false;
664 this.check_running = false;
666 // set gobject values
669 this.el.changed.connect( () => {
672 _this.save_button.el.sensitive = true;
673 print("EDITOR CHANGED");
678 // this.get('/LeftPanel.model').changed( str , false);
683 // user defined functions
684 public bool checkSyntax () {
686 if (this.check_running) {
687 print("Check is running\n");
688 if (this.check_queued) {
689 print("Check is already queued");
692 this.check_queued = true;
693 print("Adding queued Check ");
694 GLib.Timeout.add_seconds(1, () => {
695 this.check_queued = false;
704 var str = this.toString();
707 if (this.error_line > 0) {
710 this.el.get_bounds (out start, out end);
712 this.el.remove_source_marks (start, end, null);
714 if (str.length < 1) {
715 print("checkSyntax - empty string?\n");
719 if (_this.file.xtype == "PlainFile") {
721 // assume it's gtk...
722 this.check_running = true;
724 if (!BuilderApplication.valasource.checkPlainFileSpawn(
728 this.check_running = false;
734 if (_this.file == null) {
737 var p = _this.file.project.palete;
741 this.check_running = true;
744 if (_this.file.language == "js") {
745 this.check_running = false;
746 print("calling validate javascript\n");
747 Gee.HashMap<int,string> errors;
748 p.javascriptHasErrors(
749 _this.window.windowstate,
752 _this.file, // no reference not node?
755 return this.highlightErrors(errors);
760 print("calling validate vala\n");
761 // clear the buttons.
764 if (! BuilderApplication.valasource.checkFileWithNodePropChange(
770 this.check_running = false;
775 //print("done mark line\n");
777 return true; // at present allow saving - even if it's invalid..
779 public bool highlightErrorsJson (string type, Json.Object obj) {
782 this.el.get_bounds (out start, out end);
784 this.el.remove_source_marks (start, end, type);
787 // we should highlight other types of errors..
789 if (!obj.has_member(type)) {
790 print("Return has no errors\n");
794 if (_this.window.windowstate.state != WindowState.State.CODEONLY
801 var err = obj.get_object_member(type);
804 if (_this.file == null) {
808 var valafn = _this.file.path;
810 if (_this.file.xtype != "PlainFile") {
817 var regex = new Regex("\\.bjs$");
821 valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
822 } catch (GLib.RegexError e) {
829 if (!err.has_member(valafn)) {
830 print("File path has no errors\n");
834 var lines = err.get_object_member(valafn);
837 if (obj.has_member("line_offset")) {
838 offset = (int)obj.get_int_member("line_offset") + 1;
844 var tlines = this.el.get_line_count () +1;
846 lines.foreach_member((obj, line, node) => {
849 // print("get inter\n");
850 var eline = int.parse(line) - offset;
851 print("GOT ERROR on line %s -- converted to %d\n", line,eline);
854 if (eline > tlines || eline < 0) {
857 this.el.get_iter_at_line( out iter, eline);
858 //print("mark line\n");
859 var msg = "Line: %d".printf(eline+1);
860 var ar = lines.get_array_member(line);
861 for (var i = 0 ; i < ar.get_length(); i++) {
862 msg += (msg.length > 0) ? "\n" : "";
863 msg += ar.get_string_element(i);
867 this.el.create_source_mark(msg, type, iter);
876 public bool highlightErrors ( Gee.HashMap<int,string> validate_res) {
878 this.error_line = validate_res.size;
880 if (this.error_line < 1) {
883 var tlines = this.el.get_line_count ();
885 var valiter = validate_res.map_iterator();
886 while (valiter.next()) {
888 // print("get inter\n");
889 var eline = valiter.get_key();
890 if (eline > tlines) {
893 this.el.get_iter_at_line( out iter, eline);
894 //print("mark line\n");
895 this.el.create_source_mark(valiter.get_value(), "ERR", iter);
899 public string toString () {
903 this.el.get_start_iter(out s);
904 this.el.get_end_iter(out e);
905 var ret = this.el.get_text(s,e,true);
906 //print("TO STRING? " + ret);
913 public class Xcls_Box12 : Object
916 private Editor _this;
922 public Xcls_Box12(Editor _owner )
925 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
929 // set gobject values
930 this.el.homogeneous = false;
931 this.el.vexpand = false;
932 var child_0 = new Xcls_search_entry( _this );
934 this.el.add( child_0.el );
935 var child_1 = new Xcls_MenuBar14( _this );
937 this.el.add ( child_1.el );
938 var child_2 = new Xcls_nextBtn( _this );
940 this.el.add( child_2.el );
941 var child_3 = new Xcls_backBtn( _this );
943 this.el.add( child_3.el );
944 var child_4 = new Xcls_MenuButton20( _this );
946 this.el.add( child_4.el );
949 // user defined functions
951 public class Xcls_search_entry : Object
953 public Gtk.SearchEntry el;
954 private Editor _this;
960 public Xcls_search_entry(Editor _owner )
963 _this.search_entry = this;
964 this.el = new Gtk.SearchEntry();
968 // set gobject values
969 this.el.width_request = 300;
970 this.el.hexpand = true;
971 this.el.placeholder_text = "Press enter to search";
975 var description = Pango.FontDescription.from_string("monospace");
976 description.set_size(8000);
977 this.el.set_property("font-desc",description);
980 this.el.key_press_event.connect( (event) => {
981 if (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
982 GLib.debug("SAVE: ctrl-g pressed");
983 _this.forwardSearch(true);
988 if (event.keyval == Gdk.Key.Return && this.el.text.length > 0) {
990 _this.search(this.el.text);
991 _this.search_results.updateResults();
993 GLib.Timeout.add_seconds(2,() => {
994 _this.search_results.updateResults();
1002 // print(event.key.keyval)
1007 this.el.changed.connect( () => {
1009 if (this.el.text == "") {
1010 _this.search_results.el.hide();
1014 switch(_this.windowstate.state) {
1015 case WindowState.State.CODEONLY:
1016 ///case WindowState.State.CODE:
1017 // search the code being edited..
1018 res = _this.windowstate.code_editor_tab.search(this.el.text);
1021 case WindowState.State.PREVIEW:
1022 if (_this.windowstate.file.xtype == "Gtk") {
1023 res = _this.windowstate.window_gladeview.search(this.el.text);
1025 res = _this.windowstate.window_rooview.search(this.el.text);
1031 _this.search_results.el.show();
1033 _this.search_results.el.label = "%d Matches".printf(res);
1035 _this.search_results.el.label = "No Matches";
1043 // user defined functions
1044 public void forwardSearch (bool change_focus) {
1047 _this.forwardSearch(change_focus);
1051 switch(_this.windowstate.state) {
1052 case WindowState.State.CODEONLY:
1053 //case WindowState.State.CODE:
1054 // search the code being edited..
1055 _this.windowstate.code_editor_tab.forwardSearch(change_focus);
1058 case WindowState.State.PREVIEW:
1059 if (_this.windowstate.file.xtype == "Gtk") {
1060 _this.windowstate.window_gladeview.forwardSearch(change_focus);
1062 _this.windowstate.window_rooview.forwardSearch(change_focus);
1072 public class Xcls_MenuBar14 : Object
1074 public Gtk.MenuBar el;
1075 private Editor _this;
1081 public Xcls_MenuBar14(Editor _owner )
1084 this.el = new Gtk.MenuBar();
1088 // set gobject values
1089 var child_0 = new Xcls_search_results( _this );
1091 this.el.add ( child_0.el );
1094 // user defined functions
1096 public class Xcls_search_results : Object
1098 public Gtk.MenuItem el;
1099 private Editor _this;
1103 public bool always_show_image;
1106 public Xcls_search_results(Editor _owner )
1109 _this.search_results = this;
1110 this.el = new Gtk.MenuItem();
1113 this.always_show_image = true;
1115 // set gobject values
1116 this.el.visible = false;
1120 this.el.button_press_event.connect( () => {
1122 if (this.popup == null) {
1123 this.popup = new Xcls_ValaCompileErrors();
1124 this.popup.window = _this;
1128 this.popup.show(this.notices, this.el);
1134 // user defined functions
1135 public void updateResults () {
1136 this.el.visible = true;
1138 var res = _this.searchcontext.get_occurrences_count();
1140 _this.search_results.el.label = "??? Matches";
1144 _this.nextBtn.el.sensitive = false;
1145 _this.backBtn.el.sensitive = false;
1148 _this.search_results.el.label = "%d Matches".printf(res);
1149 _this.nextBtn.el.sensitive = true;
1150 _this.backBtn.el.sensitive = true;
1153 _this.search_results.el.label = "No Matches";
1159 public class Xcls_nextBtn : Object
1161 public Gtk.Button el;
1162 private Editor _this;
1168 public Xcls_nextBtn(Editor _owner )
1171 _this.nextBtn = this;
1172 this.el = new Gtk.Button();
1176 // set gobject values
1177 this.el.always_show_image = true;
1178 this.el.label = "Next";
1179 this.el.sensitive = false;
1180 var child_0 = new Xcls_Image17( _this );
1182 this.el.image = child_0.el;
1185 this.el.button_press_event.connect( (event) => {
1187 _this.forwardSearch(true);
1193 // user defined functions
1195 public class Xcls_Image17 : Object
1197 public Gtk.Image el;
1198 private Editor _this;
1204 public Xcls_Image17(Editor _owner )
1207 this.el = new Gtk.Image();
1211 // set gobject values
1212 this.el.icon_name = "go-down";
1215 // user defined functions
1219 public class Xcls_backBtn : Object
1221 public Gtk.Button el;
1222 private Editor _this;
1228 public Xcls_backBtn(Editor _owner )
1231 _this.backBtn = this;
1232 this.el = new Gtk.Button();
1236 // set gobject values
1237 this.el.always_show_image = true;
1238 this.el.label = "Previous";
1239 this.el.sensitive = false;
1240 var child_0 = new Xcls_Image19( _this );
1242 this.el.image = child_0.el;
1245 this.el.button_press_event.connect( (event) => {
1247 _this.backSearch(true);
1253 // user defined functions
1255 public class Xcls_Image19 : Object
1257 public Gtk.Image el;
1258 private Editor _this;
1264 public Xcls_Image19(Editor _owner )
1267 this.el = new Gtk.Image();
1271 // set gobject values
1272 this.el.icon_name = "go-up";
1275 // user defined functions
1279 public class Xcls_MenuButton20 : Object
1281 public Gtk.MenuButton el;
1282 private Editor _this;
1288 public Xcls_MenuButton20(Editor _owner )
1291 this.el = new Gtk.MenuButton();
1295 // set gobject values
1296 this.el.always_show_image = true;
1297 this.el.label = "Settings";
1298 var child_0 = new Xcls_Image21( _this );
1300 this.el.image = child_0.el;
1301 var child_1 = new Xcls_search_settings( _this );
1303 this.el.popup = child_1.el;
1306 // user defined functions
1308 public class Xcls_Image21 : Object
1310 public Gtk.Image el;
1311 private Editor _this;
1317 public Xcls_Image21(Editor _owner )
1320 this.el = new Gtk.Image();
1324 // set gobject values
1325 this.el.icon_name = "emblem-system";
1328 // user defined functions
1331 public class Xcls_search_settings : Object
1334 private Editor _this;
1340 public Xcls_search_settings(Editor _owner )
1343 _this.search_settings = this;
1344 this.el = new Gtk.Menu();
1348 // set gobject values
1349 var child_0 = new Xcls_case_sensitive( _this );
1351 this.el.append( child_0.el );
1352 var child_1 = new Xcls_regex( _this );
1354 this.el.append( child_1.el );
1355 var child_2 = new Xcls_multiline( _this );
1357 this.el.append( child_2.el );
1360 // user defined functions
1362 public class Xcls_case_sensitive : Object
1364 public Gtk.CheckMenuItem el;
1365 private Editor _this;
1371 public Xcls_case_sensitive(Editor _owner )
1374 _this.case_sensitive = this;
1375 this.el = new Gtk.CheckMenuItem();
1379 // set gobject values
1380 this.el.label = "Case Sensitive";
1390 // user defined functions
1393 public class Xcls_regex : Object
1395 public Gtk.CheckMenuItem el;
1396 private Editor _this;
1402 public Xcls_regex(Editor _owner )
1406 this.el = new Gtk.CheckMenuItem();
1410 // set gobject values
1411 this.el.label = "Regex";
1421 // user defined functions
1424 public class Xcls_multiline : Object
1426 public Gtk.CheckMenuItem el;
1427 private Editor _this;
1433 public Xcls_multiline(Editor _owner )
1436 _this.multiline = this;
1437 this.el = new Gtk.CheckMenuItem();
1441 // set gobject values
1442 this.el.label = "Multi-line (add \\n)";
1452 // user defined functions