1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00

x11/habak: New port: Background changing app

habak is a background changing app.

habak uses layered model. Lowermost layer is just black screen. You
can put other objects on it and these objects are called habaks.
There are three kinds of habaks: graphic files (images), texts and
"internal objects". Final background image consists of one or more
habaks positioned on the black screen. The order of habaks in the
command line is also the order of displaying them on screen. So
last habak would be drawn on the top of previous.

WWW: https://sourceforge.net/projects/fvwm-crystal/

PR:		266120
This commit is contained in:
Jesús Daniel Colmenares Oviedo 2023-05-01 08:18:02 -04:00 committed by Robert Clausecker
parent 45c4a99d6f
commit 6dc548efbe
8 changed files with 176 additions and 0 deletions

View File

@ -112,6 +112,7 @@
SUBDIR += gtkterm2
SUBDIR += guake
SUBDIR += gxkb
SUBDIR += habak
SUBDIR += hamclock
SUBDIR += hhpc
SUBDIR += hs-xmobar

23
x11/habak/Makefile Normal file
View File

@ -0,0 +1,23 @@
PORTNAME= habak
DISTVERSION= 0.2.5
CATEGORIES= x11
MASTER_SITES= SF/fvwm-crystal/habak/${DISTVERSION}
MAINTAINER= DtxdF@disroot.org
COMMENT= Background changing app
WWW= https://sourceforge.net/projects/fvwm-crystal/
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS+= libImlib2.so:graphics/imlib2 \
libX11.so:x11/libX11
USES= localbase:ldflags
PLIST_FILES= bin/${PORTNAME}
do-install:
(cd ${WRKSRC}/src && ${INSTALL_PROGRAM} ${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME})
.include <bsd.port.mk>

3
x11/habak/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1661854392
SHA256 (habak-0.2.5.tar.gz) = a996ddca6c99bbeb343c2ad584ccd4f51723dece90e828abee99398cd402f509
SIZE (habak-0.2.5.tar.gz) = 28747

View File

@ -0,0 +1,8 @@
--- Makefile.orig 2022-08-30 10:17:30 UTC
+++ Makefile
@@ -3,5 +3,3 @@ all:
clean:
make -C src clean
- rm habak
-

View File

@ -0,0 +1,32 @@
--- src/Makefile.orig 2022-08-30 10:14:57 UTC
+++ src/Makefile
@@ -1,23 +1,22 @@
#CFLAGS = -I/usr/X11R6/include -Wall -g -ggdb
#LDFLAGS = -L/usr/X11R6/lib -lImlib2 -lm -g -ggdb
-CFLAGS += -I/usr/X11R6/include -Wall
-LDFLAGS += -L/usr/X11R6/lib -lImlib2 -lm
+CFLAGS+= -Wall
+LDFLAGS+= -lX11 -lImlib2 -lm
all: habak
- ln -f habak ../habak
habak: xcore.o random.o habak.o
- gcc $(LDFLAGS) -o habak xcore.o random.o habak.o
+ ${CC} $(LDFLAGS) -o habak xcore.o random.o habak.o
habak.o: habak.c types.h defaults.h proto.h
- gcc $(CFLAGS) -c habak.c -o habak.o
+ ${CC} $(CFLAGS) -c habak.c -o habak.o
random.o: random.c proto.h
- gcc $(CFLAGS) -c random.c -o random.o
+ ${CC} $(CFLAGS) -c random.c -o random.o
xcore.o: xcore.c
- gcc $(CFLAGS) -c xcore.c -o xcore.o
+ ${CC} $(CFLAGS) -c xcore.c -o xcore.o
clean:
rm habak *.o

View File

