Root/gui_status.h

Source at commit 809e8142b53ba7227241d39d2c4057f7201087a9 created 4 years 9 months ago.
By Werner Almesberger, gui.c (change_world): don't change color of the active frame
1/*
2 * gui_status.h - GUI, status area
3 *
4 * Written 2009, 2010, 2012 by Werner Almesberger
5 * Copyright 2009, 2010, 2012 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#include "obj.h"
22
23
24enum curr_unit {
25    curr_unit_mm,
26    curr_unit_mil,
27    curr_unit_auto,
28    curr_unit_n
29};
30
31
32extern enum curr_unit curr_unit;
33
34
35void edit_var_type(struct var *var);
36void edit_pad_type(enum pad_type *type);
37
38void edit_unique(const char **s, int (*validate)(const char *s, void *ctx),
39    void *ctx, const char *tooltip);
40void edit_unique_null(const char **s, int (*validate)(const char *s, void *ctx),
41    void *ctx, const char *tooltip);
42void edit_unique_with_values(const char **s,
43    int (*validate)(const char *s, void *ctx), void *ctx,
44    void (*set_values)(void *user, const struct value *values, int n_values),
45    void *user, int max_values, const char *tooltip);
46void edit_name(char **s, int (*validate)(const char *s, void *ctx), void *ctx,
47    const char *tooltip);
48void edit_expr(struct expr **expr, const char *tooltip);
49void edit_expr_list(struct expr *expr,
50    void (*set_values)(void *user, const struct value *values, int n_values),
51    void *user, const char *tooltip);
52void edit_dist_expr(struct expr **expr, const char *tooltip);
53void edit_x(struct expr **expr, const char *tooltip);
54void edit_y(struct expr **expr, const char *tooltip);
55void edit_nothing(void);
56
57void set_with_units(void (*set)(const char *tooltip, const char *fmt, ...),
58    const char *prefix, unit_type u, const char *tooltip);
59
60#define SETTER(name) \
61    void status_set_##name(const char *tooltip, const char *fmt, ...) \
62       __attribute__((format(printf, 2, 3))) \
63
64SETTER(type_x);
65SETTER(type_y);
66SETTER(type_entry);
67SETTER(name);
68SETTER(x);
69SETTER(y);
70SETTER(r);
71SETTER(angle);
72SETTER(sys_x);
73SETTER(sys_y);
74SETTER(user_x);
75SETTER(user_y);
76SETTER(zoom);
77SETTER(grid);
78SETTER(unit);
79
80#undef SETTER
81
82void status_set_icon(GtkWidget *image);
83void status_set_xy(struct coord coord);
84void status_set_angle_xy(const char *tooltip, struct coord v);
85
86void status_begin_reporting(void);
87
88void make_status_area(GtkWidget *vbox);
89void cleanup_status_area(void);
90
91#endif /* !GUI_STATUS_H */
92

Archive Download this file

Branches:
master



interactive