Compare commits
	
		
			2 Commits
		
	
	
		
			v1.0.10+nm
			...
			static-lin
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f167a0e44a | |||
| 1804b28a0d | 
@ -4,10 +4,6 @@ stages:
 | 
			
		||||
  - build
 | 
			
		||||
 | 
			
		||||
before_script:
 | 
			
		||||
  - apt-get -y update
 | 
			
		||||
  - apt-get -y install wget gnupg2
 | 
			
		||||
  - echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list
 | 
			
		||||
  - wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -
 | 
			
		||||
  - apt-get -y update
 | 
			
		||||
  - apt-get -y build-dep .
 | 
			
		||||
 | 
			
		||||
@ -16,6 +12,8 @@ build_meson:
 | 
			
		||||
  tags:
 | 
			
		||||
    - librem5
 | 
			
		||||
  script:
 | 
			
		||||
    - meson . _build/ -Ddepdatadir=/usr/share
 | 
			
		||||
    - ninja -C _build install
 | 
			
		||||
    - mkdir -p ../build
 | 
			
		||||
    - meson ../build/
 | 
			
		||||
    - cd ../build
 | 
			
		||||
    - ninja install
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,11 +1,102 @@
 | 
			
		||||
<?xml version="1.0"?>
 | 
			
		||||
<geometry version="0.90">
 | 
			
		||||
  <bounds x="0.000000" y="0.000000" width="410.0000" height="296.5853"/>
 | 
			
		||||
  <bounds x="0.000000" y="0.000000" width="640.0000" height="296.5853"/>
 | 
			
		||||
  <section angle="0">
 | 
			
		||||
    <bounds x="0" y="0" width="608.7804" height="201.3658"/>
 | 
			
		||||
    <bounds x="15.60975" y="15.60975" width="640.0000" height="39.02439"/>
 | 
			
		||||
    <row orientation="1">
 | 
			
		||||
      <key keycode="9" name="ESC" oref="outline2">
 | 
			
		||||
	<bounds x="3.121951" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="67" name="FK01" oref="outline2">
 | 
			
		||||
	<bounds x="84.29268" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="68" name="FK02" oref="outline2">
 | 
			
		||||
	<bounds x="124.8780" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="69" name="FK03" oref="outline2">
 | 
			
		||||
	<bounds x="165.4634" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="70" name="FK04" oref="outline2">
 | 
			
		||||
	<bounds x="206.0487" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="71" name="FK05" oref="outline2">
 | 
			
		||||
	<bounds x="266.9268" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="72" name="FK06" oref="outline2">
 | 
			
		||||
	<bounds x="307.5121" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="73" name="FK07" oref="outline2">
 | 
			
		||||
	<bounds x="348.0975" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="74" name="FK08" oref="outline2">
 | 
			
		||||
	<bounds x="388.6829" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="75" name="FK09" oref="outline2">
 | 
			
		||||
	<bounds x="449.5609" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="76" name="FK10" oref="outline2">
 | 
			
		||||
	<bounds x="490.1463" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="95" name="FK11" oref="outline2">
 | 
			
		||||
	<bounds x="530.7317" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="96" name="FK12" oref="outline2">
 | 
			
		||||
	<bounds x="571.3170" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
    </row>
 | 
			
		||||
  </section>
 | 
			
		||||
  <section angle="0">
 | 
			
		||||
    <bounds x="15.60975" y="78.04878" width="608.7804" height="201.3658"/>
 | 
			
		||||
    <row orientation="1">
 | 
			
		||||
      <key keycode="49" name="TLDE" oref="outline2">
 | 
			
		||||
	<bounds x="3.121951" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="10" name="AE01" oref="outline2">
 | 
			
		||||
	<bounds x="43.70731" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="11" name="AE02" oref="outline2">
 | 
			
		||||
	<bounds x="84.29268" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="12" name="AE03" oref="outline2">
 | 
			
		||||
	<bounds x="124.8780" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="13" name="AE04" oref="outline2">
 | 
			
		||||
	<bounds x="165.4634" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="14" name="AE05" oref="outline2">
 | 
			
		||||
	<bounds x="206.0487" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="15" name="AE06" oref="outline2">
 | 
			
		||||
	<bounds x="245.0731" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="16" name="AE07" oref="outline2">
 | 
			
		||||
	<bounds x="285.6585" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="17" name="AE08" oref="outline2">
 | 
			
		||||
	<bounds x="326.2439" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="18" name="AE09" oref="outline2">
 | 
			
		||||
	<bounds x="366.8292" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="19" name="AE10" oref="outline2">
 | 
			
		||||
	<bounds x="407.4146" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="20" name="AE11" oref="outline2">
 | 
			
		||||
	<bounds x="448.0000" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="21" name="AE12" oref="outline2">
 | 
			
		||||
	<bounds x="488.5853" y="1.560976" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="22" name="BKSP" oref="outline13">
 | 
			
		||||
	<bounds x="529.1707" y="1.560976" width="79.60975" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
    </row>
 | 
			
		||||
    <row orientation="1">
 | 
			
		||||
      <key keycode="23" name="TAB" oref="outline4">
 | 
			
		||||
	<bounds x="3.121951" y="42.14634" width="59.31707" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="24" name="AD01" oref="outline2">
 | 
			
		||||
	<bounds x="65.56097" y="42.14634" width="37.46341" height="52.44877"/>
 | 
			
		||||
	<bounds x="65.56097" y="42.14634" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="25" name="AD02" oref="outline2">
 | 
			
		||||
	<bounds x="106.1463" y="42.14634" width="37.46341" height="37.46341"/>
 | 
			
		||||
@ -34,11 +125,20 @@
 | 
			
		||||
      <key keycode="33" name="AD10" oref="outline2">
 | 
			
		||||
	<bounds x="429.2682" y="42.14634" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="34" name="AD11" oref="outline2">
 | 
			
		||||
	<bounds x="468.2926" y="42.14634" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="35" name="AD12" oref="outline2">
 | 
			
		||||
	<bounds x="508.8780" y="42.14634" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="51" name="BKSL" oref="outline5">
 | 
			
		||||
	<bounds x="549.4634" y="42.14634" width="59.31707" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
    </row>
 | 
			
		||||
  </section>
 | 
			
		||||
  <section angle="0">
 | 
			
		||||
    <bounds x="0" y="0" width="608.7804" height="201.3658"/>
 | 
			
		||||
    <row orientation="1">
 | 
			
		||||
      <key keycode="66" name="CAPS" oref="outline6">
 | 
			
		||||
	<bounds x="3.121951" y="82.73170" width="68.68292" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="38" name="AC01" oref="outline2">
 | 
			
		||||
	<bounds x="76.48780" y="82.73170" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
@ -66,12 +166,18 @@
 | 
			
		||||
      <key keycode="46" name="AC09" oref="outline2">
 | 
			
		||||
	<bounds x="399.6097" y="82.73170" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="47" name="AC10" oref="outline2">
 | 
			
		||||
	<bounds x="438.6341" y="82.73170" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="48" name="AC11" oref="outline2">
 | 
			
		||||
	<bounds x="479.2195" y="82.73170" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="36" name="RTRN" oref="outline7">
 | 
			
		||||
	<bounds x="519.8048" y="82.73170" width="88.97561" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
    </row>
 | 
			
		||||
  </section>
 | 
			
		||||
  <section angle="0">
 | 
			
		||||
    <bounds x="0" y="0" width="608.7804" height="201.3658"/>
 | 
			
		||||
    <row orientation="1">
 | 
			
		||||
      <key keycode="50" name="LFSH" oref="altline">
 | 
			
		||||
      <key keycode="50" name="LFSH" oref="outline8">
 | 
			
		||||
	<bounds x="3.121951" y="121.7560" width="88.97561" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="52" name="AB01" oref="outline2">
 | 
			
		||||
