summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2022-02-23 23:18:53 +0100
committerDave Davenport <qball@blame.services>2022-02-23 23:18:53 +0100
commit534aa6ad5439809f46b0fece92c7923dcd2b9e8f (patch)
tree4ab2708087c8da50108c688a60d398f5b6ea7f31
parent32d33ade16c3b962b4957c37edf114476cdd22ce (diff)
Rename Dialogs -> Modes
Try to fix some of old syntax.
-rw-r--r--Makefile.am42
-rw-r--r--doc/rofi.114
-rw-r--r--doc/rofi.1.markdown14
-rw-r--r--include/modes/combi.h (renamed from include/dialogs/combi.h)0
-rw-r--r--include/modes/dmenu.h (renamed from include/dialogs/dmenu.h)0
-rw-r--r--include/modes/dmenuscriptshared.h (renamed from include/dialogs/dmenuscriptshared.h)0
-rw-r--r--include/modes/drun.h (renamed from include/dialogs/drun.h)0
-rw-r--r--include/modes/filebrowser.h (renamed from include/dialogs/filebrowser.h)0
-rw-r--r--include/modes/help-keys.h (renamed from include/dialogs/help-keys.h)0
-rw-r--r--include/modes/modes.h (renamed from include/dialogs/dialogs.h)26
-rw-r--r--include/modes/run.h (renamed from include/dialogs/run.h)0
-rw-r--r--include/modes/script.h (renamed from include/dialogs/script.h)0
-rw-r--r--include/modes/ssh.h (renamed from include/dialogs/ssh.h)0
-rw-r--r--include/modes/window.h (renamed from include/dialogs/window.h)0
-rw-r--r--meson.build42
-rw-r--r--source/modes/combi.c (renamed from source/dialogs/combi.c)4
-rw-r--r--source/modes/dmenu.c (renamed from source/dialogs/dmenu.c)6
-rw-r--r--source/modes/drun.c (renamed from source/dialogs/drun.c)6
-rw-r--r--source/modes/filebrowser.c (renamed from source/dialogs/filebrowser.c)2
-rw-r--r--source/modes/help-keys.c (renamed from source/dialogs/help-keys.c)2
-rw-r--r--source/modes/run.c (renamed from source/dialogs/run.c)6
-rw-r--r--source/modes/script.c (renamed from source/dialogs/script.c)6
-rw-r--r--source/modes/ssh.c (renamed from source/dialogs/ssh.c)4
-rw-r--r--source/modes/window.c (renamed from source/dialogs/window.c)4
-rw-r--r--source/rofi.c2
-rw-r--r--source/view.c2
-rw-r--r--source/xcb.c2
-rw-r--r--test/mode-test.c281
28 files changed, 216 insertions, 249 deletions
diff --git a/Makefile.am b/Makefile.am
index 13e1a902..71cf53c4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -80,15 +80,15 @@ SOURCES=\
source/xrmoptions.c\
source/xcb.c\
source/css-colors.c\
- source/dialogs/run.c\
- source/dialogs/ssh.c\
- source/dialogs/drun.c\
- source/dialogs/dmenu.c\
- source/dialogs/combi.c\
- source/dialogs/window.c\
- source/dialogs/script.c\
- source/dialogs/help-keys.c\
- source/dialogs/filebrowser.c\
+ source/modes/run.c\
+ source/modes/ssh.c\
+ source/modes/drun.c\
+ source/modes/dmenu.c\
+ source/modes/combi.c\
+ source/modes/window.c\
+ source/modes/script.c\
+ source/modes/help-keys.c\
+ source/modes/filebrowser.c\
include/display.h\
include/xcb.h\
include/xcb-internal.h\
@@ -116,17 +116,17 @@ SOURCES=\
include/widgets/listview.h\
include/widgets/scrollbar.h\
include/xrmoptions.h\
- include/dialogs/ssh.h\
- include/dialogs/run.h\
- include/dialogs/drun.h\
- include/dialogs/dmenu.h\
- include/dialogs/combi.h\
- include/dialogs/script.h\
- include/dialogs/window.h\
- include/dialogs/dialogs.h\
- include/dialogs/help-keys.h\
- include/dialogs/filebrowser.h\
- include/dialogs/dmenuscriptshared.h\
+ include/modes/ssh.h\
+ include/modes/run.h\
+ include/modes/drun.h\
+ include/modes/dmenu.h\
+ include/modes/combi.h\
+ include/modes/script.h\
+ include/modes/window.h\
+ include/modes/modes.h\
+ include/modes/help-keys.h\
+ include/modes/filebrowser.h\
+ include/modes/dmenuscriptshared.h\
resources/resources.c\
resources/resources.h
@@ -534,7 +534,7 @@ mode_test_LDADD=$(textbox_test_LDADD) $(check_LIBS)
mode_test_SOURCES=\
config/config.c\
test/mode-test.c\
- source/dialogs/help-keys.c\
+ source/modes/help-keys.c\
source/helper.c\
source/theme.c\
source/css-colors.c\
diff --git a/doc/rofi.1 b/doc/rofi.1
index 4db14fb9..f5ba483b 100644
--- a/doc/rofi.1
+++ b/doc/rofi.1
@@ -1452,19 +1452,19 @@ View: The main window view functions.
.IP \(bu 2
Widgets.Box: The Box widget.
.IP \(bu 2
-Dialogs.DMenu: The dmenu mode.
+Modes.DMenu: The dmenu mode.
.IP \(bu 2
-Dialogs.Run: The run mode.
+Modes.Run: The run mode.
.IP \(bu 2
-Dialogs.DRun: The desktop file run mode.
+Modes.DRun: The desktop file run mode.
.IP \(bu 2
-Dialogs.Window: The window mode.
+Modes.Window: The window mode.
.IP \(bu 2
-Dialogs.Script: The script mode.
+Modes.Script: The script mode.
.IP \(bu 2
-Dialogs.Combi: The script mode.
+Modes.Combi: The script mode.
.IP \(bu 2
-Dialogs.Ssh: The ssh mode.
+Modes.Ssh: The ssh mode.
.IP \(bu 2
Rofi: The main application.
.IP \(bu 2
diff --git a/doc/rofi.1.markdown b/doc/rofi.1.markdown
index 08ebfbf0..979a501e 100644
--- a/doc/rofi.1.markdown
+++ b/doc/rofi.1.markdown
@@ -919,13 +919,13 @@ environment variable. At the time of creation of this page, the following debug
* X11Helper: The X11 Helper functions.
* View: The main window view functions.
* Widgets.Box: The Box widget.
- * Dialogs.DMenu: The dmenu mode.
- * Dialogs.Run: The run mode.
- * Dialogs.DRun: The desktop file run mode.
- * Dialogs.Window: The window mode.
- * Dialogs.Script: The script mode.
- * Dialogs.Combi: The script mode.
- * Dialogs.Ssh: The ssh mode.
+ * Modes.DMenu: The dmenu mode.
+ * Modes.Run: The run mode.
+ * Modes.DRun: The desktop file run mode.
+ * Modes.Window: The window mode.
+ * Modes.Script: The script mode.
+ * Modes.Combi: The script mode.
+ * Modes.Ssh: The ssh mode.
* Rofi: The main application.
* Timings: Get timing output.
* Theme: Theme engine debug output. (warning lots of output).
diff --git a/include/dialogs/combi.h b/include/modes/combi.h
index fbc222d6..fbc222d6 100644
--- a/include/dialogs/combi.h
+++ b/include/modes/combi.h
diff --git a/include/dialogs/dmenu.h b/include/modes/dmenu.h
index 2b030e17..2b030e17 100644
--- a/include/dialogs/dmenu.h
+++ b/include/modes/dmenu.h
diff --git a/include/dialogs/dmenuscriptshared.h b/include/modes/dmenuscriptshared.h
index 27247fa5..27247fa5 100644
--- a/include/dialogs/dmenuscriptshared.h
+++ b/include/modes/dmenuscriptshared.h
diff --git a/include/dialogs/drun.h b/include/modes/drun.h
index c74a2673..c74a2673 100644
--- a/include/dialogs/drun.h
+++ b/include/modes/drun.h
diff --git a/include/dialogs/filebrowser.h b/include/modes/filebrowser.h
index eca667e0..eca667e0 100644
--- a/include/dialogs/filebrowser.h
+++ b/include/modes/filebrowser.h
diff --git a/include/dialogs/help-keys.h b/include/modes/help-keys.h
index 64f0c0b2..64f0c0b2 100644
--- a/include/dialogs/help-keys.h
+++ b/include/modes/help-keys.h
diff --git a/include/dialogs/dialogs.h b/include/modes/modes.h
index 09734f6b..72b8b6ee 100644
--- a/include/dialogs/dialogs.h
+++ b/include/modes/modes.h
@@ -25,23 +25,23 @@
*
*/
-#ifndef ROFI_DIALOGS_DIALOGS_H
-#define ROFI_DIALOGS_DIALOGS_H
+#ifndef ROFI_MODES_MODES_H
+#define ROFI_MODES_MODES_H
/**
* @defgroup MODES Modes
*/
/**
- * List of available dialogs.
+ * List of available modes.
*/
-#include "dialogs/combi.h"
-#include "dialogs/dmenu.h"
-#include "dialogs/drun.h"
-#include "dialogs/filebrowser.h"
-#include "dialogs/help-keys.h"
-#include "dialogs/run.h"
-#include "dialogs/script.h"
-#include "dialogs/ssh.h"
-#include "dialogs/window.h"
-#endif // ROFI_DIALOGS_DIALOGS_H
+#include "modes/combi.h"
+#include "modes/dmenu.h"
+#include "modes/drun.h"
+#include "modes/filebrowser.h"
+#include "modes/help-keys.h"
+#include "modes/run.h"
+#include "modes/script.h"
+#include "modes/ssh.h"
+#include "modes/window.h"
+#endif // ROFI_MODES_MODES_H
diff --git a/include/dialogs/run.h b/include/modes/run.h
index 015f5054..015f5054 100644
--- a/include/dialogs/run.h
+++ b/include/modes/run.h
diff --git a/include/dialogs/script.h b/include/modes/script.h
index 47237734..47237734 100644
--- a/include/dialogs/script.h
+++ b/include/modes/script.h
diff --git a/include/dialogs/ssh.h b/include/modes/ssh.h
index 6cb892a6..6cb892a6 100644
--- a/include/dialogs/ssh.h
+++ b/include/modes/ssh.h
diff --git a/include/dialogs/window.h b/include/modes/window.h
index 145628b3..145628b3 100644
--- a/include/dialogs/window.h
+++ b/include/modes/window.h
diff --git a/meson.build b/meson.build
index 9c960d8c..40ee135d 100644
--- a/meson.build
+++ b/meson.build
@@ -159,15 +159,15 @@ rofi_sources = files(
'source/xrmoptions.c',
'source/rofi-types.c',
'source/xcb.c',
- 'source/dialogs/run.c',
- 'source/dialogs/ssh.c',
- 'source/dialogs/drun.c',
- 'source/dialogs/dmenu.c',
- 'source/dialogs/combi.c',
- 'source/dialogs/window.c',
- 'source/dialogs/script.c',
- 'source/dialogs/help-keys.c',
- 'source/dialogs/filebrowser.c',
+ 'source/modes/run.c',
+ 'source/modes/ssh.c',
+ 'source/modes/drun.c',
+ 'source/modes/dmenu.c',
+ 'source/modes/combi.c',
+ 'source/modes/window.c',
+ 'source/modes/script.c',
+ 'source/modes/help-keys.c',
+ 'source/modes/filebrowser.c',
'include/display.h',
'include/xcb.h',
'include/xcb-internal.h',
@@ -195,17 +195,17 @@ rofi_sources = files(
'include/widgets/listview.h',
'include/widgets/scrollbar.h',
'include/xrmoptions.h',
- 'include/dialogs/ssh.h',
- 'include/dialogs/run.h',
- 'include/dialogs/drun.h',
- 'include/dialogs/dmenu.h',
- 'include/dialogs/combi.h',
- 'include/dialogs/script.h',
- 'include/dialogs/window.h',
- 'include/dialogs/dialogs.h',
- 'include/dialogs/help-keys.h',
- 'include/dialogs/filebrowser.h',
- 'include/dialogs/dmenuscriptshared.h',
+ 'include/modes/ssh.h',
+ 'include/modes/run.h',
+ 'include/modes/drun.h',
+ 'include/modes/dmenu.h',
+ 'include/modes/combi.h',
+ 'include/modes/script.h',
+ 'include/modes/window.h',
+ 'include/modes/modes.h',
+ 'include/modes/help-keys.h',
+ 'include/modes/filebrowser.h',
+ 'include/modes/dmenuscriptshared.h',
)
theme_lexer_sources = files('lexer/theme-lexer.l')
theme_parser_sources = files('lexer/theme-parser.y')
@@ -452,7 +452,7 @@ if check.found()
],
objects: rofi.extract_objects([
'config/config.c',
- 'source/dialogs/help-keys.c',
+ 'source/modes/help-keys.c',
'source/helper.c',
'source/theme.c',
'source/css-colors.c',
diff --git a/source/dialogs/combi.c b/source/modes/combi.c
index 27fc4a3a..cc60c33c 100644
--- a/source/dialogs/combi.c
+++ b/source/modes/combi.c
@@ -26,7 +26,7 @@
*/
/** The log domain of this dialog. */
-#define G_LOG_DOMAIN "Dialogs.Combi"
+#define G_LOG_DOMAIN "Modes.Combi"
#include "helper.h"
#include "settings.h"
@@ -36,7 +36,7 @@
#include "mode-private.h"
#include "widgets/textbox.h"
-#include <dialogs/dialogs.h>
+#include <modes/modes.h>
#include <pango/pango.h>
#include <theme.h>
diff --git a/source/dialogs/dmenu.c b/source/modes/dmenu.c
index 5ca6d353..53416c3f 100644
--- a/source/dialogs/dmenu.c
+++ b/source/modes/dmenu.c
@@ -26,9 +26,9 @@
*/
/** The log domain of this dialog. */
-#define G_LOG_DOMAIN "Dialogs.DMenu"
+#define G_LOG_DOMAIN "Modes.DMenu"
-#include "dialogs/dmenu.h"
+#include "modes/dmenu.h"
#include "helper.h"
#include "rofi-icon-fetcher.h"
#include "rofi.h"
@@ -50,7 +50,7 @@
#include <sys/types.h>
#include <unistd.h>
-#include "dialogs/dmenuscriptshared.h"
+#include "modes/dmenuscriptshared.h"
static int dmenu_mode_init(Mode *sw);
static int dmenu_token_match(const Mode *sw, rofi_int_matcher **tokens,
diff --git a/source/dialogs/drun.c b/source/modes/drun.c
index c943483a..48296919 100644
--- a/source/dialogs/drun.c
+++ b/source/modes/drun.c
@@ -26,7 +26,7 @@
*/
/** The log domain of this dialog. */
-#define G_LOG_DOMAIN "Dialogs.DRun"
+#define G_LOG_DOMAIN "Modes.DRun"
#include <config.h>
#ifdef ENABLE_DRUN
@@ -44,8 +44,8 @@
#include <sys/types.h>
#include <unistd.h>
-#include "dialogs/drun.h"
-#include "dialogs/filebrowser.h"
+#include "modes/drun.h"
+#include "modes/filebrowser.h"
#include "helper.h"
#include "history.h"
#include "mode-private.h"
diff --git a/source/dialogs/filebrowser.c b/source/modes/filebrowser.c
index daffcd66..2964f6a4 100644
--- a/source/dialogs/filebrowser.c
+++ b/source/modes/filebrowser.c
@@ -36,7 +36,7 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include "dialogs/filebrowser.h"
+#include "modes/filebrowser.h"
#include "helper.h"
#include "history.h"
#include "mode-private.h"
diff --git a/source/dialogs/help-keys.c b/source/modes/help-keys.c
index fdf522a8..3659209d 100644
--- a/source/dialogs/help-keys.c
+++ b/source/modes/help-keys.c
@@ -38,7 +38,7 @@
#include <sys/types.h>
#include <unistd.h>
-#include "dialogs/help-keys.h"
+#include "modes/help-keys.h"
#include "helper.h"
#include "rofi.h"
#include "settings.h"
diff --git a/source/dialogs/run.c b/source/modes/run.c
index dcab35bb..47a9634e 100644
--- a/source/dialogs/run.c
+++ b/source/modes/run.c
@@ -31,7 +31,7 @@
*/
/** The log domain of this dialog. */
-#define G_LOG_DOMAIN "Dialogs.Run"
+#define G_LOG_DOMAIN "Modes.Run"
#include <config.h>
#include <stdio.h>
@@ -46,8 +46,8 @@
#include <sys/types.h>
#include <unistd.h>
-#include "dialogs/filebrowser.h"
-#include "dialogs/run.h"
+#include "modes/filebrowser.h"
+#include "modes/run.h"
#include "helper.h"
#include "history.h"
#include "rofi.h"
diff --git a/source/dialogs/script.c b/source/modes/script.c
index da2af78c..f8c1dc7f 100644
--- a/source/dialogs/script.c
+++ b/source/modes/script.c
@@ -26,9 +26,9 @@
*/
/** The log domain of this dialog. */
-#define G_LOG_DOMAIN "Dialogs.Script"
+#define G_LOG_DOMAIN "Modes.Script"
-#include "dialogs/script.h"
+#include "modes/script.h"
#include "helper.h"
#include "rofi.h"
#include <assert.h>
@@ -46,7 +46,7 @@
#include "rofi-icon-fetcher.h"
-#include "dialogs/dmenuscriptshared.h"
+#include "modes/dmenuscriptshared.h"
typedef struct {
/** ID of the current script. */
diff --git a/source/dialogs/ssh.c b/source/modes/ssh.c
index 077d09ce..261e5c3c 100644
--- a/source/dialogs/ssh.c
+++ b/source/modes/ssh.c
@@ -33,7 +33,7 @@
/**
* Log domain for the ssh mode.
*/
-#define G_LOG_DOMAIN "Dialogs.Ssh"
+#define G_LOG_DOMAIN "Modes.Ssh"
#include <config.h>
#include <glib.h>
@@ -51,7 +51,7 @@
#include <sys/types.h>
#include <unistd.h>
-#include "dialogs/ssh.h"
+#include "modes/ssh.h"
#include "history.h"
#include "rofi.h"
#include "settings.h"
diff --git a/source/dialogs/window.c b/source/modes/window.c
index eacbec3d..e5f78686 100644
--- a/source/dialogs/window.c
+++ b/source/modes/window.c
@@ -26,7 +26,7 @@
*/
/** The log domain of this dialog. */
-#define G_LOG_DOMAIN "Dialogs.Window"
+#define G_LOG_DOMAIN "Modes.Window"
#include <config.h>
@@ -49,8 +49,8 @@
#include "xcb-internal.h"
#include "xcb.h"
-#include "dialogs/window.h"
#include "helper.h"
+#include "modes/window.h"
#include "rofi.h"
#include "settings.h"
#include "widgets/textbox.h"
diff --git a/source/rofi.c b/source/rofi.c
index 7f2992d9..9d549fe6 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -59,9 +59,9 @@
#include "rofi.h"
#include "settings.h"
-#include "dialogs/dialogs.h"
#include "helper.h"
#include "mode.h"
+#include "modes/modes.h"
#include "widgets/textbox.h"
#include "xrmoptions.h"
diff --git a/source/view.c b/source/view.c
index b15b138d..6df1fa70 100644
--- a/source/view.c
+++ b/source/view.c
@@ -54,11 +54,11 @@
#include "settings.h"
#include "timings.h"
-#include "dialogs/dialogs.h"
#include "display.h"
#include "helper-theme.h"
#include "helper.h"
#include "mode.h"
+#include "modes/modes.h"
#include "xcb-internal.h"
#include "xrmoptions.h"
diff --git a/source/xcb.c b/source/xcb.c
index de93b4ee..de3a1925 100644
--- a/source/xcb.c
+++ b/source/xcb.c
@@ -63,7 +63,7 @@
#include "xcb.h"
#include <libsn/sn.h>
-#include "dialogs/window.h"
+#include "modes/window.h"
#include "mode.h"
#include <rofi.h>
diff --git a/test/mode-test.c b/test/mode-test.c
index 8b76d65d..de19b47a 100644
--- a/test/mode-test.c
+++ b/test/mode-test.c
@@ -25,217 +25,184 @@
*
*/
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdio.h>
#include <assert.h>
#include <glib.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
-#include <mode.h>
-#include <mode-private.h>
-#include <dialogs/help-keys.h>
-#include <xkbcommon/xkbcommon.h>
-#include "theme.h"
-#include "rofi.h"
#include "display.h"
-#include "xcb.h"
+#include "rofi.h"
+#include "theme.h"
#include "widgets/textbox.h"
-#include <keyb.h>
+#include "xcb.h"
#include <helper.h>
+#include <keyb.h>
+#include <mode-private.h>
+#include <mode.h>
+#include <modes/help-keys.h>
+#include <xkbcommon/xkbcommon.h>
-#include <check.h>
#include "rofi-icon-fetcher.h"
+#include <check.h>
ThemeWidget *rofi_theme = NULL;
-uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
-{
+uint32_t rofi_icon_fetcher_query(const char *name, const int size) { return 0; }
+uint32_t rofi_icon_fetcher_query_advanced(const char *name, const int wsize,
+ const int hsize) {
return 0;
}
-uint32_t rofi_icon_fetcher_query_advanced ( const char *name, const int wsize, const int hsize )
-{
- return 0;
-}
-void rofi_clear_error_messages ( void ) {}
-cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
-{
- return NULL;
-}
-
-gboolean rofi_theme_parse_string ( const char *string )
-{
+void rofi_clear_error_messages(void) {}
+cairo_surface_t *rofi_icon_fetcher_get(const uint32_t uid) { return NULL; }
+
+gboolean rofi_theme_parse_string(const char *string) { return FALSE; }
+
+double textbox_get_estimated_char_height(void) { return 16.0; }
+double textbox_get_estimated_ch(void) { return 9.0; }
+void rofi_add_error_message(G_GNUC_UNUSED GString *msg) {}
+int monitor_active(G_GNUC_UNUSED workarea *d) { return 0; }
+int rofi_view_error_dialog(const char *msg, G_GNUC_UNUSED int markup) {
+ fputs(msg, stderr);
+ return TRUE;
+}
+void rofi_view_get_current_monitor(G_GNUC_UNUSED int *width,
+ G_GNUC_UNUSED int *height) {}
+RofiViewState *rofi_view_get_active(void) { return NULL; }
+gboolean rofi_view_check_action(G_GNUC_UNUSED RofiViewState *state,
+ G_GNUC_UNUSED BindingsScope scope,
+ G_GNUC_UNUSED guint action) {
return FALSE;
}
+void rofi_view_trigger_action(G_GNUC_UNUSED RofiViewState *state,
+ G_GNUC_UNUSED BindingsScope scope,
+ G_GNUC_UNUSED guint action) {}
-double textbox_get_estimated_char_height ( void )
-{
- return 16.0;
-}
-double textbox_get_estimated_ch ( void )
-{
- return 9.0;
-}
-void rofi_add_error_message ( G_GNUC_UNUSED GString *msg )
-{
-}
-int monitor_active ( G_GNUC_UNUSED workarea *d )
-{
- return 0;
-}
-int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup )
-{
- fputs ( msg, stderr );
- return TRUE;
-}
-void rofi_view_get_current_monitor ( G_GNUC_UNUSED int *width, G_GNUC_UNUSED int *height )
-{
-
-}
-RofiViewState * rofi_view_get_active ( void )
-{
- return NULL;
-}
-gboolean rofi_view_check_action ( G_GNUC_UNUSED RofiViewState *state, G_GNUC_UNUSED BindingsScope scope, G_GNUC_UNUSED guint action )
-{
- return FALSE;
-}
-void rofi_view_trigger_action ( G_GNUC_UNUSED RofiViewState *state, G_GNUC_UNUSED BindingsScope scope, G_GNUC_UNUSED guint action )
-{
-}
-
-void display_startup_notification ( G_GNUC_UNUSED RofiHelperExecuteContext *context, G_GNUC_UNUSED GSpawnChildSetupFunc *child_setup, G_GNUC_UNUSED gpointer *user_data )
-{
-}
+void display_startup_notification(
+ G_GNUC_UNUSED RofiHelperExecuteContext *context,
+ G_GNUC_UNUSED GSpawnChildSetupFunc *child_setup,
+ G_GNUC_UNUSED gpointer *user_data) {}
#ifndef _ck_assert_ptr_null
/* Pointer against NULL comparison macros with improved output
* compared to ck_assert(). */
/* OP may only be == or != */
-#define _ck_assert_ptr_null(X, OP) do { \
- const void* _ck_x = (X); \
- ck_assert_msg(_ck_x OP NULL, \
- "Assertion '%s' failed: %s == %#x", \
- #X" "#OP" NULL", \
- #X, _ck_x); \
-} while (0)
+#define _ck_assert_ptr_null(X, OP) \
+ do { \
+ const void *_ck_x = (X); \
+ ck_assert_msg(_ck_x OP NULL, "Assertion '%s' failed: %s == %#x", \
+ #X " " #OP " NULL", #X, _ck_x); \
+ } while (0)
#define ck_assert_ptr_null(X) _ck_assert_ptr_null(X, ==)
#define ck_assert_ptr_nonnull(X) _ck_assert_ptr_null(X, !=)
#endif
-static void test_mode_setup ( void )
-{
- ck_assert_int_eq ( mode_init ( &help_keys_mode ), TRUE);
-}
-static void test_mode_teardown ( void )
-{
- mode_destroy ( &help_keys_mode );
+static void test_mode_setup(void) {
+ ck_assert_int_eq(mode_init(&help_keys_mode), TRUE);
}
+static void test_mode_teardown(void) { mode_destroy(&help_keys_mode); }
-START_TEST(test_mode_create)
-{
- ck_assert_ptr_nonnull ( help_keys_mode.private_data );
+START_TEST(test_mode_create) {
+ ck_assert_ptr_nonnull(help_keys_mode.private_data);
}
END_TEST
-START_TEST(test_mode_destroy)
-{
- mode_destroy ( &help_keys_mode );
- ck_assert_ptr_null ( help_keys_mode.private_data );
+START_TEST(test_mode_destroy) {
+ mode_destroy(&help_keys_mode);
+ ck_assert_ptr_null(help_keys_mode.private_data);
}
END_TEST
-START_TEST(test_mode_num_items)
-{
- unsigned int rows = mode_get_num_entries ( &help_keys_mode);
- ck_assert_int_eq ( rows, 74);
- for ( unsigned int i =0; i < rows; i++ ) {
- int state = 0;
- GList *list = NULL;
- char *v = mode_get_display_value ( &help_keys_mode, i, &state, &list, TRUE );
- ck_assert_ptr_nonnull ( v );
- g_free ( v );
- v = mode_get_display_value ( &help_keys_mode, i, &state, &list, FALSE );
- ck_assert_ptr_null ( v );
- }
- mode_destroy ( &help_keys_mode );
+START_TEST(test_mode_num_items) {
+ unsigned int rows = mode_get_num_entries(&help_keys_mode);
+ ck_assert_int_eq(rows, 74);
+ for (unsigned int i = 0; i < rows; i++) {
+ int state = 0;
+ GList *list = NULL;
+ char *v = mode_get_display_value(&help_keys_mode, i, &state, &list, TRUE);
+ ck_assert_ptr_nonnull(v);
+ g_free(v);
+ v = mode_get_display_value(&help_keys_mode, i, &state, &list, FALSE);
+ ck_assert_ptr_null(v);
+ }
+ mode_destroy(&help_keys_mode);
}
END_TEST
-START_TEST(test_mode_result)
-{
- char *res;
+START_TEST(test_mode_result) {
+ char *res;
- res = NULL;
- ck_assert_int_eq ( mode_result ( &help_keys_mode, MENU_NEXT, &res,0), NEXT_DIALOG);
- g_free ( res );
+ res = NULL;
+ ck_assert_int_eq(mode_result(&help_keys_mode, MENU_NEXT, &res, 0),
+ NEXT_DIALOG);
+ g_free(res);
- res = NULL;
- ck_assert_int_eq ( mode_result ( &help_keys_mode, MENU_PREVIOUS, &res,0), PREVIOUS_DIALOG);
- g_free ( res );
+ res = NULL;
+ ck_assert_int_eq(mode_result(&help_keys_mode, MENU_PREVIOUS, &res, 0),
+ PREVIOUS_DIALOG);
+ g_free(res);
- res = NULL;
- ck_assert_int_eq ( mode_result ( &help_keys_mode, MENU_QUICK_SWITCH|1, &res,0), 1);
- g_free ( res );
+ res = NULL;
+ ck_assert_int_eq(mode_result(&help_keys_mode, MENU_QUICK_SWITCH | 1, &res, 0),
+ 1);
+ g_free(res);
- res = NULL;
- ck_assert_int_eq ( mode_result ( &help_keys_mode, MENU_QUICK_SWITCH|2, &res,0), 2);
- g_free ( res );
+ res = NULL;
+ ck_assert_int_eq(mode_result(&help_keys_mode, MENU_QUICK_SWITCH | 2, &res, 0),
+ 2);
+ g_free(res);
}
END_TEST
-START_TEST(test_mode_match_entry)
-{
- rofi_int_matcher **t = helper_tokenize( "primary-paste", FALSE );
- ck_assert_ptr_nonnull ( t );
-
- ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 0), TRUE );
- ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 1), FALSE );
- helper_tokenize_free ( t );
- t = helper_tokenize( "y-paste", FALSE );
- ck_assert_ptr_nonnull ( t );
+START_TEST(test_mode_match_entry) {
+ rofi_int_matcher **t = helper_tokenize("primary-paste", FALSE);
+ ck_assert_ptr_nonnull(t);
- ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 0), TRUE );
- ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 1), TRUE );
- ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 2), FALSE );
- helper_tokenize_free ( t );
+ ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 0), TRUE);
+ ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 1), FALSE);
+ helper_tokenize_free(t);
+ t = helper_tokenize("y-paste", FALSE);
+ ck_assert_ptr_nonnull(t);
+ ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 0), TRUE);
+ ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 1), TRUE);
+ ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 2), FALSE);
+ helper_tokenize_free(t);
}
END_TEST
-static Suite * mode_suite (void)
-{
- Suite *s;
- TCase *tc_core;
+static Suite *mode_suite(void) {
+ Suite *s;
+ TCase *tc_core;
- s = suite_create("Mode");
+ s = suite_create("Mode");
- /* Core test case */
- tc_core = tcase_create("HelpKeys");
- tcase_add_checked_fixture(tc_core, test_mode_setup, test_mode_teardown);
- tcase_add_test(tc_core, test_mode_create);
- tcase_add_test(tc_core, test_mode_num_items);
- tcase_add_test(tc_core, test_mode_result );
- tcase_add_test(tc_core, test_mode_destroy);
- tcase_add_tes