aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sciteco.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sciteco.h')
-rw-r--r--src/sciteco.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/sciteco.h b/src/sciteco.h
index 87bd973..7fe09d4 100644
--- a/src/sciteco.h
+++ b/src/sciteco.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2023 Robin Haberkorn
+ * Copyright (C) 2012-2024 Robin Haberkorn
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,6 +21,8 @@
#include <glib.h>
+#include <Scintilla.h>
+
#if TECO_INTEGER == 32
typedef gint32 teco_int_t;
#define TECO_INT_FORMAT G_GINT32_FORMAT
@@ -58,8 +60,18 @@ teco_is_failure(teco_bool_t x)
return x >= 0;
}
+/**
+ * Call function as destructor on debug builds.
+ * This should be used only if the cleanup is optional.
+ */
+#ifdef NDEBUG
+#define TECO_DEBUG_CLEANUP __attribute__((unused))
+#else
+#define TECO_DEBUG_CLEANUP __attribute__((destructor))
+#endif
+
/** TRUE if C is a control character */
-#define TECO_IS_CTL(C) ((C) < ' ')
+#define TECO_IS_CTL(C) ((gunichar)(C) < ' ')
/** ASCII character to echo control character C */
#define TECO_CTL_ECHO(C) ((C) | 0x40)
/**
@@ -73,17 +85,25 @@ teco_is_failure(teco_bool_t x)
* This is not a bitfield, since it is set from SciTECO.
*/
enum {
+ TECO_ED_DEFAULT_ANSI = (1 << 2),
TECO_ED_AUTOCASEFOLD = (1 << 3),
TECO_ED_AUTOEOL = (1 << 4),
TECO_ED_HOOKS = (1 << 5),
- TECO_ED_FNKEYS = (1 << 6),
+ //TECO_ED_MOUSEKEY = (1 << 6),
TECO_ED_SHELLEMU = (1 << 7),
- TECO_ED_XTERM_CLIPBOARD = (1 << 8)
+ TECO_ED_OSC52 = (1 << 8),
+ TECO_ED_ICONS = (1 << 9)
};
/* in main.c */
extern teco_int_t teco_ed;
+static inline guint
+teco_default_codepage(void)
+{
+ return teco_ed & TECO_ED_DEFAULT_ANSI ? SC_CHARSET_ANSI : SC_CP_UTF8;
+}
+
/* in main.c */
extern volatile sig_atomic_t teco_interrupted;