/* Try to open html documentation uri via the default
browser on the operating system */
#ifdef __APPLE__
-#define HTMLOPENARGV {"open", 0, 0}
+#define HTMLOPENAPP "open"
#elif _WIN32
-#define HTMLOPENARGV {"wscript", 0, 0}
+#define HTMLOPENAPP "wscript"
#else
-#define HTMLOPENARGV {"xdg-open", 0, 0}
+#define HTMLOPENAPP "xdg-open"
#endif
static const gchar *artists[] = { "Bastián Díaz", "Hugo Alejandro", NULL};
online_help (const char *page)
{
GError *htmlerr = NULL;
- gchar *htmlargv[3] = HTMLOPENARGV;
+ gchar helpapp[] = HTMLOPENAPP;
+ gchar *htmlargv[3] = {helpapp, 0, 0};
gchar *htmlfilename = NULL;
gchar *htmlfullname = NULL;
gchar *htmluri = NULL;
{
}
-static const GtkTargetEntry targets[] = {
-
- { "STRING", 0, SELECT_FMT_TEXT },
- { "TEXT", 0, SELECT_FMT_TEXT },
- { "COMPOUND_TEXT", 0, SELECT_FMT_TEXT },
- { "text/plain", 0, SELECT_FMT_TEXT },
-
- { "UTF8_STRING", 0, SELECT_FMT_UTF8 },
- { "text/plain;charset=utf-8", 0, SELECT_FMT_UTF8 },
+#define CBTARGETS \
+CT ( ctn1, "STRING", 0, SELECT_FMT_TEXT ) \
+CT ( ctn2, "TEXT", 0, SELECT_FMT_TEXT ) \
+CT ( ctn3, "COMPOUND_TEXT", 0, SELECT_FMT_TEXT ) \
+CT ( ctn4, "text/plain", 0, SELECT_FMT_TEXT ) \
+CT ( ctn5, "UTF8_STRING", 0, SELECT_FMT_UTF8 ) \
+CT ( ctn6, "text/plain;charset=utf-8", 0, SELECT_FMT_UTF8 ) \
+CT ( ctn7, "text/html", 0, SELECT_FMT_HTML )
+
+#define CT(ID, TARGET, FLAGS, INFO) static gchar ID[] = TARGET;
+CBTARGETS
+#undef CT
+gchar ctnlast[] = "application/vnd.oasis.opendocument.text";
- { "text/html", 0, SELECT_FMT_HTML },
-
- { "application/vnd.oasis.opendocument.text", 0, SELECT_FMT_ODT }
+static const GtkTargetEntry targets[] = {
+#define CT(ID, TARGET, FLAGS, INFO) { ID, FLAGS, INFO },
+ CBTARGETS
+#undef CT
+ { ctnlast, 0, SELECT_FMT_ODT }
};
static void
sw->cliptext = NULL;
}
+static gchar tn1[] = "UTF8_STRING";
+static gchar tn2[] = "STRING";
+static gchar tn3[] = "TEXT";
+static gchar tn4[] = "COMPOUND_TEXT";
+static gchar tn5[] = "text/plain;charset=utf-8";
+static gchar tn6[] = "text/plain";
static const GtkTargetEntry targets[] = {
- { "UTF8_STRING", 0, SELECT_FMT_TEXT },
- { "STRING", 0, SELECT_FMT_TEXT },
- { "TEXT", 0, SELECT_FMT_TEXT },
- { "COMPOUND_TEXT", 0, SELECT_FMT_TEXT },
- { "text/plain;charset=utf-8", 0, SELECT_FMT_TEXT },
- { "text/plain", 0, SELECT_FMT_TEXT },
+ { tn1, 0, SELECT_FMT_TEXT },
+ { tn2, 0, SELECT_FMT_TEXT },
+ { tn3, 0, SELECT_FMT_TEXT },
+ { tn4, 0, SELECT_FMT_TEXT },
+ { tn5, 0, SELECT_FMT_TEXT },
+ { tn6, 0, SELECT_FMT_TEXT }
};
-
/*
Store a clip containing the currently selected text.
Returns true iff something was set.
gi (GListModel *list, guint position)
{
GtkWidget *button = gtk_button_new ();
- gchar *text = NULL;
+ const gchar *text = NULL;
switch (position)
{