diff options
author | Bert <ber.t@gmx.com> | 2011-01-17 14:57:59 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-01-17 14:57:59 +0100 |
commit | e7bc3bb71beaa1d026400779706094f870aca069 (patch) | |
tree | 126385461d011d2b7ef674a563f371358f3b5563 |
Non-working skeleton
-rw-r--r-- | Makefile | 28 | ||||
-rw-r--r-- | app.c | 21 | ||||
-rw-r--r-- | app.h | 33 | ||||
-rw-r--r-- | config.h | 11 | ||||
-rw-r--r-- | image.c | 21 | ||||
-rw-r--r-- | image.h | 37 | ||||
-rw-r--r-- | main.c | 34 | ||||
-rw-r--r-- | sxiv.h | 26 | ||||
-rw-r--r-- | window.c | 21 | ||||
-rw-r--r-- | window.h | 30 |
10 files changed, 262 insertions, 0 deletions
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 @@ -0,0 +1,21 @@ +/* sxiv: app.c + * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de> + * + * 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" + @@ -0,0 +1,33 @@ +/* sxiv: app.h + * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de> + * + * 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 + @@ -0,0 +1,21 @@ +/* sxiv: image.c + * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de> + * + * 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" + @@ -0,0 +1,37 @@ +/* sxiv: image.h + * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de> + * + * 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 */ @@ -0,0 +1,34 @@ +/* sxiv: main.c + * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de> + * + * 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; +} @@ -0,0 +1,26 @@ +/* sxiv: sxiv.h + * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de> + * + * 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 <muennich at informatik.hu-berlin.de> + * + * 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 <muennich at informatik.hu-berlin.de> + * + * 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 */ |