gui_style.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * gui_style.h - GUI, style definitions
  3. *
  4. * Written 2009-2011 by Werner Almesberger
  5. * Copyright 2009-2011 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_STYLE_H
  13. #define GUI_STYLE_H
  14. #include <gtk/gtk.h>
  15. #include "inst.h"
  16. /* ----- screen distances, etc. -------------------------------------------- */
  17. #define CANVAS_CLEARANCE 10
  18. #define ZOOM_STOP_BORDER 50 /* stop zoom if we have at least a 50
  19. pixel border */
  20. #define VEC_ARROW_LEN 10
  21. #define VEC_ARROW_ANGLE 20
  22. #define VEC_EYE_R 5
  23. #define PAD_FONT "Sans Bold 24"
  24. #define PAD_BORDER 2
  25. #define MEAS_FONT "Sans 8"
  26. #define MEAS_BASELINE_OFFSET 0.1
  27. #define MEAS_ARROW_LEN 9
  28. #define MEAS_ARROW_ANGLE 30
  29. #define FRAME_FONT "Sans 8"
  30. #define FRAME_BASELINE_OFFSET 0.1
  31. #define FRAME_SHORT_X 100
  32. #define FRAME_SHORT_Y 20
  33. #define FRAME_CLEARANCE 5
  34. #define FRAME_EYE_R1 3
  35. #define FRAME_EYE_R2 5
  36. #define ITEM_LIST_FONT "Liberation Mono 8"
  37. //#define ITEM_LIST_FONT "Courier Bold 8"
  38. #define SELECT_R 6 /* pixels within which we select */
  39. #define DRAG_MIN_R 5
  40. #define MIN_FONT_SCALE 0.20 /* don't scale fonts below this */
  41. #define MM_FORMAT_FIXED "%8.3f" /* -NNN.NNN */
  42. #define MIL_FORMAT_FIXED "%7.1f" /* -NNNN.N */
  43. #define MM_FORMAT_SHORT "%.4g"
  44. #define MIL_FORMAT_SHORT "%.4g"
  45. #define DEFAULT_FRAME_AREA_WIDTH 250
  46. #define DEFAULT_FRAME_AREA_HEIGHT 100
  47. #define FRAME_AREA_MISC_WIDTH 24 /* pane, scroll bar, slack */
  48. /* ----- assorted colors --------------------------------------------------- */
  49. #define COLOR_EDIT_ASIS "#ffffff"
  50. #define COLOR_EDIT_GOOD "#a0ffa0"
  51. #define COLOR_EDIT_BAD "#ffa0a0"
  52. #define COLOR_EDITING "#ff00ff"
  53. #define COLOR_PART_NAME "#ffa050"
  54. #define COLOR_PART_NAME_EDITING COLOR_EDITING
  55. #define COLOR_FRAME_UNSELECTED "#c0c0c0"
  56. #define COLOR_FRAME_SELECTED "#fff0a0"
  57. #define COLOR_FRAME_EDITING COLOR_EDITING
  58. #define COLOR_VAR_PASSIVE COLOR_FRAME_UNSELECTED
  59. #define COLOR_VAR_EDITING COLOR_EDITING
  60. #define COLOR_EXPR_PASSIVE "#f0f0ff"
  61. #define COLOR_EXPR_EDITING COLOR_EDITING
  62. #define COLOR_CHOICE_UNSELECTED COLOR_EXPR_PASSIVE
  63. #define COLOR_CHOICE_SELECTED "#a0a0ff"
  64. #define COLOR_ROW_UNSELECTED COLOR_CHOICE_UNSELECTED
  65. #define COLOR_ROW_SELECTED COLOR_CHOICE_SELECTED
  66. #define COLOR_VAR_TABLE_SEP "black"
  67. #define COLOR_TOOL_UNSELECTED "#dcdad5"
  68. #define COLOR_TOOL_SELECTED "red"
  69. #define COLOR_ITEM_NORMAL "#dcdad5"
  70. #define COLOR_ITEM_SELECTED COLOR_FRAME_SELECTED
  71. #define COLOR_ITEM_ERROR "red"
  72. #define COLOR_SELECTOR "white"
  73. /* ----- canvas drawing styles --------------------------------------------- */
  74. extern GdkGC *gc_bg, *gc_bg_error;
  75. extern GdkGC *gc_drag;
  76. extern GdkGC *gc_highlight;
  77. extern GdkGC *gc_active_frame;
  78. extern GdkGC *gc_vec[mode_n];
  79. extern GdkGC *gc_obj[mode_n];
  80. extern GdkGC *gc_pad[mode_n];
  81. extern GdkGC *gc_pad_bare[mode_n];
  82. extern GdkGC *gc_pad_trace[mode_n];
  83. extern GdkGC *gc_pad_mask[mode_n];
  84. extern GdkGC *gc_ptext[mode_n];
  85. extern GdkGC *gc_rim[mode_n];
  86. extern GdkGC *gc_hole[mode_n];
  87. extern GdkGC *gc_meas[mode_n];
  88. extern GdkGC *gc_frame[mode_n];
  89. extern PangoFontDescription *item_list_font;
  90. void gui_setup_style(GdkDrawable *drawable);
  91. void gui_cleanup_style(void);
  92. #endif /* !GUI_STYLE_H */