Non-working skeleton

This commit is contained in:
Bert 2011-01-17 14:57:59 +01:00
commit e7bc3bb71b
10 changed files with 262 additions and 0 deletions

28
Makefile Normal file
View File

@ -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

21
app.c Normal file
View File

@ -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"

33
app.h Normal file
View File

@ -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 */

11
config.h Normal file
View File

@ -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

21
image.c Normal file
View File

@ -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"

37
image.h Normal file
View File

@ -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 */

34
main.c Normal file
View File

@ -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;
}

26
sxiv.h Normal file
View File

@ -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 */

21
window.c Normal file
View File

@ -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"

30
window.h Normal file
View File

@ -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 */