@ -95,95 +201,113 @@
 | 
			
		||||
      <key keycode="58" name="AB07" oref="outline2">
 | 
			
		||||
	<bounds x="337.1707" y="121.7560" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="22" name="BKSP" oref="altline">
 | 
			
		||||
	<bounds x="529.1707" y="1.560976" width="79.60975" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
    </row>
 | 
			
		||||
  </section>
 | 
			
		||||
  <section angle="0">
 | 
			
		||||
    <bounds x="0" y="0" width="608.7804" height="201.3658"/>
 | 
			
		||||
    <row orientation="1">
 | 
			
		||||
      <key keycode="37" name="LCTL" oref="altline">
 | 
			
		||||
	<bounds x="62.43902" y="162.3414" width="48.39024" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="64" name="LALT" oref="altline">
 | 
			
		||||
	<bounds x="113.9512" y="162.3414" width="48.39024" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="65" name="SPCE" oref="spaceline">
 | 
			
		||||
	<bounds x="165.4634" y="162.3414" width="217.5853" height="37.46341"/>
 | 
			
		||||
      <key keycode="59" name="AB08" oref="outline2">
 | 
			
		||||
	<bounds x="377.7560" y="121.7560" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="60" name="AB09" oref="outline2">
 | 
			
		||||
       <bounds x="418.3414" y="121.7560" width="37.46341" height="37.46341"/>
 | 
			
		||||
	<bounds x="418.3414" y="121.7560" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="36" name="RTRN" oref="outline7">
 | 
			
		||||
	<bounds x="519.8048" y="82.73170" width="88.97561" height="37.46341"/>
 | 
			
		||||
      <key keycode="61" name="AB10" oref="outline2">
 | 
			
		||||
	<bounds x="458.9268" y="121.7560" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="62" name="RTSH" oref="outline9">
 | 
			
		||||
	<bounds x="499.5121" y="121.7560" width="109.2682" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
    </row>
 | 
			
		||||
    <row orientation="1">
 | 
			
		||||
      <key keycode="149" name="I149" oref="outline10">
 | 
			
		||||
	<bounds x="3.121951" y="162.3414" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="37" name="LCTL" oref="outline1">
 | 
			
		||||
	<bounds x="62.43902" y="162.3414" width="48.39024" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="64" name="LALT" oref="outline1">
 | 
			
		||||
	<bounds x="113.9512" y="162.3414" width="48.39024" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="65" name="SPCE" oref="outline3">
 | 
			
		||||
	<bounds x="165.4634" y="162.3414" width="217.5853" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="113" name="LEFT" oref="outline1">
 | 
			
		||||
	<bounds x="368.0487" y="162.3414" width="48.39024" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="111" name="UP" oref="outline1">
 | 
			
		||||
	<bounds x="419.43894" y="162.3414" width="48.39024" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="116" name="DOWN" oref="outline1">
 | 
			
		||||
	<bounds x="470.82918" y="162.3414" width="48.39024" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="114" name="RGHT" oref="outline1">
 | 
			
		||||
	<bounds x="522.21942" y="162.3414" width="48.39024" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
      <key keycode="150" name="I150" oref="outline10">
 | 
			
		||||
	<bounds x="573.60966" y="162.3414" width="37.46341" height="37.46341"/>
 | 
			
		||||
      </key>
 | 
			
		||||
    </row>
 | 
			
		||||
  </section>
 | 
			
		||||
  <outline id="outline2" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="37.46341" y="0.000000"/>
 | 
			
		||||
    <point x="37.46341" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="37.46341" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="altline" corner-radius="1.000000">
 | 
			
		||||
  <outline id="outline1" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="48.39024" y="0.000000"/>
 | 
			
		||||
    <point x="48.39024" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="48.39024" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="outline4" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="59.31707" y="0.000000"/>
 | 
			
		||||
    <point x="59.31707" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="59.31707" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="outline5" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="59.31707" y="0.000000"/>
 | 
			
		||||
    <point x="59.31707" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="59.31707" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="outline6" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="68.68292" y="0.000000"/>
 | 
			
		||||
    <point x="68.68292" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="68.68292" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="outline7" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="88.97561" y="0.000000"/>
 | 
			
		||||
    <point x="88.97561" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="88.97561" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="outline8" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="88.97561" y="0.000000"/>
 | 
			
		||||
    <point x="88.97561" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="88.97561" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="outline9" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="109.2682" y="0.000000"/>
 | 
			
		||||
    <point x="109.2682" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="109.2682" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="outline10" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="37.46341" y="0.000000"/>
 | 
			
		||||
    <point x="37.46341" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="37.46341" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="outline13" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="79.60975" y="0.000000"/>
 | 
			
		||||
    <point x="79.60975" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="79.60975" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
  <outline id="spaceline" corner-radius="1.000000">
 | 
			
		||||
  <outline id="outline3" corner-radius="1.000000">
 | 
			
		||||
    <point x="0.000000" y="0.000000"/>
 | 
			
		||||
    <point x="150.5853" y="0.000000"/>
 | 
			
		||||
    <point x="150.5853" y="52.44877"/>
 | 
			
		||||
    <point x="0.000000" y="52.44877"/>
 | 
			
		||||
    <point x="217.5853" y="0.000000"/>
 | 
			
		||||
    <point x="217.5853" y="37.46341"/>
 | 
			
		||||
    <point x="0.000000" y="37.46341"/>
 | 
			
		||||
  </outline>
 | 
			
		||||
</geometry>
 | 
			
		||||
 | 
			
		||||
