aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNunoSempere <nuno.sempere@protonmail.com>2024-02-11 13:52:38 +0100
committerNunoSempere <nuno.sempere@protonmail.com>2024-02-11 13:52:38 +0100
commit9113aac95797e4b8944b17f2e439a5866a05087b (patch)
tree3483758cf94e514f01c9b36b337d9614a245d229
parent2896ff4e52241c7cb3ee24f91527c42ef0bfbecb (diff)
some code simplification
- don't have main and "setup" as two separate functions - declare all global variables at the same time
-rw-r--r--plugins/readability/readability.c2
-rw-r--r--plugins/readability/readability.h2
-rw-r--r--plugins/readability/readability.js3
-rwxr-xr-xrosebin43184 -> 43192 bytes
-rw-r--r--rose.c56
5 files changed, 31 insertions, 32 deletions
diff --git a/plugins/readability/readability.c b/plugins/readability/readability.c
index ae18073..4acb310 100644
--- a/plugins/readability/readability.c
+++ b/plugins/readability/readability.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define READABILITY_N 88023 + 1000
+#define READABILITY_N 88067 + 1000
void read_readability_js(char* string)
{
diff --git a/plugins/readability/readability.h b/plugins/readability/readability.h
index 11ec2ae..90d8ba0 100644
--- a/plugins/readability/readability.h
+++ b/plugins/readability/readability.h
@@ -1,7 +1,7 @@
#ifndef READABILITY
#define READABILITY
-#define READABILITY_N 88023 + 1000
+#define READABILITY_N 88067 + 1000
void read_readability_js(char* string);
diff --git a/plugins/readability/readability.js b/plugins/readability/readability.js
index 3bef151..bf7169d 100644
--- a/plugins/readability/readability.js
+++ b/plugins/readability/readability.js
@@ -2615,12 +2615,13 @@ var style_sheet_simple = `
<style type="text/css">
body {
- padding: 40px 200px 40px 200px;
+ padding: 40px 200px 40px 200px !important;
font-size: 18px;
font: 18px/1.5 Roboto;
line-height: 1.6;
background-color: #FEFEFE !important;
color: #444 !important;
+ max-width: 99% !important;
}
#readOverlay {
diff --git a/rose b/rose
index a1f145e..756f4e4 100755
--- a/rose
+++ b/rose
Binary files differ
diff --git a/rose.c b/rose.c
index f7d004e..20447df 100644
--- a/rose.c
+++ b/rose.c
@@ -10,14 +10,33 @@
#include "plugins/shortcuts/shortcuts.h"
#include "plugins/style/style.h"
-// #include "plugins/stand_in/stand_in.h"
+/* Global declarations */
+static GtkNotebook* notebook;
+static GtkWindow* window;
+// Search, find and url bar
+static GtkHeaderBar* bar;
+static GtkEntryBuffer* search_buf;
+static GtkEntry* search;
+static int entry_mode;
+enum { _SEARCH, _FIND, _HIDDEN };
+
+/* CACHE */
+#define CACHE \
+ "base-cache-directory", CACHE_DIR, "base-data-directory", CACHE_DIR, \
+ "disk-cache-directory", CACHE_DIR, "dom-cache-directory", CACHE_DIR, \
+ "hsts-cache-directory", CACHE_DIR, "indexeddb-directory", CACHE_DIR, \
+ "itp-directory", CACHE_DIR, "local-storage-directory", CACHE_DIR, \
+ "offline-application-cache-directory", CACHE_DIR, \
+ "service-worker-registrations-directory", CACHE_DIR
+
+/* Plugins */
+// #include "plugins/stand_in/stand_in.h"
int LIBRE_REDIRECT_ENABLED = true;
int READABILITY_ENABLED = true;
int CUSTOM_STYLE_ENABLED = true;
int CUSTOM_USER_AGENT = false;
int NUM_TABS = 0;
-
// to enable plugins,
// 1. Enable them:
// - uncomment their #include statement
@@ -29,24 +48,6 @@ int NUM_TABS = 0;
// - In the make file, include the stand_in.c file and exclude the
// relevant plugin
-#define CACHE \
- "base-cache-directory", CACHE_DIR, "base-data-directory", CACHE_DIR, \
- "disk-cache-directory", CACHE_DIR, "dom-cache-directory", CACHE_DIR, \
- "hsts-cache-directory", CACHE_DIR, "indexeddb-directory", CACHE_DIR, \
- "itp-directory", CACHE_DIR, "local-storage-directory", CACHE_DIR, \
- "offline-application-cache-directory", CACHE_DIR, \
- "service-worker-registrations-directory", CACHE_DIR
-
-enum { _SEARCH,
- _FIND,
- _HIDDEN };
-
-static int entry_mode;
-static GtkWindow* window;
-static GtkHeaderBar* bar;
-static GtkEntryBuffer* search_buf;
-static GtkEntry* search;
-
WebKitWebView* webview_new()
{
char* style;
@@ -460,15 +461,18 @@ void notebook_init(GtkNotebook* notebook, const char* uri)
notebook_append(notebook, uri);
}
-void setup(GtkNotebook* notebook, int argc, char** argv)
+int main(int argc, char** argv)
{
- // Define GTK entities
+ // <https://docs.gtk.org/gtk3/func.init.html>
+ gtk_init(NULL, NULL);
+
+ // Define GTK entities. These are declared globally
window = GTK_WINDOW(gtk_window_new(0));
- notebook = GTK_NOTEBOOK(gtk_notebook_new());
bar = GTK_HEADER_BAR(gtk_header_bar_new());
search_buf = GTK_ENTRY_BUFFER(gtk_entry_buffer_new("", 0));
search = GTK_ENTRY(gtk_entry_new_with_buffer(search_buf));
gtk_window_set_default_size(window, WIDTH, HEIGHT);
+ notebook = GTK_NOTEBOOK(gtk_notebook_new());
window_init(notebook);
// Initialize with first uri
@@ -488,13 +492,7 @@ void setup(GtkNotebook* notebook, int argc, char** argv)
notebook_append(notebook, argv[i]);
}
}
-}
-int main(int argc, char** argv)
-{
- GtkNotebook* notebook = NULL;
- gtk_init(NULL, NULL);
- setup(notebook, argc, argv);
gtk_main();
// this point is never reached, since gtk_main(); never exits.
}