about summary refs log tree commit diff stats
path: root/dwm.h
Commit message (Expand)AuthorAgeFilesLines
* removed an unnecessary newlineAnselm R. Garbe2007-02-241-1/+0
* removed superfluous externs (except for tags, because tags is defined in the ...Anselm R. Garbe2007-02-241-53/+53
* renamed untiled into floating, keeping tiled instead of tiling (afaik tiled s...Anselm R. Garbe2007-02-221-4/+4
* made Fnt an anonymous inner structAnselm R. Garbe2007-02-221-15/+15
* made Fnt an anonymous inner structAnselm R. Garbe2007-02-221-9/+7
* renamed versatile into untiledAnselm R. Garbe2007-02-221-4/+4
* merged focus{prev.next} into focusclient(1/-1)Anselm R. Garbe2007-02-221-2/+1
* made dwm.h more tidy (thx Jukka for the zoom() hint)Anselm R. Garbe2007-02-221-12/+11
* replaced Arg union with const char *arg, seems cleaner to me, even if we need...Anselm R. Garbe2007-02-221-20/+15
* fixing missing extern declars in dwm.h for {de,at}tach()Anselm R. Garbe2007-02-221-0/+2
* several changes, made togglemax extern and separated it from zoom() - moved z...Anselm R. Garbe2007-02-221-15/+15
* reverted accidental removal of sx, syAnselm R. Garbe2007-02-211-1/+1
* removed some global vars which should be static insteadAnselm R. Garbe2007-02-211-2/+2
* moved focus{next,prev} and nexttiled from client.c to layout.c (because those...Anselm R. Garbe2007-02-211-4/+4
* fixed quoting and a comment 3.6Anselm R. Garbe2007-02-211-1/+1
* added draw.c again (except getcolor and setfont which are helpers in main.c)Anselm R. Garbe2007-02-201-4/+6
* separating drawsquare from drawtext, made drawtext externAnselm R. Garbe2007-02-201-0/+2
* split screen.c into layout.c and tag.c (because the view is an implicit mixtu...Anselm R. Garbe2007-02-201-8/+10
* replaced togglelayout with setlayoutAnselm R. Garbe2007-02-191-1/+1
* renamed Client->versatile and Rule->versatile into Client->isversatile resp. ...Anselm R. Garbe2007-02-191-1/+1
* renames swim[ming] into versatileAnselm R. Garbe2007-02-191-3/+3
* renamed floating into swimming (this does not clash with C naming conventions...Anselm R. Garbe2007-02-191-4/+3
* introduced Layout structAnselm R. Garbe2007-02-191-7/+12
* forgot an extern declarationAnselm R. Garbe2007-02-191-1/+1
* removed procevent, more refactoringAnselm R. Garbe2007-02-191-1/+0
* draw.c is useless (belongs to main.c now)Anselm R. Garbe2007-02-191-8/+3
* renamed view.c into screen.cAnselm R. Garbe2007-02-191-6/+4
* renamed manage.c to view.cAnselm R. Garbe2007-02-191-7/+7
* merged tag.c, view.c and tile.c to manage.cAnselm R. Garbe2007-02-191-21/+15
* some more refactoringAnselm R. Garbe2007-02-191-5/+5
* added some new convenience functionsAnselm R. Garbe2007-02-191-1/+4
* introduced tile.c, some refactoring of functionsAnselm R. Garbe2007-02-191-5/+8
* removed ugly ban(), extended resize() that it only resets the size if necessa...Anselm R. Garbe2007-02-161-2/+2
* removed getnext/getprev, redundantAnselm R. Garbe2007-02-161-2/+0
* added ban() which takes care than a banned window is not banned again... (thi...Anselm R. Garbe2007-02-141-1/+2
* replaced getproto with a saner function, now old-school artifacts of WM times...Anselm R. Garbe2007-02-071-5/+2
* 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
n>:: nim call(a) Here `call` can change a field or element of `a`, so if we have a dependant expression of `a` : e.g. `a.field`. Dependats become `MaybeNil`. branches rules --------------- Branches are the reason we do nil checking like this: with flow checking. Sources of brancing are `if`, `while`, `for`, `and`, `or`, `case`, `try` and combinations with `return`, `break`, `continue` and `raise` We create a new layer/"scope" for each branch where we map expressions to nilability. This happens when we "fork": usually on the beginning of a construct. When branches "join" we usually unify their expression maps or/and nilabilities. Merging usually merges maps and alias sets: nilabilities are merged like this: .. code-block:: nim template union(l: Nilability, r: Nilability): Nilability = ## unify two states if l == r: l else: MaybeNil Special handling is for `.isNil` and `== nil`, also for `not`, `and` and `or`. `not` reverses the nilability, `and` is similar to "forking" : the right expression is checked in the layer resulting from the left one and `or` is similar to "merging": the right and left expression should be both checked in the original layer. `isNil`, `== nil` make expressions `Nil`. If there is a `not` or `!= nil`, they make them `Safe`. We also reverse the nilability in the opposite branch: e.g. `else`. compound expressions: field, index expressions ----------------------------------------------- We want to track also field(dot) and index(bracket) expressions. We track some of those compound expressions which might be nilable as dependants of their bases: `a.field` is changed if `a` is moved (re-assigned), similarly `a[index]` is dependent on `a` and `a.field.field` on `a.field`. When we move the base, we update dependants to `MaybeNil`. Otherwise we usually start with type nilability. When we call args, we update the nilability of their dependants to `MaybeNil` as the calls usually can change them. We might need to check for `strictFuncs` pure funcs and not do that then. For field expressions `a.field`, we calculate an integer value based on a hash of the tree and just accept equivalent trees as equivalent expressions. For item expression `a[index]`, we also calculate an integer value based on a hash of the tree and accept equivalent trees as equivalent expressions: for static values only. For now we support only constant indices: we dont track expression with no-const indices. For those we just report a warning even if they are safe for now: one can use a local variable to workaround. For loops this might be annoying: so one should be able to turn off locally the warning using the `{.warning[StrictCheckNotNil]:off}.`. For bracket expressions, in the future we might count `a[<any>]` as the same general expression. This means we should should the index but otherwise handle it the same for assign (maybe "aliasing" all the non-static elements) and differentiate only for static: e.g. `a[0]` and `a[1]`. element tracking ----------------- When we assign an object construction, we should track the fields as well: .. code-block:: nim var a = Nilable(field: Nilable()) # a : Safe, a.field: Safe Usually we just track the result of an expression: probably this should apply for elements in other cases as well. Also related to tracking initialization of expressions/fields. unstructured control flow rules ------------------------------- Unstructured control flow keywords as `return`, `break`, `continue`, `raise` mean that we jump from a branch out. This means that if there is code after the finishing of the branch, it would be ran if one hasn't hit the direct parent branch of those: so it is similar to an `else`. In those cases we should use the reverse nilabilities for the local to the condition expressions. E.g. .. code-block:: nim for a in c: if not a.isNil: b() break code # here a: Nil , because if not, we would have breaked aliasing ------------ We support alias detection for local expressions. We track sets of aliased expressions. We start with all nilable local expressions in separate sets. Assignments and other changes to nilability can move / move out expressions of sets. `move`: Moving `left` to `right` means we remove `left` from its current set and unify it with the `right`'s set. This means it stops being aliased with its previous aliases. .. code-block:: nim var left = b left = right # moving left to right `move out`: Moving out `left` might remove it from the current set and ensure that it's in its own set as a single element. e.g. .. code-block:: nim var left = b left = nil # moving out initialization of non nilable and nilable values ------------------------------------------------- TODO warnings and errors --------------------- We show an error for each dereference (`[]`, `.field`, `[index]` `()` etc) which is of a tracked expression which is in `MaybeNil` or `Nil` state. We might also show a history of the transitions and the reasons for them that might change the nilability of the expression.