summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/about.c4
-rw-r--r--src/about/local.mk2
-rw-r--r--src/about/marquee.c40
-rw-r--r--src/about/paths.h32
-rw-r--r--src/local.mk2
5 files changed, 78 insertions, 2 deletions
diff --git a/src/about.c b/src/about.c
index 41338d3..96ec4be 100644
--- a/src/about.c
+++ b/src/about.c
@@ -25,6 +25,7 @@
#include "about.h"
#include "application.h"
+#include "about/paths.h"
GHashTable *
parse_query_string(gchar *str)
@@ -77,7 +78,6 @@ mq_about_request(WebKitURISchemeRequest *request, MqApplication *application)
}
if (g_strcmp0(path, "marquee") == 0) {
- /* TODO: Respond with an HTML document with a toggle button. */
- mq_application_marquee_mode_activate(application);
+ mq_about_marquee_response(application, query);
}
}
diff --git a/src/about/local.mk b/src/about/local.mk
new file mode 100644
index 0000000..f61618b
--- /dev/null
+++ b/src/about/local.mk
@@ -0,0 +1,2 @@
+marquee_SOURCES += \
+ %reldir%/marquee.c
diff --git a/src/about/marquee.c b/src/about/marquee.c
new file mode 100644
index 0000000..cd5ab33
--- /dev/null
+++ b/src/about/marquee.c
@@ -0,0 +1,40 @@
+/*
+ * about:marquee
+ *
+ * Copyright (C) 2017 Patrick McDermott
+ *
+ * This file is part of Marquee.
+ *
+ * Marquee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Marquee is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Marquee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glib.h>
+
+#include "paths.h"
+#include "../application.h"
+
+gchar *
+mq_about_marquee_response(MqApplication *application, GHashTable *query)
+{
+ if (query && g_hash_table_lookup(query, "toggle")) {
+ if (mq_application_marquee_mode_on(application)) {
+ mq_application_marquee_mode_deactivate(application);
+ } else {
+ mq_application_marquee_mode_activate(application);
+ }
+ }
+
+ /* TODO: Respond with an HTML document with a toggle button. */
+ return NULL;
+}
diff --git a/src/about/paths.h b/src/about/paths.h
new file mode 100644
index 0000000..ec365d1
--- /dev/null
+++ b/src/about/paths.h
@@ -0,0 +1,32 @@
+/*
+ * about: URI paths
+ *
+ * Copyright (C) 2017 Patrick McDermott
+ *
+ * This file is part of Marquee.
+ *
+ * Marquee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Marquee is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Marquee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MQ_ABOUT_PATHS_H
+#define MQ_ABOUT_PATHS_H
+
+#include <glib.h>
+
+#include "../application.h"
+
+gchar *
+mq_about_marquee_response(MqApplication *application, GHashTable *query);
+
+#endif
diff --git a/src/local.mk b/src/local.mk
index e68fd2e..4413c54 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -6,3 +6,5 @@ marquee_SOURCES += \
%reldir%/tab-chrome.c \
%reldir%/tab-body.c \
%reldir%/about.c
+
+include %reldir%/about/local.mk