about summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
...
* added an creatnotify event handlerAnselm R. Garbe2007-06-044-40/+56
* applied anudots [un]ban repair patchAnselm R. Garbe2007-06-043-7/+3
* making variable declarations in dwm.h extern, this seems to be more ansi comp...Anselm R. Garbe2007-06-011-15/+15
* replaced BORDERPX with sel->border in togglemax(), in other places this is no...Anselm R. Garbe2007-05-302-2/+2
* Added tag 4.2 for changeset c13cb8c6b7a5Anselm R. Garbe2007-05-301-0/+1
* referred to LICENSE file 4.2Anselm R. Garbe2007-05-3010-60/+10
* Jukka also belongs to Copyright holders after all he has contributed and done...Anselm R. Garbe2007-05-3011-1/+12
* applied Jukkas patchAnselm R. Garbe2007-05-302-2/+2
* changed -v output (now also anydot and nsz are contained in this output)Anselm R. Garbe2007-05-291-1/+1
* added nsz to copyright holders as well, because he did a lot recentlyAnselm R. Garbe2007-05-2911-0/+11
* added anydot to Copyright holders, because he contributed a lot recentlyAnselm R. Garbe2007-05-2911-0/+11
* applied anydot's 3 minor patches, thank you anydotAnselm R. Garbe2007-05-294-34/+31
* applied Sanders patchAnselm R. Garbe2007-05-281-2/+2
* applied anydots proposal to let togglefloating restore fixed windowsAnselm R. Garbe2007-05-251-0/+2
* fix if n < nmaster of remainer calculation for master windowsAnselm R. Garbe2007-05-241-1/+1
* rev 900, coolAnselm R. Garbe2007-05-241-1/+1
* foAnselm R. Garbe2007-05-241-1/+1
* calculating the remainder for master and stack area correctlyAnselm R. Garbe2007-05-241-6/+9
* fixed issue reported by Christian GarbsAnselm R. Garbe2007-05-241-2/+1
* removed the only one and superfloues strncmpAnselm R. Garbe2007-05-231-1/+1
* fooAnselm R. Garbe2007-05-231-1/+1
* reverted last change after Sander pointed out the original decisionAnselm R. Garbe2007-05-231-1/+1
* applied anydots remark of togglefloating()Anselm R. Garbe2007-05-231-1/+1
* applied Szabolcs proposal for zoom() as wellAnselm R. Garbe2007-05-221-1/+1
* applied Szabolcs proposal to simplify setlayout()Anselm R. Garbe2007-05-222-6/+4
* Added tag 4.1 for changeset 00f4180df72bAnselm R. Garbe2007-05-211-0/+1
* no that change breaks fullscreen apps 4.1Anselm R. Garbe2007-05-161-1/+0
* raise barwin in restack, that's the most elegant solution I thinkAnselm R. Garbe2007-05-161-0/+1
* simplificationAnselm R. Garbe2007-05-151-4/+2
* raising the barwin has no effect becasue of restackAnselm R. Garbe2007-05-151-1/+0
* fixAnselm R. Garbe2007-05-151-0/+2
* barwindow raisingAnselm R. Garbe2007-05-151-0/+3
* using BarTop as fallback if BARPOS is set to BarOff as default for togglingAnselm R. Garbe2007-05-151-1/+6
* removed strip, added -s to LDFLAGSAnselm R. Garbe2007-05-152-2/+1
* added new Mod1-b functionality to dwm(1)Anselm R. Garbe2007-05-152-2/+5
* another fix, call lt->arrange() in togglebar onlyAnselm R. Garbe2007-05-153-5/+6
* fixed bpos initAnselm R. Garbe2007-05-151-0/+1
* made bar togglalbleAnselm R. Garbe2007-05-155-18/+47
* thanks to JukkaAnselm R. Garbe2007-05-141-1/+0
* added the GTK Save-As bug report to BUGS section of dwm(1)Anselm R. Garbe2007-05-141-0/+8
* applied dfenze cleanups, fixed some comments in dwm.hAnselm R. Garbe2007-05-144-21/+20
* small fix of fixAnselm R. Garbe2007-05-101-2/+1
* fixed a potential security flawAnselm R. Garbe2007-05-101-3/+5
* applied Maarten Maathuis recenter-patch for floating clients only requesting ...Anselm R. Garbe2007-05-091-0/+4
* s/remain/remainder/Anselm R. Garbe2007-05-091-3/+3
* fixing remaining space calculationAnselm R. Garbe2007-05-091-5/+5
* thanks to Juka to check -Wall ;)Anselm R. Garbe2007-05-081-2/+0
* next version is 4.1Anselm R. Garbe2007-05-071-1/+1
* applied patch of Paul Liu to allow onthefly resizing due to xrandr changesAnselm R. Garbe2007-05-073-2/+25
* Added tag 4.0 for changeset 018c38468422Anselm R. Garbe2007-04-191-0/+1
class="w"> p = x.p if p != nil: mixin `=destroy` when not supportsCopyMem(T): for i in 0..<x.len: `=destroy`(p.data[i]) if p.allocator != nil: p.allocator.dealloc(p.allocator, p, payloadSize(p.cap)) x.p = nil x.len = 0 proc `=`[T](x: var seq[T]; y: seq[T]) = mixin `=destroy` var a = cast[ptr NimSeqV2[T]](addr x) var b = cast[ptr NimSeqV2[T]](unsafeAddr y) if a.p == b.p: return `=destroy`(x) a.len = b.len if b.p != nil: a.p = cast[type(a.p)](alloc(payloadSize(a.len))) when supportsCopyMem(T): if a.len > 0: copyMem(unsafeAddr a.p.data[0], unsafeAddr b.p.data[0], a.len * sizeof(T)) else: for i in 0..<a.len: a.p.data[i] = b.p.data[i] proc `=sink`[T](x: var seq[T]; y: seq[T]) = mixin `=destroy` var a = cast[ptr NimSeqV2[T]](addr x) var b = cast[ptr NimSeqV2[T]](unsafeAddr y) if a.p != nil and a.p != b.p: `=destroy`(x) a.len = b.len a.p = b.p type PayloadBase = object cap: int allocator: Allocator proc newSeqPayload(cap, elemSize: int): pointer {.compilerRtl, raises: [].} = # we have to use type erasure here as Nim does not support generic # compilerProcs. Oh well, this will all be inlined anyway. if cap > 0: let allocator = getLocalAllocator() var p = cast[ptr PayloadBase](allocator.alloc(allocator, cap * elemSize + sizeof(int) + sizeof(Allocator))) p.allocator = allocator p.cap = cap result = p else: result = nil proc prepareSeqAdd(len: int; p: pointer; addlen, elemSize: int): pointer {. compilerRtl, noSideEffect, raises: [].} = {.noSideEffect.}: template `+!`(p: pointer, s: int): pointer = cast[pointer](cast[int](p) +% s) const headerSize = sizeof(int) + sizeof(Allocator) if addlen <= 0: result = p elif p == nil: result = newSeqPayload(len+addlen, elemSize) else: # Note: this means we cannot support things that have internal pointers as # they get reallocated here. This needs to be documented clearly. var p = cast[ptr PayloadBase](p) let cap = max(resize(p.cap), len+addlen) if p.allocator == nil: let allocator = getLocalAllocator() var q = cast[ptr PayloadBase](allocator.alloc(allocator, headerSize + elemSize * cap)) copyMem(q +! headerSize, p +! headerSize, len * elemSize) q.allocator = allocator q.cap = cap result = q else: let allocator = p.allocator var q = cast[ptr PayloadBase](allocator.realloc(allocator, p, headerSize + elemSize * p.cap, headerSize + elemSize * cap)) q.allocator = allocator q.cap = cap result = q proc shrink*[T](x: var seq[T]; newLen: Natural) = mixin `=destroy` sysAssert newLen <= x.len, "invalid newLen parameter for 'shrink'" when not supportsCopyMem(T): for i in countdown(x.len - 1, newLen): `=destroy`(x[i]) # XXX This is wrong for const seqs that were moved into 'x'! cast[ptr NimSeqV2[T]](addr x).len = newLen proc grow*[T](x: var seq[T]; newLen: Natural; value: T) = let oldLen = x.len if newLen <= oldLen: return var xu = cast[ptr NimSeqV2[T]](addr x) if xu.p == nil or xu.p.cap < newLen: xu.p = cast[typeof(xu.p)](prepareSeqAdd(oldLen, xu.p, newLen - oldLen, sizeof(T))) xu.len = newLen for i in oldLen .. newLen-1: xu.p.data[i] = value proc add*[T](x: var seq[T]; value: sink T) {.magic: "AppendSeqElem", noSideEffect.} = ## Generic proc for adding a data item `y` to a container `x`. ## ## For containers that have an order, `add` means *append*. New generic ## containers should also call their adding proc `add` for consistency. ## Generic code becomes much easier to write if the Nim naming scheme is ## respected. let oldLen = x.len var xu = cast[ptr NimSeqV2[T]](addr x) if xu.p == nil or xu.p.cap < oldLen+1: xu.p = cast[typeof(xu.p)](prepareSeqAdd(oldLen, xu.p, 1, sizeof(T))) xu.len = oldLen+1 xu.p.data[oldLen] = value proc setLen[T](s: var seq[T], newlen: Natural) = {.noSideEffect.}: if newlen < s.len: shrink(s, newlen) else: let oldLen = s.len if newlen <= oldLen: return var xu = cast[ptr NimSeqV2[T]](addr s) if xu.p == nil or xu.p.cap < newlen: xu.p = cast[typeof(xu.p)](prepareSeqAdd(oldLen, xu.p, newlen - oldLen, sizeof(T))) xu.len = newlen when false: proc resize[T](s: var NimSeqV2[T]) = let old = s.cap if old == 0: s.cap = 8 else: s.cap = (s.cap * 3) shr 1 s.data = cast[type(s.data)](realloc(s.data, old * sizeof(T), s.cap * sizeof(T))) proc reserveSlot[T](x: var NimSeqV2[T]): ptr T = if x.len >= x.cap: resize(x) result = addr(x.data[x.len]) inc x.len template add*[T](x: var NimSeqV2[T]; y: T) = reserveSlot(x)[] = y template `[]`*[T](x: NimSeqV2[T]; i: Natural): T = assert i < x.len x.data[i] template `[]=`*[T](x: NimSeqV2[T]; i: Natural; y: T) = assert i < x.len x.data[i] = y proc `@`*[T](elems: sink openArray[T]): NimSeqV2[T] = result.cap = elems.len result.len = elems.len result.data = cast[type(result.data)](alloc(result.cap * sizeof(T))) when supportsCopyMem(T): copyMem(result.data, unsafeAddr(elems[0]), result.cap * sizeof(T)) else: for i in 0..<result.len: result.data[i] = elems[i]