summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-06-22 10:13:26 (GMT)
committerhobbs <hobbs>2002-06-22 10:13:26 (GMT)
commitada9b40cb1ed12dff8ae71d167aeeea17bcade14 (patch)
tree960b07c03b8b74ffa66c1e547aa2338cdb07ea74 /mac
parent3016d7bb9fdd6c9886c4e501d5e7a1ac0823e9aa (diff)
downloadtk-ada9b40cb1ed12dff8ae71d167aeeea17bcade14.zip
tk-ada9b40cb1ed12dff8ae71d167aeeea17bcade14.tar.gz
tk-ada9b40cb1ed12dff8ae71d167aeeea17bcade14.tar.bz2
* doc/wm.n: TIP #95 Windows implementation and
* mac/tkMacWm.c (Tk_WmCmd): docs with mac and unix stubs. * unix/tkUnixWm.c (Tk_WmCmd): * win/tkWinWm.c (Tk_WmCmd): * tests/unixWm.test: * tests/winWm.test: more wm attr tests will be needed.
Diffstat (limited to 'mac')
-rw-r--r--mac/tkMacWm.c109
1 files changed, 59 insertions, 50 deletions
diff --git a/mac/tkMacWm.c b/mac/tkMacWm.c
index 18170be..6770aa9 100644
--- a/mac/tkMacWm.c
+++ b/mac/tkMacWm.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacWm.c,v 1.18 2002/06/14 22:25:12 jenglish Exp $
+ * RCS: @(#) $Id: tkMacWm.c,v 1.19 2002/06/22 10:13:26 hobbs Exp $
*/
#include <Gestalt.h>
@@ -739,7 +739,8 @@ Tk_WmCmd(
return TCL_ERROR;
}
wmPtr = winPtr->wmInfoPtr;
- if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)) {
+ if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)
+ && (length >= 2)) {
int numer1, denom1, numer2, denom2;
if ((argc != 3) && (argc != 7)) {
@@ -782,6 +783,14 @@ Tk_WmCmd(
}
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
goto updateGeom;
+ } else if ((c == 'a') && (strncmp(argv[1], "attributes", length) == 0)
+ && (length >= 2)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # arguments: must be \"",
+ argv[0], " attributes window",
+ "\"", (char *) NULL);
+ return TCL_ERROR;
+ }
} else if ((c == 'c') && (strncmp(argv[1], "client", length) == 0)
&& (length >= 2)) {
if ((argc != 3) && (argc != 4)) {
@@ -4120,7 +4129,7 @@ TkUnsupported1Cmd(
Tcl_SetResult(interp, "floatSideZoomProc", TCL_STATIC);
break;
default:
- panic("invalid style");
+ panic("invalid style");
}
if (appearanceSpec) {
Tcl_Obj *attributeList, *newResult;
@@ -4153,11 +4162,11 @@ TkUnsupported1Cmd(
Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("none", -1));
} else if (wmPtr->attributes == kWindowStandardDocumentAttributes) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("standardDocument", -1));
} else if (wmPtr->attributes == kWindowStandardFloatingAttributes) {
- Tcl_ListObjAppendElement(interp, attributeList,
- Tcl_NewStringObj("standardFloating", -1));
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("standardFloating", -1));
} else {
if (wmPtr->attributes & kWindowCloseBoxAttribute) {
Tcl_ListObjAppendElement(interp, attributeList,
@@ -4197,48 +4206,48 @@ TkUnsupported1Cmd(
}
return TCL_OK;
} else if (argc == 4) {
- if (strcmp(argv[3], "documentProc") == 0) {
- wmPtr->style = documentProc;
- } else if (strcmp(argv[3], "noGrowDocProc") == 0) {
- wmPtr->style = documentProc;
- } else if (strcmp(argv[3], "dBoxProc") == 0) {
- wmPtr->style = dBoxProc;
- } else if (strcmp(argv[3], "plainDBox") == 0) {
- wmPtr->style = plainDBox;
- } else if (strcmp(argv[3], "altDBoxProc") == 0) {
- wmPtr->style = altDBoxProc;
- } else if (strcmp(argv[3], "movableDBoxProc") == 0) {
- wmPtr->style = movableDBoxProc;
- } else if (strcmp(argv[3], "zoomDocProc") == 0) {
- wmPtr->style = zoomDocProc;
- } else if (strcmp(argv[3], "zoomNoGrow") == 0) {
- wmPtr->style = zoomNoGrow;
- } else if (strcmp(argv[3], "rDocProc") == 0) {
- wmPtr->style = rDocProc;
- } else if (strcmp(argv[3], "floatProc") == 0) {
- wmPtr->style = floatGrowProc;
- } else if (strcmp(argv[3], "floatGrowProc") == 0) {
- wmPtr->style = floatGrowProc;
- } else if (strcmp(argv[3], "floatZoomProc") == 0) {
- wmPtr->style = floatZoomGrowProc;
- } else if (strcmp(argv[3], "floatZoomGrowProc") == 0) {
- wmPtr->style = floatZoomGrowProc;
- } else if (strcmp(argv[3], "floatSideProc") == 0) {
- wmPtr->style = floatSideGrowProc;
- } else if (strcmp(argv[3], "floatSideGrowProc") == 0) {
- wmPtr->style = floatSideGrowProc;
- } else if (strcmp(argv[3], "floatSideZoomProc") == 0) {
- wmPtr->style = floatSideZoomGrowProc;
- } else if (strcmp(argv[3], "floatSideZoomGrowProc") == 0) {
- wmPtr->style = floatSideZoomGrowProc;
- } else {
- Tcl_AppendResult(interp, "bad style: should be documentProc, ",
- "dBoxProc, plainDBox, altDBoxProc, movableDBoxProc, ",
- "zoomDocProc, rDocProc, floatProc, floatZoomProc, ",
- "floatSideProc, or floatSideZoomProc",
- (char *) NULL);
- return TCL_ERROR;
- }
+ if (strcmp(argv[3], "documentProc") == 0) {
+ wmPtr->style = documentProc;
+ } else if (strcmp(argv[3], "noGrowDocProc") == 0) {
+ wmPtr->style = documentProc;
+ } else if (strcmp(argv[3], "dBoxProc") == 0) {
+ wmPtr->style = dBoxProc;
+ } else if (strcmp(argv[3], "plainDBox") == 0) {
+ wmPtr->style = plainDBox;
+ } else if (strcmp(argv[3], "altDBoxProc") == 0) {
+ wmPtr->style = altDBoxProc;
+ } else if (strcmp(argv[3], "movableDBoxProc") == 0) {
+ wmPtr->style = movableDBoxProc;
+ } else if (strcmp(argv[3], "zoomDocProc") == 0) {
+ wmPtr->style = zoomDocProc;
+ } else if (strcmp(argv[3], "zoomNoGrow") == 0) {
+ wmPtr->style = zoomNoGrow;
+ } else if (strcmp(argv[3], "rDocProc") == 0) {
+ wmPtr->style = rDocProc;
+ } else if (strcmp(argv[3], "floatProc") == 0) {
+ wmPtr->style = floatGrowProc;
+ } else if (strcmp(argv[3], "floatGrowProc") == 0) {
+ wmPtr->style = floatGrowProc;
+ } else if (strcmp(argv[3], "floatZoomProc") == 0) {
+ wmPtr->style = floatZoomGrowProc;
+ } else if (strcmp(argv[3], "floatZoomGrowProc") == 0) {
+ wmPtr->style = floatZoomGrowProc;
+ } else if (strcmp(argv[3], "floatSideProc") == 0) {
+ wmPtr->style = floatSideGrowProc;
+ } else if (strcmp(argv[3], "floatSideGrowProc") == 0) {
+ wmPtr->style = floatSideGrowProc;
+ } else if (strcmp(argv[3], "floatSideZoomProc") == 0) {
+ wmPtr->style = floatSideZoomGrowProc;
+ } else if (strcmp(argv[3], "floatSideZoomGrowProc") == 0) {
+ wmPtr->style = floatSideZoomGrowProc;
+ } else {
+ Tcl_AppendResult(interp, "bad style: should be documentProc, ",
+ "dBoxProc, plainDBox, altDBoxProc, movableDBoxProc, ",
+ "zoomDocProc, rDocProc, floatProc, floatZoomProc, ",
+ "floatSideProc, or floatSideZoomProc",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
} else if (argc == 5) {
int oldClass = wmPtr->macClass;
int oldAttributes = wmPtr->attributes;
@@ -4278,7 +4287,7 @@ TkUnsupported1Cmd(
if (Tcl_SplitList(interp, argv[4], &attrArgc, &attrArgv) != TCL_OK) {
wmPtr->macClass = oldClass;
Tcl_AppendResult(interp, "Ill-formed attributes list: \"",
- argv[4], "\".", (char *) NULL);
+ argv[4], "\".", (char *) NULL);
return TCL_ERROR;
}
@@ -4341,7 +4350,7 @@ TkUnsupported1Cmd(
(char *) NULL);
return TCL_ERROR;
}
-
+
return TCL_OK;
}