2009-08-03 19:12:47 +03:00
|
|
|
/*
|
|
|
|
* gui_status.h - GUI, status area
|
|
|
|
*
|
2010-01-03 01:27:36 +02:00
|
|
|
* Written 2009, 2010 by Werner Almesberger
|
|
|
|
* Copyright 2009, 2010 by Werner Almesberger
|
2009-08-03 19:12:47 +03:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GUI_STATUS_H
|
|
|
|
#define GUI_STATUS_H
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "coord.h"
|
|
|
|
#include "expr.h"
|
|
|
|
|
|
|
|
|
2009-08-16 14:21:48 +03:00
|
|
|
enum curr_unit {
|
|
|
|
curr_unit_mm,
|
|
|
|
curr_unit_mil,
|
|
|
|
curr_unit_auto,
|
|
|
|
curr_unit_n
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern enum curr_unit curr_unit;
|
|
|
|
|
|
|
|
|
2009-09-13 02:15:15 +03:00
|
|
|
void edit_pad_type(enum pad_type *type);
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
void edit_unique(const char **s, int (*validate)(const char *s, void *ctx),
|
2010-01-03 02:36:52 +02:00
|
|
|
void *ctx, const char *tooltip);
|
2009-08-03 19:12:47 +03:00
|
|
|
void edit_unique_null(const char **s, int (*validate)(const char *s, void *ctx),
|
2010-01-03 02:36:52 +02:00
|
|
|
void *ctx, const char *tooltip);
|
2009-08-16 07:12:37 +03:00
|
|
|
void edit_unique_with_values(const char **s,
|
|
|
|
int (*validate)(const char *s, void *ctx), void *ctx,
|
|
|
|
void (*set_values)(void *user, const struct value *values, int n_values),
|
2010-01-03 02:36:52 +02:00
|
|
|
void *user, int max_values, const char *tooltip);
|
|
|
|
void edit_name(char **s, int (*validate)(const char *s, void *ctx), void *ctx,
|
|
|
|
const char *tooltip);
|
|
|
|
void edit_expr(struct expr **expr, const char *tooltip);
|
2009-08-16 08:05:12 +03:00
|
|
|
void edit_expr_list(struct expr *expr,
|
|
|
|
void (*set_values)(void *user, const struct value *values, int n_values),
|
2010-01-03 02:36:52 +02:00
|
|
|
void *user, const char *tooltip);
|
2010-02-18 15:39:20 +02:00
|
|
|
void edit_dist_expr(struct expr **expr, const char *tooltip);
|
2010-01-03 02:36:52 +02:00
|
|
|
void edit_x(struct expr **expr, const char *tooltip);
|
|
|
|
void edit_y(struct expr **expr, const char *tooltip);
|
2009-08-03 19:12:47 +03:00
|
|
|
void edit_nothing(void);
|
|
|
|
|
2010-01-03 01:27:36 +02:00
|
|
|
void set_with_units(void (*set)(const char *tooltip, const char *fmt, ...),
|
|
|
|
const char *prefix, unit_type u, const char *tooltip);
|
|
|
|
|
|
|
|
#define SETTER(name) \
|
|
|
|
void status_set_##name(const char *tooltip, const char *fmt, ...) \
|
|
|
|
__attribute__((format(printf, 2, 3))) \
|
|
|
|
|
|
|
|
SETTER(type_x);
|
|
|
|
SETTER(type_y);
|
|
|
|
SETTER(type_entry);
|
|
|
|
SETTER(name);
|
|
|
|
SETTER(x);
|
|
|
|
SETTER(y);
|
|
|
|
SETTER(r);
|
|
|
|
SETTER(angle);
|
|
|
|
SETTER(sys_x);
|
|
|
|
SETTER(sys_y);
|
|
|
|
SETTER(user_x);
|
|
|
|
SETTER(user_y);
|
|
|
|
SETTER(zoom);
|
|
|
|
SETTER(grid);
|
|
|
|
SETTER(unit);
|
|
|
|
|
|
|
|
#undef SETTER
|
2009-08-03 19:12:47 +03:00
|
|
|
|
2009-12-15 23:24:30 +02:00
|
|
|
void status_set_icon(GtkWidget *image);
|
2009-08-03 19:12:47 +03:00
|
|
|
void status_set_xy(struct coord coord);
|
2010-01-03 01:27:36 +02:00
|
|
|
void status_set_angle_xy(const char *tooltip, struct coord v);
|
2009-08-03 19:12:47 +03:00
|
|
|
|
|
|
|
void status_begin_reporting(void);
|
|
|
|
|
2009-09-13 02:15:15 +03:00
|
|
|
void make_status_area(GtkWidget *vbox);
|
|
|
|
void cleanup_status_area(void);
|
2009-08-03 19:12:47 +03:00
|
|
|
|
|
|
|
#endif /* !GUI_STATUS_H */
|