From 9792a22799f1b1a91f63b0cdef25e8dfe54a699f Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 18 Aug 2016 04:01:45 -0300 Subject: [PATCH] eeshow/gui/gui.c (eeschema_coord): only used in glabel.c, move there --- eeshow/gui/common.h | 1 - eeshow/gui/glabel.c | 17 +++++++++++++++++ eeshow/gui/gui.c | 13 ------------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/eeshow/gui/common.h b/eeshow/gui/common.h index 9239c98..cb86c73 100644 --- a/eeshow/gui/common.h +++ b/eeshow/gui/common.h @@ -129,7 +129,6 @@ void show_history(struct gui_ctx *ctx, enum selecting sel); /* gui.c */ void redraw(const struct gui_ctx *ctx); -void eeschema_coord(const struct gui_ctx *ctx, int x, int y, int *rx, int *ry); struct gui_sheet *find_corresponding_sheet(struct gui_sheet *pick_from, struct gui_sheet *ref_in, const struct gui_sheet *ref); void render_sheet(struct gui_sheet *sheet); diff --git a/eeshow/gui/glabel.c b/eeshow/gui/glabel.c index d99137b..4dc37d2 100644 --- a/eeshow/gui/glabel.c +++ b/eeshow/gui/glabel.c @@ -36,6 +36,23 @@ struct glabel_aoi_ctx { }; +/* ----- Tools ------------------------------------------------------------- */ + + +static void eeschema_coord(const struct gui_ctx *ctx, + int x, int y, int *rx, int *ry) +{ + GtkAllocation alloc; + + gtk_widget_get_allocation(ctx->da, &alloc); + *rx = ((x - ctx->x) >> ctx->zoom) + alloc.width / 2; + *ry = ((y - ctx->y) >> ctx->zoom) + alloc.height / 2; +} + + +/* ----- AoIs -------------------------------------------------------------- */ + + static void glabel_dest_click(void *user) { struct gui_sheet *sheet = user; diff --git a/eeshow/gui/gui.c b/eeshow/gui/gui.c index 196ebe0..dd35afe 100644 --- a/eeshow/gui/gui.c +++ b/eeshow/gui/gui.c @@ -196,19 +196,6 @@ void render_delta(struct gui_ctx *ctx) } -/* ----- Tools ------------------------------------------------------------- */ - - -void eeschema_coord(const struct gui_ctx *ctx, int x, int y, int *rx, int *ry) -{ - GtkAllocation alloc; - - gtk_widget_get_allocation(ctx->da, &alloc); - *rx = ((x - ctx->x) >> ctx->zoom) + alloc.width / 2; - *ry = ((y - ctx->y) >> ctx->zoom) + alloc.height / 2; -} - - /* ----- AoI callbacks ----------------------------------------------------- */