gui_status.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. #ifndef GUI_STATUS_H
  13. #define GUI_STATUS_H
  14. #include <gtk/gtk.h>
  15. #include "coord.h"
  16. #include "expr.h"
  17. #include "obj.h"
  18. enum curr_unit {
  19. curr_unit_mm,
  20. curr_unit_mil,
  21. curr_unit_auto,
  22. curr_unit_n
  23. };
  24. extern enum curr_unit curr_unit;
  25. void edit_var_type(struct var *var);
  26. void edit_pad_type(enum pad_type *type);
  27. void edit_unique(const char **s, int (*validate)(const char *s, void *ctx),
  28. void *ctx, const char *tooltip);
  29. void edit_unique_null(const char **s, int (*validate)(const char *s, void *ctx),
  30. void *ctx, const char *tooltip);
  31. void edit_unique_with_values(const char **s,
  32. int (*validate)(const char *s, void *ctx), void *ctx,
  33. void (*set_values)(void *user, const struct value *values, int n_values),
  34. void *user, int max_values, const char *tooltip);
  35. void edit_name(char **s, int (*validate)(const char *s, void *ctx), void *ctx,
  36. const char *tooltip);
  37. void edit_expr(struct expr **expr, const char *tooltip);
  38. void edit_expr_list(struct expr *expr,
  39. void (*set_values)(void *user, const struct value *values, int n_values),
  40. void *user, const char *tooltip);
  41. void edit_dist_expr(struct expr **expr, const char *tooltip);
  42. void edit_x(struct expr **expr, const char *tooltip);
  43. void edit_y(struct expr **expr, const char *tooltip);
  44. void edit_nothing(void);
  45. void set_with_units(void (*set)(const char *tooltip, const char *fmt, ...),
  46. const char *prefix, unit_type u, const char *tooltip);
  47. #define SETTER(name) \
  48. void status_set_##name(const char *tooltip, const char *fmt, ...) \
  49. __attribute__((format(printf, 2, 3))) \
  50. SETTER(type_x);
  51. SETTER(type_y);
  52. SETTER(type_entry);
  53. SETTER(name);
  54. SETTER(x);
  55. SETTER(y);
  56. SETTER(r);
  57. SETTER(angle);
  58. SETTER(sys_x);
  59. SETTER(sys_y);
  60. SETTER(user_x);
  61. SETTER(user_y);
  62. SETTER(zoom);
  63. SETTER(grid);
  64. SETTER(unit);
  65. #undef SETTER
  66. void status_set_icon(GtkWidget *image);
  67. void status_set_xy(struct coord coord);
  68. void status_set_angle_xy(const char *tooltip, struct coord v);
  69. void status_begin_reporting(void);
  70. void make_status_area(GtkWidget *vbox);
  71. void cleanup_status_area(void);
  72. #endif /* !GUI_STATUS_H */