diff options
author | nijtmans <nijtmans> | 2007-01-03 05:06:25 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2007-01-03 05:06:25 (GMT) |
commit | 04839e2ede345ab7e9e61a07baefd1c91cca56bf (patch) | |
tree | ee02b8a4aebc8b8d0adb8c18fad99e3cbea4c19a /generic/ttk | |
parent | df1d5b0c6b3bdf308fd86c0101f8e9110b177a6d (diff) | |
download | tk-04839e2ede345ab7e9e61a07baefd1c91cca56bf.zip tk-04839e2ede345ab7e9e61a07baefd1c91cca56bf.tar.gz tk-04839e2ede345ab7e9e61a07baefd1c91cca56bf.tar.bz2 |
various "const" additions, in line with TIP #27
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkButton.c | 14 | ||||
-rw-r--r-- | generic/ttk/ttkEntry.c | 6 | ||||
-rw-r--r-- | generic/ttk/ttkFrame.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkInit.c | 6 | ||||
-rw-r--r-- | generic/ttk/ttkManager.h | 6 | ||||
-rw-r--r-- | generic/ttk/ttkNotebook.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkPanedwindow.c | 6 | ||||
-rw-r--r-- | generic/ttk/ttkProgress.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkScale.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkScrollbar.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkSeparator.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkSquare.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkTreeview.c | 12 | ||||
-rw-r--r-- | generic/ttk/ttkWidget.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkWidget.h | 10 |
15 files changed, 52 insertions, 52 deletions
diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index b87a7dbf..a054931 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -1,4 +1,4 @@ -/* $Id: ttkButton.c,v 1.4 2006/12/14 19:51:02 jenglish Exp $ +/* $Id: ttkButton.c,v 1.5 2007/01/03 05:06:25 nijtmans Exp $ * Copyright (c) 2003, Joe English * * label, button, checkbutton, radiobutton, and menubutton widgets. @@ -54,7 +54,7 @@ typedef struct BasePart base; } Base; -static Tk_OptionSpec BaseOptionSpecs[] = +static const Tk_OptionSpec BaseOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", "", Tk_Offset(Base,base.textObj), -1, @@ -219,7 +219,7 @@ typedef struct LabelPart label; } Label; -static Tk_OptionSpec LabelOptionSpecs[] = +static const Tk_OptionSpec LabelOptionSpecs[] = { {TK_OPTION_BORDER, "-background", "frameColor", "FrameColor", NULL, Tk_Offset(Label,label.backgroundObj), -1, @@ -296,7 +296,7 @@ typedef struct /* * Option specifications: */ -static Tk_OptionSpec ButtonOptionSpecs[] = +static const Tk_OptionSpec ButtonOptionSpecs[] = { WIDGET_TAKES_FOCUS, @@ -401,7 +401,7 @@ typedef struct /* * Option specifications: */ -static Tk_OptionSpec CheckbuttonOptionSpecs[] = +static const Tk_OptionSpec CheckbuttonOptionSpecs[] = { WIDGET_TAKES_FOCUS, @@ -593,7 +593,7 @@ typedef struct /* * Option specifications: */ -static Tk_OptionSpec RadiobuttonOptionSpecs[] = +static const Tk_OptionSpec RadiobuttonOptionSpecs[] = { WIDGET_TAKES_FOCUS, @@ -763,7 +763,7 @@ typedef struct static const char *directionStrings[] = { "above", "below", "left", "right", "flush", NULL }; -static Tk_OptionSpec MenubuttonOptionSpecs[] = +static const Tk_OptionSpec MenubuttonOptionSpecs[] = { WIDGET_TAKES_FOCUS, diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 157962e..b2f75ad 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1,5 +1,5 @@ /* - * $Id: ttkEntry.c,v 1.4 2006/12/17 21:09:46 jenglish Exp $ + * $Id: ttkEntry.c,v 1.5 2007/01/03 05:06:25 nijtmans Exp $ * * DERIVED FROM: tk/generic/tkEntry.c r1.35. * @@ -158,7 +158,7 @@ typedef struct #define DEF_ENTRY_FONT "TkTextFont" #define DEF_LIST_HEIGHT "10" -static Tk_OptionSpec EntryOptionSpecs[] = +static const Tk_OptionSpec EntryOptionSpecs[] = { WIDGET_TAKES_FOCUS, @@ -1690,7 +1690,7 @@ typedef struct { ComboboxPart combobox; } Combobox; -static Tk_OptionSpec ComboboxOptionSpecs[] = +static const Tk_OptionSpec ComboboxOptionSpecs[] = { {TK_OPTION_STRING, "-height", "height", "Height", DEF_LIST_HEIGHT, Tk_Offset(Combobox, combobox.heightObj), -1, diff --git a/generic/ttk/ttkFrame.c b/generic/ttk/ttkFrame.c index 5ed6272..b4b8654 100644 --- a/generic/ttk/ttkFrame.c +++ b/generic/ttk/ttkFrame.c @@ -1,4 +1,4 @@ -/* $Id: ttkFrame.c,v 1.3 2006/12/14 19:51:04 jenglish Exp $ +/* $Id: ttkFrame.c,v 1.4 2007/01/03 05:06:25 nijtmans Exp $ * Copyright (c) 2004, Joe English * * ttk::frame and ttk::labelframe widgets. @@ -29,7 +29,7 @@ typedef struct FramePart frame; } Frame; -static Tk_OptionSpec FrameOptionSpecs[] = +static const Tk_OptionSpec FrameOptionSpecs[] = { {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", NULL, Tk_Offset(Frame,frame.borderWidthObj), -1, @@ -250,7 +250,7 @@ typedef struct #define LABELWIDGET_CHANGED 0x100 -static Tk_OptionSpec LabelframeOptionSpecs[] = +static const Tk_OptionSpec LabelframeOptionSpecs[] = { {TK_OPTION_STRING, "-labelanchor", "labelAnchor", "LabelAnchor", "nw", Tk_Offset(Labelframe, label.labelAnchorObj),-1, @@ -480,7 +480,7 @@ static void LabelframeLostSlave(ClientData clientData, Tk_Window slaveWindow) Ttk_LostSlaveProc(clientData, slaveWindow); } -static Tk_OptionSpec LabelOptionSpecs[] = { +static const Tk_OptionSpec LabelOptionSpecs[] = { {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0, 0,0} }; diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c index 38197b2..f12a01b 100644 --- a/generic/ttk/ttkInit.c +++ b/generic/ttk/ttkInit.c @@ -1,4 +1,4 @@ -/* $Id: ttkInit.c,v 1.4 2006/12/14 19:51:04 jenglish Exp $ +/* $Id: ttkInit.c,v 1.5 2007/01/03 05:06:25 nijtmans Exp $ * Copyright (c) 2003, Joe English * * Ttk package: initialization routine and miscellaneous utilities. @@ -13,7 +13,7 @@ * Legal values for the button -default option. * See also: enum Ttk_ButtonDefaultState. */ -CONST char *ttkDefaultStrings[] = { +const char *ttkDefaultStrings[] = { "normal", "active", "disabled", NULL }; @@ -131,7 +131,7 @@ void TtkSendVirtualEvent(Tk_Window tgtWin, const char *eventName) * Common factors for data accessor commands. */ int TtkEnumerateOptions( - Tcl_Interp *interp, void *recordPtr, Tk_OptionSpec *specPtr, + Tcl_Interp *interp, void *recordPtr, const Tk_OptionSpec *specPtr, Tk_OptionTable optionTable, Tk_Window tkwin) { Tcl_Obj *result = Tcl_NewListObj(0,0); diff --git a/generic/ttk/ttkManager.h b/generic/ttk/ttkManager.h index bf057c3..5c7fce8 100644 --- a/generic/ttk/ttkManager.h +++ b/generic/ttk/ttkManager.h @@ -1,4 +1,4 @@ -/* $Id: ttkManager.h,v 1.3 2006/11/03 15:42:42 patthoyts Exp $ +/* $Id: ttkManager.h,v 1.4 2007/01/03 05:06:25 nijtmans Exp $ * * Copyright (c) 2005, Joe English. Freely redistributable. * @@ -31,7 +31,7 @@ typedef struct TtkSlave_ Ttk_Slave; /* forward */ */ typedef struct { /* Manager hooks */ Tk_GeomMgr tkGeomMgr; /* "real" Tk Geometry Manager */ - Tk_OptionSpec *slaveOptionSpecs; /* slave record options */ + const Tk_OptionSpec *slaveOptionSpecs; /* slave record options */ size_t slaveSize; /* size of slave record */ int (*RequestedSize)(void *managerData, int *widthPtr, int *heightPtr); @@ -59,7 +59,7 @@ struct TtkSlave_ struct TtkManager_ { - Ttk_ManagerSpec *managerSpec; + const Ttk_ManagerSpec *managerSpec; void *managerData; Tk_Window masterWindow; Tk_OptionTable slaveOptionTable; diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 70450af..de499ce 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -1,4 +1,4 @@ -/* $Id: ttkNotebook.c,v 1.4 2006/12/14 19:51:04 jenglish Exp $ +/* $Id: ttkNotebook.c,v 1.5 2007/01/03 05:06:25 nijtmans Exp $ * Copyright (c) 2004, Joe English * * NOTE-ACTIVE: activeTabIndex is not always correct (it's @@ -62,7 +62,7 @@ typedef struct * PaneOptionSpecs includes additional options for child window placement * and is used to configure the slave. */ -static Tk_OptionSpec TabOptionSpecs[] = +static const Tk_OptionSpec TabOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-state", "", "", "normal", -1,Tk_Offset(Tab,state), @@ -79,7 +79,7 @@ static Tk_OptionSpec TabOptionSpecs[] = {TK_OPTION_END} }; -static Tk_OptionSpec PaneOptionSpecs[] = +static const Tk_OptionSpec PaneOptionSpecs[] = { {TK_OPTION_STRING, "-padding", "padding", "Padding", "0", Tk_Offset(Tab,paddingObj), -1, 0,0,GEOMETRY_CHANGED }, @@ -114,7 +114,7 @@ typedef struct NotebookPart notebook; } Notebook; -static Tk_OptionSpec NotebookOptionSpecs[] = +static const Tk_OptionSpec NotebookOptionSpecs[] = { WIDGET_TAKES_FOCUS, diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index cb0502a..840f160 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -1,4 +1,4 @@ -/* $Id: ttkPanedwindow.c,v 1.7 2006/12/14 19:51:04 jenglish Exp $ +/* $Id: ttkPanedwindow.c,v 1.8 2007/01/03 05:06:25 nijtmans Exp $ * * Copyright (c) 2005, Joe English. Freely redistributable. * @@ -75,7 +75,7 @@ typedef struct { /* @@@ NOTE: -orient is readonly 'cause dynamic oriention changes NYI */ -static Tk_OptionSpec PanedOptionSpecs[] = { +static const Tk_OptionSpec PanedOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical", Tk_Offset(Paned,paned.orientObj), Tk_Offset(Paned,paned.orient), 0,(ClientData)ttkOrientStrings,READONLY_OPTION|STYLE_CHANGED }, @@ -92,7 +92,7 @@ typedef struct { int weight; /* Pane -weight, for resizing */ } Pane; -static Tk_OptionSpec PaneOptionSpecs[] = { +static const Tk_OptionSpec PaneOptionSpecs[] = { {TK_OPTION_INT, "-weight", "weight", "Weight", "0", -1,Tk_Offset(Pane,weight), 0,0,GEOMETRY_CHANGED }, {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0} diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index 4b442d3..1ae7b57 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -1,4 +1,4 @@ -/* $Id: ttkProgress.c,v 1.3 2006/12/14 19:51:04 jenglish Exp $ +/* $Id: ttkProgress.c,v 1.4 2007/01/03 05:06:25 nijtmans Exp $ * * Copyright (c) Joe English, Pat Thoyts, Michael Kirkham * @@ -45,7 +45,7 @@ typedef struct { ProgressbarPart progress; } Progressbar; -static Tk_OptionSpec ProgressbarOptionSpecs[] = +static const Tk_OptionSpec ProgressbarOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", Tk_Offset(Progressbar,progress.orientObj), -1, diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index 6cf3cbb..9bb60ce 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -1,4 +1,4 @@ -/* $Id: ttkScale.c,v 1.3 2006/12/14 19:51:04 jenglish Exp $ +/* $Id: ttkScale.c,v 1.4 2007/01/03 05:06:25 nijtmans Exp $ * Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net> * * ttk::scale widget. @@ -43,7 +43,7 @@ typedef struct ScalePart scale; } Scale; -static Tk_OptionSpec ScaleOptionSpecs[] = +static const Tk_OptionSpec ScaleOptionSpecs[] = { WIDGET_TAKES_FOCUS, diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index ab32208..48c62e3 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -1,4 +1,4 @@ -/* $Id: ttkScrollbar.c,v 1.3 2006/12/14 19:51:04 jenglish Exp $ +/* $Id: ttkScrollbar.c,v 1.4 2007/01/03 05:06:25 nijtmans Exp $ * Copyright (c) 2003, Joe English * * ttk::scrollbar widget. @@ -32,7 +32,7 @@ typedef struct ScrollbarPart scrollbar; } Scrollbar; -static Tk_OptionSpec ScrollbarOptionSpecs[] = +static const Tk_OptionSpec ScrollbarOptionSpecs[] = { {TK_OPTION_STRING, "-command", "command", "Command", "", Tk_Offset(Scrollbar,scrollbar.commandObj), -1, 0,0,0}, diff --git a/generic/ttk/ttkSeparator.c b/generic/ttk/ttkSeparator.c index 9781e98..614c92c 100644 --- a/generic/ttk/ttkSeparator.c +++ b/generic/ttk/ttkSeparator.c @@ -1,4 +1,4 @@ -/* $Id: ttkSeparator.c,v 1.3 2006/12/14 19:51:04 jenglish Exp $ +/* $Id: ttkSeparator.c,v 1.4 2007/01/03 05:06:25 nijtmans Exp $ * * Copyright (c) 2004, Joe English * @@ -24,7 +24,7 @@ typedef struct SeparatorPart separator; } Separator; -static Tk_OptionSpec SeparatorOptionSpecs[] = +static const Tk_OptionSpec SeparatorOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", Tk_Offset(Separator,separator.orientObj), diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c index e9c9bcb..86e4fbf 100644 --- a/generic/ttk/ttkSquare.c +++ b/generic/ttk/ttkSquare.c @@ -2,7 +2,7 @@ * * Minimal sample ttk widget. * - * $Id: ttkSquare.c,v 1.2 2006/11/03 03:06:22 das Exp $ + * $Id: ttkSquare.c,v 1.3 2007/01/03 05:06:25 nijtmans Exp $ */ #include <tk.h> @@ -50,7 +50,7 @@ typedef struct * defined for all widgets. */ -static Tk_OptionSpec SquareOptionSpecs[] = +static const Tk_OptionSpec SquareOptionSpecs[] = { WIDGET_TAKES_FOCUS, diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index a7b913d..0314b87 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1,4 +1,4 @@ -/* $Id: ttkTreeview.c,v 1.10 2006/12/18 19:41:19 jenglish Exp $ +/* $Id: ttkTreeview.c,v 1.11 2007/01/03 05:06:25 nijtmans Exp $ * Copyright (c) 2004, Joe English * * ttk::treeview widget implementation. @@ -52,7 +52,7 @@ struct TreeItemRec Tcl_Obj *tagsObj; }; -static Tk_OptionSpec ItemOptionSpecs[] = +static const Tk_OptionSpec ItemOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", "", Tk_Offset(TreeItem,textObj), -1, @@ -174,7 +174,7 @@ typedef struct { Tcl_Obj *fontObj; } DisplayItem; -static Tk_OptionSpec TagOptionSpecs[] = +static const Tk_OptionSpec TagOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", NULL, Tk_Offset(DisplayItem,textObj), -1, @@ -259,7 +259,7 @@ static void FreeColumn(TreeColumn *column) /* Don't touch column->data, it's scratch storage */ } -static Tk_OptionSpec ColumnOptionSpecs[] = +static const Tk_OptionSpec ColumnOptionSpecs[] = { {TK_OPTION_INT, "-width", "width", "Width", DEF_COLWIDTH, -1, Tk_Offset(TreeColumn,width), @@ -279,7 +279,7 @@ static Tk_OptionSpec ColumnOptionSpecs[] = {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0} }; -static Tk_OptionSpec HeadingOptionSpecs[] = +static const Tk_OptionSpec HeadingOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", "", Tk_Offset(TreeColumn,headingObj), -1, @@ -425,7 +425,7 @@ typedef struct { static const char *SelectModeStrings[] = { "none", "browse", "extended", NULL }; -static Tk_OptionSpec TreeviewOptionSpecs[] = +static const Tk_OptionSpec TreeviewOptionSpecs[] = { WIDGET_TAKES_FOCUS, diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index 8dc3de6..7a9ca26 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -1,4 +1,4 @@ -/* $Id: ttkWidget.c,v 1.3 2006/11/27 06:53:55 jenglish Exp $ +/* $Id: ttkWidget.c,v 1.4 2007/01/03 05:06:25 nijtmans Exp $ * Copyright (c) 2003, Joe English * * Ttk widget implementation, core widget utilities. @@ -145,7 +145,7 @@ void TtkWidgetChangeState(WidgetCore *corePtr, * Invoke an ensemble defined by a WidgetCommandSpec. */ int TtkWidgetEnsembleCommand( - WidgetCommandSpec *commands, /* Ensemble definition */ + const WidgetCommandSpec *commands, /* Ensemble definition */ int cmdIndex, /* Index of command word */ Tcl_Interp *interp, /* Interpreter to use */ int objc, Tcl_Obj *const objv[], /* Argument vector */ @@ -174,10 +174,10 @@ WidgetInstanceObjCmd( ClientData clientData, /* Widget record pointer */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj * CONST objv[]) /* Argument objects. */ + Tcl_Obj * const objv[]) /* Argument objects. */ { WidgetCore *corePtr = (WidgetCore *)clientData; - WidgetCommandSpec *commands = corePtr->widgetSpec->commands; + const WidgetCommandSpec *commands = corePtr->widgetSpec->commands; int status = TCL_OK; Tcl_Preserve(clientData); diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h index 035e464..d5ac472 100644 --- a/generic/ttk/ttkWidget.h +++ b/generic/ttk/ttkWidget.h @@ -1,4 +1,4 @@ -/* $Id: ttkWidget.h,v 1.4 2006/12/14 19:51:04 jenglish Exp $ +/* $Id: ttkWidget.h,v 1.5 2007/01/03 05:06:25 nijtmans Exp $ * Copyright (c) 2003, Joe English * Helper routines for widget implementations. */ @@ -59,7 +59,7 @@ typedef struct { } WidgetCommandSpec; MODULE_SCOPE int TtkWidgetEnsembleCommand( /* Run an ensemble command */ - WidgetCommandSpec *commands, int cmdIndex, + const WidgetCommandSpec *commands, int cmdIndex, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr); /* @@ -69,8 +69,8 @@ struct WidgetSpec_ { const char *className; /* Widget class name */ size_t recordSize; /* #bytes in widget record */ - Tk_OptionSpec *optionSpecs; /* Option specifications */ - WidgetCommandSpec *commands; /* Widget instance subcommands */ + const Tk_OptionSpec *optionSpecs; /* Option specifications */ + const WidgetCommandSpec *commands; /* Widget instance subcommands */ /* * Hooks: @@ -173,7 +173,7 @@ MODULE_SCOPE void TtkSendVirtualEvent(Tk_Window tgtWin, const char *eventName); * Helper routines for data accessor commands: */ MODULE_SCOPE int TtkEnumerateOptions( - Tcl_Interp *, void *recordPtr, Tk_OptionSpec *, Tk_OptionTable, Tk_Window); + Tcl_Interp *, void *recordPtr, const Tk_OptionSpec *, Tk_OptionTable, Tk_Window); MODULE_SCOPE int TtkGetOptionValue( Tcl_Interp *, void *recordPtr, Tcl_Obj *optName, Tk_OptionTable, Tk_Window); |