about summary refs log tree commit diff stats
path: root/dwm.h
Commit message (Collapse)AuthorAgeFilesLines
* 3->4 colorsAnselm R. Garbe2006-08-241-3/+2
|
* updated man pageAnselm R. Garbe2006-08-231-1/+1
|
* separated setup stuff into main.c:setup() - this makes main() more readableAnselm R. Garbe2006-08-231-12/+8
|
* separated several functions into view.cAnselm R. Garbe2006-08-221-10/+12
|
* changed main event loopAnselm R.Garbe2006-08-151-0/+1
|
* removed NUMLOCKMASK, added dynamically calculated numlockmask insteadAnselm R.Garbe2006-08-141-1/+1
|
* changed replacetag into toggletagAnselm R.Garbe2006-08-141-3/+3
|
* removed ungrabkeys again (because of sander's mail)Anselm R.Garbe2006-08-141-1/+0
|
* implemented ungrabkeys() which is called in cleanup()Anselm R.Garbe2006-08-141-0/+1
|
* implemented restack behavior (floats are on top in tiled mode)Anselm R.Garbe2006-08-141-1/+2
|
* removed viewnext/viewprevAnselm R.Garbe2006-08-141-2/+0
|
* made shortcuts like proposed by Sander, renamed viewextend to toggleview ↵Anselm R.Garbe2006-08-131-1/+1
| | | | (more clear)
* implemented viewextend and added M-S-C-n shortcuts for extending the current ↵Anselm R.Garbe2006-08-111-1/+2
| | | | view... updated man page (works great!) nice feature
* implement multi-tag selection through button3 click on the specific tagAnselm R.Garbe2006-08-111-2/+3
|
* readded border color, this sucks leastAnselm R.Garbe2006-08-101-0/+1
|
* removed unnecessary border colorAnselm R.Garbe2006-08-101-1/+0
|
* disallow zoom on maximized clientsAnselm R.Garbe2006-08-101-1/+0
|
* removed NET_ACTIVE_WINDOW handlingAnselm R.Garbe2006-08-081-1/+1
|
* implemented NET_ACTIVE_WINDOW supportAnselm R.Garbe2006-08-081-1/+1
|
* switched to regexp matching for Rulesarg@10ksloc.org2006-08-041-0/+1
|
* using execl now, argv changed, using cmd and const char defs directly in the ↵arg@10ksloc.org2006-08-041-1/+1
| | | | KEYS struct
* removed TLast tag enum, now tags is simple defined as char *[] array, the ↵arg@10ksloc.org2006-08-031-2/+3
| | | | rest is calculated correctly, rules take an int array for the tags
* changed Client->tags and Rule->tags to be Bool (I'll also try to remove the ↵arg@10ksloc.org2006-08-031-3/+4
| | | | TLast enum)
* removed the CONFIG variable from config.mk, renamed config.h into ↵arg@10ksloc.org2006-08-021-1/+1
| | | | config.default.h, after first clone/extract one needs to copy config.default.h to config.h, that is easier than always heavy typing make CONFIG=blafasel
* made fullscreen apps working fine in floating mode (there is no sane way to ↵arg@10ksloc.org2006-08-021-2/+2
| | | | make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
* renamed WM_PROTOCOL_DELWIN into PROTODELWINarg@10ksloc.org2006-08-011-1/+1
|
* cleaned config.*h to prevent some confusionarg@10ksloc.org2006-08-011-2/+3
|
* uppercasing all define'd values (uppercase-prefixed should only be enum ↵arg@10ksloc.org2006-08-011-2/+2
| | | | field qualifiers)
* centralized/externalized configuration to config.harg@10ksloc.org2006-08-011-20/+1
|
* applied Jukkas prev/next patch with XK_{h,l}arg@10ksloc.org2006-08-011-0/+2
|
* applied Sanders patchesarg@10ksloc.org2006-08-011-2/+6
|
* committed a patch which fixes the hints of Jukkaarg@10ksloc.org2006-08-011-1/+1
|
* sanitization of several clunky stuff, removed heretag (rarely of use), ↵arg@10ksloc.org2006-07-211-12/+10
| | | | simplified pop(), changed shortcuts to always contain MODKEY
* applied sanders no_sizehints for tiled mode patch (thx!)arg@10ksloc.org2006-07-201-1/+1
|
* using double-linked list in order to get correct prev focus handlingarg@10ksloc.org2006-07-201-1/+2
|
* cleaned the CUSTOMIZE flagsarg@10ksloc.org2006-07-201-2/+2
|
* made status bar drawing more robust, implemented togglemax and togglemode, ↵arg@10ksloc.org2006-07-201-1/+3
| | | | works quite well
* removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling ↵arg@10ksloc.org2006-07-201-5/+2
| | | | remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
* implemented regexp matching for rulesarg@10ksloc.org2006-07-191-17/+0
|
* applied Jukka's patch with s/ModKeyMask/MODKEY/garg@10ksloc.org2006-07-191-0/+1
|
* refactored Sanders code somewhatarg@10ksloc.org2006-07-191-2/+2
|
* applied Sanders resize patch, fixed lower bugarg@10ksloc.org2006-07-191-1/+4
|
* implemened distinguishing float/managed geometries of clients (works quite well)Anselm R. Garbe2006-07-181-2/+5
|
* pop on heretagAnselm R. Garbe2006-07-181-0/+1
|
* added heretag command which allows to tag a client of a foreign tag with ↵Anselm R. Garbe2006-07-181-1/+2
| | | | current tag
* ordered variables in structs and source files alphabeticallyAnselm R. Garbe2006-07-171-20/+18
|
* several additions in mouse handling ;)Anselm R. Garbe2006-07-161-2/+2
|
* changing XFlush into XSyncAnselm R. Garbe2006-07-151-0/+5
|
* sanitized other stuffAnselm R. Garbe2006-07-151-3/+1
|
* proceeded with cleaning up, sorting functions, etcAnselm R. Garbe2006-07-151-20/+19
|
class="p">) for i,line in ipairs(Lines) do if line.mode == 'text' then Cursor1.line = i break end end love.window.setTitle('Text with Lines - '..Filename) end -- App.initialize function App.filedropped(file) App.initialize_globals() -- in particular, forget all undo history Filename = file:getFilename() file:open('r') Lines = load_from_file(file) file:close() for i,line in ipairs(Lines) do if line.mode == 'text' then Cursor1.line = i break end end love.window.setTitle('Text with Lines - '..Filename) end function App.draw() Button_handlers = {} love.graphics.setColor(1, 1, 1) love.graphics.rectangle('fill', 0, 0, App.screen.width-1, App.screen.height-1) love.graphics.setColor(0, 0, 0) assert(Text.le1(Screen_top1, Cursor1)) local y = Margin_top --? print('== draw') for line_index,line in ipairs(Lines) do --? print('draw:', y, line_index, line) if y + Line_height > App.screen.height then break end --? print('a') if line_index >= Screen_top1.line then Screen_bottom1.line = line_index if line.mode == 'text' and line.data == '' then line.y = y button('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0}, icon = icon.insert_drawing, onpress1 = function() Drawing.before = snapshot() table.insert(Lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}}) if Cursor1.line >= line_index then Cursor1.line = Cursor1.line+1 end end}) if Search_term == nil then if line_index == Cursor1.line then Text.draw_cursor(25, y) end end y = y + Line_height elseif line.mode == 'drawing' then y = y+10 -- padding line.y = y Drawing.draw(line) y = y + Drawing.pixels(line.h) + 10 -- padding else --? print('text') line.y = y y, Screen_bottom1.pos = Text.draw(line, Line_width, line_index) y = y + Line_height --? print('=> y', y) end end end --? print('screen bottom: '..tostring(Screen_bottom1.pos)..' in '..tostring(Lines[Screen_bottom1.line].data)) if Search_term then Text.draw_search_bar() end end function App.update(dt) Drawing.update(dt) end function App.mousepressed(x,y, mouse_button) if Search_term then return end propagate_to_button_handlers(x,y, mouse_button) for line_index,line in ipairs(Lines) do if line.mode == 'text' then if Text.in_line(line, x,y) then if App.shift_down() then Selection1 = {line=Cursor1.line, pos=Cursor1.pos} end Cursor1.line = line_index Cursor1.pos = Text.to_pos_on_line(line, x, y) if not App.shift_down() then Selection1 = {line=Cursor1.line, pos=Cursor1.pos} end end elseif line.mode == 'drawing' then if Drawing.in_drawing(line, x, y) then Drawing.mouse_pressed(line, x,y, button) end end end end function App.mousereleased(x,y, button) if Search_term then return end if Lines.current_drawing then Drawing.mouse_released(x,y, button) else for line_index,line in ipairs(Lines) do if line.mode == 'text' then if Text.in_line(line, x,y) then Cursor1.line = line_index Cursor1.pos = Text.to_pos_on_line(line, x, y) if Text.eq1(Cursor1, Selection1) and not App.shift_down() then Selection1 = {} end end end end --? print('select:', Selection1.line, Selection1.pos) end end function App.textinput(t) for _,line in ipairs(Lines) do line.y = nil end -- just in case we scroll if Search_term then Search_term = Search_term..t Search_text = nil Text.search_next() elseif Current_drawing_mode == 'name' then local drawing = Lines.current_drawing local p = drawing.points[drawing.pending.target_point] p.name = p.name..t else Text.textinput(t) end save_to_disk(Lines, Filename) end function App.keychord_pressed(chord) for _,line in ipairs(Lines) do line.y = nil end -- just in case we scroll if Search_term then if chord == 'escape' then Search_term = nil Search_text = nil Cursor1 = Search_backup.cursor Screen_top1 = Search_backup.screen_top Search_backup = nil elseif chord == 'return' then Search_term = nil Search_text = nil Search_backup = nil elseif chord == 'backspace' then local len = utf8.len(Search_term) local byte_offset = utf8.offset(Search_term, len) Search_term = string.sub(Search_term, 1, byte_offset-1) Search_text = nil elseif chord == 'down' then Cursor1.pos = Cursor1.pos+1 Text.search_next() elseif chord == 'up' then Text.search_previous() end return elseif chord == 'C-f' then Search_term = '' Search_backup = {cursor={line=Cursor1.line, pos=Cursor1.pos}, screen_top={line=Screen_top1.line, pos=Screen_top1.pos}} assert(Search_text == nil) elseif chord == 'C-=' then Font_height = Font_height+2 love.graphics.setFont(love.graphics.newFont(Font_height)) Line_height = math.floor(Font_height*1.3) Text.redraw_all() elseif chord == 'C--' then Font_height = Font_height-2 love.graphics.setFont(love.graphics.newFont(Font_height)) Text.redraw_all() Line_height = math.floor(Font_height*1.3) elseif chord == 'C-0' then Font_height = 20 love.graphics.setFont(love.graphics.newFont(Font_height)) Text.redraw_all() Line_height = 26 elseif chord == 'C-z' then local event = undo_event() if event then local src = event.before Screen_top1 = deepcopy(src.screen_top) Cursor1 = deepcopy(src.cursor) Selection1 = deepcopy(src.selection) patch(Lines, event.after, event.before) end elseif chord == 'C-y' then local event = redo_event() if event then local src = event.after Screen_top1 = deepcopy(src.screen_top) Cursor1 = deepcopy(src.cursor) Selection1 = deepcopy(src.selection) patch(Lines, event.before, event.after) end -- clipboard elseif chord == 'C-c' then local s = Text.selection() if s then App.setClipboardText(s) end elseif chord == 'C-x' then local s = Text.cut_selection() if s then App.setClipboardText(s) end elseif chord == 'C-v' then -- We don't have a good sense of when to scroll, so we'll be conservative -- and sometimes scroll when we didn't quite need to. local before_line = Cursor1.line local before = snapshot(before_line) local clipboard_data = App.getClipboardText() local num_newlines = 0 -- hack 1 for _,code in utf8.codes(clipboard_data) do local c = utf8.char(code) if c == '\n' then Text.insert_return() num_newlines = num_newlines+1 else Text.insert_at_cursor(utf8.char(code)) end end -- hack 1: if we have too many newlines we definitely need to scroll for i=before_line,Cursor1.line do Lines[i].screen_line_starting_pos = nil Text.populate_screen_line_starting_pos(i) end if Cursor1.line-Screen_top1.line+1 + num_newlines > App.screen.height/Line_height then Screen_top1.line = Cursor1.line Screen_top1.pos = 1 Text.scroll_up_while_cursor_on_screen() end -- hack 2: if we have too much text wrapping we definitely need to scroll local clipboard_text = App.newText(love.graphics.getFont(), clipboard_data) local clipboard_width = App.width(clipboard_text) --? print(Cursor_y, Cursor_y*Line_width, Cursor_y*Line_width+Cursor_x, Cursor_y*Line_width+Cursor_x+clipboard_width, Line_width*App.screen.height/Line_height) if Cursor_y*Line_width+Cursor_x + clipboard_width > Line_width*App.screen.height/Line_height then Screen_top1.line = Cursor1.line Screen_top1.pos = 1 Text.scroll_up_while_cursor_on_screen() end record_undo_event({before=before, after=snapshot(before_line, Cursor1.line)}) -- dispatch to drawing or text elseif love.mouse.isDown('1') or chord:sub(1,2) == 'C-' then Drawing.keychord_pressed(chord) elseif chord == 'escape' and love.mouse.isDown('1') then local drawing = Drawing.current_drawing() if drawing then drawing.pending = {} end elseif chord == 'escape' and not love.mouse.isDown('1') then for _,line in ipairs(Lines) do if line.mode == 'drawing' then line.show_help = false end end elseif Current_drawing_mode == 'name' then if chord == 'return' then Current_drawing_mode = Previous_drawing_mode Previous_drawing_mode = nil else local drawing = Lines.current_drawing local p = drawing.points[drawing.pending.target_point] if chord == 'escape' then p.name = nil elseif chord == 'backspace' then local len = utf8.len(p.name) local byte_offset = utf8.offset(p.name, len-1) p.name = string.sub(p.name, 1, byte_offset) end end save_to_disk(Lines, Filename) else Text.keychord_pressed(chord) end end function App.keyreleased(key, scancode) end