sq3: show SQLite error messages on stderr by default
[iv.d.git] / egra / test.d
blobae880b6e6b3c8d51228d1e79aacb6c4a4b347884
1 /* E-Mail Client
2 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
3 * Understanding is not required. Only obedience.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3 of the License ONLY.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 module test /*is aliced*/;
19 import arsd.simpledisplay;
21 import iv.bclamp;
22 import iv.cmdcon;
23 import iv.cmdcongl;
24 import iv.strex;
25 import iv.utfutil;
26 import iv.vfs.io;
27 import iv.vfs.util;
29 import iv.egra;
32 // ////////////////////////////////////////////////////////////////////////// //
33 static immutable string TestStyle = `
34 MainPaneWindow {
35 grouplist-divline: white;
36 grouplist-back: #222;
38 threadlist-divline: white;
39 threadlist-back: #222;
42 TitlerWindow {
43 frame: white;
44 title-back: white;
45 title-text: black;
47 back: rgb(0, 92, 0);
48 text: #7f0;
49 hotline: #7f0;
54 // ////////////////////////////////////////////////////////////////////////// //
55 //__gshared int lastWinWidth, lastWinHeight;
58 // ////////////////////////////////////////////////////////////////////////// //
59 public class TitlerWindow : SubWindow {
60 public:
61 LineEditWidget edtTitle;
62 LineEditWidget fromName;
63 LineEditWidget fromMail;
65 protected:
66 dynstring name;
67 dynstring mail;
68 dynstring folder;
69 dynstring title;
71 bool delegate (dynstring name, dynstring mail, dynstring folder, dynstring title) onSelected;
73 override void createWidgets () {
74 new SpacerWidget(2);
76 version(none) {
77 fromName = new LineEditWidget("Name:");
78 fromName.flex = 1;
80 new SpacerWidget(1);
81 fromMail = new LineEditWidget("Mail:");
82 fromMail.flex = 1;
84 new SpacerWidget(1);
85 edtTitle = new LineEditWidget("Title:");
86 edtTitle.flex = 1;
87 } else {
88 (new HBoxWidget).enter{
89 with (new HotLabelWidget("&Name:", LabelWidget.HAlign.Right)) { width = width+2; hsizeId = "editors"; }
90 new SpacerWidget(4);
91 fromName = new LineEditWidget();
92 fromName.flex = 1;
93 }.flex = 1;
95 new SpacerWidget(1);
96 (new HBoxWidget).enter{
97 with (new HotLabelWidget("&Mail:", LabelWidget.HAlign.Right)) { width = width+2; hsizeId = "editors"; }
98 new SpacerWidget(4);
99 fromMail = new LineEditWidget();
100 fromMail.flex = 1;
101 }.flex = 1;
103 new SpacerWidget(1);
104 (new HBoxWidget).enter{
105 with (new HotLabelWidget("&Title:", LabelWidget.HAlign.Right)) { width = width+2; hsizeId = "editors"; }
106 new SpacerWidget(4);
107 edtTitle = new LineEditWidget();
108 edtTitle.flex = 1;
109 }.flex = 1;
112 new SpacerWidget(4);
113 (new HBoxWidget).enter{
114 new SpacerWidget(2);
115 new SpringWidget(1);
116 with (new ButtonWidget(" O&k ")) {
117 hsizeId = "okcancel";
118 deftype = Default.Accept;
119 onAction = delegate (self) {
120 if (onSelected !is null) {
121 if (!onSelected(fromName.str, fromMail.str, folder, edtTitle.str)) return;
123 close();
126 new SpacerWidget(2);
127 with (new ButtonWidget(" Cancel ")) {
128 hsizeId = "okcancel";
129 deftype = Default.Cancel;
130 onAction = delegate (self) {
131 close();
134 new SpacerWidget(4);
135 with (new ButtonWidget(" ... ")) {
136 hsizeId = "okcancel";
137 hotkey = "M-L";
138 disabled = true;
140 new SpringWidget(1);
141 new SpacerWidget(2);
143 new SpacerWidget(4);
145 fromName.str = name;
146 fromMail.str = mail;
147 edtTitle.str = title;
149 relayoutResize();
150 centerWindow();
152 edtTitle.focus();
155 this (const(char)[] aname, const(char)[] amail, const(char)[] afolder, const(char)[] atitle) {
156 dynstring caption = "Title for "~aname~" <"~amail~">";
157 name = aname;
158 mail = amail;
159 folder = afolder;
160 title = atitle;
161 super(caption);
166 // ////////////////////////////////////////////////////////////////////////// //
167 public class TagOptionsWindow : SubWindow {
168 dynstring tagname;
170 void delegate (const(char)[] tagname) onUpdated;
172 this (const(char)[] atagname) {
173 tagname = atagname;
174 dynstring caption = "options for '"~atagname~"'";
175 super(caption);
178 override void createWidgets () {
179 LabelWidget optPath = new LabelWidget("", LabelWidget.HAlign.Center);
180 optPath.flex = 1;
182 LineEditWidget optMonthes;
183 (new HBoxWidget).enter{
184 with (new HotLabelWidget("&Monthes:", LabelWidget.HAlign.Right)) { width = width+2; /*hsizeId = "editors";*/ }
185 new SpacerWidget(4);
186 optMonthes = new LineEditWidget();
187 //optMonthes.flex = 1;
188 optMonthes.width = gxTextWidthUtf("96669");
189 conwriteln("ISMYSEL: ", optMonthes.isMySelector(" Widget#. "));
190 conwriteln("ISMYSEL: ", optMonthes.isMySelector(" HBoxWidget LineEditWidget#. "));
191 conwriteln("ISMYSEL: ", optMonthes.isMySelector(" HBoxWidget> #. "));
192 conwriteln("ISMYSEL: ", optMonthes.isMySelector(" SubWindow HBoxWidget LineEditWidget#. "));
193 //new SpringWidget(1);
194 }.flex = 1;
196 CheckboxWidget optThreaded = new CheckboxWidget("&Threaded");
197 optThreaded.flex = 1;
199 CheckboxWidget optAttaches = new CheckboxWidget("&Attaches");
200 optAttaches.flex = 1;
202 with (new RadioWidget("Radio &1")) {
203 rgroup = "rg1";
204 flex = 1;
205 id = "r1";
208 with (new RadioWidget("Radio &2")) {
209 rgroup = "rg1";
210 flex = 1;
211 checked = true;
212 id = "r2";
215 new SpacerWidget(4);
216 (new HBoxWidget).enter{
217 new SpacerWidget(2);
218 new SpringWidget(1);
219 with (new ButtonWidget(" O&k ")) {
220 hsizeId = "okcancel";
221 deftype = Default.Accept;
222 onAction = delegate (self) {
223 if (onUpdated !is null) onUpdated(tagname);
224 close();
225 auto rw = self.getSelectedRadio("rg1");
226 if (rw !is null) conwriteln("SELECTED RADIO: <", rw.id, ">");
229 new SpacerWidget(4);
230 with (new ButtonWidget(" Cancel ")) {
231 hsizeId = "okcancel";
232 deftype = Default.Cancel;
233 onAction = delegate (self) {
234 close();
237 new SpacerWidget(4);
238 with (new ButtonWidget(" ... ")) {
239 hsizeId = "okcancel";
240 hotkey = "M-L";
241 onAction = delegate (self) {
242 (new SelectCompletionWindow("", buildAutoCompletion("/home/ketmar/"), aspath:true)).onSelected = (str) {
243 conwriteln("SELECTED: <", str.getData, ">");
245 //close();
247 //disabled = true;
249 new SpringWidget(1);
250 new SpacerWidget(2);
252 new SpacerWidget(4);
254 optMonthes.focus();
256 optPath.text = "booPath";
257 optMonthes.str = "666";
259 optThreaded.enabled = false;
260 optAttaches.enabled = true;
262 optMonthes.killTextOnChar = true;
264 relayoutResize();
265 centerWindow();
266 //add(); // for "focused"
268 forEachSelector("SubWindow > RootWidget CheckboxWidget", (EgraStyledClass w) {
269 import iv.vfs.io; writeln("LEW=", typeid(w).name, "; text=", (cast(CheckboxWidget)w).title.getData);
270 //return false;
273 forEachSelector("SubWindow > RootWidget :focused", (EgraStyledClass w) {
274 import iv.vfs.io; writeln("FOCUSED=", typeid(w).name);
275 //return false;
278 foreach (HotLabelWidget c; querySelectorAll!HotLabelWidget("SubWindow > RootWidget HotLabelWidget")) {
279 import iv.vfs.io;
280 writeln("LBL: <", c.text.getData, ">");
283 { import iv.vfs.io;
284 Widget qf = querySelector(":focused");
285 if (qf !is null) writeln("QFOCUSED=", typeid(qf).name); else writeln("FUCK!");
290 // ////////////////////////////////////////////////////////////////////////// //
291 void initConsole () {
292 // //////////////////////////////////////////////////////////////////// //
293 conRegFunc!(() {
294 import core.memory : GC;
295 conwriteln("starting GC collection...");
296 GC.collect();
297 GC.minimize();
298 conwriteln("GC collection complete.");
299 })("gc_collect", "force GC collection cycle");
302 // //////////////////////////////////////////////////////////////////// //
303 conRegFunc!(() {
304 auto qww = new YesNoWindow("Quit?", "Do you really want to quit?", true);
305 qww.onYes = () { concmd("quit"); };
306 qww.addModal();
307 })("quit_prompt", "quit with prompt");
309 conRegFunc!(() {
310 new TitlerWindow("name", "mail", "folder", "title");
311 })("window_titler", "titler window test");
313 conRegFunc!(() {
314 new TagOptionsWindow("xtag");
315 })("window_tagoptions", "tag options window test");
319 // ////////////////////////////////////////////////////////////////////////// //
320 __gshared MainPaneWindow mainPane;
323 final class MainPaneWindow : SubWindow {
324 ProgressBarWidget pbar;
325 int tessType = -1;
326 AGGTesselation deftess;
327 bool timetest;
328 int lastMX = -10000, lastMY = -10000;
330 this () {
331 super(null, GxPoint(0, 0), GxSize(screenWidth, screenHeight));
332 mType = Type.OnBottom;
334 pbar = new ProgressBarWidget(rootWidget, "progress bar");
335 pbar.setMinMax(0, 100);
336 pbar.width = clientWidth-64;
337 pbar.current = 50;
338 pbar.posy = clientHeight-pbar.height-8;
339 pbar.posx = (clientWidth-pbar.width)/2;
341 deftess = gxagg.tesselator;
343 add();
346 // //////////////////////////////////////////////////////////////////// //
347 override void onPaint () {
348 if (closed) return;
350 enum guiGroupListWidth = 128;
351 enum guiThreadListHeight = 520;
353 gxFillRect(0, 0, guiGroupListWidth, screenHeight, getColor("grouplist-back"));
354 gxVLine(guiGroupListWidth, 0, screenHeight, getColor("grouplist-divline"));
356 gxFillRect(guiGroupListWidth+1, 0, screenWidth, guiThreadListHeight, getColor("threadlist-back"));
357 gxHLine(guiGroupListWidth+1, guiThreadListHeight, screenWidth, getColor("threadlist-divline"));
359 version(all) {
360 import core.stdc.math : roundf;
362 if (tessType >= 0) {
363 if (tessType > AGGTesselation.max) tessType = AGGTesselation.max;
364 gxagg.tesselator = cast(AGGTesselation)tessType;
365 } else {
366 gxagg.tesselator = deftess;
369 gxagg.beginFrame();
370 gxagg.params.width = 1.4f;
371 //gxagg.params.width = 1.01f;
373 float baphx = roundf((screenWidth-gxagg.BaphometDims)*0.5f)+0.5f;
374 float baphy = roundf((screenHeight-gxagg.BaphometDims)*0.5f)+0.5f;
376 import iv.pxclock;
377 ulong estt;
378 ubyte hit = 0;
379 if (timetest) {
380 timetest = false;
381 estt = 0;
382 foreach (; 0..1000) {
383 gxagg.beginFrame();
384 immutable tstt = clockMicro();
385 gxagg.renderBaphomet(baphx, baphy);
386 estt += (clockMicro()-tstt);
388 estt /= 1000;
389 gxagg.beginFrame();
390 gxagg.renderBaphomet(baphx, baphy);
391 } else {
392 immutable tstt = clockMicro();
393 gxagg.renderBaphomet(baphx, baphy);
394 estt = clockMicro()-tstt;
397 version(none) {
398 gxagg
399 .moveTo(baphx-1, baphy-1)
400 .lineTo(baphx+gxagg.BaphometDims, baphy-1)
401 .lineTo(baphx+gxagg.BaphometDims, baphy+gxagg.BaphometDims)
402 .lineTo(baphx-1, baphy+gxagg.BaphometDims)
403 .lineTo(baphx-1, baphy-1);
405 version(all) {
406 gxagg.roundedRect(baphx-1, baphy-1, gxagg.BaphometDims+1, gxagg.BaphometDims+1, 16.0f);
408 gxagg.stroke();
409 //gxagg.contour();
410 //gxagg.fill();
412 version(none) {
413 gxagg
414 .beginPath();
415 .moveTo(10, 10);
416 .lineTo(30, 20);
417 .width = 1.0f;
418 gxagg.contour();
421 hit = gxagg.hitTest(lastMX, lastMY);
424 immutable rstt = clockMicro();
425 gxagg.render(gxrgba(255, 0, 0, (tessType >= 0 ? 255 : 66)));
426 immutable fstt = clockMicro()-rstt;
427 import core.stdc.stdio; printf("total Baphomet render microsecs: %u\n", cast(uint)fstt);
430 //gxagg.endFrame(gxrgba(255, 0, 0, (tessType >= 0 ? 255 : 66)));
431 gxagg.endFrame();
434 import std.format : format;
435 string s = "tess: %s level: %d; mcsecs: %s".format(gxagg.tesselator, gxagg.bezierLimit, estt);
436 gxDrawTextUtf(200, 20, s, GxColors.k8orange);
437 if (hit) {
438 s = "hit: %3s".format(hit);
439 gxDrawTextUtf(200, 40, s, GxColors.k8orange);
441 enum rxofs = 132;
442 enum ryofs = 432;
443 enum rwdt = 8;
444 foreach (int y; -16..+17) {
445 foreach (int x; -16..+17) {
446 GxColor c = gxGetPixel(lastMX+x, lastMY+y)|gxAlphaMask;
447 int rx = (x+16)*rwdt+rxofs;
448 int ry = (y+16)*rwdt+ryofs;
449 gxFillRect(rx, ry, rwdt, rwdt, c);
452 gxVLine(rxofs+16*rwdt+rwdt/2-1, ryofs, 32*rwdt, GxColors.white);
453 gxHLine(rxofs, ryofs+16*rwdt+rwdt/2-1, 32*rwdt, GxColors.white);
457 ulong accstt = 0, fstt;
459 version(all) {
460 gxagg.beginFrame();
461 AGGMatrix tmt;
462 version(all) {
464 .rotate(deg2rad(35.0f))
465 .translate(20, 100);
466 assert(!tmt.isIdentity);
470 .translate(0.5f, 0.5f)
471 .translate(-160, 0);
473 gxagg.withTransform(tmt, {
474 gxagg.moveTo(50, 50);
475 gxagg.lineTo(60, 60);
476 gxagg.moveTo(100, 100);
477 gxagg.lineTo(140, 120);
478 version(none) {
479 // CW (because logical coords are upwards)
480 gxagg.moveTo(200, 200);
481 gxagg.lineTo(200, 100);
482 gxagg.lineTo(100, 100);
483 gxagg.lineTo(100, 200);
484 gxagg.lineTo(200, 200);
485 } else {
486 // CCW (because logical coords are upwards)
487 gxagg.moveTo(100, 100);
488 gxagg.lineTo(200, 100);
489 gxagg.lineTo(200, 200);
490 gxagg.lineTo(100, 200);
492 gxagg.closePoly();
493 //gxagg.flipOrientation = true;
494 //gxagg.dumpVertices();
497 version(all) {
498 gxagg.fill();
499 fstt = clockMicro();
500 gxagg.render(gxrgba(0, 127, 0, 127));
501 accstt += clockMicro()-fstt;
503 version(all) {
504 //gxagg.dumpVertices();
505 gxagg.stroke();
506 fstt = clockMicro();
507 gxagg.render(gxrgba(127, 0, 0, 255));
508 accstt += clockMicro()-fstt;
511 version(all) {
512 gxagg.resetDashes();
513 gxagg.addDash(4, 4);
514 gxagg.addDash(8, 8);
515 gxagg.dashStroke();
516 //gxagg.dashContour();
517 fstt = clockMicro();
518 gxagg.render(gxrgba(255, 255, 0, 255));
519 accstt += clockMicro()-fstt;
522 version(all) {
523 gxagg.paramsContour.width = 6;
524 gxagg.contour();
525 fstt = clockMicro();
526 gxagg.render(gxrgba(255, 255, 255, 255));
527 accstt += clockMicro()-fstt;
530 version(all) {
531 gxagg.flipOrientation = true;
532 gxagg.contour();
533 fstt = clockMicro();
534 gxagg.render(gxrgba(0, 255, 0, 255));
535 accstt += clockMicro()-fstt;
536 gxagg.flipOrientation = false;
539 { import core.stdc.stdio; printf("total rect render microsecs: %u\n", cast(uint)accstt); }
541 //gxagg.render(gxrgba(0, 127, 0, 127));
543 version(all) {
544 AGGVGradient3 grad;
545 gxagg
546 .beginPath()
547 .roundedRect(400.5f, 600.5f, 96, 28, 8)
548 .fill()
549 //.render(gxRGB!(192, 192, 192));
551 .render(AGGVGradient3(gxagg.rasterMinY, gxRGB!(127, 127, 127),
552 gxagg.rasterMaxY, gxRGB!(142, 142, 142),
553 20, gxRGB!(196, 196, 196)));
556 .render(AGGVGradient3(gxagg.rasterMinY, gxRGB!(255, 0, 0),
557 gxagg.rasterMaxY, gxRGB!(0, 255, 0),
558 20, gxRGB!(0, 0, 255)));
560 .render(AGGHGradient(gxagg.rasterMinX, gxRGBA!(255, 0, 0, 127),
561 gxagg.rasterMaxX, gxRGBA!(0, 255, 0, 90)));
564 version(all) {
565 accstt = 0;
566 float[4] bounds;
567 dchar dch = '@';
568 if (gxFontCharPathBounds(dch, bounds[])) {
569 //conwriteln("bounds: (", bounds[0], ",", bounds[1], ")-(", bounds[2], ",", bounds[3], ")");
570 float desthgt = 96;
571 immutable float gwdt = bounds[2]-bounds[0];
572 immutable float ghgt = bounds[3]-bounds[1];
573 float scale = desthgt/ghgt;
574 AGGMatrix tmx;
576 .scale(scale, scale)
577 .translate(-bounds[0]*scale+100.5f, -bounds[1]*scale+100.5f);
578 gxagg.withTransform(tmx, {
579 gxagg
580 .resetParams()
581 .beginPath();
582 if (gxFontCharToPath(dch)) {
583 gxagg
584 //.stroke()
585 .fill()
586 //.render(GxColors.k8orange);
587 .noop();
588 fstt = clockMicro();
589 gxagg.render(AGGVGradient3(gxagg.rasterMinY, gxRGB!(200, 73, 0),
590 gxagg.rasterMaxY, gxRGB!(255, 128, 0)));
591 accstt += clockMicro()-fstt;
593 int emb = cast(int)(4/scale);
594 float[4] ebounds;
595 gxagg
596 .beginPath();
597 if (gxFontCharPathEmboldenBounds(dch, emb, ebounds[])) {
598 immutable float ewdt = ebounds[2]-ebounds[0];
599 immutable float ehgt = ebounds[3]-ebounds[1];
600 gxagg.transform.translate(-(ewdt-gwdt)*0.5f*scale, (ehgt-ghgt)*0.5f*scale);
601 if (gxFontCharToPathEmbolden(dch, emb)) {
602 gxagg
603 .stroke()
604 .noop();
605 fstt = clockMicro();
606 gxagg.render(GxColors.green);
607 accstt += clockMicro()-fstt;
611 { import core.stdc.stdio; printf("total glyph render microsecs: %u\n", cast(uint)accstt); }
615 static if (is(typeof({immutable string s = import("xbnd.d");}))) {
616 mixin(import("xbnd.d"));
617 enum hasxbnd = true;
618 } else {
619 enum hasxbnd = false;
622 version(all) {
623 float[4] gbounds;
624 dchar gdch = '@';
625 if (gxFontCharPathBounds(gdch, gbounds[])) {
626 float desthgt = 196;
627 immutable float gwdt = gbounds[2]-gbounds[0];
628 immutable float ghgt = gbounds[3]-gbounds[1];
629 float scale = desthgt/ghgt;
630 AGGMatrix tmx;
632 .scale(scale, scale)
633 .translate(-bounds[0]*scale+200.5f, -bounds[1]*scale+200.5f);
634 gxagg.withTransform(tmx, {
635 gxagg.resetParams().beginPath();
636 if (gxFontCharToPath(gdch)) {
637 //gxagg.flipOrientation = true;
638 gxagg.paramsContour.width = 8;
639 gxagg.contourFill();
640 //gxagg.render(gxrgba(0, 155, 0, 255));
641 gxagg.render(gxagg.vgradient(gxrgb(0, 38, 0), gxrgb(0, 98, 0)));
642 gxagg.flipOrientation = false;
644 gxagg.resetParams().beginPath();
645 if (gxFontCharToPath(gdch)) {
646 gxagg.fill();
647 static if (hasxbnd) {
648 gxagg.render(AGGImgFill(0, 0, 32));
649 } else {
650 gxagg.render(gxagg.vgradient(gxrgb(255, 127, 0), gxrgb(155, 27, 0)));
657 static if (hasxbnd) xbnd();
659 gxagg.endFrame();
662 version(test_round_rect) {
663 gxClipReset();
664 gxFillRoundedRect(lastMouseX-16, lastMouseY-16, 128, 96, rrad, /*gxSolidWhite*/gxRGBA!(0, 255, 0, 127));
665 //gxDrawRoundedRect(lastMouseX-16, lastMouseY-16, 128, 96, rrad, gxRGBA!(0, 255, 0, 127));
668 drawWidgets();
671 version(test_round_rect) {
672 int rrad = 16;
675 override bool onKeyBubble (KeyEvent event) {
676 if (event.pressed) {
677 version(test_round_rect) {
678 if (event == "Plus") { ++rrad; return true; }
679 if (event == "Minus") { --rrad; return true; }
681 if (event == "C-Q") { concmd("quit_prompt"); return true; }
682 if (event == "1") { concmd("window_titler"); return true; }
683 if (event == "2") { concmd("window_tagoptions"); return true; }
684 if (event == "Minus") { pbar.current = pbar.current-1; return true; }
685 if (event == "Plus") { pbar.current = pbar.current+1; return true; }
687 if (event == "Q") { if (gxagg.bezierLimit > 1) { --gxagg.bezierLimit; widgetChanged(); } return true; }
688 if (event == "W") { if (gxagg.bezierLimit < 1000) { ++gxagg.bezierLimit; widgetChanged(); } return true; }
690 if (event == "Z") { --tessType; if (tessType < -1) tessType = -1; widgetChanged(); return true; }
691 if (event == "X") { ++tessType; widgetChanged(); return true; }
693 if (event == "T") { timetest = true; widgetChanged(); return true; }
694 //if (dbg_dump_keynames) conwriteln("key: ", event.toStr, ": ", event.modifierState&ModifierState.windows);
695 //foreach (const ref kv; mainAppKeyBindings.byKeyValue) if (event == kv.key) concmd(kv.value);
697 return false;
700 // returning `false` to avoid screen rebuilding by dispatcher
701 override bool onMouseBubble (MouseEvent event) {
702 if (event.type == MouseEventType.buttonPressed || event.type == MouseEventType.buttonReleased) {
703 if (lastMX != event.x || lastMY != event.y) {
704 lastMX = event.x;
705 lastMY = event.y;
706 //widgetChanged();
708 widgetChanged();
709 } else if (event.modifierState) {
710 // for OpenGL, this rebuilds the whole screen anyway
711 lastMX = event.x;
712 lastMY = event.y;
713 widgetChanged();
715 return false;
720 // ////////////////////////////////////////////////////////////////////////// //
721 void main (string[] args) {
722 //egraFontName = "PT Sans:pixelsize=16";
724 defaultColorStyle.parseStyle(TestStyle);
725 //egraDefaultFontSize = 48;
727 glconAllowOpenGLRender = false;
729 sdpyWindowClass = "EGRATest";
730 //glconShowKey = "M-Grave";
732 initConsole();
734 conProcessQueue();
735 conProcessArgs!true(args);
737 egraCreateSystemWindow("EGRA Test", allowResize:false);
739 vbwin.addEventListener((QuitEvent evt) {
740 if (vbwin.closed) return;
741 if (isQuitRequested) { vbwin.close(); return; }
742 vbwin.close();
745 static if (is(typeof(&vbwin.closeQuery))) {
746 vbwin.closeQuery = delegate () { concmd("quit"); egraPostDoConCommands(); };
749 mainPane = new MainPaneWindow();
750 //egraSkipScreenClear = true; // main pane is fullscreen
752 postScreenRebuild();
753 repostHideMouse();
755 vbwin.eventLoop(1000*10,
756 delegate () {
757 egraProcessConsole();
759 delegate (KeyEvent event) {
760 if (egraOnKey(event)) return;
762 delegate (MouseEvent event) {
763 if (egraOnMouse(event)) return;
765 delegate (dchar ch) {
766 if (egraOnChar(ch)) return;
770 flushGui();
771 conProcessQueue(int.max/4);