about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-22 08:02:04 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-22 08:02:04 +0100
commit6ee9f1345760f320dd76c713754ba2a70669bedd (patch)
tree20c0c6d05a1f80796fe2c9ee49cb537c5e23f132
parent352cae4380713949d3800ebcda7aff3bb5ab9efc (diff)
downloaddwm-6ee9f1345760f320dd76c713754ba2a70669bedd.tar.gz
fixing missing extern declars in dwm.h for {de,at}tach()
-rw-r--r--dwm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/dwm.h b/dwm.h
index 6fe9e15..a6af9ba 100644
--- a/dwm.h
+++ b/dwm.h
@@ -102,7 +102,9 @@ extern Layout *lt;
 extern Window root, barwin;
 
 /* client.c */
+extern void attach(Client *c);			/* attaches c to global client list */
 extern void configure(Client *c);		/* send synthetic configure event */
+extern void detach(Client *c);			/* detaches c from global client list */
 extern void focus(Client *c);			/* focus c, c may be NULL */
 extern void killclient(Arg arg);		/* kill c nicely */
 extern void manage(Window w, XWindowAttributes *wa);	/* manage new client */
color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
from ranger.actions import Actions
from ranger.container import Bookmarks
from ranger.ext.relpath import relpath_conf
from ranger import __version__

CTRL_C = 3
TICKS_BEFORE_COLLECTING_GARBAGE = 100

class FM(Actions):
	def __init__(self, ui = None, bookmarks = None):
		"""Initialize FM."""
		Actions.__init__(self)
		self.ui = ui
		self.bookmarks = bookmarks
		self.apps = self.settings.apps.CustomApplications()

		from ranger.shared import FileManagerAware
		FileManagerAware.fm = self

	def initialize(self):
		"""If ui/bookmarks are None, they will be initialized here."""
		from ranger.fsobject.directory import Directory

		if self.bookmarks is None:
			self.bookmarks = Bookmarks(
					bookmarkfile=relpath_conf('bookmarks'),
					bookmarktype=Directory,
					autosave=False)
			self.bookmarks.load()

		else:
			self.bookmarks = bookmarks

		if self.ui is None:
			from ranger.gui.defaultui import DefaultUI
			self.ui = DefaultUI()
			self.ui.initialize()

	def loop(self):
		"""The main loop consists of:
1. reloading bookmarks if outdated
2. drawing and finalizing ui
3. reading and handling user input
4. after X loops: collecting unused directory objects
"""

		self.env.enter_dir(self.env.path)

		gc_tick = 0

		try:
			while True:
				try:
					self.bookmarks.update_if_outdated()
					self.ui.draw()
					self.ui.finalize()

					key = self.ui.get_next_key()
					self.ui.handle_key(key)

					gc_tick += 1
					if gc_tick > TICKS_BEFORE_COLLECTING_GARBAGE:
						gc_tick = 0
						self.env.garbage_collect()

				except KeyboardInterrupt:
					self.ui.handle_key(CTRL_C)
		finally:
			self.bookmarks.remember(self.env.pwd)
			self.bookmarks.save()