diff options
Diffstat (limited to 'src/vala/main.vala')
-rw-r--r-- | src/vala/main.vala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vala/main.vala b/src/vala/main.vala new file mode 100644 index 0000000..535baf6 --- /dev/null +++ b/src/vala/main.vala @@ -0,0 +1,26 @@ +int main (string[] args) { + Intl.setlocale (LocaleCategory.ALL, ""); + var name = "eu.planete_kraus.Disfluid"; + if (Disfluid.is_nightly ()) { + name += ".Devel"; + } + var app = new Adw.Application( + name, + ApplicationFlags.FLAGS_NONE + ); + app.activate.connect(() => { + var cache_entry = new Disfluid.CacheEntry.alloc (512, 4096, 2 * 1024 * 1024); + cache_entry.set_request_gdate (new GLib.DateTime.utc (2023, 03, 26, 19, 38, 00)); + cache_entry.set_response_gdate (new GLib.DateTime.now ()); + cache_entry.set_key ("GET https://example.com\r\n"); + cache_entry.set_response_header ("HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n"); + cache_entry.set_response_body ((char[]) "Hello"); + var cache_entry_view = new Disfluid.CacheEntryView.with_value ("/tmp/test.cache", cache_entry); + var cache_view = new Adw.PreferencesPage (); + cache_view.add (cache_entry_view); + var window = new Disfluid.MainWindow (cache_view); + window.set_application (app); + window.present(); + }); + return app.run(args); +} |