about summary refs log tree commit diff stats
path: root/dwm.h
Commit message (Expand)AuthorAgeFilesLines
...
* implemented aspect ratio support of windowsAnselm R. Garbe2007-02-061-0/+1
* handling WM_STATE seems to make DnD in gtk/qt apps working, well let's handle...Anselm R. Garbe2007-01-281-1/+1
* renamed activescreen into selscreen 3.2Anselm R. Garbe2007-01-231-1/+1
* small changesAnselm R. Garbe2007-01-231-1/+1
* applied Sanders all5.patch (thanks for your weekend session, Sander!)Anselm R. Garbe2007-01-221-5/+1
* moved BORDERPX to config.*.hAnselm R. Garbe2007-01-171-1/+0
* removed erealloc (not used) 3.1Anselm R. Garbe2007-01-161-1/+0
* removed unnecessary bx, by, bw variablesAnselm R. Garbe2007-01-161-1/+1
* removed drawclient and drawall (they performed useless operations/consumed us...Anselm R. Garbe2007-01-151-2/+0
* implemented new color scheme accordingly to Sanders proposalAnselm R. Garbe2007-01-141-2/+1
* removed mode label stuffAnselm R. Garbe2007-01-141-3/+1
* removed client title barAnselm R. Garbe2007-01-141-5/+0
* reorganizedAnselm R. Garbe2007-01-081-0/+1
* implemented nmaster appearance in mode label (using %u)Anselm R. Garbe2007-01-081-0/+1
* experimental version which allows master clients being increased/decreasedAnselm R. Garbe2007-01-051-1/+3
* fixed comment of drawclient()Anselm R. Garbe2007-01-041-1/+1
* renamed drawtitle into drawclientAnselm R. Garbe2007-01-041-1/+1
* correctionsarg@mig292007-01-021-1/+1
* next version will contain updated copyright noticearg@mig292007-01-021-1/+1
* changed comment of updatesizehintsarg@mig292007-01-021-1/+1
* renamed updatesize into updatesizehints (thx to Sander for this hint)arg@mig292007-01-011-1/+1
* removed Client->gravarg@mig292006-12-121-1/+0
* removed gravitate for the momentarg@mig292006-12-111-1/+0
* removed viewall signature from dwm.harg@mig292006-11-301-1/+0
* added man page entryarg@mig292006-11-271-1/+1
* added togglefloat to hg tip (i consider this useful for some cases), using MO...arg@mig292006-11-271-0/+1
* fifififarg@mig292006-11-221-1/+1
* applied Gottox' windowarea patcharg@mig292006-11-161-0/+1
* renamed resizecol into resizemaster 2.1arg@mig292006-10-311-1/+1
* applied sanders try2 patcharg@mig292006-10-271-1/+1
* moved MOUSEMASK into event.c (not used in other places)Anselm R. Garbe2006-10-161-1/+0
* do* has no Arg arument anymore (never called directly) 1.9Anselm R. Garbe2006-10-061-3/+3
* code polishing, removed unnecessary newlinesAnselm R. Garbe2006-10-061-2/+1
* removed the stack position stuffAnselm R. Garbe2006-10-051-6/+0
* keep master ratio on resizecol -> arrangeAnselm R. Garbe2006-10-051-3/+3
* simplified dotile()Anselm R. Garbe2006-10-051-1/+0
* removed useless updatemasterAnselm R. Garbe2006-09-291-1/+0
* removed the direction flippingAnselm R. Garbe2006-09-291-2/+0
* added the new dotile as described on mlAnselm R. Garbe2006-09-291-3/+6
* prelim of dotile()Anselm R. Garbe2006-09-291-0/+1
* first step to a more flexible dotile() algorithmAnselm R. Garbe2006-09-291-1/+7
* applied Jukkas patchAnselm R. Garbe2006-09-281-0/+2
* fixing the settags issue, preparing 1.7.1 1.7.1Anselm R. Garbe2006-09-271-0/+1
* added configure(), but this doesn't really fix those frking broken SDL appsarg@mmvi2006-09-261-0/+1
* applied sanders jukka patcharg@mmvi2006-09-251-1/+1
* applied Jukkas patcharg@mmvi2006-09-251-6/+6
* small change to achieve Jukka's last proposalarg@mmvi2006-09-221-1/+2
* fixed issue pointed out by Jukkaarg@mmvi2006-09-221-1/+0
* implemented the maximization as I described on the mailinglist, this feels be...arg@mmvi2006-09-221-2/+2
* improved intro comment in dwm.h, updated config.mkarg@mmvi2006-09-201-3/+3
an>"cannot open file: " & file) result = "" proc atomicTypeX(name: string; m: TMagic; t: PType; info: TLineInfo): PNode = let sym = newSym(skType, getIdent(name), t.owner, info) sym.magic = m sym.typ = t result = newSymNode(sym) result.typ = t proc atomicTypeX(s: PSym; info: TLineInfo): PNode = result = newSymNode(s) result.info = info proc mapTypeToAstX(t: PType; info: TLineInfo; inst=false; allowRecursionX=false): PNode proc mapTypeToBracketX(name: string; m: TMagic; t: PType; info: TLineInfo; inst=false): PNode = result = newNodeIT(nkBracketExpr, if t.n.isNil: info else: t.n.info, t) result.add atomicTypeX(name, m, t, info) for i in 0 ..< t.len: if t.sons[i] == nil: let void = atomicTypeX("void", mVoid, t, info) void.typ = newType(tyVoid, t.owner) result.add void else: result.add mapTypeToAstX(t.sons[i], info, inst) proc objectNode(n: PNode): PNode = if n.kind == nkSym: result = newNodeI(nkIdentDefs, n.info) result.add n # name result.add mapTypeToAstX(n.sym.typ, n.info, true, false) # type result.add ast.emptyNode # no assigned value else: result = copyNode(n) for i in 0 ..< n.safeLen: result.add objectNode(n[i]) proc mapTypeToAstX(t: PType; info: TLineInfo; inst=false; allowRecursionX=false): PNode = var allowRecursion = allowRecursionX template atomicType(name, m): untyped = atomicTypeX(name, m, t, info) template atomicType(s): untyped = atomicTypeX(s, info) template mapTypeToAst(t,info): untyped = mapTypeToAstX(t, info, inst) template mapTypeToAstR(t,info): untyped = mapTypeToAstX(t, info, inst, true) template mapTypeToAst(t,i,info): untyped = if i<t.len and t.sons[i]!=nil: mapTypeToAstX(t.sons[i], info, inst) else: ast.emptyNode template mapTypeToBracket(name, m, t, info): untyped = mapTypeToBracketX(name, m, t, info, inst) template newNodeX(kind): untyped = newNodeIT(kind, if t.n.isNil: info else: t.n.info, t) template newIdentDefs(n,t): untyped = var id = newNodeX(nkIdentDefs) id.add n # name id.add mapTypeToAst(t, info) # type id.add ast.emptyNode # no assigned value id template newIdentDefs(s): untyped = newIdentDefs(s, s.typ) if inst: if t.sym != nil: # if this node has a symbol if not allowRecursion: # getTypeInst behavior: return symbol return atomicType(t.sym) #else: # getTypeImpl behavior: turn off recursion # allowRecursion = false case t.kind of tyNone: result = atomicType("none", mNone) of tyBool: result = atomicType("bool", mBool) of tyChar: result = atomicType("char", mChar) of tyNil: result = atomicType("nil", mNil) of tyExpr: result = atomicType("expr", mExpr) of tyStmt: result = atomicType("stmt", mStmt) of tyVoid: result = atomicType("void", mVoid) of tyEmpty: result = atomicType("empty", mNone) of tyArray: result = newNodeIT(nkBracketExpr, if t.n.isNil: info else: t.n.info, t) result.add atomicType("array", mArray) if inst and t.sons[0].kind == tyRange: var rng = newNodeX(nkInfix) rng.add newIdentNode(getIdent(".."), info) rng.add t.sons[0].n.sons[0].copyTree rng.add t.sons[0].n.sons[1].copyTree result.add rng else: result.add mapTypeToAst(t.sons[0], info) result.add mapTypeToAst(t.sons[1], info) of tyTypeDesc: if t.base != nil: result = newNodeIT(nkBracketExpr, if t.n.isNil: info else: t.n.info, t) result.add atomicType("typeDesc", mTypeDesc) result.add mapTypeToAst(t.base, info) else: result = atomicType("typeDesc", mTypeDesc) of tyGenericInvocation: result = newNodeIT(nkBracketExpr, if t.n.isNil: info else: t.n.info, t) for i in 0 ..< t.len: result.add mapTypeToAst(t.sons[i], info) of tyGenericInst: if inst: if allowRecursion: result = mapTypeToAstR(t.lastSon, info) else: result = newNodeX(nkBracketExpr) #result.add mapTypeToAst(t.lastSon, info) result.add mapTypeToAst(t[0], info) for i in 1 ..< t.len-1: result.add mapTypeToAst(t.sons[i], info) else: result = mapTypeToAstX(t.lastSon, info, inst, allowRecursion) of tyGenericBody: if inst: result = mapTypeToAstR(t.lastSon, info) else: result = mapTypeToAst(t.lastSon, info) of tyAlias: result = mapTypeToAstX(t.lastSon, info, inst, allowRecursion) of tyOrdinal: result = mapTypeToAst(t.lastSon, info) of tyDistinct: if inst: result = newNodeX(nkDistinctTy) result.add mapTypeToAst(t.sons[0], info) else: if allowRecursion or t.sym == nil: result = mapTypeToBracket("distinct", mDistinct, t, info) else: result = atomicType(t.sym) of tyGenericParam, tyForward: result = atomicType(t.sym) of tyObject: if inst: result = newNodeX(nkObjectTy) result.add ast.emptyNode # pragmas not reconstructed yet if t.sons[0] == nil: result.add ast.emptyNode # handle parent object else: var nn = newNodeX(nkOfInherit) nn.add mapTypeToAst(t.sons[0], info) result.add nn if t.n.len > 0: result.add objectNode(t.n) else: result.add ast.emptyNode else: if allowRecursion or t.sym == nil: result = newNodeIT(nkObjectTy, if t.n.isNil: info else: t.n.info, t) result.add ast.emptyNode if t.sons[0] == nil: result.add ast.emptyNode else: result.add mapTypeToAst(t.sons[0], info) result.add copyTree(t.n) else: result = atomicType(t.sym) of tyEnum: result = newNodeIT(nkEnumTy, if t.n.isNil: info else: t.n.info, t) result.add ast.emptyNode # pragma node, currently always empty for enum for c in t.n.sons: result.add copyTree(c) of tyTuple: if inst: # only named tuples have a node, unnamed tuples don't if t.n.isNil: result = newNodeX(nkTupleConstr) for subType in t.sons: result.add mapTypeToAst(subType, info) else: result = newNodeX(nkTupleTy) for s in t.n.sons: result.add newIdentDefs(s) else: result = mapTypeToBracket("tuple", mTuple, t, info) of tySet: result = mapTypeToBracket("set", mSet, t, info) of tyPtr: if inst: result = newNodeX(nkPtrTy) result.add mapTypeToAst(t.sons[0], info) else: result = mapTypeToBracket("ptr", mPtr, t, info) of tyRef: if inst: result = newNodeX(nkRefTy) result.add mapTypeToAst(t.sons[0], info) else: result = mapTypeToBracket("ref", mRef, t, info) of tyVar: if inst: result = newNodeX(nkVarTy) result.add mapTypeToAst(t.sons[0], info) else: result = mapTypeToBracket("var", mVar, t, info) of tyLent: result = mapTypeToBracket("lent", mBuiltinType, t, info) of tySink: result = mapTypeToBracket("sink", mBuiltinType, t, info) of tySequence: result = mapTypeToBracket("seq", mSeq, t, info) of tyOpt: result = mapTypeToBracket("opt", mOpt, t, info) of tyProc: if inst: result = newNodeX(nkProcTy) var fp = newNodeX(nkFormalParams) if t.sons[0] == nil: fp.add ast.emptyNode else: fp.add mapTypeToAst(t.sons[0], t.n[0].info) for i in 1..<t.sons.len: fp.add newIdentDefs(t.n[i], t.sons[i]) result.add fp result.add ast.emptyNode # pragmas aren't reconstructed yet else: result = mapTypeToBracket("proc", mNone, t, info) of tyOpenArray: result = mapTypeToBracket("openArray", mOpenArray, t, info) of tyRange: result = newNodeIT(nkBracketExpr, if t.n.isNil: info else: t.n.info, t) result.add atomicType("range", mRange) result.add t.n.sons[0].copyTree result.add t.n.sons[1].copyTree of tyPointer: result = atomicType("pointer", mPointer) of tyString: result = atomicType("string", mString) of tyCString: result = atomicType("cstring", mCString) of tyInt: result = atomicType("int", mInt) of tyInt8: result = atomicType("int8", mInt8) of tyInt16: result = atomicType("int16", mInt16) of tyInt32: result = atomicType("int32", mInt32) of tyInt64: result = atomicType("int64", mInt64) of tyFloat: result = atomicType("float", mFloat) of tyFloat32: result = atomicType("float32", mFloat32) of tyFloat64: result = atomicType("float64", mFloat64) of tyFloat128: result = atomicType("float128", mFloat128) of tyUInt: result = atomicType("uint", mUint) of tyUInt8: result = atomicType("uint8", mUint8) of tyUInt16: result = atomicType("uint16", mUint16) of tyUInt32: result = atomicType("uint32", mUint32) of tyUInt64: result = atomicType("uint64", mUint64) of tyVarargs: result = mapTypeToBracket("varargs", mVarargs, t, info) of tyProxy: result = atomicType("error", mNone) of tyBuiltInTypeClass: result = mapTypeToBracket("builtinTypeClass", mNone, t, info) of tyUserTypeClass, tyUserTypeClassInst: if t.isResolvedUserTypeClass: result = mapTypeToAst(t.lastSon, info) else: result = mapTypeToBracket("concept", mNone, t, info) result.add t.n.copyTree of tyCompositeTypeClass: result = mapTypeToBracket("compositeTypeClass", mNone, t, info) of tyAnd: result = mapTypeToBracket("and", mAnd, t, info) of tyOr: result = mapTypeToBracket("or", mOr, t, info) of tyNot: result = mapTypeToBracket("not", mNot, t, info) of tyAnything: result = atomicType("anything", mNone) of tyInferred: assert false of tyStatic, tyFromExpr: if inst: if t.n != nil: result = t.n.copyTree else: result = atomicType("void", mVoid) else: result = newNodeIT(nkBracketExpr, if t.n.isNil: info else: t.n.info, t) result.add atomicType("static", mNone) if t.n != nil: result.add t.n.copyTree of tyUnused, tyOptAsRef: assert(false, "mapTypeToAstX") proc opMapTypeToAst*(t: PType; info: TLineInfo): PNode = result = mapTypeToAstX(t, info, false, true) # the "Inst" version includes generic parameters in the resulting type tree # and also tries to look like the corresponding Nim type declaration proc opMapTypeInstToAst*(t: PType; info: TLineInfo): PNode = result = mapTypeToAstX(t, info, true, false) # the "Impl" version includes generic parameters in the resulting type tree # and also tries to look like the corresponding Nim type implementation proc opMapTypeImplToAst*(t: PType; info: TLineInfo): PNode = result = mapTypeToAstX(t, info, true, true)