@ -14,6 +14,10 @@ install_data(
 | 
			
		||||
    install_dir: pkgdatadir + '/keyboards/geometry/',
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
install_data('dbus/sm.puri.OSK0.xml',
 | 
			
		||||
    install_dir: dbusdir
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
symbols = [
 | 
			
		||||
    'ar.xml',
 | 
			
		||||
    'as-inscript.xml',
 | 
			
		||||
 | 
			
		||||
@ -5,14 +5,18 @@
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.key {
 | 
			
		||||
    color: #deddda;
 | 
			
		||||
    background: #464448;
 | 
			
		||||
    border-width: 0.5px;
 | 
			
		||||
    border-color: #5e5c64;
 | 
			
		||||
    border-radius: 2px;
 | 
			
		||||
    color: #ffffff;
 | 
			
		||||
    background-gradient-direction: vertical;
 | 
			
		||||
    background-gradient-start: rgba(0, 0, 0, 255);
 | 
			
		||||
    background-gradient-end: rgba(64, 64, 64, 255);
 | 
			
		||||
    border-width: 2px;
 | 
			
		||||
    border-color: rgba(128, 128, 128, 255);
 | 
			
		||||
    border-radius: 3px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.key:active {
 | 
			
		||||
    background: #1c71d8;
 | 
			
		||||
    border-color: #3584e4;
 | 
			
		||||
    background-gradient-direction: vertical;
 | 
			
		||||
    background-gradient-start: rgba(0, 0, 255, 255);
 | 
			
		||||
    background-gradient-end: rgba(64, 64, 255, 255);
 | 
			
		||||
    border-color: rgba(160, 160, 255, 255);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@ -1,17 +1,3 @@
 | 
			
		||||
squeekboard (1.0.10+nmu1) amber-phone; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * Add dbus protocol definition.
 | 
			
		||||
    This let's us drop the virtboard build dependency.
 | 
			
		||||
  * debian: Drop virtboard build-dependency
 | 
			
		||||
 | 
			
		||||
 -- Guido Günther <agx@sigxcpu.org>  Mon, 07 Oct 2019 09:31:18 +0200
 | 
			
		||||
 | 
			
		||||
squeekboard (1.0.10) unstable; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * Use a shared DBus definition
 | 
			
		||||
 | 
			
		||||
 -- Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>  Tue, 02 Jul 2019 20:12:02 +0000
 | 
			
		||||
 | 
			
		||||
squeekboard (1.0.9) unstable; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * Initial release.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								debian/control
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								debian/control
									
									
									
									
										vendored
									
									
								
							@ -18,6 +18,7 @@ Homepage: https://source.puri.sm/Librem5/squeekboard
 | 
			
		||||
Package: squeekboard
 | 
			
		||||
Architecture: linux-any
 | 
			
		||||
Depends:
 | 
			
		||||
 libstd-rust-1.34 (= 1.34.2+dfsg1-1),
 | 
			
		||||
 ${shlibs:Depends}
 | 
			
		||||
 ${misc:Depends}
 | 
			
		||||
Description: On-screen keyboard for Wayland
 | 
			
		||||
 | 
			
		||||
@ -66,7 +66,7 @@ struct _EekKeyPrivate
 | 
			
		||||
    EekSymbolMatrix *symbol_matrix;
 | 
			
		||||
    gint column;
 | 
			
		||||
    gint row;
 | 
			
		||||
    gulong oref; // UI outline reference
 | 
			
		||||
    gulong oref;
 | 
			
		||||
    gboolean is_pressed;
 | 
			
		||||
    gboolean is_locked;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@ -199,21 +199,32 @@ void
 | 
			
		||||
_eek_rounded_polygon (cairo_t  *cr,
 | 
			
		||||
                      gdouble   radius,
 | 
			
		||||
                      EekPoint *points,
 | 
			
		||||
                      guint     num_points)
 | 
			
		||||
                      gint      num_points)
 | 
			
		||||
{
 | 
			
		||||
    gint i, j;
 | 
			
		||||
 | 
			
		||||
    cairo_move_to (cr,
 | 
			
		||||
                   (gdouble) (points[num_points - 1].x +
 | 
			
		||||
                              points[0].x) / 2,
 | 
			
		||||
                   (gdouble) (points[num_points - 1].y +
 | 
			
		||||
                              points[0].y) / 2);
 | 
			
		||||
 | 
			
		||||
    for (guint i = 0; i < num_points; i++) {
 | 
			
		||||
        guint j = (i + 1) % num_points;
 | 
			
		||||
 | 
			
		||||
#ifdef KBDRAW_DEBUG
 | 
			
		||||
    printf ("    rounded polygon of radius %f:\n", radius);
 | 
			
		||||
#endif
 | 
			
		||||
    for (i = 0; i < num_points; i++) {
 | 
			
		||||
        j = (i + 1) % num_points;
 | 
			
		||||
        rounded_corner (cr, (gdouble) points[i].x,
 | 
			
		||||
                        (gdouble) points[i].y,
 | 
			
		||||
                        (gdouble) (points[i].x + points[j].x) / 2,
 | 
			
		||||
                        (gdouble) (points[i].y + points[j].y) / 2,
 | 
			
		||||
                        radius);
 | 
			
		||||
    }
 | 
			
		||||
#ifdef KBDRAW_DEBUG
 | 
			
		||||
        printf ("      corner (%d, %d) -> (%d, %d):\n",
 | 
			
		||||
                points[i].x, points[i].y, points[j].x,
 | 
			
		||||
                points[j].y);
 | 
			
		||||
#endif
 | 
			
		||||
    };
 | 
			
		||||
    cairo_close_path (cr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -273,7 +273,7 @@ void eek_keyboard_press_key(EekKeyboard *keyboard, EekKey *key, guint32 timestam
 | 
			
		||||
    // "Borrowed" from eek-context-service; doesn't influence the state but forwards the event
 | 
			
		||||
 | 
			
		||||
    guint keycode = eek_key_get_keycode (key);
 | 
			
		||||
    EekModifierType modifiers = eek_keyboard_get_modifiers (keyboard);
 | 
			
		||||
    guint modifiers = eek_keyboard_get_modifiers (keyboard);
 | 
			
		||||
 | 
			
		||||
    emit_key_activated(keyboard->manager, keyboard, keycode, symbol, modifiers, TRUE, timestamp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -48,8 +48,6 @@ typedef struct _EekKeyboardPrivate EekKeyboardPrivate;
 | 
			
		||||
 *
 | 
			
		||||
 * Contains the state of the physical keyboard.
 | 
			
		||||
 *
 | 
			
		||||
 * Is also a graphical element...
 | 
			
		||||
 *
 | 
			
		||||
 * The #EekKeyboard structure contains only private data and should
 | 
			
		||||
 * only be accessed using the provided API.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@ -79,7 +79,7 @@ typedef struct _TextProperty TextProperty;
 | 
			
		||||
extern void _eek_rounded_polygon               (cairo_t     *cr,
 | 
			
		||||
                                                gdouble      radius,
 | 
			
		||||
                                                EekPoint    *points,
 | 
			
		||||
                                                guint         num_points);
 | 
			
		||||
                                                gint         num_points);
 | 
			
		||||
 | 
			
		||||
static void eek_renderer_real_render_key_label (EekRenderer *self,
 | 
			
		||||
                                                PangoLayout *layout,
 | 
			
		||||
@ -116,8 +116,8 @@ create_keyboard_surface_key_callback (EekElement *element,
 | 
			
		||||
    cairo_rectangle (data->cr,
 | 
			
		||||
                     0.0,
 | 
			
		||||
                     0.0,
 | 
			
		||||
                     bounds.width * priv->scale + 100,
 | 
			
		||||
                     bounds.height * priv->scale + 100);
 | 
			
		||||
                     bounds.width * priv->scale,
 | 
			
		||||
                     bounds.height * priv->scale);
 | 
			
		||||
    cairo_clip (data->cr);
 | 
			
		||||
    render_key (data->renderer, data->cr, EEK_KEY(element), FALSE);
 | 
			
		||||
 | 
			
		||||
@ -205,6 +205,8 @@ render_key_outline (EekRenderer *renderer,
 | 
			
		||||
    EekRendererPrivate *priv = EEK_RENDERER_GET_PRIVATE(renderer);
 | 
			
		||||
    EekOutline *outline;
 | 
			
		||||
    EekBounds bounds;
 | 
			
		||||
    gdouble scale;
 | 
			
		||||
    gint i;
 | 
			
		||||
    guint oref;
 | 
			
		||||
    EekThemeNode *theme_node;
 | 
			
		||||
    EekColor foreground, background, gradient_start, gradient_end, border_color;
 | 
			
		||||
@ -231,14 +233,14 @@ render_key_outline (EekRenderer *renderer,
 | 
			
		||||
        border_width = eek_theme_node_get_border_width (theme_node,
 | 
			
		||||
                                                        EEK_SIDE_TOP);
 | 
			
		||||
        border_radius = eek_theme_node_get_border_radius (theme_node,
 | 
			
		||||
                                                          EEK_CORNER_TOPLEFT);
 | 
			
		||||
                                                          EEK_SIDE_TOP);
 | 
			
		||||
        eek_theme_node_get_border_color (theme_node, EEK_SIDE_TOP,
 | 
			
		||||
                                         &border_color);
 | 
			
		||||
    } else {
 | 
			
		||||
        foreground = priv->default_foreground_color;
 | 
			
		||||
        background = priv->default_background_color;
 | 
			
		||||
        gradient_type = EEK_GRADIENT_NONE;
 | 
			
		||||
        border_width = (gint)round(priv->border_width);
 | 
			
		||||
        border_width = priv->border_width;
 | 
			
		||||
        border_radius = -1;
 | 
			
		||||
        border_color.red = ABS(background.red - foreground.red) * 0.7;
 | 
			
		||||
        border_color.green = ABS(background.green - foreground.green) * 0.7;
 | 
			
		||||
@ -246,15 +248,21 @@ render_key_outline (EekRenderer *renderer,
 | 
			
		||||
        border_color.alpha = foreground.alpha;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* need to rescale so that the border fit inside the clipping
 | 
			
		||||
       region */
 | 
			
		||||
    eek_element_get_bounds (EEK_ELEMENT(key), &bounds);
 | 
			
		||||
    scale = MIN((bounds.width - border_width * 2) / bounds.width,
 | 
			
		||||
                (bounds.height - border_width * 2) / bounds.height);
 | 
			
		||||
 | 
			
		||||
    outline = eek_outline_copy (outline);
 | 
			
		||||
    for (guint i = 0; i < outline->num_points; i++) {
 | 
			
		||||
        outline->points[i].x *= priv->scale;
 | 
			
		||||
        outline->points[i].y *= priv->scale;
 | 
			
		||||
    for (i = 0; i < outline->num_points; i++) {
 | 
			
		||||
        outline->points[i].x *= priv->scale * scale;
 | 
			
		||||
        outline->points[i].y *= priv->scale * scale;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    cairo_translate (cr,
 | 
			
		||||
                     border_width * priv->scale,
 | 
			
		||||
                     border_width * priv->scale);
 | 
			
		||||
                     border_width * priv->scale * scale,
 | 
			
		||||
                     border_width * priv->scale * scale);
 | 
			
		||||
 | 
			
		||||
    if (gradient_type != EEK_GRADIENT_NONE) {
 | 
			
		||||
        cairo_pattern_t *pat;
 | 
			
		||||
@ -332,10 +340,6 @@ render_key_outline (EekRenderer *renderer,
 | 
			
		||||
                          outline->num_points);
 | 
			
		||||
    cairo_stroke (cr);
 | 
			
		||||
 | 
			
		||||
    cairo_translate (cr,
 | 
			
		||||
                     -border_width * priv->scale,
 | 
			
		||||
                     -border_width * priv->scale);
 | 
			
		||||
 | 
			
		||||
    eek_outline_free (outline);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -460,11 +464,10 @@ render_key (EekRenderer *self,
 | 
			
		||||
    if (!outline_surface) {
 | 
			
		||||
        cairo_t *cr;
 | 
			
		||||
 | 
			
		||||
        // Outline will be drawn on the outside of the button, so the surface needs to be bigger than the button
 | 
			
		||||
        outline_surface =
 | 
			
		||||
            cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
 | 
			
		||||
                                        (int)ceil(bounds.width) + 10,
 | 
			
		||||
                                        (int)ceil(bounds.height) + 10);
 | 
			
		||||
                                        bounds.width,
 | 
			
		||||
                                        bounds.height);
 | 
			
		||||
        cr = cairo_create (outline_surface);
 | 
			
		||||
 | 
			
		||||
        /* blank background */
 | 
			
		||||
@ -637,7 +640,7 @@ eek_renderer_real_render_key_label (EekRenderer *self,
 | 
			
		||||
 | 
			
		||||
        size = calculate_font_size (self, base_font, FALSE);
 | 
			
		||||
        priv->font = pango_font_description_copy (base_font);
 | 
			
		||||
        pango_font_description_set_size (priv->font, size * 0.6);
 | 
			
		||||
        pango_font_description_set_size (priv->font, size);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    eek_element_get_bounds (EEK_ELEMENT(key), &bounds);
 | 
			
		||||
 | 
			
		||||
@ -129,7 +129,7 @@ static EekKey *
 | 
			
		||||
eek_section_real_create_key (EekSection *self,
 | 
			
		||||
                             guint       keycode,
 | 
			
		||||
                             gint        column_index,
 | 
			
		||||
                             guint        row_index)
 | 
			
		||||
                             gint        row_index)
 | 
			
		||||
{
 | 
			
		||||
    EekKey *key;
 | 
			
		||||
    gint num_rows;
 | 
			
		||||
@ -479,80 +479,3 @@ eek_section_create_key (EekSection *section,
 | 
			
		||||
                                                       column,
 | 
			
		||||
                                                       row);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void keysizer(EekElement *element, gpointer user_data) {
 | 
			
		||||
    EekKey *key = EEK_KEY(element);
 | 
			
		||||
    EekKeyboard *keyboard = EEK_KEYBOARD(user_data);
 | 
			
		||||
    uint oref = eek_key_get_oref (key);
 | 
			
		||||
    EekOutline *outline = eek_keyboard_get_outline (keyboard, oref);
 | 
			
		||||
    if (outline && outline->num_points > 0) {
 | 
			
		||||
        double minx = outline->points[0].x;
 | 
			
		||||
        double maxx = minx;
 | 
			
		||||
        double miny = outline->points[0].y;
 | 
			
		||||
        double maxy = miny;
 | 
			
		||||
        for (uint i = 1; i < outline->num_points; i++) {
 | 
			
		||||
            EekPoint p = outline->points[i];
 | 
			
		||||
            if (p.x < minx) {
 | 
			
		||||
                minx = p.x;
 | 
			
		||||
            } else if (p.x > maxx) {
 | 
			
		||||
                maxx = p.x;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (p.y < miny) {
 | 
			
		||||
                miny = p.y;
 | 
			
		||||
            } else if (p.y > maxy) {
 | 
			
		||||
                maxy = p.y;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        EekBounds key_bounds = {0};
 | 
			
		||||
        eek_element_get_bounds(element, &key_bounds);
 | 
			
		||||
        key_bounds.height = maxy - miny;
 | 
			
		||||
        key_bounds.width = maxx - minx;
 | 
			
		||||
        eek_element_set_bounds(element, &key_bounds);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct keys_info {
 | 
			
		||||
    uint count;
 | 
			
		||||
    double total_width;
 | 
			
		||||
    double biggest_height;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void keycounter (EekElement *element, gpointer user_data) {
 | 
			
		||||
    struct keys_info *data = user_data;
 | 
			
		||||
    data->count++;
 | 
			
		||||
    EekBounds key_bounds = {0};
 | 
			
		||||
    eek_element_get_bounds(element, &key_bounds);
 | 
			
		||||
    data->total_width += key_bounds.width;
 | 
			
		||||
    if (key_bounds.height > data->biggest_height) {
 | 
			
		||||
        data->biggest_height = key_bounds.height;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const double keyspacing = 3.0;
 | 
			
		||||
 | 
			
		||||
static void keyplacer(EekElement *element, gpointer user_data) {
 | 
			
		||||
    double *current_offset = user_data;
 | 
			
		||||
    EekBounds key_bounds = {0};
 | 
			
		||||
    eek_element_get_bounds(element, &key_bounds);
 | 
			
		||||
    key_bounds.x = *current_offset;
 | 
			
		||||
    key_bounds.y = 0;
 | 
			
		||||
    eek_element_set_bounds(element, &key_bounds);
 | 
			
		||||
    *current_offset += key_bounds.width + keyspacing;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void eek_section_place_keys(EekSection *section, EekKeyboard *keyboard)
 | 
			
		||||
{
 | 
			
		||||
    eek_container_foreach_child(EEK_CONTAINER(section), keysizer, keyboard);
 | 
			
		||||
 | 
			
		||||
    struct keys_info keyinfo = {0};
 | 
			
		||||
    eek_container_foreach_child(EEK_CONTAINER(section), keycounter, &keyinfo);
 | 
			
		||||
    EekBounds section_bounds = {0};
 | 
			
		||||
    eek_element_get_bounds(EEK_ELEMENT(section), §ion_bounds);
 | 
			
		||||
 | 
			
		||||
    double key_offset = (section_bounds.width - (keyinfo.total_width + (keyinfo.count - 1) * keyspacing)) / 2;
 | 
			
		||||
    eek_container_foreach_child(EEK_CONTAINER(section), keyplacer, &key_offset);
 | 
			
		||||
 | 
			
		||||
    section_bounds.height = keyinfo.biggest_height;
 | 
			
		||||
    eek_element_set_bounds(EEK_ELEMENT(section), §ion_bounds);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -127,7 +127,5 @@ EekKey *eek_section_create_key           (EekSection     *section,
 | 
			
		||||
EekKey *eek_section_find_key_by_keycode  (EekSection     *section,
 | 
			
		||||
                                          guint           keycode);
 | 
			
		||||
 | 
			
		||||
void eek_section_place_keys              (EekSection     *section, EekKeyboard *keyboard);
 | 
			
		||||
 | 
			
		||||
G_END_DECLS
 | 
			
		||||
#endif  /* EEK_SECTION_H */
 | 
			
		||||
 | 
			
		||||
@ -214,7 +214,7 @@ struct _EekOutline
 | 
			
		||||
    /*< public >*/
 | 
			
		||||
    gdouble corner_radius;
 | 
			
		||||
    EekPoint *points;
 | 
			
		||||
    guint num_points;
 | 
			
		||||
    gint num_points;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
GType       eek_outline_get_type (void) G_GNUC_CONST;
 | 
			
		||||
 | 
			
		||||
@ -362,6 +362,9 @@ geometry_start_element_callback (GMarkupParseContext *pcontext,
 | 
			
		||||
            eek_element_set_bounds (EEK_ELEMENT(data->keyboard), &bounds);
 | 
			
		||||
        else if (g_strcmp0 (data->element_stack->data, "section") == 0)
 | 
			
		||||
            eek_element_set_bounds (EEK_ELEMENT(data->section), &bounds);
 | 
			
		||||
        else if (g_strcmp0 (data->element_stack->data, "key") == 0)
 | 
			
		||||
            eek_element_set_bounds (EEK_ELEMENT(data->key), &bounds);
 | 
			
		||||
 | 
			
		||||
        goto out;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -501,6 +504,7 @@ geometry_end_element_callback (GMarkupParseContext *pcontext,
 | 
			
		||||
{
 | 
			
		||||
    GeometryParseData *data = user_data;
 | 
			
		||||
    GSList *head = data->element_stack;
 | 
			
		||||
    gint i;
 | 
			
		||||
 | 
			
		||||
    g_free (head->data);
 | 
			
		||||
    data->element_stack = g_slist_next (data->element_stack);
 | 
			
		||||
@ -532,8 +536,7 @@ geometry_end_element_callback (GMarkupParseContext *pcontext,
 | 
			
		||||
        outline->num_points = g_slist_length (data->points);
 | 
			
		||||
        outline->points = g_slice_alloc0 (sizeof (EekPoint) *
 | 
			
		||||
                                          outline->num_points);
 | 
			
		||||
        guint i;
 | 
			
		||||
        for (i = 0, head = data->points = g_slist_reverse (data->points);
 | 
			
		||||
        for (head = data->points = g_slist_reverse (data->points), i = 0;
 | 
			
		||||
             head && i < outline->num_points;
 | 
			
		||||
             head = g_slist_next (head), i++) {
 | 
			
		||||
            memcpy (&outline->points[i], head->data, sizeof (EekPoint));
 | 
			
		||||
@ -637,13 +640,13 @@ symbols_start_element_callback (GMarkupParseContext *pcontext,
 | 
			
		||||
 | 
			
		||||
        data->key = eek_keyboard_find_key_by_keycode (data->keyboard,
 | 
			
		||||
                                                      keycode);
 | 
			
		||||
        /*if (data->key == NULL) {
 | 
			
		||||
        if (data->key == NULL) {
 | 
			
		||||
            g_set_error (error,
 | 
			
		||||
                         G_MARKUP_ERROR,
 | 
			
		||||
                         G_MARKUP_ERROR_INVALID_CONTENT,
 | 
			
		||||
                         "no such keycode %u", keycode);
 | 
			
		||||
            return;
 | 
			
		||||
        }*/
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        attribute = get_attribute (attribute_names, attribute_values,
 | 
			
		||||
                                   "groups");
 | 
			
		||||
@ -718,10 +721,6 @@ symbols_end_element_callback (GMarkupParseContext *pcontext,
 | 
			
		||||
    text = g_strndup (data->text->str, data->text->len);
 | 
			
		||||
 | 
			
		||||
    if (g_strcmp0 (element_name, "key") == 0) {
 | 
			
		||||
        if (!data->key) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        gint num_symbols = g_slist_length (data->symbols);
 | 
			
		||||
        gint levels = num_symbols / data->groups;
 | 
			
		||||
        EekSymbolMatrix *matrix = eek_symbol_matrix_new (data->groups,
 | 
			
		||||
@ -1133,38 +1132,6 @@ eek_xml_keyboard_desc_free (EekXmlKeyboardDesc *desc)
 | 
			
		||||
    g_slice_free (EekXmlKeyboardDesc, desc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct place_data {
 | 
			
		||||
    double desired_width;
 | 
			
		||||
    double current_offset;
 | 
			
		||||
    EekKeyboard *keyboard;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const double section_spacing = 7.0;
 | 
			
		||||
 | 
			
		||||
static void section_placer(EekElement *element, gpointer user_data) {
 | 
			
		||||
    struct place_data *data = (struct place_data*)user_data;
 | 
			
		||||
 | 
			
		||||
    EekBounds section_bounds = {0};
 | 
			
		||||
    eek_element_get_bounds(element, §ion_bounds);
 | 
			
		||||
    section_bounds.width = data->desired_width;
 | 
			
		||||
    eek_element_set_bounds(element, §ion_bounds);
 | 
			
		||||
 | 
			
		||||
    // Sections are rows now. Gather up all the keys and adjust their bounds.
 | 
			
		||||
    eek_section_place_keys(EEK_SECTION(element), EEK_KEYBOARD(data->keyboard));
 | 
			
		||||
 | 
			
		||||
    eek_element_get_bounds(element, §ion_bounds);
 | 
			
		||||
    section_bounds.y = data->current_offset;
 | 
			
		||||
    eek_element_set_bounds(element, §ion_bounds);
 | 
			
		||||
    data->current_offset += section_bounds.height + section_spacing;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void section_counter(EekElement *element, gpointer user_data) {
 | 
			
		||||
    double *total_height = user_data;
 | 
			
		||||
    EekBounds section_bounds = {0};
 | 
			
		||||
    eek_element_get_bounds(element, §ion_bounds);
 | 
			
		||||
    *total_height += section_bounds.height + section_spacing;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
parse_geometry (const gchar *path, EekKeyboard *keyboard, GError **error)
 | 
			
		||||
{
 | 
			
		||||
@ -1217,27 +1184,6 @@ parse_geometry (const gchar *path, EekKeyboard *keyboard, GError **error)
 | 
			
		||||
    }
 | 
			
		||||
    g_hash_table_destroy (oref_hash);
 | 
			
		||||
 | 
			
		||||
    /* Order rows */
 | 
			
		||||
    // This needs to be done after outlines, because outlines define key sizes
 | 
			
		||||
    // TODO: do this only for rows without bounds
 | 
			
		||||
 | 
			
		||||
    // The keyboard width is given by the user via screen size. The height will be given dynamically.
 | 
			
		||||
    // TODO: calculate max line width beforehand for button centering. Leave keyboard centering to the renderer later
 | 
			
		||||
    EekBounds keyboard_bounds = {0};
 | 
			
		||||
    eek_element_get_bounds(EEK_ELEMENT(keyboard), &keyboard_bounds);
 | 
			
		||||
 | 
			
		||||
    struct place_data placer_data = {
 | 
			
		||||
        .desired_width = keyboard_bounds.width,
 | 
			
		||||
        .current_offset = 0,
 | 
			
		||||
        .keyboard = keyboard,
 | 
			
		||||
    };
 | 
			
		||||
    eek_container_foreach_child(EEK_CONTAINER(keyboard), section_placer, &placer_data);
 | 
			
		||||
 | 
			
		||||
    double total_height = 0;
 | 
			
		||||
    eek_container_foreach_child(EEK_CONTAINER(keyboard), section_counter, &total_height);
 | 
			
		||||
    keyboard_bounds.height = total_height;
 | 
			
		||||
    eek_element_set_bounds(EEK_ELEMENT(keyboard), &keyboard_bounds);
 | 
			
		||||
 | 
			
		||||
    geometry_parse_data_free (data);
 | 
			
		||||
    return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -136,9 +136,6 @@ eekboard_context_service_real_create_keyboard (EekboardContextService *self,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    keyboard = eek_keyboard_new (self, layout, CSW, CSH);
 | 
			
		||||
    if (!keyboard) {
 | 
			
		||||
        g_error("Failed to create a keyboard");
 | 
			
		||||
    }
 | 
			
		||||
    g_object_unref (layout);
 | 
			
		||||
 | 
			
		||||
    struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
 | 
			
		||||
 | 
			
		||||
@ -34,8 +34,7 @@ typedef struct {
 | 
			
		||||
    struct xkb_keymap *keymap; // unowned copy
 | 
			
		||||
    XkbDescRec *xkb;
 | 
			
		||||
    guint modifier_keycodes[8];
 | 
			
		||||
    guint modifier_indices[MOD_IDX_LAST];
 | 
			
		||||
    guint group;
 | 
			
		||||
    gint group;
 | 
			
		||||
} SeatEmitter;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -115,7 +114,7 @@ get_keycode_from_gdk_keymap (SeatEmitter *emitter,
 | 
			
		||||
        return FALSE;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < n_keys; i++)
 | 
			
		||||
        if ((guint)keys[i].group == emitter->group)
 | 
			
		||||
        if (keys[i].group == emitter->group)
 | 
			
		||||
            best_match = &keys[i];
 | 
			
		||||
 | 
			
		||||
    if (!best_match) {
 | 
			
		||||
@ -141,23 +140,25 @@ int send_virtual_keyboard_key(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
send_fake_modifiers_events (SeatEmitter         *emitter,
 | 
			
		||||
send_fake_modifier_key_event (SeatEmitter         *emitter,
 | 
			
		||||
                              EekModifierType modifiers,
 | 
			
		||||
                              gboolean        is_pressed,
 | 
			
		||||
                              uint32_t        timestamp)
 | 
			
		||||
{
 | 
			
		||||
    (void)timestamp;
 | 
			
		||||
    unsigned long i;
 | 
			
		||||
 | 
			
		||||
    uint32_t proto_modifiers = 0;
 | 
			
		||||
    if (modifiers & EEK_SHIFT_MASK) {
 | 
			
		||||
        proto_modifiers |= 1<<MOD_IDX_SHIFT;
 | 
			
		||||
    for (i = 0; i < G_N_ELEMENTS(emitter->modifier_keycodes); i++) {
 | 
			
		||||
        if (modifiers & (1 << i)) {
 | 
			
		||||
            guint keycode = emitter->modifier_keycodes[i];
 | 
			
		||||
            printf("Trying to send a modifier %ld press %d\n", i, is_pressed);
 | 
			
		||||
            g_return_if_fail (keycode > 0);
 | 
			
		||||
 | 
			
		||||
            send_virtual_keyboard_key (emitter->virtual_keyboard,
 | 
			
		||||
                                       keycode,
 | 
			
		||||
                                       is_pressed,
 | 
			
		||||
                                       timestamp);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (modifiers & EEK_CONTROL_MASK) {
 | 
			
		||||
        proto_modifiers |= 1<<MOD_IDX_CTRL;
 | 
			
		||||
    }
 | 
			
		||||
    if (modifiers & EEK_MOD1_MASK) {
 | 
			
		||||
        proto_modifiers |= 1<<MOD_IDX_ALT;
 | 
			
		||||
    }
 | 
			
		||||
    zwp_virtual_keyboard_v1_modifiers(emitter->virtual_keyboard, proto_modifiers, 0, 0, emitter->group);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@ -189,14 +190,19 @@ send_fake_key_event (SeatEmitter *emitter,
 | 
			
		||||
    keyboard_modifiers &= (unsigned)~EEK_SHIFT_MASK;
 | 
			
		||||
    keyboard_modifiers &= (unsigned)~EEK_LOCK_MASK;
 | 
			
		||||
    /* FIXME: may need to remap ISO_Level3_Shift and NumLock */
 | 
			
		||||
#if 0
 | 
			
		||||
    keyboard_modifiers &= ~EEK_MOD5_MASK;
 | 
			
		||||
    keyboard_modifiers &= ~client->alt_gr_mask;
 | 
			
		||||
    keyboard_modifiers &= ~client->num_lock_mask;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    modifiers |= keyboard_modifiers;
 | 
			
		||||
 | 
			
		||||
    send_fake_modifiers_events (emitter, modifiers, timestamp);
 | 
			
		||||
    send_fake_modifier_key_event (emitter, modifiers, TRUE, timestamp);
 | 
			
		||||
 | 
			
		||||
    // There's something magical about subtracting/adding 8 to keycodes for some reason
 | 
			
		||||
    send_virtual_keyboard_key (emitter->virtual_keyboard, keycode - 8, (unsigned)pressed, timestamp);
 | 
			
		||||
    send_fake_modifiers_events (emitter, modifiers, timestamp);
 | 
			
		||||
    send_fake_modifier_key_event (emitter, modifiers, FALSE, timestamp);
 | 
			
		||||
 | 
			
		||||
    if (old_keysym != xkeysym)
 | 
			
		||||
        replace_keycode (emitter, keycode, &old_keysym);
 | 
			
		||||
@ -205,7 +211,7 @@ send_fake_key_event (SeatEmitter *emitter,
 | 
			
		||||
static void
 | 
			
		||||
send_fake_key_events (SeatEmitter *emitter,
 | 
			
		||||
                      EekSymbol *symbol,
 | 
			
		||||
                      EekModifierType      keyboard_modifiers,
 | 
			
		||||
                      guint      keyboard_modifiers,
 | 
			
		||||
                      gboolean   pressed,
 | 
			
		||||
                      uint32_t   timestamp)
 | 
			
		||||
{
 | 
			
		||||
@ -247,48 +253,12 @@ send_fake_key_events (SeatEmitter *emitter,
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Finds the first key code for each modifier and saves it in modifier_keycodes */
 | 
			
		||||
static void
 | 
			
		||||
update_modifier_info (SeatEmitter *client)
 | 
			
		||||
{
 | 
			
		||||
    client->modifier_indices[MOD_IDX_SHIFT] = xkb_keymap_mod_get_index(client->keymap, XKB_MOD_NAME_SHIFT);
 | 
			
		||||
    client->modifier_indices[MOD_IDX_CAPS] = xkb_keymap_mod_get_index(client->keymap, XKB_MOD_NAME_CAPS);
 | 
			
		||||
    client->modifier_indices[MOD_IDX_CTRL] = xkb_keymap_mod_get_index(client->keymap, XKB_MOD_NAME_CTRL);
 | 
			
		||||
    client->modifier_indices[MOD_IDX_ALT] = xkb_keymap_mod_get_index(client->keymap, XKB_MOD_NAME_ALT);
 | 
			
		||||
    client->modifier_indices[MOD_IDX_NUM] = xkb_keymap_mod_get_index(client->keymap, XKB_MOD_NAME_NUM);
 | 
			
		||||
    client->modifier_indices[MOD_IDX_MOD3] = xkb_keymap_mod_get_index(client->keymap, "Mod3");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_LOGO] = xkb_keymap_mod_get_index(client->keymap, XKB_MOD_NAME_LOGO);
 | 
			
		||||
    client->modifier_indices[MOD_IDX_ALTGR] = xkb_keymap_mod_get_index(client->keymap, "Mod5");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_NUMLK] = xkb_keymap_mod_get_index(client->keymap, "NumLock");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_ALSO_ALT] = xkb_keymap_mod_get_index(client->keymap, "Alt");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_LVL3] = xkb_keymap_mod_get_index(client->keymap, "LevelThree");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_LALT] = xkb_keymap_mod_get_index(client->keymap, "LAlt");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_RALT] = xkb_keymap_mod_get_index(client->keymap, "RAlt");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_RCONTROL] = xkb_keymap_mod_get_index(client->keymap, "RControl");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_LCONTROL] = xkb_keymap_mod_get_index(client->keymap, "LControl");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_SCROLLLK] = xkb_keymap_mod_get_index(client->keymap, "ScrollLock");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_LVL5] = xkb_keymap_mod_get_index(client->keymap, "LevelFive");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_ALSO_ALTGR] = xkb_keymap_mod_get_index(client->keymap, "AltGr");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_META] = xkb_keymap_mod_get_index(client->keymap, "Meta");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_SUPER] = xkb_keymap_mod_get_index(client->keymap, "Super");
 | 
			
		||||
    client->modifier_indices[MOD_IDX_HYPER] = xkb_keymap_mod_get_index(client->keymap, "Hyper");
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
    for (xkb_mod_index_t i = 0;
 | 
			
		||||
         i < xkb_keymap_num_mods(client->keymap);
 | 
			
		||||
         i++) {
 | 
			
		||||
        g_log("squeek", G_LOG_LEVEL_DEBUG, "%s", xkb_keymap_mod_get_name(client->keymap, i));
 | 
			
		||||
    }*/
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
emit_key_activated (EekboardContextService *manager,
 | 
			
		||||
                    EekKeyboard     *keyboard,
 | 
			
		||||
                    guint            keycode,
 | 
			
		||||
                    EekSymbol       *symbol,
 | 
			
		||||
                    EekModifierType  modifiers,
 | 
			
		||||
                    guint            modifiers,
 | 
			
		||||
                    gboolean pressed,
 | 
			
		||||
                    uint32_t timestamp)
 | 
			
		||||
{
 | 
			
		||||
@ -322,6 +292,72 @@ emit_key_activated (EekboardContextService *manager,
 | 
			
		||||
    SeatEmitter emitter = {0};
 | 
			
		||||
    emitter.virtual_keyboard = manager->virtual_keyboard;
 | 
			
		||||
    emitter.keymap = keyboard->keymap;
 | 
			
		||||
    update_modifier_info (&emitter);
 | 
			
		||||
    send_fake_key_events (&emitter, symbol, modifiers, pressed, timestamp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Finds the first key code for each modifier and saves it in modifier_keycodes */
 | 
			
		||||
static void
 | 
			
		||||
update_modifier_keycodes (SeatEmitter *client)
 | 
			
		||||
{
 | 
			
		||||
    GdkDisplay *display = gdk_display_get_default ();
 | 
			
		||||
    Display *xdisplay = NULL; // GDK_DISPLAY_XDISPLAY (display);
 | 
			
		||||
    return; // FIXME: need to get those codes somehow
 | 
			
		||||
    XModifierKeymap *mods;
 | 
			
		||||
    gint i, j;
 | 
			
		||||
 | 
			
		||||
    //mods = XGetModifierMapping (xdisplay);
 | 
			
		||||
    for (i = 0; i < 8; i++) {
 | 
			
		||||
        client->modifier_keycodes[i] = 0;
 | 
			
		||||
        for (j = 0; j < mods->max_keypermod; j++) {
 | 
			
		||||
            KeyCode keycode = mods->modifiermap[mods->max_keypermod * i + j];
 | 
			
		||||
            if (keycode != 0) {
 | 
			
		||||
                client->modifier_keycodes[i] = keycode;
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    //XFreeModifiermap (mods);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
client_enable_xtest (SeatEmitter *client)
 | 
			
		||||
{
 | 
			
		||||
    //GdkDisplay *display = gdk_display_get_default ();
 | 
			
		||||
    //Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
 | 
			
		||||
    int opcode, event_base, error_base, major_version, minor_version;
 | 
			
		||||
 | 
			
		||||
    /* FIXME: need at least to fetch an xkb keymap (but what for?)
 | 
			
		||||
    g_assert (display);
 | 
			
		||||
 | 
			
		||||
    if (!XTestQueryExtension (xdisplay,
 | 
			
		||||
                              &event_base, &error_base,
 | 
			
		||||
                              &major_version, &minor_version)) {
 | 
			
		||||
        g_warning ("XTest extension is not available");
 | 
			
		||||
        return FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!XkbQueryExtension (xdisplay,
 | 
			
		||||
                            &opcode, &event_base, &error_base,
 | 
			
		||||
                            &major_version, &minor_version)) {
 | 
			
		||||
        g_warning ("Xkb extension is not available");
 | 
			
		||||
        return FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!client->xkb)
 | 
			
		||||
        client->xkb = XkbGetMap (xdisplay, XkbKeySymsMask, XkbUseCoreKbd);
 | 
			
		||||
    g_assert (client->xkb);
 | 
			
		||||
*/
 | 
			
		||||
    update_modifier_keycodes (client);
 | 
			
		||||
 | 
			
		||||
    return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
client_disable_xtest (SeatEmitter *client)
 | 
			
		||||
{
 | 
			
		||||
    //if (client->xkb) {
 | 
			
		||||
      //  XkbFreeKeyboard (client->xkb, 0, TRUE);	/* free_all = TRUE */
 | 
			
		||||
        //client->xkb = NULL;
 | 
			
		||||
    //}
 | 
			
		||||
}
 | 
			
		||||
//#endif  /* HAVE_XTEST */
 | 
			
		||||
 | 
			
		||||
@ -9,36 +9,6 @@
 | 
			
		||||
 | 
			
		||||
#include "virtual-keyboard-unstable-v1-client-protocol.h"
 | 
			
		||||
 | 
			
		||||
/// Indices obtained by xkb_keymap_mod_get_name
 | 
			
		||||
enum mod_indices {
 | 
			
		||||
    MOD_IDX_SHIFT,
 | 
			
		||||
    MOD_IDX_CAPS,
 | 
			
		||||
    MOD_IDX_CTRL,
 | 
			
		||||
    MOD_IDX_ALT,
 | 
			
		||||
    MOD_IDX_NUM,
 | 
			
		||||
    MOD_IDX_MOD3,
 | 
			
		||||
    MOD_IDX_LOGO,
 | 
			
		||||
    MOD_IDX_ALTGR,
 | 
			
		||||
    MOD_IDX_NUMLK, // Caution, not sure which is the right one
 | 
			
		||||
    MOD_IDX_ALSO_ALT, // Not sure why, alt emits the first alt on my setup
 | 
			
		||||
    MOD_IDX_LVL3,
 | 
			
		||||
 | 
			
		||||
    // Not sure if the next 4 are used at all
 | 
			
		||||
    MOD_IDX_LALT,
 | 
			
		||||
    MOD_IDX_RALT,
 | 
			
		||||
    MOD_IDX_RCONTROL,
 | 
			
		||||
    MOD_IDX_LCONTROL,
 | 
			
		||||
 | 
			
		||||
    MOD_IDX_SCROLLLK,
 | 
			
		||||
    MOD_IDX_LVL5,
 | 
			
		||||
    MOD_IDX_ALSO_ALTGR, // Not used on my layout
 | 
			
		||||
    MOD_IDX_META,
 | 
			
		||||
    MOD_IDX_SUPER,
 | 
			
		||||
    MOD_IDX_HYPER,
 | 
			
		||||
 | 
			
		||||
    MOD_IDX_LAST,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
emit_key_activated (EekboardContextService *manager, EekKeyboard *keyboard,
 | 
			
		||||
                    guint            keycode,
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
project(
 | 
			
		||||
    'squeekboard',
 | 
			
		||||
    'c', 'rust',
 | 
			
		||||
    version: '1.0.10',
 | 
			
		||||
    version: '1.0.9',
 | 
			
		||||
    license: 'GPLv3',
 | 
			
		||||
    meson_version: '>=0.43.0',
 | 
			
		||||
    default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ],
 | 
			
		||||
@ -19,12 +19,7 @@ endif
 | 
			
		||||
prefix = get_option('prefix')
 | 
			
		||||
datadir = join_paths(prefix, get_option('datadir'))
 | 
			
		||||
pkgdatadir = join_paths(datadir, meson.project_name())
 | 
			
		||||
if get_option('depdatadir') == ''
 | 
			
		||||
  depdatadir = datadir
 | 
			
		||||
else
 | 
			
		||||
  depdatadir = get_option('depdatadir')
 | 
			
		||||
endif
 | 
			
		||||
dbusdir = join_paths(depdatadir, 'dbus-1/interfaces')
 | 
			
		||||
dbusdir = join_paths(datadir, 'dbus-1/interfaces')
 | 
			
		||||
 | 
			
		||||
subdir('data')
 | 
			
		||||
subdir('protocols')
 | 
			
		||||
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
option('depdatadir', type : 'string', value : '', description : 'System data path. Will be searched for definitions instead of datadir when provided')
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
gnome = import('gnome')
 | 
			
		||||
dbus_src = gnome.gdbus_codegen(
 | 
			
		||||
    'sm.puri.OSK0',
 | 
			
		||||
    join_paths(meson.source_root() / 'data' / 'dbus', 'sm.puri.OSK0.xml')
 | 
			
		||||
    '../data/dbus/sm.puri.OSK0.xml'
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
sources = [
 | 
			
		||||
@ -46,7 +46,6 @@ sources = [
 | 
			
		||||
 | 
			
		||||
cc = meson.get_compiler('c')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
deps = [
 | 
			
		||||
#  dependency('glib-2.0', version: '>=2.26.0'),
 | 
			
		||||
  dependency('gio-2.0', version: '>=2.26.0'),
 | 
			
		||||
@ -56,21 +55,19 @@ deps = [
 | 
			
		||||
  dependency('xkbcommon'),
 | 
			
		||||
  cc.find_library('m'),
 | 
			
		||||
  cc.find_library('rt'),
 | 
			
		||||
  cc.find_library('dl'),
 | 
			
		||||
  cc.find_library('pthread'),
 | 
			
		||||
  cc.find_library('libstd-79f126b09196cdf2'),
 | 
			
		||||
#  dependency('libxklavier'), # FIXME remove
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
# Replacement for eekboard-server
 | 
			
		||||
rslib = static_library(
 | 
			
		||||
  'rslib',
 | 
			
		||||
  sources: ['imservice.rs'],
 | 
			
		||||
  rust_crate_type: 'staticlib'
 | 
			
		||||
  sources: ['imservice.rs']
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
squeekboard = executable('squeekboard',
 | 
			
		||||
  sources,
 | 
			
		||||
  link_with: rslib,
 | 
			
		||||
  link_with: [rslib],
 | 
			
		||||
  include_directories: [include_directories('..'), include_directories('../eek')],
 | 
			
		||||
  dependencies: deps,
 | 
			
		||||
  install: true,
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user