@ -0,0 +1,47 @@
--- src/habak.c.orig 2022-08-30 10:28:37 UTC
+++ src/habak.c
@@ -22,7 +22,7 @@ struct stat file_info;
double xco,yco;
DATA32 *raw_data;
-int i, multy;
+int multy;
Imlib_Image workspace;
habak_t template_habak;
@@ -197,7 +197,7 @@ template_habak.text=DEFAULT_TEXT;
if (argc==1) {print_help(0);}
-for (i=1;i<argc;i++) {
+for (int i=1;i<argc;i++) {
if (!strcmp(argv[i],"-mC")) {
d("parse center");
template_habak.center=MOD_CENTER;
@@ -515,7 +515,7 @@ switch (current_list_item->data.type) {
imlib_context_set_image(current_list_item->data.image);
imlib_image_set_has_alpha(1);
imlib_context_set_color(current_list_item->data.red,current_list_item->data.green,current_list_item->data.blue,current_list_item->data.alpha);
- for (i=0;i<scr->height;i+=2) {
+ for (int i=0;i<scr->height;i+=2) {
imlib_image_draw_line(0,i,current_list_item->data.width,i,0);
}
/* OK, mamy gotowy obraz. Poniewa¿ jest to teraz tak naprawdê _obraz_, to
@@ -533,7 +533,7 @@ switch (current_list_item->data.type) {
imlib_context_set_image(current_list_item->data.image);
imlib_image_set_has_alpha(1);
imlib_context_set_color(current_list_item->data.red,current_list_item->data.green,current_list_item->data.blue,current_list_item->data.alpha);
- for (i=1;i<scr->height;i+=2) {imlib_image_draw_line(0,i,current_list_item->data.width,i,0);}
+ for (int i=1;i<scr->height;i+=2) {imlib_image_draw_line(0,i,current_list_item->data.width,i,0);}
/* OK, mamy gotowy obraz. Poniewa¿ jest to teraz tak naprawdê _obraz_, to
* mo¿na zmieniæ jego typ na "IMAGE_HABAK"
*/
@@ -561,7 +561,7 @@ switch (current_list_item->data.type) {
imlib_context_set_font(current_list_item->data.font);
multxt=current_list_item->data.text;
multy=current_list_item->data.y;
- while (multxt10=strchr(multxt,10)) {
+ while ((multxt10=strchr(multxt,10))) {
*multxt10=0;
imlib_text_draw(current_list_item->data.x,multy,multxt);
*multxt10=10;

View File

@ -0,0 +1,53 @@
--- src/random.c.orig 2004-12-09 17:01:43 UTC
+++ src/random.c
@@ -13,7 +13,7 @@ int syserr;
#define ALLOC_STEP 1000
regex_t regexp;
-int size_files=0, used_files=0, i=0;
+int size_files=0, used_files=0;
char **files, *wyjscie;
regmatch_t matchpos;
@@ -70,9 +70,9 @@ return;
char *randomly_select_font(const char *wejscie){
-files=NULL;wyjscie=NULL;size_files=0;used_files=0;i=0;
+files=NULL;wyjscie=NULL;size_files=0;used_files=0;;
-regcomp(&regexp,"^.*\\.ttf$",REG_ICASE||REG_NOSUB);
+regcomp(&regexp,"^.*\\.ttf$",REG_ICASE|REG_NOSUB);
add_file(wejscie);
@@ -80,7 +80,7 @@ if (used_files==0) {
return NULL;
}
-i=rand()%used_files;
+int i=rand()%used_files;
wyjscie=malloc(strlen(files[i])+1);
strcpy(wyjscie,files[i]);
@@ -92,9 +92,9 @@ return wyjscie;
char *randomly_select_image(const char *wejscie){
-files=NULL;wyjscie=NULL;size_files=0;used_files=0;i=0;
+files=NULL;wyjscie=NULL;size_files=0;used_files=0;;
-regcomp(&regexp,"^.*\\.(bmp|jpg|jpeg|png|tiff|tif|tga|gif|pcx|xpm|pnm|ppm|xbm)$",REG_ICASE||REG_NOSUB);
+regcomp(&regexp,"^.*\\.(bmp|jpg|jpeg|png|tiff|tif|tga|gif|pcx|xpm|pnm|ppm|xbm)$",REG_ICASE|REG_NOSUB);
add_file(wejscie);
@@ -102,7 +102,7 @@ if (used_files==0) {
return NULL;
}
-i=rand()%used_files;
+int i=rand()%used_files;
wyjscie=malloc(strlen(files[i])+1);
strcpy(wyjscie,files[i]);

9
x11/habak/pkg-descr Normal file
View File

@ -0,0 +1,9 @@
habak is a background changing app.
habak uses layered model. Lowermost layer is just black screen. You
can put other objects on it and these objects are called habaks.
There are three kinds of habaks: graphic files (images), texts and
"internal objects". Final background image consists of one or more
habaks positioned on the black screen. The order of habaks in the
command line is also the order of displaying them on screen. So
last habak would be drawn on the top of previous.