summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-03 20:13:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-03 20:13:08 (GMT)
commite5491193b5d773f05acdd08d31cadc621f85a92d (patch)
treea256be01dace35517d45686cdaf5c62776f7dda1 /generic/ttk
parentaf6b6491bf5dffb77da1203394b643367c95cd0c (diff)
downloadtk-e5491193b5d773f05acdd08d31cadc621f85a92d.zip
tk-e5491193b5d773f05acdd08d31cadc621f85a92d.tar.gz
tk-e5491193b5d773f05acdd08d31cadc621f85a92d.tar.bz2
Add 2 MODULE_SCOPE string tables (tkStateStrings and tkCompoundStrings) which can be reused in many places
Diffstat (limited to 'generic/ttk')
-rw-r--r--generic/ttk/ttkDefaultTheme.c2
-rw-r--r--generic/ttk/ttkImage.c2
-rw-r--r--generic/ttk/ttkInit.c8
-rw-r--r--generic/ttk/ttkLayout.c4
-rw-r--r--generic/ttk/ttkNotebook.c2
-rw-r--r--generic/ttk/ttkPanedwindow.c2
-rw-r--r--generic/ttk/ttkTheme.c2
-rw-r--r--generic/ttk/ttkTreeview.c12
-rw-r--r--generic/ttk/ttkWidget.c2
-rw-r--r--generic/ttk/ttkWidget.h6
10 files changed, 21 insertions, 21 deletions
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c
index 89bf028..e4bfeca 100644
--- a/generic/ttk/ttkDefaultTheme.c
+++ b/generic/ttk/ttkDefaultTheme.c
@@ -731,7 +731,7 @@ typedef struct {
Tcl_Obj *colorObj;
} MenubuttonArrowElement;
-static const char *directionStrings[] = { /* See also: button.c */
+static const char *const directionStrings[] = { /* See also: button.c */
"above", "below", "left", "right", "flush", NULL
};
enum { POST_ABOVE, POST_BELOW, POST_LEFT, POST_RIGHT, POST_FLUSH };
diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c
index 2ef30e0..002a753 100644
--- a/generic/ttk/ttkImage.c
+++ b/generic/ttk/ttkImage.c
@@ -344,7 +344,7 @@ Ttk_CreateImageElement(
const char *elementName,
int objc, Tcl_Obj *const objv[])
{
- static const char *optionStrings[] =
+ static const char *const optionStrings[] =
{ "-border","-height","-padding","-sticky","-width",NULL };
enum { O_BORDER, O_HEIGHT, O_PADDING, O_STICKY, O_WIDTH };
diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c
index 0bda18b..9bc9d75 100644
--- a/generic/ttk/ttkInit.c
+++ b/generic/ttk/ttkInit.c
@@ -12,7 +12,7 @@
* Legal values for the button -default option.
* See also: enum Ttk_ButtonDefaultState.
*/
-const char *ttkDefaultStrings[] = {
+const char *const ttkDefaultStrings[] = {
"normal", "active", "disabled", NULL
};
@@ -28,7 +28,7 @@ int Ttk_GetButtonDefaultStateFromObj(
* Legal values for the -compound option.
* See also: enum Ttk_Compound.
*/
-const char *ttkCompoundStrings[] = {
+const char *const ttkCompoundStrings[] = {
"none", "text", "image", "center",
"top", "bottom", "left", "right", NULL
};
@@ -45,7 +45,7 @@ int Ttk_GetCompoundFromObj(
* Legal values for the -orient option.
* See also: enum Ttk_Orient.
*/
-const char *ttkOrientStrings[] = {
+const char *const ttkOrientStrings[] = {
"horizontal", "vertical", NULL
};
@@ -61,7 +61,7 @@ int Ttk_GetOrientFromObj(
* Recognized values for the -state compatibility option.
* Other options are accepted and interpreted as synonyms for "normal".
*/
-static const char *ttkStateStrings[] = {
+static const char *const ttkStateStrings[] = {
"normal", "readonly", "disabled", "active", NULL
};
enum {
diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c
index ed61a1c..9cebe2d 100644
--- a/generic/ttk/ttkLayout.c
+++ b/generic/ttk/ttkLayout.c
@@ -603,13 +603,13 @@ Ttk_InstantiateLayout(Ttk_Theme theme, Ttk_TemplateNode *op)
*/
/* NB: This must match bit definitions TTK_PACK_LEFT etc. */
-static const char *packSideStrings[] =
+static const char *const packSideStrings[] =
{ "left", "right", "top", "bottom", NULL };
Ttk_LayoutTemplate Ttk_ParseLayoutTemplate(Tcl_Interp *interp, Tcl_Obj *objPtr)
{
enum { OP_SIDE, OP_STICKY, OP_EXPAND, OP_BORDER, OP_UNIT, OP_CHILDREN };
- static const char *optStrings[] = {
+ static const char *const optStrings[] = {
"-side", "-sticky", "-expand", "-border", "-unit", "-children", 0 };
int i = 0, objc;
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c
index ea82ef1..24dea7b 100644
--- a/generic/ttk/ttkNotebook.c
+++ b/generic/ttk/ttkNotebook.c
@@ -1053,7 +1053,7 @@ static int NotebookHideCommand(
static int NotebookIdentifyCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- static const char *whatTable[] = { "element", "tab", NULL };
+ static const char *const whatTable[] = { "element", "tab", NULL };
enum { IDENTIFY_ELEMENT, IDENTIFY_TAB };
int what = IDENTIFY_ELEMENT;
Notebook *nb = (Notebook *)recordPtr;
diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c
index 4fbbf94..8563c07 100644
--- a/generic/ttk/ttkPanedwindow.c
+++ b/generic/ttk/ttkPanedwindow.c
@@ -717,7 +717,7 @@ static int PanedForgetCommand(
static int PanedIdentifyCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- static const char *whatTable[] = { "element", "sash", NULL };
+ static const char *const whatTable[] = { "element", "sash", NULL };
enum { IDENTIFY_ELEMENT, IDENTIFY_SASH };
int what = IDENTIFY_SASH;
Paned *pw = (Paned *)recordPtr;
diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c
index 00cb50b..711c410 100644
--- a/generic/ttk/ttkTheme.c
+++ b/generic/ttk/ttkTheme.c
@@ -1381,7 +1381,7 @@ static int StyleThemeCreateCmd(
ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
StylePackageData *pkgPtr = (StylePackageData *)clientData;
- static const char *optStrings[] =
+ static const char *const optStrings[] =
{ "-parent", "-settings", NULL };
enum { OP_PARENT, OP_SETTINGS };
Ttk_Theme parentTheme = pkgPtr->defaultTheme, newTheme;
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 1bb0482..23bc3eb 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -319,14 +319,14 @@ static Tk_OptionSpec HeadingOptionSpecs[] = {
#define DEFAULT_SHOW "tree headings"
-static const char *showStrings[] = {
+static const char *const showStrings[] = {
"tree", "headings", NULL
};
static int GetEnumSetFromObj(
Tcl_Interp *interp,
Tcl_Obj *objPtr,
- const char *table[],
+ const char *const table[],
unsigned *resultPtr)
{
unsigned result = 0;
@@ -433,7 +433,7 @@ typedef struct {
#define SCROLLCMD_CHANGED (USER_MASK<<2)
#define SHOW_CHANGED (USER_MASK<<3)
-static const char *SelectModeStrings[] = { "none", "browse", "extended", NULL };
+static const char *const SelectModeStrings[] = { "none", "browse", "extended", NULL };
static Tk_OptionSpec TreeviewOptionSpecs[] = {
{TK_OPTION_STRING, "-columns", "columns", "Columns",
@@ -1501,7 +1501,7 @@ typedef enum {
REGION_CELL
} TreeRegion;
-static const char *regionStrings[] = {
+static const char *const regionStrings[] = {
"nothing", "heading", "separator", "tree", "cell", 0
};
@@ -2263,7 +2263,7 @@ done:
static int TreeviewIdentifyCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- static const char *submethodStrings[] =
+ static const char *const submethodStrings[] =
{ "region", "item", "column", "row", "element", NULL };
enum { I_REGION, I_ITEM, I_COLUMN, I_ROW, I_ELEMENT };
@@ -2949,7 +2949,7 @@ static int TreeviewSelectionCommand(
enum {
SELECTION_SET, SELECTION_ADD, SELECTION_REMOVE, SELECTION_TOGGLE
};
- static const char *selopStrings[] = {
+ static const char *const selopStrings[] = {
"set", "add", "remove", "toggle", NULL
};
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index f5bfb4d..36b5097 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -755,7 +755,7 @@ int TtkWidgetIdentifyCommand(
{
WidgetCore *corePtr = recordPtr;
Ttk_Element element;
- static const char *whatTable[] = { "element", NULL };
+ static const char *const whatTable[] = { "element", NULL };
int x, y, what;
if (objc < 4 || objc > 5) {
diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h
index 6cd691b..c6b2dc9 100644
--- a/generic/ttk/ttkWidget.h
+++ b/generic/ttk/ttkWidget.h
@@ -247,9 +247,9 @@ MODULE_SCOPE void Ttk_TagSetApplyStyle(Ttk_TagTable,Ttk_Style,Ttk_State,void*);
* String tables for widget resource specifications:
*/
-MODULE_SCOPE const char *ttkOrientStrings[];
-MODULE_SCOPE const char *ttkCompoundStrings[];
-MODULE_SCOPE const char *ttkDefaultStrings[];
+MODULE_SCOPE const char *const ttkOrientStrings[];
+MODULE_SCOPE const char *const ttkCompoundStrings[];
+MODULE_SCOPE const char *const ttkDefaultStrings[];
/*
* ... other option types...