Dana Jansens [Mon, 8 Aug 2011 16:35:52 +0000 (12:35 -0400)]
Make ObConfigParser objects.
The ConfigParser object lets you register paths/variables with a specific
object. Then you can load a file with that object. Different files may
obviously need different variables.
Dana Jansens [Sat, 6 Aug 2011 01:55:00 +0000 (21:55 -0400)]
wip: Add config_parser.c which will provide a nice means to specify config variables and where they are in the config file.
- Has functions to register variables of different types.
- When it reads from the file it stores it in an ObConfigValue, but
puts the raw value directly into a variable of the right type so there
is no redirection needed to access config values.
TODO:
- move the config file loading shit into config_parser.c
- have config.c just register the various config vars with the parser.
- some more complex things like Fonts will need more work.
- remove the "#if 0" stuff in config_parser.c
- this is an example of the direction I'm trying to go in config.c eventually
Dana Jansens [Sat, 6 Aug 2011 01:53:33 +0000 (21:53 -0400)]
Add ObConfigValue types for a keyboard and mouse button (with modifiers).
Make the copy process return FALSE if the value cannot be copied successfully.
Make the enum, key, and mouse functions return FALSE if the ObConfigValue
isn't valid.
Dana Jansens [Fri, 5 Aug 2011 15:35:09 +0000 (11:35 -0400)]
Rename ObActionValue to ObConfigValue. This holds one of three types.
1. A string
2. A list of other ObConfigValues
3. A list of actions (ObActionList).
The string type can be returned in various ways such as int, enum, fraction, gravity coordiate.
Provide a ways to save the ObConfigValue into a pointer. This lets you keep
the value contained withing the ObConfigValue in a variable of its basic type.
Dana Jansens [Wed, 3 Aug 2011 21:03:30 +0000 (17:03 -0400)]
register filters on startup
TODO:
1. write filters for everything in actions/if.c
2. rm actions/if.c
3. make action(s) to change config options?
includes key and mouse binding
4. rm -rf *xml*?
Dana Jansens [Wed, 3 Aug 2011 15:32:02 +0000 (11:32 -0400)]
Add functions to ObClientSet to run a function on each client in the set, and add constness.
Anything that doesnt change/destroy the given set takes a const ObClientSet*.
Dana Jansens [Tue, 2 Aug 2011 19:55:44 +0000 (15:55 -0400)]
Add action_list_run.c/h with action_list_run() and struct ObActionListRun.
This function runs an action list, taking over from the function that used to
live in action.c. Now the action.c function will simply run a single action.
The actions and filters now take a const ObActionListRun* which describes
the user event which triggered the actions/filters to run.
The action_list_run() function can also run filters, yay. However...
TODO:
1. the filters' client sets are not passed to actions yet. do this.
2. make action(s) to change config options
includes key and mouse binding
3. rm -rf *xml*
Dana Jansens [Tue, 2 Aug 2011 18:45:21 +0000 (14:45 -0400)]
Add a means to duplicate ObClientSet
and fix destroy notifications.
- set the destroy notification when making a set with a single window, not
when making an empty set.
- always add/remove the destroy notification when creating/destroying the hash
table
Dana Jansens [Mon, 4 Oct 2010 18:33:16 +0000 (14:33 -0400)]
Create some Openbox release scripts:
release/bugs: Prints a list of bugs that are mentioned in git commits for a
git revision, since previous release.
- Very useful for updating the CHANGELOG file!
release/go: Tests a git revision for correct compilation, and prepares files
for release.
- Makes the tarball
- Makes a GPG signature for the tarball
- Tags the release
- Spits out URLs to edit and gives the changelog for copy/paste.
release/email: Sends an email to the Openbox mailing list with the changelog
and details about the release. Call this with the same parameters used for
running release/go once it is finished, and the files are uploaded, etc.
- Also emails mikachu re freshmeat.net
Dana Jansens [Fri, 29 Jul 2011 21:28:14 +0000 (17:28 -0400)]
make a special "ALL" ObClientSet which contains all clients.
This saves copying all the clients into the set.
IMPORTANT: This client set will test as a "true" boolean regardless of if there
are clients present or not.
- We did this to allow for boolean filters. A boolean filter returns the
"ALL" set for its true value, and an empty set for its false value.
Dana Jansens [Fri, 29 Jul 2011 20:57:55 +0000 (16:57 -0400)]
Pass a user data to the client_set_reduce/expand function which is given to the
callback.
This lets us pass the filter's context in to its test function along with the
client window, so it can make an intelligent decision about adding/removing
the client from the current set.
Dana Jansens [Fri, 29 Jul 2011 20:00:02 +0000 (16:00 -0400)]
Add ObClientSet data type. It holds a set of clients !
The sets can be modified by union and intersection, and can have clients
added or removed with a test callback function.
They use a GHashTable underneath.
Dana Jansens [Wed, 27 Jul 2011 20:32:05 +0000 (16:32 -0400)]
Parse ObActionsList*s from the config file (out of the xml for now).
- config.c: use the new actions parser
- actions.c: provide the actions parser a way to create a new action (takes
a hash table of options for it)
- actions/*.c: take a hash table of options instead of an xml subtree
- *: us ObActionsList* instead of a GList* of ObActionAct*s.
TODO:
1. make filters
openbox/filters/*.c
openbox/filters.c as interface to them
store filters in parsed filter tests instead of key/value pairs
2. make action(s) to change config options
includes key and mouse binding
3. rm -rf *xml*
Dana Jansens [Tue, 26 Jul 2011 22:06:42 +0000 (18:06 -0400)]
Add a parser for the action command language.
The parser generates list of actions (complete with filters). The parser isn't
called anywhere yet, and uses the incomplete actions_act_new() function.
TODO:
The filters now are just text string key:value pairs. But they should
become intelligent objects like actions are.
The actions need to change their option parsing from XML to the new key:value
pair lists.
Dana Jansens [Tue, 26 Jul 2011 13:40:52 +0000 (09:40 -0400)]
Fix blocking in inotify reader.
If the inotify reader reads an event and it ends at the same place the read()
ended, then we don't know that there is anything more available, so don't
try read() again until after it has been poll()'d.
Dana Jansens [Sun, 24 Jul 2011 22:13:36 +0000 (18:13 -0400)]
Make the obt_watch functionality work without inotify (via manual refreshes).
Adds obt/watch_manual.c which is a filler for when watch_inotify.c can't be
used. Other watch_foo.c may also exist in the future I hope.
Adds obt/watch_interface.h which the inotify (and others) subsystem can use
to call back notification to the main watch system that events have
occured.
Keep track of all files being watched within the main watch system, so that if
a directory disappears, we can report the files inside it being removed.
This change moved a lot of the recursive functionality out from
watch_inotify.c into the main watch.c, making it much more simple and should
help make it much easier to add other watch_foo.c subsystems.
Dana Jansens [Wed, 9 Mar 2011 18:49:11 +0000 (13:49 -0500)]
fix updates in the app menu from the linkbase.
it did not remove things correctly if the linkbase removed something while the
menu was not shown.
it sorted the wrong list.
basically it was buggy. tested now with a duplicate .desktop id in 2 places,
and the menu shows only one copy. updating it while the menu is not shown
correctly updates the menu. updating it while the menu is shown also
correclty updates the menu.
Dana Jansens [Wed, 26 Jan 2011 23:11:22 +0000 (18:11 -0500)]
Show the list of categories in the apps menus as submenus.
The categories are not based on what you actually have yet but will be soon.
Removed the "main category" notion from the links themselves, they just
publish a list of categories instead. Moved this notion out to the Apps menu
itself. This should make it easy to possibly to customize your set of
visible categories if we should like to do that sometime.
Dana Jansens [Tue, 25 Jan 2011 18:25:22 +0000 (13:25 -0500)]
don't free lists in the linkbase hash table prematurely.
the values (GSList objects) are freed by the hash table's free function if a
new value is inserted. if we change the list and reinsert it, then it would
cause the list we're inserting to get freed (partially). not good. so instead
we manually free them when we remove them/destroy the hash table.
Dana Jansens [Mon, 24 Jan 2011 22:05:44 +0000 (17:05 -0500)]
Avoid blocks on read() for inotify.
When we come into the function we don't know how much data is available to
read. So just read a single event and return, so poll can figure out if there
is more for us or not.
Dana Jansens [Mon, 24 Jan 2011 20:13:27 +0000 (15:13 -0500)]
Filter links in a ObtLinkbase by environments.
Store a set of active environments in a linkbase and only include links in the
linkbase that 1) want to be displayed, 2) pass TryExec, 3) match environment
requirements and restrictions.
Dana Jansens [Tue, 21 Sep 2010 00:46:37 +0000 (20:46 -0400)]
Linkbase adds all the .desktops in the system, and updates them as they change.
Fixes to .desktop parsing.
Add language/locale support for .desktop files.
Fixes to inotify watching, change what information is passed through the notify handler.
Add linkbase.h to the public obt headers.
Dana Jansens [Mon, 20 Sep 2010 19:45:36 +0000 (15:45 -0400)]
Add/fix inotify support for watching filesystem changes.
obt/watch.h has the interface.
obt/watch.c has the generic watch code.
obt/watch_inotify.c has an inotify-specific backend, which could be replaced with another.
Carlos Pita [Wed, 12 Jan 2011 23:49:45 +0000 (20:49 -0300)]
Separate theme options for osd prompt buttons.
I managed to keep backwards compatibility without really cluttering
the code so here is the patch
http://bugzilla.icculus.org/show_bug.cgi?id=4874 too.
Please keep in mind that this is my first piece of code for openbox
and that I'm not a die hard openbox user (yet), not to tell the patch
was not exhaustively tested. Anyway I think it's pretty much in a good
shape but any criticism will be welcome.
Basically the patch add the following theme options for controlling
buttons in osd prompts:
%%%% colors
%
% for the text inside the button
osd.button.unpressed.text.color
osd.button.pressed.text.color
osd.button.focused.text.color
%
% for the line art around the button
% (if you don't wan't the box just make box.color = bg.color)
osd.button.pressed.box.color
osd.button.focused.box.color
unpressed: neither clicked nor selected
focused: selected but not clicked
pressed: clicked (and of course selected)
I discarded the previous distinction between press and pfocus as in
fact it was only a formal distinction, in that both appearances
mimicked each other in every sense. It think that it was just
inherited from the way titlebar buttons are managed so I decided to
simplify it a bit.
All the options default in a way that preserves backwards compatibility:
Notice that a good deal of locs where added to theme.c but in
compensation prompt.c is pretty much simpler now because the
appearances and textures are created while loading the theme.