Root/
Source at commit 23dc37014cfc9e163f20db112a42f8e8458a6e75 created 13 years 5 months ago. By Xiangfu Liu, update to svn rev 5982, enable dh_auto_test | |
---|---|
1 | /* |
2 | * gui_status.h - GUI, status area |
3 | * |
4 | * Written 2009, 2010 by Werner Almesberger |
5 | * Copyright 2009, 2010 by Werner Almesberger |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or |
10 | * (at your option) any later version. |
11 | */ |
12 | |
13 | |
14 | #ifndef GUI_STATUS_H |
15 | #define GUI_STATUS_H |
16 | |
17 | #include <gtk/gtk.h> |
18 | |
19 | #include "coord.h" |
20 | #include "expr.h" |
21 | |
22 | |
23 | enum curr_unit { |
24 | curr_unit_mm, |
25 | curr_unit_mil, |
26 | curr_unit_auto, |
27 | curr_unit_n |
28 | }; |
29 | |
30 | |
31 | extern enum curr_unit curr_unit; |
32 | |
33 | |
34 | void edit_pad_type(enum pad_type *type); |
35 | |
36 | void edit_unique(const char **s, int (*validate)(const char *s, void *ctx), |
37 | void *ctx, const char *tooltip); |
38 | void edit_unique_null(const char **s, int (*validate)(const char *s, void *ctx), |
39 | void *ctx, const char *tooltip); |
40 | void edit_unique_with_values(const char **s, |
41 | int (*validate)(const char *s, void *ctx), void *ctx, |
42 | void (*set_values)(void *user, const struct value *values, int n_values), |
43 | void *user, int max_values, const char *tooltip); |
44 | void edit_name(char **s, int (*validate)(const char *s, void *ctx), void *ctx, |
45 | const char *tooltip); |
46 | void edit_expr(struct expr **expr, const char *tooltip); |
47 | void edit_expr_list(struct expr *expr, |
48 | void (*set_values)(void *user, const struct value *values, int n_values), |
49 | void *user, const char *tooltip); |
50 | void edit_dist_expr(struct expr **expr, const char *tooltip); |
51 | void edit_x(struct expr **expr, const char *tooltip); |
52 | void edit_y(struct expr **expr, const char *tooltip); |
53 | void edit_nothing(void); |
54 | |
55 | void set_with_units(void (*set)(const char *tooltip, const char *fmt, ...), |
56 | const char *prefix, unit_type u, const char *tooltip); |
57 | |
58 | #define SETTER(name) \ |
59 | void status_set_##name(const char *tooltip, const char *fmt, ...) \ |
60 | __attribute__((format(printf, 2, 3))) \ |
61 | |
62 | SETTER(type_x); |
63 | SETTER(type_y); |
64 | SETTER(type_entry); |
65 | SETTER(name); |
66 | SETTER(x); |
67 | SETTER(y); |
68 | SETTER(r); |
69 | SETTER(angle); |
70 | SETTER(sys_x); |
71 | SETTER(sys_y); |
72 | SETTER(user_x); |
73 | SETTER(user_y); |
74 | SETTER(zoom); |
75 | SETTER(grid); |
76 | SETTER(unit); |
77 | |
78 | #undef SETTER |
79 | |
80 | void status_set_icon(GtkWidget *image); |
81 | void status_set_xy(struct coord coord); |
82 | void status_set_angle_xy(const char *tooltip, struct coord v); |
83 | |
84 | void status_begin_reporting(void); |
85 | |
86 | void make_status_area(GtkWidget *vbox); |
87 | void cleanup_status_area(void); |
88 | |
89 | #endif /* !GUI_STATUS_H */ |
90 |
Branches:
master