diff options
author | joye <joye> | 2014-01-07 19:14:27 (GMT) |
---|---|---|
committer | joye <joye> | 2014-01-07 19:14:27 (GMT) |
commit | a6ba7234bf14a9491b6e95fbe63c874918eeca10 (patch) | |
tree | 4d1e2848ed31241028dee2a119ed7ec57cfaf27f | |
parent | 90f4cfbba09517a8facf0aa019073580b66f5f92 (diff) | |
download | blt-a6ba7234bf14a9491b6e95fbe63c874918eeca10.zip blt-a6ba7234bf14a9491b6e95fbe63c874918eeca10.tar.gz blt-a6ba7234bf14a9491b6e95fbe63c874918eeca10.tar.bz2 |
*** empty log message ***
-rw-r--r-- | src/bltConfig.C | 87 | ||||
-rw-r--r-- | src/bltConfig.h | 18 |
2 files changed, 0 insertions, 105 deletions
diff --git a/src/bltConfig.C b/src/bltConfig.C index 1fc6e9f..ffe0da0 100644 --- a/src/bltConfig.C +++ b/src/bltConfig.C @@ -389,93 +389,6 @@ Blt_GetDashesFromObj( return TCL_OK; } -int -Blt_GetLimitsFromObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, - Blt_Limits *limitsPtr) -{ - int values[3]; - int nValues; - int limitsFlags; - - /* Initialize limits to default values */ - values[2] = LIMITS_NOM; - values[1] = LIMITS_MAX; - values[0] = LIMITS_MIN; - limitsFlags = 0; - nValues = 0; - if (objPtr != NULL) { - Tcl_Obj **objv; - int objc; - int i; - - if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) { - return TCL_ERROR; - } - if (objc > 3) { - Tcl_AppendResult(interp, "wrong # limits \"", Tcl_GetString(objPtr), - "\"", (char *)NULL); - return TCL_ERROR; - } - for (i = 0; i < objc; i++) { - const char *string; - int size; - - string = Tcl_GetString(objv[i]); - if (string[0] == '\0') { - continue; /* Empty string: use default value */ - } - limitsFlags |= (1 << i); - if (Tk_GetPixelsFromObj(interp, tkwin, objv[i], &size) != TCL_OK) { - return TCL_ERROR; - } - if ((size < LIMITS_MIN) || (size > LIMITS_MAX)) { - Tcl_AppendResult(interp, "bad limit \"", string, "\"", - (char *)NULL); - return TCL_ERROR; - } - values[i] = size; - } - nValues = objc; - } - /* - * Check the limits specified. We can't check the requested size of - * widgets. - */ - switch (nValues) { - case 1: - limitsFlags |= (LIMITS_MIN_SET | LIMITS_MAX_SET); - values[1] = values[0]; /* Set minimum and maximum to value */ - break; - - case 2: - if (values[1] < values[0]) { - Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr), - "\": min > max", (char *)NULL); - return TCL_ERROR; /* Minimum is greater than maximum */ - } - break; - - case 3: - if (values[1] < values[0]) { - Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr), - "\": min > max", (char *)NULL); - return TCL_ERROR; /* Minimum is greater than maximum */ - } - if ((values[2] < values[0]) || (values[2] > values[1])) { - Tcl_AppendResult(interp, "nominal value \"", Tcl_GetString(objPtr), - "\" out of range", (char *)NULL); - return TCL_ERROR; /* Nominal is outside of range defined - * by minimum and maximum */ - } - break; - } - limitsPtr->min = values[0]; - limitsPtr->max = values[1]; - limitsPtr->nom = values[2]; - limitsPtr->flags = limitsFlags; - return TCL_OK; -} - /* Configuration option helper routines */ /* diff --git a/src/bltConfig.h b/src/bltConfig.h index d881fce..55003be 100644 --- a/src/bltConfig.h +++ b/src/bltConfig.h @@ -173,11 +173,6 @@ typedef enum { #define BLT_CONFIG_USER_BIT (1<<8) -#define SIDE_LEFT (1<<0) -#define SIDE_TOP (1<<1) -#define SIDE_RIGHT (1<<2) -#define SIDE_BOTTOM (1<<3) - #define STATE_NORMAL (0) #define STATE_ACTIVE (1<<0) #define STATE_DISABLED (1<<1) @@ -257,21 +252,8 @@ typedef struct { int nom; /* Nominal starting value. */ } Blt_Limits; -#define LIMITS_MIN_SET (1<<0) -#define LIMITS_MAX_SET (1<<1) -#define LIMITS_NOM_SET (1<<2) - -#define LIMITS_MIN 0 /* Default minimum limit */ -#define LIMITS_MAX SHRT_MAX /* Default maximum limit */ -#define LIMITS_NOM -1000 /* Default nomimal value. Indicates - * if a pane has received any space - * yet */ - extern void Blt_SetDashes (Display *display, GC gc, Blt_Dashes *dashesPtr); -extern int Blt_GetLimitsFromObj(Tcl_Interp *interp, Tk_Window tkwin, - Tcl_Obj *objPtr, Blt_Limits *limitsPtr); - extern int Blt_ConfigureInfoFromObj(Tcl_Interp *interp, Tk_Window tkwin, Blt_ConfigSpec *specs, char *widgRec, Tcl_Obj *objPtr, int flags); |