config.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef CONFIG_H_INCLUDED
  2. #define CONFIG_H_INCLUDED
  3. #include <libconfig.h>
  4. extern config_t config; // badwolf.c
  5. int read_config(config_t *config, const char *config_path);
  6. #define BADWOLF_TAB_LABEL_CHARWIDTH 26
  7. /* BADWOLF_TAB_LABEL_ELLIPSIZE: pango ellipsize mode of the tab label text, can be one of:
  8. * - PANGO_ELLIPSIZE_NONE
  9. * - PANGO_ELLIPSIZE_START
  10. * - PANGO_ELLIPSIZE_MIDDLE
  11. * - PANGO_ELLIPSIZE_END
  12. *
  13. * See https://developer.gnome.org/pango/stable/pango-Layout-Objects.html#PangoEllipsizeMode
  14. */
  15. #define BADWOLF_TAB_LABEL_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE
  16. // BADWOLF_BOX_PADDING: Amount of padding between browser’s box (tab child) elements
  17. #define BADWOLF_BOX_PADDING 0
  18. // BADWOLF_TOOLBAR_PADDING: Amount of padding between toolbar elements
  19. #define BADWOLF_TOOLBAR_PADDING 0
  20. // BADWOLF_TOOLBAR_PADDING: Amount of padding between toolbar elements
  21. #define BADWOLF_TOOLBAR_SEPARATOR_PADDING 4
  22. // BADWOLF_STATUSBAR_PADDING: Amount of padding between statusbar elements
  23. #define BADWOLF_STATUSBAR_PADDING 0
  24. // BADWOLF_DOWNLOAD_PADDING: Amount of padding between download list row-elements
  25. #define BADWOLF_DOWNLOAD_PADDING 5
  26. /* BADWOLF_WEBKIT_SETTINGS:
  27. * Used when creating a new view with webkit_settings_new_with_settings the usage is:
  28. * setting-name, setting-value, setting-name, …, NULL
  29. *
  30. * See: https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html
  31. */
  32. // clang-format off
  33. #define BADWOLF_WEBKIT_SETTINGS \
  34. "default-charset", "utf-8", \
  35. "enable-accelerated-2d-canvas", FALSE, \
  36. "enable-caret-browsing", FALSE, \
  37. "enable-developer-extras", TRUE, \
  38. "enable-dns-prefetching", FALSE, \
  39. "enable-hyperlink-auditing", FALSE, \
  40. "enable-java", FALSE, \
  41. "enable-javascript-markup", FALSE, \
  42. "enable-javascript", TRUE, \
  43. "enable-plugins", FALSE, \
  44. "javascript-can-access-clipboard", FALSE, \
  45. "javascript-can-open-windows-automatically", FALSE, \
  46. "media-playback-requires-user-gesture", TRUE, \
  47. "minimum-font-size", 9, \
  48. "allow-top-navigation-to-data-urls", FALSE, \
  49. NULL
  50. // clang-format on
  51. /* BADWOLF_STATUSLABEL_ELLIPSIZE: pango ellipsize mode of the status bar label text, can be one of:
  52. * - PANGO_ELLIPSIZE_NONE
  53. * - PANGO_ELLIPSIZE_START
  54. * - PANGO_ELLIPSIZE_MIDDLE
  55. * - PANGO_ELLIPSIZE_END
  56. *
  57. * See https://developer.gnome.org/pango/stable/pango-Layout-Objects.html#PangoEllipsizeMode
  58. */
  59. #define BADWOLF_STATUSLABEL_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE
  60. /* BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE: pango ellipsize mode of the download destination path,
  61. * can be one of:
  62. * - PANGO_ELLIPSIZE_NONE
  63. * - PANGO_ELLIPSIZE_START
  64. * - PANGO_ELLIPSIZE_MIDDLE
  65. * - PANGO_ELLIPSIZE_END
  66. *
  67. * See https://developer.gnome.org/pango/stable/pango-Layout-Objects.html#PangoEllipsizeMode
  68. */
  69. #define BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE
  70. #endif /* CONFIG_H_INCLUDED */