From: Axel S. <A....@ke...> - 2005-12-07 14:59:53
|
On Wed, 2005-12-07 at 13:57 +0000, Duncan Coutts wrote: > > > where setBitSliceWord32 :: Word32 -> Int -> Int -> Word32 -> Word32 > > > setBitSliceWord32 word off count value = > > > let mask = (1 `shiftL` count - 1) `shiftL` off > > > in (word .&. complement mask) .|. (value `shiftL` off) > > > > Ok, so you can do it :-) > > Yeah, ok that was overkill. :-) > I could have just said "actually it's not too hard". Sorry that wasn't meant to be condescending. I guess my point was that it can be done, but it might be a bad trade-off since it is rather tricky to get right and it's not clear if it has any advantages over an array of arrays. I wonder what the API would look like if people where to implement their own Model. Is your indexing scheme already part of a model (i.e. we pass three integers from the TreeIter for people implementing their own model) or is this built into the library (i.e. people implementing a model get a TreePath). > > > > To advertise my suggestion... Advancing iterators is O(1) in all cases, > > > > even if you iter through the children (which requires a hashtable > > > > lookup). And it is a bit simpler to implement. > > > > > > That sounds good! > > > > > > > That said, we could have both approaches. > > > > > > I've mostly implemented (but not fully tested) the above approach. (See > > > the attached screenshot.) I might have a go with your suggestion and see > > > how they compare. > > > > Maybe you can commit something, so I can look at it? > > Sure. I'll start by committing the low level bits (C parts + low level > Haskell wrapper) and post the high level bits to the list for review. I'm not so worried that your high level stuff doesn't work. Committing is fine by me. > > No rush, though, I'm supposed to work on my PhD (and spent the whole > > morning adding the onInsertText signal). > > Heh. Yeah that signal bocking/stopping stuff is less than pleasant. I added two functions called stopTextInsert and stopDeleteInsert. That begs the question if we should have these functions for all handlers... Axel. |