2023-02-07 13:28:21 +00:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
/* See more:
|
2023-10-06 14:55:37 +00:00
|
|
|
* https://webkitgtk.org/reference/webkit2gtk/stable/class.Settings.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define WEBKIT_DEFAULT_SETTINGS \
|
2023-10-06 14:44:47 +00:00
|
|
|
"enable-back-forward-navigation-gestures", true, "enable-developer-extras", true, \
|
2023-10-06 14:44:26 +00:00
|
|
|
"enable-smooth-scrolling", false, \
|
|
|
|
"default-charset", "utf-8"
|
2023-02-07 13:28:21 +00:00
|
|
|
|
|
|
|
#define GTK "gtk-application-prefer-dark-theme", false, "gtk-enable-animations", false
|
2023-06-26 10:26:53 +00:00
|
|
|
#define ROSE_HOMEPAGE false
|
2023-11-08 23:00:31 +00:00
|
|
|
#define SEARCH "https://lite.duckduckgo.com/html/?q=%s" // "https://search.nunosempere.com/search?q=%s"
|
2023-04-29 22:33:09 +00:00
|
|
|
#define HOME ROSE_HOMEPAGE ? "file:///home/loki/Documents/core/software/fresh/C/rose-browser/rosenrot/user-scripts/ubuntu-20.04/rose-images/rose-homepage.png" : "https://search.nunosempere.com/"
|
2023-06-26 10:26:53 +00:00
|
|
|
// #define HOME ROSE_HOMEPAGE ? "file:///home/loki/Documents/core/software/fresh/C/rose-browser/rosenrot/user-scripts/ubuntu-20.04/rose-images/rose-homepage.png" : "https://search.nunosempere.com/"
|
2023-08-01 09:37:34 +00:00
|
|
|
#define CACHE_DIR "/home/loki/.cache/rose"
|
2023-02-07 13:28:21 +00:00
|
|
|
|
2023-06-05 01:15:32 +00:00
|
|
|
#define WIDTH 1920 // 960 for half-width, 1920 for full width
|
2023-02-07 13:28:21 +00:00
|
|
|
#define HEIGHT 1080
|
2023-11-22 20:41:21 +00:00
|
|
|
#define SEARCH_BAR_SIZE 1000
|
2023-02-07 13:28:21 +00:00
|
|
|
#define KEY(x) GDK_KEY_##x
|
2023-11-08 23:00:31 +00:00
|
|
|
#define ZOOM 1.6 /* Starting zoom level.*/
|
2023-02-07 13:28:21 +00:00
|
|
|
#define ZOOM_VAL .1 /* Zooming value in zoomin/zoomout functions */
|
|
|
|
#define BG_COLOR "#FEFEFE" /* "FEFEFE", "#1E1E2E" */
|
2023-05-14 03:50:14 +00:00
|
|
|
#define DEBUG false
|
2023-06-17 06:19:29 +00:00
|
|
|
#define MAX_NUM_TABS 8 // set to 0 or false if you want unlimited tabs, or look at the relevant rose.c code.
|
2023-02-07 13:28:21 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
goback,
|
|
|
|
goforward,
|
|
|
|
refresh,
|
|
|
|
refresh_force,
|
|
|
|
back_to_home,
|
|
|
|
toggle_fullscreen,
|
|
|
|
zoomin,
|
|
|
|
zoomout,
|
|
|
|
zoom_reset,
|
2024-01-06 15:30:09 +00:00
|
|
|
new_tab,
|
2023-02-07 13:28:21 +00:00
|
|
|
next_tab,
|
|
|
|
prev_tab,
|
|
|
|
close_tab,
|
|
|
|
show_searchbar,
|
|
|
|
show_finder,
|
|
|
|
finder_next,
|
|
|
|
finder_prev,
|
|
|
|
prettify,
|
|
|
|
hide_bar
|
|
|
|
} func;
|
|
|
|
|
|
|
|
#define SFT 1 << 0
|
|
|
|
#define CTRL 1 << 2
|
|
|
|
#define ALT 1 << 3
|
|
|
|
|
|
|
|
static struct {
|
|
|
|
unsigned mod;
|
|
|
|
unsigned key;
|
|
|
|
func id;
|
|
|
|
} keys[] = {
|
|
|
|
{ CTRL, KEY(h), goback },
|
|
|
|
{ CTRL, KEY(j), goforward },
|
|
|
|
{ CTRL, KEY(r), refresh },
|
|
|
|
{ CTRL | SFT, KEY(R), refresh_force },
|
|
|
|
{ CTRL | SFT, KEY(H), back_to_home },
|
|
|
|
{ CTRL, KEY(equal), zoomin },
|
|
|
|
{ CTRL, KEY(minus), zoomout },
|
|
|
|
{ CTRL, KEY(0), zoom_reset },
|
2024-01-06 15:30:09 +00:00
|
|
|
{ CTRL, KEY(Page_Up), prev_tab },
|
|
|
|
{ CTRL, KEY(Page_Down), next_tab },
|
|
|
|
{ CTRL, KEY(t), new_tab },
|
2023-02-07 13:28:21 +00:00
|
|
|
{ CTRL, KEY(w), close_tab },
|
|
|
|
{ 0x0, KEY(F11), toggle_fullscreen },
|
|
|
|
{ CTRL, KEY(l), show_searchbar },
|
2024-01-06 15:30:09 +00:00
|
|
|
{ CTRL, KEY(semicolon), hide_bar },
|
2023-02-07 13:28:21 +00:00
|
|
|
{ CTRL, KEY(f), show_finder },
|
|
|
|
{ CTRL, KEY(n), finder_next },
|
|
|
|
{ CTRL | SFT, KEY(N), finder_prev },
|
|
|
|
{ CTRL, KEY(p), prettify }
|
|
|
|
};
|
|
|
|
/* ^ For controls more akin to normal browsers */
|
|
|
|
/* Reference for the key shorthand:
|
|
|
|
* <https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gdk/gdkkeysyms.h> */
|
|
|
|
|
|
|
|
/* Old controls: {
|
|
|
|
{ CTRL, KEY(h), goback },
|
|
|
|
{ CTRL, KEY(l), goforward },
|
|
|
|
{ CTRL, KEY(r), refresh },
|
|
|
|
{ CTRL | SFT, KEY(R), refresh_force },
|
|
|
|
{ CTRL | SFT, KEY(H), back_to_home },
|
|
|
|
{ CTRL, KEY(equal), zoomin },
|
|
|
|
{ CTRL, KEY(minus), zoomout },
|
|
|
|
{ CTRL, KEY(0), zoom_reset },
|
|
|
|
{ ALT, KEY(h), prev_tab },
|
|
|
|
{ CTRL, KEY(k), hide_searchbar },
|
|
|
|
{ ALT, KEY(l), next_tab },
|
|
|
|
{ CTRL, KEY(w), close_tab },
|
|
|
|
{ 0x0, KEY(F11), toggle_fullscreen },
|
|
|
|
{ CTRL, KEY(e), show_searchbar },
|
|
|
|
{ CTRL, KEY(f), show_finder },
|
|
|
|
{ CTRL, KEY(n), finder_next },
|
|
|
|
{ CTRL | SFT, KEY(N), finder_prev },
|
|
|
|
{ CTRL, KEY(p), prettify }
|
|
|
|
};
|
|
|
|
*/
|