From e7bc3bb71beaa1d026400779706094f870aca069 Mon Sep 17 00:00:00 2001 From: Bert Date: Mon, 17 Jan 2011 14:57:59 +0100 Subject: Non-working skeleton --- Makefile | 28 ++++++++++++++++++++++++++++ app.c | 21 +++++++++++++++++++++ app.h | 33 +++++++++++++++++++++++++++++++++ config.h | 11 +++++++++++ image.c | 21 +++++++++++++++++++++ image.h | 37 +++++++++++++++++++++++++++++++++++++ main.c | 34 ++++++++++++++++++++++++++++++++++ sxiv.h | 26 ++++++++++++++++++++++++++ window.c | 21 +++++++++++++++++++++ window.h | 30 ++++++++++++++++++++++++++++++ 10 files changed, 262 insertions(+) create mode 100644 Makefile create mode 100644 app.c create mode 100644 app.h create mode 100644 config.h create mode 100644 image.c create mode 100644 image.h create mode 100644 main.c create mode 100644 sxiv.h create mode 100644 window.c create mode 100644 window.h diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d205b70 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +all: sxiv + +CC?=gcc +PREFIX?=/usr/local +CFLAGS+= -Wall -pedantic -g +LDFLAGS+= +LIBS+= + +SRCFILES=$(wildcard *.c) +OBJFILES=$(SRCFILES:.c=.o) + +physlock: $(OBJFILES) + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + +%.o: %.c Makefile + $(CC) $(CFLAGS) -c -o $@ $< + +install: all + install -D -m 4755 -o root -g root sxiv $(PREFIX)/sbin/sxiv + +clean: + rm -f sxiv *.o + +tags: *.h *.c + ctags $^ + +cscope: *.h *.c + cscope -b diff --git a/app.c b/app.c new file mode 100644 index 0000000..4c0fa32 --- /dev/null +++ b/app.c @@ -0,0 +1,21 @@ +/* sxiv: app.c + * Copyright (c) 2011 Bert Muennich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "sxiv.h" +#include "app.h" + diff --git a/app.h b/app.h new file mode 100644 index 0000000..2f65579 --- /dev/null +++ b/app.h @@ -0,0 +1,33 @@ +/* sxiv: app.h + * Copyright (c) 2011 Bert Muennich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef APP_H +#define APP_H + +#include "image.h" +#include "window.h" + +typedef struct app_s { + const char **filenames; + unsigned int filecnt; + unsigned int fileidx; + img_t img; + win_t win; +} app_t; + +#endif /* APP_H */ diff --git a/config.h b/config.h new file mode 100644 index 0000000..63c5d0f --- /dev/null +++ b/config.h @@ -0,0 +1,11 @@ +/* */ +#define WIN_WIDTH 800 +#define WIN_HEIGHT 600 + +/* */ +#define SCALE_MODE SCALE_DOWN + +/* */ +#define ZOOM_MIN 12.5 +#define ZOOM_MAX 400 + diff --git a/image.c b/image.c new file mode 100644 index 0000000..e5503f1 --- /dev/null +++ b/image.c @@ -0,0 +1,21 @@ +/* sxiv: image.c + * Copyright (c) 2011 Bert Muennich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "sxiv.h" +#include "image.h" + diff --git a/image.h b/image.h new file mode 100644 index 0000000..4edb794 --- /dev/null +++ b/image.h @@ -0,0 +1,37 @@ +/* sxiv: image.h + * Copyright (c) 2011 Bert Muennich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef IMAGE_H +#define IMAGE_H + +typedef enum { + SCALE_DOWN = 0; + SCALE_FIT; + SCALE_ZOOM; +} scalemode_t; + +typedef struct img_s { + scalemode_t scalemode; + int zoom; + int w; + int h; + int x; + int y; +} img_t; + +#endif /* IMAGE_H */ diff --git a/main.c b/main.c new file mode 100644 index 0000000..b2f739a --- /dev/null +++ b/main.c @@ -0,0 +1,34 @@ +/* sxiv: main.c + * Copyright (c) 2011 Bert Muennich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "sxiv.h" +#include "app.h" + +app_t app; + +void cleanup() { + static int in = 0; + + if (!in++) { + } +} + +int main(int argc, char **argv) { + + return 0; +} diff --git a/sxiv.h b/sxiv.h new file mode 100644 index 0000000..e5458d5 --- /dev/null +++ b/sxiv.h @@ -0,0 +1,26 @@ +/* sxiv: sxiv.h + * Copyright (c) 2011 Bert Muennich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef SXIV_H +#define SXIV_H + +#include "config.h" + +#define VERSION "git-20110117" + +#endif /* SXIV_H */ diff --git a/window.c b/window.c new file mode 100644 index 0000000..90f24c3 --- /dev/null +++ b/window.c @@ -0,0 +1,21 @@ +/* sxiv: window.c + * Copyright (c) 2011 Bert Muennich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "sxiv.h" +#include "window.h" + diff --git a/window.h b/window.h new file mode 100644 index 0000000..3ac34cb --- /dev/null +++ b/window.h @@ -0,0 +1,30 @@ +/* sxiv: window.h + * Copyright (c) 2011 Bert Muennich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef WINDOW_H +#define WINDOW_H + +typedef struct win_s { + int w; + int h; + int x; + int y; + int bw; +} win_t; + +#endif /* WINDOW_H */ -- cgit v1.2.3