Changes
4 changed files (+105/-0)
-
gtk-adwaita/README.md (new)
-
@@ -0,0 +1,42 @@<!-- Copyright 2025 Shota FUJI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 --> # gtk-adwaita GTK client adhering to Gnome Human Interface Guidline. ## Development Guide ### Running locally GLib requires setting fields to be defined in XML schema file, which will be installed to shared directory then be compiled to binary file using system tool. Due to this design limitation, you have to pre-compile `data/*.gschema.xml` file into the binary file for local run. The `-Dcompile-gschema` option performs that compile task and emits the generated binary file onto `<zig-out>/share/glib-2.0/schemas`. You can tell GLib to load the compiled file using `GSETTINGS_SCHEMA_DIR` environment variable: ``` GSETTINGS_SCHEMA_DIR=./zig-out/share/glib-2.0/schemas ./zig-out/bin/plac ``` ### Enable debug logging Add `Plac` to `G_MESSAGES_DEBUG` environment variable: ``` G_MESSAGES_DEBUG=Plac ./zig-out/bin/plac ```
-
-
-
@@ -30,6 +30,8 @@ pub fn build(b: *std.Build) !void {const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const compile_gschema = b.option(bool, "compile-gschema", "Compile gschema XML file for local run") orelse false; const core = core: { const dep = b.dependency("core", .{ .target = target,
-
@@ -139,6 +141,22 @@break :gresource built_c; }; const gschema_compiled = gschema: { const compiler = b.addSystemCommand(&.{"glib-compile-schemas"}); compiler.addArg("--targetdir"); const out = compiler.addOutputDirectoryArg("compiled"); compiler.addArg("--strict"); compiler.addDirectoryArg(b.path("data/")); compiler.addFileInput(b.path("data/jp.pocka.plac.gtk-adwaita.gschema.xml")); const t = b.addInstallFile(out.path(b, "gschemas.compiled"), "share/glib-2.0/schemas/gschemas.compiled"); break :gschema t; }; // An executable. const exe = exe: { const exe = b.addExecutable(.{
-
@@ -186,4 +204,12 @@ };// Install a main executable file on "zig build" without subcommand. b.installArtifact(exe); // Install gschema file b.installFile("data/jp.pocka.plac.gtk-adwaita.gschema.xml", "share/glib-2.0/schemas/jp.pocka.plac.gtk-adwaita.gschema.xml"); // Install compiled gschema file if (compile_gschema) { b.getInstallStep().dependOn(&gschema_compiled.step); } }
-
-
-
@@ -0,0 +1,32 @@<?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2025 Shota FUJI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 --> <schemalist> <schema path="/jp/pocka/plac/gtk-adwaita/" id="jp.pocka.plac.gtk-adwaita"> <key name="connected-server-id" type="s"> <default>""</default> <summary>Last Connected Server ID</summary> <description>Connects to the server with this ID on application startup.</description> </key> <key name="connected-server-token" type="s"> <default>""</default> <summary>Last Connected Server Token</summary> <description>Connects to the server with this token. Ignored when connected-server-id is empty.</description> </key> </schema> </schemalist>
-
-
-
@@ -24,6 +24,11 @@ );} protected override void activate() { var settings = new Settings("jp.pocka.plac.gtk-adwaita"); var connected_server_id = settings.get_string("connected-server-id"); var connected_server_token = settings.get_string("connected-server-token"); var selector = new ServerSelector.Window(this); selector.start(); }
-