GTK4: formatting pass

This commit is contained in:
NunoSempere 2024-07-20 21:48:06 -04:00
parent 4f3a90daaf
commit b2793329c8
4 changed files with 50 additions and 49 deletions

View File

@ -103,6 +103,8 @@ clean:
format: $(SRC) $(PLUGINS)
$(FORMATTER_C) $(SRC) $(PLUGINS) $(rosenrot.h)
$(FORMATTER_C) $(SRC_4) $(PLUGINS) $(rosenrot.h)
$(FORMATTER_C) $(SRC_4_greenfield) $(PLUGINS) $(rosenrot.h)
$(FORMATTER_JS) plugins/readability/readability.js
$(FORMATTER_JS) plugins/style/style.js

View File

@ -184,7 +184,7 @@ switch (document.domain) {
`;
break;
default:
console.log(`Domain: ${document.domain}`)
console.log(`Domain: ${document.domain}`);
console.log("No custom style");
}

View File

@ -2,14 +2,16 @@
#include <stdlib.h>
#include <string.h>
#include <webkit/webkit.h>
#include "config.h"
#include "plugins/plugins.h"
#include <webkit/webkit.h>
/* Global declarations */
static GtkNotebook* notebook;
static GtkWidget* window;
typedef enum { _SEARCH, _FIND, _HIDDEN } Bar_entry_mode;
typedef enum { _SEARCH,
_FIND,
_HIDDEN } Bar_entry_mode;
static struct {
GtkHeaderBar* widget;
GtkEntry* line;
@ -385,7 +387,7 @@ int handle_signal_keypress(void* self, GdkEvent* event, GtkNotebook* notebook)
return 0;
}
static int rose_keypress_event(GtkEventControllerKey *event_controller, int keyval, int keycode,
static int rose_keypress_event(GtkEventControllerKey* event_controller, int keyval, int keycode,
GdkModifierType state, GtkNotebook* notebook)
{
@ -471,6 +473,6 @@ int main(int argc, char** argv)
}
}
while (g_list_model_get_n_items (gtk_window_get_toplevels ()) > 0)
g_main_context_iteration (NULL, TRUE);
while (g_list_model_get_n_items(gtk_window_get_toplevels()) > 0)
g_main_context_iteration(NULL, TRUE);
}

View File

@ -2,13 +2,15 @@
#include <stdlib.h>
#include <string.h>
#include <webkit/webkit.h>
#include "config.h"
#include "plugins/plugins.h"
#include <webkit/webkit.h>
static GtkNotebook* notebook;
static GtkWidget *window;
typedef enum { _SEARCH, _FIND, _HIDDEN } Bar_entry_mode;
static GtkWidget* window;
typedef enum { _SEARCH,
_FIND,
_HIDDEN } Bar_entry_mode;
static struct {
GtkHeaderBar* widget;
GtkEntry* line;
@ -33,7 +35,6 @@ void load_uri(WebKitWebView* view, const char* uri)
}
}
/* Create new tabs */
WebKitWebView* create_new_webview()
{
@ -113,19 +114,17 @@ void notebook_create_new_tab(GtkNotebook* notebook, const char* uri)
}
}
int
main (int argc, char **argv)
int main(int argc, char** argv)
{
// Initialize i18n support with bindtextdomain(), etc.
// ...
// Initialize the widget set
gtk_init ();
gtk_init();
// Create the main window
window = gtk_window_new ();
window = gtk_window_new();
gtk_window_set_default_size(GTK_WINDOW(window), WIDTH, HEIGHT_4);
// Set up our GUI elements
@ -136,17 +135,15 @@ main (int argc, char **argv)
// ...
// Show the application window
gtk_window_present (GTK_WINDOW (window));
gtk_window_present(GTK_WINDOW(window));
gtk_window_set_child(GTK_WINDOW(window), GTK_WIDGET(notebook));
char* first_uri = argc > 1 ? argv[1] : HOME;
notebook_create_new_tab(notebook, first_uri);
// Enter the main event loop, and wait for user interaction
while (!0)
g_main_context_iteration (NULL, TRUE);
g_main_context_iteration(NULL, TRUE);
// The user lost interest
return 0;