Initial commit: eizoctl

This commit is contained in:
Přemysl Eric Janouch 2024-11-25 02:52:59 +01:00
commit 15ea5b6a8e
Signed by: p
GPG Key ID: A0420B94F92B9493
6 changed files with 1521 additions and 0 deletions

11
.clang-format Normal file
View File

@ -0,0 +1,11 @@
BasedOnStyle: LLVM
ColumnLimit: 80
IndentWidth: 4
TabWidth: 4
UseTab: ForContinuationAndIndentation
AlwaysBreakAfterReturnType: AllDefinitions
BreakBeforeBraces: Linux
SpaceAfterCStyleCast: true
AlignAfterOpenBracket: DontAlign
AlignOperands: DontAlign
SpacesBeforeTrailingComments: 2

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
/compile_commands.json
/eizoctl
/eizoctl.exe
/eizoctltray.png
/eizoctltray.ico
/eizoctltray.o
/eizoctltray.exe

38
Makefile Normal file
View File

@ -0,0 +1,38 @@
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
HIDAPI = hidapi-hidraw
else
HIDAPI = hidapi
endif
CFLAGS += -Wall -Wextra -g -std=gnu99 $(shell pkg-config --cflags $(HIDAPI))
LDFLAGS += $(shell pkg-config --libs $(HIDAPI))
outputs = eizoctl compile_commands.json
ifeq ($(OS),Windows_NT)
outputs += eizoctltray.png eizoctltray.ico eizoctltray.o eizoctltray.exe
LDFLAGS += -static
endif
all: $(outputs)
compile_commands.json:
>$@ echo '[{'
>>$@ echo '"directory": "'"$$(pwd)"'",'
>>$@ echo '"command": "$(CC) $(CFLAGS) eizoctl.c",'
>>$@ echo '"file": "'"$$(pwd)"'/eizoctl.c"'
>>$@ echo '}]'
eizoctl: eizoctl.c
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS)
clean:
rm -f $(outputs)
ifeq ($(OS),Windows_NT)
eizoctltray.png: eizoctltray.svg
rsvg-convert --output=$@ -- $<
eizoctltray.ico: eizoctltray.png
icotool -c -o $@ -- $<
eizoctltray.o: eizoctltray.rc eizoctltray.ico
windres -o $@ $<
eizoctltray.exe: eizoctl.c eizoctltray.o
$(CC) $(CFLAGS) $(CPPFLAGS) -DUNICODE -D_UNICODE -DTRAY \
-o $@ $^ $(LDFLAGS) -mwindows -municode -lPowrProf
endif

1433
eizoctl.c Normal file

File diff suppressed because it is too large Load Diff

1
eizoctltray.rc Normal file
View File

@ -0,0 +1 @@
1 ICON "eizoctltray.ico"

31
eizoctltray.svg Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" width="16" height="16" viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="shadow" color-interpolation-filters="sRGB">
<!-- I'm not sure why this works the way it does, but hey.
Neither feDropShadow nor feGaussianBlur do. -->
<feConvolveMatrix in="SourceAlpha"
kernelMatrix="1 2 1 2 4 2 1 2 1" divisor="16" />
<feMerge>
<feMergeNode />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
<linearGradient id="gradient" x1="25%" y1="0%" x2="75%" y2="100%">
<stop offset="0%" stop-color="#fff" />
<stop offset="100%" stop-color="#eee" />
</linearGradient>
<linearGradient id="panel-bg" x1="25%" y1="0%" x2="75%" y2="100%">
<stop offset="0%" stop-color="hsl(300, 100%, 75%)" />
<stop offset="100%" stop-color="hsl(240, 100%, 75%)" />
</linearGradient>
</defs>
<g filter="url(#shadow)" fill="url(#gradient)">
<rect x="1" y="2" width="14" height="10" />
<rect x="3" y="4" width="10" height="6" fill="url(#panel-bg)" />
<rect x="5" y="13" width="6" height="2" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB