Removed Cambalache

We need more features than it can provide for now (cf. #178)
master
vhaudiquet 1 year ago
parent a210254c58
commit cf6501d93a
  1. 17
      Makefile
  2. 102
      ui/ginput.cmb
  3. 92
      ui/main-window.ui
  4. 15
      ui/panel-empty.ui
  5. 100
      ui/panel-mouse.ui
  6. 37
      ui/panel.ui

@ -1,12 +1,11 @@
NAME=ginput
CC=gcc
CAMBALACHE=cambalache
CFLAGS=$(shell pkg-config --cflags gtk4 libadwaita-1 libusb-1.0) -O3 -I src
LDFLAGS=$(shell pkg-config --libs gtk4 libadwaita-1 libusb-1.0)
BUILD_DIR=build
CMB := $(wildcard ui/*.cmb)
C_FILES := $(shell find $(src) -name '*.c')
UI := $(shell find ui/ -name '*.ui')
C_FILES := $(shell find src/ -name '*.c')
all: resources $(BUILD_DIR)/$(NAME)
@ -20,16 +19,11 @@ $(BUILD_DIR)/$(NAME): $(BUILD_DIR)/resource.c $(C_FILES) | $(BUILD_DIR)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
# UI : Cambalache contains all of the UI files, just compile them all
$(BUILD_DIR)/%.ui: ui/$(NAME).cmb | $(BUILD_DIR)
$(CAMBALACHE) -E $^
mv ui/*.ui $(BUILD_DIR)/
# Resources
$(BUILD_DIR)/resource.c: ui/ginput.gresource.xml ui/style.css $(BUILD_DIR)/main-window.ui
$(BUILD_DIR)/resource.c: ui/ginput.gresource.xml ui/style.css ui
cp ui/style.css $(BUILD_DIR)/
cp ui/ginput.gresource.xml $(BUILD_DIR)/
cd $(BUILD_DIR) && glib-compile-resources --generate-source --target=resource.c ginput.gresource.xml
cd ui && glib-compile-resources --generate-source --target=resource.c ginput.gresource.xml
mv ui/resource.c $(BUILD_DIR)/
$(BUILD_DIR)/glib-2.0/schemas/gschemas.compiled: v.ginput.gschema.xml | $(BUILD_DIR)
mkdir -p $(BUILD_DIR)/glib-2.0/schemas
@ -38,7 +32,6 @@ $(BUILD_DIR)/glib-2.0/schemas/gschemas.compiled: v.ginput.gschema.xml | $(BUILD_
# Phony targets
.PHONY: clean
clean:
rm -f ui/*.ui # Remove compiled UI files that might be left over
rm -rf $(BUILD_DIR)
.PHONY: run

@ -1,102 +0,0 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!DOCTYPE cambalache-project SYSTEM "cambalache-project.dtd">
<cambalache-project version="0.13.1" target_tk="gtk-4.0">
<ui>
(1,1,"gkeyboards.ui","main-window.ui",None,None,None,None,None,None," &lt;menu id=\"primary_menu\"&gt;\n &lt;section&gt;\n &lt;item&gt;\n &lt;attribute name=\"label\" translatable=\"yes\"&gt;About&lt;/attribute&gt;\n &lt;attribute name=\"action\"&gt;app.about&lt;/attribute&gt;\n &lt;/item&gt;\n &lt;/section&gt;\n &lt;/menu&gt;\n"),
(2,1,None,"panel.ui",None,None,None,None,None,None,None),
(3,1,None,"panel-empty.ui",None,None,None,None,None,None,""),
(4,1,None,"panel-mouse.ui",None,None,None,None,None,None,None)
</ui>
<object>
(1,1,"AdwApplicationWindow","MainWindow",None,None,None,None,None,None),
(1,2,"AdwLeaflet","main_leaflet",1,None,None,None,-1,None),
(1,3,"GtkBox","sidebar_box",2,None,None,None,None,None),
(1,4,"AdwHeaderBar","header",3,None,None,None,None,None),
(1,5,"AdwWindowTitle","sidebar_title_widget",4,None,None,None,None,None),
(1,6,"GtkMenuButton",None,4,None,"end",None,None,"&lt;property name=\"menu-model\"&gt;primary_menu&lt;/property&gt;"),
(1,7,"AdwLeafletPage",None,2,None,None,None,1,None),
(1,8,"GtkSeparator",None,7,None,None,None,None,None),
(1,9,"GtkBox","panel_box",2,None,None,None,2,None),
(1,10,"GtkStack","stack",9,None,None,None,None,None),
(1,11,"GtkScrolledWindow",None,3,None,None,None,1,None),
(1,12,"GtkViewport",None,11,None,None,None,None,None),
(2,1,"AdwBin","Panel",None,None,None,None,None,None),
(2,11,"GtkBox","main_box",1,None,None,None,None,None),
(2,12,"AdwBin","content_bin",11,None,None,None,1,None),
(2,13,"AdwBin","titlebar_bin",11,None,None,None,None,None),
(2,15,"AdwHeaderBar","titlebar",13,None,None,None,None,None),
(2,16,"AdwWindowTitle","title",15,None,None,None,None,None),
(3,1,"Panel","EmptyPanel",None,None,None,None,None,"\n"),
(3,2,"GtkLabel",None,1,None,None,None,None,None),
(4,1,"Panel","MousePanel",None,None,None,None,None,""),
(4,5,"GtkBox",None,1,None,None,None,1,None),
(4,6,"GtkImage","mouse_image",5,None,None,None,None,None),
(4,7,"GtkLabel","mouse_name",5,None,None,None,1,None)
</object>
<object_property>
(1,1,"GtkWindow","default-height","980",None,None,None,None,None,None,None,None,None),
(1,1,"GtkWindow","default-width","640",None,None,None,None,None,None,None,None,None),
(1,3,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(1,4,"AdwHeaderBar","show-end-title-buttons","False",None,None,None,None,None,None,None,None,None),
(1,4,"AdwHeaderBar","title-widget",None,None,None,None,None,5,None,None,None,None),
(1,5,"AdwWindowTitle","title","Input devices",None,None,None,None,None,None,None,None,None),
(1,6,"GtkMenuButton","icon-name","open-menu-symbolic",None,None,None,None,None,None,None,None,None),
(1,6,"GtkMenuButton","primary","True",None,None,None,None,None,None,None,None,None),
(1,7,"AdwLeafletPage","child",None,None,None,None,None,8,None,None,None,None),
(1,7,"AdwLeafletPage","navigatable","False",None,None,None,None,None,None,None,None,None),
(1,8,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(1,9,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(1,9,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(1,9,"GtkWidget","vexpand","True",None,None,None,None,None,None,None,None,None),
(1,10,"GtkStack","transition-type","crossfade",None,None,None,None,None,None,None,None,None),
(1,10,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(1,10,"GtkWidget","vexpand","True",None,None,None,None,None,None,None,None,None),
(1,10,"GtkWidget","width-request","360",None,None,None,None,None,None,None,None,None),
(1,11,"GtkScrolledWindow","child",None,None,None,None,None,12,None,None,None,None),
(1,11,"GtkScrolledWindow","hscrollbar-policy","never",None,None,None,None,None,None,None,None,None),
(1,11,"GtkWidget","vexpand","True",None,None,None,None,None,None,None,None,None),
(1,11,"GtkWidget","width-request","200",None,None,None,None,None,None,None,None,None),
(2,11,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(2,11,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(2,11,"GtkWidget","vexpand","True",None,None,None,None,None,None,None,None,None),
(2,12,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(2,12,"GtkWidget","vexpand","True",None,None,None,None,None,None,None,None,None),
(2,13,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(2,15,"AdwHeaderBar","show-start-title-buttons","False",None,None,None,None,None,None,None,None,None),
(2,15,"AdwHeaderBar","title-widget",None,None,None,None,None,16,None,None,None,None),
(3,2,"GtkLabel","justify","center",None,None,None,None,None,None,None,None,None),
(3,2,"GtkLabel","label","There is nothing here...\nPerhaps you don't have the needed drivers installed and active ?",None,None,None,None,None,None,None,None,None),
(4,5,"GtkBox","spacing","10",None,None,None,None,None,None,None,None,None),
(4,5,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(4,5,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
(4,6,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
(4,6,"GtkWidget","height-request","250",None,None,None,None,None,None,None,None,None),
(4,6,"GtkWidget","margin-top","30",None,None,None,None,None,None,None,None,None),
(4,6,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(4,6,"GtkWidget","width-request","300",None,None,None,None,None,None,None,None,None),
(4,7,"GtkLabel","justify","center",None,None,None,None,None,None,None,None,None),
(4,7,"GtkWidget","halign","center",None,None,None,None,None,None,None,None,None)
</object_property>
<object_data>
(1,6,"GtkWidget",1,1,None,None,None,None,None,None),
(1,10,"GtkWidget",1,1,None,None,None,None,None,None),
(1,10,"GtkWidget",2,2,None,1,None,None,None,None),
(1,8,"GtkWidget",1,1,None,None,None,None,None,None),
(1,8,"GtkWidget",2,2,None,1,None,None,None,None),
(1,6,"GtkWidget",2,2,None,1,None,None,None,None),
(4,1,"GtkWidget",2,2,None,1,None,None,None,None),
(4,1,"GtkWidget",2,3,None,1,None,None,None,None),
(4,1,"GtkWidget",2,4,None,1,None,None,None,None),
(4,1,"GtkWidget",2,5,None,1,None,None,None,None),
(4,1,"GtkWidget",2,6,None,1,None,None,None,None),
(4,6,"GtkWidget",1,1,None,None,None,None,None,None),
(4,7,"GtkWidget",1,1,None,None,None,None,None,None),
(4,7,"GtkWidget",2,2,None,1,None,None,None,None)
</object_data>
<object_data_arg>
(1,10,"GtkWidget",2,2,"name","background"),
(1,8,"GtkWidget",2,2,"name","sidebar"),
(1,6,"GtkWidget",2,2,"name","image-button"),
(4,7,"GtkWidget",2,2,"name","heading")
</object_data_arg>
</cambalache-project>

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='UTF-8'?>
<interface>
<requires lib="gtk" version="4.10" />
<requires lib="libadwaita" version="1.0" />
<template class="MainWindow" parent="AdwApplicationWindow">
<property name="default-height">980</property>
<property name="default-width">640</property>
<child>
<object class="AdwLeaflet" id="main_leaflet">
<child>
<object class="GtkBox" id="sidebar_box">
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar" id="header">
<property name="show-end-title-buttons">False</property>
<property name="title-widget">
<object class="AdwWindowTitle" id="sidebar_title_widget">
<property name="title">Input devices</property>
</object>
</property>
<child type="end">
<object class="GtkMenuButton">
<property name="icon-name">open-menu-symbolic</property>
<property name="primary">True</property>
<style>
<class name="image-button" />
</style>
<property name="menu-model">primary_menu</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="child">
<object class="GtkViewport" />
</property>
<property name="hscrollbar-policy">never</property>
<property name="vexpand">True</property>
<property name="width-request">200</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwLeafletPage">
<property name="child">
<object class="GtkSeparator">
<property name="orientation">vertical</property>
<style>
<class name="sidebar" />
</style>
</object>
</property>
<property name="navigatable">False</property>
</object>
</child>
<child>
<object class="GtkBox" id="panel_box">
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<property name="vexpand">True</property>
<child>
<object class="GtkStack" id="stack">
<property name="hexpand">True</property>
<property name="transition-type">crossfade</property>
<property name="vexpand">True</property>
<property name="width-request">360</property>
<style>
<class name="background" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<menu id="primary_menu">
<section>
<item>
<attribute name="label" translatable="yes">About</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
</menu>
</interface>

@ -0,0 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<interface>
<requires lib="gtk" version="4.6"/>
<template class="EmptyPanel" parent="Panel">
<child type="content">
<object class="GtkLabel">
<property name="justify">center</property>
<property name="label">There is nothing here...
Perhaps you don't have the needed drivers installed and active ?</property>
</object>
</child>
</template>
</interface>

@ -0,0 +1,100 @@
<?xml version='1.0' encoding='UTF-8'?>
<interface>
<requires lib="gtk" version="4.6" />
<template class="MousePanel" parent="Panel">
<child type="content">
<object class="GtkBox">
<property name="halign">start</property>
<property name="spacing">10</property>
<property name="valign">start</property>
<child>
<object class="GtkBox" id="presentation_box">
<property name="halign">start</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
<object class="GtkImage" id="mouse_image">
<property name="halign">start</property>
<property name="height-request">250</property>
<property name="margin-top">30</property>
<property name="valign">start</property>
<property name="width-request">300</property>
<style />
</object>
</child>
<child>
<object class="GtkLabel" id="mouse_name">
<property name="halign">center</property>
<property name="justify">center</property>
<style>
<class name="heading" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="basic_settings">
<property name="halign">start</property>
<property name="margin-top">30</property>
<property name="orientation">vertical</property>
<property name="valign">start</property>
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="label">Basic settings</property>
<property name="valign">start</property>
<style>
<class name="title-3" />
</style>
</object>
</child>
<child>
<object class="GtkBox" id="dpi_box">
<property name="halign">start</property>
<property name="margin-top">30</property>
<property name="valign">start</property>
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="justify">center</property>
<property name="label">DPI:</property>
<property name="margin-end">10</property>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkSpinButton" id="dpi_spinbutton">
<property name="adjustment">
<object class="GtkAdjustment" id="dpi_adjustment">
<property name="step-increment">100.0</property>
<property name="upper">26000.0</property>
<property name="value">200.0</property>
</object>
</property>
<property name="climb-rate">100.0</property>
<property name="margin-end">10</property>
<property name="margin-start">10</property>
<property name="value">200.0</property>
<property name="width-request">150</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="justify">right</property>
<property name="label">(Maximum: 26000)</property>
<property name="margin-end">10</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>

@ -0,0 +1,37 @@
<?xml version='1.0' encoding='UTF-8'?>
<interface>
<requires lib="gtk" version="4.0" />
<requires lib="libadwaita" version="1.0" />
<template class="Panel" parent="AdwBin">
<child>
<object class="GtkBox" id="main_box">
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<property name="vexpand">True</property>
<child>
<object class="AdwBin" id="titlebar_bin">
<property name="hexpand">True</property>
<child>
<object class="AdwHeaderBar" id="titlebar">
<property name="show-start-title-buttons">False</property>
<property name="title-widget">
<object class="AdwWindowTitle" id="title" />
</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwBin" id="content_bin">
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
</child>
</object>
</child>
</template>
</interface>
Loading…
Cancel
Save