about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* changed shortcut into Mod1-0Anselm R. Garbe2006-08-313-7/+7
|
* added viewall to mainstream (only Ross Mohns version, not the toggle)Anselm R. Garbe2006-08-315-0/+17
|
* implemented Button2 press on tags for toggletag on the focused clientAnselm R. Garbe2006-08-312-2/+15
|
* applied sanders patch to remove unnecessary commit()Anselm R. Garbe2006-08-313-16/+9
|
* small fix in config.arg.hAnselm R. Garbe2006-08-301-3/+3
|
* Added tag 1.2 for changeset e3179ce2b90451d2807cd53b589d768412b8666bAnselm R. Garbe2006-08-301-0/+1
|
* prepared 1.2 1.2Anselm R. Garbe2006-08-301-1/+1
|
* now using Salmi's menu commandAnselm R. Garbe2006-08-301-2/+3
|
* removed a warning reported by JukkaAnselm R. Garbe2006-08-301-1/+0
|
* simplified configurerequestAnselm R. Garbe2006-08-291-25/+22
|
* now dwm enforces max screen size also in tiled mode on non-floating clients ↵Anselm R. Garbe2006-08-291-13/+14
| | | | which are maximized
* fixedAnselm R. Garbe2006-08-291-1/+3
|
* configurenotify remembers max geom now, and restores this if necessary, ↵Anselm R. Garbe2006-08-292-4/+14
| | | | however it accepts to touch the max size on configurerequest, this shouldn't break fillscreen apps (tested with mplayer)
* applied patch similiar proposed by dave tweedAnselm R. Garbe2006-08-291-10/+13
|
* improved selection policyAnselm R. Garbe2006-08-291-20/+24
|
* still something wrong with reorder()Anselm R. Garbe2006-08-294-56/+33
|
* this algorithm seems to keep order for any scenarioAnselm R. Garbe2006-08-291-14/+41
|
* fix client position in list also on tag and toggletagAnselm R. Garbe2006-08-291-0/+4
|
* added attach/detach functions which don't attach at the begin of list, but ↵Anselm R. Garbe2006-08-293-29/+52
| | | | at the slot of a first match of the tags of a client
* removed crappy variablesAnselm R. Garbe2006-08-283-5/+5
|
* changed config.arg.h - I really need the 4th tagAnselm R. Garbe2006-08-282-2/+2
|
* updated html pageAnselm R. Garbe2006-08-281-2/+2
|
* Added tag 1.1 for changeset 44a55e6e46bf6c231780b09d919977d6f01083deAnselm R. Garbe2006-08-281-0/+1
|
* added a comment to spawn 1.1Anselm R. Garbe2006-08-281-0/+1
|
* applied sanders focus_ patchesAnselm R. Garbe2006-08-282-26/+49
|
* applied sanders somepatches.patchAnselm R. Garbe2006-08-284-8/+16
|
* oh frking dear big font...Anselm R. Garbe2006-08-251-1/+1
|
* term enlightenedAnselm R. Garbe2006-08-251-1/+1
|
* switching to darker colorscheme with larger fontAnselm R. Garbe2006-08-251-7/+7
|
* patched arg.hAnselm R. Garbe2006-08-251-1/+1
|
* new stuffAnselm R. Garbe2006-08-251-1/+1
|
* switching to dark colors againAnselm R. Garbe2006-08-251-6/+6
|
* updated man page of dwmAnselm R. Garbe2006-08-251-3/+3
|
* changed order of optionsAnselm R. Garbe2006-08-252-4/+4
|
* trying a different configurationAnselm R. Garbe2006-08-255-23/+24
|
* removed small 1px gap, somehow without it things feel betterAnselm R. Garbe2006-08-251-1/+1
|
* oopsAnselm R. Garbe2006-08-251-1/+1
|
* fixed typoAnselm R. Garbe2006-08-252-2/+2
|
* s/TILED/TILE/gAnselm R. Garbe2006-08-253-3/+3
|
* removed a bunch of lines, made mode symbols configurableAnselm R. Garbe2006-08-254-8/+7
|
* changed symbols for float/tiled mode, added mouse-driven mode toggle to ↵Anselm R. Garbe2006-08-252-11/+13
| | | | buttonpress()
* small fix to separate client title from right-most tagAnselm R. Garbe2006-08-251-2/+2
|
* restored config.arg.hAnselm R. Garbe2006-08-251-16/+12
|
* new color stuff/new rendering stuffAnselm R. Garbe2006-08-256-58/+70
|
* back to 3 colorsAnselm R. Garbe2006-08-255-38/+35
|
* fixedAnselm R. Garbe2006-08-241-6/+6
|
* 3->4 colorsAnselm R. Garbe2006-08-246-26/+22
|
* Added tag 1.0 for changeset bbc98e77ae89a7c9232a5be0835f60ea00d8036eAnselm R. Garbe2006-08-241-0/+1
|
* prepared dwm-1.0 1.0Anselm R. Garbe2006-08-241-2/+2
|
* yet another fixAnselm R. Garbe2006-08-241-1/+1
|
*/ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#
#
#           The Nim Compiler
#        (c) Copyright 2012 Andreas Rumpf
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

