summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-04 01:55:29 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-04 02:11:45 (GMT)
commit9132d430693cfda5e0c046a902cab469f83418de (patch)
tree3ddfe6bb9b282f9b70464bb0a5016a1b3c55e8a2 /gfx
parent1eebec29e302f07a77cfcfa6db5a08dedc727eda (diff)
downloadeeshow-9132d430693cfda5e0c046a902cab469f83418de.zip
eeshow-9132d430693cfda5e0c046a902cab469f83418de.tar.gz
eeshow-9132d430693cfda5e0c046a902cab469f83418de.tar.bz2
main/eediff.c: the big leap - use diff_process_file (WIP)
There is still some cleanup left to do, including doing something about -e and -1.
Diffstat (limited to 'gfx')
-rw-r--r--gfx/diff.c6
-rw-r--r--gfx/diff.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/gfx/diff.c b/gfx/diff.c
index 824b37f..bbb8142 100644
--- a/gfx/diff.c
+++ b/gfx/diff.c
@@ -150,7 +150,7 @@ static void *diff_init(void)
}
-static void *diff_process_file(struct diff *diff, struct file_names *file_names,
+void *diff_process_file(struct diff *diff, struct file_names *file_names,
int argc, char *const *argv, const char *opts)
{
struct file_names *fn = file_names;
@@ -242,10 +242,6 @@ static bool diff_args(void *ctx, int argc, char *const *argv, const char *opts)
diff->new_gfx = diff_process_file(diff, &file_names, argc, argv, opts);
free_file_names(&file_names);
- diff->gfx = gfx_init(&cro_img_ops);
- if (!diff->gfx)
- return 0;
-
return gfx_args(diff->gfx, argc, argv, opts);
}
diff --git a/gfx/diff.h b/gfx/diff.h
index 5bee90c..90eb66d 100644
--- a/gfx/diff.h
+++ b/gfx/diff.h
@@ -20,6 +20,7 @@
#include "gfx/gfx.h"
#include "gfx/cro.h"
+#include "kicad/ext.h"
extern const struct gfx_ops diff_ops;
@@ -31,6 +32,8 @@ struct area {
struct area *next;
};
+struct diff;
+
void add_area(struct area **areas, int xa, int ya, int xb, int yb,
uint32_t color);
@@ -41,4 +44,7 @@ void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale,
struct cro_ctx *new, struct cro_ctx *new_extra,
const struct area *areas);
+void *diff_process_file(struct diff *diff, struct file_names *file_names,
+ int argc, char *const *argv, const char *opts);
+
#endif /* !GFX_DIFF_H */