commit: 1f82848e4aca29abd70dd8f248d922c5f9268e11
parent 7e77cef6c4bad117074236cce3c5114d1b763660
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 11 Apr 2019 01:21:49 +0200
Formatting: Break after the return type for definitions
Diffstat:
2 files changed, 46 insertions(+), 27 deletions(-)
diff --git a/.clang-format b/.clang-format
@@ -5,6 +5,7 @@ AlignTrailingComments: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
+AlwaysBreakAfterReturnType: AllDefinitions
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Allman
diff --git a/badwolf.c b/badwolf.c
@@ -66,7 +66,8 @@ GtkWidget *badwolf_new_tab_box(const gchar *title, struct Client *browser);
gint get_tab_position(GtkContainer *notebook, GtkWidget *child);
int main(int argc, char *argv[]);
-static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data)
+static gboolean
+WebViewCb_close(WebKitWebView *webView, gpointer user_data)
{
(void)webView;
struct Client *browser = (struct Client *)user_data;
@@ -81,8 +82,8 @@ static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data)
return TRUE;
}
-static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView,
- WebKitWebProcessTerminationReason reason)
+static gboolean
+WebViewCb_web_process_terminated(WebKitWebView *webView, WebKitWebProcessTerminationReason reason)
{
(void)webView;
char *str_reason;
@@ -101,7 +102,8 @@ static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView,
return FALSE;
}
-static gboolean WebViewCb_notify__uri(WebKitWebView *webView, GParamSpec *pspec, gpointer user_data)
+static gboolean
+WebViewCb_notify__uri(WebKitWebView *webView, GParamSpec *pspec, gpointer user_data)
{
(void)webView;
(void)pspec;
@@ -115,7 +117,8 @@ static gboolean WebViewCb_notify__uri(WebKitWebView *webView, GParamSpec *pspec,
return TRUE;
}
-GtkWidget *badwolf_new_tab_box(const gchar *title, struct Client *browser)
+GtkWidget *
+badwolf_new_tab_box(const gchar *title, struct Client *browser)
{
(void)browser;
GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
@@ -169,7 +172,8 @@ WebViewCb_notify__is__playing__audio(WebKitWebView *webView, GParamSpec *pspec,
return TRUE;
}
-void webView_tab_label_change(struct Client *browser)
+void
+webView_tab_label_change(struct Client *browser)
{
const gchar *title;
GtkWidget *notebook = browser->window->notebook;
@@ -188,9 +192,10 @@ void webView_tab_label_change(struct Client *browser)
gtk_window_set_title(GTK_WINDOW(browser->window->main_window), title);
}
-static gboolean WebViewCb_notify__estimated_load_progress(WebKitWebView *webView,
- GParamSpec *pspec,
- gpointer user_data)
+static gboolean
+WebViewCb_notify__estimated_load_progress(WebKitWebView *webView,
+ GParamSpec *pspec,
+ gpointer user_data)
{
(void)webView;
(void)pspec;
@@ -207,10 +212,11 @@ static gboolean WebViewCb_notify__estimated_load_progress(WebKitWebView *webView
return TRUE;
}
-static gboolean WebViewCb_mouse_target_changed(WebKitWebView *webView,
- WebKitHitTestResult *hit,
- guint modifiers,
- gpointer user_data)
+static gboolean
+WebViewCb_mouse_target_changed(WebKitWebView *webView,
+ WebKitHitTestResult *hit,
+ guint modifiers,
+ gpointer user_data)
{
(void)webView;
(void)modifiers;
@@ -222,9 +228,10 @@ static gboolean WebViewCb_mouse_target_changed(WebKitWebView *webView,
return TRUE;
}
-static WebKitWebView *WebViewCb_create(WebKitWebView *related_web_view,
- WebKitNavigationAction *navigation_action,
- gpointer user_data)
+static WebKitWebView *
+WebViewCb_create(WebKitWebView *related_web_view,
+ WebKitNavigationAction *navigation_action,
+ gpointer user_data)
{
(void)navigation_action;
struct Window *window = (struct Window *)user_data;
@@ -240,7 +247,8 @@ static WebKitWebView *WebViewCb_create(WebKitWebView *related_web_view,
}
}
-static gboolean locationCb_activate(GtkEntry *location, gpointer user_data)
+static gboolean
+locationCb_activate(GtkEntry *location, gpointer user_data)
{
const char *target_url;
struct Client *browser = (struct Client *)user_data;
@@ -252,7 +260,8 @@ static gboolean locationCb_activate(GtkEntry *location, gpointer user_data)
return TRUE;
}
-static gboolean javascriptCb_toggled(GtkButton *javascript, gpointer user_data)
+static gboolean
+javascriptCb_toggled(GtkButton *javascript, gpointer user_data)
{
struct Client *browser = (struct Client *)user_data;
@@ -266,7 +275,8 @@ static gboolean javascriptCb_toggled(GtkButton *javascript, gpointer user_data)
return TRUE;
}
-static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data)
+static gboolean
+SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data)
{
(void)search;
struct Client *browser = (struct Client *)user_data;
@@ -277,7 +287,8 @@ static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_
return TRUE;
}
-static gboolean SearchEntryCb_previous__match(GtkSearchEntry *search, gpointer user_data)
+static gboolean
+SearchEntryCb_previous__match(GtkSearchEntry *search, gpointer user_data)
{
(void)search;
struct Client *browser = (struct Client *)user_data;
@@ -288,7 +299,8 @@ static gboolean SearchEntryCb_previous__match(GtkSearchEntry *search, gpointer u
return TRUE;
}
-static gboolean SearchEntryCb_search__changed(GtkSearchEntry *search, gpointer user_data)
+static gboolean
+SearchEntryCb_search__changed(GtkSearchEntry *search, gpointer user_data)
{
struct Client *browser = (struct Client *)user_data;
WebKitFindController *findController = webkit_web_view_get_find_controller(browser->webView);
@@ -299,7 +311,8 @@ static gboolean SearchEntryCb_search__changed(GtkSearchEntry *search, gpointer u
return TRUE;
}
-static gboolean SearchEntryCb_stop__search(GtkSearchEntry *search, gpointer user_data)
+static gboolean
+SearchEntryCb_stop__search(GtkSearchEntry *search, gpointer user_data)
{
(void)search;
struct Client *browser = (struct Client *)user_data;
@@ -421,7 +434,8 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web
return browser;
}
-int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser)
+int
+badwolf_new_tab(GtkNotebook *notebook, struct Client *browser)
{
gint current_page = gtk_notebook_get_current_page(notebook);
gchar *title = "New tab";
@@ -441,7 +455,8 @@ int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser)
return 0;
}
-void new_tabCb_clicked(GtkButton *new_tab, gpointer user_data)
+void
+new_tabCb_clicked(GtkButton *new_tab, gpointer user_data)
{
(void)new_tab;
struct Window *window = (struct Window *)user_data;
@@ -450,7 +465,8 @@ void new_tabCb_clicked(GtkButton *new_tab, gpointer user_data)
badwolf_new_tab(GTK_NOTEBOOK(window->notebook), browser);
}
-void closeCb_clicked(GtkButton *close, gpointer user_data)
+void
+closeCb_clicked(GtkButton *close, gpointer user_data)
{
(void)close;
struct Client *browser = (struct Client *)user_data;
@@ -469,7 +485,8 @@ notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num,
gtk_window_set_title(GTK_WINDOW(window->main_window), gtk_widget_get_tooltip_text(label));
}
-gint get_tab_position(GtkContainer *notebook, GtkWidget *child)
+gint
+get_tab_position(GtkContainer *notebook, GtkWidget *child)
{
GValue position = G_VALUE_INIT;
g_value_init(&position, G_TYPE_INT);
@@ -479,7 +496,8 @@ gint get_tab_position(GtkContainer *notebook, GtkWidget *child)
return g_value_get_int(&position);
}
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
{
struct Window *window = g_malloc(sizeof(struct Client));
gchar *target_url = NULL;