Преглед на файлове

Non-working skeleton

master
Bert преди 13 години
ревизия
e7bc3bb71b
променени са 10 файла, в които са добавени 262 реда и са изтрити 0 реда
  1. +28
    -0
      Makefile
  2. +21
    -0
      app.c
  3. +33
    -0
      app.h
  4. +11
    -0
      config.h
  5. +21
    -0
      image.c
  6. +37
    -0
      image.h
  7. +34
    -0
      main.c
  8. +26
    -0
      sxiv.h
  9. +21
    -0
      window.c
  10. +30
    -0
      window.h

+ 28
- 0
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

+ 21
- 0
app.c Целия файл

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

+ 11
- 0
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


+ 21
- 0
image.c Целия файл

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

+ 34
- 0
main.c Целия файл

@@ -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
- 0
sxiv.h Целия файл

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


+ 30
- 0
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 */

Loading…
Отказ
Запис