Skip to content

Commit

Permalink
Move/remove files used only in minimal example
Browse files Browse the repository at this point in the history
Rename utils.c to write_ppm.c, move to examples dir, remove utils.h.
Move the include-all libmypaint.c to examples folder, replace its
use for top-dir identification in autogen.sh with mypaint-config.h
  • Loading branch information
jplloyd committed Dec 27, 2019
1 parent f0f2c6f commit 0a26ee1
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 14 deletions.
7 changes: 1 addition & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ if HAVE_INTROSPECTION
introspection_sources = \
$(MyPaint_introspectable_headers) \
brushmodes.c \
libmypaint.c \
mypaint-brush-settings.c \
mypaint-rectangle.c \
operationqueue.c \
utils.c \
fifo.c \
mypaint-mapping.c \
mypaint.c \
Expand Down Expand Up @@ -125,8 +123,7 @@ LIBMYPAINT_SOURCES = \
mypaint-tiled-surface.c \
operationqueue.c \
rng-double.c \
tilemap.c \
utils.c
tilemap.c

libmypaint_@LIBMYPAINT_API_PLATFORM_VERSION@_la_SOURCES = $(libmypaint_public_HEADERS) $(LIBMYPAINT_SOURCES)

Expand All @@ -144,12 +141,10 @@ EXTRA_DIST = \
fifo.h \
generate.py \
helpers.h \
libmypaint.c \
operationqueue.h \
rng-double.h \
tiled-surface-private.h \
tilemap.h \
utils.h \
glib/mypaint-brush.c

if HAVE_I18N
Expand Down
2 changes: 1 addition & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LIBTOOL_WIN32_REQUIRED_VERSION=2.2

PROJECT="libmypaint"
TEST_TYPE=-f
FILE=libmypaint.c
FILE=mypaint-config.h


srcdir=`dirname $0`
Expand Down
2 changes: 1 addition & 1 deletion libmypaint.c → examples/libmypaint.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "fifo.c"
#include "operationqueue.c"
#include "rng-double.c"
#include "utils.c"
#include "write_ppm.c"
#include "tilemap.c"

#include "mypaint.c"
Expand Down
2 changes: 0 additions & 2 deletions examples/minimal.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "libmypaint.c"
#include "mypaint-fixed-tiled-surface.h"

#include "utils.h" /* Not public API, just used for write_ppm to demonstrate */

void
stroke_to(MyPaintBrush *brush, MyPaintSurface *surf, float x, float y)
{
Expand Down
4 changes: 2 additions & 2 deletions utils.c → examples/write_ppm.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ iterate_over_line_chunks(MyPaintTiledSurface * tiled_surface, int height, int wi
const int tiles_per_row = (width / tile_size) + 1*(width % tile_size != 0);

MyPaintTileRequest *requests = (MyPaintTileRequest *)malloc(tiles_per_row * sizeof(MyPaintTileRequest));

for (int ty = 0; ty < number_of_tile_rows; ty++) {

// Fetch all horizontal tiles in current tile row
Expand Down Expand Up @@ -121,7 +121,7 @@ void write_ppm(MyPaintFixedTiledSurface *fixed_surface, char *filepath)
const int width = mypaint_fixed_tiled_surface_get_width(fixed_surface);
const int height = mypaint_fixed_tiled_surface_get_height(fixed_surface);
fprintf(data.fp, "P3\n#Handwritten\n%d %d\n255\n", width, height);

iterate_over_line_chunks((MyPaintTiledSurface *)fixed_surface,
height, width,
write_ppm_chunk, &data);
Expand Down
2 changes: 0 additions & 2 deletions utils.h

This file was deleted.

0 comments on commit 0a26ee1

Please sign in to comment.