4f8e5e481e2e6d7dc035e0b10dabec0e7318e961
[roobuilder] / src / Builder4 / ValaCompileResults.bjs
1 {
2  "build_module" : "builder",
3  "gen_extended" : false,
4  "items" : [
5   {
6    "$ xns" : "Gtk",
7    "Gtk.PositionType position" : "Gtk.PositionType.TOP",
8    "Xcls_MainWindow window" : "",
9    "bool active" : true,
10    "bool modal" : true,
11    "id" : "ValaCompileResults",
12    "int height_request" : 400,
13    "int width_request" : 600,
14    "items" : [
15     {
16      "$ xns" : "Gtk",
17      "* pack" : "set_child",
18      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
19      "bool hexpand" : true,
20      "bool vexpand" : true,
21      "gboolean homogeneous" : false,
22      "id" : "compile_view",
23      "items" : [
24       {
25        "$ xns" : "Gtk",
26        "* init" : [
27         "{",
28         " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
29         " ",
30         "",
31         "}",
32         ""
33        ],
34        "bool hexpand" : true,
35        "bool vexpand" : true,
36        "items" : [
37         {
38          "$ xns" : "GtkSource",
39          "* init" : [
40           "{",
41           "",
42           "   \tthis.css = new Gtk.CssProvider();",
43           "\t ",
44           "\tthis.css.load_from_string(",
45           "\t\t\"#compile-results-view { font: 10px monospace ;}\"",
46           "\t);",
47           "\t ",
48           "\t\t\tGtk.StyleContext.add_provider_for_display(",
49           "\t\tthis.el.get_display(),",
50           "\t\tthis.css,",
51           "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
52           "\t);",
53           "\t\t",
54           "",
55           "}",
56           ""
57          ],
58          "* prop" : "child",
59          "Gtk.CssProvider css" : "",
60          "bool editable" : false,
61          "bool hexpand" : true,
62          "bool show_line_numbers" : false,
63          "bool vexpand" : true,
64          "id" : "sourceview",
65          "string name" : "compile-results-view",
66          "xtype" : "View"
67         }
68        ],
69        "xtype" : "ScrolledWindow"
70       }
71      ],
72      "xtype" : "Box"
73     }
74    ],
75    "xtype" : "Popover",
76    "| void show" : [
77     "( Gtk.Widget onbtn, bool reset) {",
78     "\tvar win = this.window.el;",
79     "    var  w = win.get_width();",
80     "    var h = win.get_height();",
81     "",
82     "    // left tree = 250, editor area = 500?",
83     "    ",
84     "    var new_w = int.min(750, w-100);",
85     "    if (new_w > (w-100)) {",
86     "        new_w = w-100;",
87     "    }",
88     "    this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));",
89     " \tif (this.el.parent == null) {",
90     "\t\tthis.el.set_parent(win);",
91     "\t}",
92     "   // Gtk.Allocation rect;",
93     "\t//onbtn.get_allocation(out rect);",
94     "    //this.el.set_pointing_to(rect);",
95     "",
96     "    this.el.popup();",
97     "   // not sure why..",
98     "   ",
99     "   if (reset) {",
100     "\t\tvar buf = (GtkSource.Buffer)this.sourceview.el.get_buffer();",
101     "\t\tbuf.set_text(\"\",0);",
102     "\t}",
103     "   ",
104     "    ",
105     "    ",
106     "    ",
107     "}",
108     ""
109    ],
110    "| void xaddLine" : [
111     "(string str) {",
112     "\t/*",
113     "\tif (this.window.windowstate.project.path != BuilderApplication.valasource.file.project.path) {",
114     "\t\t// not our project.",
115     "\t\treturn;",
116     "\t}",
117     "\t",
118     "\t",
119     "\tvar buf = (GtkSource.Buffer)this.sourceview.el.get_buffer();",
120     "\tGtk.TextIter iter;",
121     "\tbuf.get_end_iter (out  iter);",
122     "\tbuf.insert(ref iter, str, str.length);",
123     "\t/// scroll..",
124     "\tbuf.get_end_iter (out  iter);",
125     "\tthis.sourceview.el.scroll_to_iter(iter, 0.0f, true, 0.0f, 1.0f);",
126     " */",
127     "}",
128     ""
129    ]
130   }
131  ],
132  "name" : "ValaCompileResults"
133 }