diff --git a/gui_status.c b/gui_status.c index 05d92e0..222a144 100644 --- a/gui_status.c +++ b/gui_status.c @@ -24,6 +24,7 @@ #include "error.h" #include "unparse.h" #include "obj.h" +#include "layer.h" #include "gui_util.h" #include "gui_style.h" #include "gui_canvas.h" @@ -195,28 +196,7 @@ static GtkWidget *pad_type; static void show_pad_type(void) { - const char *s; - - switch (*curr_pad_type) { - case pt_normal: - s = "normal"; - break; - case pt_bare: - s = "bare"; - break; - case pt_trace: - s = "trace"; - break; - case pt_paste: - s = "paste"; - break; - case pt_mask: - s = "mask"; - break; - default: - abort(); - } - gtk_label_set_text(GTK_LABEL(pad_type), s); + gtk_label_set_text(GTK_LABEL(pad_type), pad_type_name(*curr_pad_type)); } diff --git a/layer.c b/layer.c index b6a533c..b62533c 100644 --- a/layer.c +++ b/layer.c @@ -1,8 +1,8 @@ /* * layer.c - PCB layers on a pad * - * Written 2009-2011 by Werner Almesberger - * Copyright 2009-2011 by Werner Almesberger + * Written 2009-2012 by Werner Almesberger + * Copyright 2009-2012 by Werner Almesberger * * 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 @@ -86,6 +86,25 @@ enum pad_type layers_to_pad_type(layer_type layers) } +const char *pad_type_name(enum pad_type type) +{ + switch (type) { + case pt_normal: + return "normal"; + case pt_bare: + return "bare"; + case pt_trace: + return "trace"; + case pt_paste: + return "paste"; + case pt_mask: + return "mask"; + default: + abort(); + } +} + + /* ----- layers in mechanical holes ---------------------------------------- */ diff --git a/layer.h b/layer.h index 873e99c..b52a362 100644 --- a/layer.h +++ b/layer.h @@ -1,8 +1,8 @@ /* * layer.h - PCB layers on a pad * - * Written 2009-2011 by Werner Almesberger - * Copyright 2009-2011 by Werner Almesberger + * Written 2009-2012 by Werner Almesberger + * Copyright 2009-2012 by Werner Almesberger * * 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 @@ -75,6 +75,7 @@ enum pad_type { layer_type pad_type_to_layers(enum pad_type type); enum pad_type layers_to_pad_type(layer_type layers); +const char *pad_type_name(enum pad_type type); layer_type mech_hole_layers(void);