From 2d389342fddac8143621e8a3f9a0cb1ea8cfd39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 14 Jan 2020 14:09:24 +0100 Subject: [PATCH] cairo-renderer: Update coding style and add comment explaining how to use the inter process communication to update the GUI with rendering status updates --- output-renderers/cairo-renderer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/output-renderers/cairo-renderer.c b/output-renderers/cairo-renderer.c index a768ea8..28abcf8 100644 --- a/output-renderers/cairo-renderer.c +++ b/output-renderers/cairo-renderer.c @@ -275,12 +275,20 @@ static int cairo_renderer_render_cell_to_vector_file(GdsOutputRenderer *renderer goto ret_parent; } - /* Close stdin and (stdout and stderr may live on) */ + /* We are now in a separate process just for rendering the output image. + * You may print a log message to the activity bar of the gui by writing a line + * teminated with '\n' to comm_pipe[1]. This will be handled by the parent process. + * Directly calling the update function + * gds_output_renderer_update_async_progress() + * does not have any effect because this is a separate process. + */ + + /* + * Close stdin and (stdout and stderr may live on) + */ close(0); - //close(1); close(comm_pipe[0]); - layers = (struct cairo_layer *)calloc(MAX_LAYERS, sizeof(struct cairo_layer)); /* Clear layers */