Lines Matching defs:slot
32 #define CHECK_ONLY (1) /* check max slot constraint */
38 * required, the layout calculations overwehlm them. [A "slot" contains
47 * However, the space is proportional to the highest numbered slot with
63 * Structure to hold information for grid masters. A slot is either
68 int minSize; /* The minimum size of this slot (in pixels).
71 int weight; /* The resize weight of this slot. (0) means
72 * this slot doesn't resize. Extra space in
76 * this slot. This amount is "added" to the
77 * largest slave in the slot. */
81 * of this slot from the beginning of the
91 * is one of these for each slot, an array for each of the rows or columns.
98 * right edges fall in this slot. */
99 int minSize; /* Minimum size needed for this slot,
102 * in this slot, adjusted for any slot
104 int pad; /* Padding needed for this slot */
108 * right/bottom edge of the slot calculated
112 * right-or-bottom edge of the slot calculated
239 static int CheckSlotData _ANSI_ARGS_((Gridder *masterPtr, int slot,
689 int slot; /* the column or row number */
709 if (Tcl_GetInt(interp, argv[3], &slot) != TCL_OK) {
717 ok = CheckSlotData(masterPtr, slot, slotType, checkOnly);
736 slotPtr[slot].minSize,slotPtr[slot].pad,
737 slotPtr[slot].weight);
760 sprintf(interp->result,"%d",slotPtr[slot].minSize);
765 slotPtr[slot].minSize = size;
771 sprintf(interp->result,"%d",slotPtr[slot].weight);
779 slotPtr[slot].weight = wt;
784 sprintf(interp->result,"%d",slotPtr[slot].pad);
793 slotPtr[slot].pad = size;
922 * the minsize specified for that slot.
929 * The slot offsets are modified to shrink the layout.
938 register SlotInfo *slotPtr; /* Pointer to slot array. */
940 register int slot; /* Current slot. */
963 for (slot=0; slot < slots; slot++) {
964 totalWeight += slotPtr[slot].weight;
972 * Add extra space according to the slot weights. This is done
977 for (weight=slot=0; slot < slots; slot++) {
978 weight += slotPtr[slot].weight;
979 slotPtr[slot].offset += diff * weight / totalWeight;
986 * minimum possible size by looking at the slot minSizes.
989 for (slot=0; slot < slots; slot++) {
990 if (slotPtr[slot].weight > 0) {
991 minSize += slotPtr[slot].minSize;
992 } else if (slot > 0) {
993 minSize += slotPtr[slot].offset - slotPtr[slot-1].offset;
995 minSize += slotPtr[slot].offset;
1001 * set the slot sizes to their minimum values, then clip on the
1007 for (slot=0; slot < slots; slot++) {
1008 if (slotPtr[slot].weight > 0) {
1009 offset += slotPtr[slot].minSize;
1010 } else if (slot > 0) {
1011 offset += slotPtr[slot].offset - slotPtr[slot-1].offset;
1013 offset += slotPtr[slot].offset;
1015 slotPtr[slot].offset = offset;
1022 * get renormalized anytime a slot shrinks to its minimum size.
1031 for (totalWeight=slot=0; slot < slots; slot++) {
1032 int current = (slot==0) ? slotPtr[slot].offset :
1033 slotPtr[slot].offset - slotPtr[slot-1].offset;
1034 if (current > slotPtr[slot].minSize) {
1035 totalWeight += slotPtr[slot].weight;
1036 slotPtr[slot].temp = slotPtr[slot].weight;
1038 slotPtr[slot].temp = 0;
1050 for (weight=slot=0; slot < slots; slot++) {
1051 int current; /* current size of this slot */
1053 * this slot to equal its minsize */
1054 if (slotPtr[slot].temp == 0) {
1057 weight += slotPtr[slot].temp;
1058 current = (slot==0) ? slotPtr[slot].offset :
1059 slotPtr[slot].offset - slotPtr[slot-1].offset;
1060 maxDiff = totalWeight * (slotPtr[slot].minSize - current)
1061 / slotPtr[slot].temp;
1071 for (weight=slot=0; slot < slots; slot++) {
1072 weight += slotPtr[slot].temp;
1073 slotPtr[slot].offset += newDiff * weight / totalWeight;
1228 * window size, then adjust the slot offsets according to the
1254 int width, height; /* slot or slave size */
1328 * The slot offsets are copied into the SlotInfo structure for the
1354 * current slot from the beginning of the
1356 int slot; /* The current slot. */
1357 int start; /* The first slot of a contiguous set whose
1359 int end; /* The Last slot of a contiguous set whose
1391 * Allocate an extra layout slot to represent the left/top edge of
1392 * the 0th slot to make it easier to calculate slot widths from
1394 * Initialize the "dummy" slot to the left/top of the table.
1395 * This slot avoids special casing the first slot.
1404 * Copy the slot constraints into the layout structure,
1408 for (slot=0; slot < constraintCount; slot++) {
1409 layoutPtr[slot].minSize = slotPtr[slot].minSize;
1410 layoutPtr[slot].weight = slotPtr[slot].weight;
1411 layoutPtr[slot].pad = slotPtr[slot].pad;
1412 layoutPtr[slot].binNextPtr = NULL;
1414 for(;slot<gridCount;slot++) {
1415 layoutPtr[slot].minSize = 0;
1416 layoutPtr[slot].weight = 0;
1417 layoutPtr[slot].pad = 0;
1418 layoutPtr[slot].binNextPtr = NULL;
1424 * each slot. Slaves whose span is two or more slots don't
1425 * contribute to the minimum size of each slot directly, but can cause
1431 * sizes at each slot boundary, without the need to re-sort the slaves.
1473 * Determine the minimum slot offsets going from left to right
1477 for (offset=slot=0; slot < gridCount; slot++) {
1478 layoutPtr[slot].minOffset = layoutPtr[slot].minSize + offset;
1479 for (slavePtr = layoutPtr[slot].binNextPtr; slavePtr != NULL;
1482 int required = slavePtr->size + layoutPtr[slot - span].minOffset;
1483 if (required > layoutPtr[slot].minOffset) {
1484 layoutPtr[slot].minOffset = required;
1487 offset = layoutPtr[slot].minOffset;
1503 * Determine the minimum slot offsets going from right to left,
1504 * bounding the pixel range of each slot boundary.
1509 for (slot=0; slot < gridCount; slot++) {
1510 layoutPtr[slot].maxOffset = offset;
1512 for (slot=gridCount-1; slot > 0;) {
1513 for (slavePtr = layoutPtr[slot].binNextPtr; slavePtr != NULL;
1517 int startSlot = slot - span;
1522 offset -= layoutPtr[slot].minSize;
1523 slot--;
1524 if (layoutPtr[slot].maxOffset < offset) {
1525 offset = layoutPtr[slot].maxOffset;
1527 layoutPtr[slot].maxOffset = offset;
1533 * At this point, each slot boundary has a range of values that
1536 * spans of slot boundaries where the minOffsets are less than
1537 * the maxOffsets, and adjust the offsets according to the slot
1538 * weights. At each pass, at least one slot boundary will have
1556 * slot boundaries have a range of possible positions.
1576 for (slot=start; slot<=end; slot++) {
1577 totalWeight += layoutPtr[slot].weight;
1578 need += layoutPtr[slot].minSize;
1595 * of one or more of the internal slot boundaries.
1597 * entire span, would cause a slot boundary to have its possible
1605 for (weight=0,slot=start; slot<end; slot++) {
1606 int diff = layoutPtr[slot].maxOffset - layoutPtr[slot].minOffset;
1607 weight += noWeights ? 1 : layoutPtr[slot].weight;
1608 if ((noWeights || layoutPtr[slot].weight>0) &&
1619 for (weight=0,slot=start; slot<end; slot++) {
1620 weight += noWeights ? 1 : layoutPtr[slot].weight;
1621 layoutPtr[slot].minOffset +=
1623 layoutPtr[slot].minSize = layoutPtr[slot].minOffset
1624 - layoutPtr[slot-1].minOffset;
1626 layoutPtr[slot].minSize = layoutPtr[slot].minOffset
1627 - layoutPtr[slot-1].minOffset;
1635 for (slot=end; slot > start; slot--) {
1636 layoutPtr[slot-1].maxOffset =
1637 layoutPtr[slot].maxOffset-layoutPtr[slot].minSize;
1648 for (slot=0; slot < gridCount; slot++) {
1649 slotPtr[slot].offset = layoutPtr[slot].minOffset;
1775 * row and column (slot) constraints.
1790 CheckSlotData(masterPtr, slot, slotType, checkOnly)
1792 int slot; /* which slot to look at */
1796 int last; /* last available slot memory is alloced for */
1800 * If slot is out of bounds, return immediately.
1803 if (slot < 0 || slot >= MAX_ELEMENT) {
1821 return (end < slot) ? TCL_ERROR : TCL_OK;
1825 if (last < slot) {
1826 size_t size = sizeof(SlotInfo) * (slot + PREALLOC);
1833 (sizeof(SlotInfo) * (PREALLOC+slot-last)));
1837 masterPtr->masterDataPtr->rowSpace = slot+PREALLOC;
1840 masterPtr->masterDataPtr->columnSpace = slot+PREALLOC;
1843 if (slot >= end && checkOnly != CHECK_SPACE) {
1845 masterPtr->masterDataPtr->rowMax = slot+1;
1847 masterPtr->masterDataPtr->columnMax = slot+1;