# this unit handles Nim sets; it implements bit sets
# the code here should be reused in the Nim standard library

type
  TBitSet* = seq[int8]        # we use byte here to avoid issues with
                              # cross-compiling; uint would be more efficient
                              # however

const
  ElemSize* = sizeof(int8) * 8

proc bitSetInit*(b: var TBitSet, length: int)
proc bitSetUnion*(x: var TBitSet, y: TBitSet)
proc bitSetDiff*(x: var TBitSet, y: TBitSet)
proc bitSetSymDiff*(x: var TBitSet, y: TBitSet)
proc bitSetIntersect*(x: var TBitSet, y: TBitSet)
proc bitSetIncl*(x: var TBitSet, elem: BiggestInt)
proc bitSetExcl*(x: var TBitSet, elem: BiggestInt)
proc bitSetIn*(x: TBitSet, e: BiggestInt): bool
proc bitSetEquals*(x, y: TBitSet): bool
proc bitSetContains*(x, y: TBitSet): bool
# implementation

proc bitSetIn(x: TBitSet, e: BiggestInt): bool =
  result = (x[int(e div ElemSize)] and toU8(int(1 shl (e mod ElemSize)))) !=
      toU8(0)

proc bitSetIncl(x: var TBitSet, elem: BiggestInt) =
  assert(elem >= 0)
  x[int(elem div ElemSize)] = x[int(elem div ElemSize)] or
      toU8(int(1 shl (elem mod ElemSize)))

proc bitSetExcl(x: var TBitSet, elem: BiggestInt) =
  x[int(elem div ElemSize)] = x[int(elem div ElemSize)] and
      not toU8(int(1 shl (elem mod ElemSize)))

proc bitSetInit(b: var TBitSet, length: int) =
  newSeq(b, length)

proc bitSetUnion(x: var TBitSet, y: TBitSet) =
  for i in countup(0, high(x)): x[i] = x[i] or y[i]

proc bitSetDiff(x: var TBitSet, y: TBitSet) =
  for i in countup(0, high(x)): x[i] = x[i] and not y[i]

proc bitSetSymDiff(x: var TBitSet, y: TBitSet) =
  for i in countup(0, high(x)): x[i] = x[i] xor y[i]

proc bitSetIntersect(x: var TBitSet, y: TBitSet) =
  for i in countup(0, high(x)): x[i] = x[i] and y[i]

proc bitSetEquals(x, y: TBitSet): bool =
  for i in countup(0, high(x)):
    if x[i] != y[i]:
      return false
  result = true

proc bitSetContains(x, y: TBitSet): bool =
  for i in countup(0, high(x)):
    if (x[i] and not y[i]) != int8(0):
      return false
  result = true