From: Ben Hutchings Date: Sat, 24 Mar 2007 19:04:35 +0000 (+0000) Subject: [svn-upgrade] Integrating new upstream version, ion3 (20070203) X-Git-Tag: 20070203 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d;p=ion3.git [svn-upgrade] Integrating new upstream version, ion3 (20070203) --- diff --git a/ChangeLog b/ChangeLog index 43a323e..d966641 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,388 @@ +2007-02-03 14:50 UTC Tuomo Valkonen + tagged ion-3ds-20070203 + +2007-02-03 14:50 UTC Tuomo Valkonen + * RELNOTES update + +2007-02-03 11:09 UTC Tuomo Valkonen + * Updates to some styles + +2007-02-03 11:08 UTC Tuomo Valkonen + * Include spacing in border width for the "ridge" and "inlaid" border styles. + +2007-02-03 06:05 UTC Etan Reisner + * Make the docs match the #defines. + +2007-02-01 20:25 UTC Tuomo Valkonen + * Different selected/unselected-activity substyles for tab-frame too. + +2007-02-01 20:14 UTC Tuomo Valkonen + * `WMPlex.attach_new` can now be passed parameters by `ioncore.deflayout` + definitions (unless a particular parameter is masked in certain use cases, + such as `switchto`). + +2007-02-01 18:26 UTC Tuomo Valkonen + * Minor GrStyleSpec init/copy optimisation + +2007-01-31 19:04 UTC Tuomo Valkonen + * Fixes in lookcommon_clean usage + +2007-01-31 17:58 UTC Tuomo Valkonen + * Defined activity attribute for menu entries in the "clean" styles. + (The usual red for unselected, a bit lighter for selected entries.) + +2007-01-31 17:57 UTC Tuomo Valkonen + * Set the "activity" attribute on relevant entries in the "focuslist" menu. + +2007-01-31 17:56 UTC Tuomo Valkonen + * Added support for arbitrary (drawing engine) attributes for menu entries. + +2007-01-30 20:53 UTC Tuomo Valkonen + * Minor improvements to groupws_prepare_manage + +2007-01-30 20:53 UTC Tuomo Valkonen + * Oops, layout loading changes dislocated transient mgmt. code. + +2007-01-30 18:30 UTC Tuomo Valkonen + * Renamed the `subs` element of WMPlex configuration to `managed` + for consistency. The old name is still supported on load. + +2007-01-30 18:24 UTC Tuomo Valkonen + * Added `new_group` winprop. + It should be the name of the layout of a new group/workspace to create, + if the the `target` winprop fails. The latter is tried again after + creating the new group. + +2007-01-30 08:48 UTC Tuomo Valkonen + * More and fixed release notes + +2007-01-30 00:27 UTC Tuomo Valkonen + * Minor optimisation + +2007-01-29 16:49 UTC Tuomo Valkonen + * Improved layout and winprop communication between C/Lua. + ioncore.deflayout and ioncore.getlayout replace mod_query.layouts + and ioncore.set{default_ws_params = ...} + +2007-01-28 10:03 UTC Tuomo Valkonen + * Fixes to new drawing engine attribute scoring: + - Since each item occurs on the attribute list only once, with a score, + the a star ("*") on the source list should be used scored by its score + there, instead of one. (Possibly also other items' scores should be + multiplied by the source list score?) + - The "activity" substyle needs some stars in it to give it a higher + score over other rather specific possibilities without "no_activity" + to block their use. + +2007-01-27 17:33 UTC Tuomo Valkonen + * Oops, wrong address.. + +2007-01-27 17:00 UTC Tuomo Valkonen + * attach_tagged behaviour restoration. + +2007-01-27 16:44 UTC Tuomo Valkonen + * Updates to man page references to binding contexts. + NOTE: Some of the translations apparently are totally + out-dated. Please update. + +2007-01-27 13:09 UTC Tuomo Valkonen + * Added option for case-insensitive completion. + mod_query.set{caseicompl=true} will cause some completions (such as + window and workspace names) to be case-insensitive. + +2007-01-27 13:08 UTC Tuomo Valkonen + * Oops, mod_query.get wasn't marked EXTL_SAFE + +2007-01-27 12:51 UTC Tuomo Valkonen + * mod_query(.lua) clean-up and completion improvements + +2007-01-26 19:51 UTC Tuomo Valkonen + * Statusbar meter name is now passed as attribute to the drawing engine. + It is therefore possible to give different meters different colours, + with de.substyle("metername", { ... }) in the appropriate style + definition ("stdisp", "stdisp-statusbar"). + +2007-01-26 19:01 UTC Tuomo Valkonen + * Completion code fixes + +2007-01-26 11:12 UTC Tuomo Valkonen + * README update + +2007-01-25 22:07 UTC Tuomo Valkonen + * Check for NULL in get_hook + +2007-01-25 04:24 UTC Etan Reisner + * The name given to the workspace query should be used. I'm assuming this was a typo/braino of some sort. + +2007-01-24 19:06 UTC Tuomo Valkonen + * Menu updates + +2007-01-24 19:03 UTC Tuomo Valkonen + * Improvements to query_renameworkspace + +2007-01-24 18:53 UTC Tuomo Valkonen + * Added cfg_layouts.lua with layout definitions + +2007-01-24 18:42 UTC Tuomo Valkonen + * Added layout query for new workspace to mod_query.query_workspace. + The table returned by the function mod_query.layouts can be used to + configure additional layouts. + +2007-01-24 09:16 UTC Tuomo Valkonen + * The "" text apparently wasn't i18nised, residing in config.h. + +2007-01-23 17:00 UTC Tuomo Valkonen + * Added region_dispose for chain-destruction of regions. + It also handles goto to return placeholder target if the to-be destroyed + region could control the focus. This also fixes recent regression wrt. + return from full screen mode. + +2007-01-23 07:09 UTC Tuomo Valkonen + * Marked WFrame.mode "safe" + +2007-01-26 18:08 UTC Tuomo Valkonen + * Added quasiactivity hint to the "clean" styles (+improved activity colour). + Frame padding is drawn in red when frame frame is quasiactive. Stylistically + it's far from ideal, but that seems to be the best place for the hint + without major improvements to the drawing engine. The "emboss" styles still + need to get this added, but they also demand other work, being largely + bitrotted. + +2007-01-26 17:58 UTC Tuomo Valkonen + * Drawing engine API and attribute handling changes. + An attribute string is no longer passed to every drawing function, + but instead the attributes must be allocated from libtu's "stringstore", + and then set on the brush. The attributes are also no longer matched + linearly, but by simple containment, with the linear specification strings + in the style files (and gr_get_brush also still), however still modifying + the score a match gives. These changes should make it easier to add + additional attributes. + +2007-01-26 17:46 UTC Tuomo Valkonen + * Fixed leak in mod_query_history_push_ + +2007-01-22 20:32 UTC Tuomo Valkonen + * Ugly pointer focus hack for messy floats: + If a window that does not have the focus, or if the focus is being + changed elsewhere, is unmapped (or destroyed), contains the pointer, + then try to set the focus again to prevent focus from changing to + a window under this unampped window. (However, if the unampped window + has the focus, and no change elsewhere is known, current focus policy + dictates that the focus should fall to the underlying window.) + +2007-01-21 13:25 UTC Tuomo Valkonen + * RELNOTES conflict resolution + +2007-01-21 13:06 UTC Tuomo Valkonen + * Fixes + +2007-01-21 13:05 UTC Tuomo Valkonen + * Frame quasiactivation tracking + +2007-01-21 12:39 UTC Tuomo Valkonen + * Pseudoactivity state maintenance hack + +2007-01-18 20:14 UTC Tuomo Valkonen + * Navi-code updates + +2007-01-17 20:49 UTC Tuomo Valkonen + * Comment updates + +2007-01-20 20:07 UTC Tuomo Valkonen + * Removed 'detail' from notify_change parameters + (And reordered call in unset_manager.) + +2007-01-18 08:00 UTC Tuomo Valkonen + * Year changed... + (The one nice thing about CVS was that you could automate this + numbering. Perhaps a record check script could make you update + the dates manually as you change the files...) + +2007-01-17 18:18 UTC Tuomo Valkonen + * Further simplifications/dead code removal. + (Made possible by removal of Xinerama #ifdef hacks.) + +2007-01-17 18:11 UTC Tuomo Valkonen + * Removed the bitrotted Xinerama code altogether. + I am unlikely to waste time fixing it. However, the abstract support still + remains (enhanced), and someone who cares about it, will just have to write + a separate module to set up a special layout for the root window (now a + WScreen and WMPlex) with new WScreens for each Xinerama screen, and set + the screen ID of the root window to less than zero for the layout loading + code. + +2007-01-17 18:11 UTC Tuomo Valkonen + * Loading hack + +2007-01-17 17:54 UTC Tuomo Valkonen + * Made WRootWin inherit WScreen. + This removes some ugly hacks, and simplifies things a lot for the usual + case of a single screen, or that of normal X multihead. This completes + the bitrot of Xinerama-specific code, although abstract support for + various (nested) screen configurations remains (and infact there's + now the abstract possibility of both single-screen and multi-screen + workspaces/windows). + +2007-01-17 16:06 UTC Tuomo Valkonen + * Group focus policy changes + +2007-01-16 15:49 UTC Tuomo Valkonen + * Statusbar size hint tuning + +2007-01-14 00:30 UTC Tuomo Valkonen + * Fixes wrt. FRAME_MODE_UNKNOWN (e.g. scratchpad). + +2007-01-14 15:39 UTC Tuomo Valkonen + * Removed fake activication messages for non-windows. + +2007-01-13 23:27 UTC Tuomo Valkonen + * Toplevel bindmap usage tuning + +2007-01-13 20:58 UTC Tuomo Valkonen + * Do not use Watches in return storage. + Instead clean up things in region_deinit. The pointer to the region in the + watch is reset before calling the watch handler, so node in the search tree + is never found, the watch/pointer being the key. + +2007-01-13 20:45 UTC Tuomo Valkonen + * Changes in padding/spacing usage in frames. + (See RELNOTES.) + +2007-01-13 20:27 UTC Tuomo Valkonen + * Do not draw spacing after last textbox + +2007-01-13 18:54 UTC Tuomo Valkonen + * Oops, forgot this... + +2007-01-13 18:32 UTC Tuomo Valkonen + * Use libtu stringstore for the notification mechanism + (Testing against allocated StringIds is more efficient than strcmp.) + +2007-01-13 16:02 UTC Tuomo Valkonen + * Removed region_managed_(in)activated hooks and functions. + - region_notify_change and the corresponding region_notify_hook do the job. + +2007-01-12 14:37 UTC Tuomo Valkonen + * README fixes/improvements + +2007-01-10 18:22 UTC Tuomo Valkonen + * doc + +2007-01-10 18:18 UTC Tuomo Valkonen + * Fixed WMPlex.attach_tagged to switch to the first attached region + +2007-01-10 18:15 UTC Tuomo Valkonen + * Moved mod_tiling.detach as ioncore.detach. + (It has nothing to do with tilings, after all.) + +2007-01-10 18:09 UTC Tuomo Valkonen + * Use previous placeholder on entering FS mode, if there's one + +2007-01-10 18:03 UTC Tuomo Valkonen + * Detach tuning + +2007-01-10 17:30 UTC Tuomo Valkonen + * Use original stacking level and sizepolicy for unframed detachs + +2007-01-10 17:24 UTC Tuomo Valkonen + * Removed unused modal flag + (The information is in the stacking level.) + +2007-01-10 07:48 UTC Tuomo Valkonen + * Updated configuration file doc. comments + +2007-01-10 01:06 UTC Tuomo Valkonen + * Removed traces of WPaneWS. + It won't be found in Ion3: there aren't separate workspace classes + anymore, after all. Instead, so-called "trays" may be added. Or maybe + not. Who knows. + +2007-01-10 00:31 UTC Tuomo Valkonen + * Query history tuning + +2007-01-09 22:23 UTC Tuomo Valkonen + * Added placeholder staleness checks + +2007-01-09 21:44 UTC Tuomo Valkonen + * Placeholder and detach improvements: + - No need for special handling of transients in configs anymore: + framing of non-WWindow regions on detach is automatic now, and + an auto-destroyed frame creates a recreation WFramedPHolder for + its remaining WMPlexPHolders, so that the container frame can + be recreated on attach. + - Consequently, multiple fullscreened windows from a floating frame + are now returned back to the same frame, even if the original + frame was emptied (and thus destroyed) in the meanwhile. + +2007-01-08 20:12 UTC Tuomo Valkonen + * Typo fix (+ minor related policy changes) + +2007-01-06 18:56 UTC Tuomo Valkonen + * Added mode to WFramedParam + +2007-01-04 22:13 UTC Tuomo Valkonen + * Moved set/is_fullscreen from WClientWin to WGroup + - Simplifies the binding (and the config needs to be updated!) + +2007-01-03 17:48 UTC Tuomo Valkonen + * Some renames for consistency + +2007-01-03 17:38 UTC Tuomo Valkonen + * Support obtaining current key in submaps as well + +2007-01-03 17:26 UTC Tuomo Valkonen + * Mod1+K K opens a grabmenu with the "focustlist" menu + - Cyclable with Mod1+K + +2007-01-03 17:25 UTC Tuomo Valkonen + * Added focuslist menu + - First lists ioncore.activity_i results and then ioncore.focushistory_i + +2007-01-03 16:53 UTC Tuomo Valkonen + * Changed *_list exports into *_i iterators + +2007-01-03 16:42 UTC Tuomo Valkonen + * Oops (and been there for a while, stupid GCC) + +2007-01-03 15:51 UTC Tuomo Valkonen + * Remove managers from focus list when child is pushed on it + +2006-12-28 20:29 UTC Tuomo Valkonen + * Detach binding/menu tuning + +2006-12-28 20:26 UTC Tuomo Valkonen + * Added / to characters substituted in query menus + +2006-12-28 20:25 UTC Tuomo Valkonen + * Fixed menu append + +2006-12-28 20:13 UTC Tuomo Valkonen + * Detach is toggleable now (using return placeholder list) + +2006-12-28 19:40 UTC Tuomo Valkonen + * Full screen code rearrangements + +2006-12-27 14:48 UTC Tuomo Valkonen + * Minor tuning + +2006-12-27 14:35 UTC Tuomo Valkonen + * Use return storage for return from full screen mode + +2006-12-26 20:25 UTC Tuomo Valkonen + * Don't snow info window for activity on active screen + +2006-12-26 17:40 UTC Tuomo Valkonen + * More functions for return storage + +2006-12-26 17:37 UTC Tuomo Valkonen + * Use watches in return storage + +2006-12-26 17:12 UTC Tuomo Valkonen + * Added basic "return" placeholder storage + +2006-12-26 16:53 UTC Tuomo Valkonen + * Removed unused variable/string + 2006-12-23 14:59 UTC Tuomo Valkonen tagged ion-3ds-20061223 diff --git a/README b/README index 62684ee..0769ba6 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Ion === -Copyright (c) Tuomo Valkonen 1999-2006. +Copyright (c) Tuomo Valkonen 1999-2007. tuomov at iki.fi @@ -18,16 +18,16 @@ Building and installing * Lua 5.1 (see ). 2. a) Edit `system.mk` to suit your system. Most GNU/Linux users should - need very little modifications to `system.mk`. + need very few changes. b) Alternatively, go to the directory `build/ac`, run `autoreconf` - and then `./configure`. Switch back to the top directory afterwards. - See `build/ac/README.autoconf` for details on parameters, especially - if you are using the Debian Lua packages. If you try this method and - it fails for some reason, please make sure `build/ac/system-ac.mk` - does not exist before falling back to alternative a). Also in such - a case, find someone else to complain to; I (tuomov) will have - nothing to do with autoconf. + and then `./configure`. Switch back to the top lvel directory + afterwards. See `build/ac/README.autoconf` for details on parameters, + especially if you are using the Debian Lua packages. If you try + this method and it fails for some reason, please make sure + `build/ac/system-ac.mk` does not exist before falling back to + alternative a). Also in such a case, find someone else to complain + to: I (tuomov) will have nothing to do with autoconf. 3. If you want to build some extra modules now or do not want to build some of the standard modules, edit `modulelist.mk`. @@ -65,7 +65,7 @@ Some optional installation steps a program to view a file based on its guessed MIME type. Unless you are using Debian, most likely you don't have it, but any other similar program (or just plain old text editor) will do as well - just the bindings - in `cfg_bindings.lua`. Of course, if you don't want to use the feature at + in `cfg_ioncore.lua`. Of course, if you don't want to use the feature at this time or never, you may simply skip this step. If you want to use `run-mailcap`, it can be found from the following address, as a source tarball as well: @@ -93,7 +93,7 @@ Some optional installation steps If the `MANPATH` environment variable is not set on your system and it does not have the `manpath` command (or it does not print anything - sensible), you may also want to set the `ION_MC_MANPATH` environment + sensible), you may also want to set the `ION_MANPATH` environment variable to the list of paths where the system stores manual pages. diff --git a/RELNOTES b/RELNOTES index 589ab54..0834cfa 100644 --- a/RELNOTES +++ b/RELNOTES @@ -1,4 +1,33 @@ +ion-3ds-20070203 +---------------- + + * There's been changes in padding/spacing usage in styles. Frames + now surround stuff inside borders not with `spacing` pixels, but + with `padding_pixels. Spacing is only used to space things within + the borders (all the tabs and the client window from each other). + Consequently, custom styles may need to be updated to reflect this, + by increasing the padding, possibly also altering/removing colour + (to set it to background colour). + + * The use of drawing engine attributes has also changed, and strict + ordering of them in the styles is no longer necessary. Additionally, + much more attributes are supported, including the name of every + statusbar meter. + + * Xinerama support is gone. In addition to being problematic as such, + it had bit-rotted, and I will not waste time fixing it. + + * `ioncore.set` no longer supports the `default_ws_params` parameter + for configuring the default layout. It is replaced by + `ioncore.deflayout("default", { ... })`, which allows configuring + other layouts as well, known by `mod_query.query_workspace` (F9). + Some default layouts are configured in `cfg_layout.lua`. + + * It is now possible to automatically create new workspaces for + windows with the `new_group` winprop. + + ion-3ds-20061223 ---------------- diff --git a/TODO.riot b/TODO.riot index efe689f..009833b 100644 --- a/TODO.riot +++ b/TODO.riot @@ -127,32 +127,6 @@ In-Reply-To: A general solution to transients, queries and menus in tiny frames. -From background-static Thu Mar 23 17:40:08 EET 2006 -Message-Id: -Date: Thu Mar 23 17:40:08 EET 2006 -Status: RO -X-Riot-Version: 1ds-yyyymmdd -From: Riot -X-Riot-Edited: Thu Mar 23 17:40:10 EET 2006 -Content-Type: text/plain; charset=utf-8 -Subject: PaneWS -In-Reply-To: - -PaneWS - -From background-static Thu Mar 23 17:40:13 EET 2006 -Message-Id: -Date: Thu Mar 23 17:40:13 EET 2006 -Status: RO -X-Riot-Version: 1ds-yyyymmdd -From: Riot -X-Riot-Edited: Thu Mar 23 17:40:13 EET 2006 -Content-Type: text/plain; charset=utf-8 -Subject: Lots of fine-tuning -In-Reply-To: - -Lots of fine-tuning - From background-static Thu Mar 23 17:50:02 EET 2006 Message-Id: Date: Thu Mar 23 17:50:02 EET 2006 @@ -167,6 +141,19 @@ In-Reply-To: Pane handles should allow resizing with the rodent. (You know, those things on the sides of floating splits.) +From background-static Wed Jan 10 03:06:06 EET 2007 +Message-Id: +Date: Wed Jan 10 03:06:06 EET 2007 +Status: RO +X-Riot-Version: 1ds-20060502 +From: Riot +X-Riot-Edited: Wed Jan 10 03:06:06 EET 2007 +Content-Type: text/plain; charset=utf-8 +Subject: Trays? +In-Reply-To: + +Trays? + From background-static Thu Mar 23 18:09:58 EET 2006 Message-Id: Date: Thu Mar 23 18:09:58 EET 2006 diff --git a/build/ac/configure.ac b/build/ac/configure.ac index c65e7cb..277cc96 100644 --- a/build/ac/configure.ac +++ b/build/ac/configure.ac @@ -3,7 +3,7 @@ dnl Please report bugs in this autoconf script Tom Payne dnl $Header: /home/twp/cvsroot/twp/ion/ion-devel-autoconf/configure.ac,v 1.16 2004/01/14 11:32:19 twp Exp $ AC_INIT([Ion Window Manager], - [3ds-20061223], + [3ds-20070203], [nobody@nowhere.invalid], [ion3]) AC_PREREQ([2.58]) diff --git a/config.h b/config.h index 23935b7..f9d7131 100644 --- a/config.h +++ b/config.h @@ -1,7 +1,7 @@ /* * config.h * - * Copyright (c) Tuomo Valkonen 1999-2002. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -41,9 +41,6 @@ #define CF_CURSOR_DRAG XC_cross #define CF_CURSOR_WAITKEY XC_icon -#define CF_STR_EMPTY "" -#define CF_STR_EMPTY_LEN 13 - #define CF_STDISP_MIN_SZ 8 #endif /* ION_CONFIG_H */ diff --git a/de/brush.c b/de/brush.c index a0576a6..fbaaa61 100644 --- a/de/brush.c +++ b/de/brush.c @@ -1,7 +1,7 @@ /* * ion/de/brush.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -29,15 +29,24 @@ /*{{{ Brush creation and releasing */ +static GrStyleSpec tabframe_spec=GR_STYLESPEC_INIT; +static GrStyleSpec tabinfo_spec=GR_STYLESPEC_INIT; +static GrStyleSpec tabmenuentry_spec=GR_STYLESPEC_INIT; + + bool debrush_init(DEBrush *brush, Window win, - const char *stylename, DEStyle *style) + const GrStyleSpec *spec, DEStyle *style) { + GrStyleSpec tmp; + brush->d=style; brush->extras_fn=NULL; brush->indicator_w=0; brush->win=win; brush->clip_set=FALSE; + gr_stylespec_init(&brush->current_attr); + style->usecount++; if(!grbrush_init(&(brush->grbrush))){ @@ -45,11 +54,15 @@ bool debrush_init(DEBrush *brush, Window win, return FALSE; } - if(MATCHES("tab-frame", stylename) || MATCHES("tab-info", stylename)){ + ENSURE_INITSPEC(tabframe_spec, "tab-frame"); + ENSURE_INITSPEC(tabinfo_spec, "tab-info"); + ENSURE_INITSPEC(tabmenuentry_spec, "tab-menuentry"); + + if(MATCHES(tabframe_spec, spec) || MATCHES(tabinfo_spec, spec)){ brush->extras_fn=debrush_tab_extras; if(!style->tabbrush_data_ok) destyle_create_tab_gcs(style); - }else if(MATCHES("tab-menuentry", stylename)){ + }else if(MATCHES(tabmenuentry_spec, spec)){ brush->extras_fn=debrush_menuentry_extras; brush->indicator_w=grbrush_get_text_width((GrBrush*)brush, DE_SUB_IND, @@ -60,22 +73,32 @@ bool debrush_init(DEBrush *brush, Window win, } -DEBrush *create_debrush(Window win, const char *stylename, DEStyle *style) +DEBrush *create_debrush(Window win, const GrStyleSpec *spec, DEStyle *style) { - CREATEOBJ_IMPL(DEBrush, debrush, (p, win, stylename, style)); + CREATEOBJ_IMPL(DEBrush, debrush, (p, win, spec, style)); } static DEBrush *do_get_brush(Window win, WRootWin *rootwin, const char *stylename, bool slave) { - DEStyle *style=de_get_style(rootwin, stylename); + DEStyle *style; DEBrush *brush; + GrStyleSpec spec; - if(style==NULL) + if(!gr_stylespec_load(&spec, stylename)) return NULL; - brush=create_debrush(win, stylename, style); + style=de_get_style(rootwin, &spec); + + if(style==NULL){ + gr_stylespec_unalloc(&spec); + return NULL; + } + + brush=create_debrush(win, &spec, style); + + gr_stylespec_unalloc(&spec); /* Set background colour */ if(brush!=NULL && !slave){ @@ -104,6 +127,7 @@ void debrush_deinit(DEBrush *brush) { destyle_unref(brush->d); brush->d=NULL; + gr_stylespec_unalloc(&brush->current_attr); grbrush_deinit(&(brush->grbrush)); } @@ -117,6 +141,40 @@ void debrush_release(DEBrush *brush) /*}}}*/ +/*{{{ Attributes */ + + +void debrush_init_attr(DEBrush *brush, const GrStyleSpec *spec) +{ + gr_stylespec_unalloc(&brush->current_attr); + + if(spec!=NULL) + gr_stylespec_append(&brush->current_attr, spec); +} + + +void debrush_set_attr(DEBrush *brush, GrAttr attr) +{ + gr_stylespec_set(&brush->current_attr, attr); +} + + +void debrush_unset_attr(DEBrush *brush, GrAttr attr) +{ + gr_stylespec_unset(&brush->current_attr, attr); +} + + +GrStyleSpec *debrush_get_current_attr(DEBrush *brush) +{ + return &brush->current_attr; +} + + +/*}}}*/ + + + /*{{{ Border widths and extra information */ @@ -124,17 +182,18 @@ void debrush_get_border_widths(DEBrush *brush, GrBorderWidths *bdw) { DEStyle *style=brush->d; DEBorder *bd=&(style->border); - uint tmp; + uint tmp=0, spc=style->spacing; switch(bd->style){ case DEBORDER_RIDGE: + tmp=spc; case DEBORDER_GROOVE: - tmp=bd->sh+bd->hl+bd->pad; + tmp+=bd->sh+bd->hl+bd->pad; bdw->top=tmp; bdw->bottom=tmp; bdw->left=tmp; bdw->right=tmp; break; case DEBORDER_INLAID: - tmp=bd->sh+bd->pad; bdw->top=tmp; bdw->left=tmp; - tmp=bd->hl+bd->pad; bdw->bottom=tmp; bdw->right=tmp; + tmp=bd->sh+bd->pad+spc; bdw->top=tmp; bdw->left=tmp; + tmp=bd->hl+bd->pad+spc; bdw->bottom=tmp; bdw->right=tmp; break; case DEBORDER_ELEVATED: default: @@ -190,6 +249,9 @@ static DynFunTab debrush_dynfuntab[]={ {(DynFun*)grbrush_get_slave, (DynFun*)debrush_get_slave}, {grbrush_begin, debrush_begin}, {grbrush_end, debrush_end}, + {grbrush_init_attr, debrush_init_attr}, + {grbrush_set_attr, debrush_set_attr}, + {grbrush_unset_attr, debrush_unset_attr}, END_DYNFUNTAB }; diff --git a/de/brush.h b/de/brush.h index a1a6b3f..d9a040a 100644 --- a/de/brush.h +++ b/de/brush.h @@ -1,7 +1,7 @@ /* * ion/de/brush.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -25,10 +25,12 @@ INTRCLASS(DEBrush); typedef void DEBrushExtrasFn(DEBrush *brush, - const WRectangle *g, DEColourGroup *cg, + const WRectangle *g, + DEColourGroup *cg, GrBorderWidths *bdw, GrFontExtents *fnte, - const char *a1, const char *a2, + const GrStyleSpec *a1, + const GrStyleSpec *a2, bool pre); DECLCLASS(DEBrush){ @@ -38,15 +40,17 @@ DECLCLASS(DEBrush){ int indicator_w; Window win; bool clip_set; + + GrStyleSpec current_attr; }; extern DEBrush *de_get_brush(Window win, WRootWin *rootwin, const char *style); extern DEBrush *create_debrush(Window win, - const char *stylename, DEStyle *style); + const GrStyleSpec *spec, DEStyle *style); extern bool debrush_init(DEBrush *brush, Window win, - const char *stylename, DEStyle *style); + const GrStyleSpec *spec, DEStyle *style); extern void debrush_deinit(DEBrush *brush); extern DEBrush *debrush_get_slave(DEBrush *brush, WRootWin *rootwin, @@ -56,18 +60,24 @@ extern void debrush_release(DEBrush *brush); extern DEColourGroup *debrush_get_colour_group2(DEBrush *brush, - const char *attr_p1, - const char *attr_p2); + const GrStyleSpec *a1, + const GrStyleSpec *a2); extern DEColourGroup *debrush_get_colour_group(DEBrush *brush, - const char *attr); + const GrStyleSpec *attr); +extern DEColourGroup *debrush_get_current_colour_group(DEBrush *brush); /* Begin/end */ extern void debrush_begin(DEBrush *brush, const WRectangle *geom, int flags); extern void debrush_end(DEBrush *brush); +extern void debrush_init_attr(DEBrush *brush, const GrStyleSpec *spec); +extern void debrush_set_attr(DEBrush *brush, GrAttr attr); +extern void debrush_unset_attr(DEBrush *brush, GrAttr attr); +extern GrStyleSpec *debrush_get_current_attr(DEBrush *brush); + /* Information */ extern void debrush_get_border_widths(DEBrush *brush, GrBorderWidths *bdw); @@ -77,18 +87,16 @@ extern bool debrush_get_extra(DEBrush *brush, const char *key, char type, /* Borders & boxes */ extern void debrush_draw_border(DEBrush *brush, - const WRectangle *geom, - const char *attrib); + const WRectangle *geom); extern void debrush_draw_borderline(DEBrush *brush, const WRectangle *geom, - const char *attrib, GrBorderLine line); + GrBorderLine line); extern void debrush_draw_textbox(DEBrush *brush, const WRectangle *geom, - const char *text, const char *attr, - bool needfill); + const char *text, bool needfill); extern void debrush_draw_textboxes(DEBrush *brush, const WRectangle *geom, int n, const GrTextElem *elem, - bool needfill, const char *common_attrib); + bool needfill); extern DEBrushExtrasFn debrush_tab_extras; extern DEBrushExtrasFn debrush_menuentry_extras; @@ -100,8 +108,7 @@ extern void debrush_set_window_shape(DEBrush *brush, bool rough, extern void debrush_enable_transparency(DEBrush *brush, GrTransparency mode); -extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom, - const char *attr); +extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom); extern void debrush_clear_area(DEBrush *brush, const WRectangle *geom); diff --git a/de/colour.c b/de/colour.c index c3797c3..5693d81 100644 --- a/de/colour.c +++ b/de/colour.c @@ -1,7 +1,7 @@ /* * ion/de/colour.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -56,10 +56,7 @@ void de_free_colour_group(WRootWin *rootwin, DEColourGroup *cg) XFreeColors(ioncore_g.dpy, rootwin->default_cmap, pixels, 5, 0); - if(cg->spec!=NULL){ - free(cg->spec); - cg->spec=NULL; - } + gr_stylespec_unalloc(&cg->spec); } diff --git a/de/colour.h b/de/colour.h index 8886b97..06d8654 100644 --- a/de/colour.h +++ b/de/colour.h @@ -1,7 +1,7 @@ /* * ion/de/colour.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -24,7 +24,7 @@ typedef unsigned long DEColour; DECLSTRUCT(DEColourGroup){ - char *spec; + GrStyleSpec spec; DEColour bg, hl, sh, fg, pad; }; diff --git a/de/draw.c b/de/draw.c index aae2dae..552e48f 100644 --- a/de/draw.c +++ b/de/draw.c @@ -1,7 +1,7 @@ /* * ion/de/draw.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -26,16 +26,16 @@ static DEColourGroup *destyle_get_colour_group2(DEStyle *style, - const char *attr_p1, - const char *attr_p2) + const GrStyleSpec *a1, + const GrStyleSpec *a2) { int i, score, maxscore=0; DEColourGroup *maxg=&(style->cgrp); while(style!=NULL){ for(i=0; in_extra_cgrps; i++){ - score=gr_stylespec_score2(style->extra_cgrps[i].spec, - attr_p1, attr_p2); + score=gr_stylespec_score2(&style->extra_cgrps[i].spec, a1, a2); + if(score>maxscore){ maxg=&(style->extra_cgrps[i]); maxscore=score; @@ -49,19 +49,25 @@ static DEColourGroup *destyle_get_colour_group2(DEStyle *style, DEColourGroup *debrush_get_colour_group2(DEBrush *brush, - const char *attr_p1, - const char *attr_p2) + const GrStyleSpec *a1, + const GrStyleSpec *a2) { - return destyle_get_colour_group2(brush->d, attr_p1, attr_p2); + return destyle_get_colour_group2(brush->d, a1, a2); } -DEColourGroup *debrush_get_colour_group(DEBrush *brush, const char *attr) +DEColourGroup *debrush_get_colour_group(DEBrush *brush, const GrStyleSpec *attr) { return destyle_get_colour_group2(brush->d, attr, NULL); } +DEColourGroup *debrush_get_current_colour_group(DEBrush *brush) +{ + return debrush_get_colour_group(brush, debrush_get_current_attr(brush)); +} + + /*}}}*/ @@ -160,11 +166,12 @@ void debrush_do_draw_border(DEBrush *brush, WRectangle geom, } + + void debrush_draw_border(DEBrush *brush, - const WRectangle *geom, - const char *attrib) + const WRectangle *geom) { - DEColourGroup *cg=debrush_get_colour_group(brush, attrib); + DEColourGroup *cg=debrush_get_current_colour_group(brush); if(cg!=NULL) debrush_do_draw_border(brush, *geom, cg); } @@ -223,9 +230,9 @@ void debrush_do_draw_borderline(DEBrush *brush, WRectangle geom, void debrush_draw_borderline(DEBrush *brush, const WRectangle *geom, - const char *attrib, GrBorderLine line) + GrBorderLine line) { - DEColourGroup *cg=debrush_get_colour_group(brush, attrib); + DEColourGroup *cg=debrush_get_current_colour_group(brush); if(cg!=NULL) debrush_do_draw_borderline(brush, *geom, cg, line); } @@ -251,10 +258,16 @@ static void copy_masked(DEBrush *brush, Drawable src, Drawable dst, } +static GrStyleSpec dragged_spec=GR_STYLESPEC_INIT; +static GrStyleSpec tagged_spec=GR_STYLESPEC_INIT; +static GrStyleSpec submenu_spec=GR_STYLESPEC_INIT; + + void debrush_tab_extras(DEBrush *brush, const WRectangle *g, DEColourGroup *cg, GrBorderWidths *bdw, GrFontExtents *fnte, - const char *a1, const char *a2, + const GrStyleSpec *a1, + const GrStyleSpec *a2, bool pre) { DEStyle *d=brush->d; @@ -263,9 +276,12 @@ void debrush_tab_extras(DEBrush *brush, const WRectangle *g, * with shared GC:s. */ static bool swapped=FALSE; + + ENSURE_INITSPEC(dragged_spec, "dragged"); + ENSURE_INITSPEC(tagged_spec, "tagged"); if(pre){ - if(!MATCHES2("*-*-*-dragged", a1, a2)) + if(!MATCHES2(dragged_spec, a1, a2)) return; tmp=d->normal_gc; @@ -276,7 +292,7 @@ void debrush_tab_extras(DEBrush *brush, const WRectangle *g, return; } - if(MATCHES2("*-*-tagged", a1, a2)){ + if(MATCHES2(tagged_spec, a1, a2)){ XSetForeground(ioncore_g.dpy, d->copy_gc, cg->fg); copy_masked(brush, d->tag_pixmap, brush->win, 0, 0, @@ -298,10 +314,13 @@ void debrush_tab_extras(DEBrush *brush, const WRectangle *g, } -void debrush_menuentry_extras(DEBrush *brush, const WRectangle *g, - DEColourGroup *cg, GrBorderWidths *bdw, +void debrush_menuentry_extras(DEBrush *brush, + const WRectangle *g, + DEColourGroup *cg, + GrBorderWidths *bdw, GrFontExtents *fnte, - const char *a1, const char *a2, + const GrStyleSpec *a1, + const GrStyleSpec *a2, bool pre) { int tx, ty; @@ -309,7 +328,9 @@ void debrush_menuentry_extras(DEBrush *brush, const WRectangle *g, if(pre) return; - if(!MATCHES2("*-*-submenu", a1, a2)) + ENSURE_INITSPEC(submenu_spec, "submenu"); + + if(!MATCHES2(submenu_spec, a1, a2)) return; ty=(g->y+bdw->top+fnte->baseline @@ -336,10 +357,13 @@ void debrush_do_draw_box(DEBrush *brush, const WRectangle *geom, } -static void debrush_do_draw_textbox(DEBrush *brush, const WRectangle *geom, - const char *text, DEColourGroup *cg, +static void debrush_do_draw_textbox(DEBrush *brush, + const WRectangle *geom, + const char *text, + DEColourGroup *cg, bool needfill, - const char *a1, const char *a2) + const GrStyleSpec *a1, + const GrStyleSpec *a2) { uint len; GrBorderWidths bdw; @@ -386,10 +410,11 @@ static void debrush_do_draw_textbox(DEBrush *brush, const WRectangle *geom, void debrush_draw_textbox(DEBrush *brush, const WRectangle *geom, - const char *text, const char *attr, - bool needfill) + const char *text, bool needfill) { + GrStyleSpec *attr=debrush_get_current_attr(brush); DEColourGroup *cg=debrush_get_colour_group(brush, attr); + if(cg!=NULL){ debrush_do_draw_textbox(brush, geom, text, cg, needfill, attr, NULL); @@ -399,24 +424,30 @@ void debrush_draw_textbox(DEBrush *brush, const WRectangle *geom, void debrush_draw_textboxes(DEBrush *brush, const WRectangle *geom, int n, const GrTextElem *elem, - bool needfill, const char *common_attrib) + bool needfill) { + GrStyleSpec *common_attrib; WRectangle g=*geom; DEColourGroup *cg; GrBorderWidths bdw; int i; + common_attrib=debrush_get_current_attr(brush); + grbrush_get_border_widths(&(brush->grbrush), &bdw); - for(i=0; i0 && needfill){ XClearArea(ioncore_g.dpy, brush->win, g.x, g.y, @@ -490,9 +521,9 @@ void debrush_enable_transparency(DEBrush *brush, GrTransparency mode) } -void debrush_fill_area(DEBrush *brush, const WRectangle *geom, const char *attr) +void debrush_fill_area(DEBrush *brush, const WRectangle *geom) { - DEColourGroup *cg=debrush_get_colour_group(brush, attr); + DEColourGroup *cg=debrush_get_current_colour_group(brush); GC gc=brush->d->normal_gc; if(cg==NULL) @@ -555,9 +586,13 @@ static void debrush_clear_clipping_rectangle(DEBrush *brush) void debrush_begin(DEBrush *brush, const WRectangle *geom, int flags) { + if(flags&GRBRUSH_AMEND) flags|=GRBRUSH_NO_CLEAR_OK; + if(!(flags&GRBRUSH_KEEP_ATTR)) + debrush_init_attr(brush, NULL); + if(!(flags&GRBRUSH_NO_CLEAR_OK)) debrush_clear_area(brush, geom); diff --git a/de/font.c b/de/font.c index 9d80c1e..957cc61 100644 --- a/de/font.c +++ b/de/font.c @@ -1,7 +1,7 @@ /* * ion/de/font.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -267,10 +267,9 @@ void debrush_do_draw_string(DEBrush *brush, int x, int y, void debrush_draw_string(DEBrush *brush, int x, int y, - const char *str, int len, bool needfill, - const char *attrib) + const char *str, int len, bool needfill) { - DEColourGroup *cg=debrush_get_colour_group(brush, attrib); + DEColourGroup *cg=debrush_get_current_colour_group(brush); if(cg!=NULL) debrush_do_draw_string(brush, x, y, str, len, needfill, cg); } diff --git a/de/font.h b/de/font.h index d2f5e3b..7e40121 100644 --- a/de/font.h +++ b/de/font.h @@ -1,7 +1,7 @@ /* * ion/de/font.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -38,8 +38,7 @@ extern DEFont *de_load_font(const char *fontname); extern void de_free_font(DEFont *font); extern void debrush_draw_string(DEBrush *brush, int x, int y, - const char *str, int len, bool needfill, - const char *attrib); + const char *str, int len, bool needfill); extern void debrush_do_draw_string(DEBrush *brush, int x, int y, const char *str, int len, bool needfill, DEColourGroup *colours); diff --git a/de/fontset.h b/de/fontset.h index 256d1d9..994c769 100644 --- a/de/fontset.h +++ b/de/fontset.h @@ -1,7 +1,7 @@ /* * ion/de/fontset.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/de/init.c b/de/init.c index 3e779b3..ad40323 100644 --- a/de/init.c +++ b/de/init.c @@ -1,7 +1,7 @@ /* * ion/de/init.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -28,6 +28,32 @@ #include "exports.h" +/*{{{ Style specifications */ + + +static bool get_spec(ExtlTab tab, const char *name, GrStyleSpec *spec, + char **pat_ret) +{ + char *str; + bool res; + + if(!extl_table_gets_s(tab, name, &str)) + return FALSE; + + res=gr_stylespec_load(spec, str); + + if(pat_ret==NULL) + free(str); + else + *pat_ret=str; + + return res; +} + + +/*}}}*/ + + /*{{{ Borders */ @@ -141,15 +167,18 @@ void de_get_extra_cgrps(WRootWin *rootwin, DEStyle *style, ExtlTab tab) return; for(i=0; iextra_cgrps+i-nfailed);*/ - style->extra_cgrps[i-nfailed].spec=name; + style->extra_cgrps[i-nfailed].spec=spec; + de_get_colour_group(rootwin, style->extra_cgrps+i-nfailed, sub, style); @@ -237,6 +266,8 @@ void de_get_nonfont(WRootWin *rootwin, DEStyle *style, ExtlTab tab) } + + /*EXTL_DOC * Define a style for the root window \var{rootwin}. */ @@ -246,8 +277,9 @@ bool de_defstyle_rootwin(WRootWin *rootwin, const char *name, ExtlTab tab) DEStyle *style; char *fnt; uint n; + char *based_on_name; DEStyle *based_on=NULL; - char *based_on_name=NULL; + GrStyleSpec based_on_spec; if(name==NULL) return FALSE; @@ -257,18 +289,22 @@ bool de_defstyle_rootwin(WRootWin *rootwin, const char *name, ExtlTab tab) if(style==NULL) return FALSE; - if(extl_table_gets_s(tab, "based_on", &based_on_name)){ - based_on=de_get_style(rootwin, based_on_name); + if(get_spec(tab, "based_on", &based_on_spec, &based_on_name)){ + based_on=de_get_style(rootwin, &based_on_spec); + + gr_stylespec_unalloc(&based_on_spec); + if(based_on==style){ warn(TR("'based_on' for %s points back to the style itself."), name); }else if(based_on==NULL){ - warn(TR("Unknown base style \"%s\"."), based_on); + warn(TR("Unknown base style. \"%s\""), based_on_name); }else{ style->based_on=based_on; based_on->usecount++; /* Copy simple parameters */ } + free(based_on_name); } diff --git a/de/init.h b/de/init.h index f3b6f10..c751bb0 100644 --- a/de/init.h +++ b/de/init.h @@ -1,7 +1,7 @@ /* * ion/de/init.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/de/private.h b/de/private.h index 39141e6..dde51c4 100644 --- a/de/private.h +++ b/de/private.h @@ -1,7 +1,7 @@ /* * ion/de/private.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -15,7 +15,10 @@ #define DE_SUB_IND " ->" #define DE_SUB_IND_LEN 3 -#define MATCHES(S, A) (gr_stylespec_score(S, A)>0) -#define MATCHES2(S, A1, A2) (gr_stylespec_score2(S, A1, A2)>0) +#define MATCHES(S, A) (gr_stylespec_score(&(S), A)>0) +#define MATCHES2(S, A1, A2) (gr_stylespec_score2(&(S), A1, A2)>0) +#define ENSURE_INITSPEC(S, NM) \ + if((S).attrs==NULL) gr_stylespec_load(&(S), NM); + #endif /* ION_DE_PRIVATE_H */ diff --git a/de/style.c b/de/style.c index cf44e47..8db97cd 100644 --- a/de/style.c +++ b/de/style.c @@ -1,7 +1,7 @@ /* * ion/de/style.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -119,7 +119,7 @@ void destyle_create_tab_gcs(DEStyle *style) static DEStyle *styles=NULL; -DEStyle *de_get_style(WRootWin *rootwin, const char *stylename) +DEStyle *de_get_style(WRootWin *rootwin, const GrStyleSpec *spec) { DEStyle *style, *maxstyle=NULL; int score, maxscore=0; @@ -127,7 +127,7 @@ DEStyle *de_get_style(WRootWin *rootwin, const char *stylename) for(style=styles; style!=NULL; style=style->next){ if(style->rootwin!=rootwin) continue; - score=gr_stylespec_score(style->style, stylename); + score=gr_stylespec_score(&style->spec, spec); if(score>maxscore){ maxstyle=style; maxscore=score; @@ -160,8 +160,7 @@ void destyle_deinit(DEStyle *style) UNLINK_ITEM(styles, style, next, prev); - if(style->style!=NULL) - free(style->style); + gr_stylespec_unalloc(&style->spec); if(style->font!=NULL){ de_free_font(style->font); @@ -206,8 +205,7 @@ static void dump_style(DEStyle *style) bool destyle_init(DEStyle *style, WRootWin *rootwin, const char *name) { - style->style=scopy(name); - if(style->style==NULL) + if(!gr_stylespec_load(&style->spec, name)) return FALSE; style->based_on=NULL; @@ -228,12 +226,12 @@ bool destyle_init(DEStyle *style, WRootWin *rootwin, const char *name) style->textalign=DEALIGN_CENTER; style->cgrp_alloced=FALSE; - style->cgrp.spec=NULL; style->cgrp.bg=DE_BLACK(rootwin); style->cgrp.pad=DE_BLACK(rootwin); style->cgrp.fg=DE_WHITE(rootwin); style->cgrp.hl=DE_WHITE(rootwin); style->cgrp.sh=DE_WHITE(rootwin); + gr_stylespec_init(&style->cgrp.spec); style->font=NULL; @@ -268,17 +266,18 @@ static DEStyle *do_create_style(WRootWin *rootwin, const char *name) DEStyle *de_create_style(WRootWin *rootwin, const char *name) { DEStyle *oldstyle, *style; - + uint score; + style=do_create_style(rootwin, name); if(style==NULL) return NULL; for(oldstyle=styles; oldstyle!=NULL; oldstyle=oldstyle->next){ - if(oldstyle->rootwin==rootwin && oldstyle->style!=NULL && - strcmp(oldstyle->style, name)==0){ + if(oldstyle->rootwin!=rootwin) + continue; + if(gr_stylespec_equals(&oldstyle->spec, &style->spec)) break; - } } if(oldstyle!=NULL && !oldstyle->is_fallback) @@ -312,8 +311,8 @@ void de_deinit_styles() for(style=styles; style!=NULL; style=next){ next=style->next; if(style->usecount>1){ - warn(TR("Style %s still in use [%d] but the module " - "is being unloaded!"), style->style, style->usecount); + warn(TR("Style is still in use [%d] but the module " + "is being unloaded!"), style->usecount); } dump_style(style); } diff --git a/de/style.h b/de/style.h index f25c44c..90dfc07 100644 --- a/de/style.h +++ b/de/style.h @@ -1,7 +1,7 @@ /* * ion/de/style.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -46,7 +46,7 @@ DECLSTRUCT(DEBorder){ DECLSTRUCT(DEStyle){ - char *style; + GrStyleSpec spec; int usecount; bool is_fallback; @@ -91,7 +91,7 @@ extern void destyle_create_tab_gcs(DEStyle *style); extern void de_reset(); extern void de_deinit_styles(); -extern DEStyle *de_get_style(WRootWin *rootwin, const char *name); +extern DEStyle *de_get_style(WRootWin *rootwin, const GrStyleSpec *spec); #endif /* ION_DE_STYLE_H */ diff --git a/doc/ChangeLog b/doc/ChangeLog index 5e3a3d1..0756556 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,36 @@ +2007-02-03 15:04 UTC Tuomo Valkonen + tagged ion-doc-3ds-20070203 + +2007-02-03 15:00 UTC Tuomo Valkonen + * Style configuration documentation updates + +2007-02-02 21:38 UTC Tuomo Valkonen + * Statusbar stuff was missing + +2007-01-30 18:29 UTC Tuomo Valkonen + * Documented new_group + +2007-01-26 18:16 UTC Tuomo Valkonen + * Hook reference updates + +2007-01-18 07:54 UTC Tuomo Valkonen + * Updates + +2007-01-17 19:28 UTC Tuomo Valkonen + * Updated class hierarchies + +2007-01-13 18:43 UTC Tuomo Valkonen + * Update + +2007-01-13 16:12 UTC Tuomo Valkonen + * Updated hook documentation + +2007-01-03 19:12 UTC Tuomo Valkonen + * Document focuslist and focuslist_ menus + +2007-01-03 15:31 UTC Tuomo Valkonen + * Added missing clientwin_property_change_hook documentation + 2006-12-23 15:00 UTC Tuomo Valkonen tagged ion-doc-3ds-20061223 diff --git a/doc/Makefile b/doc/Makefile index bd580ca..aa203d8 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -17,7 +17,7 @@ DOCS=ionconf ionnotes FNTEXES=ioncore-fns.tex mod_tiling-fns.tex \ mod_query-fns.tex de-fns.tex mod_menu-fns.tex \ - mod_dock-fns.tex mod_sp-fns.tex + mod_dock-fns.tex mod_sp-fns.tex mod_statusbar-fns.tex # Generic rules ###################################### @@ -124,6 +124,9 @@ mod_dock-fns.tex: $(TOPDIR)/mod_dock/*.c mod_sp-fns.tex: $(TOPDIR)/mod_sp/*.c $(MKEXPORTS) -module mod_sp -mkdoc -o $@ $+ +mod_statusbar-fns.tex: $(TOPDIR)/mod_statusbar/*.c + $(MKEXPORTS) -module mod_statusbar -mkdoc -o $@ $+ + de-fns.tex: $(TOPDIR)/de/*.c $(MKEXPORTS) -module de -mkdoc -o $@ $+ diff --git a/doc/conf-menus.tex b/doc/conf-menus.tex index 3f9ee17..f47a5a8 100644 --- a/doc/conf-menus.tex +++ b/doc/conf-menus.tex @@ -48,6 +48,11 @@ just like the menus defined as above. List of all client windows. Activating an entry jumps to that window. \\ \code{workspacelist} & List of all workspaces. Activating an entry jumps to that workspaces. \\ + \code{focuslist} & + List of client windows with recent activity in them, followed by + previously focused client windows. \\ + \code{focuslist_} & + List of previously focused client windows. \\ \code{stylemenu} & List of available \file{look\_*.lua} style files. Activating an entry loads that style and ask to save the selection. \\ diff --git a/doc/conf-winprops.tex b/doc/conf-winprops.tex index 10c1c10..9a416d3 100644 --- a/doc/conf-winprops.tex +++ b/doc/conf-winprops.tex @@ -100,12 +100,32 @@ usual method of identifying windows, and how to obtain this information. \end{winprop} +\begin{winprop}{new_group}{string} + \index{new-group@\var{new_group}} + If the region specified by \code{target} winprop does not exist + (or that winprop is not set), create a new workspace using the + previously stored layout (see \fnref{ioncore.deflayout}) named by + this property. After creating the workspace, \code{target} is + attempted to be found again. (If that still fails, the newly + created workspace is still asked to manage the client window.) +\end{winprop} + + \begin{winprop}{oneshot}{boolean} \index{oneshot@\var{oneshot}} Discard this winprop after first use. \end{winprop} +\begin{winprop}{statusbar}{string} + \index{statusbar@\var{statusbar}} + Put the window on the statusbar, in the named tray component, + (The default tray component is called simply ``\code{systray}'', + and others you give names to in your custom template, always + prefixed by ``\code{systray_}''. +\end{winprop} + + \begin{winprop}{switchto}{boolean} \index{switchto@\var{switchto}} Should a newly mapped client window be switched to within @@ -116,7 +136,7 @@ usual method of identifying windows, and how to obtain this information. \begin{winprop}{target}{string} \index{target@\var{target}} The name of an object (workspace, frame) that should manage - windows of this type. + windows of this type. See also \code{new_group}. \end{winprop} diff --git a/doc/de.tex b/doc/de.tex index 6c8c2b4..ceba206 100644 --- a/doc/de.tex +++ b/doc/de.tex @@ -45,7 +45,6 @@ foo-bar-baz foo-*-baz foo-bar * -foo-baz -- Doesn't match, not selected! \end{verbatim} Some of the drawing primitives allow extra attributes to be @@ -72,9 +71,13 @@ tag and drag states.) \begin{tabularx}{\linewidth}{lX} \tabhead{Style name & Description} \code{frame} & Style for frames. - Substyles: \code{active}, \code{inactive}. \\ + Substyle attributes: \code{active}/\code{inactive} + (mutually exclusive) and + \code{quasiactive}\nobreak/\code{not_quasiactive}. + A frame is ``quasiactive'' when an active region + has a backlink to it, such as a detached window. \\ \code{frame-tiled} & A more specific style for tiled frames. - Substyles as for \code{frame}. \\ + Substyle attributes as for \code{frame}. \\ \code{frame-tiled-alt} & An alternative style for tiled frames. Often used to disable the tab-bar. \\ \code{frame-floating} & A more specific style for floating @@ -88,22 +91,25 @@ tag and drag states.) \begin{tabularx}{\linewidth}{lX} \tabhead{Style name & Description} \code{tab} & Style for frames' tabs and menu entries. - Substyles: combinations of the form \code{a-s} where - \code{a} is one of \code{active}\nobreak/\code{inactive} and - \code{s} is one of \code{selected}\nobreak/\code{unselected} \\ + Substyle attributes: + \code{active}\nobreak/\code{inactive} and + \code{selected}\nobreak/\code{unselected} \\ \code{tab-frame} & A more specific style for frames' tabs. - Substyles: combinations of the form \code{a-s-t-d-u} where - \code{a} and \code{s} are as above and - \code{t} is one of \code{tagged}\nobreak/\code{not_tagged}, - \code{d} is one of \code{dragged}\nobreak/\code{not_dragged} and - \code{u} is one of \code{activity}\nobreak/\code{no_activity}. \\ + Additional substyle attributes include: + \code{tagged}\nobreak/\code{not_tagged}, + \code{dragged}\nobreak/\code{not_dragged}, + \code{activity}\nobreak/\code{no_activity} and + \code{quasiactive}\nobreak/\code{not_quasiactive}. \\ \code{tab-frame-tiled}, & \\ \code{tab-frame-tiled-alt}, & \\ \code{tab-frame-floating}, & \\ \code{tab-frame-transient} & More specific styles for frames in the different modes. \\ -\code{tab-menuentry} & A more specific style for entries in \type{WMenu}s. \\ -\code{tab-menuentry-bigmenu} & An alternate style for entries in \type{WMenu}s. \\ +\code{tab-menuentry} & A more specific style for entries in \type{WMenu}s. + Additional substyle attributes include \code{submenu} and + occasionally also \code{activity} is used.\\ +\code{tab-menuentry-bigmenu} & + An alternate style for entries in \type{WMenu}s. \\ \end{tabularx} \subsubsection{The rest} @@ -112,7 +118,7 @@ tag and drag states.) \tabhead{Style name & Description} \code{input} & A style for \type{WInput}s. \\ \code{input-edln} & A more specific style for \type{WEdln}s. - Substyles: \code{selection} for selected text and + Substyle attributes: \code{selection} for selected text and \code{cursor} for the cursor indicating current editing point. \\ \code{input-message} & A more specific style for \type{WMessage}s. \\ \code{input-menu} & A more specific style for \type{WMenu}s. \\ @@ -135,7 +141,7 @@ and should usually be symlinked to or a copy of of some \subsection{The structure of the configuration files} -The first thing to do in a stylefile is to choose the drawing +The first thing to do in a style file is to choose the drawing engine, possibly loading the module as well. This is done with the following chunk of code. diff --git a/doc/exact-version b/doc/exact-version index 0413a6b..40b3215 100644 --- a/doc/exact-version +++ b/doc/exact-version @@ -1,5 +1,5 @@ Context: -[TAG ion-doc-3ds-20061223 -Tuomo Valkonen **20061223150012] +[TAG ion-doc-3ds-20070203 +Tuomo Valkonen **20070203150437] diff --git a/doc/fullhierarchy.tex b/doc/fullhierarchy.tex index d5d5a39..8e1cfa9 100644 --- a/doc/fullhierarchy.tex +++ b/doc/fullhierarchy.tex @@ -15,10 +15,10 @@ |-->WRegion | |-->WClientWin | |-->WWindow - | | |-->WRootWin | | |-->WMPlex - | | | |-->WScreen | | | |-->WFrame + | | | |-->WScreen + | | | |->WRootWin | | |-->WInfoWin | | | |-->WStatusBar (mod_statusbar) | | |-->WMenu (mod_menu) diff --git a/doc/hookref.tex b/doc/hookref.tex index f4f2a9e..4c26562 100644 --- a/doc/hookref.tex +++ b/doc/hookref.tex @@ -42,6 +42,17 @@ reg:attach(cwin) \end{function} +\begin{function} + \index{clientwin-property-change-hook@\code{clientwin_property_change_hook}} + \hookname{clientwin_property_change_hook} + \hookparams{(WClientWin, integer)} + \begin{funcdesc} + Called when the property identified by the parameter atom id + (integer) has changed on a client window. + \end{funcdesc} +\end{function} + + \begin{function} \index{clientwin-unmapped-hook@\code{clientwin_unmapped_hook}} \hookname{clientwin_unmapped_hook} @@ -142,71 +153,6 @@ reg:attach(cwin) \end{function} -%\begin{function} -% \index{panews-init-layout-alt@\code{panews_init_layout_alt}} -% \hookname{panews_init_layout_alt} -% \hookparams{table} -% \begin{funcdesc} -% Called to initialise panews layout. The table parameter has -% initially a single field \var{ws} pointing to the workspace, -% but the succesfull handler should set the field \var{layout} -% to a proper layout (as those saved in the layout savefiles). -% \end{funcdesc} -%\end{function} - - -\begin{function} - \index{panews-make-placement-alt@\code{panews_make_placement_alt}} - \hookname{panews_make_placement_alt} - \hookparams{table} - \begin{funcdesc} - Called to make a placement on panews. The parameter table has - the following fields: - - \begin{tabularx}{\linewidth}{llX} - \tabhead{Field & Type & Description} - \var{ws} & \type{WPaneWS} & The workspace \\ - \var{frame} & \type{WFrame} & A frame initially allocated for the - region to be placed \\ - \var{reg} & \type{WRegion} & The region to be placed \\ - \var{specifier} & \type{WRegion} & For drag\&drop on handling empty areas\\ - \end{tabularx} - - The handler should set some of these fields on success: - - \begin{tabularx}{\linewidth}{llX} - \tabhead{Field & Type & Description} - \var{res_node} & \type{WSplit} & Target split \\ - \var{res_config} & \type{WFrame} & New configuration for it, unless - \type{WSplitRegion} \\ - \var{res_w} & integer & New width for target split (optional) \\ - \var{res_h} & integer & New height for target split (optional) \\ - \end{tabularx} - \end{funcdesc} -\end{function} - - -\begin{function} - \index{region-activated-hook@\code{region_activated_hook}} - \hookname{region_activated_hook} - \hookparams{WRegion} - \begin{funcdesc} - Signalled when a region or one of its children has received the focus. - \end{funcdesc} -\end{function} - - -\begin{function} - \index{region-activity-hook@\code{region_activity_hook}} - \hookname{region_activity_hook} - \hookparams{WRegion} - \begin{funcdesc} - This hook is triggered when the activity flag of the parameter - region has been changed. - \end{funcdesc} -\end{function} - - \begin{function} \index{region-do-warp-alt@\code{region_do_warp_alt}} \hookname{region_do_warp_alt} @@ -218,17 +164,6 @@ reg:attach(cwin) \end{function} -\begin{function} - \index{region-inactivated-hook@\code{region_inactivated_hook}} - \hookname{region_inactivated_hook} - \hookparams{WRegion} - \begin{funcdesc} - Signalled when the focus has moved from the parameter region or - one of its children to a non-child region of the parameter region. - \end{funcdesc} -\end{function} - - \begin{function} \index{screen-managed-changed-hook@\code{screen_managed_changed_hook}} \hookname{screen_managed_changed_hook} @@ -239,3 +174,37 @@ reg:attach(cwin) \fnref{frame_managed_changed_hook}. \end{funcdesc} \end{function} + + +\begin{function} + \index{region-notify-hook@\code{region_notify_hook}} + \hookname{region_notify_hook} + \hookparams{(WRegion, string)} + \begin{funcdesc} + Signalled when something (minor) has changed in relation to + the first parameter region. The string argument gives the + change: + + \begin{tabularx}{\linewidth}{lX} + \tabhead{String & Description} + \code{deinit} & The region is about to be deinitialised. \\ + \code{activated} & The region has received focus. \\ + \code{inactivated} & The region has lost focus. \\ + \code{activity} & There's been activity in the region itself. \\ + \code{sub_activity} & There's been activity in some sub-region. \\ + \code{name} & The name of the region has changed. \\ + \code{unset_manager} & The region no longer has a manager. \\ + \code{set_manager} & The region now has a manager. \\ + \code{tag} & Tagging state has changed. \\ + \code{pseudoactivated} & The region has become pseudoactive + (see below). \\ + \code{pseudoinactivated} & The region is no longer pseudoactive. \\ + \end{tabularx} + + A region is pseudoactive, when a) it is itself not active (does + not not have the focus, and may not even have a window that could + have it), but b) some region managed by it is active. + \end{funcdesc} +\end{function} + + diff --git a/doc/ionconf.dvi.gz b/doc/ionconf.dvi.gz index 905ef66..7d7c934 100644 Binary files a/doc/ionconf.dvi.gz and b/doc/ionconf.dvi.gz differ diff --git a/doc/ionconf.out b/doc/ionconf.out index 060a02d..2f1b8ec 100644 --- a/doc/ionconf.out +++ b/doc/ionconf.out @@ -33,15 +33,15 @@ \BOOKMARK [2][-]{subsection.4.2.2}{ Defining the styles}{section.4.2} \BOOKMARK [2][-]{subsection.4.2.3}{ An example}{section.4.2} \BOOKMARK [1][-]{section.4.3}{ Miscellaneous settings}{chapter.4} -\BOOKMARK [2][-]{lstlisting.4.-385}{ Extra fields for style !frame!}{section.4.3} -\BOOKMARK [2][-]{lstlisting.4.-407}{ Extra fields for style !dock!}{section.4.3} +\BOOKMARK [2][-]{lstlisting.4.-390}{ Extra fields for style !frame!}{section.4.3} +\BOOKMARK [2][-]{lstlisting.4.-412}{ Extra fields for style !dock!}{section.4.3} \BOOKMARK [0][-]{chapter.5}{ Scripting}{} \BOOKMARK [1][-]{section.5.1}{ Hooks}{chapter.5} \BOOKMARK [1][-]{section.5.2}{ Referring to regions}{chapter.5} \BOOKMARK [2][-]{subsection.5.2.1}{ Direct object references}{section.5.2} \BOOKMARK [2][-]{subsection.5.2.2}{ Name-based lookups}{section.5.2} \BOOKMARK [1][-]{section.5.3}{ Alternative winprop selection criteria}{chapter.5} -\BOOKMARK [1][-]{lstlisting.5.-448}{ Writing !ion-statusd! monitors}{chapter.5} +\BOOKMARK [1][-]{lstlisting.5.-453}{ Writing !ion-statusd! monitors}{chapter.5} \BOOKMARK [0][-]{chapter.6}{ Function reference}{} \BOOKMARK [1][-]{section.6.1}{ Functions defined in ioncore}{chapter.6} \BOOKMARK [2][-]{subsection.6.1.1}{ WClientWin functions}{section.6.1} diff --git a/doc/ionconf.ps.gz b/doc/ionconf.ps.gz index 055828e..6103c98 100644 Binary files a/doc/ionconf.ps.gz and b/doc/ionconf.ps.gz differ diff --git a/doc/ionconf.tex b/doc/ionconf.tex index 9dd71c8..3f22904 100644 --- a/doc/ionconf.tex +++ b/doc/ionconf.tex @@ -10,7 +10,7 @@ \title{Configuring and extending Ion3 with Lua} \author{Tuomo Valkonen \\ tuomov at iki.fi} -\date{2006-12-23} +\date{2007-02-03} \makeindex diff --git a/doc/ionconf/images.log b/doc/ionconf/images.log index 952589a..3fec32a 100644 --- a/doc/ionconf/images.log +++ b/doc/ionconf/images.log @@ -1,4 +1,4 @@ -This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=latex 2006.11.18) 23 DEC 2006 17:03 +This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=latex 2006.11.18) 3 FEB 2007 17:05 entering extended mode **./images.tex (./images.tex @@ -353,41 +353,41 @@ LaTeX Font Info: External font `cmex10' loaded for size (Font) <8> on input line 235. LaTeX Font Info: External font `cmex10' loaded for size (Font) <6> on input line 235. -l2hSize :tex2html_wrap_inline1028:7.0626pt::0.0pt::7.1201pt. +l2hSize :tex2html_wrap_inline1027:7.0626pt::0.0pt::7.1201pt. [1 ] -l2hSize :tex2html_wrap_inline1032:7.48248pt::0.0pt::48.86426pt. +l2hSize :tex2html_wrap_inline1031:7.48248pt::0.0pt::48.86426pt. [2 ] -l2hSize :tex2html_wrap_inline1981:8.7125pt::8.7125pt::23.6642pt. +l2hSize :tex2html_wrap_inline2020:8.7125pt::8.7125pt::23.6642pt. [3 ] -l2hSize :tex2html_wrap_inline6076:7.5626pt::7.5626pt::14.53923pt. +l2hSize :tex2html_wrap_inline6229:7.5626pt::7.5626pt::14.53923pt. [4 ] -l2hSize :tex2html_wrap_inline6080:7.5626pt::7.5626pt::14.53923pt. +l2hSize :tex2html_wrap_inline6231:7.5626pt::7.5626pt::14.53923pt. [5 ] -l2hSize :tex2html_wrap_inline9064:8.7125pt::8.7125pt::86.9574pt. +l2hSize :tex2html_wrap_inline9215:8.7125pt::8.7125pt::86.9574pt. [6 ] (./images.aux) ) Here is how much of TeX's memory you used: 4428 strings out of 94501 - 62627 string characters out of 1175793 - 121207 words of memory out of 1000000 + 62589 string characters out of 1175793 + 121255 words of memory out of 1000000 7572 multiletter control sequences out of 10000+50000 7874 words of font info for 24 fonts, out of 500000 for 2000 580 hyphenation exceptions out of 8191 diff --git a/doc/ionconf/images.tex b/doc/ionconf/images.tex index d950261..fa6a169 100644 --- a/doc/ionconf/images.tex +++ b/doc/ionconf/images.tex @@ -82,7 +82,7 @@ \title{Configuring and extending Ion3 with Lua} \author{Tuomo Valkonen \\tuomov at iki.fi} -\date{2006-12-23} +\date{2007-02-03} \makeindex @@ -231,7 +231,7 @@ \stepcounter{section} \stepcounter{section} {\newpage\clearpage -\lthtmlinlinemathA{tex2html_wrap_inline1028}% +\lthtmlinlinemathA{tex2html_wrap_inline1027}% $n$% \lthtmlinlinemathZ \lthtmlcheckvsize\clearpage} @@ -242,7 +242,7 @@ $n$% \stepcounter{subsection} \stepcounter{subsection} {\newpage\clearpage -\lthtmlinlinemathA{tex2html_wrap_inline1032}% +\lthtmlinlinemathA{tex2html_wrap_inline1031}% $N=1{\ldots} 5$% \lthtmlinlinemathZ \lthtmlcheckvsize\clearpage} @@ -293,7 +293,7 @@ $N=1{\ldots} 5$% \stepcounter{section} \stepcounter{subsection} {\newpage\clearpage -\lthtmlinlinemathA{tex2html_wrap_inline1981}% +\lthtmlinlinemathA{tex2html_wrap_inline2020}% $(0, 1]$% \lthtmlinlinemathZ \lthtmlcheckvsize\clearpage} @@ -308,12 +308,6 @@ $(0, 1]$% \stepcounter{section} \stepcounter{chapter} \stepcounter{section} -{\newpage\clearpage -\lthtmlinlinemathA{tex2html_wrap_inline6076}% -$-1$% -\lthtmlinlinemathZ -\lthtmlcheckvsize\clearpage} - \stepcounter{subsection} \stepcounter{subsection} \stepcounter{subsection} @@ -322,7 +316,13 @@ $-1$% \stepcounter{subsection} \stepcounter{subsection} {\newpage\clearpage -\lthtmlinlinemathA{tex2html_wrap_inline6080}% +\lthtmlinlinemathA{tex2html_wrap_inline6229}% +$-1$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline6231}% $-2$% \lthtmlinlinemathZ \lthtmlcheckvsize\clearpage} @@ -351,7 +351,7 @@ $-2$% \stepcounter{section} \stepcounter{subsection} {\newpage\clearpage -\lthtmlinlinemathA{tex2html_wrap_inline9064}% +\lthtmlinlinemathA{tex2html_wrap_inline9215}% $\{t,m,b\}\times\{t,c,b\}$% \lthtmlinlinemathZ \lthtmlcheckvsize\clearpage} diff --git a/doc/ionconf/index.html b/doc/ionconf/index.html index 7a0a20d..b693be4 100644 --- a/doc/ionconf/index.html +++ b/doc/ionconf/index.html @@ -57,7 +57,7 @@ original version by: Nikos Drakos, CBLU, University of Leeds

Tuomo Valkonen

tuomov at iki.fi

-

2006-12-23

+

2007-02-03

diff --git a/doc/ionconf/internals.pl b/doc/ionconf/internals.pl index d2d476e..28350c3 100644 --- a/doc/ionconf/internals.pl +++ b/doc/ionconf/internals.pl @@ -50,10 +50,6 @@ $key = q/fn:WFrame.is_shaded/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WMPlex.mx_list/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.goto_activity/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -70,11 +66,11 @@ $key = q/fn:WEdln.finish/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WEdln.bskip_word/; +$key = q/fn:WEdln.mark/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WEdln.mark/; +$key = q/fn:WEdln.bskip_word/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -114,10 +110,6 @@ $key = q/fn:WRegion.is_mapped/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WClientWin.is_fullscreen/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.goto_prev_screen/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -138,11 +130,11 @@ $key = q/fn:ioncore.get/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WWindow.p_resize/; +$key = q/fn:WComplProxy.set_completions/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WComplProxy.set_completions/; +$key = q/fn:WWindow.p_resize/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -170,10 +162,6 @@ $key = q/fn:ioncore.defmenu/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.set_get_winprop_fn/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fig:borders/; $ref_files{$key} = "$dir".q|node5.html|; $noresave{$key} = "$nosave"; @@ -218,6 +206,10 @@ $key = q/fn:ioncore.warn_traced/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:WTiling.managed_i/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WMenu.select_next/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -314,7 +306,7 @@ $key = q/fn:ioncore.write_savefile/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/panews_make_placement_alt/; +$key = q/fn:ioncore.tagged_i/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -330,10 +322,6 @@ $key = q/fn:WWindow.xid/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.activity_list/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:WClientWin.get_ident/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -378,6 +366,10 @@ $key = q/fn:WFrame.p_tabdrag/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.clientwin_i/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WRegion.screen_of/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -486,11 +478,11 @@ $key = q/fn:ioncore.getctxmenu/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/region_inactivated_hook/; +$key = q/fn:WFrame.maximize_horiz/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WFrame.maximize_horiz/; +$key = q/fn:ioncore.region_i/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -498,6 +490,10 @@ $key = q/fn:WWindow.p_move/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:WGroup.is_fullscreen/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/sec:objects/; $ref_files{$key} = "$dir".q|node3.html|; $noresave{$key} = "$nosave"; @@ -550,6 +546,10 @@ $key = q/fn:mod_query.query_workspace/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:WGroup.managed_i/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WMenu.typeahead_clear/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -562,7 +562,7 @@ $key = q/fn:WSplit.rqgeom/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.tags_first/; +$key = q/fn:WMPlex.managed_i/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -654,10 +654,6 @@ $key = q/fn:ioncore.exec/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.region_list/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:WMPlex.mx_current/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -690,10 +686,6 @@ $key = q/fn:WSplitSplit.br/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WMPlex.managed_list/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:string.shell_safe/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -702,10 +694,6 @@ $key = q/fn:mod_query.query_restart/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WTiling.managed_list/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:mod_tiling.set/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -742,10 +730,18 @@ $key = q/fn:WRegion.rqclose_propagate/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/region_notify_hook/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WEdln.clear_mark/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.focushistory_i/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/tiling_placement_alt/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -758,6 +754,10 @@ $key = q/fn:WRegion.begin_kbresize/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.deflayout/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/sec:classesrolesinstances/; $ref_files{$key} = "$dir".q|node4.html|; $noresave{$key} = "$nosave"; @@ -790,11 +790,11 @@ $key = q/clientwin_mapped_hook/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WClientWin.set_fullscreen/; +$key = q/fn:WEdln.paste/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WEdln.paste/; +$key = q/fn:ioncore.detach/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -814,6 +814,10 @@ $key = q/fn:mod_query.query_attachclient/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/clientwin_property_change_hook/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:table.append/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -866,6 +870,10 @@ $key = q/fn:ioncore.get_paths/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.tagged_first/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/sec:walkthrough/; $ref_files{$key} = "$dir".q|node4.html|; $noresave{$key} = "$nosave"; @@ -910,10 +918,6 @@ $key = q/fn:WTiling.split_top/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/region_activity_hook/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.progname/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -1010,19 +1014,19 @@ $key = q/fn:ioncore.kpress_wait/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/clientwin_do_manage_alt/; +$key = q/fn:WTiling.transpose_at/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WRegion.rootwin_of/; +$key = q/clientwin_do_manage_alt/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WTiling.transpose_at/; +$key = q/fn:WMPlex.mx_i/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/ioncore_sigchld_hook/; +$key = q/fn:WRegion.rootwin_of/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -1030,6 +1034,10 @@ $key = q/fn:ioncore.match_winprop_name/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/ioncore_sigchld_hook/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WTiling.nextto/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -1086,10 +1094,6 @@ $key = q/fn:ioncore.getwinprop/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.tagged_list/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.request_selection/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -1118,10 +1122,6 @@ $key = q/sec:conffiles/; $ref_files{$key} = "$dir".q|node4.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.clientwin_list/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.aboutmsg/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -1130,7 +1130,7 @@ $key = q/chap:prelim/; $ref_files{$key} = "$dir".q|node3.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WGroup.managed_list/; +$key = q/fn:ioncore.getlayout/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -1158,10 +1158,6 @@ $key = q/fn:WInput.scrolldown/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/region_activated_hook/; -$ref_files{$key} = "$dir".q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:mod_query.history_table/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; @@ -1174,15 +1170,19 @@ $key = q/fn:ioncore.set/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.mpress/; +$key = q/fn:ioncore.activity_i/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/sec:tilingref/; +$key = q/fn:WGroup.set_fullscreen/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:mod_tiling.detach/; +$key = q/fn:ioncore.mpress/; +$ref_files{$key} = "$dir".q|node7.html|; +$noresave{$key} = "$nosave"; + +$key = q/sec:tilingref/; $ref_files{$key} = "$dir".q|node7.html|; $noresave{$key} = "$nosave"; diff --git a/doc/ionconf/ionconf.html b/doc/ionconf/ionconf.html index 7a0a20d..b693be4 100644 --- a/doc/ionconf/ionconf.html +++ b/doc/ionconf/ionconf.html @@ -57,7 +57,7 @@ original version by: Nikos Drakos, CBLU, University of Leeds

Tuomo Valkonen

tuomov at iki.fi

-

2006-12-23

+

2007-02-03

diff --git a/doc/ionconf/labels.pl b/doc/ionconf/labels.pl index cbfa297..2d6ca3c 100644 --- a/doc/ionconf/labels.pl +++ b/doc/ionconf/labels.pl @@ -50,10 +50,6 @@ $key = q/fn:WFrame.is_shaded/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WMPlex.mx_list/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.goto_activity/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -70,11 +66,11 @@ $key = q/fn:WEdln.finish/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WEdln.bskip_word/; +$key = q/fn:WEdln.mark/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WEdln.mark/; +$key = q/fn:WEdln.bskip_word/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -114,10 +110,6 @@ $key = q/fn:WRegion.is_mapped/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WClientWin.is_fullscreen/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.goto_prev_screen/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -138,11 +130,11 @@ $key = q/fn:ioncore.get/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WWindow.p_resize/; +$key = q/fn:WComplProxy.set_completions/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WComplProxy.set_completions/; +$key = q/fn:WWindow.p_resize/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -170,10 +162,6 @@ $key = q/fn:ioncore.defmenu/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.set_get_winprop_fn/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fig:borders/; $external_labels{$key} = "$URL/" . q|node5.html|; $noresave{$key} = "$nosave"; @@ -218,6 +206,10 @@ $key = q/fn:ioncore.warn_traced/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:WTiling.managed_i/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WMenu.select_next/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -314,7 +306,7 @@ $key = q/fn:ioncore.write_savefile/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/panews_make_placement_alt/; +$key = q/fn:ioncore.tagged_i/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -330,10 +322,6 @@ $key = q/fn:WWindow.xid/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.activity_list/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:WClientWin.get_ident/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -378,6 +366,10 @@ $key = q/fn:WFrame.p_tabdrag/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.clientwin_i/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WRegion.screen_of/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -486,11 +478,11 @@ $key = q/fn:ioncore.getctxmenu/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/region_inactivated_hook/; +$key = q/fn:WFrame.maximize_horiz/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WFrame.maximize_horiz/; +$key = q/fn:ioncore.region_i/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -498,6 +490,10 @@ $key = q/fn:WWindow.p_move/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:WGroup.is_fullscreen/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/sec:objects/; $external_labels{$key} = "$URL/" . q|node3.html|; $noresave{$key} = "$nosave"; @@ -550,6 +546,10 @@ $key = q/fn:mod_query.query_workspace/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:WGroup.managed_i/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WMenu.typeahead_clear/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -562,7 +562,7 @@ $key = q/fn:WSplit.rqgeom/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.tags_first/; +$key = q/fn:WMPlex.managed_i/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -654,10 +654,6 @@ $key = q/fn:ioncore.exec/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.region_list/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:WMPlex.mx_current/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -690,10 +686,6 @@ $key = q/fn:WSplitSplit.br/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WMPlex.managed_list/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:string.shell_safe/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -702,10 +694,6 @@ $key = q/fn:mod_query.query_restart/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WTiling.managed_list/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:mod_tiling.set/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -742,10 +730,18 @@ $key = q/fn:WRegion.rqclose_propagate/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/region_notify_hook/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WEdln.clear_mark/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.focushistory_i/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/tiling_placement_alt/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -758,6 +754,10 @@ $key = q/fn:WRegion.begin_kbresize/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.deflayout/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/sec:classesrolesinstances/; $external_labels{$key} = "$URL/" . q|node4.html|; $noresave{$key} = "$nosave"; @@ -790,11 +790,11 @@ $key = q/clientwin_mapped_hook/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WClientWin.set_fullscreen/; +$key = q/fn:WEdln.paste/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WEdln.paste/; +$key = q/fn:ioncore.detach/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -814,6 +814,10 @@ $key = q/fn:mod_query.query_attachclient/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/clientwin_property_change_hook/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:table.append/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -866,6 +870,10 @@ $key = q/fn:ioncore.get_paths/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.tagged_first/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/sec:walkthrough/; $external_labels{$key} = "$URL/" . q|node4.html|; $noresave{$key} = "$nosave"; @@ -910,10 +918,6 @@ $key = q/fn:WTiling.split_top/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/region_activity_hook/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.progname/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -1010,19 +1014,19 @@ $key = q/fn:ioncore.kpress_wait/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/clientwin_do_manage_alt/; +$key = q/fn:WTiling.transpose_at/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WRegion.rootwin_of/; +$key = q/clientwin_do_manage_alt/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WTiling.transpose_at/; +$key = q/fn:WMPlex.mx_i/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/ioncore_sigchld_hook/; +$key = q/fn:WRegion.rootwin_of/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -1030,6 +1034,10 @@ $key = q/fn:ioncore.match_winprop_name/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; +$key = q/ioncore_sigchld_hook/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + $key = q/fn:WTiling.nextto/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -1086,10 +1094,6 @@ $key = q/fn:ioncore.getwinprop/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.tagged_list/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.request_selection/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -1118,10 +1122,6 @@ $key = q/sec:conffiles/; $external_labels{$key} = "$URL/" . q|node4.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.clientwin_list/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.aboutmsg/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -1130,7 +1130,7 @@ $key = q/chap:prelim/; $external_labels{$key} = "$URL/" . q|node3.html|; $noresave{$key} = "$nosave"; -$key = q/fn:WGroup.managed_list/; +$key = q/fn:ioncore.getlayout/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -1158,10 +1158,6 @@ $key = q/fn:WInput.scrolldown/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/region_activated_hook/; -$external_labels{$key} = "$URL/" . q|node7.html|; -$noresave{$key} = "$nosave"; - $key = q/fn:mod_query.history_table/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -1174,15 +1170,19 @@ $key = q/fn:ioncore.set/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.mpress/; +$key = q/fn:ioncore.activity_i/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/sec:tilingref/; +$key = q/fn:WGroup.set_fullscreen/; +$external_labels{$key} = "$URL/" . q|node7.html|; +$noresave{$key} = "$nosave"; + +$key = q/fn:ioncore.mpress/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; -$key = q/fn:mod_tiling.detach/; +$key = q/sec:tilingref/; $external_labels{$key} = "$URL/" . q|node7.html|; $noresave{$key} = "$nosave"; @@ -1357,10 +1357,6 @@ $key = q/fn:WFrame.is_shaded/; $external_latex_labels{$key} = q|6.1.2|; $noresave{$key} = "$nosave"; -$key = q/fn:WMPlex.mx_list/; -$external_latex_labels{$key} = q|6.1.7|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.goto_activity/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; @@ -1377,11 +1373,11 @@ $key = q/fn:WEdln.finish/; $external_latex_labels{$key} = q|6.3.2|; $noresave{$key} = "$nosave"; -$key = q/fn:WEdln.bskip_word/; +$key = q/fn:WEdln.mark/; $external_latex_labels{$key} = q|6.3.2|; $noresave{$key} = "$nosave"; -$key = q/fn:WEdln.mark/; +$key = q/fn:WEdln.bskip_word/; $external_latex_labels{$key} = q|6.3.2|; $noresave{$key} = "$nosave"; @@ -1421,10 +1417,6 @@ $key = q/fn:WRegion.is_mapped/; $external_latex_labels{$key} = q|6.1.9|; $noresave{$key} = "$nosave"; -$key = q/fn:WClientWin.is_fullscreen/; -$external_latex_labels{$key} = q|6.1.1|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.goto_prev_screen/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; @@ -1445,14 +1437,14 @@ $key = q/fn:ioncore.get/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; -$key = q/fn:WWindow.p_resize/; -$external_latex_labels{$key} = q|6.1.12|; -$noresave{$key} = "$nosave"; - $key = q/fn:WComplProxy.set_completions/; $external_latex_labels{$key} = q|6.3.1|; $noresave{$key} = "$nosave"; +$key = q/fn:WWindow.p_resize/; +$external_latex_labels{$key} = q|6.1.12|; +$noresave{$key} = "$nosave"; + $key = q/fn:ioncore.shutdown/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; @@ -1477,10 +1469,6 @@ $key = q/fn:ioncore.defmenu/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.set_get_winprop_fn/; -$external_latex_labels{$key} = q|6.1|; -$noresave{$key} = "$nosave"; - $key = q/fig:borders/; $external_latex_labels{$key} = q|4.1|; $noresave{$key} = "$nosave"; @@ -1525,6 +1513,10 @@ $key = q/fn:ioncore.warn_traced/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; +$key = q/fn:WTiling.managed_i/; +$external_latex_labels{$key} = q|6.2.5|; +$noresave{$key} = "$nosave"; + $key = q/fn:WMenu.select_next/; $external_latex_labels{$key} = q|6.4.1|; $noresave{$key} = "$nosave"; @@ -1621,8 +1613,8 @@ $key = q/fn:ioncore.write_savefile/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; -$key = q/panews_make_placement_alt/; -$external_latex_labels{$key} = q|6.8|; +$key = q/fn:ioncore.tagged_i/; +$external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; $key = q/sec:exports/; @@ -1637,10 +1629,6 @@ $key = q/fn:WWindow.xid/; $external_latex_labels{$key} = q|6.1.12|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.activity_list/; -$external_latex_labels{$key} = q|6.1|; -$noresave{$key} = "$nosave"; - $key = q/fn:WClientWin.get_ident/; $external_latex_labels{$key} = q|6.1.1|; $noresave{$key} = "$nosave"; @@ -1685,6 +1673,10 @@ $key = q/fn:WFrame.p_tabdrag/; $external_latex_labels{$key} = q|6.1.2|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.clientwin_i/; +$external_latex_labels{$key} = q|6.1|; +$noresave{$key} = "$nosave"; + $key = q/fn:WRegion.screen_of/; $external_latex_labels{$key} = q|6.1.9|; $noresave{$key} = "$nosave"; @@ -1793,18 +1785,22 @@ $key = q/fn:ioncore.getctxmenu/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; -$key = q/region_inactivated_hook/; -$external_latex_labels{$key} = q|6.8|; -$noresave{$key} = "$nosave"; - $key = q/fn:WFrame.maximize_horiz/; $external_latex_labels{$key} = q|6.1.2|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.region_i/; +$external_latex_labels{$key} = q|6.1|; +$noresave{$key} = "$nosave"; + $key = q/fn:WWindow.p_move/; $external_latex_labels{$key} = q|6.1.12|; $noresave{$key} = "$nosave"; +$key = q/fn:WGroup.is_fullscreen/; +$external_latex_labels{$key} = q|6.1.3|; +$noresave{$key} = "$nosave"; + $key = q/sec:objects/; $external_latex_labels{$key} = q|2.2|; $noresave{$key} = "$nosave"; @@ -1857,6 +1853,10 @@ $key = q/fn:mod_query.query_workspace/; $external_latex_labels{$key} = q|6.3|; $noresave{$key} = "$nosave"; +$key = q/fn:WGroup.managed_i/; +$external_latex_labels{$key} = q|6.1.3|; +$noresave{$key} = "$nosave"; + $key = q/fn:WMenu.typeahead_clear/; $external_latex_labels{$key} = q|6.4.1|; $noresave{$key} = "$nosave"; @@ -1869,8 +1869,8 @@ $key = q/fn:WSplit.rqgeom/; $external_latex_labels{$key} = q|6.2.1|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.tags_first/; -$external_latex_labels{$key} = q|6.1|; +$key = q/fn:WMPlex.managed_i/; +$external_latex_labels{$key} = q|6.1.7|; $noresave{$key} = "$nosave"; $key = q/fn:WEdln.set_mark/; @@ -1961,10 +1961,6 @@ $key = q/fn:ioncore.exec/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.region_list/; -$external_latex_labels{$key} = q|6.1|; -$noresave{$key} = "$nosave"; - $key = q/fn:WMPlex.mx_current/; $external_latex_labels{$key} = q|6.1.7|; $noresave{$key} = "$nosave"; @@ -1997,10 +1993,6 @@ $key = q/fn:WSplitSplit.br/; $external_latex_labels{$key} = q|6.2.4|; $noresave{$key} = "$nosave"; -$key = q/fn:WMPlex.managed_list/; -$external_latex_labels{$key} = q|6.1.7|; -$noresave{$key} = "$nosave"; - $key = q/fn:string.shell_safe/; $external_latex_labels{$key} = q|6.1.15|; $noresave{$key} = "$nosave"; @@ -2009,10 +2001,6 @@ $key = q/fn:mod_query.query_restart/; $external_latex_labels{$key} = q|6.3|; $noresave{$key} = "$nosave"; -$key = q/fn:WTiling.managed_list/; -$external_latex_labels{$key} = q|6.2.5|; -$noresave{$key} = "$nosave"; - $key = q/fn:mod_tiling.set/; $external_latex_labels{$key} = q|6.2|; $noresave{$key} = "$nosave"; @@ -2049,10 +2037,18 @@ $key = q/fn:WRegion.rqclose_propagate/; $external_latex_labels{$key} = q|6.1.9|; $noresave{$key} = "$nosave"; +$key = q/region_notify_hook/; +$external_latex_labels{$key} = q|6.8|; +$noresave{$key} = "$nosave"; + $key = q/fn:WEdln.clear_mark/; $external_latex_labels{$key} = q|6.3.2|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.focushistory_i/; +$external_latex_labels{$key} = q|6.1|; +$noresave{$key} = "$nosave"; + $key = q/tiling_placement_alt/; $external_latex_labels{$key} = q|6.8|; $noresave{$key} = "$nosave"; @@ -2065,6 +2061,10 @@ $key = q/fn:WRegion.begin_kbresize/; $external_latex_labels{$key} = q|6.1.9|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.deflayout/; +$external_latex_labels{$key} = q|6.1|; +$noresave{$key} = "$nosave"; + $key = q/sec:classesrolesinstances/; $external_latex_labels{$key} = q|3.5.1|; $noresave{$key} = "$nosave"; @@ -2097,14 +2097,14 @@ $key = q/clientwin_mapped_hook/; $external_latex_labels{$key} = q|6.8|; $noresave{$key} = "$nosave"; -$key = q/fn:WClientWin.set_fullscreen/; -$external_latex_labels{$key} = q|6.1.1|; -$noresave{$key} = "$nosave"; - $key = q/fn:WEdln.paste/; $external_latex_labels{$key} = q|6.3.2|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.detach/; +$external_latex_labels{$key} = q|6.1|; +$noresave{$key} = "$nosave"; + $key = q/fn:WClientWin.xid/; $external_latex_labels{$key} = q|6.1.1|; $noresave{$key} = "$nosave"; @@ -2121,6 +2121,10 @@ $key = q/fn:mod_query.query_attachclient/; $external_latex_labels{$key} = q|6.3|; $noresave{$key} = "$nosave"; +$key = q/clientwin_property_change_hook/; +$external_latex_labels{$key} = q|6.8|; +$noresave{$key} = "$nosave"; + $key = q/fn:table.append/; $external_latex_labels{$key} = q|6.1.16|; $noresave{$key} = "$nosave"; @@ -2173,6 +2177,10 @@ $key = q/fn:ioncore.get_paths/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; +$key = q/fn:ioncore.tagged_first/; +$external_latex_labels{$key} = q|6.1|; +$noresave{$key} = "$nosave"; + $key = q/sec:walkthrough/; $external_latex_labels{$key} = q|3.2|; $noresave{$key} = "$nosave"; @@ -2217,10 +2225,6 @@ $key = q/fn:WTiling.split_top/; $external_latex_labels{$key} = q|6.2.5|; $noresave{$key} = "$nosave"; -$key = q/region_activity_hook/; -$external_latex_labels{$key} = q|6.8|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.progname/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; @@ -2317,26 +2321,30 @@ $key = q/fn:ioncore.kpress_wait/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; +$key = q/fn:WTiling.transpose_at/; +$external_latex_labels{$key} = q|6.2.5|; +$noresave{$key} = "$nosave"; + $key = q/clientwin_do_manage_alt/; $external_latex_labels{$key} = q|6.8|; $noresave{$key} = "$nosave"; +$key = q/fn:WMPlex.mx_i/; +$external_latex_labels{$key} = q|6.1.7|; +$noresave{$key} = "$nosave"; + $key = q/fn:WRegion.rootwin_of/; $external_latex_labels{$key} = q|6.1.9|; $noresave{$key} = "$nosave"; -$key = q/fn:WTiling.transpose_at/; -$external_latex_labels{$key} = q|6.2.5|; +$key = q/fn:ioncore.match_winprop_name/; +$external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; $key = q/ioncore_sigchld_hook/; $external_latex_labels{$key} = q|6.8|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.match_winprop_name/; -$external_latex_labels{$key} = q|6.1|; -$noresave{$key} = "$nosave"; - $key = q/fn:WTiling.nextto/; $external_latex_labels{$key} = q|6.2.5|; $noresave{$key} = "$nosave"; @@ -2393,10 +2401,6 @@ $key = q/fn:ioncore.getwinprop/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.tagged_list/; -$external_latex_labels{$key} = q|6.1|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.request_selection/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; @@ -2425,10 +2429,6 @@ $key = q/sec:conffiles/; $external_latex_labels{$key} = q|3.1|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.clientwin_list/; -$external_latex_labels{$key} = q|6.1|; -$noresave{$key} = "$nosave"; - $key = q/fn:ioncore.aboutmsg/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; @@ -2437,8 +2437,8 @@ $key = q/chap:prelim/; $external_latex_labels{$key} = q|2|; $noresave{$key} = "$nosave"; -$key = q/fn:WGroup.managed_list/; -$external_latex_labels{$key} = q|6.1.3|; +$key = q/fn:ioncore.getlayout/; +$external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; $key = q/fig:parentship/; @@ -2465,10 +2465,6 @@ $key = q/fn:WInput.scrolldown/; $external_latex_labels{$key} = q|6.3.3|; $noresave{$key} = "$nosave"; -$key = q/region_activated_hook/; -$external_latex_labels{$key} = q|6.8|; -$noresave{$key} = "$nosave"; - $key = q/fn:mod_query.history_table/; $external_latex_labels{$key} = q|6.3|; $noresave{$key} = "$nosave"; @@ -2481,15 +2477,19 @@ $key = q/fn:ioncore.set/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; -$key = q/fn:ioncore.mpress/; +$key = q/fn:ioncore.activity_i/; $external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; -$key = q/sec:tilingref/; -$external_latex_labels{$key} = q|6.2|; +$key = q/fn:WGroup.set_fullscreen/; +$external_latex_labels{$key} = q|6.1.3|; +$noresave{$key} = "$nosave"; + +$key = q/fn:ioncore.mpress/; +$external_latex_labels{$key} = q|6.1|; $noresave{$key} = "$nosave"; -$key = q/fn:mod_tiling.detach/; +$key = q/sec:tilingref/; $external_latex_labels{$key} = q|6.2|; $noresave{$key} = "$nosave"; diff --git a/doc/ionconf/node10.html b/doc/ionconf/node10.html index f33c3b7..46a988d 100644 --- a/doc/ionconf/node10.html +++ b/doc/ionconf/node10.html @@ -74,27 +74,31 @@ List of functions
gr.select_engine
ioncore.aboutmsg
ioncore.activity_first -
ioncore.activity_list +
ioncore.activity_i
ioncore.bdoc
ioncore.chdir_for
ioncore.clear_tags -
ioncore.clientwin_list +
ioncore.clientwin_i
ioncore.compile_cmd
ioncore.create_ws
ioncore.current
ioncore.defbindings
ioncore.defctxmenu +
ioncore.deflayout
ioncore.defmenu
ioncore.defshortening
ioncore.defwinprop +
ioncore.detach
ioncore.exec
ioncore.exec_on
ioncore.find_manager
ioncore.find_screen_id +
ioncore.focushistory_i
ioncore.get
ioncore.getbindings
ioncore.getctxmenu
ioncore.get_dir_for +
ioncore.getlayout
ioncore.getmenu
ioncore.get_paths
ioncore.get_savefile @@ -125,21 +129,20 @@ List of functions
ioncore.progname
ioncore.read_savefile
ioncore.refresh_stylelist -
ioncore.region_list +
ioncore.region_i
ioncore.request_selection
ioncore.resign
ioncore.restart
ioncore.restart_other
ioncore.set -
ioncore.set_get_winprop_fn
ioncore.set_paths
ioncore.set_selection
ioncore.shutdown
ioncore.snapshot
ioncore.submap
ioncore.submenu -
ioncore.tagged_list -
ioncore.tags_first +
ioncore.tagged_first +
ioncore.tagged_i
ioncore.TR
ioncore.version
ioncore.warn @@ -189,7 +192,7 @@ List of functions
mod_query.warn
mod_sp.set_shown
mod_sp.set_shown_on -
mod_tiling.detach +
mod_statusbar.statusbars
mod_tiling.get
mod_tiling.mkbottom
mod_tiling.set @@ -200,11 +203,9 @@ List of functions
table.join
table.map
WClientWin.get_ident -
WClientWin.is_fullscreen
WClientWin.kill
WClientWin.nudge
WClientWin.quote_next -
WClientWin.set_fullscreen
WClientWin.xid
WComplProxy.set_completions
WDock.attach @@ -256,7 +257,9 @@ List of functions
WGroup.attach
WGroup.attach_new
WGroup.bottom -
WGroup.managed_list +
WGroup.is_fullscreen +
WGroup.managed_i +
WGroup.set_fullscreen
WGroupWS.attach_framed
WInfoWin.set_text
WInput.cancel @@ -280,10 +283,10 @@ List of functions
WMPlex.get_stdisp
WMPlex.inc_index
WMPlex.is_hidden -
WMPlex.managed_list +
WMPlex.managed_i
WMPlex.mx_count
WMPlex.mx_current -
WMPlex.mx_list +
WMPlex.mx_i
WMPlex.mx_nth
WMPlex.set_hidden
WMPlex.set_index @@ -326,9 +329,15 @@ List of functions
WSplitSplit.flip
WSplitSplit.tl
WSplit.transpose +
WStatusBar.get_template_table +
WStatusBar.is_systray_extl +
WStatusBar.set_systray +
WStatusBar.set_template +
WStatusBar.set_template_table +
WStatusBar.update
WTiling.farthest
WTiling.flip_at -
WTiling.managed_list +
WTiling.managed_i
WTiling.nextto
WTiling.node_of
WTiling.set_floating diff --git a/doc/ionconf/node11.html b/doc/ionconf/node11.html index 2c12ab2..76b0481 100644 --- a/doc/ionconf/node11.html +++ b/doc/ionconf/node11.html @@ -58,1029 +58,1035 @@ original version by: Nikos Drakos, CBLU, University of Leeds Index


aboutmsg - : 6.1 + : 6.1
acrobatic - : 3.5 + : 3.5
activity_first - : 6.1 -
activity_list - : 6.1 + : 6.1 +
activity_i + : 6.1
Alt - : 3.3.5 + : 3.3.5
AnyModifier - : 3.3.5 + : 3.3.5
append - : 6.1.16 + : 6.1.16
aspect - : 3.5 + : 3.5
attach - : 6.1.3 - | 6.1.7 - | 6.5.1 + : 6.1.3 + | 6.1.7 + | 6.5.1
attach_framed - : 6.1.5 + : 6.1.5
attach_new - : 6.1.3 - | 6.1.7 + : 6.1.3 + | 6.1.7
attach_tagged - : 6.1.7 + : 6.1.7
back - : 6.3.2 + : 6.3.2
backspace - : 6.3.2 + : 6.3.2
bdoc - : 6.1 + : 6.1
begin_kbresize - : 6.1.9 + : 6.1.9
bkill_word - : 6.3.2 + : 6.3.2
bol - : 6.3.2 + : 6.3.2
bottom - : 6.1.3 + : 6.1.3
br - : 6.2.4 + : 6.2.4
bskip_word - : 6.3.2 + : 6.3.2
Button-n - : 3.3.6 + : 3.3.6
cancel - : 6.1.8 - | 6.3.3 - | 6.4.1 + : 6.1.8 + | 6.3.3 + | 6.4.1
chdir_for - : 6.1 + : 6.1
class
-
winprop : 3.5.1 +
winprop : 3.5.1
clear_mark - : 6.3.2 + : 6.3.2
clear_tags - : 6.1 + : 6.1
clientwin_do_manage_alt - : 6.8 -
clientwin_list - : 6.1 + : 6.8 +
clientwin_i + : 6.1
clientwin_mapped_hook - : 6.8 + : 6.8 +
clientwin_property_change_hook + : 6.8
clientwin_unmapped_hook - : 6.8 + : 6.8
compile_cmd - : 6.1 + : 6.1
complete - : 6.3.2 + : 6.3.2
contents - : 6.3.2 + : 6.3.2
context - : 6.3.2 + : 6.3.2
Control - : 3.3.5 + : 3.3.5
copy - : 6.1.16 - | 6.3.2 + : 6.1.16 + | 6.3.2
create_ws - : 6.1 + : 6.1
current - : 6.1 - | 6.1.9 - | 6.2.2 + : 6.1 + | 6.1.9 + | 6.2.2
current_scr - : 6.1.10 + : 6.1.10
cut - : 6.3.2 + : 6.3.2
de
-
defstyle : 6.7 -
defstyle_rootwin : 6.7 -
reset : 6.7 -
substyle : 6.7 +
defstyle : 6.7 +
defstyle_rootwin : 6.7 +
reset : 6.7 +
substyle : 6.7
dec_index - : 6.1.7 + : 6.1.7
defbindings - : 6.1 + : 6.1
defcmd - : 6.3 + : 6.3
defctxmenu - : 6.1 + : 6.1 +
deflayout + : 6.1
defmenu - : 3.4.1 - | 6.1 + : 3.4.1 + | 6.1
defshortening - : 6.1 + : 6.1
defstyle - : 6.7 + : 6.7
defstyle_rootwin - : 6.7 + : 6.7
defwinprop - : 6.1 + : 6.1
delete - : 6.3.2 + : 6.3.2
detach - : 6.2 + : 6.1
dir - : 6.2.4 + : 6.2.4
drawing engine - : 4.1 + : 4.1
eol - : 6.3.2 + : 6.3.2
ETCDIR - : 3.1 + : 3.1
exec - : 6.1 + : 6.1
exec_on - : 6.1 + : 6.1
export - : 6.1.13 + : 6.1.13
farthest - : 6.2.5 + : 6.2.5
find_manager - : 6.1 + : 6.1
find_screen_id - : 6.1 + : 6.1
finish - : 6.1.8 - | 6.3.2 - | 6.4.1 + : 6.1.8 + | 6.3.2 + | 6.4.1
flip - : 6.2.4 + : 6.2.4
flip_at - : 6.2.5 + : 6.2.5
float - : 3.5 + : 3.5 +
focushistory_i + : 6.1
forward - : 6.3.2 + : 6.3.2
frame_managed_changed_hook - : 6.8 + : 6.8
fullscreen - : 3.5 + : 3.5
geom - : 6.1.9 - | 6.2.1 + : 6.1.9 + | 6.2.1
get - : 6.1 - | 6.2 - | 6.3 - | 6.4 - | 6.5.1 + : 6.1 + | 6.2 + | 6.3 + | 6.4 + | 6.5.1
get_dir_for - : 6.1 + : 6.1
get_ident - : 6.1.1 + : 6.1.1
get_index - : 6.1.7 + : 6.1.7
get_paths - : 6.1 + : 6.1
get_savefile - : 6.1 + : 6.1
get_stdisp - : 6.1.7 + : 6.1.7
getbindings - : 6.1 + : 6.1
getctxmenu - : 6.1 + : 6.1 +
getlayout + : 6.1
getmenu - : 6.1 + : 6.1
getwinprop - : 6.1 + : 6.1
goto - : 6.1.9 + : 6.1.9
goto_activity - : 6.1 + : 6.1
goto_first - : 6.1 + : 6.1
goto_next - : 6.1 + : 6.1
goto_next_screen - : 6.1 + : 6.1
goto_nth_screen - : 6.1 + : 6.1
goto_prev_screen - : 6.1 + : 6.1
goto_previous - : 6.1 + : 6.1
gr
-
read_config : 6.1.14 -
refresh : 6.1.14 -
select_engine : 6.1.14 +
read_config : 6.1.14 +
refresh : 6.1.14 +
select_engine : 6.1.14
grabmenu - : 6.4 + : 6.4
history_clear - : 6.3 + : 6.3
history_get - : 6.3 + : 6.3
history_next - : 6.3.2 + : 6.3.2
history_prev - : 6.3.2 + : 6.3.2
history_push - : 6.3 + : 6.3
history_search - : 6.3 + : 6.3
history_table - : 6.3 + : 6.3
icat - : 6.1.16 + : 6.1.16
id - : 6.1.11 + : 6.1.11
ignore_cfgrq - : 3.5 + : 3.5
ignore_net_active_window - : 3.5 + : 3.5
ignore_resizeinc - : 3.5 + : 3.5
inc_index - : 6.1.7 + : 6.1.7
insstr - : 6.3.2 + : 6.3.2
instance
-
winprop : 3.5.1 +
winprop : 3.5.1
ioncore
-
aboutmsg : 6.1 -
activity_first : 6.1 -
activity_list : 6.1 -
bdoc : 6.1 -
chdir_for : 6.1 -
clear_tags : 6.1 -
clientwin_list : 6.1 -
compile_cmd : 6.1 -
create_ws : 6.1 -
current : 6.1 -
defbindings : 6.1 -
defctxmenu : 6.1 -
defmenu : 6.1 -
defshortening : 6.1 -
defwinprop : 6.1 -
exec : 6.1 -
exec_on : 6.1 -
find_manager : 6.1 -
find_screen_id : 6.1 -
get : 6.1 -
get_dir_for : 6.1 -
get_paths : 6.1 -
get_savefile : 6.1 -
getbindings : 6.1 -
getctxmenu : 6.1 -
getmenu : 6.1 -
getwinprop : 6.1 -
goto_activity : 6.1 -
goto_first : 6.1 -
goto_next : 6.1 -
goto_next_screen : 6.1 -
goto_nth_screen : 6.1 -
goto_prev_screen : 6.1 -
goto_previous : 6.1 -
is_i18n : 6.1 -
kpress : 6.1 -
kpress_wait : 6.1 -
load_module : 6.1 -
lookup_clientwin : 6.1 -
lookup_region : 6.1 -
lookup_script : 6.1 -
match_winprop_name : 6.1 -
mclick : 6.1 -
mdblclick : 6.1 -
mdrag : 6.1 -
menuentry : 6.1 -
mpress : 6.1 -
navi_first : 6.1 -
navi_next : 6.1 -
popen_bgread : 6.1 -
progname : 6.1 -
read_savefile : 6.1 -
refresh_stylelist : 6.1 -
region_list : 6.1 -
request_selection : 6.1 -
resign : 6.1 -
restart : 6.1 -
restart_other : 6.1 -
set : 6.1 -
set_get_winprop_fn : 6.1 -
set_paths : 6.1 -
set_selection : 6.1 -
shutdown : 6.1 -
snapshot : 6.1 -
submap : 6.1 -
submenu : 6.1 -
tagged_list : 6.1 -
tags_first : 6.1 -
TR : 6.1 -
version : 6.1 -
warn : 6.1 -
warn_traced : 6.1 -
write_savefile : 6.1 -
x_change_property : 6.1 -
x_delete_property : 6.1 -
x_get_atom_name : 6.1 -
x_get_text_property : 6.1 -
x_get_window_property : 6.1 -
x_intern_atom : 6.1 -
x_set_text_property : 6.1 +
aboutmsg : 6.1 +
activity_first : 6.1 +
activity_i : 6.1 +
bdoc : 6.1 +
chdir_for : 6.1 +
clear_tags : 6.1 +
clientwin_i : 6.1 +
compile_cmd : 6.1 +
create_ws : 6.1 +
current : 6.1 +
defbindings : 6.1 +
defctxmenu : 6.1 +
deflayout : 6.1 +
defmenu : 6.1 +
defshortening : 6.1 +
defwinprop : 6.1 +
detach : 6.1 +
exec : 6.1 +
exec_on : 6.1 +
find_manager : 6.1 +
find_screen_id : 6.1 +
focushistory_i : 6.1 +
get : 6.1 +
get_dir_for : 6.1 +
get_paths : 6.1 +
get_savefile : 6.1 +
getbindings : 6.1 +
getctxmenu : 6.1 +
getlayout : 6.1 +
getmenu : 6.1 +
getwinprop : 6.1 +
goto_activity : 6.1 +
goto_first : 6.1 +
goto_next : 6.1 +
goto_next_screen : 6.1 +
goto_nth_screen : 6.1 +
goto_prev_screen : 6.1 +
goto_previous : 6.1 +
is_i18n : 6.1 +
kpress : 6.1 +
kpress_wait : 6.1 +
load_module : 6.1 +
lookup_clientwin : 6.1 +
lookup_region : 6.1 +
lookup_script : 6.1 +
match_winprop_name : 6.1 +
mclick : 6.1 +
mdblclick : 6.1 +
mdrag : 6.1 +
menuentry : 6.1 +
mpress : 6.1 +
navi_first : 6.1 +
navi_next : 6.1 +
popen_bgread : 6.1 +
progname : 6.1 +
read_savefile : 6.1 +
refresh_stylelist : 6.1 +
region_i : 6.1 +
request_selection : 6.1 +
resign : 6.1 +
restart : 6.1 +
restart_other : 6.1 +
set : 6.1 +
set_paths : 6.1 +
set_selection : 6.1 +
shutdown : 6.1 +
snapshot : 6.1 +
submap : 6.1 +
submenu : 6.1 +
tagged_first : 6.1 +
tagged_i : 6.1 +
TR : 6.1 +
version : 6.1 +
warn : 6.1 +
warn_traced : 6.1 +
write_savefile : 6.1 +
x_change_property : 6.1 +
x_delete_property : 6.1 +
x_get_atom_name : 6.1 +
x_get_text_property : 6.1 +
x_get_window_property : 6.1 +
x_intern_atom : 6.1 +
x_set_text_property : 6.1
ioncore_deinit_hook - : 6.8 + : 6.8
ioncore_post_layout_setup_hook - : 6.8 + : 6.8
ioncore_sigchld_hook - : 6.8 + : 6.8
ioncore_snapshot_hook - : 6.8 + : 6.8
is_active - : 6.1.9 + : 6.1.9
is_activity - : 6.1.9 + : 6.1.9
is_fullscreen - : 6.1.1 + : 6.1.3
is_hidden - : 6.1.7 + : 6.1.7
is_histcompl - : 6.3.2 + : 6.3.2
is_i18n - : 6.1 + : 6.1
is_mapped - : 6.1.9 + : 6.1.9
is_shaded - : 6.1.2 + : 6.1.2
is_tagged - : 6.1.9 + : 6.1.9
join - : 6.1.16 + : 6.1.16
jumpto - : 3.5 + : 3.5
keysymdef.h - : 3.3.5 + : 3.3.5
kill - : 6.1.1 + : 6.1.1
kill_line - : 6.3.2 + : 6.3.2
kill_to_bol - : 6.3.2 + : 6.3.2
kill_to_eol - : 6.3.2 + : 6.3.2
kill_word - : 6.3.2 + : 6.3.2
kpress - : 6.1 + : 6.1
kpress_wait - : 6.1 + : 6.1
load_module - : 6.1 + : 6.1
Lock - : 3.3.5 + : 3.3.5
lookup_clientwin - : 6.1 + : 6.1
lookup_region - : 6.1 + : 6.1
lookup_script - : 6.1 -
managed_list - : 6.1.3 - | 6.1.7 - | 6.2.5 + : 6.1 +
managed_i + : 6.1.3 + | 6.1.7 + | 6.2.5
manager - : 2.2.2.1 - | 6.1.9 + : 2.2.2.1 + | 6.1.9
map - : 6.1.16 + : 6.1.16
mark - : 6.3.2 + : 6.3.2
match_winprop_name - : 6.1 + : 6.1
max_size - : 3.5 + : 3.5
maximize_horiz - : 6.1.2 + : 6.1.2
maximize_vert - : 6.1.2 + : 6.1.2
mclick - : 6.1 + : 6.1
mdblclick - : 6.1 + : 6.1
mdrag - : 6.1 + : 6.1
menu - : 6.4 + : 6.4
menuentry - : 3.4.1 - | 6.1 + : 3.4.1 + | 6.1
menus - : 3.4.1 + : 3.4.1
message - : 6.3 + : 6.3
min_size - : 3.5 + : 3.5
mkbottom - : 6.2 + : 6.2
mod_dock
-
set_floating_shown_on : 6.5 +
set_floating_shown_on : 6.5
mod_menu
-
get : 6.4 -
grabmenu : 6.4 -
menu : 6.4 -
pmenu : 6.4 -
set : 6.4 +
get : 6.4 +
grabmenu : 6.4 +
menu : 6.4 +
pmenu : 6.4 +
set : 6.4
mod_query
-
defcmd : 6.3 -
get : 6.3 -
history_clear : 6.3 -
history_get : 6.3 -
history_push : 6.3 -
history_search : 6.3 -
history_table : 6.3 -
message : 6.3 -
popen_completions : 6.3 -
query : 6.3 -
query_attachclient : 6.3 -
query_editfile : 6.3 -
query_exec : 6.3 -
query_gotoclient : 6.3 -
query_lua : 6.3 -
query_man : 6.3 -
query_menu : 6.3 -
query_renameframe : 6.3 -
query_renameworkspace : 6.3 -
query_restart : 6.3 -
query_runfile : 6.3 -
query_shutdown : 6.3 -
query_ssh : 6.3 -
query_workspace : 6.3 -
query_yesno : 6.3 -
set : 6.3 -
show_about_ion : 6.3 -
show_tree : 6.3 -
warn : 6.3 +
defcmd : 6.3 +
get : 6.3 +
history_clear : 6.3 +
history_get : 6.3 +
history_push : 6.3 +
history_search : 6.3 +
history_table : 6.3 +
message : 6.3 +
popen_completions : 6.3 +
query : 6.3 +
query_attachclient : 6.3 +
query_editfile : 6.3 +
query_exec : 6.3 +
query_gotoclient : 6.3 +
query_lua : 6.3 +
query_man : 6.3 +
query_menu : 6.3 +
query_renameframe : 6.3 +
query_renameworkspace : 6.3 +
query_restart : 6.3 +
query_runfile : 6.3 +
query_shutdown : 6.3 +
query_ssh : 6.3 +
query_workspace : 6.3 +
query_yesno : 6.3 +
set : 6.3 +
show_about_ion : 6.3 +
show_tree : 6.3 +
warn : 6.3
mod_sp
-
set_shown : 6.6 -
set_shown_on : 6.6 +
set_shown : 6.6 +
set_shown_on : 6.6
mod_tiling
-
detach : 6.2 -
get : 6.2 -
mkbottom : 6.2 -
set : 6.2 +
get : 6.2 +
mkbottom : 6.2 +
set : 6.2
mode - : 6.1.2 + : 6.1.2
ModN - : 3.3.5 + : 3.3.5
move - : 6.1.8 + : 6.1.8
mpress - : 6.1 + : 6.1
mx_count - : 6.1.7 + : 6.1.7
mx_current - : 6.1.7 -
mx_list - : 6.1.7 + : 6.1.7 +
mx_i + : 6.1.7
mx_nth - : 6.1.7 + : 6.1.7
name - : 6.1.9 + : 6.1.9
navi_first - : 6.1 + : 6.1
navi_next - : 6.1 + : 6.1 +
new_group + : 3.5
next_completion - : 6.3.2 + : 6.3.2
nextto - : 6.2.5 + : 6.2.5
node_of - : 6.2.5 + : 6.2.5
nudge - : 6.1.1 + : 6.1.1
NumLock - : 3.3.5 + : 3.3.5
Obj - : 2.2.1 + : 2.2.1
oneshot - : 3.5 + : 3.5
p_move - : 6.1.12 + : 6.1.12
p_resize - : 6.1.12 + : 6.1.12
p_switch_tab - : 6.1.2 + : 6.1.2
p_tabdrag - : 6.1.2 -
panews_make_placement_alt - : 6.8 + : 6.1.2
parent - : 2.2.2.1 - | 6.1.9 - | 6.2.1 + : 2.2.2.1 + | 6.1.9 + | 6.2.1
paste - : 6.3.2 + : 6.3.2
pmenu - : 6.4 + : 6.4
point - : 6.3.2 + : 6.3.2
popen_bgread - : 6.1 + : 6.1
popen_completions - : 6.3 + : 6.3
PREFIX - : 3.1 + : 3.1
prev_completion - : 6.3.2 + : 6.3.2
progname - : 6.1 + : 6.1
query - : 6.3 + : 6.3
query_attachclient - : 6.3 + : 6.3
query_editfile - : 6.3 + : 6.3
query_exec - : 6.3 + : 6.3
query_gotoclient - : 6.3 + : 6.3
query_lua - : 6.3 + : 6.3
query_man - : 6.3 + : 6.3
query_menu - : 6.3 + : 6.3
query_renameframe - : 6.3 + : 6.3
query_renameworkspace - : 6.3 + : 6.3
query_restart - : 6.3 + : 6.3
query_runfile - : 6.3 + : 6.3
query_shutdown - : 6.3 + : 6.3
query_ssh - : 6.3 + : 6.3
query_workspace - : 6.3 + : 6.3
query_yesno - : 6.3 + : 6.3
quote_next - : 6.1.1 + : 6.1.1
read_config - : 6.1.14 + : 6.1.14
read_savefile - : 6.1 + : 6.1
refresh - : 6.1.14 + : 6.1.14
refresh_stylelist - : 6.1 + : 6.1
reg - : 6.2.3 -
region_activated_hook - : 6.8 -
region_activity_hook - : 6.8 + : 6.2.3
region_do_warp_alt - : 6.8 -
region_inactivated_hook - : 6.8 -
region_list - : 6.1 + : 6.8 +
region_i + : 6.1 +
region_notify_hook + : 6.8
request_selection - : 6.1 + : 6.1
reset - : 6.7 + : 6.7
resign - : 6.1 + : 6.1
resize - : 6.1.8 - | 6.5.1 + : 6.1.8 + | 6.5.1
restart - : 6.1 + : 6.1
restart_other - : 6.1 + : 6.1
role
-
winprop : 3.5.1 +
winprop : 3.5.1
root window : 2.2.1
rootwin_of - : 6.1.9 + : 6.1.9
rqclose - : 6.1.9 + : 6.1.9
rqclose_propagate - : 6.1.9 + : 6.1.9
rqgeom - : 6.1.9 - | 6.2.1 + : 6.1.9 + | 6.2.1
rqorder - : 6.1.9 + : 6.1.9
screen
physical : 2.2.1
X : 2.2.1
screen_managed_changed_hook - : 6.8 + : 6.8
screen_of - : 6.1.9 + : 6.1.9
scrolldown - : 6.3.3 + : 6.3.3
ScrollLock - : 3.3.5 + : 3.3.5
scrollup - : 6.3.3 + : 6.3.3
select_engine - : 6.1.14 + : 6.1.14
select_next - : 6.4.1 + : 6.4.1
select_nth - : 6.4.1 + : 6.4.1
select_prev - : 6.4.1 + : 6.4.1
set - : 6.1 - | 6.2 - | 6.3 - | 6.4 - | 6.5.1 + : 6.1 + | 6.2 + | 6.3 + | 6.4 + | 6.5.1
set_activity - : 6.1.9 + : 6.1.9
set_completions - : 6.3.1 + : 6.3.1
set_context - : 6.3.2 + : 6.3.2
set_floating - : 6.2.5 + : 6.2.5
set_floating_at - : 6.2.5 + : 6.2.5
set_floating_shown_on - : 6.5 + : 6.5
set_fullscreen - : 6.1.1 -
set_get_winprop_fn - : 6.1 + : 6.1.3
set_hidden - : 6.1.7 + : 6.1.7
set_index - : 6.1.7 + : 6.1.7
set_managed_offset - : 6.1.11 + : 6.1.11
set_mark - : 6.3.2 + : 6.3.2
set_mode - : 6.1.2 + : 6.1.2
set_name - : 6.1.9 + : 6.1.9
set_name_exact - : 6.1.9 + : 6.1.9
set_numbers - : 6.1.2 + : 6.1.2
set_paths - : 6.1 + : 6.1
set_selection - : 6.1 + : 6.1
set_shaded - : 6.1.2 + : 6.1.2
set_shown - : 6.6 + : 6.6
set_shown_on - : 6.6 + : 6.6
set_stdisp - : 6.1.7 + : 6.1.7
set_tagged - : 6.1.9 + : 6.1.9
set_text - : 6.1.6 + : 6.1.6
shell_safe - : 6.1.15 + : 6.1.15
Shift - : 3.3.5 + : 3.3.5
show_about_ion - : 6.3 + : 6.3
show_tree - : 6.3 + : 6.3
shutdown - : 6.1 + : 6.1
size_hints - : 6.1.9 + : 6.1.9
skip_word - : 6.3.2 + : 6.3.2
snapshot - : 6.1 + : 6.1
split - : 6.2.5 + : 6.2.5
split_at - : 6.2.5 + : 6.2.5
split_top - : 6.2.5 + : 6.2.5
split_tree - : 6.2.5 + : 6.2.5 +
statusbar + : 3.5
string
-
shell_safe : 6.1.15 +
shell_safe : 6.1.15
style - : 4.1 + : 4.1
submap - : 6.1 + : 6.1
submenu - : 3.4.1 - | 6.1 + : 3.4.1 + | 6.1
substyle - : 4.1 - | 6.7 + : 4.1 + | 6.7
switch_next - : 6.1.7 + : 6.1.7
switch_nth - : 6.1.7 + : 6.1.7
switch_prev - : 6.1.7 + : 6.1.7
switchto - : 3.5 + : 3.5
system.mk - : 3.1 + : 3.1
table
-
append : 6.1.16 -
copy : 6.1.16 -
icat : 6.1.16 -
join : 6.1.16 -
map : 6.1.16 +
append : 6.1.16 +
copy : 6.1.16 +
icat : 6.1.16 +
join : 6.1.16 +
map : 6.1.16
-
tagged_list - : 6.1 -
tags_first - : 6.1 +
tagged_first + : 6.1 +
tagged_i + : 6.1
target - : 3.5 + : 3.5
tiling_placement_alt - : 6.8 + : 6.8
tl - : 6.2.4 + : 6.2.4
TR - : 6.1 + : 6.1
transient - : 3.5.2 + : 3.5.2
transient_mode - : 3.5 + : 3.5
transients_at_top - : 3.5 + : 3.5
transparent - : 3.5 + : 3.5
transpose - : 6.2.1 + : 6.2.1
transpose_at - : 6.2.5 + : 6.2.5
transpose_chars - : 6.3.2 + : 6.3.2
transpose_words - : 6.3.2 + : 6.3.2
typeahead_clear - : 6.4.1 + : 6.4.1
unsplit_at - : 6.2.5 + : 6.2.5
version - : 6.1 + : 6.1
warn - : 6.1 - | 6.3 + : 6.1 + | 6.3
warn_traced - : 6.1 + : 6.1
WClientWin - : 2.2.1 + : 2.2.1
-
get_ident : 6.1.1 -
is_fullscreen : 6.1.1 -
kill : 6.1.1 -
nudge : 6.1.1 -
quote_next : 6.1.1 -
set_fullscreen : 6.1.1 -
xid : 6.1.1 +
get_ident : 6.1.1 +
kill : 6.1.1 +
nudge : 6.1.1 +
quote_next : 6.1.1 +
xid : 6.1.1
WComplProxy
-
set_completions : 6.3.1 +
set_completions : 6.3.1
WDock
-
attach : 6.5.1 -
get : 6.5.1 -
resize : 6.5.1 -
set : 6.5.1 +
attach : 6.5.1 +
get : 6.5.1 +
resize : 6.5.1 +
set : 6.5.1
WEdln - : 2.2.1 + : 2.2.1
-
back : 6.3.2 -
backspace : 6.3.2 -
bkill_word : 6.3.2 -
bol : 6.3.2 -
bskip_word : 6.3.2 -
clear_mark : 6.3.2 -
complete : 6.3.2 -
contents : 6.3.2 -
context : 6.3.2 -
copy : 6.3.2 -
cut : 6.3.2 -
delete : 6.3.2 -
eol : 6.3.2 -
finish : 6.3.2 -
forward : 6.3.2 -
history_next : 6.3.2 -
history_prev : 6.3.2 -
insstr : 6.3.2 -
is_histcompl : 6.3.2 -
kill_line : 6.3.2 -
kill_to_bol : 6.3.2 -
kill_to_eol : 6.3.2 -
kill_word : 6.3.2 -
mark : 6.3.2 -
next_completion : 6.3.2 -
paste : 6.3.2 -
point : 6.3.2 -
prev_completion : 6.3.2 -
set_context : 6.3.2 -
set_mark : 6.3.2 -
skip_word : 6.3.2 -
transpose_chars : 6.3.2 -
transpose_words : 6.3.2 +
back : 6.3.2 +
backspace : 6.3.2 +
bkill_word : 6.3.2 +
bol : 6.3.2 +
bskip_word : 6.3.2 +
clear_mark : 6.3.2 +
complete : 6.3.2 +
contents : 6.3.2 +
context : 6.3.2 +
copy : 6.3.2 +
cut : 6.3.2 +
delete : 6.3.2 +
eol : 6.3.2 +
finish : 6.3.2 +
forward : 6.3.2 +
history_next : 6.3.2 +
history_prev : 6.3.2 +
insstr : 6.3.2 +
is_histcompl : 6.3.2 +
kill_line : 6.3.2 +
kill_to_bol : 6.3.2 +
kill_to_eol : 6.3.2 +
kill_word : 6.3.2 +
mark : 6.3.2 +
next_completion : 6.3.2 +
paste : 6.3.2 +
point : 6.3.2 +
prev_completion : 6.3.2 +
set_context : 6.3.2 +
set_mark : 6.3.2 +
skip_word : 6.3.2 +
transpose_chars : 6.3.2 +
transpose_words : 6.3.2
WFrame - : 2.2.1 + : 2.2.1
-
is_shaded : 6.1.2 -
maximize_horiz : 6.1.2 -
maximize_vert : 6.1.2 -
mode : 6.1.2 -
p_switch_tab : 6.1.2 -
p_tabdrag : 6.1.2 -
set_mode : 6.1.2 -
set_numbers : 6.1.2 -
set_shaded : 6.1.2 +
is_shaded : 6.1.2 +
maximize_horiz : 6.1.2 +
maximize_vert : 6.1.2 +
mode : 6.1.2 +
p_switch_tab : 6.1.2 +
p_tabdrag : 6.1.2 +
set_mode : 6.1.2 +
set_numbers : 6.1.2 +
set_shaded : 6.1.2
WGroup - : 2.2.1 + : 2.2.1
-
attach : 6.1.3 -
attach_new : 6.1.3 -
bottom : 6.1.3 -
managed_list : 6.1.3 +
attach : 6.1.3 +
attach_new : 6.1.3 +
bottom : 6.1.3 +
is_fullscreen : 6.1.3 +
managed_i : 6.1.3 +
set_fullscreen : 6.1.3
WGroupCW - : 2.2.1 -
WGroupWS : 2.2.1 +
WGroupWS + : 2.2.1
-
attach_framed : 6.1.5 +
attach_framed : 6.1.5
WInfoWin
-
set_text : 6.1.6 +
set_text : 6.1.6
Winprops - : 3.5 + : 3.5
WInput - : 2.2.1 + : 2.2.1
-
cancel : 6.3.3 -
scrolldown : 6.3.3 -
scrollup : 6.3.3 +
cancel : 6.3.3 +
scrolldown : 6.3.3 +
scrollup : 6.3.3
WMenu
-
cancel : 6.4.1 -
finish : 6.4.1 -
select_next : 6.4.1 -
select_nth : 6.4.1 -
select_prev : 6.4.1 -
typeahead_clear : 6.4.1 +
cancel : 6.4.1 +
finish : 6.4.1 +
select_next : 6.4.1 +
select_nth : 6.4.1 +
select_prev : 6.4.1 +
typeahead_clear : 6.4.1
WMessage - : 2.2.1 + : 2.2.1
WMoveresMode
-
cancel : 6.1.8 -
finish : 6.1.8 -
move : 6.1.8 -
resize : 6.1.8 +
cancel : 6.1.8 +
finish : 6.1.8 +
move : 6.1.8 +
resize : 6.1.8
WMPlex
-
attach : 6.1.7 -
attach_new : 6.1.7 -
attach_tagged : 6.1.7 -
dec_index : 6.1.7 -
get_index : 6.1.7 -
get_stdisp : 6.1.7 -
inc_index : 6.1.7 -
is_hidden : 6.1.7 -
managed_list : 6.1.7 -
mx_count : 6.1.7 -
mx_current : 6.1.7 -
mx_list : 6.1.7 -
mx_nth : 6.1.7 -
set_hidden : 6.1.7 -
set_index : 6.1.7 -
set_stdisp : 6.1.7 -
switch_next : 6.1.7 -
switch_nth : 6.1.7 -
switch_prev : 6.1.7 +
attach : 6.1.7 +
attach_new : 6.1.7 +
attach_tagged : 6.1.7 +
dec_index : 6.1.7 +
get_index : 6.1.7 +
get_stdisp : 6.1.7 +
inc_index : 6.1.7 +
is_hidden : 6.1.7 +
managed_i : 6.1.7 +
mx_count : 6.1.7 +
mx_current : 6.1.7 +
mx_i : 6.1.7 +
mx_nth : 6.1.7 +
set_hidden : 6.1.7 +
set_index : 6.1.7 +
set_stdisp : 6.1.7 +
switch_next : 6.1.7 +
switch_nth : 6.1.7 +
switch_prev : 6.1.7
WRegion - : 2.2.1 + : 2.2.1
-
begin_kbresize : 6.1.9 -
current : 6.1.9 -
geom : 6.1.9 -
goto : 6.1.9 -
is_active : 6.1.9 -
is_activity : 6.1.9 -
is_mapped : 6.1.9 -
is_tagged : 6.1.9 -
manager : 6.1.9 -
name : 6.1.9 -
parent : 6.1.9 -
rootwin_of : 6.1.9 -
rqclose : 6.1.9 -
rqclose_propagate : 6.1.9 -
rqgeom : 6.1.9 -
rqorder : 6.1.9 -
screen_of : 6.1.9 -
set_activity : 6.1.9 -
set_name : 6.1.9 -
set_name_exact : 6.1.9 -
set_tagged : 6.1.9 -
size_hints : 6.1.9 +
begin_kbresize : 6.1.9 +
current : 6.1.9 +
geom : 6.1.9 +
goto : 6.1.9 +
is_active : 6.1.9 +
is_activity : 6.1.9 +
is_mapped : 6.1.9 +
is_tagged : 6.1.9 +
manager : 6.1.9 +
name : 6.1.9 +
parent : 6.1.9 +
rootwin_of : 6.1.9 +
rqclose : 6.1.9 +
rqclose_propagate : 6.1.9 +
rqgeom : 6.1.9 +
rqorder : 6.1.9 +
screen_of : 6.1.9 +
set_activity : 6.1.9 +
set_name : 6.1.9 +
set_name_exact : 6.1.9 +
set_tagged : 6.1.9 +
size_hints : 6.1.9
write_savefile - : 6.1 + : 6.1
WRootWin - : 2.2.1 + : 2.2.1
-
current_scr : 6.1.10 +
current_scr : 6.1.10
WScreen - : 2.2.1 + : 2.2.1
-
id : 6.1.11 -
set_managed_offset : 6.1.11 +
id : 6.1.11 +
set_managed_offset : 6.1.11
WSplit - : 2.2.1 + : 2.2.1
-
geom : 6.2.1 -
parent : 6.2.1 -
rqgeom : 6.2.1 -
transpose : 6.2.1 +
geom : 6.2.1 +
parent : 6.2.1 +
rqgeom : 6.2.1 +
transpose : 6.2.1
WSplitInner
-
current : 6.2.2 +
current : 6.2.2
WSplitRegion
-
reg : 6.2.3 +
reg : 6.2.3
WSplitSplit
-
br : 6.2.4 -
dir : 6.2.4 -
flip : 6.2.4 -
tl : 6.2.4 +
br : 6.2.4 +
dir : 6.2.4 +
flip : 6.2.4 +
tl : 6.2.4
WTiling - : 2.2.1 + : 2.2.1
-
farthest : 6.2.5 -
flip_at : 6.2.5 -
managed_list : 6.2.5 -
nextto : 6.2.5 -
node_of : 6.2.5 -
set_floating : 6.2.5 -
set_floating_at : 6.2.5 -
split : 6.2.5 -
split_at : 6.2.5 -
split_top : 6.2.5 -
split_tree : 6.2.5 -
transpose_at : 6.2.5 -
unsplit_at : 6.2.5 +
farthest : 6.2.5 +
flip_at : 6.2.5 +
managed_i : 6.2.5 +
nextto : 6.2.5 +
node_of : 6.2.5 +
set_floating : 6.2.5 +
set_floating_at : 6.2.5 +
split : 6.2.5 +
split_at : 6.2.5 +
split_top : 6.2.5 +
split_tree : 6.2.5 +
transpose_at : 6.2.5 +
unsplit_at : 6.2.5
WWindow - : 2.2.1 + : 2.2.1
-
p_move : 6.1.12 -
p_resize : 6.1.12 -
xid : 6.1.12 +
p_move : 6.1.12 +
p_resize : 6.1.12 +
xid : 6.1.12
x_change_property - : 6.1 + : 6.1
x_delete_property - : 6.1 + : 6.1
x_get_atom_name - : 6.1 + : 6.1
x_get_text_property - : 6.1 + : 6.1
x_get_window_property - : 6.1 + : 6.1
x_intern_atom - : 6.1 + : 6.1
x_set_text_property - : 6.1 + : 6.1
xid - : 6.1.1 - | 6.1.12 + : 6.1.1 + | 6.1.12
Xinerama : 2.2.1
xmodmap - : 3.3.5 + : 3.3.5
xprop - : 3.5.2 + : 3.5.2
diff --git a/doc/ionconf/node12.html b/doc/ionconf/node12.html index 90201d6..b55a763 100644 --- a/doc/ionconf/node12.html +++ b/doc/ionconf/node12.html @@ -70,7 +70,7 @@ Mathematics Department, Macquarie University, Sydney. The command line arguments were:
latex2html -show_section_numbers -short_index -local_icons -noaddress -up_url http://iki.fi/tuomov/ion/ -up_title 'Ion homepage' -nofootnode -split 3 ionconf

-The translation was initiated by tuomov on 2006-12-23 +The translation was initiated by tuomov on 2007-02-03


diff --git a/doc/ionconf/node3.html b/doc/ionconf/node3.html index f3dbd29..cc7578a 100644 --- a/doc/ionconf/node3.html +++ b/doc/ionconf/node3.html @@ -227,7 +227,7 @@ implement.

-

+
+ Substyle attributes: active/inactive + (mutually exclusive) and + quasiactive/not_quasiactive. + A frame is ``quasiactive'' when an active region + has a backlink to it, such as a detached window. + Substyle attributes as for frame. + Substyle attributes: + active/inactive and + selected/unselected + Additional substyle attributes include: + tagged/not_tagged, + dragged/not_dragged, + activity/no_activity and + quasiactive/not_quasiactive. @@ -268,7 +271,9 @@ tag and drag states.) different modes. - + @@ -291,7 +296,7 @@ tag and drag states.) @@ -335,7 +340,7 @@ and should usually be symlinked to or a copy of of some

-The first thing to do in a stylefile is to choose the drawing +The first thing to do in a style file is to choose the drawing engine, possibly loading the module as well. This is done with the following chunk of code. @@ -407,7 +412,7 @@ border elements and styles referred to there are explained in Figure

-

+
Figure 2.1: Partial Ioncore, mod_tiling and mod_query @@ -237,10 +237,10 @@ Partial Ioncore, mod_tiling and +
Is the base of Ion's object system.

WRegion
-
+
is the base class for everything corresponding to something on the screen. Each object of type WRegion has a size and position relative to the parent WRegion. While a big part of Ion @@ -277,27 +277,27 @@ The core classes:

WClientWin
-
is a class for +
is a class for client window objects, the objects that window managers are supposed to manage.

WWindow
-
is the base class for all +
is the base class for all internal objects having an X window associated to them (WClientWins also have X windows associated to them).

WRootWin
-
is the class for +
is the class for root windows of X screens. Note that an ''X screen'' or root window is not necessarily a single physical screen as a root window - may be split over multiple screens when multi-head extensions - such as Xinerama are used. (Actually there - can be only one WRootWin when Xinerama is used.) + may be split over multiple screens when hacks such as + Xinerama are used. (Actually there can be only + one root window when Xinerama is used.)

@@ -310,15 +310,14 @@ The core classes:

WScreen
-
is the class for objects +
is the class for objects corresponding to physical screens. Screens may share a root - window when Xinerama multihead extensions are used as explained - above. + window when the Xinerama extension is used as explained above.

WFrame
-
is the class for frames. +
is the class for frames. While most Ion's objects have no graphical presentation, frames basically add to WMPlexes the decorations around client windows (borders, tabs). @@ -326,11 +325,11 @@ The core classes:

WGroup
-
is the base class for groups. +
is the base class for groups. Particular types of groups are workspaces - (WGroupWS) + (WGroupWS) and groups of client windows - (WGroupCW). + (WGroupCW).
@@ -340,12 +339,12 @@ Classes implemented by the mod_tiling module:

WTiling
-
is the class for tilings +
is the class for tilings of frames.
WSplit
-
(or, more specifically, classes +
(or, more specifically, classes that inherit it) encode the WTiling tree structure.
@@ -356,19 +355,19 @@ Classes implemented by the mod_query module:

WInput
-
is a virtual base class for the +
is a virtual base class for the two classes below.
WEdln
-
is the class for the ''queries'', +
is the class for the ''queries'', the text inputs that usually appear at bottoms of frames and sometimes screens. Queries are the functional equivalent of ''mini buffers'' in many text editors.
WMessage
-
implements the boxes for +
implements the boxes for warning and other messages that Ion may wish to display to the user. These also usually appear at bottoms of frames.
@@ -392,7 +391,7 @@ binding callbacks in the move and resize mode. 2.2.2.1 Parent-child relations Each object of type WRegion has a parent and possibly a manager -associated to it. The parent for an object is always a +associated to it. The parent for an object is always a WWindow and for WRegion with an X window (WClientWin, WWindow) the parent WWindow is given by the same relation of the X windows. For other WRegions the relation is not as clear. @@ -402,7 +401,7 @@ Figure 2.2.

-

+
@@ -423,7 +422,7 @@ Most common parent-child relations

WRegions have very little control over their children as a parent. -The manager WRegion has much more control over its +The manager WRegion has much more control over its managed WRegions. Managers, for example, handle resize requests, focusing and displaying of the managed regions. Indeed the manager--managed relationship gives a better picture of the logical ordering of objects on @@ -441,7 +440,7 @@ but all have a parent-a screen if not anything else.

-

+
Figure 2.2: Most common parent-child relations
diff --git a/doc/ionconf/node4.html b/doc/ionconf/node4.html index 60acef3..d156abd 100644 --- a/doc/ionconf/node4.html +++ b/doc/ionconf/node4.html @@ -153,9 +153,9 @@ explained. For a reference on exported functions, see section Ion3, to which document applies, stores its stock configuration files in /usr/local/etc/ion3/ unless you, the OS package maintainer or whoever installed the package on the system has modified the variables -PREFIX or -ETCDIR in -system.mk before compiling Ion. +PREFIX or +ETCDIR in +system.mk before compiling Ion. In the first case you probably know where to find the files and in the other case the system administrator or the OS package maintainer should have provided documentation to point to the correct location. @@ -573,8 +573,8 @@ defbindings("WFrame", { As seen above, the functions that create key binding specifications require a keyspec argument. This argument should be a string containing the name of a key as listed in the X header file keysymdef.h3.1 without the XK_ prefix. - + HREF="#foot857">3.1 without the XK_ prefix. + Most of the key names are quite intuitive while some are not. For example, the Enter key on the main part of the keyboard has the less common name Return while the one the numpad is called KP_Enter. @@ -586,23 +586,23 @@ modifiers:
Shift, Control, Mod1 to Mod5, AnyModifier and Lock. + -

X allows binding all of these modifiers to almost any key and while this list of modifiers does not explicitly list keys such as -Alt that are common on modern keyboards, such +Alt that are common on modern keyboards, such keys are bound to one of the ModN. On systems running XFree86 Alt is usually Mod1. On Suns Mod1 is the diamond key and Alt something else. One of the ''flying window'' keys on so called Windows-keyboards is probably mapped to Mod3 if you have -such a key. Use the program xmodmap +such a key. Use the program xmodmap to find out what exactly is bound where.

@@ -614,10 +614,10 @@ default.

Ion ignores the Lock modifier and any ModN () -bound to NumLock or -ScrollLock +bound to NumLock or +ScrollLock by default because such3.2 locking keys may otherwise + HREF="#foot836">3.2 locking keys may otherwise cause confusion.

@@ -630,7 +630,7 @@ cause confusion. Button specifications are similar to key definitions but now instead of specifying modifiers and a key, you specify modifiers and one of the button names Button1 to -Button5. Additionally the +Button5. Additionally the specification may end with an optional area name following an @-sign. Only frames currently support areas, and the supported values in this case are @@ -681,10 +681,10 @@ to it is available virtually everywhere.

- - + + In the stock configuration file setup, menus are defined in the file cfg_menus.lua as previously mentioned. The mod_menu module must be loaded for one to be able to define menus, and this is done with @@ -739,6 +739,13 @@ just like the menus defined as above.

+ + + + + + @@ -814,7 +821,7 @@ handlers (and elsewhere): after which the selected entry is activated. This function is meant to be used for implementing, for example, Win***s-style Alt-Tab handling.3.3 + HREF="#foot1174">3.3
Figure 2.3: Most common manager-managed relations
workspacelist List of all workspaces. Activating an entry jumps to that workspaces.
focuslistList of client windows with recent activity in them, followed by + previously focused client windows.
focuslist_List of previously focused client windows.
stylemenu List of available look_*.lua style files. Activating an entry loads that style and ask to save the selection.
@@ -842,7 +849,7 @@ defbindings("WFrame", {

-The so-called ''winprops'' can be used to change how +The so-called ''winprops'' can be used to change how specific windows are handled and to set up some kludges to deal with badly behaving applications. They are defined by calling the function defwinprop with a table containing the properties to set and the @@ -860,7 +867,7 @@ usual method of identifying windows, and how to obtain this information.

Description:
-
+
Set this to true for Acrobat Reader. It has an annoying habit of trying to manage its dialogs instead of setting them as transients and letting the window manager do its job, causing @@ -878,7 +885,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
The table should contain the entries w and h that override application-supplied aspect ratio hint. @@ -893,7 +900,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Set this to open the window in a floating frame, when in a group. @@ -908,7 +915,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Should the window be initially in full screen mode?
@@ -922,7 +929,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Should configure requests on the window be ignored? Only has effect on floating windows. @@ -937,7 +944,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Ignore extended WM hints _NET_ACTIVE_WINDOW request.
@@ -951,7 +958,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Should application supplied size increments be ignored?
@@ -965,7 +972,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Should a newly created client window always be made active, even if the allocated frame isn't. @@ -980,7 +987,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
The table should contain the entries w and h that override application-supplied maximum size hint. @@ -995,12 +1002,31 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Similar to max_size but for the minimum size hint.
+

+ +

+
Winprop:
+
new_group (string) + +
+
Description:
+
+ If the region specified by target winprop does not exist + (or that winprop is not set), create a new workspace using the + previously stored layout (see ioncore.deflayout) named by + this property. After creating the workspace, target is + attempted to be found again. (If that still fails, the newly + created workspace is still asked to manage the client window.) + +
+
+

@@ -1009,12 +1035,29 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Discard this winprop after first use.
+

+ +

+
Winprop:
+
statusbar (string) + +
+
Description:
+
+ Put the window on the statusbar, in the named tray component, + (The default tray component is called simply ``systray'', + and others you give names to in your custom template, always + prefixed by ``systray_''. + +
+
+

@@ -1023,7 +1066,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Should a newly mapped client window be switched to within its frame. @@ -1038,9 +1081,9 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
The name of an object (workspace, frame) that should manage - windows of this type. + windows of this type. See also new_group.
@@ -1053,7 +1096,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
"normal": No change in behaviour. "current": The window should be thought of as a transient for the current active client window (if any) even if it is not marked as a @@ -1072,7 +1115,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
When transients are managed by the client window itself (as it is the case on tiled workspaces), should the transients be placed at the top of the window instead of bottom? @@ -1088,7 +1131,7 @@ usual method of identifying windows, and how to obtain this information.
Description:
-
+
Should frames be made transparent when this window is selected?
@@ -1105,9 +1148,9 @@ usual method of identifying windows, and how to obtain this information.

The identification information in the winprop specification is usually the -class, -role, -instance and +class, +role, +instance and name of the window. The name field is a Lua-style regular expression matched against the window's title and the rest are strings that must @@ -1190,7 +1233,7 @@ can be used to list the identification information required to set winprops for a window and all the transient windows managed within it.

- + Another way to get the identification information is to use xprop. Simply run To get class and instance, simply run xprop WM_CLASS and click on the particular window of interest. The class is the latter of @@ -1199,7 +1242,7 @@ windows have this property - use the command xprop WM_ROLE. This method, however, will not work on transients.

- + So-called ''transient windows'' are usually short-lived dialogs (although some programs abuse this property) that have a parent window that they are ''transient for''. On tiled workspaces Ion displays these windows @@ -1208,7 +1251,7 @@ Unfortunately xprop is stupid and can't cope with this situation, returning the parent window's properties when the transient is clicked on. For this reason you'll have to do a little extra work to get the properties for that window.3.4 + HREF="#foot1451">3.4

Finally, it should be mentioned that too many authors these days ''forget'' to set this vital identification to anything meaningful: @@ -1308,26 +1351,26 @@ default name formed from the frame's class name and an instance number.



Footnotes

-
...keysymdef.h...keysymdef.h3.1
This file can usually be found in the directory /usr/X11R6/include/X11/.
-
... such... such3.2
Completely useless keys that should be gotten rid of in the author's opinion.
-
... handling.... handling.3.3
See the wcirculate.lua script in the Ion scripts repository http://iki.fi/tuomov/repos/ion-scripts-3/.
-
... window.... window.3.4
There's a patch to xprop to fix this, but nothing seems to be happening with respect to including it in diff --git a/doc/ionconf/node5.html b/doc/ionconf/node5.html index b6951d4..da15f29 100644 --- a/doc/ionconf/node5.html +++ b/doc/ionconf/node5.html @@ -125,7 +125,7 @@ for the default drawing engine.

- +
4.1 Drawing engines, style specifications and sub-styles

@@ -169,7 +169,6 @@ foo-bar-baz foo-*-baz foo-bar * -foo-baz -- Doesn't match, not selected!

@@ -178,7 +177,7 @@ specified, also in the form

 attr1-attr2-...-attrn
 
-These extra attributes are called substyles +These extra attributes are called substyles and allow, for example, the state of the object to be indicated by different colour sets while keeping the interface at an abstract level and the drawing engine completely ignorant @@ -209,11 +208,15 @@ tag and drag states.)
frame Style for frames. - Substyles: active, inactive.
frame-tiled A more specific style for tiled frames. - Substyles as for frame.
frame-tiled-alt An alternative style for tiled frames. @@ -242,17 +245,17 @@ tag and drag states.)
tab Style for frames' tabs and menu entries. - Substyles: combinations of the form a-s where - a is one of active/inactive and - s is one of selected/unselected
tab-frame A more specific style for frames' tabs. - Substyles: combinations of the form a-s-t-d-u where - a and s are as above and - t is one of tagged/not_tagged, - d is one of dragged/not_dragged and - u is one of activity/no_activity.
tab-frame-tiled,  
tab-menuentryA more specific style for entries in WMenus.A more specific style for entries in WMenus. + Additional substyle attributes include submenu and + occasionally also activity is used.
tab-menuentry-bigmenu An alternate style for entries in WMenus.
input-edln A more specific style for WEdlns. - Substyles: selection for selected text and + Substyle attributes: selection for selected text and cursor for the cursor indicating current editing point.
input-message
diff --git a/doc/ionconf/node6.html b/doc/ionconf/node6.html index b1bbe8b..8c985d1 100644 --- a/doc/ionconf/node6.html +++ b/doc/ionconf/node6.html @@ -180,11 +180,11 @@ end

If you want to a single non-WClientWin region with an exact known name, use ioncore.lookup_region. If you want a list of all regions, -use ioncore.region_list. Both functions accept an optional argument +use ioncore.region_list. Both functions accept an optional argument that can be used to specify that the returned region(s) must be of a more specific type. Client windows live in a different namespace and for them you should use the equivalent functions ioncore.lookup_clientwin -and ioncore.clientwin_list. +and ioncore.clientwin_list.

To get the name of an object, use WRegion.name. Please be diff --git a/doc/ionconf/node7.html b/doc/ionconf/node7.html index 5a3e390..628a670 100644 --- a/doc/ionconf/node7.html +++ b/doc/ionconf/node7.html @@ -163,8 +163,8 @@ original version by: Nikos Drakos, CBLU, University of Leeds

-
- +
+
Synopsis:
@@ -180,8 +180,8 @@ original version by: Nikos Drakos, CBLU, University of Leeds

-
- +
+
Synopsis:
@@ -198,8 +198,8 @@ original version by: Nikos Drakos, CBLU, University of Leeds

-
- +
+
Synopsis:
@@ -215,8 +215,8 @@ original version by: Nikos Drakos, CBLU, University of Leeds

-
- +
+
Synopsis:
@@ -242,18 +242,18 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
-
ioncore.create_ws(scr, tmpl, no_default) +
ioncore.create_ws(scr, tmpl, layout)
Description:
Create new workspace on screen scr. The table tmpl - may be used to override parts of default_ws_params, - and no_default may be set to true to complete ignore it. + may be used to override parts of the layout named with layout. + If no layout is given, "default" is used.
@@ -261,8 +261,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -280,8 +280,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -298,8 +298,27 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+ + +
+
Synopsis:
+
ioncore.deflayout(name, tab) + +
+
Description:
+
Define a new workspace layout with name name, and + attach/creation parameters given in tab. The layout + "empty" may not be defined. + +
+
+ +

+ +

+
+
Synopsis:
@@ -317,8 +336,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -334,8 +353,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -357,8 +376,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -374,8 +393,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -392,8 +411,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -410,8 +429,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -428,8 +447,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -446,8 +465,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -463,8 +482,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -480,8 +499,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -497,8 +516,26 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+ + +
+
Synopsis:
+
ioncore.getlayout(name, all) + +
+
Description:
+
Get named layout (or all of the latter parameter is set, + but this is for internal use only). + +
+
+ +

+ +

+
+
Synopsis:
@@ -514,8 +551,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -531,8 +568,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -548,8 +585,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -565,16 +602,18 @@ The string guard maybe set to pose limits on _sub. Currently

-
- - +
+ +
Synopsis:
-
table ioncore.activity_list() +
bool ioncore.activity_i(function iterfn)
Description:
-
Return list of regions with activity/urgency bit set. +
Iterate over activity list until iterfn returns false. + The function itself returns true if it reaches the end of list + without this happening.
@@ -582,8 +621,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -599,16 +638,18 @@ The string guard maybe set to pose limits on _sub. Currently

-
- - +
+ +
Synopsis:
-
table ioncore.clientwin_list() +
bool ioncore.clientwin_i(function fn)
Description:
-
Return a list of all client windows. +
Iterate over client windows until iterfn returns false. + The function itself returns true if it reaches the end of list + without this happening.
@@ -616,8 +657,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -633,8 +674,8 @@ The string guard maybe set to pose limits on _sub. Currently

-
- +
+
Synopsis:
@@ -687,8 +728,32 @@ Similarly to sed's 's' command, rule may contain characters that are

-
- +
+ + +
+
Synopsis:
+
bool ioncore.detach(WRegion reg, string how) + +
+
Description:
+
Detach or reattach reg, depending on whether how + is 'set'/'unset'/'toggle'. (Detaching means making reg + managed by its nearest ancestor WGroup, framed if reg is + not itself WFrame. Reattaching means making it managed where + it used to be managed, if a return-placeholder exists.) + If reg is the 'bottom' of some group, the whole group is + detached. If reg is a WWindow, it is put into a + frame. + +
+
+ +

+ +

+
+
Synopsis:
@@ -707,8 +772,8 @@ Similarly to sed's 's' command, rule may contain characters that are

-
- +
+
Synopsis:
@@ -716,10 +781,26 @@ Similarly to sed's 's' command, rule may contain characters that are
Description:
-
Find the screen with numerical id id. If Xinerama is - not present, id corresponds to X screen numbers. Otherwise - the ids are some arbitrary ordering of Xinerama rootwins. - If id is , the screen with the highest id is returned. +
Find the screen with numerical id id. + +
+
+ +

+ +

+
+ + +
+
Synopsis:
+
bool ioncore.focushistory_i(function iterfn) + +
+
Description:
+
Iterate over focus history until iterfn returns false. + The function itself returns true if it reaches the end of list + without this happening.
@@ -727,8 +808,8 @@ Similarly to sed's 's' command, rule may contain characters that are

-
- +
+
Synopsis:
@@ -744,8 +825,8 @@ Similarly to sed's 's' command, rule may contain characters that are

-
- +
+
Synopsis:
@@ -761,8 +842,8 @@ Similarly to sed's 's' command, rule may contain characters that are

-
- +
+
Synopsis:
@@ -778,8 +859,8 @@ Similarly to sed's 's' command, rule may contain characters that are

-
- +
+
Synopsis:
@@ -799,8 +880,8 @@ Similarly to sed's 's' command, rule may contain characters that are

-
- +
+
Synopsis:
@@ -820,8 +901,8 @@ Similarly to sed's 's' command, rule may contain characters that are

-
- +
+
Synopsis:
@@ -841,8 +922,8 @@ Note that this function is asynchronous; the screen will not

-
- +
+
Synopsis:
@@ -862,8 +943,8 @@ Note that this function is asynchronous; the screen will not

-
- +
+
Synopsis:
@@ -883,8 +964,8 @@ Note that this function is asynchronous; the screen will not

-
- +
+
Synopsis:
@@ -904,8 +985,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -921,8 +1002,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -938,8 +1019,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -955,8 +1036,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -973,8 +1054,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -992,8 +1073,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -1015,8 +1096,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -1034,8 +1115,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -1051,16 +1132,19 @@ Note that this function is asynchronous; the region will not

-
- - +
+ +
Synopsis:
-
table ioncore.region_list(string typenam) +
bool ioncore.region_i(function fn, string typenam)
Description:
-
Find all non-client window regions inheriting typenam. +
Iterate over all non-client window regions with (inherited) class + typenam until iterfn returns false. + The function itself returns true if it reaches the end of list + without this happening.
@@ -1068,8 +1152,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -1086,8 +1170,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -1104,8 +1188,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -1121,8 +1205,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -1138,8 +1222,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -1208,10 +1292,6 @@ Note that this function is asynchronous; the region will not One of ''udlr'' (up-down, then left-right), ''lrud'' (left-right, then up-down) or ''random''. -
- -
Figure 4.1: Sketch of different border styles and elements
default_ws_params(table) Default workspace layout; the - attach/creation parameters for a WGroup.

@@ -1229,25 +1309,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- - -
-
Synopsis:
-
void ioncore.set_get_winprop_fn(function fn) - -
-
Description:
-
Set function used to look up winprops. - -
-
- -

- -

-
- +
+
Synopsis:
@@ -1263,8 +1326,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1280,8 +1343,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1297,8 +1360,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1314,16 +1377,16 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- - +
+ +
Synopsis:
-
table ioncore.tagged_list() +
WRegion ioncore.tagged_first()
Description:
-
Returns a list of tagged regions. +
Returns first tagged object.
@@ -1331,16 +1394,18 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- - +
+ +
Synopsis:
-
WRegion ioncore.tags_first() +
bool ioncore.tagged_i(function iterfn)
Description:
-
Returns first tagged object. +
Iterate over tagged regions until iterfn returns false. + The function itself returns true if it reaches the end of list + without this happening.
@@ -1348,8 +1413,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1365,8 +1430,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1383,8 +1448,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1400,8 +1465,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1420,8 +1485,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1437,8 +1502,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1455,8 +1520,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1475,8 +1540,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1497,8 +1562,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1514,8 +1579,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1533,8 +1598,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1552,8 +1617,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1572,8 +1637,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1589,8 +1654,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1609,8 +1674,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1627,8 +1692,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1648,8 +1713,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1668,8 +1733,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1686,8 +1751,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1703,8 +1768,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1723,8 +1788,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1752,8 +1817,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1772,25 +1837,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- - -
-
Synopsis:
-
bool WClientWin.is_fullscreen(WClientWin cwin) - -
-
Description:
-
Is cwin in full screen mode? - -
-
- -

- -

-
- +
+
Synopsis:
@@ -1807,8 +1855,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1825,8 +1873,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1842,27 +1890,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- - -
-
Synopsis:
-
bool WClientWin.set_fullscreen(WClientWin cwin, string how) - -
-
Description:
-
Set client window cwin full screen state according to the - parameter how (set/unset/toggle). Resulting state is returned, - which may not be what was requested. - -
-
- -

- -

-
- +
+
Synopsis:
@@ -1884,8 +1913,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1901,8 +1930,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1918,8 +1947,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1935,8 +1964,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1952,8 +1981,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1970,8 +1999,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -1989,8 +2018,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -2006,8 +2035,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -2025,8 +2054,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -2050,8 +2079,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -2069,8 +2098,8 @@ When a keyboard resize function is called, and at most kbresize_t_max

-
- +
+
Synopsis:
@@ -2116,8 +2145,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2133,16 +2162,55 @@ In addition parameters to the region to be created are passed in this

-
- - +
+ +
Synopsis:
-
table WGroup.managed_list(WGroup ws) +
bool WGroup.is_fullscreen(WGroup grp)
Description:
-
Returns a list of regions managed by the workspace (frames, mostly). +
Is reg in full screen mode? + +
+
+ +

+ +

+
+ + +
+
Synopsis:
+
bool WGroup.managed_i(WGroup ws, function iterfn) + +
+
Description:
+
Iterate over managed regions of ws until iterfn returns + false. + The function itself returns true if it reaches the end of list + without this happening. + +
+
+ +

+ +

+
+ + +
+
Synopsis:
+
bool WGroup.set_fullscreen(WGroup grp, string how) + +
+
Description:
+
Set client window reg full screen state according to the + parameter how (set/unset/toggle). Resulting state is returned, + which may not be what was requested.
@@ -2162,8 +2230,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2201,8 +2269,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2224,8 +2292,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2243,8 +2311,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2307,8 +2375,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2324,8 +2392,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2341,8 +2409,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2360,8 +2428,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2378,8 +2446,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2395,8 +2463,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2412,16 +2480,19 @@ In addition parameters to the region to be created are passed in this

-
- - +
+ +
Synopsis:
-
table WMPlex.managed_list(WMPlex mplex) +
bool WMPlex.managed_i(WMPlex mplex, function iterfn)
Description:
-
Returns a list of all regions managed by mplex. +
Iterate over managed regions of mplex until iterfn returns + false. + The function itself returns true if it reaches the end of list + without this happening.
@@ -2429,8 +2500,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2446,8 +2517,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2464,17 +2535,19 @@ In addition parameters to the region to be created are passed in this

-
- - +
+ +
Synopsis:
-
table WMPlex.mx_list(WMPlex mplex) +
bool WMPlex.mx_i(WMPlex mplex, function iterfn)
Description:
-
Returns a list of regions on the numbered/mutually exclusive list of - mplex. +
Iterate over numbered/mutually exclusive region list of mplex + until iterfn returns false. + The function itself returns true if it reaches the end of list + without this happening.
@@ -2482,8 +2555,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2500,8 +2573,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2519,8 +2592,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2532,10 +2605,10 @@ In addition parameters to the region to be created are passed in this the mutually exclusive list. Special values for index are: - + - +
After WMPlex.mx_current.Last.
Last.After WMPlex.mx_current.
@@ -2545,8 +2618,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2585,8 +2658,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2603,8 +2676,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2620,8 +2693,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2644,8 +2717,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2662,8 +2735,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2680,8 +2753,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2713,8 +2786,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2739,8 +2812,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2761,8 +2834,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2779,8 +2852,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2797,8 +2870,8 @@ In addition parameters to the region to be created are passed in this

-
- +
+
Synopsis:
@@ -2819,8 +2892,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -2836,8 +2909,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -2853,8 +2926,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -2870,8 +2943,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -2887,8 +2960,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -2904,8 +2977,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -2921,8 +2994,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -2938,8 +3011,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -2955,8 +3028,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -2981,8 +3054,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3002,8 +3075,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3022,8 +3095,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3040,8 +3113,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3057,8 +3130,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3075,8 +3148,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3095,8 +3168,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3114,8 +3187,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3132,8 +3205,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3157,8 +3230,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3180,8 +3253,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3197,8 +3270,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3223,8 +3296,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3242,8 +3315,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3261,8 +3334,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3284,7 +3357,7 @@ Note that this function is asynchronous; the region will not

-
+
Synopsis:
@@ -3306,8 +3379,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3323,8 +3396,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3340,8 +3413,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3367,8 +3440,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3390,8 +3463,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3407,8 +3480,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3425,8 +3498,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3442,8 +3515,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3460,8 +3533,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3483,26 +3556,8 @@ Note that this function is asynchronous; the region will not
-
- - -
-
Synopsis:
-
bool mod_tiling.detach(WRegion reg) - -
-
Description:
-
Detach reg, i.e. make it managed by its nearest ancestor - WGroup, framed if reg is not itself WFrame. - -
-
- -

- -

-
- +
+
Synopsis:
@@ -3518,8 +3573,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3536,8 +3591,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3560,8 +3615,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3577,8 +3632,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3594,8 +3649,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3613,8 +3668,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3636,8 +3691,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3659,8 +3714,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3682,8 +3737,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3700,8 +3755,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3718,8 +3773,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3735,8 +3790,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3759,8 +3814,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3776,8 +3831,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3793,8 +3848,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3813,16 +3868,19 @@ Note that this function is asynchronous; the region will not

-
- - +
+ +
Synopsis:
-
table WTiling.managed_list(WTiling ws) +
bool WTiling.managed_i(WTiling ws, function iterfn)
Description:
-
Returns a list of regions managed by the workspace (frames, mostly). +
Iterate over managed regions of ws until iterfn returns + false. + The function itself returns true if it reaches the end of list + without this happening.
@@ -3830,8 +3888,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3850,8 +3908,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3868,8 +3926,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3888,8 +3946,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3907,8 +3965,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3926,8 +3984,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3948,8 +4006,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3965,8 +4023,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -3982,8 +4040,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4006,8 +4064,8 @@ Note that this function is asynchronous; the region will not
-
- +
+
Synopsis:
@@ -4023,8 +4081,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4041,8 +4099,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4058,8 +4116,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4075,8 +4133,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4092,19 +4150,20 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
-
integer mod_query.history_search(string s, integer from, bool bwd) +
integer mod_query.history_search(string s, integer from, bool bwd, bool exact)
Description:
Try to find matching history entry. Returns -1 if none was found. The parameter from specifies where to start searching from, and bwd causes backward search from - that point. + that point. If exact is not set, s only required + to be a prefix of the match.
@@ -4112,8 +4171,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4129,8 +4188,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4146,8 +4205,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4170,6 +4229,10 @@ Note that this function is asynchronous; the region will not (integer) auto-show-completions delay in milliseconds (default: 250). +caseicompl +(boolean) Turn some completions case-insensitive + (default: false). + @@ -4178,8 +4241,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4195,8 +4258,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4219,8 +4282,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4246,8 +4309,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4265,8 +4328,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4284,8 +4347,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4305,8 +4368,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4324,8 +4387,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4344,8 +4407,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4363,8 +4426,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4380,8 +4443,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4398,17 +4461,18 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
-
mod_query.query_renameworkspace(mplex) +
mod_query.query_renameworkspace(mplex, ws)
Description:
-
This function asks for a name new for the workspace on which the - query resides. +
This function asks for a name new for the workspace ws, + or the one on which mplex resides, if it is not set. + If mplex is not set, one is looked for.
@@ -4416,8 +4480,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4434,8 +4498,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4453,8 +4517,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4472,8 +4536,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4490,8 +4554,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4511,8 +4575,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4530,8 +4594,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4547,8 +4611,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4570,8 +4634,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4597,8 +4661,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4614,8 +4678,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4631,8 +4695,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4649,8 +4713,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4666,8 +4730,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4684,8 +4748,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4701,8 +4765,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4724,8 +4788,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4741,8 +4805,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4758,8 +4822,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4775,8 +4839,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4793,8 +4857,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4810,8 +4874,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4827,8 +4891,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4844,8 +4908,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4861,8 +4925,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4880,8 +4944,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4899,8 +4963,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4916,8 +4980,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4933,8 +4997,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4950,8 +5014,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4967,8 +5031,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -4984,8 +5048,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -5002,8 +5066,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -5021,8 +5085,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -5038,8 +5102,8 @@ Note that this function is asynchronous; the region will not

-
- +
+
Synopsis:
@@ -5060,8 +5124,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5078,8 +5142,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5095,8 +5159,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5112,8 +5176,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5129,8 +5193,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5147,8 +5211,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5164,8 +5228,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5187,8 +5251,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5204,8 +5268,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5221,8 +5285,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5244,8 +5308,8 @@ Note that this function is asynchronous; the selection will not
-
- +
+
Synopsis:
@@ -5263,8 +5327,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5290,8 +5354,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5307,8 +5371,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5342,8 +5406,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5367,8 +5431,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5384,8 +5448,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5402,8 +5466,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5419,8 +5483,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5436,8 +5500,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5453,8 +5517,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5476,8 +5540,8 @@ Note that this function is asynchronous; the selection will not
-
- +
+
Synopsis:
@@ -5499,8 +5563,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5516,8 +5580,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5534,8 +5598,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5551,8 +5615,8 @@ Note that this function is asynchronous; the selection will not

-
- +
+
Synopsis:
@@ -5607,8 +5671,8 @@ Any parameters not explicitly set in conftab will be left unchanged.
-
- +
+
Synopsis:
@@ -5625,8 +5689,8 @@ Any parameters not explicitly set in conftab will be left unchanged.

-
- +
+
Synopsis:
@@ -5649,8 +5713,8 @@ Any parameters not explicitly set in conftab will be left unchanged.
-
- +
+
Synopsis:
@@ -5666,8 +5730,8 @@ Any parameters not explicitly set in conftab will be left unchanged.

-
- +
+
Synopsis:
@@ -5683,8 +5747,8 @@ Any parameters not explicitly set in conftab will be left unchanged.

-
- +
+
Synopsis:
@@ -5700,8 +5764,8 @@ Any parameters not explicitly set in conftab will be left unchanged.

-
- +
+
Synopsis:
@@ -5725,7 +5789,7 @@ Any parameters not explicitly set in conftab will be left unchanged.

-
+
Hook name:
@@ -5797,7 +5861,7 @@ reg:attach(cwin)

-
+
Hook name:
@@ -5817,7 +5881,28 @@ reg:attach(cwin)

-
+
+ +
+
Hook name:
+
clientwin_property_change_hook + +
+
Parameters:
+
(WClientWin, integer) + +
+
Description:
+
Called when the property identified by the parameter atom id + (integer) has changed on a client window. + +
+
+ +

+ +

+
Hook name:
@@ -5838,7 +5923,7 @@ reg:attach(cwin)

-
+
Hook name:
@@ -5884,7 +5969,7 @@ reg:attach(cwin)

-
+
Hook name:
@@ -5905,7 +5990,7 @@ reg:attach(cwin)

-
+
Hook name:
@@ -5925,7 +6010,7 @@ reg:attach(cwin)

-
+
Hook name:
@@ -5946,7 +6031,7 @@ reg:attach(cwin)

-
+
Hook name:
@@ -5966,7 +6051,7 @@ reg:attach(cwin)

-
+
Hook name:
@@ -6018,85 +6103,11 @@ reg:attach(cwin)

-
+
Hook name:
-
panews_make_placement_alt - -
-
Parameters:
-
table - -
-
Description:
-
Called to make a placement on panews. The parameter table has - the following fields: - -

- - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
wsWPaneWSThe workspace
frameWFrameA frame initially allocated for the - region to be placed
regWRegionThe region to be placed
specifierWRegionFor drag&drop on handling empty areas
- -

-The handler should set some of these fields on success: - -

- - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
res_nodeWSplitTarget split
res_configWFrameNew configuration for it, unless - WSplitRegion
res_wintegerNew width for target split (optional)
res_hintegerNew height for target split (optional)
- -

-
- -

- -

-
- -
-
Hook name:
-
region_activated_hook +
region_do_warp_alt
Parameters:
@@ -6104,7 +6115,8 @@ The handler should set some of these fields on success:
Description:
-
Signalled when a region or one of its children has received the focus. +
This alt-hook exist to allow for alternative pointer warping + implementations.
@@ -6112,20 +6124,21 @@ The handler should set some of these fields on success:

-
+
Hook name:
-
region_activity_hook +
screen_managed_changed_hook
Parameters:
-
WRegion +
table
Description:
-
This hook is triggered when the activity flag of the parameter - region has been changed. +
Called when there are changes in the objects managed by a screen + or their order. The table parameter is similar to that of + frame_managed_changed_hook.
@@ -6133,67 +6146,73 @@ The handler should set some of these fields on success:

-
+
Hook name:
-
region_do_warp_alt +
region_notify_hook
Parameters:
-
WRegion +
(WRegion, string)
Description:
-
This alt-hook exist to allow for alternative pointer warping - implementations. - -
-
+
Signalled when something (minor) has changed in relation to + the first parameter region. The string argument gives the + change:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StringDescription
deinitThe region is about to be deinitialised.
activatedThe region has received focus.
inactivatedThe region has lost focus.
activityThere's been activity in the region itself.
sub_activityThere's been activity in some sub-region.
nameThe name of the region has changed.
unset_managerThe region no longer has a manager.
set_managerThe region now has a manager.
tagTagging state has changed.
pseudoactivatedThe region has become pseudoactive + (see below).
pseudoinactivatedThe region is no longer pseudoactive.
-

-
- -
-
Hook name:
-
region_inactivated_hook - -
-
Parameters:
-
WRegion - -
-
Description:
-
Signalled when the focus has moved from the parameter region or - one of its children to a non-child region of the parameter region. +

+A region is pseudoactive, when a) it is itself not active (does + not not have the focus, and may not even have a window that could + have it), but b) some region managed by it is active.

-

-
- -
-
Hook name:
-
screen_managed_changed_hook - -
-
Parameters:
-
table - -
-
Description:
-
Called when there are changes in the objects managed by a screen - or their order. The table parameter is similar to that of - frame_managed_changed_hook. - -
-
-

diff --git a/doc/ionconf/node9.html b/doc/ionconf/node9.html index 69a5aff..9d55faa 100644 --- a/doc/ionconf/node9.html +++ b/doc/ionconf/node9.html @@ -74,10 +74,10 @@ B. Full class hierarchy visible to Lua-side |-->WRegion | |-->WClientWin | |-->WWindow - | | |-->WRootWin | | |-->WMPlex - | | | |-->WScreen | | | |-->WFrame + | | | |-->WScreen + | | | |->WRootWin | | |-->WInfoWin | | | |-->WStatusBar (mod_statusbar) | | |-->WMenu (mod_menu) diff --git a/doc/ionnotes.dvi.gz b/doc/ionnotes.dvi.gz index 2922df5..599aad6 100644 Binary files a/doc/ionnotes.dvi.gz and b/doc/ionnotes.dvi.gz differ diff --git a/doc/ionnotes.ps.gz b/doc/ionnotes.ps.gz index d432ffb..2bbff07 100644 Binary files a/doc/ionnotes.ps.gz and b/doc/ionnotes.ps.gz differ diff --git a/doc/ionnotes/node2.html b/doc/ionnotes/node2.html index e25fd2d..ad3c839 100644 --- a/doc/ionnotes/node2.html +++ b/doc/ionnotes/node2.html @@ -128,7 +128,7 @@ implement.

-

+
Figure 1: Partial Ioncore, mod_tiling and mod_query @@ -138,10 +138,10 @@ Partial Ioncore, mod_tiling and +
Is the base of Ion's object system.

WRegion
-
+
is the base class for everything corresponding to something on the screen. Each object of type WRegion has a size and position relative to the parent WRegion. While a big part of Ion @@ -178,27 +178,27 @@ The core classes:

WClientWin
-
is a class for +
is a class for client window objects, the objects that window managers are supposed to manage.

WWindow
-
is the base class for all +
is the base class for all internal objects having an X window associated to them (WClientWins also have X windows associated to them).

WRootWin
-
is the class for +
is the class for root windows of X screens. Note that an ''X screen'' or root window is not necessarily a single physical screen as a root window - may be split over multiple screens when multi-head extensions - such as Xinerama are used. (Actually there - can be only one WRootWin when Xinerama is used.) + may be split over multiple screens when hacks such as + Xinerama are used. (Actually there can be only + one root window when Xinerama is used.)

@@ -211,15 +211,14 @@ The core classes:

WScreen
-
is the class for objects +
is the class for objects corresponding to physical screens. Screens may share a root - window when Xinerama multihead extensions are used as explained - above. + window when the Xinerama extension is used as explained above.

WFrame
-
is the class for frames. +
is the class for frames. While most Ion's objects have no graphical presentation, frames basically add to WMPlexes the decorations around client windows (borders, tabs). @@ -227,11 +226,11 @@ The core classes:

WGroup
-
is the base class for groups. +
is the base class for groups. Particular types of groups are workspaces - (WGroupWS) + (WGroupWS) and groups of client windows - (WGroupCW). + (WGroupCW).
@@ -241,12 +240,12 @@ Classes implemented by the mod_tiling module:

WTiling
-
is the class for tilings +
is the class for tilings of frames.
WSplit
-
(or, more specifically, classes +
(or, more specifically, classes that inherit it) encode the WTiling tree structure.
@@ -257,19 +256,19 @@ Classes implemented by the mod_query module:

WInput
-
is a virtual base class for the +
is a virtual base class for the two classes below.
WEdln
-
is the class for the ''queries'', +
is the class for the ''queries'', the text inputs that usually appear at bottoms of frames and sometimes screens. Queries are the functional equivalent of ''mini buffers'' in many text editors.
WMessage
-
implements the boxes for +
implements the boxes for warning and other messages that Ion may wish to display to the user. These also usually appear at bottoms of frames.
@@ -293,7 +292,7 @@ binding callbacks in the move and resize mode. 1.2.1 Parent-child relations Each object of type WRegion has a parent and possibly a manager -associated to it. The parent for an object is always a +associated to it. The parent for an object is always a WWindow and for WRegion with an X window (WClientWin, WWindow) the parent WWindow is given by the same relation of the X windows. For other WRegions the relation is not as clear. @@ -303,7 +302,7 @@ Figure 2.

-

+
@@ -324,7 +323,7 @@ Most common parent-child relations

WRegions have very little control over their children as a parent. -The manager WRegion has much more control over its +The manager WRegion has much more control over its managed WRegions. Managers, for example, handle resize requests, focusing and displaying of the managed regions. Indeed the manager--managed relationship gives a better picture of the logical ordering of objects on @@ -342,7 +341,7 @@ but all have a parent-a screen if not anything else.

-

+
Figure 2: Most common parent-child relations
diff --git a/doc/ionnotes/node3.html b/doc/ionnotes/node3.html index 4f17c4e..0309e19 100644 --- a/doc/ionnotes/node3.html +++ b/doc/ionnotes/node3.html @@ -64,11 +64,11 @@ original version by: Nikos Drakos, CBLU, University of Leeds

First, to get things clear, what are considered objects here are C -structures containing a properly initialized +structures containing a properly initialized structure defined in ioncore/obj.h as the first element (or the first element of the structure which is the first element and so on which gives rise to inheritance). The WObj structure contains a pointer -to a WObjDescr class type info structure and +to a WObjDescr class type info structure and a list of so called ''watches''. The WObjDescr structure simply lists the class name, a table of dynamic functions and a pointer to deinitialisation function (or ''destructor''). @@ -77,7 +77,7 @@ deinitialisation function (or ''destructor''). Ion does not do any reference counting, garbage collecting or other fancy things related to automatic safe freeing of objects with its simplistic object system. Instead special watches (the WWatch - structure) may be used to create safe references to + structure) may be used to create safe references to objects that might be destroyed during the time the specific pointer is needed. When an object is destroyed, its list of watches is processed, setting the pointers in the watches to NULL and the watch handlers for diff --git a/doc/ionnotes/node4.html b/doc/ionnotes/node4.html index 037e8bc..1ae2bf7 100644 --- a/doc/ionnotes/node4.html +++ b/doc/ionnotes/node4.html @@ -126,11 +126,11 @@ C side of Ion and Lua:

- + - + @@ -195,7 +195,7 @@ initialisation and deinitialisation code.

You've seen the terms level 1 and 2 call handler mentioned above. - + The Lua support code uses two so called call handlers to convert and check the types of parameters passed from Lua to C and back to Lua. The first one of these call handlers is the same for all exported functions and @@ -230,10 +230,10 @@ supported by the generated L2 call handlers).

The functions -extl_call, -extl_call_named, -extl_dofile and -extl_dostring +extl_call, +extl_call_named, +extl_dofile and +extl_dostring call a referenced function (ExtlFn), named function, execute a string and a file, respectively. The rest of the parameters for all these functions are similar. The 'spec' argument is a string of identifier @@ -249,7 +249,7 @@ passing succeeded or not.

Sometimes it is necessary to block calls to all but a limited set of Ion functions. This can be accomplished with -extl_set_safelist. +extl_set_safelist. The parameter to this function is a NULL-terminated array of strings and the return value is a similar old safelist. The call extl_set_safelist(NULL) removes any safelist and allows @@ -263,7 +263,7 @@ calls to all exported functions.

Configuration files should be read as before with the function -read_config_for +read_config_for except that the list of known options is no longer present.

diff --git a/doc/ionnotes/node5.html b/doc/ionnotes/node5.html index 51c46f8..d3aba2e 100644 --- a/doc/ionnotes/node5.html +++ b/doc/ionnotes/node5.html @@ -83,10 +83,10 @@ original version by: Nikos Drakos, CBLU, University of Leeds

To keep Ion's code as simple as possible yet safe, there are restrictions when the WObj -destroy_obj +destroy_obj function that calls watches, the deinit routine and frees memory may be called directly. In all other cases the -defer_destroy +defer_destroy function should be used to defer the call of destroy_obj until Ioncore returns to its main event loop. @@ -104,7 +104,7 @@ following cases: some reason failed to reparent the object to this frame.

  • In a deferred action handler set with - defer_action. + defer_action. Like deferred destroys, other deferred actions are called when Ioncore has returned to the main loop.
  • diff --git a/doc/ionnotes/node8.html b/doc/ionnotes/node8.html index 0ec574a..6e12241 100644 --- a/doc/ionnotes/node8.html +++ b/doc/ionnotes/node8.html @@ -58,35 +58,35 @@ original version by: Nikos Drakos, CBLU, University of Leeds Index
    call handler - : 3.2 + : 3.2
    defer_action - : 4.1 -
    defer_destroy : 4.1 -
    destroy_obj +
    defer_destroy : 4.1 +
    destroy_obj + : 4.1
    extl_call - : 3.3 + : 3.3
    extl_call_named - : 3.3 + : 3.3
    extl_dofile - : 3.3 + : 3.3
    extl_dostring - : 3.3 + : 3.3
    extl_set_safelist - : 3.3 + : 3.3
    ExtlFn - : 3.1 -
    ExtlTab : 3.1 +
    ExtlTab + : 3.1
    manager - : 1.2.1 + : 1.2.1
    Obj - : 1.1 + : 1.1
    parent - : 1.2.1 + : 1.2.1
    read_config_for - : 3.4 + : 3.4
    root window : 1.1
    screen
    @@ -94,39 +94,39 @@ Index
    X : 1.1
    WClientWin - : 1.1 + : 1.1
    WEdln - : 1.1 + : 1.1
    WFrame - : 1.1 + : 1.1
    WGroup - : 1.1 + : 1.1
    WGroupCW - : 1.1 -
    WGroupWS : 1.1 +
    WGroupWS + : 1.1
    WInput - : 1.1 + : 1.1
    WMessage - : 1.1 + : 1.1
    WObj - : 2 + : 2
    WObjDescr - : 2 + : 2
    WRegion - : 1.1 + : 1.1
    WRootWin - : 1.1 + : 1.1
    WScreen - : 1.1 + : 1.1
    WSplit - : 1.1 -
    WTiling : 1.1 +
    WTiling + : 1.1
    WWatch - : 2 + : 2
    WWindow - : 1.1 + : 1.1
    Xinerama : 1.1 diff --git a/doc/ionnotes/node9.html b/doc/ionnotes/node9.html index a4ce07f..7823010 100644 --- a/doc/ionnotes/node9.html +++ b/doc/ionnotes/node9.html @@ -70,7 +70,7 @@ Mathematics Department, Macquarie University, Sydney. The command line arguments were:
    latex2html -show_section_numbers -short_index -local_icons -noaddress -up_url http://iki.fi/tuomov/ion/ -up_title 'Ion homepage' -nofootnode -split 4 ionnotes

    -The translation was initiated by tuomov on 2006-12-23 +The translation was initiated by tuomov on 2007-02-03


    diff --git a/doc/objects.tex b/doc/objects.tex index e751eab..80321fa 100644 --- a/doc/objects.tex +++ b/doc/objects.tex @@ -44,10 +44,10 @@ implement. |-->WRegion | |-->WClientWin | |-->WWindow - | | |-->WRootWin | | |-->WMPlex - | | | |-->WScreen | | | |-->WFrame + | | | |-->WScreen + | | | |-->WRootWin | | |-->WInput (mod_query) | | |-->WEdln (mod_query) | | |-->WMessage (mod_query) @@ -89,10 +89,10 @@ The core classes: root windows\index{root window} of X screens\index{screen!X}. Note that an ''X screen'' or root window is not necessarily a single physical screen\index{screen!physical} as a root window - may be split over multiple screens when multi-head extensions - such as Xinerama\index{Xinerama} are used. (Actually there - can be only one \type{WRootWin} when Xinerama is used.) - + may be split over multiple screens when hacks such as + Xinerama\index{Xinerama} are used. (Actually there can be only + one root window when Xinerama is used.) + \item[\type{WMPlex}] is a base class for all regions that''multiplex'' other regions. This means that of the regions managed by the multiplexer, only one can be displayed at a time. Classes that inhereit \type{WMPlex} @@ -100,8 +100,7 @@ The core classes: \item[\type{WScreen}]\indextype{WScreen} is the class for objects corresponding to physical screens. Screens may share a root - window when Xinerama multihead extensions are used as explained - above. + window when the Xinerama extension is used as explained above. \item[\type{WFrame}]\indextype{WFrame} is the class for frames. While most Ion's objects have no graphical presentation, frames basically diff --git a/etc/Makefile b/etc/Makefile index 81ba5c1..2c5b191 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/build/system-inc.mk ETC = cfg_ion.lua cfg_ioncore.lua cfg_kludges.lua cfg_modules.lua \ cfg_tiling.lua cfg_query.lua cfg_menu.lua \ - cfg_statusbar.lua cfg_dock.lua \ + cfg_statusbar.lua cfg_dock.lua cfg_layouts.lua \ look_brownsteel.lua look_clean.lua look_dusky.lua \ look_greyviolet.lua look_ios.lua look_cleanviolet.lua \ look_simpleblue.lua look_cleanios.lua \ diff --git a/etc/cfg_ion.lua b/etc/cfg_ion.lua index 8e8d02e..339a026 100644 --- a/etc/cfg_ion.lua +++ b/etc/cfg_ion.lua @@ -52,5 +52,9 @@ dopath("cfg_modules") --dopath("mod_dock") --dopath("mod_sp") +-- Define some default layouts. This is also done by cfg_modules +-- if loaded. +--dopath("cfg_layouts", true) + -- Deprecated. dopath("cfg_user", true) diff --git a/etc/cfg_ioncore.lua b/etc/cfg_ioncore.lua index acf7e94..b10b46c 100644 --- a/etc/cfg_ioncore.lua +++ b/etc/cfg_ioncore.lua @@ -36,10 +36,12 @@ defbindings("WScreen", { bdoc("Switch to next/previous object within current screen."), kpress(META.."comma", "WScreen.switch_prev(_)"), kpress(META.."period", "WScreen.switch_next(_)"), - + submap(META.."K", { bdoc("Go to first region demanding attention or previously active one."), - kpress("K", "ioncore.goto_activity() or ioncore.goto_previous()"), + kpress("K", "mod_menu.grabmenu(_, _sub, 'focuslist')"), + -- Alternative without (cyclable) menu + --kpress("K", "ioncore.goto_activity() or ioncore.goto_previous()"), --bdoc("Go to previous active object."), --kpress("K", "ioncore.goto_previous()"), @@ -115,21 +117,27 @@ defbindings("WClientWin", { defbindings("WGroupCW", { bdoc("Toggle client window group full-screen mode"), - kpress_wait(META.."Return", - "WClientWin.set_fullscreen(_:bottom(), 'toggle')"), + kpress_wait(META.."Return", "WGroup.set_fullscreen(_, 'toggle')"), }) -- WMPlex context bindings -- -- These bindings work in frames and on screens. The innermost of such --- contexts/objects always gets to handle the key press. Most of these --- bindings define actions on client windows. (Remember that client windows --- can be put in fullscreen mode and therefore may not have a frame.) +-- contexts/objects always gets to handle the key press. defbindings("WMPlex", { bdoc("Close current object."), kpress_wait(META.."C", "WRegion.rqclose_propagate(_, _sub)"), + + submap(META.."K", { + bdoc("Detach (float) or reattach an object to its previous location."), + -- By using _chld instead of _sub, we can detach/reattach queries + -- attached to a group. The detach code checks if the parameter + -- (_chld) is a group 'bottom' and detaches the whole group in that + -- case. + kpress("D", "ioncore.detach(_chld, 'toggle')", "_chld:non-nil"), + }), }) -- Frames for transient windows ignore this bindmap @@ -182,9 +190,8 @@ defbindings("WMPlex.toplevel", { -- WFrame context bindings -- --- These bindings are common to all types of frames. The rest of frame --- bindings that differ between frame types are defined in the modules' --- configuration files. +-- These bindings are common to all types of frames. Some additional +-- frame bindings are found in some modules' configuration files. defbindings("WFrame", { submap(META.."K", { @@ -359,6 +366,8 @@ defctxmenu("WFrame", "Frame", { menuentry("Close", "WRegion.rqclose_propagate(_, _sub)"), menuentry("Kill", "WClientWin.kill(_sub)", "_sub:WClientWin"), + menuentry("De/reattach", "ioncore.detach(_sub, 'toggle')", + "_sub:non-nil"), menuentry("Toggle tag", "WRegion.set_tagged(_sub, 'toggle')", "_sub:non-nil"), menuentry("Attach tagged", "WFrame.attach_tagged(_)"), @@ -367,11 +376,9 @@ defctxmenu("WFrame", "Frame", { }) --- Context menu for screens -defctxmenu("WScreen", "Screen", { - menuentry("New workspace", "ioncore.create_ws(_)"), - menuentry("New empty workspace", - "ioncore.create_ws(_, nil, true)"), - menuentry("Close workspace","WRegion.rqclose(_sub)"), +-- Context menu for workspaces +defctxmenu("WGroupWS", "Workspace", { + menuentry("Close", "WRegion.rqclose(_)"), + menuentry("Rename", "mod_query.query_renameworkspace(nil, _)"), }) diff --git a/etc/cfg_layouts.lua b/etc/cfg_layouts.lua new file mode 100644 index 0000000..4299c76 --- /dev/null +++ b/etc/cfg_layouts.lua @@ -0,0 +1,55 @@ +-- +-- Layouts for Ion +-- + +local a_frame = { + type="WSplitRegion", + regparams = { + type = "WFrame", + frame_style = "frame-tiled" + } +} + + +local horizontally_split = { + -- Destroy workspace if the 'bottom' tiling is destroyed last + bottom_last_close = true, + -- Layout + managed = { + { + type = "WTiling", + bottom = true, + -- The default is a single 1:1 horizontal split + split_tree = { + type = "WSplitSplit", + dir = "horizontal", + tls = 1, + brs = 1, + tl = a_frame, + br = a_frame + } + -- For a single frame + --split_tree = nil + } + } +} + + +local full_tiled = { + -- Destroy workspace if the 'bottom' tiling is destroyed last + bottom_last_close = true, + -- Layout + managed = { + { + type = "WTiling", + bottom = true, + } + } +} + + +-- Let the world know about them + +ioncore.deflayout("default", horizontally_split) +ioncore.deflayout("hsplit", horizontally_split) +ioncore.deflayout("full", full_tiled) diff --git a/etc/cfg_modules.lua b/etc/cfg_modules.lua index ccbfb70..7128f15 100644 --- a/etc/cfg_modules.lua +++ b/etc/cfg_modules.lua @@ -5,7 +5,9 @@ dopath("mod_query") dopath("mod_menu") dopath("mod_tiling") ---dopath("mod_panews") dopath("mod_statusbar") --dopath("mod_dock") dopath("mod_sp") + +-- Load some layouts +dopath("cfg_layouts") diff --git a/etc/cfg_panews.lua b/etc/cfg_panews.lua deleted file mode 100644 index 65761a0..0000000 --- a/etc/cfg_panews.lua +++ /dev/null @@ -1,57 +0,0 @@ --- --- Ion panews module configuration file --- - --- Bindings for unused area. - -defbindings("WUnusedWin", { - bdoc("Begin move/resize mode."), - kpress(META.."R", "WUnusedWin.begin_kbresize(_)"), - - bdoc("Resize the area."), - mdrag(META.."Button3", "WUnusedWin.p_resize(_)"), - mdrag(META.."Button1", "WUnusedWin.p_move(_)"), -}) - - -mod_panews.set{ - -- Layout template may be one of default|alternative1|alternative2 - -- or a template table. (The one for 'default' is reproduced below - -- as an example.) - --template="default", - -- The scale factor parameter controls the size-based classification - -- heuristic. The default of 1.0 is designed for 1280x1024 at 75dpi. - --scalef=1.0, -} - - --- The layout template for the 'default' layout looks as follows. ---[[ -{ - type="WSplitFloat", - dir="horizontal", - tls=settings.b_ratio, - brs=settings.s_ratio, - tl={ - type="WSplitPane", - contents={ - type="WSplitFloat", - dir="vertical", - tls=settings.b_ratio2, - brs=settings.s_ratio2, - tl={ - type="WSplitPane", - marker="V:single", - }, - br={ - type="WSplitPane", - marker="M:right", - }, - }, - }, - br={ - type="WSplitPane", - marker="T:up", - }, -} ---]] diff --git a/etc/cfg_tiling.lua b/etc/cfg_tiling.lua index 0225d3a..b07178e 100644 --- a/etc/cfg_tiling.lua +++ b/etc/cfg_tiling.lua @@ -26,22 +26,6 @@ defbindings("WTiling", { -- Frame bindings -defbindings("WFrame.tiled", { - submap(META.."K", { - bdoc("Detach window from tiled frame"), - kpress("D", "mod_tiling.detach(_sub)", "_sub:non-nil"), - }), -}) - - -defbindings("WFrame.transient", { - submap(META.."K", { - bdoc("Detach transient frame"), - kpress("D", "mod_tiling.detach(_)", "_sub:non-nil"), - }), -}) - - defbindings("WFrame.floating", { submap(META.."K", { bdoc("Tile frame, if no tiling exists on the workspace"), @@ -86,21 +70,6 @@ defctxmenu("WTiling", "Tiling", { }) --- Context menu entries for tiled frames. - -defctxmenu("WFrame.tiled", "Tiled frame", { - menuentry("Detach window", "mod_tiling.detach(_sub)", "_sub:non-nil"), -}) - - --- Context menu entries for transient frames. - -defctxmenu("WFrame.transient", "Transient frame", { - append=true, - menuentry("Detach", "mod_tiling.detach(_)", "_sub:non-nil"), -}) - - -- Extra context menu extra entries for floatframes. defctxmenu("WFrame.floating", "Floating frame", { @@ -108,39 +77,3 @@ defctxmenu("WFrame.floating", "Floating frame", { menuentry("New tiling", "mod_tiling.mkbottom(_)"), }) - --- Adjust default workspace layout - -local a_frame = { - type="WSplitRegion", - regparams = { - type = "WFrame", - frame_style = "frame-tiled" - } -} - -ioncore.set{ - default_ws_params = { - -- Destroy workspace if the 'bottom' tiling is destroyed last - bottom_last_close = true, - -- Layout - managed = { - { - type = "WTiling", - bottom = true, - -- The default is a single 1:1 horizontal split - split_tree = { - type = "WSplitSplit", - dir = "horizontal", - tls = 1, - brs = 1, - tl = a_frame, - br = a_frame - } - -- For a single frame - --split_tree = nil - } - } - } -} - diff --git a/etc/look_brownsteel.lua b/etc/look_brownsteel.lua index 221c5f5..5aa488e 100644 --- a/etc/look_brownsteel.lua +++ b/etc/look_brownsteel.lua @@ -59,18 +59,6 @@ de.defstyle("tab", { text_align = "center", }) -de.defstyle("tab-menuentry", { - based_on = "tab", - text_align = "left", - highlight_pixels = 0, - shadow_pixels = 0, -}) - -de.defstyle("tab-menuentry-big", { - based_on = "tab-menuentry", - font = "-*-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*", - padding_pixels = 7, -}) de.defstyle("input", { based_on = "*", diff --git a/etc/look_clean.lua b/etc/look_clean.lua index 7da34a9..a95cbf3 100644 --- a/etc/look_clean.lua +++ b/etc/look_clean.lua @@ -17,18 +17,6 @@ de.defstyle("*", { text_align = "center", }) -de.defstyle("frame", { - based_on = "*", - padding_colour = "#545d75", - background_colour = "black", - de.substyle("active", { - shadow_colour = "grey", - highlight_colour = "grey", - padding_colour = "#545d75", - background_colour = "black", - }), -}) - de.defstyle("tab", { based_on = "*", font = "-misc-fixed-medium-r-*-*-13-*-*-*-*-60-*-*", @@ -59,22 +47,6 @@ de.defstyle("tab", { text_align = "center", }) -de.defstyle("tab-menuentry", { - based_on = "tab", - text_align = "left", - de.substyle("inactive-selected", { - shadow_colour = "grey", - highlight_colour = "grey", - background_colour = "#8a999e", - foreground_colour = "grey", - }), -}) - -de.defstyle("tab-menuentry-big", { - based_on = "tab-menuentry", - padding_pixels = 7, -}) - de.defstyle("input", { based_on = "*", shadow_colour = "grey", @@ -98,5 +70,10 @@ de.defstyle("input", { dopath("lookcommon_clean") +de.defstyle("tab-menuentry-big", { + based_on = "tab-menuentry", + padding_pixels = 7, +}) + gr.refresh() diff --git a/etc/look_cleanios.lua b/etc/look_cleanios.lua index 6a70546..3c11bc8 100644 --- a/etc/look_cleanios.lua +++ b/etc/look_cleanios.lua @@ -18,13 +18,6 @@ de.defstyle("*", { text_align = "center", }) -de.defstyle("frame", { - based_on = "*", - padding_colour = "#d8d8d8", - background_colour = "#000000", - transparent_background = false, -}) - de.defstyle("tab", { based_on = "*", font = "-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*", @@ -55,18 +48,6 @@ de.defstyle("tab", { text_align = "center", }) -de.defstyle("tab-menuentry", { - based_on = "tab", - text_align = "left", - spacing = 1, -}) - -de.defstyle("tab-menuentry-big", { - based_on = "tab-menuentry", - font = "-*-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*", - padding_pixels = 7, -}) - de.defstyle("input-edln", { based_on = "*", de.substyle("*-cursor", { @@ -81,5 +62,11 @@ de.defstyle("input-edln", { dopath("lookcommon_clean") +de.defstyle("tab-menuentry-big", { + based_on = "tab-menuentry", + font = "-*-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*", + padding_pixels = 7, +}) + gr.refresh() diff --git a/etc/look_cleanviolet.lua b/etc/look_cleanviolet.lua index 32dce50..70e8acc 100644 --- a/etc/look_cleanviolet.lua +++ b/etc/look_cleanviolet.lua @@ -29,14 +29,6 @@ de.defstyle("*", { }) -de.defstyle("frame", { - based_on = "*", - padding_colour = "#aaaaaa", - background_colour = "#000000", - transparent_background = false, -}) - - de.defstyle("tab", { based_on = "*", font = "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*", @@ -59,20 +51,6 @@ de.defstyle("tab", { }) -de.defstyle("tab-menuentry", { - based_on = "tab", - text_align = "left", - spacing = 1, -}) - - -de.defstyle("tab-menuentry-big", { - based_on = "tab-menuentry", - font = "-*-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*", - padding_pixels = 7, -}) - - de.defstyle("input", { based_on = "*", text_align = "left", @@ -94,7 +72,16 @@ de.defstyle("input", { }), }) + dopath("lookcommon_clean") + + +de.defstyle("tab-menuentry-big", { + based_on = "tab-menuentry", + font = "-*-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*", + padding_pixels = 7, +}) + -- Refresh objects' brushes. gr.refresh() diff --git a/etc/look_dusky.lua b/etc/look_dusky.lua index 5effeee..4387e9d 100644 --- a/etc/look_dusky.lua +++ b/etc/look_dusky.lua @@ -59,19 +59,6 @@ de.defstyle("tab", { text_align = "center", }) -de.defstyle("tab-menuentry", { - based_on = "tab", - text_align = "left", - highlight_pixels = 0, - shadow_pixels = 0, -}) - -de.defstyle("tab-menuentry-big", { - based_on = "tab-menuentry", - font = "-*-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*", - padding_pixels = 7, -}) - de.defstyle("input", { based_on = "*", shadow_colour = "#404040", diff --git a/etc/look_greyviolet.lua b/etc/look_greyviolet.lua index ec15a78..43dafee 100644 --- a/etc/look_greyviolet.lua +++ b/etc/look_greyviolet.lua @@ -59,19 +59,6 @@ de.defstyle("tab", { text_align = "center", }) -de.defstyle("tab-menuentry", { - based_on = "tab", - text_align = "left", - highlight_pixels = 0, - shadow_pixels = 0, -}) - -de.defstyle("tab-menuentry-big", { - based_on = "tab-menuentry", - font = "-*-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*", - padding_pixels = 7, -}) - de.defstyle("input", { based_on = "*", shadow_colour = "#777777", diff --git a/etc/look_ios.lua b/etc/look_ios.lua index 4b8f4da..85afceb 100644 --- a/etc/look_ios.lua +++ b/etc/look_ios.lua @@ -65,19 +65,6 @@ de.defstyle("tab", { text_align = "center", }) -de.defstyle("tab-menuentry", { - based_on = "tab", - text_align = "left", - highlight_pixels = 0, - shadow_pixels = 0, -}) - -de.defstyle("tab-menuentry-big", { - based_on = "tab-menuentry", - font = "-*-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*", - padding_pixels = 7, -}) - de.defstyle("input", { based_on = "*", shadow_colour = "#606060", diff --git a/etc/look_simpleblue.lua b/etc/look_simpleblue.lua index 0773f7a..2c37852 100644 --- a/etc/look_simpleblue.lua +++ b/etc/look_simpleblue.lua @@ -42,7 +42,7 @@ de.defstyle("tab", { shadow_colour = "black", highlight_colour = "black", background_colour = "#3f3f3f", - foreground_colour = "#9f9f9f", + foreground_colour = "#bfbfbf", }), de.substyle("active-unselected", { shadow_colour = "black", @@ -53,8 +53,8 @@ de.defstyle("tab", { de.substyle("inactive-selected", { shadow_colour = "black", highlight_colour = "black", - background_colour = "#0f1f4f", - foreground_colour = "#9f9f9f", + background_colour = "#1f2f4f", + foreground_colour = "#bfbfbf", }), de.substyle("inactive-unselected", { shadow_colour = "black", @@ -106,6 +106,11 @@ de.defstyle("input", { }), }) +de.defstyle("input-menu", { + based_on = "input", + padding_pixels=0, +}) + dopath("lookcommon_clean") gr.refresh() diff --git a/etc/lookcommon_clean.lua b/etc/lookcommon_clean.lua index cfb059a..de0efa2 100644 --- a/etc/lookcommon_clean.lua +++ b/etc/lookcommon_clean.lua @@ -20,20 +20,31 @@ de.defstyle("stdisp", { de.defstyle("actnotify", { based_on = "*", - shadow_colour = "#e0c0c0", - highlight_colour = "#e0c0c0", - background_colour = "#990000", + shadow_colour = "#c04040", + highlight_colour = "#c04040", + background_colour = "#901010", foreground_colour = "#eeeeee", }) de.defstyle("tab-frame", { based_on = "tab", - de.substyle("*-*-*-*-activity", { - shadow_colour = "#e0c0c0", - highlight_colour = "#e0c0c0", - background_colour = "#990000", + -- TODO: some kind of amend option. It should not be necessary to + -- duplicate this definition for both tab-frame and tab-menuentry, + -- or for each style, nor use more complex hacks to communicate + -- this stuff otherwise. + de.substyle("*-*-*-unselected-activity", { + shadow_colour = "#c04040", + highlight_colour = "#c04040", + background_colour = "#901010", foreground_colour = "#eeeeee", }), + + de.substyle("*-*-*-selected-activity", { + shadow_colour = "#c04040", + highlight_colour = "#c04040", + background_colour = "#b03030", + foreground_colour = "#ffffff", + }), }) de.defstyle("tab-frame-tiled", { @@ -41,11 +52,40 @@ de.defstyle("tab-frame-tiled", { spacing = 1, }) +de.defstyle("tab-menuentry", { + based_on = "tab", + text_align = "left", + + de.substyle("*-*-*-unselected-activity", { + shadow_colour = "#c04040", + highlight_colour = "#c04040", + background_colour = "#901010", + foreground_colour = "#eeeeee", + }), + + de.substyle("*-*-*-selected-activity", { + shadow_colour = "#c04040", + highlight_colour = "#c04040", + background_colour = "#b03030", + foreground_colour = "#ffffff", + }), +}) + +de.defstyle("frame", { + based_on = "*", + background_colour = "#000000", + transparent_background = false, + de.substyle("quasiactive", { + -- Something detached from the frame is active + padding_colour = "#901010", + }), +}) + de.defstyle("frame-tiled", { based_on = "frame", shadow_pixels = 0, highlight_pixels = 0, - padding_pixels = 0, + padding_pixels = 1, spacing = 1, }) @@ -56,5 +96,6 @@ de.defstyle("frame-tiled-alt", { de.defstyle("frame-floating", { based_on = "frame", - bar = "shaped" + bar = "shaped", + padding_pixels = 0, }) diff --git a/etc/lookcommon_emboss.lua b/etc/lookcommon_emboss.lua index 4c558e1..1d771c1 100644 --- a/etc/lookcommon_emboss.lua +++ b/etc/lookcommon_emboss.lua @@ -17,20 +17,31 @@ de.defstyle("stdisp", { de.defstyle("actnotify", { based_on = "*", - shadow_colour = "#401010", - highlight_colour = "#eec0c0", - background_colour = "#990000", - foreground_colour = "#eeeeee", + shadow_colour = "#600808", + highlight_colour = "#c04040", + background_colour = "#b03030", + foreground_colour = "#ffffff", }) de.defstyle("tab-frame", { based_on = "tab", - de.substyle("*-*-*-*-activity", { - shadow_colour = "#401010", - highlight_colour = "#eec0c0", - background_colour = "#990000", + -- TODO: some kind of amend option. It should not be necessary to + -- duplicate this definition for both tab-frame and tab-menuentry, + -- or for each style, nor use more complex hacks to communicate + -- this stuff otherwise. + de.substyle("*-*-*-unselected-activity", { + shadow_colour = "#600808", + highlight_colour = "#c04040", + background_colour = "#901010", foreground_colour = "#eeeeee", }), + + de.substyle("*-*-*-selected-activity", { + shadow_colour = "#600808", + highlight_colour = "#c04040", + background_colour = "#b03030", + foreground_colour = "#ffffff", + }), }) de.defstyle("tab-frame-tiled", { @@ -55,3 +66,30 @@ de.defstyle("frame-tiled-alt", { based_on = "frame-tiled", bar = "none", }) + +de.defstyle("tab-menuentry", { + based_on = "tab", + text_align = "left", + highlight_pixels = 0, + shadow_pixels = 0, + + de.substyle("*-*-*-unselected-activity", { + shadow_colour = "#600808", + highlight_colour = "#c04040", + background_colour = "#901010", + foreground_colour = "#eeeeee", + }), + + de.substyle("*-*-*-selected-activity", { + shadow_colour = "#600808", + highlight_colour = "#c04040", + background_colour = "#b03030", + foreground_colour = "#ffffff", + }), +}) + +de.defstyle("tab-menuentry-big", { + based_on = "tab-menuentry", + font = "-*-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*", + padding_pixels = 7, +}) diff --git a/exact-version b/exact-version index d04e47f..43c9187 100644 --- a/exact-version +++ b/exact-version @@ -1,5 +1,5 @@ Context: -[TAG ion-3ds-20061223 -Tuomo Valkonen **20061223145904] +[TAG ion-3ds-20070203 +Tuomo Valkonen **20070203145039] diff --git a/ion/Makefile b/ion/Makefile index a79fa9f..823ab7f 100644 --- a/ion/Makefile +++ b/ion/Makefile @@ -19,7 +19,7 @@ INCLUDES += $(X11_INCLUDES) INCLUDES += $(LIBMAINLOOP_INCLUDES) $(LIBTU_INCLUDES) $(LIBEXTL_INCLUDES) INCLUDES += -I.. -LIBS += $(X11_LIBS) $(XINERAMA_LIBS) +LIBS += $(X11_LIBS) LIBS += $(WHOLEA) $(LIBMAINLOOP_LIBS) $(LIBEXTL_LIBS) $(LIBTU_LIBS) $(NO_WHOLEA) LIBS += $(LUA_LIBS) $(DL_LIBS) LIBS += -lm diff --git a/ion/ion.c b/ion/ion.c index 93a5977..1c7fcf9 100644 --- a/ion/ion.c +++ b/ion/ion.c @@ -1,7 +1,7 @@ /* * ion/ion/ion.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -48,16 +48,8 @@ static OptParserOpt ion_opts[]={ DUMMY_TR("Add directory to search path")}, {OPT_ID('o'), "oneroot", 0, NULL, - DUMMY_TR("Manage default root window/non-Xinerama screen only")}, + DUMMY_TR("Manage default screen only")}, -#if defined(CF_XINERAMA) || defined(CF_SUN_XINERAMA) - {OPT_ID('x'), "xinerama", OPT_ARG, "1|0", - DUMMY_TR("Use Xinerama screen information (default: 1/yes)")}, -#else - {OPT_ID('x'), "xinerama", OPT_ARG, "?", - DUMMY_TR("Ignored: not compiled with Xinerama support")}, -#endif - {OPT_ID('s'), "session", OPT_ARG, "session_name", DUMMY_TR("Name of session (affects savefiles)")}, @@ -189,17 +181,6 @@ int main(int argc, char*argv[]) case OPT_ID('o'): stflags|=IONCORE_STARTUP_ONEROOT; break; - case OPT_ID('x'): - { - const char *p=optparser_get_arg(); - if(strcmp(p, "1")==0) - stflags&=~IONCORE_STARTUP_NOXINERAMA; - else if(strcmp(p, "0")==0) - stflags|=IONCORE_STARTUP_NOXINERAMA; - else - warn(TR("Invalid parameter to -xinerama.")); - } - break; case OPT_ID('s'): extl_set_sessiondir(optparser_get_arg()); break; diff --git a/ioncore/Makefile b/ioncore/Makefile index c0bd8d9..c98fc61 100644 --- a/ioncore/Makefile +++ b/ioncore/Makefile @@ -23,7 +23,8 @@ SOURCES=binding.c conf-bindings.c cursor.c event.c exec.c focus.c \ kbresize.c rectangle.c xwindow.c presize.c extlrx.c \ pholder.c mplexpholder.c llist.c basicpholder.c sizepolicy.c \ stacking.c group.c grouppholder.c group-cw.c navi.c \ - group-ws.c float-placement.c groupedpholder.c framedpholder.c + group-ws.c float-placement.c groupedpholder.c framedpholder.c \ + return.c detach.c LUA_SOURCES=\ ioncore_ext.lua ioncore_luaext.lua ioncore_bindings.lua \ diff --git a/ioncore/activity.c b/ioncore/activity.c index 0f7b7a6..668d10a 100644 --- a/ioncore/activity.c +++ b/ioncore/activity.c @@ -1,7 +1,7 @@ /* * ion/ioncore/activity.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -32,7 +32,7 @@ void region_mark_mgd_activity(WRegion *mgr) mgr->mgd_activity++; if(!mgr_marked){ - region_notify_change(mgr, "sub-activity"); + region_notify_change(mgr, ioncore_g.notifies.sub_activity); region_mark_mgd_activity(REGION_MANAGER(mgr)); } } @@ -46,7 +46,7 @@ void region_clear_mgd_activity(WRegion *mgr) mgr->mgd_activity=maxof(0, mgr->mgd_activity-1); if(!region_is_activity_r(mgr)){ - region_notify_change(mgr, "sub-activity"); + region_notify_change(mgr, ioncore_g.notifies.sub_activity); region_clear_mgd_activity(REGION_MANAGER(mgr)); } } @@ -89,7 +89,7 @@ bool region_set_activity(WRegion *reg, int sp) propagate_clear(reg); } - region_notify_change(reg, "activity"); + region_notify_change(reg, ioncore_g.notifies.activity); return nset; } @@ -124,22 +124,15 @@ bool region_is_activity_r(WRegion *reg) /*EXTL_DOC - * Return list of regions with activity/urgency bit set. + * Iterate over activity list until \var{iterfn} returns \code{false}. + * The function itself returns \code{true} if it reaches the end of list + * without this happening. */ EXTL_SAFE EXTL_EXPORT -ExtlTab ioncore_activity_list() +bool ioncore_activity_i(ExtlFn iterfn) { - ExtlTab t=extl_create_table(); - ObjListIterTmp tmp; - Obj *obj; - int i=1; - - FOR_ALL_ON_OBJLIST(Obj*, obj, actlist, tmp){ - extl_table_seti_o(t, i, obj); - } - - return t; + return extl_iter_objlist(iterfn, actlist); } diff --git a/ioncore/activity.h b/ioncore/activity.h index 912e883..5971a6c 100644 --- a/ioncore/activity.h +++ b/ioncore/activity.h @@ -1,7 +1,7 @@ /* * ion/ioncore/activity.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -24,7 +24,7 @@ extern bool region_is_activity_r(WRegion *reg); extern void region_mark_mgd_activity(WRegion *mgr); extern void region_clear_mgd_activity(WRegion *mgr); -extern ExtlTab ioncore_activity_list(); +extern bool ioncore_activity_i(ExtlFn fn); extern WRegion *ioncore_activity_first(); extern bool ioncore_goto_activity(); diff --git a/ioncore/attach.c b/ioncore/attach.c index 23004cb..4eeb64e 100644 --- a/ioncore/attach.c +++ b/ioncore/attach.c @@ -1,7 +1,7 @@ /* * ion/ioncore/attach.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -35,7 +35,7 @@ static WRegion *doit_new(WRegion *mgr, if(reg==NULL) return NULL; - + if(!cont(mgr, reg, cont_param)){ destroy_obj((Obj*)reg); return NULL; @@ -90,21 +90,31 @@ static WRegion *wrap_load(WWindow *par, const WFitParams *fp, } +WRegion *ioncore_newly_created=NULL; + + static WRegion *doit_load(WRegion *mgr, WWindow *par, const WFitParams *fp, WRegionDoAttachFn *cont, void *cont_param, ExtlTab tab) { - WRegion *reg; + WRegion *reg=NULL; if(extl_table_gets_o(tab, "reg", (Obj**)®)){ if(!OBJ_IS(reg, WRegion)) return FALSE; + }/*else if(extl_table_is_bool_set(tab, "reg_use_new")){ + reg=ioncore_newly_created; + if(reg==NULL) + return NULL; + }*/ + + if(reg!=NULL){ return doit_reparent(mgr, par, fp, cont, cont_param, reg); + }else{ + return doit_new(mgr, par, fp, cont, cont_param, + (WRegionCreateFn*)wrap_load, &tab); } - - return doit_new(mgr, par, fp, cont, cont_param, - (WRegionCreateFn*)wrap_load, &tab); } WRegion *region_attach_helper(WRegion *mgr, diff --git a/ioncore/attach.h b/ioncore/attach.h index 9183ee2..8fb94d8 100644 --- a/ioncore/attach.h +++ b/ioncore/attach.h @@ -1,7 +1,7 @@ /* * ion/ioncore/attach.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -56,4 +56,5 @@ extern WRegion *region_attach_helper(WRegion *mgr, extern bool region_attach_reparent_check(WRegion *mgr, WRegion *reg); + #endif /* ION_IONCORE_ATTACH_H */ diff --git a/ioncore/basicpholder.c b/ioncore/basicpholder.c index b8b2e96..d5c85a4 100644 --- a/ioncore/basicpholder.c +++ b/ioncore/basicpholder.c @@ -1,7 +1,7 @@ /* * ion/ioncore/basicpholder.c * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/basicpholder.h b/ioncore/basicpholder.h index 5008537..6b0df42 100644 --- a/ioncore/basicpholder.h +++ b/ioncore/basicpholder.h @@ -1,7 +1,7 @@ /* * ion/ioncore/basicpholder.h * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/binding.c b/ioncore/binding.c index 4d03abd..7b80d11 100644 --- a/ioncore/binding.c +++ b/ioncore/binding.c @@ -1,7 +1,7 @@ /* * ion/ioncore/binding.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/binding.h b/ioncore/binding.h index 8e13d34..a776a64 100644 --- a/ioncore/binding.h +++ b/ioncore/binding.h @@ -1,7 +1,7 @@ /* * ion/ioncore/binding.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/bindmaps.c b/ioncore/bindmaps.c index dd4a1d0..9c6bd46 100644 --- a/ioncore/bindmaps.c +++ b/ioncore/bindmaps.c @@ -1,7 +1,7 @@ /* * ion/ioncore/bindmaps.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -23,7 +23,7 @@ */ -WBindmap *ioncore_rootwin_bindmap=NULL; +WBindmap *ioncore_screen_bindmap=NULL; WBindmap *ioncore_mplex_bindmap=NULL; WBindmap *ioncore_mplex_toplevel_bindmap=NULL; WBindmap *ioncore_frame_bindmap=NULL; @@ -56,7 +56,7 @@ static StringIntMap frame_areas[]={ void ioncore_deinit_bindmaps() { - DO_FREE(rootwin, "WScreen"); + DO_FREE(screen, "WScreen"); DO_FREE(mplex, "WMPlex"); DO_FREE(mplex_toplevel, "WMPlex.toplevel"); DO_FREE(frame, "WFrame"); @@ -86,7 +86,7 @@ bool ioncore_init_bindmaps() if(known_bindmaps==NULL) return FALSE; - DO_ALLOC(rootwin, "WScreen", NULL); + DO_ALLOC(screen, "WScreen", NULL); DO_ALLOC(mplex, "WMPlex", NULL); DO_ALLOC(mplex_toplevel, "WMPlex.toplevel", NULL); DO_ALLOC(frame, "WFrame", frame_areas); diff --git a/ioncore/bindmaps.h b/ioncore/bindmaps.h index bef0ae0..441aabb 100644 --- a/ioncore/bindmaps.h +++ b/ioncore/bindmaps.h @@ -1,7 +1,7 @@ /* * ion/ioncore/bindmaps.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -15,7 +15,7 @@ #ifndef ION_IONCORE_BINDMAP_H #define ION_IONCORE_BINDMAP_H -extern WBindmap *ioncore_rootwin_bindmap; +extern WBindmap *ioncore_screen_bindmap; extern WBindmap *ioncore_mplex_bindmap; extern WBindmap *ioncore_mplex_toplevel_bindmap; extern WBindmap *ioncore_frame_bindmap; diff --git a/ioncore/classes.h b/ioncore/classes.h index c990b14..3836bc7 100644 --- a/ioncore/classes.h +++ b/ioncore/classes.h @@ -1,7 +1,7 @@ /* * ion/ioncore/classes.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -33,6 +33,7 @@ INTRCLASS(WGroupWS); INTRCLASS(WPHolder); INTRCLASS(WMPlexPHolder); +INTRCLASS(WFramedPHolder); INTRSTRUCT(WStacking); INTRSTRUCT(WLListNode); diff --git a/ioncore/clientwin.c b/ioncore/clientwin.c index 4b4dbe4..d80c37b 100644 --- a/ioncore/clientwin.c +++ b/ioncore/clientwin.c @@ -1,7 +1,7 @@ /* * ion/ioncore/clientwin.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -41,6 +41,8 @@ #include "netwm.h" #include "xwindow.h" #include "bindmaps.h" +#include "return.h" +#include "conf.h" static void set_clientwin_state(WClientWin *cwin, int state); @@ -78,22 +80,6 @@ void clientwin_get_protocols(WClientWin *cwin) } -static bool get_winprop_fn_set=FALSE; -static ExtlFn get_winprop_fn; - -/*EXTL_DOC - * Set function used to look up winprops. - */ -EXTL_EXPORT -void ioncore_set_get_winprop_fn(ExtlFn fn) -{ - if(get_winprop_fn_set) - extl_unref_fn(get_winprop_fn); - get_winprop_fn=extl_ref_fn(fn); - get_winprop_fn_set=TRUE; -} - - static WSizePolicy get_sizepolicy_winprop(WClientWin *cwin, const char *propname, WSizePolicy value) @@ -118,17 +104,8 @@ static void clientwin_get_winprops(WClientWin *cwin) { ExtlTab tab, tab2; int i1, i2; - bool ret; - if(!get_winprop_fn_set) - return; - - extl_protect(NULL); - ret=extl_call(get_winprop_fn, "o", "t", cwin, &tab); - extl_unprotect(NULL); - - if(!ret) - return; + tab=ioncore_get_winprop(cwin); cwin->proptab=tab; @@ -346,8 +323,6 @@ static bool clientwin_init(WClientWin *cwin, WWindow *par, Window win, cwin->n_cmapwins=0; cwin->event_mask=IONCORE_EVENTMASK_CLIENTWIN; - cwin->fs_pholder=NULL; - region_init(&(cwin->region), par, &fp); cwin->region.flags|=REGION_GRAB_ON_PARENT; @@ -376,26 +351,6 @@ static WClientWin *create_clientwin(WWindow *par, Window win, } -static bool handle_target_prop(WClientWin *cwin, const WManageParams *param) -{ - WRegion *r=NULL; - char *target_name=NULL; - - if(extl_table_gets_s(cwin->proptab, "target", &target_name)){ - r=ioncore_lookup_region(target_name, NULL); - - free(target_name); - - if(r!=NULL){ - if(region_manage_clientwin(r, cwin, param, - MANAGE_REDIR_PREFER_NO)) - return TRUE; - } - } - - return FALSE; -} - WClientWin *clientwin_get_transient_for(const WClientWin *cwin) { @@ -484,6 +439,7 @@ WClientWin* ioncore_manage_clientwin(Window win, bool maprq) XWMHints *hints; int init_state=NormalState; WManageParams param=MANAGEPARAMS_INIT; + void *mrshpm[2]; param.dockapp=FALSE; @@ -581,21 +537,14 @@ again: FALSE); } - if(!handle_target_prop(cwin, ¶m)){ - bool managed; - void *mrshpm[2]; - - mrshpm[0]=cwin; - mrshpm[1]=¶m; + mrshpm[0]=cwin; + mrshpm[1]=¶m; - managed=hook_call_alt(clientwin_do_manage_alt, &mrshpm, - (WHookMarshall*)do_manage_mrsh, - (WHookMarshallExtl*)do_manage_mrsh_extl); - - if(!managed){ - warn(TR("Unable to manage client window %#x."), win); - goto failure; - } + if(!hook_call_alt(clientwin_do_manage_alt, &mrshpm, + (WHookMarshall*)do_manage_mrsh, + (WHookMarshallExtl*)do_manage_mrsh_extl)){ + warn(TR("Unable to manage client window %#x."), win); + goto failure; } if(ioncore_g.opmode==IONCORE_OPMODE_NORMAL && @@ -604,7 +553,6 @@ again: region_set_activity((WRegion*)cwin, SETPARAM_SET); } - if(postmanage_check(cwin, &attr)){ if(param.jumpto && ioncore_g.focus_next==NULL) region_goto((WRegion*)cwin); @@ -696,6 +644,8 @@ void clientwin_deinit(WClientWin *cwin) WRegion *reg; if(cwin->win!=None){ + region_pointer_focus_hack(&cwin->region); + xwindow_unmanaged_selectinput(cwin->win, 0); XUnmapWindow(ioncore_g.dpy, cwin->win); @@ -721,12 +671,6 @@ void clientwin_deinit(WClientWin *cwin) clientwin_clear_colormaps(cwin); - if(cwin->fs_pholder!=NULL){ - WPHolder *ph=cwin->fs_pholder; - cwin->fs_pholder=NULL; - destroy_obj((Obj*)ph); - } - region_deinit((WRegion*)cwin); } @@ -747,12 +691,7 @@ static bool mrsh_u_extl(ExtlFn fn, void *param) static void clientwin_do_unmapped(WClientWin *cwin, Window win) { - bool mcf=region_may_control_focus((WRegion*)cwin); - - if(mcf && cwin->fs_pholder!=NULL) - pholder_goto(cwin->fs_pholder); - - destroy_obj((Obj*)cwin); + region_dispose_((WRegion*)cwin); hook_call(clientwin_unmapped_hook, &win, mrsh_u_c, mrsh_u_extl); } @@ -843,6 +782,8 @@ static void set_clientwin_state(WClientWin *cwin, int state) static void hide_clientwin(WClientWin *cwin) { + region_pointer_focus_hack(&cwin->region); + if(cwin->flags&CLIENTWIN_PROP_ACROBATIC){ XMoveWindow(ioncore_g.dpy, cwin->win, -2*REGION_GEOM(cwin).w, -2*REGION_GEOM(cwin).h); @@ -981,15 +922,8 @@ static bool clientwin_fitrep(WClientWin *cwin, WWindow *np, region_set_parent((WRegion*)cwin, np); sendconfig_clientwin(cwin); - if(!REGION_IS_FULLSCREEN(cwin) && cwin->fs_pholder!=NULL){ - WPHolder *ph=cwin->fs_pholder; - cwin->fs_pholder=NULL; + if(!REGION_IS_FULLSCREEN(cwin)) cwin->flags&=~CLIENTWIN_FS_RQ; - /* Can't destroy it yet - messes up mplex placeholder - * reorganisation. - */ - mainloop_defer_destroy((Obj*)ph); - } netwm_update_state(cwin); } diff --git a/ioncore/clientwin.h b/ioncore/clientwin.h index 2080d3d..f78e826 100644 --- a/ioncore/clientwin.h +++ b/ioncore/clientwin.h @@ -1,7 +1,7 @@ /* * ion/ioncore/clientwin.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -58,8 +58,6 @@ DECLCLASS(WClientWin){ XSizeHints size_hints; - WPHolder *fs_pholder; - ExtlTab proptab; }; diff --git a/ioncore/colormap.c b/ioncore/colormap.c index 83c3b75..564336d 100644 --- a/ioncore/colormap.c +++ b/ioncore/colormap.c @@ -1,7 +1,7 @@ /* * ion/ioncore/colormap.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/colormap.h b/ioncore/colormap.h index b44f7fd..143f1ec 100644 --- a/ioncore/colormap.h +++ b/ioncore/colormap.h @@ -1,7 +1,7 @@ /* * ion/ioncore/colormap.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/common.h b/ioncore/common.h index 4959a5b..61bd5df 100644 --- a/ioncore/common.h +++ b/ioncore/common.h @@ -1,7 +1,7 @@ /* * ion/ioncore/common.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/conf-bindings.c b/ioncore/conf-bindings.c index e39b811..56d679e 100644 --- a/ioncore/conf-bindings.c +++ b/ioncore/conf-bindings.c @@ -1,7 +1,7 @@ /* * ion/ioncore/conf-bindings.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/conf-bindings.h b/ioncore/conf-bindings.h index c888a6f..e86c871 100644 --- a/ioncore/conf-bindings.h +++ b/ioncore/conf-bindings.h @@ -1,7 +1,7 @@ /* * ion/ioncore/conf-bindings.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/conf.c b/ioncore/conf.c index 207c1c1..62c91f1 100644 --- a/ioncore/conf.c +++ b/ioncore/conf.c @@ -1,7 +1,7 @@ /* * ion/ioncore/conf.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -36,6 +36,12 @@ StringIntMap frame_idxs[]={ END_STRINGINTMAP }; +static bool get_winprop_fn_set=FALSE; +static ExtlFn get_winprop_fn; + +static bool get_layout_fn_set=FALSE; +static ExtlFn get_layout_fn; + /*EXTL_DOC * Set ioncore basic settings. The table \var{tab} may contain the @@ -70,8 +76,6 @@ StringIntMap frame_idxs[]={ * \var{float_placement_method} & (string) How to place floating frames. * One of ''udlr'' (up-down, then left-right), * ''lrud'' (left-right, then up-down) or ''random''. \\ - * \var{default_ws_params} & (table) Default workspace layout; the - * attach/creation parameters for a \type{WGroup}. \\ * \end{tabularx} * * When a keyboard resize function is called, and at most \var{kbresize_t_max} @@ -88,6 +92,7 @@ void ioncore_set(ExtlTab tab) int dd, rd; char *wst, *tmp; ExtlTab t; + ExtlFn fn; extl_table_gets_b(tab, "opaque_resize", &(ioncore_g.opaque_resize)); extl_table_gets_b(tab, "warp", &(ioncore_g.warp_enabled)); @@ -108,6 +113,22 @@ void ioncore_set(ExtlTab tab) ioncore_set_moveres_accel(tab); ioncore_groupws_set(tab); + + /* Internal -- therefore undocumented above */ + if(extl_table_gets_f(tab, "_get_winprop", &fn)){ + if(get_winprop_fn_set) + extl_unref_fn(get_winprop_fn); + get_winprop_fn=fn; + get_winprop_fn_set=TRUE; + } + + if(extl_table_gets_f(tab, "_get_layout", &fn)){ + if(get_layout_fn_set) + extl_unref_fn(get_layout_fn); + get_layout_fn=fn; + get_layout_fn_set=TRUE; + } + } @@ -137,7 +158,35 @@ ExtlTab ioncore_get() return tab; } - + + +ExtlTab ioncore_get_winprop(WClientWin *cwin) +{ + ExtlTab tab=extl_table_none(); + + if(get_winprop_fn_set){ + extl_protect(NULL); + extl_call(get_winprop_fn, "o", "t", cwin, &tab); + extl_unprotect(NULL); + } + + return tab; +} + + +ExtlTab ioncore_get_layout(const char *layout) +{ + ExtlTab tab=extl_table_none(); + + if(get_layout_fn_set){ + extl_protect(NULL); + extl_call(get_layout_fn, "s", "t", layout, &tab); + extl_unprotect(NULL); + } + + return tab; +} + /*EXTL_DOC * Get important directories (userdir, sessiondir, searchpath). @@ -232,7 +281,7 @@ bool ioncore_read_main_config(const char *cfgfile) ret=extl_read_config(cfgfile, ".", TRUE); - unset+=(ioncore_rootwin_bindmap->nbindings==0); + unset+=(ioncore_screen_bindmap->nbindings==0); unset+=(ioncore_mplex_bindmap->nbindings==0); unset+=(ioncore_frame_bindmap->nbindings==0); diff --git a/ioncore/conf.h b/ioncore/conf.h index da3679b..696852d 100644 --- a/ioncore/conf.h +++ b/ioncore/conf.h @@ -1,7 +1,7 @@ /* * ion/ioncore/conf.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -14,4 +14,7 @@ extern bool ioncore_read_main_config(const char *cfgfile); +extern ExtlTab ioncore_get_winprop(WClientWin *cwin); +extern ExtlTab ioncore_get_layout(const char *str); + #endif /* ION_IONCORE_CONF_H */ diff --git a/ioncore/cursor.c b/ioncore/cursor.c index 31ea25b..6973a16 100644 --- a/ioncore/cursor.c +++ b/ioncore/cursor.c @@ -1,7 +1,7 @@ /* * ion/ioncore/cursor.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/cursor.h b/ioncore/cursor.h index 0137e8c..8d03f79 100644 --- a/ioncore/cursor.h +++ b/ioncore/cursor.h @@ -1,7 +1,7 @@ /* * ion/ioncore/cursor.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/detach.c b/ioncore/detach.c new file mode 100644 index 0000000..c93ca0c --- /dev/null +++ b/ioncore/detach.c @@ -0,0 +1,194 @@ +/* + * ion/ioncore/detach.c + * + * Copyright (c) Tuomo Valkonen 1999-2007. + * + * Ion is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +static void get_relative_geom(WRectangle *g, WRegion *reg, WRegion *mgr) +{ + WWindow *rel=REGION_PARENT(mgr), *w; + + *g=REGION_GEOM(reg); + + for(w=REGION_PARENT(reg); + w!=rel && (WRegion*)w!=mgr; + w=REGION_PARENT(w)){ + + g->x+=REGION_GEOM(w).x; + g->y+=REGION_GEOM(w).y; + } +} + + +bool ioncore_do_detach(WRegion *reg, WGroup *grp, WFrameMode framemode) +{ + WGroupAttachParams ap=GROUPATTACHPARAMS_INIT; + WRegionAttachData data; + WPHolder *ph; + bool newph=FALSE; + bool ret; + + ap.switchto_set=TRUE; + ap.switchto=region_may_control_focus(reg); + + data.type=REGION_ATTACH_REPARENT; + data.u.reg=reg; + + ph=region_unset_get_return(reg); + + if(ph==NULL){ + ph=region_make_return_pholder(reg); + newph=TRUE; + } + + if(framemode!=FRAME_MODE_UNKNOWN){ + WFramedParam fpa=FRAMEDPARAM_INIT; + + fpa.mode=framemode; + fpa.inner_geom_gravity_set=TRUE; + fpa.gravity=ForgetGravity; + + ap.geom_weak_set=TRUE; + ap.geom_weak=0; + + get_relative_geom(&fpa.inner_geom, reg, (WRegion*)grp); + + ret=(region_attach_framed((WRegion*)grp, &fpa, + (WRegionAttachFn*)group_do_attach, + &ap, &data)!=NULL); + }else{ + WStacking *st=ioncore_find_stacking(reg); + + if(st!=NULL){ + ap.szplcy=st->szplcy; + ap.szplcy_set=TRUE; + + ap.level=maxof(st->level, STACKING_LEVEL_NORMAL); + ap.level_set=TRUE; + } + + ap.geom_set=TRUE; + get_relative_geom(&ap.geom, reg, (WRegion*)grp); + + ret=(group_do_attach(grp, &ap, &data)!=NULL); + } + + if(!ret && newph) + destroy_obj((Obj*)ph); + else if(!region_do_set_return(reg, ph)) + destroy_obj((Obj*)ph); + + return ret; +} + + +static WRegion *check_mplex(WRegion *reg, WFrameMode *mode) +{ + WMPlex *mplex=REGION_MANAGER_CHK(reg, WMPlex); + + if(OBJ_IS(reg, WWindow) || mplex==NULL){ + *mode=FRAME_MODE_UNKNOWN; + return reg; + } + + *mode=FRAME_MODE_FLOATING; + + if(OBJ_IS(mplex, WFrame) + && frame_mode((WFrame*)mplex)==FRAME_MODE_TRANSIENT){ + *mode=FRAME_MODE_TRANSIENT; + } + + return (WRegion*)mplex; +} + + +static WGroup *find_group(WRegion *reg) +{ + WRegion *mgr=REGION_MANAGER(reg); + + while(mgr!=NULL){ + mgr=REGION_MANAGER(mgr); + if(OBJ_IS(mgr, WGroup)) + break; + } + + return (WGroup*)mgr; +} + + +bool ioncore_detach(WRegion *reg, int sp) +{ + WPHolder *ph=region_get_return(reg); + WFrameMode mode; + WGroup *grp; + bool set, nset; + + reg=region_group_if_bottom(reg); + + grp=find_group(check_mplex(reg, &mode)); + + /* reg is only considered detached if there's no higher-level group + * to attach to, thus causing 'toggle' to cycle. + */ + set=(grp==NULL); + nset=libtu_do_setparam(sp, set); + + if(!XOR(nset, set)) + return set; + + if(!set){ + return ioncore_do_detach(reg, grp, mode); + }else{ + WPHolder *ph=region_get_return(reg); + + if(ph!=NULL){ + if(!pholder_attach_mcfgoto(ph, PHOLDER_ATTACH_SWITCHTO, reg)){ + warn(TR("Failed to reattach.")); + return TRUE; + } + region_unset_return(reg); + } + + return FALSE; + } +} + + +/*EXTL_DOC + * Detach or reattach \var{reg}, depending on whether \var{how} + * is 'set'/'unset'/'toggle'. (Detaching means making \var{reg} + * managed by its nearest ancestor \type{WGroup}, framed if \var{reg} is + * not itself \type{WFrame}. Reattaching means making it managed where + * it used to be managed, if a return-placeholder exists.) + * If \var{reg} is the 'bottom' of some group, the whole group is + * detached. If \var{reg} is a \type{WWindow}, it is put into a + * frame. + */ +EXTL_EXPORT_AS(ioncore, detach) +bool ioncore_detach_extl(WRegion *reg, const char *how) +{ + if(how==NULL) + how="set"; + + return ioncore_detach(reg, libtu_string_to_setparam(how)); +} + + diff --git a/ioncore/detach.h b/ioncore/detach.h new file mode 100644 index 0000000..30b4a4a --- /dev/null +++ b/ioncore/detach.h @@ -0,0 +1,20 @@ +/* + * ion/ioncore/detach.h + * + * Copyright (c) Tuomo Valkonen 1999-2007. + * + * Ion is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + */ + +#ifndef ION_IONCORE_DETACH_H +#define ION_IONCORE_DETACH_H + +#include "region.h" + +extern bool ioncore_detach(WRegion *reg, int sp); + +#endif /* ION_IONCORE_DETACH_H */ + diff --git a/ioncore/dummywc.h b/ioncore/dummywc.h index f3343be..6d1a491 100644 --- a/ioncore/dummywc.h +++ b/ioncore/dummywc.h @@ -1,7 +1,7 @@ /* * ion/ioncore/dummywc.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/event.c b/ioncore/event.c index 84943d5..9a3b957 100644 --- a/ioncore/event.c +++ b/ioncore/event.c @@ -1,7 +1,7 @@ /* * ion/ioncore/event.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/event.h b/ioncore/event.h index 1bf227d..b81edf1 100644 --- a/ioncore/event.h +++ b/ioncore/event.h @@ -1,7 +1,7 @@ /* * ion/ioncore/event.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -37,6 +37,10 @@ PropertyChangeMask|FocusChangeMask| \ StructureNotifyMask|EnterWindowMask) +#define IONCORE_EVENTMASK_SCREEN (FocusChangeMask|EnterWindowMask| \ + KeyPressMask|KeyReleaseMask| \ + ButtonPressMask|ButtonReleaseMask) + extern void ioncore_x_connection_handler(int conn, void *unused); extern void ioncore_flush(); extern void ioncore_get_event(XEvent *ev, long mask); diff --git a/ioncore/eventh.c b/ioncore/eventh.c index 91ab550..5e1e1fe 100644 --- a/ioncore/eventh.c +++ b/ioncore/eventh.c @@ -1,7 +1,7 @@ /* * ion/ioncore/eventh.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -305,9 +305,6 @@ void ioncore_handle_expose(const XExposeEvent *ev) /*{{{ Enter window, focus */ -/*extern Time ioncore_focus_time;*/ - - static void do_handle_enter_window(XEvent *ev) { XEnterWindowEvent *eev=&(ev->xcrossing); @@ -316,15 +313,6 @@ static void do_handle_enter_window(XEvent *ev) if(ioncore_g.input_mode!=IONCORE_INPUTMODE_NORMAL) return; - /*if(ioncore_g.focus_next!=NULL && ioncore_focus_time==CurrentTime) - return;*/ - - /*if(ioncore_await_warp()) - return; - - if(eev->mode!=NotifyNormal && !ioncore_g.warp_enabled) - return;*/ - reg=XWINDOW_REGION_OF_T(eev->window, WRegion); if(reg==NULL) @@ -335,9 +323,10 @@ static void do_handle_enter_window(XEvent *ev) if(region_skip_focus(reg)) return; - + /* If a child of 'reg' is to be focused, do not process this - * event. + * event. (ioncore_g.focus_next should only be set here by + * another call to use from ioncore_handle_enter_window below.) */ if(ioncore_g.focus_next!=NULL){ WRegion *r2=ioncore_g.focus_next; @@ -397,8 +386,7 @@ void ioncore_handle_focus_in(const XFocusChangeEvent *ev, bool skip) if(ev->detail==NotifyPointer) return; - /* Root windows appear either as WRootWins or WScreens */ - if(ev->window==region_root_of(reg)){ + if(ev->window==region_root_of(reg)){ /* OBJ_IS(reg, WRootWin) */ D(fprintf(stderr, "scr-in %d %d %d\n", ROOTWIN_OF(reg)->xscr, ev->mode, ev->detail)); if((ev->detail==NotifyPointerRoot || ev->detail==NotifyDetailNone) && @@ -408,7 +396,6 @@ void ioncore_handle_focus_in(const XFocusChangeEvent *ev, bool skip) region_set_focus(reg); return; } - /*return;*/ } /* Input contexts */ diff --git a/ioncore/eventh.h b/ioncore/eventh.h index f80257b..84257a4 100644 --- a/ioncore/eventh.h +++ b/ioncore/eventh.h @@ -1,7 +1,7 @@ /* * ion/ioncore/eventh.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/exec.c b/ioncore/exec.c index 10c8267..4147172 100644 --- a/ioncore/exec.c +++ b/ioncore/exec.c @@ -1,7 +1,7 @@ /* * ion/ioncore/exec.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/exec.h b/ioncore/exec.h index 63c8917..b7f9bce 100644 --- a/ioncore/exec.h +++ b/ioncore/exec.h @@ -1,7 +1,7 @@ /* * ion/ioncore/exec.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/extlconv.c b/ioncore/extlconv.c index 5f23b74..9fc7af9 100644 --- a/ioncore/extlconv.c +++ b/ioncore/extlconv.c @@ -1,7 +1,7 @@ /* * ion/ioncore/extlconv.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -19,21 +19,43 @@ /*{{{ Object list */ -ExtlTab extl_obj_iterable_to_table(ObjIterator *iter, void *st) +bool extl_iter_objlist_(ExtlFn fn, ObjIterator *iter, void *st) { - ExtlTab tab=extl_create_table(); - int i=1; Obj *obj; while(1){ obj=iter(st); if(obj==NULL) break; - if(extl_table_seti_o(tab, i, obj)) - i++; + if(!extl_iter_obj(fn, obj)) + return FALSE; } - return tab; + return TRUE; +} + + +bool extl_iter_objlist(ExtlFn fn, ObjList *list) +{ + ObjListIterTmp tmp; + + objlist_iter_init(&tmp, list); + + return extl_iter_objlist_(fn, (ObjIterator*)objlist_iter, &tmp); +} + + +bool extl_iter_obj(ExtlFn fn, Obj *obj) +{ + bool ret1, ret2=FALSE; + + extl_protect(NULL); + + ret1=extl_call(fn, "o", "b", obj, &ret2); + + extl_unprotect(NULL); + + return (ret1 && ret2); } diff --git a/ioncore/extlconv.h b/ioncore/extlconv.h index b4e3b80..28fbb95 100644 --- a/ioncore/extlconv.h +++ b/ioncore/extlconv.h @@ -1,7 +1,7 @@ /* * ion/ioncore/extlconv.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -15,10 +15,13 @@ #include #include #include +#include #include "common.h" #include "region.h" -extern ExtlTab extl_obj_iterable_to_table(ObjIterator *iter, void *st); +extern bool extl_iter_obj(ExtlFn fn, Obj *obj); +extern bool extl_iter_objlist_(ExtlFn fn, ObjIterator *iter, void *st); +extern bool extl_iter_objlist(ExtlFn fn, ObjList *list); extern bool extl_table_is_bool_set(ExtlTab tab, const char *entry); diff --git a/ioncore/extlrx.c b/ioncore/extlrx.c index b9a380e..a13038a 100644 --- a/ioncore/extlrx.c +++ b/ioncore/extlrx.c @@ -1,7 +1,7 @@ /* * ion/ioncore/extlrx.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/float-placement.c b/ioncore/float-placement.c index 399f5ec..8d5fb21 100644 --- a/ioncore/float-placement.c +++ b/ioncore/float-placement.c @@ -1,7 +1,7 @@ /* * ion/ioncore/float-placement.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/float-placement.h b/ioncore/float-placement.h index 0f52daf..2dc062d 100644 --- a/ioncore/float-placement.h +++ b/ioncore/float-placement.h @@ -1,7 +1,7 @@ /* * ion/ioncore/float-placement.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/focus.c b/ioncore/focus.c index fb2159b..c25ec71 100644 --- a/ioncore/focus.c +++ b/ioncore/focus.c @@ -1,7 +1,7 @@ /* * ion/ioncore/focus.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -25,8 +25,6 @@ WHook *region_do_warp_alt=NULL; -WHook *region_activated_hook=NULL; -WHook *region_inactivated_hook=NULL; /*}}}*/ @@ -35,22 +33,27 @@ WHook *region_inactivated_hook=NULL; /*{{{ Focus list */ -void region_focuslist_remove(WRegion *reg) +void region_focuslist_remove_with_mgrs(WRegion *reg) { + WRegion *mgrp=region_manager_or_parent(reg); + UNLINK_ITEM(ioncore_g.focus_current, reg, active_next, active_prev); + + if(mgrp!=NULL) + region_focuslist_remove_with_mgrs(mgrp); } void region_focuslist_push(WRegion *reg) { - region_focuslist_remove(reg); + region_focuslist_remove_with_mgrs(reg); LINK_ITEM_FIRST(ioncore_g.focus_current, reg, active_next, active_prev); } void region_focuslist_move_after(WRegion *reg, WRegion *after) { - region_focuslist_remove(reg); + region_focuslist_remove_with_mgrs(reg); LINK_ITEM_AFTER(ioncore_g.focus_current, after, reg, active_next, active_prev); } @@ -62,8 +65,8 @@ void region_focuslist_deinit(WRegion *reg) if(replace!=NULL) region_focuslist_move_after(replace, reg); - - region_focuslist_remove(reg); + + UNLINK_ITEM(ioncore_g.focus_current, reg, active_next, active_prev); } @@ -99,6 +102,34 @@ WRegion *ioncore_goto_previous() } +/*EXTL_DOC + * Iterate over focus history until \var{iterfn} returns \code{false}. + * The function itself returns \code{true} if it reaches the end of list + * without this happening. + */ +EXTL_EXPORT +bool ioncore_focushistory_i(ExtlFn iterfn) +{ + WRegion *next; + + if(ioncore_g.focus_current==NULL) + return FALSE; + + /* Find the first region on focus history list that isn't currently + * active. + */ + for(next=ioncore_g.focus_current->active_next; + next!=NULL; + next=next->active_next){ + + if(!extl_iter_obj(iterfn, (Obj*)next)) + return FALSE; + } + + return TRUE; +} + + /*}}}*/ @@ -161,9 +192,9 @@ static void check_clear_await(WRegion *reg) } -bool ioncore_await_focus() +WRegion *ioncore_await_focus() { - return (await_watch.obj!=NULL); + return (WRegion*)(await_watch.obj); } @@ -175,7 +206,7 @@ bool ioncore_await_focus() void region_got_focus(WRegion *reg) { - WRegion *par, *mgr, *tmp; + WRegion *par; check_clear_await(reg); @@ -188,30 +219,18 @@ void region_got_focus(WRegion *reg) if(!REGION_IS_ACTIVE(reg)){ D(fprintf(stderr, "got focus (inact) %s [%p]\n", OBJ_TYPESTR(reg), reg);) + reg->flags|=REGION_ACTIVE; + region_set_manager_pseudoactivity(reg); par=REGION_PARENT_REG(reg); if(par!=NULL){ par->active_sub=reg; region_update_owned_grabs(par); } - - region_activated(reg); - mgr=REGION_MANAGER(reg); - tmp=reg; - while(mgr!=NULL){ - /* We need to loop over managing non-windows (workspaces) here to - * signal their managers. - */ - region_managed_activated(mgr, tmp); - - if(REGION_PARENT_REG(reg)==mgr) - break; - - tmp=mgr; - mgr=REGION_MANAGER(mgr); - } + region_activated(reg); + region_notify_change(reg, ioncore_g.notifies.activated); }else{ D(fprintf(stderr, "got focus (act) %s [%p]\n", OBJ_TYPESTR(reg), reg);) } @@ -223,16 +242,12 @@ void region_got_focus(WRegion *reg) */ if(reg->active_sub==NULL && !OBJ_IS(reg, WClientWin)) rootwin_install_colormap(region_rootwin_of(reg), None); - - extl_protect(NULL); - hook_call_o(region_activated_hook, (Obj*)reg); - extl_unprotect(NULL); } void region_lost_focus(WRegion *reg) { - WRegion *r, *par; + WRegion *par; if(!REGION_IS_ACTIVE(reg)){ D(fprintf(stderr, "lost focus (inact) %s [%p:]\n", OBJ_TYPESTR(reg), reg);) @@ -260,14 +275,10 @@ void region_lost_focus(WRegion *reg) D(fprintf(stderr, "lost focus (act) %s [%p:]\n", OBJ_TYPESTR(reg), reg);) reg->flags&=~REGION_ACTIVE; - region_inactivated(reg); - r=REGION_MANAGER(reg); - if(r!=NULL) - region_managed_inactivated(r, reg); + region_unset_manager_pseudoactivity(reg); - extl_protect(NULL); - hook_call_o(region_inactivated_hook, (Obj*)reg); - extl_unprotect(NULL); + region_inactivated(reg); + region_notify_change(reg, ioncore_g.notifies.inactivated); } @@ -290,28 +301,14 @@ bool region_is_active(WRegion *reg) bool region_may_control_focus(WRegion *reg) { - WRegion *par, *r2; - if(OBJ_IS_BEING_DESTROYED(reg)) return FALSE; - if(REGION_IS_ACTIVE(reg)) + if(REGION_IS_ACTIVE(reg) || REGION_IS_PSEUDOACTIVE(reg)) return TRUE; if(region_is_await(reg)) return TRUE; - - par=REGION_PARENT_REG(reg); - - if(par==NULL || !REGION_IS_ACTIVE(par)) - return FALSE; - - r2=par->active_sub; - while(r2!=NULL && r2!=par){ - if(r2==reg) - return TRUE; - r2=REGION_MANAGER(r2); - } return FALSE; } @@ -395,6 +392,14 @@ void region_maybewarp(WRegion *reg, bool warp) } +void region_maybewarp_now(WRegion *reg, bool warp) +{ + ioncore_g.focus_next=NULL; + /* TODO: what if focus isn't set? Should focus_next be reset then? */ + region_do_set_focus(reg, warp); +} + + void region_set_focus(WRegion *reg) { region_maybewarp(reg, FALSE); @@ -432,4 +437,49 @@ WRegion *ioncore_current() return ioncore_g.focus_current; } + +/*}}}*/ + + +/*{{{ Pointer focus hack */ + + +/* This ugly hack tries to prevent focus change, when the pointer is + * in a window to be unmapped (or destroyed), and that does not have + * the focus, or should not soon have it. + */ +void region_pointer_focus_hack(WRegion *reg) +{ + WRegion *act=ioncore_await_focus(); + const WRectangle *g=®ION_GEOM(reg); + int x, y; + + if(ioncore_g.opmode!=IONCORE_OPMODE_NORMAL) + return; + + if(!REGION_IS_ACTIVE(reg) && act==NULL) + act=ioncore_g.focus_current; + + if(act==NULL || OBJ_IS_BEING_DESTROYED(act)) + return; + + /* Ok, anything under us should not get focus as we're unmapped: + * Either we don't have the focus, or focus change somewhere else + * is pending. + * + * It might be possible to do the pointer check more efficiently + * by trying to maintain our internal pointer containment state + * by tracking Enter/Leave events... + */ + + xwindow_pointer_pos(region_xwindow(reg), &x, &y); + + if(x>=0 && y>=0 && xw && yh){ + D(fprintf(stderr, "Pointer here and shouldn't alter focus!\n")); + region_set_focus(act); + } +} + + /*}}}*/ + diff --git a/ioncore/focus.h b/ioncore/focus.h index e995d6d..683d8ae 100644 --- a/ioncore/focus.h +++ b/ioncore/focus.h @@ -1,7 +1,7 @@ /* * ion/ioncore/focus.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -17,22 +17,24 @@ #include "window.h" #include "region.h" -DYNFUN void region_do_set_focus(WRegion *reg, bool warp); /* Delayed (until return to main loop) warp/focus */ -extern void region_warp(WRegion *reg); -extern void region_set_focus(WRegion *reg); extern void region_maybewarp(WRegion *reg, bool warp); +/* warp/focus now; do not skip enter window events etc. in mainloop */ +extern void region_maybewarp_now(WRegion *reg, bool warp); -/* Immediate warp/focus */ -extern void region_do_warp(WRegion *reg); -extern bool region_do_warp_default(WRegion *reg); +extern void region_warp(WRegion *reg); /* maybewarp TRUE */ +extern void region_set_focus(WRegion *reg); /* maybewarp FALSE */ extern void region_finalise_focusing(WRegion* reg, Window win, bool warp); +DYNFUN void region_do_set_focus(WRegion *reg, bool warp); +extern void region_do_warp(WRegion *reg); +extern bool region_do_warp_default(WRegion *reg); + /* Awaiting focus state */ extern void region_set_await_focus(WRegion *reg); -extern bool ioncore_await_focus(); +extern WRegion *ioncore_await_focus(); /* Event handling */ extern void region_got_focus(WRegion *reg); @@ -45,20 +47,20 @@ extern bool region_may_control_focus(WRegion *reg); extern bool region_is_active(WRegion *reg); /* Focus history */ -extern void region_focuslist_remove(WRegion *reg); +extern void region_focuslist_remove_with_mgrs(WRegion *reg); extern void region_focuslist_push(WRegion *reg); extern void region_focuslist_move_after(WRegion *reg, WRegion *after); extern void region_focuslist_deinit(WRegion *reg); extern WRegion *ioncore_goto_previous(); -/* Handlers to these shook should take WRegion* as parameter. */ +/* Handlers to this hook should take WRegion* as parameter. */ extern WHook *region_do_warp_alt; -extern WHook *region_activated_hook; -extern WHook *region_inactivated_hook; /* Misc. */ extern bool region_skip_focus(WRegion *reg); WRegion *ioncore_current(); +extern void region_pointer_focus_hack(WRegion *reg); + #endif /* ION_IONCORE_FOCUS_H */ diff --git a/ioncore/frame-draw.c b/ioncore/frame-draw.c index 116f10c..6c43fc6 100644 --- a/ioncore/frame-draw.c +++ b/ioncore/frame-draw.c @@ -1,7 +1,7 @@ /* * ion/ioncore/frame-draw.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -20,8 +20,10 @@ #include "framep.h" #include "frame-draw.h" #include "strings.h" +#include "activity.h" #include "names.h" #include "gr.h" +#include "gr-util.h" #define BAR_INSIDE_BORDER(FRAME) \ @@ -30,6 +32,72 @@ #define BAR_H(FRAME) (FRAME)->bar_h +/*{{{ Attributes */ + + +GR_DEFATTR(active); +GR_DEFATTR(inactive); +GR_DEFATTR(selected); +GR_DEFATTR(unselected); +GR_DEFATTR(tagged); +GR_DEFATTR(not_tagged); +GR_DEFATTR(dragged); +GR_DEFATTR(not_dragged); +GR_DEFATTR(activity); +GR_DEFATTR(no_activity); +GR_DEFATTR(quasiactive); +GR_DEFATTR(not_quasiactive); + + +static void ensure_create_attrs() +{ + GR_ALLOCATTR_BEGIN; + GR_ALLOCATTR(active); + GR_ALLOCATTR(inactive); + GR_ALLOCATTR(selected); + GR_ALLOCATTR(unselected); + GR_ALLOCATTR(tagged); + GR_ALLOCATTR(not_tagged); + GR_ALLOCATTR(dragged); + GR_ALLOCATTR(not_dragged); + GR_ALLOCATTR(no_activity); + GR_ALLOCATTR(activity); + GR_ALLOCATTR(quasiactive); + GR_ALLOCATTR(not_quasiactive); + GR_ALLOCATTR_END; +} + + +void frame_update_attr(WFrame *frame, int i, WRegion *reg) +{ + GrStyleSpec *spec; + bool selected, tagged, dragged, activity; + + if(i>=frame->titles_n){ + /* Might happen when deinitialising */ + return; + } + + ensure_create_attrs(); + + spec=&frame->titles[i].attr; + + selected=(reg==FRAME_CURRENT(frame)); + tagged=(reg!=NULL && reg->flags®ION_TAGGED); + dragged=(i==frame->tab_dragged_idx); + activity=(reg!=NULL && region_is_activity_r(reg)); + + gr_stylespec_unalloc(spec); + gr_stylespec_set(spec, selected ? GR_ATTR(selected) : GR_ATTR(unselected)); + gr_stylespec_set(spec, tagged ? GR_ATTR(tagged) : GR_ATTR(not_tagged)); + gr_stylespec_set(spec, dragged ? GR_ATTR(dragged) : GR_ATTR(not_dragged)); + gr_stylespec_set(spec, activity ? GR_ATTR(activity) : GR_ATTR(no_activity)); +} + + +/*}}}*/ + + /*{{{ (WFrame) dynfun default implementations */ @@ -82,7 +150,7 @@ void frame_bar_geom(const WFrame *frame, WRectangle *geom) uint off; if(BAR_INSIDE_BORDER(frame)){ - off=get_spacing(frame); + off=0; /*get_spacing(frame);*/ frame_border_inner_geom(frame, geom); }else{ off=0; @@ -105,10 +173,12 @@ void frame_managed_geom(const WFrame *frame, WRectangle *geom) frame_border_inner_geom(frame, geom); + /* geom->x+=spacing; geom->y+=spacing; geom->w-=2*spacing; geom->h-=2*spacing; + */ if(BAR_INSIDE_BORDER(frame) && BAR_EXISTS(frame)){ geom->y+=frame->bar_h+spacing; @@ -241,7 +311,8 @@ void frame_recalc_bar(WFrame *frame) if(FRAME_MCOUNT(frame)==0){ textw=init_title(frame, i); if(textw>0){ - title=grbrush_make_label(frame->bar_brush, CF_STR_EMPTY, textw); + title=grbrush_make_label(frame->bar_brush, TR(""), + textw); frame->titles[i].text=title; } return; @@ -269,11 +340,22 @@ void frame_recalc_bar(WFrame *frame) } +static void set_common_attrs(const WFrame *frame, GrBrush *brush) +{ + ensure_create_attrs(); + + grbrush_set_attr(brush, REGION_IS_ACTIVE(frame) + ? GR_ATTR(active) + : GR_ATTR(inactive)); + grbrush_set_attr(brush, frame->quasiactive_count>0 + ? GR_ATTR(quasiactive) + : GR_ATTR(not_quasiactive)); +} + + void frame_draw_bar(const WFrame *frame, bool complete) { WRectangle geom; - const char *cattr=(REGION_IS_ACTIVE(frame) - ? "active" : "inactive"); if(frame->bar_brush==NULL || !BAR_EXISTS(frame) @@ -285,27 +367,29 @@ void frame_draw_bar(const WFrame *frame, bool complete) grbrush_begin(frame->bar_brush, &geom, GRBRUSH_AMEND); + set_common_attrs(frame, frame->bar_brush); + grbrush_draw_textboxes(frame->bar_brush, &geom, frame->titles_n, - frame->titles, complete, cattr); + frame->titles, complete); grbrush_end(frame->bar_brush); } - void frame_draw(const WFrame *frame, bool complete) { WRectangle geom; - const char *attr=(REGION_IS_ACTIVE(frame) - ? "active" : "inactive"); if(frame->brush==NULL) return; - + frame_border_geom(frame, &geom); grbrush_begin(frame->brush, &geom, (complete ? 0 : GRBRUSH_NO_CLEAR_OK)); - grbrush_draw_border(frame->brush, &geom, attr); + set_common_attrs(frame, frame->brush); + + grbrush_draw_border(frame->brush, &geom); + frame_draw_bar(frame, TRUE); grbrush_end(frame->brush); @@ -478,4 +562,18 @@ bool frame_set_background(WFrame *frame, bool set_always) } +void frame_setup_dragwin_style(WFrame *frame, GrStyleSpec *spec, int tab) +{ + gr_stylespec_append(spec, &frame->titles[tab].attr); + + gr_stylespec_set(spec, REGION_IS_ACTIVE(frame) + ? GR_ATTR(active) + : GR_ATTR(inactive)); + gr_stylespec_set(spec, frame->quasiactive_count>0 + ? GR_ATTR(quasiactive) + : GR_ATTR(not_quasiactive)); +} + + /*}}}*/ + diff --git a/ioncore/frame-draw.h b/ioncore/frame-draw.h index 4086dec..b0134f5 100644 --- a/ioncore/frame-draw.h +++ b/ioncore/frame-draw.h @@ -1,7 +1,7 @@ /* * ion/ioncore/frame-draw.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -35,4 +35,8 @@ extern void frame_clear_shape(WFrame *frame); extern const char *framemode_get_style(WFrameMode mode); extern const char *framemode_get_tab_style(WFrameMode mode); +extern void frame_update_attr(WFrame *frame, int i, WRegion *reg); + +extern void frame_setup_dragwin_style(WFrame *frame, GrStyleSpec *spec, int tab); + #endif /* ION_IONCORE_FRAME_DRAW_H */ diff --git a/ioncore/frame-pointer.c b/ioncore/frame-pointer.c index 1d9a196..09f1c0a 100644 --- a/ioncore/frame-pointer.c +++ b/ioncore/frame-pointer.c @@ -1,7 +1,7 @@ /* * ion/ioncore/frame-pointer.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -138,7 +138,7 @@ static bool tabdrag_kbd_handler(WRegion *reg, XEvent *xev) assert(reg!=NULL); - binding=bindmap_lookup_binding(ioncore_rootwin_bindmap, BINDING_KEYPRESS, + binding=bindmap_lookup_binding(ioncore_screen_bindmap, BINDING_KEYPRESS, ev->state&~BUTTONS_MASK, ev->keycode); if(binding!=NULL && binding->func!=extl_fn_none()){ @@ -173,9 +173,7 @@ static void setup_dragwin(WFrame *frame, uint tab) if(tabdrag_infowin==NULL) return; - infowin_set_attr2(tabdrag_infowin, (REGION_IS_ACTIVE(frame) - ? "active" : "inactive"), - frame->titles[tab].attr); + frame_setup_dragwin_style(frame, infowin_stylespec(tabdrag_infowin), tab); if(frame->titles[tab].text!=NULL){ char *buf=INFOWIN_BUFFER(tabdrag_infowin); diff --git a/ioncore/frame-pointer.h b/ioncore/frame-pointer.h index 092b90a..c7163a1 100644 --- a/ioncore/frame-pointer.h +++ b/ioncore/frame-pointer.h @@ -1,7 +1,7 @@ /* * ion/ioncore/frame-pointer.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/frame.c b/ioncore/frame.c index 0f3e8f2..d733c3f 100644 --- a/ioncore/frame.c +++ b/ioncore/frame.c @@ -1,7 +1,7 @@ /* * ion/ioncore/frame.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -37,8 +37,9 @@ #include "bindmaps.h" #include "regbind.h" #include "gr.h" -#include "activity.h" #include "llist.h" +#include "framedpholder.h" +#include "return.h" extern bool frame_set_background(WFrame *frame, bool set_always); @@ -91,7 +92,7 @@ bool frame_init(WFrame *frame, WWindow *parent, const WFitParams *fp, frame_initialise_titles(frame); region_add_bindmap((WRegion*)frame, ioncore_frame_bindmap); - region_add_bindmap((WRegion*)frame, ioncore_frame_toplevel_bindmap); + region_add_bindmap((WRegion*)frame, ioncore_mplex_bindmap); frame_add_mode_bindmaps(frame); @@ -130,15 +131,18 @@ static void frame_add_mode_bindmaps(WFrame *frame) { WFrameMode mode=frame->mode; - if(mode==FRAME_MODE_TILED || mode==FRAME_MODE_TILED_ALT){ - region_add_bindmap((WRegion*)frame, ioncore_frame_toplevel_bindmap); - region_add_bindmap((WRegion*)frame, ioncore_frame_tiled_bindmap); - }else if(mode==FRAME_MODE_FLOATING){ + if(mode==FRAME_MODE_FLOATING){ + region_add_bindmap((WRegion*)frame, ioncore_mplex_toplevel_bindmap); region_add_bindmap((WRegion*)frame, ioncore_frame_toplevel_bindmap); region_add_bindmap((WRegion*)frame, ioncore_frame_floating_bindmap); }else if(mode==FRAME_MODE_TRANSIENT){ region_add_bindmap((WRegion*)frame, ioncore_frame_transient_bindmap); - } + }else{ + /* mode==FRAME_MODE_TILED || mode==FRAME_MODE_TILED_ALT || mode==FRAME_MODE_UNKNOWN */ + region_add_bindmap((WRegion*)frame, ioncore_mplex_toplevel_bindmap); + region_add_bindmap((WRegion*)frame, ioncore_frame_toplevel_bindmap); + region_add_bindmap((WRegion*)frame, ioncore_frame_tiled_bindmap); + } } @@ -151,6 +155,7 @@ void frame_set_mode(WFrame *frame, WFrameMode mode) frame_release_brushes(frame); + region_remove_bindmap((WRegion*)frame, ioncore_mplex_toplevel_bindmap); region_remove_bindmap((WRegion*)frame, ioncore_frame_toplevel_bindmap); region_remove_bindmap((WRegion*)frame, ioncore_frame_tiled_bindmap); region_remove_bindmap((WRegion*)frame, ioncore_frame_floating_bindmap); @@ -175,6 +180,7 @@ WFrameMode frame_mode(WFrame *frame) StringIntMap frame_modes[]={ + {"unknown", FRAME_MODE_UNKNOWN}, {"tiled", FRAME_MODE_TILED}, {"tiled-alt", FRAME_MODE_TILED_ALT}, {"floating", FRAME_MODE_FLOATING}, @@ -186,6 +192,7 @@ StringIntMap frame_modes[]={ /*EXTL_DOC * Get frame mode. */ +EXTL_SAFE EXTL_EXPORT_AS(WFrame, mode) const char *frame_mode_extl(WFrame *frame) { @@ -299,46 +306,6 @@ int frame_nth_tab_iw(WFrame *frame, int n) -static void update_attr(WFrame *frame, int i, WRegion *reg) -{ - int flags=0; - static char *attrs[]={ - "unselected-not_tagged-not_dragged-no_activity", - "selected-not_tagged-not_dragged-no_activity", - "unselected-tagged-not_dragged-no_activity", - "selected-tagged-not_dragged-no_activity", - "unselected-not_tagged-dragged-no_activity", - "selected-not_tagged-dragged-no_activity", - "unselected-tagged-dragged-no_activity", - "selected-tagged-dragged-no_activity", - "unselected-not_tagged-not_dragged-activity", - "selected-not_tagged-not_dragged-activity", - "unselected-tagged-not_dragged-activity", - "selected-tagged-not_dragged-activity", - "unselected-not_tagged-dragged-activity", - "selected-not_tagged-dragged-activity", - "unselected-tagged-dragged-activity", - "selected-tagged-dragged-activity" - }; - - if(i>=frame->titles_n){ - /* Might happen when deinitialising */ - return; - } - - if(reg==FRAME_CURRENT(frame)) - flags|=0x01; - if(reg!=NULL && reg->flags®ION_TAGGED) - flags|=0x02; - if(i==frame->tab_dragged_idx) - flags|=0x04; - if(reg!=NULL && region_is_activity_r(reg)) - flags|=0x08; - - frame->titles[i].attr=attrs[flags]; -} - - void frame_update_attr_nth(WFrame *frame, int i) { WRegion *reg; @@ -346,18 +313,18 @@ void frame_update_attr_nth(WFrame *frame, int i) if(i<0 || i>=frame->titles_n) return; - update_attr(frame, i, mplex_mx_nth((WMPlex*)frame, i)); + frame_update_attr(frame, i, mplex_mx_nth((WMPlex*)frame, i)); } -static void update_attrs(WFrame *frame) +static void frame_update_attrs(WFrame *frame) { int i=0; WRegion *sub; WLListIterTmp tmp; FRAME_MX_FOR_ALL(sub, frame, tmp){ - update_attr(frame, i, sub); + frame_update_attr(frame, i, sub); i++; } } @@ -371,6 +338,7 @@ static void frame_free_titles(WFrame *frame) for(i=0; ititles_n; i++){ if(frame->titles[i].text) free(frame->titles[i].text); + gr_stylespec_unalloc(&frame->titles[i].attr); } free(frame->titles); frame->titles=NULL; @@ -383,7 +351,10 @@ static void do_init_title(WFrame *frame, int i, WRegion *sub) { frame->titles[i].text=NULL; frame->titles[i].iw=frame_nth_tab_iw(frame, i); - update_attr(frame, i, sub); + + gr_stylespec_init(&frame->titles[i].attr); + + frame_update_attr(frame, i, sub); } @@ -551,6 +522,74 @@ void frame_activated(WFrame *frame) } +void frame_quasiactivation(WFrame *frame, WRegion *reg, bool act) +{ + bool was, is; + + was=(frame->quasiactive_count>0); + + frame->quasiactive_count=maxof(0, frame->quasiactive_count + + (act ? 1 : -1)); + + is=(frame->quasiactive_count>0); + + if(was!=is && !REGION_IS_ACTIVE(frame)) + window_draw((WWindow*)frame, FALSE); +} + + +static bool actinact(WRegion *reg, bool act) +{ + WPHolder *returnph=region_get_return(reg); + WFrame *frame; + + if(returnph==NULL || pholder_stale(returnph)) + return FALSE; + + frame=OBJ_CAST(pholder_target(returnph), WFrame); + + if(frame!=NULL){ + /* Ok, reg has return placeholder set to a frame: + * do quasiactivation/inactivation + */ + frame_quasiactivation(frame, reg, act); + } + + return TRUE; +} + + +static bool activated(WRegion *reg) +{ + return actinact(reg, TRUE); +} + + +static bool inactivated(WRegion *reg) +{ + return actinact(reg, FALSE); +} + + +void ioncore_frame_quasiactivation_notify(WRegion *reg, + WRegionNotify how) +{ + if(how==ioncore_g.notifies.activated || + how==ioncore_g.notifies.pseudoactivated){ + activated(reg); + }else if(how==ioncore_g.notifies.inactivated || + how==ioncore_g.notifies.pseudoinactivated){ + inactivated(reg); + }else if(how==ioncore_g.notifies.set_return){ + if(REGION_IS_ACTIVE(reg) || REGION_IS_PSEUDOACTIVE(reg)) + activated(reg); + }else if(how==ioncore_g.notifies.unset_return){ + if(REGION_IS_ACTIVE(reg) || REGION_IS_PSEUDOACTIVE(reg)) + inactivated(reg); + } +} + + /*}}}*/ @@ -620,6 +659,73 @@ static void frame_managed_rqgeom_absolute(WFrame *frame, WRegion *sub, /*}}}*/ +/*{{{ Frame recreate pholder stuff */ + + +static WFramedPHolder *frame_make_recreate_pholder(WFrame *frame) +{ + WPHolder *ph; + WFramedPHolder *fph; + WFramedParam fparam=FRAMEDPARAM_INIT; + + ph=region_make_return_pholder((WRegion*)frame); + + if(ph==NULL) + return NULL; + + fparam.mode=frame->mode; + + fph=create_framedpholder(ph, &fparam); + + if(fph==NULL){ + destroy_obj((Obj*)ph); + return NULL; + } + + return fph; +} + + +static void mplex_flatten_phs(WMPlex *mplex) +{ + WLListNode *node; + WLListIterTmp tmp; + + FOR_ALL_NODES_ON_LLIST(node, mplex->mx_list, tmp){ + WMPlexPHolder *last=(mplex->mx_phs==NULL ? NULL : mplex->mx_phs->prev); + mplex_move_phs(mplex, node, last, NULL); + } +} + + +static void frame_modify_pholders(WFrame *frame) +{ + WFramedPHolder *fph; + WMPlexPHolder *phs, *ph; + + mplex_flatten_phs(&frame->mplex); + + if(frame->mplex.mx_phs==NULL) + return; + + fph=frame_make_recreate_pholder(frame); + + if(fph==NULL) + return; + + phs=frame->mplex.mx_phs; + frame->mplex.mx_phs=NULL; + + phs->recreate_pholder=fph; + + for(ph=phs; ph!=NULL; ph=ph->next) + watch_reset(&ph->mplex_watch); +} + + +/*}}}*/ + + /*{{{ Misc. */ @@ -724,9 +830,9 @@ bool frame_is_numbers(WFrame *frame) } -void frame_managed_notify(WFrame *frame, WRegion *sub, const char *how) +void frame_managed_notify(WFrame *frame, WRegion *sub, WRegionNotify how) { - update_attrs(frame); + frame_update_attrs(frame); frame_recalc_bar(frame); frame_draw_bar(frame, FALSE); } @@ -755,7 +861,7 @@ static void frame_managed_changed(WFrame *frame, int mode, bool sw, if(mode!=MPLEX_CHANGE_SWITCHONLY) frame_initialise_titles(frame); else - update_attrs(frame); + frame_update_attrs(frame); if(sw) need_draw=!frame_set_background(frame, FALSE); @@ -776,8 +882,10 @@ static void frame_managed_changed(WFrame *frame, int mode, bool sw, static void frame_destroy_empty(WFrame *frame) { - if(EMPTY_AND_SHOULD_BE_DESTROYED(frame)) + if(EMPTY_AND_SHOULD_BE_DESTROYED(frame)){ + frame_modify_pholders(frame); destroy_obj((Obj*)frame); + } } diff --git a/ioncore/frame.h b/ioncore/frame.h index ce37814..aa4e7a6 100644 --- a/ioncore/frame.h +++ b/ioncore/frame.h @@ -1,7 +1,7 @@ /* * ion/ioncore/frame.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -64,6 +64,7 @@ DECLCLASS(WFrame){ int saved_x, saved_y; int tab_dragged_idx; + uint quasiactive_count; GrBrush *brush; GrBrush *bar_brush; @@ -115,9 +116,11 @@ extern bool frame_is_numbers(WFrame *frame); extern int frame_default_index(WFrame *frame); /* Misc */ -extern void frame_managed_notify(WFrame *frame, WRegion *sub, const char *how); +extern void frame_managed_notify(WFrame *frame, WRegion *sub, WRegionNotify how); extern void frame_managed_remove(WFrame *frame, WRegion *reg); +extern void ioncore_frame_quasiactivation_notify(WRegion *reg, WRegionNotify how); + /* Save/load */ extern ExtlTab frame_get_configuration(WFrame *frame); extern WRegion *frame_load(WWindow *par, const WFitParams *fp, ExtlTab tab); diff --git a/ioncore/framedpholder.c b/ioncore/framedpholder.c index 43375f2..6ef378b 100644 --- a/ioncore/framedpholder.c +++ b/ioncore/framedpholder.c @@ -1,7 +1,7 @@ /* * ion/ioncore/framedpholder.c * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -65,37 +65,13 @@ typedef struct{ } AP; -WRegion *framed_handler(WWindow *par, - const WFitParams *fp, - void *ap_) +void frame_adjust_to_initial(WFrame *frame, const WFitParams *fp, + const WFramedParam *param, WRegion *reg) { - AP *ap=(AP*)ap_; - WMPlexAttachParams mp=MPLEXATTACHPARAMS_INIT; - WFramedParam *param=ap->param; WRectangle rqg, mg; - WFrame *frame; - WRegion *reg; - - if(param->mkframe!=NULL) - frame=(WFrame*)(param->mkframe)(par, fp); - else - frame=create_frame(par, fp, FRAME_MODE_FLOATING); - - if(frame==NULL) - return NULL; - - if(fp->mode&(REGION_FIT_BOUNDS|REGION_FIT_WHATEVER)) - mp.flags|=MPLEX_ATTACH_WHATEVER; - - reg=mplex_do_attach(&frame->mplex, &mp, ap->data); - - if(reg==NULL){ - destroy_obj((Obj*)frame); - return NULL; - } - + if(!(fp->mode&(REGION_FIT_BOUNDS|REGION_FIT_WHATEVER))) - return (WRegion*)frame; + return; mplex_managed_geom((WMPlex*)frame, &mg); @@ -111,9 +87,9 @@ WRegion *framed_handler(WWindow *par, int bt=mg.y; int bb=REGION_GEOM(frame).h-(mg.y+mg.h); - rqg.x=(fp->g.x+param->inner_geom.x+ + rqg.x=(/*fp->g.x+*/param->inner_geom.x+ xgravity_deltax(param->gravity, bl, br)); - rqg.y=(fp->g.y+param->inner_geom.y+ + rqg.y=(/*fp->g.y+*/param->inner_geom.y+ xgravity_deltay(param->gravity, bt, bb)); rqg.w=maxof(1, param->inner_geom.w+(REGION_GEOM(frame).w-mg.w)); rqg.h=maxof(1, param->inner_geom.h+(REGION_GEOM(frame).h-mg.h)); @@ -123,6 +99,35 @@ WRegion *framed_handler(WWindow *par, rectangle_constrain(&rqg, &fp->g); region_fit((WRegion*)frame, &rqg, REGION_FIT_EXACT); +} + + +WRegion *framed_handler(WWindow *par, + const WFitParams *fp, + void *ap_) +{ + AP *ap=(AP*)ap_; + WMPlexAttachParams mp=MPLEXATTACHPARAMS_INIT; + WFramedParam *param=ap->param; + WFrame *frame; + WRegion *reg; + + frame=create_frame(par, fp, param->mode); + + if(frame==NULL) + return NULL; + + if(fp->mode&(REGION_FIT_BOUNDS|REGION_FIT_WHATEVER)) + mp.flags|=MPLEX_ATTACH_WHATEVER; + + reg=mplex_do_attach(&frame->mplex, &mp, ap->data); + + if(reg==NULL){ + destroy_obj((Obj*)frame); + return NULL; + } + + frame_adjust_to_initial(frame, fp, param, reg); return (WRegion*)frame; } @@ -162,7 +167,7 @@ WRegion *framedpholder_do_attach(WFramedPHolder *ph, int flags, ap.data=data; ap.param=&ph->param; - return pholder_attach_(ph->cont, flags, &data2); + return pholder_do_attach(ph->cont, flags, &data2); } @@ -174,19 +179,32 @@ WRegion *framedpholder_do_attach(WFramedPHolder *ph, int flags, bool framedpholder_do_goto(WFramedPHolder *ph) { - if(ph->cont!=NULL) - return pholder_goto(ph->cont); - - return FALSE; + return (ph->cont!=NULL + ? pholder_goto(ph->cont) + : FALSE); } WRegion *framedpholder_do_target(WFramedPHolder *ph) { - if(ph->cont!=NULL) - return pholder_target(ph->cont); + return (ph->cont!=NULL + ? pholder_target(ph->cont) + : NULL); +} + + +WPHolder *framedpholder_do_root(WFramedPHolder *ph) +{ + WPHolder *root; + + if(ph->cont==NULL) + return NULL; + + root=pholder_root(ph->cont); - return NULL; + return (root!=ph->cont + ? root + : &ph->ph); } @@ -205,6 +223,9 @@ static DynFunTab framedpholder_dynfuntab[]={ {(DynFun*)pholder_do_target, (DynFun*)framedpholder_do_target}, + + {(DynFun*)pholder_do_root, + (DynFun*)framedpholder_do_root}, END_DYNFUNTAB }; diff --git a/ioncore/framedpholder.h b/ioncore/framedpholder.h index 2bd7f1b..dfbbe50 100644 --- a/ioncore/framedpholder.h +++ b/ioncore/framedpholder.h @@ -1,7 +1,7 @@ /* * ion/ioncore/framedpholder.h * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -15,19 +15,19 @@ #include "common.h" #include "pholder.h" #include "attach.h" - -INTRCLASS(WFramedPHolder); -INTRSTRUCT(WFramedParam); +#include "frame.h" -#define FRAMEDPARAM_INIT {0, 0, {0, 0, 0, 0}, NULL} +#define FRAMEDPARAM_INIT {0, 0, {0, 0, 0, 0}, FRAME_MODE_FLOATING /*, NULL*/} +INTRSTRUCT(WFramedParam); DECLSTRUCT(WFramedParam){ uint inner_geom_gravity_set:1; int gravity; WRectangle inner_geom; - WRegionSimpleCreateFn *mkframe; + WFrameMode mode; + /*WRegionSimpleCreateFn *mkframe;*/ }; @@ -48,6 +48,8 @@ extern void framedpholder_deinit(WFramedPHolder *ph); extern bool framedpholder_do_goto(WFramedPHolder *ph); +extern WPHolder *framedpholder_do_root(WFramedPHolder *ph); + extern WRegion *framedpholder_do_target(WFramedPHolder *ph); extern WRegion *framedpholder_do_attach(WFramedPHolder *ph, int flags, @@ -57,4 +59,7 @@ extern WRegion *region_attach_framed(WRegion *reg, WFramedParam *param, WRegionAttachFn *fn, void *fn_param, WRegionAttachData *data); +extern void frame_adjust_to_initial(WFrame *frame, const WFitParams *fp, + const WFramedParam *param, WRegion *reg); + #endif /* ION_IONCORE_FRAMEDPHOLDER_H */ diff --git a/ioncore/framep.h b/ioncore/framep.h index a3b1283..9dabf48 100644 --- a/ioncore/framep.h +++ b/ioncore/framep.h @@ -1,7 +1,7 @@ /* * ion/ioncore/framep.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/fullscreen.c b/ioncore/fullscreen.c index e11a2d9..56ea527 100644 --- a/ioncore/fullscreen.c +++ b/ioncore/fullscreen.c @@ -1,7 +1,7 @@ /* * ion/ioncore/fullscreen.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -21,192 +21,171 @@ #include "mwmhints.h" #include "focus.h" #include "group-cw.h" +#include "return.h" -bool clientwin_fullscreen_may_switchto(WClientWin *cwin) -{ - return (region_may_control_focus((WRegion*)cwin) - || !REGION_IS_ACTIVE(region_screen_of((WRegion*)cwin))); -} +/*{{{ Generic full screen mode code */ -bool clientwin_check_fullscreen_request(WClientWin *cwin, int w, int h, - bool sw) + +bool region_fullscreen_scr(WRegion *reg, WScreen *scr, bool switchto) { - WScreen *scr; - WMwmHints *mwm; - WRectangle *rwgeom; - - mwm=xwindow_get_mwmhints(cwin->win); - if(mwm==NULL || !(mwm->flags&MWM_HINTS_DECORATIONS) || - mwm->decorations!=0) - return FALSE; + int rootx, rooty; + bool wasfs=TRUE; + int swf=(switchto ? MPLEX_ATTACH_SWITCHTO : 0); + WPHolder *ph=NULL; + bool newph=FALSE, ret; + + ph=region_unset_get_return(reg); - FOR_ALL_SCREENS(scr){ - if(!region_same_rootwin((WRegion*)scr, (WRegion*)cwin)) - continue; - /* TODO: if there are multiple possible rootwins, use the one with - * requested position, if any. - */ - if(REGION_GEOM(scr).w==w && REGION_GEOM(scr).h==h){ - cwin->flags|=CLIENTWIN_FS_RQ; - if(!clientwin_fullscreen_scr(cwin, (WScreen*)scr, sw)){ - cwin->flags&=~CLIENTWIN_FS_RQ; - return FALSE; - } - return TRUE; - } + if(ph==NULL){ + ph=region_make_return_pholder(reg); + newph=TRUE; } - rwgeom=®ION_GEOM(region_rootwin_of((WRegion*)cwin)); - - /* Catch Xinerama-unaware apps here */ - if(rwgeom->w==w && rwgeom->h==h){ - cwin->flags|=CLIENTWIN_FS_RQ; - if(clientwin_enter_fullscreen(cwin, sw)) - return TRUE; - cwin->flags&=~CLIENTWIN_FS_RQ; - } - - return FALSE; -} - - -static void destroy_pholder(WPHolder **fs_pholder) -{ - WPHolder *ph=*fs_pholder; - *fs_pholder=NULL; - destroy_obj((Obj*)ph); + ret=(mplex_attach_simple((WMPlex*)scr, reg, swf)!=NULL); + + if(!ret) + warn(TR("Failed to enter full screen mode.")); + + if(!ret && newph) + destroy_obj((Obj*)ph); + else if(!region_do_set_return(reg, ph)) + destroy_obj((Obj*)ph); + + return TRUE; } -static bool do_fullscreen_scr(WRegion *reg, WPHolder **fs_pholder, - WScreen *scr, bool switchto) +bool region_enter_fullscreen(WRegion *reg, bool switchto) { - int rootx, rooty; - bool wasfs=TRUE; - int swf=(switchto ? MPLEX_ATTACH_SWITCHTO : 0); - WRegion *mgr=REGION_MANAGER(reg); - - if(*fs_pholder!=NULL) - destroy_pholder(fs_pholder); - - if(*fs_pholder==NULL && mgr!=NULL) - *fs_pholder=region_managed_get_pholder(mgr, reg); + WScreen *scr=region_screen_of(reg); - if(!mplex_attach_simple((WMPlex*)scr, reg, swf)){ - warn(TR("Failed to enter full screen mode.")); - if(*fs_pholder!=NULL) - destroy_pholder(fs_pholder); - return FALSE; + if(scr==NULL){ + scr=rootwin_current_scr(region_rootwin_of(reg)); + if(scr==NULL) + return FALSE; } - - return TRUE; + + return region_fullscreen_scr(reg, scr, switchto); } -static bool do_leave_fullscreen(WRegion *reg, WPHolder **fs_pholder, - bool switchto) -{ - bool cf; +bool region_leave_fullscreen(WRegion *reg, bool switchto) +{ int swf=(switchto ? PHOLDER_ATTACH_SWITCHTO : 0); + WPHolder *ph=region_unset_get_return(reg); - if(*fs_pholder==NULL) + if(ph==NULL) return FALSE; - cf=region_may_control_focus(reg); - - if(!pholder_attach(*fs_pholder, swf, reg)){ + if(!pholder_attach_mcfgoto(ph, swf, reg)){ warn(TR("Failed to return from full screen mode; remaining manager " "or parent from previous location refused to manage us.")); return FALSE; } - if(*fs_pholder!=NULL) - destroy_pholder(fs_pholder); - - if(cf) - region_goto(reg); + destroy_obj((Obj*)ph); return TRUE; } -static WRegion *get_group(WClientWin *cwin) +/*#undef REGION_IS_FULLSCREEN +#define REGION_IS_FULLSCREEN(REG) (region_get_return((WRegion*)REG)!=NULL)*/ + + +static bool region_set_fullscreen(WRegion *reg, int sp) { - WGroupCW *cwg=OBJ_CAST(REGION_MANAGER(cwin), WGroupCW); + bool set=REGION_IS_FULLSCREEN(reg); + bool nset=libtu_do_setparam(sp, set); - return ((cwg!=NULL && group_bottom(&cwg->grp)==(WRegion*)cwin) - ? (WRegion*)cwg - : (WRegion*)cwin); + if(!XOR(nset, set)) + return set; + + if(nset) + region_enter_fullscreen(reg, TRUE); + else + region_leave_fullscreen(reg, TRUE); + + return REGION_IS_FULLSCREEN(reg); } -bool clientwin_fullscreen_scr(WClientWin *cwin, WScreen *scr, bool switchto) +/*}}}*/ + + +/*{{{ Client window requests */ + + +bool clientwin_fullscreen_may_switchto(WClientWin *cwin) { - WRegion *reg=get_group(cwin); - return do_fullscreen_scr(reg, &cwin->fs_pholder, scr, switchto); + return (region_may_control_focus((WRegion*)cwin) + || !REGION_IS_ACTIVE(region_screen_of((WRegion*)cwin))); } -bool clientwin_enter_fullscreen(WClientWin *cwin, bool switchto) +bool clientwin_check_fullscreen_request(WClientWin *cwin, int w, int h, + bool sw) { - WScreen *scr=region_screen_of((WRegion*)cwin); + WScreen *scr; + WMwmHints *mwm; + WRectangle *rwgeom; - if(scr==NULL){ - scr=rootwin_current_scr(region_rootwin_of((WRegion*)cwin)); - if(scr==NULL) - return FALSE; + mwm=xwindow_get_mwmhints(cwin->win); + if(mwm==NULL || !(mwm->flags&MWM_HINTS_DECORATIONS) || + mwm->decorations!=0) + return FALSE; + + FOR_ALL_SCREENS(scr){ + if(!region_same_rootwin((WRegion*)scr, (WRegion*)cwin)) + continue; + /* Only Mplayer supports single Xinerama region FS to my knowledge, + * and doesn't set position, so we also don't check position here, + * and instead take the first screen with matching size. + */ + if(REGION_GEOM(scr).w==w && REGION_GEOM(scr).h==h){ + cwin->flags|=CLIENTWIN_FS_RQ; + if(!region_fullscreen_scr((WRegion*)cwin, (WScreen*)scr, sw)){ + cwin->flags&=~CLIENTWIN_FS_RQ; + return FALSE; + } + return TRUE; + } } - return clientwin_fullscreen_scr(cwin, scr, switchto); + return FALSE; } -bool clientwin_leave_fullscreen(WClientWin *cwin, bool switchto) -{ - WRegion *reg=get_group(cwin); - return do_leave_fullscreen(reg, &cwin->fs_pholder, switchto); -} +/*}}}*/ -bool clientwin_set_fullscreen(WClientWin *cwin, int sp) -{ - bool set=REGION_IS_FULLSCREEN(cwin); - bool nset=libtu_do_setparam(sp, set); - - if(!XOR(nset, set)) - return set; - if(nset) - clientwin_enter_fullscreen(cwin, TRUE); - else - clientwin_leave_fullscreen(cwin, TRUE); - - return REGION_IS_FULLSCREEN(cwin); -} +/*{{{ Group exports */ /*EXTL_DOC - * Set client window \var{cwin} full screen state according to the + * Set client window \var{reg} full screen state according to the * parameter \var{how} (set/unset/toggle). Resulting state is returned, * which may not be what was requested. */ -EXTL_EXPORT_AS(WClientWin, set_fullscreen) -bool clientwin_set_fullscreen_extl(WClientWin *cwin, const char *how) +EXTL_EXPORT_AS(WGroup, set_fullscreen) +bool group_set_fullscreen_extl(WGroup *grp, const char *how) { - return clientwin_set_fullscreen(cwin, libtu_string_to_setparam(how)); + return region_set_fullscreen((WRegion*)grp, libtu_string_to_setparam(how)); } /*EXTL_DOC - * Is \var{cwin} in full screen mode? + * Is \var{reg} in full screen mode? */ EXTL_SAFE EXTL_EXPORT_MEMBER -bool clientwin_is_fullscreen(WClientWin *cwin) +bool group_is_fullscreen(WGroup *grp) { - return REGION_IS_FULLSCREEN(cwin); + return REGION_IS_FULLSCREEN(grp); } +/*}}}*/ diff --git a/ioncore/fullscreen.h b/ioncore/fullscreen.h index 8c820a4..2822703 100644 --- a/ioncore/fullscreen.h +++ b/ioncore/fullscreen.h @@ -1,7 +1,7 @@ /* * ion/ioncore/fullscreen.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -21,12 +21,11 @@ extern bool clientwin_check_fullscreen_request(WClientWin *cwin, int w, int h, bool switchto); -extern bool clientwin_fullscreen_scr(WClientWin *cwin, WScreen *vp, - bool switchto); -extern bool clientwin_enter_fullscreen(WClientWin *cwin, bool switchto); -extern bool clientwin_leave_fullscreen(WClientWin *cwin, bool switchto); -extern bool clientwin_set_fullscreen(WClientWin *cwin, int sp); -extern bool clientwin_is_fullscreen(WClientWin *cwin); extern bool clientwin_fullscreen_may_switchto(WClientWin *cwin); +extern bool region_fullscreen_scr(WRegion *reg, WScreen *vp, bool switchto); +extern bool region_enter_fullscreen(WRegion *reg, bool switchto); +extern bool region_leave_fullscreen(WRegion *reg, bool switchto); + + #endif /* ION_IONCORE_FULLSCREEN_H */ diff --git a/ioncore/global.h b/ioncore/global.h index 3756910..b23dce2 100644 --- a/ioncore/global.h +++ b/ioncore/global.h @@ -1,7 +1,7 @@ /* * ion/ioncore/global.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -17,6 +17,8 @@ #include #include +#include + #include "rootwin.h" #include "screen.h" #include "window.h" @@ -37,6 +39,7 @@ enum{ INTRSTRUCT(WGlobal); + DECLSTRUCT(WGlobal){ int argc; char **argv; @@ -85,6 +88,22 @@ DECLSTRUCT(WGlobal){ bool enc_utf8; /* mb encoding is utf8? */ const char *sm_client_id; + + struct{ + StringId activated, + inactivated, + activity, + sub_activity, + name, + unset_manager, + set_manager, + tag, + set_return, + unset_return, + pseudoactivated, + pseudoinactivated, + deinit; + } notifies; }; diff --git a/ioncore/gr-util.h b/ioncore/gr-util.h new file mode 100644 index 0000000..52cf384 --- /dev/null +++ b/ioncore/gr-util.h @@ -0,0 +1,24 @@ +/* + * ion/ioncore/gr-util.h + * + * Copyright (c) Tuomo Valkonen 2007. + * + * Ion is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + */ + +#ifndef ION_IONCORE_GR_UTIL_H +#define ION_IONCORE_GR_UTIL_H + +#include "gr.h" + +#define GR_ATTR(X) grattr_##X +#define GR_DEFATTR(X) static GrAttr GR_ATTR(X) = STRINGID_NONE +#define GR_ALLOCATTR_BEGIN static bool alloced=FALSE; if(alloced) return +#define GR_ALLOCATTR_END alloced=TRUE +#define GR_ALLOCATTR(X) GR_ATTR(X) = stringstore_alloc(#X) + +#endif /* ION_IONCORE_GR_UTIL_H */ + diff --git a/ioncore/gr.c b/ioncore/gr.c index d4f5a15..f864792 100644 --- a/ioncore/gr.c +++ b/ioncore/gr.c @@ -1,7 +1,7 @@ /* * ion/ioncore/gr.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -12,6 +12,7 @@ #include #include +#include #include #include #include "common.h" @@ -147,68 +148,294 @@ GrBrush *gr_get_brush(Window win, WRootWin *rootwin, const char *style) /*{{{ Scoring */ -uint gr_stylespec_score2(const char *spec, const char *attrib, - const char *attrib_p2) +static GrAttr star_id=STRINGID_NONE; + + +static int cmp(const void *a_, const void *b_) { - uint score=0; - uint a=0; - uint mult=1; + StringId a=*(const StringId*)a_; + StringId b=((const GrAttrScore*)b_)->attr; + + return (a < b ? -1 : ((a == b) ? 0 : 1)); +} - if(attrib==NULL){ - if(spec==NULL || strcmp(spec, "*")==0) - return 1; + +static uint scorefind(const GrStyleSpec *attr, const GrAttrScore *spec) +{ + GrAttrScore *res; + + if(attr->attrs==NULL) return 0; + + if(star_id==STRINGID_NONE) + star_id=stringstore_alloc("*"); + + if(spec->attr==star_id){ + /* Since every item occurs only once on the list, with a score, + * return the score of the star in the spec, instead of one. + */ + return spec->score; + } + + res=bsearch(&spec->attr, attr->attrs, attr->n, sizeof(GrAttrScore), cmp); + + return (res==NULL ? 0 : 2*res->score); +} + + +uint gr_stylespec_score2(const GrStyleSpec *spec, const GrStyleSpec *attr1, + const GrStyleSpec *attr2) +{ + uint score=0; + uint i; + + for(i=0; in; i++){ + int sc=scorefind(attr1, &spec->attrs[i]); + + if(attr2!=NULL) + sc=maxof(sc, scorefind(attr2, &spec->attrs[i])); + + if(sc==0){ + score=0; + break; + } + + score+=sc; + } + + return score; +} + + +uint gr_stylespec_score(const GrStyleSpec *spec, const GrStyleSpec *attr) +{ + return gr_stylespec_score2(spec, attr, NULL); +} + + +static uint count_dashes(const char *str) +{ + uint n=0; + + if(str!=NULL){ + while(1){ + const char *p=strchr(str, '-'); + if(p==NULL) + break; + n++; + str=p+1; + } } - while(1){ - if(*spec=='*'){ - score=score+mult; - spec++; - attrib=strchr(attrib, '-'); + return n; +} + + +bool gr_stylespec_load_(GrStyleSpec *spec, const char *str, bool no_order_score) +{ + uint score=(no_order_score ? 1 : count_dashes(str)+1); + + gr_stylespec_init(spec); + + while(str!=NULL){ + GrAttr a; + const char *p=strchr(str, '-'); + + if(p==NULL){ + a=stringstore_alloc(str); + str=p; }else{ - while(1){ - if(*attrib=='\0'){ - attrib=NULL; - break; - } - if(*attrib=='-') - break; - if(*spec!=*attrib) - return 0; - attrib++; - spec++; - } - score=score+2*mult; + a=stringstore_alloc_n(str, p-str); + str=p+1; } - if(*spec=='\0') - return score; - else if(*spec!='-') - return 0; + if(a==STRINGID_NONE) + goto fail; + + if(!gr_stylespec_add(spec, a, score)) + goto fail; + + stringstore_free(a); - if(attrib==NULL){ - if(a==0 && attrib_p2!=NULL){ - attrib=attrib_p2; - a++; - }else{ - return 0; - } - }else{ - attrib++; + if(!no_order_score) + score--; + } + + return TRUE; + +fail: + gr_stylespec_unalloc(spec); + + return FALSE; +} + + +bool gr_stylespec_load(GrStyleSpec *spec, const char *str) +{ + return gr_stylespec_load_(spec, str, FALSE); +} + + +void gr_stylespec_unalloc(GrStyleSpec *spec) +{ + uint i; + + for(i=0; in; i++) + stringstore_free(spec->attrs[i].attr); + + if(spec->attrs!=NULL){ + free(spec->attrs); + spec->attrs=NULL; + } + + spec->n=0; +} + + +void gr_stylespec_init(GrStyleSpec *spec) +{ + spec->attrs=NULL; + spec->n=0; +} + + +static bool gr_stylespec_find_(GrStyleSpec *spec, GrAttr a, int *idx_ge) +{ + bool found=FALSE; + uint i; + + for(i=0; in; i++){ + if(spec->attrs[i].attr>=a){ + found=(spec->attrs[i].attr==a); + break; } + } + + *idx_ge=i; + return found; +} + +bool gr_stylespec_add(GrStyleSpec *spec, GrAttr a, uint score) +{ + static const uint sz=sizeof(GrAttrScore); + GrAttrScore *idsn; + int idx_ge; + + if(a==GRATTR_NONE || score==0) + return TRUE; + + if(gr_stylespec_find_(spec, a, &idx_ge)){ + spec->attrs[idx_ge].score+=score; + return TRUE; + } + + idsn=(GrAttrScore*)realloc(spec->attrs, (spec->n+1)*sz); + + if(idsn==NULL) + return FALSE; + + stringstore_ref(a); + + memmove(idsn+idx_ge+1, idsn+idx_ge, (spec->n-idx_ge)*sz); + + idsn[idx_ge].attr=a; + idsn[idx_ge].score=score; + spec->attrs=idsn; + spec->n++; + + return TRUE; +} + + +bool gr_stylespec_set(GrStyleSpec *spec, GrAttr a) +{ + return gr_stylespec_add(spec, a, 1); +} + + +void gr_stylespec_unset(GrStyleSpec *spec, GrAttr a) +{ + static const uint sz=sizeof(GrAttrScore); + GrAttrScore *idsn; + int idx_ge; + + if(a==GRATTR_NONE) + return; + + if(!gr_stylespec_find_(spec, a, &idx_ge)) + return; + + stringstore_free(spec->attrs[idx_ge].attr); + + memmove(spec->attrs+idx_ge, spec->attrs+idx_ge+1, + (spec->n-idx_ge-1)*sz); + + spec->n--; + + idsn=(GrAttrScore*)realloc(spec->attrs, (spec->n)*sz); + + if(idsn!=NULL || spec->n==0) + spec->attrs=idsn; +} + - spec++; - mult=mult*3; +static bool gr_stylespec_do_init_from(GrStyleSpec *dst, const GrStyleSpec *src) +{ + uint i; + + if(src->n==0) + return TRUE; + + dst->attrs=ALLOC_N(GrAttrScore, src->n); + + if(dst->attrs==NULL) + return FALSE; + + for(i=0; in; i++){ + dst->attrs[i]=src->attrs[i]; + stringstore_ref(dst->attrs[i].attr); } + + dst->n=src->n; + + return TRUE; } -uint gr_stylespec_score(const char *spec, const char *attrib) +bool gr_stylespec_append(GrStyleSpec *dst, const GrStyleSpec *src) { - return gr_stylespec_score2(spec, attrib, NULL); + uint i; + bool ok=TRUE; + + if(dst->attrs==NULL){ + ok=gr_stylespec_do_init_from(dst, src); + }else{ + for(i=0; in; i++){ + if(!gr_stylespec_add(dst, src->attrs[i].attr, src->attrs[i].score)) + ok=FALSE; + } + } + + return ok; } +bool gr_stylespec_equals(const GrStyleSpec *s1, const GrStyleSpec *s2) +{ + uint i; + + if(s1->n!=s2->n) + return FALSE; + + for(i=0; in; i++){ + if(s1->attrs[i].attr!=s2->attrs[i].attr) + return FALSE; + } + + return TRUE; +} + + /*}}}*/ @@ -294,17 +521,16 @@ DYNFUN bool grbrush_get_extra(GrBrush *brush, const char *key, /*{{{ Dynfuns/Borders */ -void grbrush_draw_border(GrBrush *brush, const WRectangle *geom, - const char *attrib) +void grbrush_draw_border(GrBrush *brush, const WRectangle *geom) { - CALL_DYN(grbrush_draw_border, brush, (brush, geom, attrib)); + CALL_DYN(grbrush_draw_border, brush, (brush, geom)); } void grbrush_draw_borderline(GrBrush *brush, const WRectangle *geom, - const char *attrib, GrBorderLine line) + GrBorderLine line) { - CALL_DYN(grbrush_draw_borderline, brush, (brush, geom, attrib, line)); + CALL_DYN(grbrush_draw_borderline, brush, (brush, geom, line)); } @@ -315,11 +541,9 @@ void grbrush_draw_borderline(GrBrush *brush, const WRectangle *geom, void grbrush_draw_string(GrBrush *brush, int x, int y, - const char *str, int len, bool needfill, - const char *attrib) + const char *str, int len, bool needfill) { - CALL_DYN(grbrush_draw_string, brush, - (brush, x, y, str, len, needfill, attrib)); + CALL_DYN(grbrush_draw_string, brush, (brush, x, y, str, len, needfill)); } @@ -339,19 +563,16 @@ uint grbrush_get_text_width(GrBrush *brush, const char *text, uint len) void grbrush_draw_textbox(GrBrush *brush, const WRectangle *geom, - const char *text, const char *attr, - bool needfill) + const char *text, bool needfill) { - CALL_DYN(grbrush_draw_textbox, brush, - (brush, geom, text, attr, needfill)); + CALL_DYN(grbrush_draw_textbox, brush, (brush, geom, text, needfill)); } void grbrush_draw_textboxes(GrBrush *brush, const WRectangle *geom, int n, const GrTextElem *elem, - bool needfill, const char *common_attrib) + bool needfill) { - CALL_DYN(grbrush_draw_textboxes, brush, - (brush, geom, n, elem, needfill, common_attrib)); + CALL_DYN(grbrush_draw_textboxes, brush, (brush, geom, n, elem, needfill)); } @@ -374,10 +595,9 @@ void grbrush_enable_transparency(GrBrush *brush, GrTransparency tr) } -void grbrush_fill_area(GrBrush *brush, const WRectangle *geom, - const char *attr) +void grbrush_fill_area(GrBrush *brush, const WRectangle *geom) { - CALL_DYN(grbrush_fill_area, brush, (brush, geom, attr)); + CALL_DYN(grbrush_fill_area, brush, (brush, geom)); } @@ -387,6 +607,24 @@ void grbrush_clear_area(GrBrush *brush, const WRectangle *geom) } +void grbrush_init_attr(GrBrush *brush, const GrStyleSpec *spec) +{ + CALL_DYN(grbrush_init_attr, brush, (brush, spec)); +} + + +void grbrush_set_attr(GrBrush *brush, GrAttr attr) +{ + CALL_DYN(grbrush_set_attr, brush, (brush, attr)); +} + + +void grbrush_unset_attr(GrBrush *brush, GrAttr attr) +{ + CALL_DYN(grbrush_unset_attr, brush, (brush, attr)); +} + + /*}}}*/ diff --git a/ioncore/gr.h b/ioncore/gr.h index 911edc6..2d55298 100644 --- a/ioncore/gr.h +++ b/ioncore/gr.h @@ -1,7 +1,7 @@ /* * ion/ioncore/gr.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -12,6 +12,8 @@ #ifndef ION_IONCORE_GR_H #define ION_IONCORE_GR_H +#include + #include "common.h" #include "rectangle.h" @@ -42,10 +44,28 @@ typedef struct{ uint spacing; } GrBorderWidths; +typedef StringId GrAttr; + +#define GRATTR_NONE STRINGID_NONE + +#define GR_STYLESPEC_INIT {0, NULL} + +typedef struct{ + GrAttr attr; + uint score; +} GrAttrScore; + +typedef struct{ + uint n; + GrAttrScore *attrs; +} GrStyleSpec; + +#define GR_TEXTELEM_INIT {NULL, 0, GR_STYLESPEC_INIT} + typedef struct{ char *text; int iw; - char *attr; + GrStyleSpec attr; } GrTextElem; typedef enum{ @@ -66,6 +86,7 @@ typedef enum{ #define GRBRUSH_AMEND 0x0001 #define GRBRUSH_NEED_CLIP 0x0004 #define GRBRUSH_NO_CLEAR_OK 0x0008 /* implied by GRBRUSH_AMEND */ +#define GRBRUSH_KEEP_ATTR 0x0010 /* Engines etc. */ @@ -78,31 +99,32 @@ extern bool gr_select_engine(const char *engine); extern void gr_refresh(); extern void gr_read_config(); -/* Stylespecs are of the from attr1-attr2-etc. We require that each attr in - * 'spec' matches the one at same index in 'attrib' when '*' matches anything. - * The score increment for exact match is 2*3^index and 1*3^index for '*' - * match. If all elements of 'spec' match those of 'attrib' exactly, the - * accumulated score is returned. Otherwise the matching fails and zero is - * returned. For example: - * - * spec attrib score - * foo-*-baz foo-bar-baz 2+1*3+2*3^2 = 23 - * foo-bar foo-bar-baz 2+2*3 = 8 - * foo-baz foo-bar-baz 0 - * - * gr_stylespec_score2 continues matching from attrib_p2 (if not NULL) when - * it has reached end of attrib. - */ -extern uint gr_stylespec_score(const char *spec, const char *attrib); -extern uint gr_stylespec_score2(const char *spec, const char *attrib, - const char *attrib_p2); + /* Every star ('*') element of 'spec' increases score by one. + * Every other element of 'spec' found in 'attr' increases the score by the + * number set in attr times two. Any element of 'spec' (other than star), + * not found in 'attr', forces score to zero. + */ +extern uint gr_stylespec_score(const GrStyleSpec *spec, const GrStyleSpec *attr); +extern uint gr_stylespec_score2(const GrStyleSpec *spec, const GrStyleSpec *attr, + const GrStyleSpec *attr2); + +extern void gr_stylespec_init(GrStyleSpec *spec); +extern bool gr_stylespec_set(GrStyleSpec *spec, GrAttr a); +extern void gr_stylespec_unset(GrStyleSpec *spec, GrAttr a); +extern bool gr_stylespec_add(GrStyleSpec *spec, GrAttr a, uint score); +extern bool gr_stylespec_append(GrStyleSpec *dst, const GrStyleSpec *src); +extern void gr_stylespec_unalloc(GrStyleSpec *spec); +extern bool gr_stylespec_equals(const GrStyleSpec *s1, const GrStyleSpec *s2); +extern bool gr_stylespec_load(GrStyleSpec *spec, const char *str); +extern bool gr_stylespec_load_(GrStyleSpec *spec, const char *str, + bool no_order_score); /* GrBrush */ extern GrBrush *gr_get_brush(Window win, WRootWin *rootwin, const char *style); -extern GrBrush *grbrush_get_slave(GrBrush *brush, WRootWin *rootwin, +DYNFUN GrBrush *grbrush_get_slave(GrBrush *brush, WRootWin *rootwin, const char *style); extern void grbrush_release(GrBrush *brush); @@ -110,18 +132,23 @@ extern void grbrush_release(GrBrush *brush); extern bool grbrush_init(GrBrush *brush); extern void grbrush_deinit(GrBrush *brush); -extern void grbrush_begin(GrBrush *brush, const WRectangle *geom, +DYNFUN void grbrush_begin(GrBrush *brush, const WRectangle *geom, int flags); -extern void grbrush_end(GrBrush *brush); +DYNFUN void grbrush_end(GrBrush *brush); + +/* Attributes */ + +DYNFUN void grbrush_init_attr(GrBrush *brush, const GrStyleSpec *spec); +DYNFUN void grbrush_set_attr(GrBrush *brush, GrAttr attr); +DYNFUN void grbrush_unset_attr(GrBrush *brush, GrAttr attr); /* Border drawing */ DYNFUN void grbrush_get_border_widths(GrBrush *brush, GrBorderWidths *bdi); -DYNFUN void grbrush_draw_border(GrBrush *brush, const WRectangle *geom, - const char *attrib); +DYNFUN void grbrush_draw_border(GrBrush *brush, const WRectangle *geom); DYNFUN void grbrush_draw_borderline(GrBrush *brush, const WRectangle *geom, - const char *attrib, GrBorderLine line); + GrBorderLine line); /* String drawing */ @@ -130,18 +157,16 @@ DYNFUN void grbrush_get_font_extents(GrBrush *brush, GrFontExtents *fnti); DYNFUN uint grbrush_get_text_width(GrBrush *brush, const char *text, uint len); DYNFUN void grbrush_draw_string(GrBrush *brush, int x, int y, - const char *str, int len, bool needfill, - const char *attrib); + const char *str, int len, bool needfill); /* Textbox drawing */ DYNFUN void grbrush_draw_textbox(GrBrush *brush, const WRectangle *geom, - const char *text, const char *attr, - bool needfill); + const char *text, bool needfill); DYNFUN void grbrush_draw_textboxes(GrBrush *brush, const WRectangle *geom, int n, const GrTextElem *elem, - bool needfill, const char *common_attrib); + bool needfill); /* Misc */ @@ -155,8 +180,7 @@ DYNFUN void grbrush_set_window_shape(GrBrush *brush, bool rough, DYNFUN void grbrush_enable_transparency(GrBrush *brush, GrTransparency mode); -DYNFUN void grbrush_fill_area(GrBrush *brush, const WRectangle *geom, - const char *attr); +DYNFUN void grbrush_fill_area(GrBrush *brush, const WRectangle *geom); DYNFUN void grbrush_clear_area(GrBrush *brush, const WRectangle *geom); DYNFUN bool grbrush_get_extra(GrBrush *brush, const char *key, diff --git a/ioncore/group-cw.c b/ioncore/group-cw.c index dc5cc69..0084ee2 100644 --- a/ioncore/group-cw.c +++ b/ioncore/group-cw.c @@ -1,7 +1,7 @@ /* * ion/ioncore/group-cw.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -33,13 +33,6 @@ /*{{{ Add/remove managed */ -WRegion *create_transient_frame(WWindow *par, - const WFitParams *fp) -{ - return (WRegion*)create_frame(par, fp, FRAME_MODE_TRANSIENT); -} - - static WPHolder *groupcw_transient_pholder(WGroupCW *cwg, const WClientWin *cwin, const WManageParams *mp) @@ -69,7 +62,7 @@ static WPHolder *groupcw_transient_pholder(WGroupCW *cwg, fp.inner_geom_gravity_set=1; fp.inner_geom=mp->geom; fp.gravity=ForgetGravity; - fp.mkframe=create_transient_frame; + fp.mode=FRAME_MODE_TRANSIENT; ph=(WPHolder*)create_grouppholder(&cwg->grp, NULL, ¶m); @@ -181,10 +174,9 @@ const char *groupcw_displayname(WGroupCW *cwg) } -void groupcw_managed_notify(WGroupCW *cwg, WRegion *reg, const char *how) +void groupcw_managed_notify(WGroupCW *cwg, WRegion *reg, WRegionNotify how) { - if(group_bottom(&cwg->grp)==reg - && strcmp(how, "name")==0){ + if(group_bottom(&cwg->grp)==reg && how==ioncore_g.notifies.name){ /* Title has changed */ region_notify_change((WRegion*)cwg, how); } @@ -200,7 +192,6 @@ void groupcw_managed_notify(WGroupCW *cwg, WRegion *reg, const char *how) bool groupcw_init(WGroupCW *cwg, WWindow *parent, const WFitParams *fp) { cwg->transient_szplcy=DFLT_SZPLCY; - /*cwg->fs_pholder=NULL;*/ if(!group_init(&(cwg->grp), parent, fp)) return FALSE; diff --git a/ioncore/group-cw.h b/ioncore/group-cw.h index b389d46..b8616a7 100644 --- a/ioncore/group-cw.h +++ b/ioncore/group-cw.h @@ -1,7 +1,7 @@ /* * ion/ioncore/group-cw.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -39,7 +39,4 @@ extern WPHolder *groupcw_prepare_manage_transient(WGroupCW *cwg, extern WRegion *groupcw_load(WWindow *par, const WFitParams *fp, ExtlTab tab); -extern WRegion *create_transient_frame(WWindow *par, - const WFitParams *fp); - #endif /* ION_IONCORE_GROUPCW_H */ diff --git a/ioncore/group-ws.c b/ioncore/group-ws.c index b50402c..48ee838 100644 --- a/ioncore/group-ws.c +++ b/ioncore/group-ws.c @@ -1,7 +1,7 @@ /* * ion/ioncore/group-ws.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -29,28 +29,12 @@ #include "framedpholder.h" #include "float-placement.h" #include "resize.h" +#include "conf.h" /*{{{ Settings */ -static bool default_ws_params_set=FALSE; -static ExtlTab default_ws_params; - - -/*EXTL_DOC - * Set module basic settings. Currently only the \code{placement_method} - * parameter is supported. - * - * The method can be one of ''udlr'', ''lrud'' (default) and ''random''. - * The ''udlr'' method looks for free space starting from top the top left - * corner of the workspace moving first down keeping the x coordinate fixed. - * If it find no free space, it start looking similarly at next x coordinate - * unoccupied by other objects and so on. ''lrud' is the same but with the - * role of coordinates changed and both fall back to ''random'' placement - * if no free area was found. - */ - void ioncore_groupws_set(ExtlTab tab) { char *method=NULL; @@ -67,13 +51,6 @@ void ioncore_groupws_set(ExtlTab tab) warn(TR("Unknown placement method \"%s\"."), method); free(method); } - - if(extl_table_gets_t(tab, "default_ws_params", &t)){ - if(default_ws_params_set) - extl_unref_table(default_ws_params); - default_ws_params=t; - default_ws_params_set=TRUE; - } } @@ -85,9 +62,6 @@ void ioncore_groupws_get(ExtlTab t) : (ioncore_placement_method==PLACEMENT_LRUD ? "lrud" : "random"))); - - if(default_ws_params_set) - extl_table_sets_t(t, "default_ws_params", default_ws_params); } @@ -196,28 +170,6 @@ bool groupws_attach_framed_extl(WGroupWS *ws, WRegion *reg, ExtlTab t) /*{{{ groupws_prepare_manage */ -#define REG_OK(R) OBJ_IS(R, WMPlex) - - -static WMPlex *find_existing(WGroupWS *ws) -{ - WGroupIterTmp tmp; - WRegion *r=(ws->grp.current_managed!=NULL - ? ws->grp.current_managed->reg - : NULL); - - if(r!=NULL && REG_OK(r)) - return (WMPlex*)r; - - FOR_ALL_MANAGED_BY_GROUP(&ws->grp, r, tmp){ - if(REG_OK(r)) - return (WMPlex*)r; - } - - return NULL; -} - - static WPHolder *groupws_do_prepare_manage(WGroupWS *ws, const WClientWin *cwin, const WManageParams *param, @@ -228,13 +180,22 @@ static WPHolder *groupws_do_prepare_manage(WGroupWS *ws, WPHolder *ph; if(redir==MANAGE_REDIR_PREFER_YES){ - WMPlex *m=find_existing(ws); - if(m!=NULL){ - WPHolder *ph; - ph=region_prepare_manage((WRegion*)m, cwin, param, - MANAGE_REDIR_STRICT_YES); - if(ph!=NULL) - return ph; + WRegion *r=(ws->grp.current_managed!=NULL + ? ws->grp.current_managed->reg + : NULL); + WGroupIterTmp tmp; + WPHolder *ph=NULL; + + if(r!=NULL) + ph=region_prepare_manage(r, cwin, param, MANAGE_REDIR_PREFER_YES); + + if(ph==NULL){ + FOR_ALL_MANAGED_BY_GROUP(&ws->grp, r, tmp){ + ph=region_prepare_manage(r, cwin, param, + MANAGE_REDIR_PREFER_YES); + if(ph!=NULL) + break; + } } } @@ -267,7 +228,7 @@ WPHolder *groupws_prepare_manage(WGroupWS *ws, const WClientWin *cwin, WRegion *b=(ws->grp.bottom!=NULL ? ws->grp.bottom->reg : NULL); WPHolder *ph=NULL; bool act_b=(ws->grp.bottom==ws->grp.current_managed); - bool always_float, use_bottom; + bool use_bottom; int weak=0; if(param->maprq && ioncore_g.opmode!=IONCORE_OPMODE_INIT @@ -315,7 +276,7 @@ WPHolder *groupws_prepare_manage_transient(WGroupWS *ws, const WClientWin *cwin, fp.inner_geom_gravity_set=TRUE; fp.inner_geom=param->geom; fp.gravity=param->gravity; - fp.mkframe=create_transient_frame; + fp.mode=FRAME_MODE_TRANSIENT; ap.geom_weak_set=1; ap.geom_weak=0; @@ -379,7 +340,7 @@ void groupws_deinit(WGroupWS *ws) WRegion *groupws_load(WWindow *par, const WFitParams *fp, - ExtlTab tab) + ExtlTab tab) { WGroupWS *ws; @@ -394,14 +355,6 @@ WRegion *groupws_load(WWindow *par, const WFitParams *fp, } -WRegion *groupws_load_default(WWindow *par, const WFitParams *fp) -{ - return groupws_load(par, fp, (default_ws_params_set - ? default_ws_params - : extl_table_none())); -} - - static DynFunTab groupws_dynfuntab[]={ {(DynFun*)region_prepare_manage, (DynFun*)groupws_prepare_manage}, diff --git a/ioncore/group-ws.h b/ioncore/group-ws.h index cfc43a9..1fee223 100644 --- a/ioncore/group-ws.h +++ b/ioncore/group-ws.h @@ -1,7 +1,7 @@ /* * ion/ioncore/groupws.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -40,7 +40,6 @@ extern WGroupWS *create_groupws(WWindow *parent, const WFitParams *fp); extern bool groupws_init(WGroupWS *ws, WWindow *parent, const WFitParams *fp); extern void groupws_deinit(WGroupWS *ws); -extern WRegion *groupws_load_default(WWindow *par, const WFitParams *fp); extern WRegion *groupws_load(WWindow *par, const WFitParams *fp, ExtlTab tab); extern void ioncore_groupws_set(ExtlTab tab); diff --git a/ioncore/group.c b/ioncore/group.c index 591fcd7..538db14 100644 --- a/ioncore/group.c +++ b/ioncore/group.c @@ -1,7 +1,7 @@ /* * ion/ioncore/group.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -40,6 +40,7 @@ #include "grouppholder.h" #include "frame.h" #include "float-placement.h" +#include "return.h" static void group_place_stdisp(WGroup *ws, WWindow *parent, @@ -352,7 +353,7 @@ void group_managed_remove(WGroup *ws, WRegion *reg) } region_unset_manager(reg, (WRegion*)ws); - + if(!dest && !ds){ if(was_bottom && !was_stdisp && ws->managed_stdisp==NULL){ /* We should probably be managing any stdisp, that 'bottom' @@ -368,19 +369,30 @@ void group_managed_remove(WGroup *ws, WRegion *reg) } if(cur){ + /* This may still potentially cause problems when focus + * change is pending. Perhaps we should use region_await_focus, + * if it is pointing to our child (and region_may_control_focus + * fail if it is pointing somewhere else). + */ WStacking *stf=find_to_focus(ws, next_st, TRUE); - if(stf!=NULL) - region_warp(stf->reg); + if(stf!=NULL && mcf){ + region_maybewarp_now(stf->reg, FALSE); + }else{ + ws->current_managed=stf; + } } }else if(dest && !ds){ - mainloop_defer_destroy((Obj*)ws); + region_dispose((WRegion*)ws, mcf); } } -static void group_managed_activated(WGroup *ws, WRegion *reg) +static void group_managed_notify(WGroup *ws, WRegion *reg, WRegionNotify how) { - ws->current_managed=group_find_stacking(ws, reg); + if(how==ioncore_g.notifies.activated || + how==ioncore_g.notifies.pseudoactivated){ + ws->current_managed=group_find_stacking(ws, reg); + } } @@ -584,17 +596,20 @@ bool group_do_attach_final(WGroup *ws, * position request is never honoured. */ if((g.x+g.w<=REGION_GEOM(ws).x) || - (g.y+g.h<=REGION_GEOM(ws).y) || - (g.x>=REGION_GEOM(ws).x+REGION_GEOM(ws).w) || + (g.x>=REGION_GEOM(ws).x+REGION_GEOM(ws).w)){ + weak|=REGION_RQGEOM_WEAK_X; + } + + if((g.y+g.h<=REGION_GEOM(ws).y) || (g.y>=REGION_GEOM(ws).y+REGION_GEOM(ws).h)){ - weak|=REGION_RQGEOM_WEAK_X|REGION_RQGEOM_WEAK_X; + weak|=REGION_RQGEOM_WEAK_Y; } - if((weak&(REGION_RQGEOM_WEAK_X|REGION_RQGEOM_WEAK_Y)) - ==(REGION_RQGEOM_WEAK_X|REGION_RQGEOM_WEAK_Y) && + if(weak&(REGION_RQGEOM_WEAK_X|REGION_RQGEOM_WEAK_Y) && (szplcy==SIZEPOLICY_UNCONSTRAINED || szplcy==SIZEPOLICY_FREE || szplcy==SIZEPOLICY_FREE_GLUE /* without flags */)){ + /* TODO: use 'weak'? */ group_calc_placement(ws, &g); } @@ -665,7 +680,7 @@ WRegion *group_do_attach(WGroup *ws, WFitParams fp; WWindow *par; WRegion *reg; - + if(ws->bottom!=NULL && param->bottom){ warn(TR("'bottom' already set.")); return NULL; @@ -681,7 +696,7 @@ WRegion *group_do_attach(WGroup *ws, fp.g=REGION_GEOM(ws); fp.mode=REGION_FIT_BOUNDS|REGION_FIT_WHATEVER; } - + return region_attach_helper((WRegion*) ws, par, &fp, (WRegionDoAttachFn*)group_do_attach_final, /*(const WRegionAttachParams*)*/param, data); @@ -985,7 +1000,7 @@ static WStacking *do_get_next(WGroup *ws, WStacking *sti, } if(sti_ok && focusable(ws, sti, min_level)) - return st; + return sti; return NULL; } @@ -1082,8 +1097,6 @@ void group_restack(WGroup *ws, Window other, int mode) WStacking *group_find_stacking(WGroup *ws, WRegion *r) { - WStacking *st; - if(r==NULL || REGION_MANAGER(r)!=(WRegion*)ws) return NULL; @@ -1146,16 +1159,19 @@ WRegion *group_bottom(WGroup *ws) /*EXTL_DOC - * Returns a list of regions managed by the workspace (frames, mostly). + * Iterate over managed regions of \var{ws} until \var{iterfn} returns + * \code{false}. + * The function itself returns \code{true} if it reaches the end of list + * without this happening. */ EXTL_SAFE EXTL_EXPORT_MEMBER -ExtlTab group_managed_list(WGroup *ws) +bool group_managed_i(WGroup *ws, ExtlFn iterfn) { WGroupIterTmp tmp; group_iter_init(&tmp, ws); - return extl_obj_iterable_to_table((ObjIterator*)group_iter, &tmp); + return extl_iter_objlist_(iterfn, (ObjIterator*)group_iter, &tmp); } @@ -1182,6 +1198,17 @@ Window group_xwindow(const WGroup *ws) } +WRegion *region_group_if_bottom(WRegion *reg) +{ + WGroup *grp=REGION_MANAGER_CHK(reg, WGroup); + + if(grp!=NULL && group_bottom(grp)==reg) + return (WRegion*)grp; + else + return reg; +} + + /*}}}*/ @@ -1295,8 +1322,8 @@ static DynFunTab group_dynfuntab[]={ {region_do_set_focus, group_do_set_focus}, - {region_managed_activated, - group_managed_activated}, + {region_managed_notify, + group_managed_notify}, {region_managed_remove, group_managed_remove}, diff --git a/ioncore/group.h b/ioncore/group.h index 0de372a..cfc1b60 100644 --- a/ioncore/group.h +++ b/ioncore/group.h @@ -1,7 +1,7 @@ /* * ion/ioncore/group.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -36,7 +36,6 @@ DECLSTRUCT(WGroupAttachParams){ uint switchto_set:1; uint switchto:1; - uint modal:1; uint bottom:1; int geom_weak; @@ -48,7 +47,7 @@ DECLSTRUCT(WGroupAttachParams){ }; #define GROUPATTACHPARAMS_INIT \ - {0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0, 0, NULL} + {0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0, 0, NULL} DECLCLASS(WGroup){ @@ -105,6 +104,8 @@ extern bool group_managed_rqorder(WGroup *grp, WRegion *sub, extern WStacking *group_find_stacking(WGroup *ws, WRegion *r); extern WStacking *group_find_to_focus(WGroup *ws, WStacking *to_try); +extern WRegion *region_group_if_bottom(WRegion *reg); + typedef WStackingFilter WGroupIterFilter; typedef WStackingIterTmp WGroupIterTmp; diff --git a/ioncore/groupedpholder.c b/ioncore/groupedpholder.c index ac3b692..4112372 100644 --- a/ioncore/groupedpholder.c +++ b/ioncore/groupedpholder.c @@ -1,7 +1,7 @@ /* * ion/ioncore/groupedpholder.c * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -127,7 +127,7 @@ WRegion *groupedpholder_do_attach(WGroupedPHolder *ph, int flags, data2.u.n.fn=grouped_handler; data2.u.n.param=data; - return pholder_attach_(ph->cont, flags, &data2); + return pholder_do_attach(ph->cont, flags, &data2); } @@ -139,19 +139,32 @@ WRegion *groupedpholder_do_attach(WGroupedPHolder *ph, int flags, bool groupedpholder_do_goto(WGroupedPHolder *ph) { - if(ph->cont!=NULL) - return pholder_goto(ph->cont); - - return FALSE; + return (ph->cont!=NULL + ? pholder_goto(ph->cont) + : FALSE); } WRegion *groupedpholder_do_target(WGroupedPHolder *ph) { - if(ph->cont!=NULL) - return pholder_target(ph->cont); + return (ph->cont!=NULL + ? pholder_target(ph->cont) + : NULL); +} + + +WPHolder *groupedpholder_do_root(WGroupedPHolder *ph) +{ + WPHolder *root; + + if(ph->cont==NULL) + return NULL; + + root=pholder_root(ph->cont); - return NULL; + return (root!=ph->cont + ? root + : &ph->ph); } @@ -170,6 +183,9 @@ static DynFunTab groupedpholder_dynfuntab[]={ {(DynFun*)pholder_do_target, (DynFun*)groupedpholder_do_target}, + + {(DynFun*)pholder_do_root, + (DynFun*)groupedpholder_do_root}, END_DYNFUNTAB }; diff --git a/ioncore/groupedpholder.h b/ioncore/groupedpholder.h index 4feb699..3fb9edd 100644 --- a/ioncore/groupedpholder.h +++ b/ioncore/groupedpholder.h @@ -1,7 +1,7 @@ /* * ion/ioncore/groupedpholder.h * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -33,6 +33,8 @@ extern bool groupedpholder_do_goto(WGroupedPHolder *ph); extern WRegion *groupedpholder_do_target(WGroupedPHolder *ph); +extern WPHolder *groupedpholder_do_root(WGroupedPHolder *ph); + extern WRegion *groupedpholder_do_attach(WGroupedPHolder *ph, int flags, WRegionAttachData *data); diff --git a/ioncore/grouppholder.c b/ioncore/grouppholder.c index d92c5b4..aa6f5cf 100644 --- a/ioncore/grouppholder.c +++ b/ioncore/grouppholder.c @@ -1,7 +1,7 @@ /* * ion/ioncore/grouppholder.c * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -73,9 +73,7 @@ bool grouppholder_init(WGroupPHolder *ph, WGroup *ws, if(st->above!=NULL && st->above->reg!=NULL) ph->param.stack_above=st->above->reg; - ph->param.modal=FALSE; ph->param.bottom=(st==ws->bottom); - /*ph->passive=FALSE;*/ }else{ ph->param=*param; } diff --git a/ioncore/grouppholder.h b/ioncore/grouppholder.h index 4b0208a..cb0ab19 100644 --- a/ioncore/grouppholder.h +++ b/ioncore/grouppholder.h @@ -1,7 +1,7 @@ /* * ion/ioncore/grouppholder.h * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/infowin.c b/ioncore/infowin.c index 95622b4..463b16e 100644 --- a/ioncore/infowin.c +++ b/ioncore/infowin.c @@ -1,7 +1,7 @@ /* * ion/ioncore/infowin.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -45,7 +45,8 @@ bool infowin_init(WInfoWin *p, WWindow *parent, const WFitParams *fp, goto fail2; p->brush=NULL; - p->attr=NULL; + + gr_stylespec_init(&p->attr); infowin_updategr(p); @@ -62,7 +63,8 @@ bool infowin_init(WInfoWin *p, WWindow *parent, const WFitParams *fp, return TRUE; -fail3: +fail3: + gr_stylespec_unalloc(&p->attr); free(p->style); fail2: free(p->buffer); @@ -86,11 +88,6 @@ void infowin_deinit(WInfoWin *p) p->buffer=NULL; } - if(p->attr!=NULL){ - free(p->attr); - p->attr=NULL; - } - if(p->style!=NULL){ free(p->style); p->style=NULL; @@ -101,6 +98,8 @@ void infowin_deinit(WInfoWin *p) p->brush=NULL; } + gr_stylespec_unalloc(&p->attr); + window_deinit(&(p->wwin)); } @@ -124,7 +123,8 @@ void infowin_draw(WInfoWin *p, bool complete) g.h=REGION_GEOM(p).h; grbrush_begin(p->brush, &g, GRBRUSH_NO_CLEAR_OK); - grbrush_draw_textbox(p->brush, &g, p->buffer, p->attr, TRUE); + grbrush_init_attr(p->brush, &p->attr); + grbrush_draw_textbox(p->brush, &g, p->buffer, TRUE); grbrush_end(p->brush); } @@ -157,25 +157,9 @@ void infowin_updategr(WInfoWin *p) /*{{{ Content-setting */ -bool infowin_set_attr2(WInfoWin *p, const char *attr1, const char *attr2) +GrStyleSpec *infowin_stylespec(WInfoWin *p) { - char *p2=NULL; - - if(attr1!=NULL){ - if(attr2==NULL) - p2=scopy(attr1); - else - libtu_asprintf(&p2, "%s-%s", attr1, attr2); - if(p2==NULL) - return FALSE; - } - - if(p->attr) - free(p->attr); - - p->attr=p2; - - return TRUE; + return &p->attr; } diff --git a/ioncore/infowin.h b/ioncore/infowin.h index c57dd01..e51396b 100644 --- a/ioncore/infowin.h +++ b/ioncore/infowin.h @@ -1,7 +1,7 @@ /* * ion/ioncore/infowin.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -23,8 +23,8 @@ DECLCLASS(WInfoWin){ WWindow wwin; GrBrush *brush; char *buffer; - char *attr; char *style; + GrStyleSpec attr; }; #define INFOWIN_BRUSH(INFOWIN) ((INFOWIN)->brush) @@ -38,7 +38,7 @@ extern WInfoWin *create_infowin(WWindow *parent, const WFitParams *fp, extern void infowin_deinit(WInfoWin *p); extern void infowin_set_text(WInfoWin *p, const char *s); -extern bool infowin_set_attr2(WInfoWin *p, const char *a1, const char *a2); +extern GrStyleSpec *infowin_stylespec(WInfoWin *p); extern WRegion *infowin_load(WWindow *par, const WFitParams *fp, ExtlTab tab); diff --git a/ioncore/ioncore.c b/ioncore/ioncore.c index 5c88803..62f616b 100644 --- a/ioncore/ioncore.c +++ b/ioncore/ioncore.c @@ -1,7 +1,7 @@ /* * ion/ioncore/ioncore.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -69,7 +69,7 @@ WGlobal ioncore_g; static const char *progname="ion"; static const char ioncore_copy[]= - "Ion " ION_VERSION ", copyright (c) Tuomo Valkonen 1999-2006."; + "Ion " ION_VERSION ", copyright (c) Tuomo Valkonen 1999-2007."; static const char ioncore_license[]=DUMMY_TR( "This program is free software; you can redistribute it and/or\n" @@ -267,13 +267,11 @@ static bool init_hooks() INIT_HOOK_(ioncore_deinit_hook); INIT_HOOK_(screen_managed_changed_hook); INIT_HOOK_(frame_managed_changed_hook); - INIT_HOOK_(region_activated_hook); - INIT_HOOK_(region_inactivated_hook); INIT_HOOK_(clientwin_mapped_hook); INIT_HOOK_(clientwin_unmapped_hook); INIT_HOOK_(clientwin_property_change_hook); - INIT_HOOK_(region_notify_hook); + INIT_HOOK(region_notify_hook, ioncore_frame_quasiactivation_notify); INIT_HOOK(clientwin_do_manage_alt, clientwin_do_manage_default); INIT_HOOK(ioncore_handle_event_alt, ioncore_handle_event); INIT_HOOK(region_do_warp_alt, region_do_warp_default); @@ -308,7 +306,11 @@ static bool register_classes() } -static void init_global() +#define INITSTR(NM) \ + ioncore_g.notifies.NM=stringstore_alloc(#NM); \ + if(ioncore_g.notifies.NM==STRINGID_NONE) return FALSE; + +static bool init_global() { /* argc, argv must be set be the program */ ioncore_g.dpy=NULL; @@ -338,13 +340,30 @@ static void init_global() ioncore_g.frame_default_index=LLIST_INDEX_AFTER_CURRENT_ACT; ioncore_g.framed_transients=TRUE; + + INITSTR(activated); + INITSTR(inactivated); + INITSTR(activity); + INITSTR(sub_activity); + INITSTR(name); + INITSTR(unset_manager); + INITSTR(set_manager); + INITSTR(unset_return); + INITSTR(set_return); + INITSTR(pseudoactivated); + INITSTR(pseudoinactivated); + INITSTR(tag); + INITSTR(deinit); + + return TRUE; } bool ioncore_init(const char *prog, int argc, char *argv[], const char *localedir) { - init_global(); + if(!init_global()) + return FALSE; progname=prog; ioncore_g.argc=argc; @@ -483,7 +502,7 @@ static bool ioncore_init_x(const char *display, int stflags) ioncore_init_session(XDisplayName(display)); for(i=drw; i1) diff --git a/ioncore/ioncore.h b/ioncore/ioncore.h index 658e966..ace4908 100644 --- a/ioncore/ioncore.h +++ b/ioncore/ioncore.h @@ -1,7 +1,7 @@ /* * ion/ioncore/focus.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -16,7 +16,6 @@ #include "common.h" #define IONCORE_STARTUP_ONEROOT 0x0001 -#define IONCORE_STARTUP_NOXINERAMA 0x0002 extern bool ioncore_init(const char *prog, int argc, char *argv[], const char *localedir); diff --git a/ioncore/ioncore_bindings.lua b/ioncore/ioncore_bindings.lua index bf5c9fe..ec03ddd 100644 --- a/ioncore/ioncore_bindings.lua +++ b/ioncore/ioncore_bindings.lua @@ -1,7 +1,7 @@ -- -- ion/share/ioncore-bindings.lua -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/ioncore_efbb.lua b/ioncore/ioncore_efbb.lua index 156a95d..af1134c 100644 --- a/ioncore/ioncore_efbb.lua +++ b/ioncore/ioncore_efbb.lua @@ -1,7 +1,7 @@ -- -- ion/share/ioncore_efbb.lua -- Minimal emergency fallback bindings. -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/ioncore_ext.lua b/ioncore/ioncore_ext.lua index cc56732..2255bdd 100644 --- a/ioncore/ioncore_ext.lua +++ b/ioncore/ioncore_ext.lua @@ -1,7 +1,7 @@ -- -- ion/share/ioncore_ext.lua -- Ioncore Lua library -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/ioncore_luaext.lua b/ioncore/ioncore_luaext.lua index cb52b97..b361593 100644 --- a/ioncore/ioncore_luaext.lua +++ b/ioncore/ioncore_luaext.lua @@ -1,7 +1,7 @@ -- -- ion/share/ioncore_luaext.lua -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/ioncore_menudb.lua b/ioncore/ioncore_menudb.lua index 6032b94..98d86a2 100644 --- a/ioncore/ioncore_menudb.lua +++ b/ioncore/ioncore_menudb.lua @@ -1,7 +1,7 @@ -- -- ion/ioncore/ioncore_menudb.lua -- Routines for defining menus. -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by @@ -28,7 +28,9 @@ function ioncore.defmenu(name, tab) ioncore.warn(TR("Unable to append to non-table menu")) return else - table.append(menus[name], tab) + for k, v in ipairs(tab) do + table.insert(menus[name], v) + end end else menus[name]=tab @@ -117,23 +119,73 @@ end -- Workspace and window lists {{{ -local function makelist(list) - local function mkentry(tgt) - return menuentry(tgt:name(), function() tgt:goto() end) +local function addto(list) + return function(tgt, attr) + local e=menuentry(tgt:name(), function() tgt:goto() end) + e.attr=attr; + table.insert(list, e) + return true end - local entries=table.map(mkentry, list) +end + +local function sort(entries) table.sort(entries, function(a, b) return a.name < b.name end) return entries end function menus.windowlist() - return makelist(ioncore.clientwin_list()) + local entries={} + ioncore.clientwin_i(addto(entries)) + return sort(entries) end function menus.workspacelist() - return makelist(ioncore.region_list("WGenWS")) + local entries={} + local iter_=addto(entries) + + local function iter(obj) + return (not obj_is(obj, "WGroupWS") + or iter_(obj)) + end + + ioncore.region_i(iter) + + return sort(entries) +end + +local function focuslist(do_act) + local entries={} + local seen={} + local iter_=addto(entries) + + local function iter(obj, attr) + if obj_is(obj, "WClientWin") then + iter_(obj, attr) + seen[obj]=true + end + return true + end + + local function iter_act(obj) + return iter(obj, "activity") + end + + local function iter_foc(obj) + return (seen[obj] or iter(obj)) + end + + if do_act then + ioncore.activity_i(iter_act) + end + + ioncore.focushistory_i(iter_foc) + + return entries end +menus.focuslist=function() return focuslist(true) end +menus.focuslist_=function() return focuslist(false) end + -- }}} diff --git a/ioncore/ioncore_misc.lua b/ioncore/ioncore_misc.lua index fd72b4d..3b24b66 100644 --- a/ioncore/ioncore_misc.lua +++ b/ioncore/ioncore_misc.lua @@ -1,7 +1,7 @@ -- -- ion/share/ioncore_misc.lua -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by @@ -9,18 +9,54 @@ -- (at your option) any later version. -- +local group_tmpl = { type="WGroupWS" } -local group_tmpl={type="WGroupWS", switchto=true} +local default_tmpl = { switchto=true } + +local empty = { type="WGroupWS", managed={} } + +local layouts={ + empty = empty, + default = empty, +} + +--DOC +-- Define a new workspace layout with name \var{name}, and +-- attach/creation parameters given in \var{tab}. The layout +-- "empty" may not be defined. +function ioncore.deflayout(name, tab) + assert(layout ~= "empty") + + if name=="default" and not tab then + layouts[name] = empty + else + layouts[name] = table.join(tab, group_tmpl) + end +end + +--DOC +-- Get named layout (or all of the latter parameter is set, +-- but this is for internal use only). +function ioncore.getlayout(name, all) + if all then + return layouts + else + return layouts[name] + end +end + +ioncore.set{_get_layout=ioncore.getlayout} --DOC -- Create new workspace on screen \var{scr}. The table \var{tmpl} --- may be used to override parts of \code{default_ws_params}, --- and \var{no_default} may be set to \code{true} to complete ignore it. -function ioncore.create_ws(scr, tmpl, no_default) - local dflt=(not no_default and ioncore.get().default_ws_params) or {} - local t=table.join(table.join(tmpl or {}, dflt), group_tmpl) +-- may be used to override parts of the layout named with \code{layout}. +-- If no \var{layout} is given, "default" is used. +function ioncore.create_ws(scr, tmpl, layout) + local lo=ioncore.getlayout(layout or "default") + + assert(lo, TR("Unknown layout")) - return scr:attach_new(t) + return scr:attach_new(table.join(tmpl or default_tmpl, lo)) end diff --git a/ioncore/ioncore_wd.lua b/ioncore/ioncore_wd.lua index 84107b8..a908d3e 100644 --- a/ioncore/ioncore_wd.lua +++ b/ioncore/ioncore_wd.lua @@ -1,7 +1,7 @@ -- -- ion/share/ioncore_wd.lua -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/ioncore_winprops.lua b/ioncore/ioncore_winprops.lua index 333ff69..c241d63 100644 --- a/ioncore/ioncore_winprops.lua +++ b/ioncore/ioncore_winprops.lua @@ -1,7 +1,7 @@ -- -- ion/share/ioncore_winprops.lua -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by @@ -68,7 +68,7 @@ function ioncore.getwinprop(cwin) end end -ioncore.set_get_winprop_fn(ioncore.getwinprop) +ioncore.set{_get_winprop=ioncore.getwinprop} local function ensure_winproptab(class, role, instance) if not winprops[class] then @@ -91,14 +91,16 @@ end --DOC -- The basic name-based winprop matching criteria. function ioncore.match_winprop_name(prop, cwin) - local nm=cwin:name() if not prop.name then return true - elseif nm then - local st, en=string.find(nm, prop.name) - return (st and en) else - return false + local nm=cwin:name() + if nm then + local st, en=string.find(nm, prop.name) + return (st and en) + else + return false + end end end diff --git a/ioncore/kbresize.c b/ioncore/kbresize.c index b427228..012a931 100644 --- a/ioncore/kbresize.c +++ b/ioncore/kbresize.c @@ -1,7 +1,7 @@ /* * ion/ioncore/kbresize.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/kbresize.h b/ioncore/kbresize.h index 3af0781..a3841c0 100644 --- a/ioncore/kbresize.h +++ b/ioncore/kbresize.h @@ -1,7 +1,7 @@ /* * ion/ioncore/kbresize.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/key.c b/ioncore/key.c index 00848a4..57ada80 100644 --- a/ioncore/key.c +++ b/ioncore/key.c @@ -1,7 +1,7 @@ /* * ion/ioncore/key.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -172,11 +172,20 @@ static bool add_sub(WRegion *reg, uint key, uint state) static XKeyEvent *current_key_event=NULL; +static uint current_kcb, current_state; +static bool current_submap; - -XKeyEvent *ioncore_current_key_event() +/* Note: state set to AnyModifier for submaps */ +bool ioncore_current_key(uint *kcb, uint *state, bool *sub) { - return current_key_event; + if(current_kcb==0) + return FALSE; + + *kcb=current_kcb; + *state=current_state; + *sub=current_submap; + + return TRUE; } @@ -227,15 +236,16 @@ static bool do_key(WRegion *reg, XKeyEvent *ev) if(grabbed) XUngrabKeyboard(ioncore_g.dpy, CurrentTime); - if(!subs) - current_key_event=ev; - + current_kcb=ev->keycode; + current_state=ev->state; + current_submap=subs; + /* TODO: having to pass both mgd and subreg for some handlers * to work is ugly and complex. */ extl_call(binding->func, "ooo", NULL, binding_owner, mgd, subreg); - current_key_event=NULL; + current_kcb=0; if(ev->state!=0 && !subs && binding->wait) waitrelease(oreg); diff --git a/ioncore/key.h b/ioncore/key.h index e5ba29c..35d8d55 100644 --- a/ioncore/key.h +++ b/ioncore/key.h @@ -1,7 +1,7 @@ /* * ion/ioncore/key.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -19,6 +19,6 @@ extern void ioncore_do_handle_keypress(XKeyEvent *ev); extern void clientwin_quote_next(WClientWin *cwin); -extern XKeyEvent *ioncore_current_key_event(); +extern bool ioncore_current_key(uint *kcb, uint *state, bool *sub); #endif /* ION_IONCORE_KEY_H */ diff --git a/ioncore/llist.c b/ioncore/llist.c index 3baca81..657a9e3 100644 --- a/ioncore/llist.c +++ b/ioncore/llist.c @@ -1,7 +1,7 @@ /* * ion/ioncore/llist.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/llist.h b/ioncore/llist.h index 83d148d..32ac441 100644 --- a/ioncore/llist.h +++ b/ioncore/llist.h @@ -1,7 +1,7 @@ /* * ion/ioncore/llist.h * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/manage.c b/ioncore/manage.c index f1d78a0..fda8d7b 100644 --- a/ioncore/manage.c +++ b/ioncore/manage.c @@ -1,7 +1,7 @@ /* * ion/ioncore/manage.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -20,6 +20,9 @@ #include "pointer.h" #include "netwm.h" #include "extlconv.h" +#include "return.h" +#include "conf.h" +#include "group-ws.h" /*{{{ Add */ @@ -34,16 +37,22 @@ WScreen *clientwin_find_suitable_screen(WClientWin *cwin, FOR_ALL_SCREENS(scr){ if(!region_same_rootwin((WRegion*)scr, (WRegion*)cwin)) continue; - if(REGION_IS_ACTIVE(scr)){ - found=scr; - if(!respectpos) - break; - } - - if(rectangle_contains(®ION_GEOM(scr), param->geom.x, param->geom.y)){ - found=scr; - if(respectpos) - break; + + if(!OBJ_IS(scr, WRootWin)){ + /* The root window itself is only a fallback */ + + if(REGION_IS_ACTIVE(scr)){ + found=scr; + if(!respectpos) + break; + } + + if(rectangle_contains(®ION_GEOM(scr), + param->geom.x, param->geom.y)){ + found=scr; + if(respectpos) + break; + } } if(found==NULL) @@ -54,6 +63,78 @@ WScreen *clientwin_find_suitable_screen(WClientWin *cwin, } +/*extern WRegion *ioncore_newly_created;*/ + + +static WPHolder *try_target(WClientWin *cwin, const WManageParams *param, + const char *target) +{ + WRegion *r=ioncore_lookup_region(target, NULL); + + if(r==NULL) + return NULL; + + return region_prepare_manage(r, cwin, param, MANAGE_REDIR_PREFER_NO); +} + + +static bool handle_target_winprops(WClientWin *cwin, const WManageParams *param, + WScreen *scr, WPHolder **ph_ret) +{ + char *layout=NULL, *target=NULL; + WPHolder *ph=NULL; + bool mgd=FALSE; + + if(extl_table_gets_s(cwin->proptab, "target", &target)) + ph=try_target(cwin, param, target); + + if(ph==NULL && extl_table_gets_s(cwin->proptab, "new_group", &layout)){ + ExtlTab lo=ioncore_get_layout(layout); + + free(layout); + + if(lo!=extl_table_none()){ + WMPlexAttachParams par=MPLEXATTACHPARAMS_INIT; + int mask=MPLEX_ATTACH_SWITCHTO; + WRegion *reg; + + if(param->switchto) + par.flags|=MPLEX_ATTACH_SWITCHTO; + + /*ioncore_newly_created=(WRegion*)cwin;*/ + + reg=mplex_attach_new_(&scr->mplex, &par, mask, lo); + + extl_unref_table(lo); + + /*ioncore_newly_created=NULL;*/ + + mgd=(region_manager((WRegion*)cwin)!=NULL); + + if(reg!=NULL && !mgd){ + if(target!=NULL) + ph=try_target(cwin, param, target); + + if(ph==NULL){ + ph=region_prepare_manage(reg, cwin, param, + MANAGE_REDIR_PREFER_YES); + + if(ph==NULL) + destroy_obj((Obj*)reg); + } + } + } + } + + if(target!=NULL) + free(target); + + *ph_ret=ph; + + return mgd; +} + + bool clientwin_do_manage_default(WClientWin *cwin, const WManageParams *param) { @@ -64,13 +145,6 @@ bool clientwin_do_manage_default(WClientWin *cwin, int swf; bool ok, tmp; - /* Check if param->tfor or any of its managers want to manage cwin. */ - if(param->tfor!=NULL){ - assert(param->tfor!=cwin); - ph=region_prepare_manage_transient((WRegion*)param->tfor, cwin, - param, 0); - } - /* Find a suitable screen */ scr=clientwin_find_suitable_screen(cwin, param); if(scr==NULL){ @@ -78,24 +152,36 @@ bool clientwin_do_manage_default(WClientWin *cwin, return FALSE; } + if(handle_target_winprops(cwin, param, scr, &ph)) + return TRUE; + + /* Check if param->tfor or any of its managers want to manage cwin. */ + if(ph==NULL && param->tfor!=NULL){ + assert(param->tfor!=cwin); + ph=region_prepare_manage_transient((WRegion*)param->tfor, cwin, + param, 0); + } + if(ph==NULL){ /* Find a placeholder for non-fullscreen state */ ph=region_prepare_manage((WRegion*)scr, cwin, param, MANAGE_REDIR_PREFER_YES); - } - - /* Check fullscreen mode */ - if(extl_table_gets_b(cwin->proptab, "fullscreen", &tmp)) - fs=tmp; - if(fs<0) - fs=netwm_check_initial_fullscreen(cwin, param->switchto); + /* Check fullscreen mode. (This is intentionally not done + * for transients and windows with target winprops.) + */ + if(extl_table_gets_b(cwin->proptab, "fullscreen", &tmp)) + fs=tmp; + + if(fs<0) + fs=netwm_check_initial_fullscreen(cwin, param->switchto); - if(fs<0){ - fs=clientwin_check_fullscreen_request(cwin, - param->geom.w, - param->geom.h, - param->switchto); + if(fs<0){ + fs=clientwin_check_fullscreen_request(cwin, + param->geom.w, + param->geom.h, + param->switchto); + } } if(fs>0){ @@ -105,8 +191,10 @@ bool clientwin_do_manage_default(WClientWin *cwin, destroy_obj((Obj*)ph); return TRUE; } - assert(cwin->fs_pholder==NULL); - cwin->fs_pholder=ph; + + if(!region_do_set_return((WRegion*)cwin, ph)) + destroy_obj((Obj*)ph); + return TRUE; } diff --git a/ioncore/manage.h b/ioncore/manage.h index 5354bea..5b81f3d 100644 --- a/ioncore/manage.h +++ b/ioncore/manage.h @@ -1,7 +1,7 @@ /* * ion/ioncore/manage.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/modules.c b/ioncore/modules.c index f7f6242..34d64c8 100644 --- a/ioncore/modules.c +++ b/ioncore/modules.c @@ -1,7 +1,7 @@ /* * ion/ioncore/modules.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/modules.h b/ioncore/modules.h index 6cc565e..0d00e52 100644 --- a/ioncore/modules.h +++ b/ioncore/modules.h @@ -1,7 +1,7 @@ /* * ion/ioncore/modules.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/mplex.c b/ioncore/mplex.c index 158b9ff..a202e7c 100644 --- a/ioncore/mplex.c +++ b/ioncore/mplex.c @@ -1,7 +1,7 @@ /* * ion/ioncore/mplex.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -94,8 +94,8 @@ WStacking *mplex_iter_nodes(WMPlexIterTmp *tmp) /*{{{ Destroy/create mplex */ -bool mplex_do_init(WMPlex *mplex, WWindow *parent, Window win, - const WFitParams *fp, bool create) +bool mplex_do_init(WMPlex *mplex, WWindow *parent, + const WFitParams *fp, Window win) { mplex->flags=0; @@ -110,21 +110,13 @@ bool mplex_do_init(WMPlex *mplex, WWindow *parent, Window win, mplex->stdispinfo.pos=MPLEX_STDISP_BL; mplex->stdispinfo.fullsize=FALSE; - if(create){ - if(!window_init((WWindow*)mplex, parent, fp)) - return FALSE; - }else{ - if(!window_do_init((WWindow*)mplex, parent, win, fp)) - return FALSE; - } + if(!window_do_init((WWindow*)mplex, parent, fp, win)) + return FALSE; mplex->win.region.flags|=REGION_BINDINGS_ARE_GRABBED; window_select_input(&(mplex->win), IONCORE_EVENTMASK_CWINMGR); - region_add_bindmap((WRegion*)mplex, ioncore_mplex_bindmap); - region_add_bindmap((WRegion*)mplex, ioncore_mplex_toplevel_bindmap); - region_register((WRegion*)mplex); /* Call this to set MPLEX_MANAGED_UNVIEWABLE if necessary. */ @@ -136,7 +128,7 @@ bool mplex_do_init(WMPlex *mplex, WWindow *parent, Window win, bool mplex_init(WMPlex *mplex, WWindow *parent, const WFitParams *fp) { - return mplex_do_init(mplex, parent, None, fp, TRUE); + return mplex_do_init(mplex, parent, fp, None); } @@ -266,31 +258,36 @@ WRegion *mplex_mx_nth(WMPlex *mplex, uint n) /*EXTL_DOC - * Returns a list of regions on the numbered/mutually exclusive list of - * \var{mplex}. + * Iterate over numbered/mutually exclusive region list of \var{mplex} + * until \var{iterfn} returns \code{false}. + * The function itself returns \code{true} if it reaches the end of list + * without this happening. */ EXTL_SAFE EXTL_EXPORT_MEMBER -ExtlTab mplex_mx_list(WMPlex *mplex) +bool mplex_mx_i(WMPlex *mplex, ExtlFn iterfn) { WLListIterTmp tmp; llist_iter_init(&tmp, mplex->mx_list); - return extl_obj_iterable_to_table((ObjIterator*)llist_iter_regions, &tmp); + return extl_iter_objlist_(iterfn, (ObjIterator*)llist_iter_regions, &tmp); } /*EXTL_DOC - * Returns a list of all regions managed by \var{mplex}. + * Iterate over managed regions of \var{mplex} until \var{iterfn} returns + * \code{false}. + * The function itself returns \code{true} if it reaches the end of list + * without this happening. */ EXTL_SAFE EXTL_EXPORT_MEMBER -ExtlTab mplex_managed_list(WMPlex *mplex) +bool mplex_managed_i(WMPlex *mplex, ExtlFn iterfn) { WMPlexIterTmp tmp; mplex_iter_init(&tmp, mplex); - return extl_obj_iterable_to_table((ObjIterator*)mplex_iter, &tmp); + return extl_iter_objlist_(iterfn, (ObjIterator*)mplex_iter, &tmp); } @@ -298,8 +295,8 @@ ExtlTab mplex_managed_list(WMPlex *mplex) * Set index of \var{reg} within the multiplexer to \var{index} within * the mutually exclusive list. Special values for \var{index} are: * \begin{tabularx}{\linewidth}{lX} - * $-1$ & After \fnref{WMPlex.mx_current}. \\ - * $-2$ & Last. \\ + * $-1$ & Last. \\ + * $-2$ & After \fnref{WMPlex.mx_current}. \\ * \end{tabularx} */ EXTL_EXPORT_MEMBER @@ -514,7 +511,7 @@ static void mplex_managed_rqgeom(WMPlex *mplex, WRegion *sub, mplex_managed_geom(mplex, &fp.g); - sizepolicy(&node->szplcy, sub, &rq->geom, &rq->flags, &fp); + sizepolicy(&node->szplcy, sub, &rq->geom, rq->flags, &fp); if(geomret!=NULL) *geomret=fp.g; @@ -921,11 +918,11 @@ typedef WStacking *NxtFn(WMPlex *mplex, WStacking *st, bool wrap); static WRegion *do_navi(WMPlex *mplex, WStacking *sti, - NxtFn *fn, WRegionNaviData *data, bool sti_ok) + NxtFn *fn, WRegionNaviData *data, + bool sti_ok, bool wrap) { WStacking *st, *stacking; uint min_level=0; - bool wrap=FALSE; stacking=mplex_get_stacking(mplex); @@ -968,20 +965,22 @@ WRegion *mplex_navi_first(WMPlex *mplex, WRegionNavi nh, WRegionNaviData *data) { WStacking *lst=mplex->mgd; - - if(lst==NULL) - return region_navi_cont((WRegion*)mplex, NULL, data); + WRegion *res=NULL; - if(nh==REGION_NAVI_ANY){ - /* ? */ - } + if(lst!=NULL){ + if(nh==REGION_NAVI_ANY){ + /* ? */ + } - if(nh==REGION_NAVI_ANY || nh==REGION_NAVI_END || - nh==REGION_NAVI_BOTTOM || nh==REGION_NAVI_RIGHT){ - return do_navi(mplex, lst, mplex_prv, data, TRUE); - }else{ - return do_navi(mplex, lst->mgr_prev, mplex_nxt, data, TRUE); + if(nh==REGION_NAVI_ANY || nh==REGION_NAVI_END || + nh==REGION_NAVI_BOTTOM || nh==REGION_NAVI_RIGHT){ + res=do_navi(mplex, lst, mplex_prv, data, TRUE, TRUE); + }else{ + res=do_navi(mplex, lst->mgr_prev, mplex_nxt, data, TRUE, TRUE); + } } + + return region_navi_cont((WRegion*)mplex, res, data); } @@ -989,6 +988,7 @@ WRegion *mplex_navi_next(WMPlex *mplex, WRegion *rel, WRegionNavi nh, WRegionNaviData *data) { WStacking *st; + WRegion *res; if(rel!=NULL){ st=mplex_find_stacking(mplex, rel); @@ -999,17 +999,19 @@ WRegion *mplex_navi_next(WMPlex *mplex, WRegion *rel, WRegionNavi nh, }else{ return mplex_navi_first(mplex, nh, data); } - + if(nh==REGION_NAVI_ANY){ /* ? */ } if(nh==REGION_NAVI_ANY || nh==REGION_NAVI_END || nh==REGION_NAVI_BOTTOM || nh==REGION_NAVI_RIGHT){ - return do_navi(mplex, st, mplex_nxt, data, FALSE); + res=do_navi(mplex, st, mplex_nxt, data, FALSE, FALSE); }else{ - return do_navi(mplex, st, mplex_prv, data, FALSE); + res=do_navi(mplex, st, mplex_prv, data, FALSE, FALSE); } + + return region_navi_cont((WRegion*)mplex, res, data); } @@ -1265,15 +1267,15 @@ WRegion *mplex_attach_simple(WMPlex *mplex, WRegion *reg, int flags) } -static void get_params(WMPlex *mplex, ExtlTab tab, WMPlexAttachParams *par) +static void get_params(WMPlex *mplex, ExtlTab tab, int mask, + WMPlexAttachParams *par) { int layer=1; int tmp; + int ok=~mask; - par->flags=0; - - if(extl_table_gets_i(tab, "layer", &tmp)){ - /* backwards compatibility */ + if(mask==0 && extl_table_gets_i(tab, "layer", &tmp)){ + /* backwards compatibility. No need to consider masked cases */ if(tmp==2){ par->flags|=MPLEX_ATTACH_UNNUMBERED; if(!extl_table_is_bool_set(tab, "passive")) @@ -1282,34 +1284,36 @@ static void get_params(WMPlex *mplex, ExtlTab tab, WMPlexAttachParams *par) } if(extl_table_gets_i(tab, "level", &tmp)){ - if(tmp>=0){ + if(tmp>=0 && ok&MPLEX_ATTACH_LEVEL){ par->flags|=MPLEX_ATTACH_LEVEL; par->level=tmp; } } if(extl_table_is_bool_set(tab, "modal")) - par->flags|=MPLEX_ATTACH_MODAL; + par->flags|=MPLEX_ATTACH_MODAL&ok; if(extl_table_is_bool_set(tab, "unnumbered")) - par->flags|=MPLEX_ATTACH_UNNUMBERED; + par->flags|=MPLEX_ATTACH_UNNUMBERED&ok; if(extl_table_is_bool_set(tab, "switchto")) - par->flags|=MPLEX_ATTACH_SWITCHTO; + par->flags|=MPLEX_ATTACH_SWITCHTO&ok; if(extl_table_is_bool_set(tab, "hidden")) - par->flags|=MPLEX_ATTACH_HIDDEN; + par->flags|=MPLEX_ATTACH_HIDDEN&ok; if(extl_table_gets_i(tab, "index", &(par->index))) - par->flags|=MPLEX_ATTACH_INDEX; + par->flags|=MPLEX_ATTACH_INDEX&ok; if(extl_table_gets_i(tab, "sizepolicy", &tmp)){ - par->flags|=MPLEX_ATTACH_SIZEPOLICY; - par->szplcy=tmp; + if(ok&MPLEX_ATTACH_SIZEPOLICY){ + par->flags|=MPLEX_ATTACH_SIZEPOLICY; + par->szplcy=tmp; + } } if(extl_table_gets_rectangle(tab, "geom", &par->geom)) - par->flags|=MPLEX_ATTACH_GEOM; + par->flags|=MPLEX_ATTACH_GEOM&ok; } @@ -1321,13 +1325,13 @@ static void get_params(WMPlex *mplex, ExtlTab tab, WMPlexAttachParams *par) EXTL_EXPORT_MEMBER WRegion *mplex_attach(WMPlex *mplex, WRegion *reg, ExtlTab param) { - WMPlexAttachParams par; + WMPlexAttachParams par=MPLEXATTACHPARAMS_INIT; WRegionAttachData data; if(reg==NULL) return NULL; - get_params(mplex, param, &par); + get_params(mplex, param, 0, &par); data.type=REGION_ATTACH_REPARENT; data.u.reg=reg; @@ -1336,6 +1340,20 @@ WRegion *mplex_attach(WMPlex *mplex, WRegion *reg, ExtlTab param) } +WRegion *mplex_attach_new_(WMPlex *mplex, WMPlexAttachParams *par, + int mask, ExtlTab param) +{ + WRegionAttachData data; + + get_params(mplex, param, mask, par); + + data.type=REGION_ATTACH_LOAD; + data.u.tab=param; + + return mplex_do_attach(mplex, par, &data); +} + + /*EXTL_DOC * Create a new region to be managed by \var{mplex}. At least the following * fields in \var{param} are understood (all but \var{type} are optional). @@ -1365,15 +1383,9 @@ WRegion *mplex_attach(WMPlex *mplex, WRegion *reg, ExtlTab param) EXTL_EXPORT_MEMBER WRegion *mplex_attach_new(WMPlex *mplex, ExtlTab param) { - WMPlexAttachParams par; - WRegionAttachData data; + WMPlexAttachParams par=MPLEXATTACHPARAMS_INIT; - get_params(mplex, param, &par); - - data.type=REGION_ATTACH_LOAD; - data.u.tab=param; - - return mplex_do_attach(mplex, &par, &data); + return mplex_attach_new_(mplex, &par, 0, param); } @@ -1384,9 +1396,12 @@ EXTL_EXPORT_MEMBER void mplex_attach_tagged(WMPlex *mplex) { WRegion *reg; + int flags=MPLEX_ATTACH_SWITCHTO; - while((reg=ioncore_tags_take_first())!=NULL) - mplex_attach_simple(mplex, reg, 0); + while((reg=ioncore_tagged_take_first())!=NULL){ + mplex_attach_simple(mplex, reg, flags); + /*flags=0;*/ + } } @@ -1597,17 +1612,14 @@ bool mplex_set_stdisp(WMPlex *mplex, WRegion *reg, if(!CAN_MANAGE_STDISP(mgr)) mgr=NULL; - - if(oldstdisp!=reg){ - mainloop_defer_destroy((Obj*)oldstdisp); - watch_reset(&(mplex->stdispwatch)); - } } if(din!=NULL) mplex->stdispinfo=*din; if(reg==NULL){ + watch_reset(&(mplex->stdispwatch)); + if(mgr!=NULL){ region_unmanage_stdisp(mgr, TRUE, FALSE); if(oldstdisp!=NULL) @@ -1619,6 +1631,9 @@ bool mplex_set_stdisp(WMPlex *mplex, WRegion *reg, mplex_remanage_stdisp(mplex); } + if(oldstdisp!=NULL && oldstdisp!=reg) + region_dispose((WRegion*)oldstdisp, FALSE); + return TRUE; } @@ -1920,7 +1935,7 @@ ExtlTab mplex_get_configuration(WMPlex *mplex) tab=region_get_base_configuration((WRegion*)mplex); subs=extl_create_table(); - extl_table_sets_t(tab, "subs", subs); + extl_table_sets_t(tab, "managed", subs); /* First the numbered/mutually exclusive nodes */ FOR_ALL_NODES_ON_LLIST(lnode, mplex->mx_list, ltmp){ @@ -1964,16 +1979,17 @@ void mplex_load_contents(WMPlex *mplex, ExtlTab tab) extl_unref_table(subtab); }*/ - if(extl_table_gets_t(tab, "subs", &substab)){ + if(extl_table_gets_t(tab, "managed", &substab) || + extl_table_gets_t(tab, "subs", &substab)){ n=extl_table_get_n(substab); for(i=1; i<=n; i++){ if(extl_table_geti_t(substab, i, &subtab)){ /*mplex_attach_new(mplex, subtab);*/ - WMPlexAttachParams par; + WMPlexAttachParams par=MPLEXATTACHPARAMS_INIT; WRegionAttachData data; char *tmp=NULL; - get_params(mplex, subtab, &par); + get_params(mplex, subtab, 0, &par); par.flags|=MPLEX_ATTACH_INDEX; par.index=LLIST_INDEX_LAST; diff --git a/ioncore/mplex.h b/ioncore/mplex.h index 889f387..829c841 100644 --- a/ioncore/mplex.h +++ b/ioncore/mplex.h @@ -1,7 +1,7 @@ /* * ion/ioncore/mplex.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -108,8 +108,8 @@ DECLCLASS(WMPlex){ extern WMPlex *create_mplex(WWindow *parent, const WFitParams *fp); extern bool mplex_init(WMPlex *mplex, WWindow *parent, const WFitParams *fp); -extern bool mplex_do_init(WMPlex *mplex, WWindow *parent, Window win, - const WFitParams *fp, bool create); +extern bool mplex_do_init(WMPlex *mplex, WWindow *parent, + const WFitParams *fp, Window win); extern void mplex_deinit(WMPlex *mplex); /* Resize and reparent */ @@ -129,6 +129,8 @@ extern WRegion *mplex_attach_simple(WMPlex *mplex, WRegion *reg, int flags); extern WRegion *mplex_attach(WMPlex *mplex, WRegion *reg, ExtlTab param); +extern WRegion *mplex_attach_new_(WMPlex *mplex, WMPlexAttachParams *partmpl, + int mask, ExtlTab param); extern WRegion *mplex_attach_new(WMPlex *mplex, ExtlTab param); extern WRegion *mplex_do_attach_pholder(WMPlex *mplex, WMPlexPHolder *ph, @@ -176,9 +178,11 @@ extern bool mplex_managed_rqorder(WMPlex *mplex, WRegion *sub, extern WRegion *mplex_current(WMPlex *mplex); extern bool mplex_may_destroy(WMPlex *mplex); +extern bool mplex_managed_i(WMPlex *mplex, ExtlFn iterfn); + extern int mplex_mx_count(WMPlex *mplex); extern WRegion *mplex_mx_nth(WMPlex *mplex, uint n); -extern ExtlTab mplex_mx_list(WMPlex *mplex); +extern bool mplex_mx_i(WMPlex *mplex, ExtlFn iterfn); extern WRegion *mplex_mx_current(WMPlex *mplex); extern void mplex_call_changed_hook(WMPlex *mplex, WHook *hook, diff --git a/ioncore/mplexpholder.c b/ioncore/mplexpholder.c index 51166f7..f6d089a 100644 --- a/ioncore/mplexpholder.c +++ b/ioncore/mplexpholder.c @@ -1,7 +1,7 @@ /* * ion/ioncore/mplexpholder.c * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -17,6 +17,7 @@ #include "mplex.h" #include "mplexpholder.h" #include "llist.h" +#include "framedpholder.h" static void mplex_watch_handler(Watch *watch, Obj *mplex); @@ -60,12 +61,28 @@ static void mplexpholder_do_link(WMPlexPHolder *ph, void mplexpholder_do_unlink(WMPlexPHolder *ph, WMPlex *mplex) { + if(ph->recreate_pholder!=NULL){ + if(ph->prev!=NULL) + ph->prev->recreate_pholder=ph->recreate_pholder; + else + destroy_obj((Obj*)ph->recreate_pholder); + ph->recreate_pholder=NULL; + } + if(ph->after!=NULL){ UNLINK_ITEM(ph->after->phs, ph, next, prev); }else if(mplex!=NULL && on_ph_list(mplex->mx_phs, ph)){ UNLINK_ITEM(mplex->mx_phs, ph, next, prev); }else{ - assert(ph->next==NULL && ph->prev==NULL); + WMPlexPHolder *next=ph->next; + + assert((ph->next==NULL && ph->prev==NULL) + || ph->mplex_watch.obj==NULL); + + if(ph->next!=NULL) + ph->next->prev=ph->prev; + if(ph->prev!=NULL) + ph->prev->next=next; } ph->after=NULL; @@ -101,6 +118,7 @@ bool mplexpholder_init(WMPlexPHolder *ph, WMPlex *mplex, WStacking *st, ph->next=NULL; ph->prev=NULL; ph->param.flags=0; + ph->recreate_pholder=NULL; if(!watch_setup(&(ph->mplex_watch), (Obj*)mplex, mplex_watch_handler)){ pholder_deinit(&(ph->ph)); @@ -171,14 +189,121 @@ void mplexpholder_deinit(WMPlexPHolder *ph) /*{{{ Move, attach, layer */ +typedef struct{ + WMPlexPHolder *ph, *ph_head; + WRegionAttachData *data; + WFramedParam *param; +} RP; + + +WRegion *recreate_handler(WWindow *par, + const WFitParams *fp, + void *rp_) +{ + RP *rp=(RP*)rp_; + WMPlexPHolder *ph=rp->ph, *ph_head=rp->ph_head, *phtmp; + WFramedParam *param=rp->param; + WFrame *frame; + WRegion *reg; + + frame=create_frame(par, fp, param->mode); + + if(frame==NULL) + return NULL; + + /* Move pholders to frame */ + frame->mplex.mx_phs=ph_head; + + for(phtmp=frame->mplex.mx_phs; phtmp!=NULL; phtmp=phtmp->next) + watch_setup(&(phtmp->mplex_watch), (Obj*)frame, mplex_watch_handler); + + /* Attach */ + if(fp->mode&(REGION_FIT_BOUNDS|REGION_FIT_WHATEVER)) + ph->param.flags|=MPLEX_ATTACH_WHATEVER; + + reg=mplex_do_attach_pholder(&frame->mplex, ph, rp->data); + + ph->param.flags&=~MPLEX_ATTACH_WHATEVER; + + if(reg==NULL){ + /* Try to recover */ + for(phtmp=frame->mplex.mx_phs; phtmp!=NULL; phtmp=phtmp->next) + watch_reset(&(phtmp->mplex_watch)); + frame->mplex.mx_phs=NULL; + + destroy_obj((Obj*)frame); + + return NULL; + }else{ + frame_adjust_to_initial(frame, fp, param, reg); + + return (WRegion*)frame; + } +} + + +static WMPlexPHolder *get_head(WMPlexPHolder *ph) +{ + while(1){ + if(ph->prev->next==NULL) + break; + ph=ph->prev; + } + + return ph; +} + + +static WFramedPHolder *get_recreate_ph(WMPlexPHolder *ph) +{ + return get_head(ph)->recreate_pholder; +} + + +static WRegion *mplexpholder_attach_recreate(WMPlexPHolder *ph, int flags, + WRegionAttachData *data) +{ + WRegionAttachData data2; + WFramedPHolder *fph; + WPHolder *root; + WRegion *reg; + RP rp; + + rp.ph_head=get_head(ph); + + assert(rp.ph_head!=NULL); + + fph=rp.ph_head->recreate_pholder; + + if(fph==NULL) + return NULL; + + rp.ph=ph; + rp.data=data; + rp.param=&fph->param; + + data2.type=REGION_ATTACH_NEW; + data2.u.n.fn=recreate_handler; + data2.u.n.param=&rp; + + reg=pholder_do_attach(fph->cont, flags, &data2); /* == frame */ + + if(reg!=NULL){ + destroy_obj((Obj*)fph); + rp.ph_head->recreate_pholder=NULL; + } + + return reg; +} + + WRegion *mplexpholder_do_attach(WMPlexPHolder *ph, int flags, WRegionAttachData *data) { WMPlex *mplex=(WMPlex*)ph->mplex_watch.obj; - WRegion *reg=NULL; if(mplex==NULL) - return FALSE; + return mplexpholder_attach_recreate(ph, flags, data); if(flags&PHOLDER_ATTACH_SWITCHTO) ph->param.flags|=MPLEX_ATTACH_SWITCHTO; @@ -212,18 +337,55 @@ bool mplexpholder_move(WMPlexPHolder *ph, WMPlex *mplex, bool mplexpholder_do_goto(WMPlexPHolder *ph) { - WMPlex *mplex=(WMPlex*)ph->mplex_watch.obj; - - if(mplex!=NULL) - return region_goto((WRegion*)mplex); + WRegion *reg=(WRegion*)ph->mplex_watch.obj; - return FALSE; + if(reg!=NULL){ + return region_goto(reg); + }else{ + WFramedPHolder *fph=get_recreate_ph(ph); + + return (fph!=NULL + ? pholder_do_goto((WPHolder*)fph) + : FALSE); + } } WRegion *mplexpholder_do_target(WMPlexPHolder *ph) { - return (WRegion*)ph->mplex_watch.obj; + WRegion *reg=(WRegion*)ph->mplex_watch.obj; + + if(reg!=NULL){ + return reg; + }else{ + WFramedPHolder *fph=get_recreate_ph(ph); + + return (fph!=NULL + ? pholder_do_target((WPHolder*)fph) + : NULL); + } +} + + +WPHolder *mplexpholder_do_root(WMPlexPHolder *ph) +{ + WRegion *reg=(WRegion*)ph->mplex_watch.obj; + + if(reg!=NULL){ + return &ph->ph; + }else{ + WFramedPHolder *fph=get_recreate_ph(ph); + WPHolder *root; + + if(fph==NULL) + return NULL; + + root=pholder_root((WPHolder*)fph); + + return (root!=(WPHolder*)fph + ? root + : &ph->ph); + } } @@ -300,6 +462,9 @@ static DynFunTab mplexpholder_dynfuntab[]={ {(DynFun*)pholder_do_target, (DynFun*)mplexpholder_do_target}, + + {(DynFun*)pholder_do_root, + (DynFun*)mplexpholder_do_root}, END_DYNFUNTAB }; diff --git a/ioncore/mplexpholder.h b/ioncore/mplexpholder.h index 4dce782..5a98922 100644 --- a/ioncore/mplexpholder.h +++ b/ioncore/mplexpholder.h @@ -1,7 +1,7 @@ /* * ion/ioncore/mplexpholder.h * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -16,10 +16,13 @@ #include "pholder.h" #include "mplex.h" #include "attach.h" +#include "framedpholder.h" + DECLCLASS(WMPlexPHolder){ WPHolder ph; Watch mplex_watch; + WFramedPHolder *recreate_pholder; /* only on first of list */ WLListNode *after; WMPlexPHolder *next, *prev; WMPlexAttachParams param; @@ -46,6 +49,8 @@ extern WRegion *mplexpholder_do_attach(WMPlexPHolder *ph, int flags, extern bool mplexpholder_do_goto(WMPlexPHolder *ph); +extern WPHolder *mplexpholder_do_root(WMPlexPHolder *ph); + extern WRegion *mplexpholder_do_target(WMPlexPHolder *ph); extern bool mplexpholder_move(WMPlexPHolder *ph, WMPlex *mplex, diff --git a/ioncore/mwmhints.c b/ioncore/mwmhints.c index 2ebc683..2c2269c 100644 --- a/ioncore/mwmhints.c +++ b/ioncore/mwmhints.c @@ -1,7 +1,7 @@ /* * ion/ioncore/mwmhints.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/mwmhints.h b/ioncore/mwmhints.h index 99ac8ad..09571f3 100644 --- a/ioncore/mwmhints.h +++ b/ioncore/mwmhints.h @@ -1,7 +1,7 @@ /* * ion/ioncore/mwmhints.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/names.c b/ioncore/names.c index 7085504..5f3c386 100644 --- a/ioncore/names.c +++ b/ioncore/names.c @@ -1,7 +1,7 @@ /* * ion/ioncore/names.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -19,6 +19,7 @@ #include #include "common.h" +#include "global.h" #include "region.h" #include "clientwin.h" #include "names.h" @@ -416,7 +417,7 @@ static bool do_set_name(bool (*fn)(WRegion *reg, WNamespace *ns, const char *p), if(nm!=NULL) free(nm); - region_notify_change(reg, "name"); + region_notify_change(reg, ioncore_g.notifies.name); return ret; } @@ -537,16 +538,13 @@ WClientWin *ioncore_lookup_clientwin(const char *name) } -static ExtlTab do_list(WNamespace *ns, const char *typenam) +static bool do_list(ExtlFn fn, WNamespace *ns, const char *typenam) { - ExtlTab tab; Rb_node node; int n=0; if(!ns->initialised) - return extl_table_none(); - - tab=extl_create_table(); + return FALSE; rb_traverse(node, ns->rb){ WRegion *reg=(WRegion*)node->v.val; @@ -556,33 +554,38 @@ static ExtlTab do_list(WNamespace *ns, const char *typenam) if(typenam!=NULL && !obj_is_str((Obj*)reg, typenam)) continue; - if(extl_table_seti_o(tab, n+1, (Obj*)reg)) - n++; + if(!extl_iter_obj(fn, (Obj*)reg)) + return FALSE; } - return tab; + return TRUE; } /*EXTL_DOC - * Find all non-client window regions inheriting \var{typenam}. + * Iterate over all non-client window regions with (inherited) class + * \var{typenam} until \var{iterfn} returns \code{false}. + * The function itself returns \code{true} if it reaches the end of list + * without this happening. */ EXTL_SAFE EXTL_EXPORT -ExtlTab ioncore_region_list(const char *typenam) +bool ioncore_region_i(ExtlFn fn, const char *typenam) { - return do_list(&ioncore_internal_ns, typenam); + return do_list(fn, &ioncore_internal_ns, typenam); } /*EXTL_DOC - * Return a list of all client windows. + * Iterate over client windows until \var{iterfn} returns \code{false}. + * The function itself returns \code{true} if it reaches the end of list + * without this happening. */ EXTL_SAFE EXTL_EXPORT -ExtlTab ioncore_clientwin_list() +bool ioncore_clientwin_i(ExtlFn fn) { - return do_list(&ioncore_clientwin_ns, NULL); + return do_list(fn, &ioncore_clientwin_ns, NULL); } diff --git a/ioncore/names.h b/ioncore/names.h index 5a2cc36..57dd5aa 100644 --- a/ioncore/names.h +++ b/ioncore/names.h @@ -1,7 +1,7 @@ /* * ion/ioncore/names.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -43,8 +43,8 @@ DYNFUN const char *region_displayname(WRegion *reg); extern char *region_make_label(WRegion *reg, int maxw, GrBrush *brush); -extern ExtlTab ioncore_region_list(const char *typenam); -extern ExtlTab ioncore_clientwin_list(); +extern bool ioncore_region_i(ExtlFn fn, const char *typenam); +extern bool ioncore_clientwin_i(ExtlFn fn); extern WRegion *ioncore_lookup_region(const char *cname, const char *typenam); extern WClientWin *ioncore_lookup_clientwin(const char *cname); diff --git a/ioncore/navi.c b/ioncore/navi.c index f52a44b..7a10e6b 100644 --- a/ioncore/navi.c +++ b/ioncore/navi.c @@ -1,7 +1,7 @@ /* * ion/ioncore/navi.c * - * Copyright (c) Tuomo Valkonen 2006. + * Copyright (c) Tuomo Valkonen 2006-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -120,6 +120,7 @@ static bool may_ascend(WRegion *to, WRegion *from, WRegionNaviData *data) }else if(data->no_ascend!=NULL){ return (data->no_ascend!=(Obj*)from); }else{ + /* Set to TRUE for cycling out of nested workspaces etc. */ return !OBJ_IS(from, WMPlex); } } @@ -136,6 +137,7 @@ static bool may_descend(WRegion *to, WRegion *from, WRegionNaviData *data) }else if(data->no_descend!=NULL){ return (data->no_descend!=(Obj*)from); }else{ + /* Set to TRUE for cycling into nested workspaces etc. */ return !OBJ_IS(to, WMPlex); } } diff --git a/ioncore/navi.h b/ioncore/navi.h index 3c38973..b1ed6a0 100644 --- a/ioncore/navi.h +++ b/ioncore/navi.h @@ -1,7 +1,7 @@ /* * ion/ioncore/navi.h * - * Copyright (c) Tuomo Valkonen 2006. + * Copyright (c) Tuomo Valkonen 2006-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/netwm.c b/ioncore/netwm.c index cd0cb85..d7c466e 100644 --- a/ioncore/netwm.c +++ b/ioncore/netwm.c @@ -1,7 +1,7 @@ /* * ion/ioncore/netwm.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -100,7 +100,7 @@ int netwm_check_initial_fullscreen(WClientWin *cwin, bool sw) for(i=0; idata.l[0]==_NET_WM_STATE_TOGGLE){ bool sw=clientwin_fullscreen_may_switchto(cwin); cwin->flags|=CLIENTWIN_FS_RQ; - if(!clientwin_enter_fullscreen(cwin, sw)) + if(!region_enter_fullscreen((WRegion*)cwin, sw)) cwin->flags&=~CLIENTWIN_FS_RQ; }else{ /* Should not be set.. */ @@ -158,7 +158,7 @@ static void netwm_state_change_rq(WClientWin *cwin, ev->data.l[0]==_NET_WM_STATE_TOGGLE){ bool sw=clientwin_fullscreen_may_switchto(cwin); cwin->flags&=~CLIENTWIN_FS_RQ; - clientwin_leave_fullscreen(cwin, sw); + region_leave_fullscreen((WRegion*)cwin, sw); }else{ /* Set the flag */ cwin->flags|=CLIENTWIN_FS_RQ; diff --git a/ioncore/netwm.h b/ioncore/netwm.h index bbfa9b9..e566ca6 100644 --- a/ioncore/netwm.h +++ b/ioncore/netwm.h @@ -1,7 +1,7 @@ /* * ion/ioncore/netwm.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/pholder.c b/ioncore/pholder.c index 4aed2cc..5fdb7b8 100644 --- a/ioncore/pholder.c +++ b/ioncore/pholder.c @@ -1,7 +1,7 @@ /* * ion/ioncore/pholder.c * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -13,6 +13,7 @@ #include "common.h" #include "attach.h" #include "pholder.h" +#include "focus.h" bool pholder_init(WPHolder *ph) @@ -53,10 +54,15 @@ static WRegion *add_fn_reparent(WWindow *par, const WFitParams *fp, WRegion *pholder_attach_(WPHolder *ph, int flags, WRegionAttachData *data) { - if(ph->redirect!=NULL) - return pholder_attach_(ph->redirect, flags, data); - else - return pholder_do_attach(ph, flags, data); + WPHolder *root=pholder_root(ph); + + /* Use the root, so that extra containers are not added from + * stale chains. + */ + + return (root==NULL + ? NULL + : pholder_do_attach(root, flags, data)); } @@ -71,6 +77,20 @@ bool pholder_attach(WPHolder *ph, int flags, WRegion *reg) } +bool pholder_attach_mcfgoto(WPHolder *ph, int flags, WRegion *reg) +{ + bool cf=region_may_control_focus(reg); + + if(!pholder_attach(ph, flags, reg)) + return FALSE; + + if(cf) + region_goto(reg); + + return TRUE; +} + + WRegion *pholder_do_target(WPHolder *ph) { WRegion *ret=NULL; @@ -81,10 +101,9 @@ WRegion *pholder_do_target(WPHolder *ph) WRegion *pholder_target(WPHolder *ph) { - if(ph->redirect!=NULL) - return pholder_target(ph->redirect); - else - return pholder_do_target(ph); + return (ph->redirect!=NULL + ? pholder_target(ph->redirect) + : pholder_do_target(ph)); } @@ -126,13 +145,39 @@ bool pholder_do_goto(WPHolder *ph) bool pholder_goto(WPHolder *ph) { - if(ph->redirect!=NULL) - return pholder_goto(ph->redirect); - else - return pholder_do_goto(ph); + return (ph->redirect!=NULL + ? pholder_goto(ph->redirect) + : pholder_do_goto(ph)); } +WPHolder *pholder_do_root_default(WPHolder *ph) +{ + return ph; +} + + +WPHolder *pholder_do_root(WPHolder *ph) +{ + WPHolder *ret=NULL; + CALL_DYN_RET(ret, WPHolder*, pholder_do_root, ph, (ph)); + return ret; +} + + +WPHolder *pholder_root(WPHolder *ph) +{ + return (ph->redirect!=NULL + ? pholder_root(ph->redirect) + : pholder_do_root(ph)); +} + + +bool pholder_stale(WPHolder *ph) +{ + return (pholder_root(ph)!=ph); +} + bool pholder_redirect(WPHolder *ph, WRegion *old_target) { @@ -201,6 +246,9 @@ WPHolder *pholder_either(WPHolder *a, WPHolder *b) static DynFunTab pholder_dynfuntab[]={ {(DynFun*)pholder_do_check_reparent, (DynFun*)pholder_do_check_reparent_default}, + + {(DynFun*)pholder_do_root, + (DynFun*)pholder_do_root_default}, END_DYNFUNTAB }; diff --git a/ioncore/pholder.h b/ioncore/pholder.h index 7fe2710..4ccc654 100644 --- a/ioncore/pholder.h +++ b/ioncore/pholder.h @@ -1,7 +1,7 @@ /* * ion/ioncore/pholder.h * - * Copyright (c) Tuomo Valkonen 2005-2006. + * Copyright (c) Tuomo Valkonen 2005-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -39,10 +39,18 @@ extern WRegion *pholder_attach_(WPHolder *ph, int flags, extern bool pholder_attach(WPHolder *ph, int flags, WRegion *reg); +extern bool pholder_attach_mcfgoto(WPHolder *ph, int flags, WRegion *reg); + DYNFUN WRegion *pholder_do_target(WPHolder *ph); extern WRegion *pholder_target(WPHolder *ph); +extern WPHolder *pholder_do_root(WPHolder *ph); + +extern WPHolder *pholder_root(WPHolder *ph); + +extern bool pholder_stale(WPHolder *ph); + DYNFUN bool pholder_do_check_reparent(WPHolder *ph, WRegion *reg); extern bool pholder_check_reparent(WPHolder *ph, WRegion *reg); diff --git a/ioncore/pointer.c b/ioncore/pointer.c index 977940d..671af84 100644 --- a/ioncore/pointer.c +++ b/ioncore/pointer.c @@ -1,7 +1,7 @@ /* * ion/ioncore/pointer.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/pointer.h b/ioncore/pointer.h index bf2e00a..7b73cdb 100644 --- a/ioncore/pointer.h +++ b/ioncore/pointer.h @@ -1,7 +1,7 @@ /* * ion/ioncore/pointer.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/presize.c b/ioncore/presize.c index 80b7203..5b16ba4 100644 --- a/ioncore/presize.c +++ b/ioncore/presize.c @@ -1,7 +1,7 @@ /* * ion/ioncore/presize.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/presize.h b/ioncore/presize.h index 85fd889..a480033 100644 --- a/ioncore/presize.h +++ b/ioncore/presize.h @@ -1,7 +1,7 @@ /* * ion/ioncore/presize.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/property.c b/ioncore/property.c index 3bacca1..798dbf5 100644 --- a/ioncore/property.c +++ b/ioncore/property.c @@ -1,7 +1,7 @@ /* * ion/ioncore/property.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/property.h b/ioncore/property.h index c340380..cb9252e 100644 --- a/ioncore/property.h +++ b/ioncore/property.h @@ -1,7 +1,7 @@ /* * ion/ioncore/property.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/rectangle.c b/ioncore/rectangle.c index 00cae86..50dcc09 100644 --- a/ioncore/rectangle.c +++ b/ioncore/rectangle.c @@ -1,7 +1,7 @@ /* * ion/ioncore/rectangle.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/rectangle.h b/ioncore/rectangle.h index da7b305..701d2b2 100644 --- a/ioncore/rectangle.h +++ b/ioncore/rectangle.h @@ -1,7 +1,7 @@ /* * ion/ioncore/rectangle.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/regbind.c b/ioncore/regbind.c index 43bc3a6..0b2f371 100644 --- a/ioncore/regbind.c +++ b/ioncore/regbind.c @@ -1,7 +1,7 @@ /* * ion/regbind.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/regbind.h b/ioncore/regbind.h index b7c0412..ad1fe6d 100644 --- a/ioncore/regbind.h +++ b/ioncore/regbind.h @@ -1,7 +1,7 @@ /* * ion/ioncore/regbind.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/reginfo.c b/ioncore/reginfo.c index 5606b09..9815880 100644 --- a/ioncore/reginfo.c +++ b/ioncore/reginfo.c @@ -1,7 +1,7 @@ /* * ion/ioncore/reginfo.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/reginfo.h b/ioncore/reginfo.h index a83c2e2..0a75a98 100644 --- a/ioncore/reginfo.h +++ b/ioncore/reginfo.h @@ -1,7 +1,7 @@ /* * ion/ioncore/reginfo.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/region-iter.h b/ioncore/region-iter.h index bf9f135..157ab7d 100644 --- a/ioncore/region-iter.h +++ b/ioncore/region-iter.h @@ -1,7 +1,7 @@ /* * ion/ioncore/region-iter.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/region.c b/ioncore/region.c index dede094..68be25d 100644 --- a/ioncore/region.c +++ b/ioncore/region.c @@ -1,7 +1,7 @@ /* * ion/ioncore/region.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -26,6 +26,7 @@ #include "extlconv.h" #include "activity.h" #include "region-iter.h" +#include "return.h" #define D2(X) @@ -33,8 +34,8 @@ WHook *region_notify_hook=NULL; -static void region_notify_change_(WRegion *reg, const char *how, - Obj *detail); + +static void region_notify_change_(WRegion *reg, WRegionNotify how); /*{{{ Init & deinit */ @@ -73,7 +74,7 @@ void region_init(WRegion *reg, WWindow *par, const WFitParams *fp) reg->rootwin=((WRegion*)par)->rootwin; region_set_parent(reg, par); }else{ - assert(OBJ_IS(reg, WRootWin));/* || OBJ_IS(reg, WScreen));*/ + assert(OBJ_IS(reg, WRootWin)); } } @@ -103,6 +104,8 @@ static void destroy_children(WRegion *reg) void region_deinit(WRegion *reg) { + region_notify_change(reg, ioncore_g.notifies.deinit); + destroy_children(reg); if(ioncore_g.focus_next==reg){ @@ -111,6 +114,7 @@ void region_deinit(WRegion *reg) } region_detach_manager(reg); + region_unset_return(reg); region_unset_parent(reg); region_remove_bindings(reg); @@ -192,18 +196,6 @@ void region_do_set_focus(WRegion *reg, bool warp) /*{{{ Manager region dynfuns */ -void region_managed_activated(WRegion *mgr, WRegion *reg) -{ - CALL_DYN(region_managed_activated, mgr, (mgr, reg)); -} - - -void region_managed_inactivated(WRegion *mgr, WRegion *reg) -{ - CALL_DYN(region_managed_inactivated, mgr, (mgr, reg)); -} - - static bool region_managed_prepare_focus_default(WRegion *mgr, WRegion *reg, int flags, WPrepareFocusResult *res) @@ -228,7 +220,7 @@ bool region_managed_prepare_focus(WRegion *mgr, WRegion *reg, } -void region_managed_notify(WRegion *mgr, WRegion *reg, const char *how) +void region_managed_notify(WRegion *mgr, WRegion *reg, WRegionNotify how) { CALL_DYN(region_managed_notify, mgr, (mgr, reg, how)); } @@ -377,7 +369,7 @@ bool region_reparent(WRegion *reg, WWindow *par, static bool region_rqclose_default(WRegion *reg, bool relocate) { WPHolder *ph; - bool refuse=TRUE; + bool refuse=TRUE, mcf; if((!relocate && !region_may_destroy(reg)) || !region_manager_allows_destroying(reg)){ @@ -385,6 +377,7 @@ static bool region_rqclose_default(WRegion *reg, bool relocate) } ph=region_get_rescue_pholder(reg); + mcf=region_may_control_focus(reg); if(ph!=NULL){ refuse=!region_rescue_clientwins(reg, ph); @@ -396,7 +389,7 @@ static bool region_rqclose_default(WRegion *reg, bool relocate) return FALSE; } - mainloop_defer_destroy((Obj*)reg); + region_dispose(reg, mcf); return TRUE; } @@ -478,6 +471,24 @@ bool region_manager_allows_destroying(WRegion *reg) } +void region_dispose(WRegion *reg, bool was_mcf) +{ + if(was_mcf){ + WPHolder *ph=region_get_return(reg); + if(ph!=NULL) + pholder_goto(ph); + } + + mainloop_defer_destroy((Obj*)reg); +} + + +void region_dispose_(WRegion *reg) +{ + region_dispose(reg, region_may_control_focus(reg)); +} + + /*}}}*/ @@ -494,6 +505,7 @@ void region_detach_manager(WRegion *reg) if(mgr==NULL) return; +#if 0 /* Restore activity state to non-parent manager */ if(region_may_control_focus(reg)){ WRegion *par=REGION_PARENT_REG(reg); @@ -504,11 +516,10 @@ void region_detach_manager(WRegion *reg) * be made to work. */ par->active_sub=mgr; - /*if(region_xwindow(mgr)!=None){*/ - region_do_set_focus(mgr, FALSE); - /*}*/ + region_maybewarp_now(mgr, FALSE); } } +#endif region_set_activity(reg, SETPARAM_UNSET); @@ -518,6 +529,39 @@ void region_detach_manager(WRegion *reg) } +void region_unset_manager_pseudoactivity(WRegion *reg) +{ + WRegion *mgr=reg->manager, *par=REGION_PARENT_REG(reg); + + if(mgr==NULL || mgr==par || !REGION_IS_PSEUDOACTIVE(mgr)) + return; + + mgr->flags&=~REGION_PSEUDOACTIVE; + + region_notify_change(mgr, ioncore_g.notifies.pseudoinactivated); + + region_unset_manager_pseudoactivity(mgr); +} + + +void region_set_manager_pseudoactivity(WRegion *reg) +{ + WRegion *mgr=reg->manager, *par=REGION_PARENT_REG(reg); + + if(!REGION_IS_ACTIVE(reg) && !REGION_IS_PSEUDOACTIVE(reg)) + return; + + if(mgr==NULL || mgr==par || REGION_IS_PSEUDOACTIVE(mgr)) + return; + + mgr->flags|=REGION_PSEUDOACTIVE; + + region_notify_change(mgr, ioncore_g.notifies.pseudoactivated); + + region_set_manager_pseudoactivity(mgr); +} + + /* This should only be called within region_managed_remove, * _after_ any managed lists and other essential structures * of mgr have been broken. @@ -526,13 +570,17 @@ void region_unset_manager(WRegion *reg, WRegion *mgr) { if(reg->manager!=mgr) return; + + region_notify_change_(reg, ioncore_g.notifies.unset_manager); + + region_unset_manager_pseudoactivity(reg); reg->manager=NULL; if(region_is_activity_r(reg)) region_clear_mgd_activity(mgr); - - region_notify_change_(reg, "unset_manager", (Obj*)mgr); + + region_unset_return(reg); } @@ -546,10 +594,12 @@ void region_set_manager(WRegion *reg, WRegion *mgr) reg->manager=mgr; + region_set_manager_pseudoactivity(reg); + if(region_is_activity_r(reg)) region_mark_mgd_activity(mgr); - region_notify_change_(reg, "set_manager", (Obj*)mgr); + region_notify_change_(reg, ioncore_g.notifies.set_manager); } @@ -776,54 +826,53 @@ void region_rootpos(WRegion *reg, int *xret, int *yret) } -static bool mrsh_not(WHookDummy *fn, void *p) +typedef struct{ + WRegion *reg; + WRegionNotify how; +} MRSHP; + + +static bool mrsh_notify_change(WHookDummy *fn, void *p_) { - WRegion *reg=(WRegion*)((void**)p)[0]; - const char *how=(const char*)((void**)p)[1]; - Obj *detail=(Obj*)((void**)p)[2]; + MRSHP *p=(MRSHP*)p_; - fn(reg, how, detail); + fn(p->reg, p->how); return TRUE; } -static bool mrshe_not(ExtlFn fn, void *p) +static bool mrshe_notify_change(ExtlFn fn, void *p_) { - WRegion *reg=(WRegion*)((void**)p)[0]; - const char *how=(const char*)((void**)p)[1]; - Obj *detail=(Obj*)((void**)p)[2]; + MRSHP *p=(MRSHP*)p_; - extl_call(fn, "oso", NULL, reg, how, detail); + extl_call(fn, "os", NULL, p->reg, stringstore_get(p->how)); return TRUE; } -static void region_notify_change_(WRegion *reg, const char *how, - Obj *detail) +static void region_notify_change_(WRegion *reg, WRegionNotify how) { - const void *p[3]; + MRSHP p; + + p.reg=reg; + p.how=how; - p[0]=reg; - p[1]=how; - p[2]=detail; - extl_protect(NULL); - hook_call(region_notify_hook, p, mrsh_not, mrshe_not), + hook_call(region_notify_hook, &p, mrsh_notify_change, mrshe_notify_change), extl_unprotect(NULL); - } -void region_notify_change(WRegion *reg, const char *how) +void region_notify_change(WRegion *reg, WRegionNotify how) { WRegion *mgr=REGION_MANAGER(reg); if(mgr!=NULL) region_managed_notify(mgr, reg, how); - region_notify_change_(reg, how, NULL); + region_notify_change_(reg, how); } diff --git a/ioncore/region.h b/ioncore/region.h index b2feff7..d30b435 100644 --- a/ioncore/region.h +++ b/ioncore/region.h @@ -1,7 +1,7 @@ /* * ion/ioncore/region.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -13,31 +13,34 @@ #define ION_IONCORE_REGION_H #include +#include #include #include "common.h" #include "rectangle.h" -#define REGION_MAPPED 0x0001 -#define REGION_ACTIVE 0x0002 -#define REGION_HAS_GRABS 0x0004 -#define REGION_TAGGED 0x0008 +#define REGION_MAPPED 0x0001 +#define REGION_ACTIVE 0x0002 +#define REGION_HAS_GRABS 0x0004 +#define REGION_TAGGED 0x0008 +#define REGION_PSEUDOACTIVE 0x0010 #define REGION_BINDINGS_ARE_GRABBED 0x0020 -#define REGION_GRAB_ON_PARENT 0x0040 -#define REGION_ACTIVITY 0x0100 -#define REGION_SKIP_FOCUS 0x0200 -#define REGION_CWINS_BEING_RESCUED 0x0400 -#define REGION_PLEASE_WARP 0x0800 +#define REGION_GRAB_ON_PARENT 0x0040 +#define REGION_ACTIVITY 0x0100 +#define REGION_SKIP_FOCUS 0x0200 +#define REGION_CWINS_BEING_RESCUED 0x0400 +#define REGION_PLEASE_WARP 0x0800 #define REGION_BINDING_UPDATE_SCHEDULED 0x1000 -#define REGION_GOTO_FOCUS 0x0001 -#define REGION_GOTO_NOWARP 0x0002 -#define REGION_GOTO_ENTERWINDOW 0x0004 +#define REGION_GOTO_FOCUS 0x0001 +#define REGION_GOTO_NOWARP 0x0002 +#define REGION_GOTO_ENTERWINDOW 0x0004 /* Use region_is_fully_mapped instead for most cases. */ #define REGION_IS_MAPPED(R) (((WRegion*)(R))->flags®ION_MAPPED) #define REGION_MARK_MAPPED(R) (((WRegion*)(R))->flags|=REGION_MAPPED) #define REGION_MARK_UNMAPPED(R) (((WRegion*)(R))->flags&=~REGION_MAPPED) #define REGION_IS_ACTIVE(R) (((WRegion*)(R))->flags®ION_ACTIVE) +#define REGION_IS_PSEUDOACTIVE(R) (((WRegion*)(R))->flags®ION_PSEUDOACTIVE) #define REGION_IS_TAGGED(R) (((WRegion*)(R))->flags®ION_TAGGED) #define REGION_IS_URGENT(R) (((WRegion*)(R))->flags®ION_URGENT) #define REGION_GEOM(R) (((WRegion*)(R))->geom) @@ -58,6 +61,8 @@ typedef int WRegionFitMode; +typedef StringId WRegionNotify; + typedef enum{ REGION_ORDER_FRONT, @@ -135,9 +140,7 @@ DYNFUN WRegion *region_managed_control_focus(WRegion *mgr, WRegion *reg); DYNFUN void region_managed_remove(WRegion *reg, WRegion *sub); DYNFUN bool region_managed_prepare_focus(WRegion *reg, WRegion *sub, int flags, WPrepareFocusResult *res); -DYNFUN void region_managed_activated(WRegion *reg, WRegion *sub); -DYNFUN void region_managed_inactivated(WRegion *reg, WRegion *sub); -DYNFUN void region_managed_notify(WRegion *reg, WRegion *sub, const char *how); +DYNFUN void region_managed_notify(WRegion *reg, WRegion *sub, WRegionNotify how); DYNFUN bool region_managed_may_destroy(WRegion *mgr, WRegion *reg); DYNFUN bool region_managed_rqorder(WRegion *reg, WRegion *sub, WRegionOrder order); @@ -162,7 +165,7 @@ extern bool region_reparent(WRegion *reg, WWindow *target, extern void region_updategr_default(WRegion *reg); extern void region_rootpos(WRegion *reg, int *xret, int *yret); -extern void region_notify_change(WRegion *reg, const char *how); +extern void region_notify_change(WRegion *reg, WRegionNotify how); extern bool region_goto(WRegion *reg); extern bool region_goto_flags(WRegion *reg, int flags); @@ -171,6 +174,9 @@ extern bool region_is_fully_mapped(WRegion *reg); extern void region_detach_manager(WRegion *reg); +extern void region_dispose(WRegion *reg, bool was_mcf); +extern void region_dispose_(WRegion *reg); + extern WWindow *region_parent(WRegion *reg); extern WRegion *region_manager(WRegion *reg); extern WRegion *region_manager_or_parent(WRegion *reg); @@ -188,6 +194,9 @@ extern bool region_manager_allows_destroying(WRegion *reg); extern WRegion *region_managed_within(WRegion *reg, WRegion *mgd); +extern void region_set_manager_pseudoactivity(WRegion *reg); +extern void region_unset_manager_pseudoactivity(WRegion *reg); + extern WHook *region_notify_hook; #endif /* ION_IONCORE_REGION_H */ diff --git a/ioncore/resize.c b/ioncore/resize.c index a8cff5a..33bfde0 100644 --- a/ioncore/resize.c +++ b/ioncore/resize.c @@ -1,7 +1,7 @@ /* * ion/ioncore/resize.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -478,7 +478,7 @@ bool moveresmode_do_end(WMoveresMode *mode, bool apply) set_saved(mode, reg); if(mode->infowin!=NULL){ - mainloop_defer_destroy((Obj*)mode->infowin); + region_dispose((WRegion*)mode->infowin, FALSE); mode->infowin=NULL; } destroy_obj((Obj*)mode); diff --git a/ioncore/resize.h b/ioncore/resize.h index 3a4f062..700c56e 100644 --- a/ioncore/resize.h +++ b/ioncore/resize.h @@ -1,7 +1,7 @@ /* * ion/ioncore/resize.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/return.c b/ioncore/return.c new file mode 100644 index 0000000..444f548 --- /dev/null +++ b/ioncore/return.c @@ -0,0 +1,160 @@ +/* + * ion/ioncore/return.h + * + * Copyright (c) Tuomo Valkonen 1999-2007. + * + * Ion is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + */ + +#include +#include + +#include "common.h" +#include "global.h" +#include "region.h" +#include "pholder.h" +#include "return.h" + + +/*{{{ Storage tree */ + + +static Rb_node retrb=NULL; + + +/*}}}*/ + + + +/*{{{ Set */ + + +bool region_do_set_return(WRegion *reg, WPHolder *ph) +{ + Rb_node node; + int found=0; + + assert(!OBJ_IS_BEING_DESTROYED(reg)); + + region_unset_return(reg); + + if(retrb==NULL){ + retrb=make_rb(); + if(retrb==NULL) + return FALSE; + } + + node=rb_insertp(retrb, reg, ph); + + region_notify_change(reg, ioncore_g.notifies.set_return); + + return (node!=NULL); +} + + +WPHolder *region_make_return_pholder(WRegion *reg) +{ + WRegion *mgr=region_manager(reg); + + if(mgr==NULL) + return NULL; + + return region_managed_get_pholder(mgr, reg); +} + + +/* +extern WPHolder *region_set_return(WRegion *reg) +{ + WPHolder *ph=region_make_return_pholder(reg); + + if(ph!=NULL){ + if(region_do_set_return(reg, ph)) + return ph; + destroy_obj((Obj*)ph); + } + + return NULL; +} +*/ + + +/*}}}*/ + + +/*{{{ Get */ + +Rb_node do_find(WRegion *reg) +{ + int found=0; + Rb_node node; + + if(retrb==NULL) + return NULL; + + node=rb_find_pkey_n(retrb, reg, &found); + + return (found ? node : NULL); +} + + +WPHolder *region_do_get_return(WRegion *reg) +{ + Rb_node node=do_find(reg); + + return (node!=NULL ? (WPHolder*)node->v.val : NULL); +} + + +WPHolder *region_get_return(WRegion *reg) +{ + /* Should managers be scanned? */ + return region_do_get_return(reg); +} + + +/*}}}*/ + + +/*{{{ Unset */ + + +static WPHolder *do_remove_node(Rb_node node) +{ + WPHolder *ph=(WPHolder*)node->v.val; + + rb_delete_node(node); + + return ph; +} + + +WPHolder *region_unset_get_return(WRegion *reg) +{ + Rb_node node; + + node=do_find(reg); + + if(node!=NULL){ + region_notify_change(reg, ioncore_g.notifies.unset_return); + return do_remove_node(node); + }else{ + return NULL; + } +} + + +void region_unset_return(WRegion *reg) +{ + WPHolder *ph=region_unset_get_return(reg); + + if(ph!=NULL) + mainloop_defer_destroy((Obj*)ph); +} + + +/*}}}*/ + diff --git a/ioncore/return.h b/ioncore/return.h new file mode 100644 index 0000000..6870f18 --- /dev/null +++ b/ioncore/return.h @@ -0,0 +1,34 @@ +/* + * ion/ioncore/return.h + * + * Copyright (c) Tuomo Valkonen 1999-2007. + * + * Ion is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + */ + +#ifndef ION_IONCORE_RETURN_H +#define ION_IONCORE_RETURN_H + +#include "region.h" +#include "pholder.h" + +/* Note: 'ph' is under the control of this 'return' module after succesfully + * (true return value) having been passed to this function and must no + * longer be destroyed by other code unless removed with unset_get. + */ +extern bool region_do_set_return(WRegion *reg, WPHolder *ph); + +/*extern WPHolder *region_set_return(WRegion *reg);*/ + +extern WPHolder *region_get_return(WRegion *reg); + +extern void region_unset_return(WRegion *reg); + +extern WPHolder *region_unset_get_return(WRegion *reg); + +extern WPHolder *region_make_return_pholder(WRegion *reg); + +#endif /* ION_IONCORE_RETURN_H */ diff --git a/ioncore/rootwin.c b/ioncore/rootwin.c index 5fc4891..6e75ee3 100644 --- a/ioncore/rootwin.c +++ b/ioncore/rootwin.c @@ -1,7 +1,7 @@ /* * ion/ioncore/rootwin.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -20,12 +20,6 @@ #include #include #include -/*#include */ -#ifdef CF_XINERAMA -#include -#elif defined(CF_SUN_XINERAMA) -#include -#endif #include #include "common.h" @@ -201,13 +195,14 @@ static void preinit_gr(WRootWin *rootwin) } -static WRootWin *preinit_rootwin(int xscr) +static Atom net_virtual_roots=None; + + +static bool rootwin_init(WRootWin *rootwin, int xscr) { Display *dpy=ioncore_g.dpy; - WRootWin *rootwin; WFitParams fp; Window root; - int i; /* Try to select input on the root window */ root=RootWindow(dpy, xscr); @@ -215,24 +210,16 @@ static WRootWin *preinit_rootwin(int xscr) redirect_error=FALSE; XSetErrorHandler(my_redirect_error_handler); - XSelectInput(dpy, root, IONCORE_EVENTMASK_ROOT); + XSelectInput(dpy, root, IONCORE_EVENTMASK_ROOT|IONCORE_EVENTMASK_SCREEN); XSync(dpy, 0); XSetErrorHandler(my_error_handler); if(redirect_error){ warn(TR("Unable to redirect root window events for screen %d."), xscr); - return NULL; + return FALSE; } - rootwin=ALLOC(WRootWin); - - if(rootwin==NULL) - return NULL; - - /* Init the struct */ - OBJ_INIT(rootwin, WRootWin); - rootwin->xscr=xscr; rootwin->default_cmap=DefaultColormap(dpy, xscr); rootwin->tmpwins=NULL; @@ -245,14 +232,12 @@ static WRootWin *preinit_rootwin(int xscr) fp.g.w=DisplayWidth(dpy, xscr); fp.g.h=DisplayHeight(dpy, xscr); - if(!window_do_init((WWindow*)rootwin, NULL, root, &fp)){ + if(!screen_init((WScreen*)rootwin, NULL, &fp, xscr, root)){ free(rootwin); - return NULL; + return FALSE; } - /* Note: this mask isn't right if some WScreen auses the same window. */ - ((WWindow*)rootwin)->event_mask=IONCORE_EVENTMASK_ROOT; - + ((WWindow*)rootwin)->event_mask=IONCORE_EVENTMASK_ROOT|IONCORE_EVENTMASK_SCREEN; ((WRegion*)rootwin)->flags|=REGION_BINDINGS_ARE_GRABBED|REGION_PLEASE_WARP; ((WRegion*)rootwin)->rootwin=rootwin; @@ -264,208 +249,9 @@ static WRootWin *preinit_rootwin(int xscr) preinit_gr(rootwin); netwm_init_rootwin(rootwin); - region_add_bindmap((WRegion*)rootwin, ioncore_rootwin_bindmap); - - return rootwin; -} - - -static Atom net_virtual_roots=None; - - -static WScreen *add_screen(WRootWin *rw, int id, const WRectangle *geom, - bool useroot) -{ - WScreen *scr; - CARD32 p[1]; - WFitParams fp; - - fp.g=*geom; - fp.mode=REGION_FIT_EXACT; - -#ifdef CF_ALWAYS_VIRTUAL_ROOT - useroot=FALSE; -#endif - - scr=create_screen(rw, id, &fp, useroot); - - if(scr==NULL) - return NULL; - - region_set_manager((WRegion*)scr, (WRegion*)rw); - - region_map((WRegion*)scr); - - if(!useroot){ - p[0]=region_xwindow((WRegion*)scr); - XChangeProperty(ioncore_g.dpy, WROOTWIN_ROOT(rw), net_virtual_roots, - XA_WINDOW, 32, PropModeAppend, (uchar*)&(p[0]), 1); - } - - return scr; -} - - -#ifdef CF_XINERAMA -static bool xinerama_sanity_check(XineramaScreenInfo *xi, int nxi) -{ - int i, j; - - for(i=0; i=xi[i].x_org && xi[j].x_org=xi[i].y_org && xi[j].y_org=monitors[i].x && - monitors[j].x=monitors[i].y && - monitors[j].yxor_gc); - window_deinit((WWindow*)rw); + rw->scr.mplex.win.win=None; + + screen_deinit(&rw->scr); } @@ -508,29 +302,6 @@ void rootwin_deinit(WRootWin *rw) /*{{{ region dynfun implementations */ -static void rootwin_do_set_focus(WRootWin *rootwin, bool warp) -{ - WRegion *sub; - - sub=REGION_ACTIVE_SUB(rootwin); - - if(sub==NULL || !REGION_IS_MAPPED(sub)){ - WScreen *scr; - FOR_ALL_SCREENS(scr){ - if(REGION_IS_MAPPED(scr)){ - sub=(WRegion*)scr; - break; - } - } - } - - if(sub!=NULL) - region_do_set_focus(sub, warp); - else - window_do_set_focus((WWindow*)rootwin, warp); -} - - static bool rootwin_fitrep(WRootWin *rootwin, WWindow *par, const WFitParams *fp) { @@ -551,30 +322,12 @@ static void rootwin_unmap(WRootWin *rootwin) } -static void rootwin_managed_remove(WRootWin *rootwin, WRegion *reg) -{ - region_unset_manager(reg, (WRegion*)rootwin); -} - - -static Window rootwin_x_window(WRootWin *rootwin) -{ - return WROOTWIN_ROOT(rootwin); -} - - /*}}}*/ /*{{{ Misc */ -static bool scr_ok(WRegion *r) -{ - return (OBJ_IS(r, WScreen) && REGION_IS_MAPPED(r)); -} - - /*EXTL_DOC * Returns previously active screen on root window \var{rootwin}. */ @@ -582,22 +335,17 @@ EXTL_SAFE EXTL_EXPORT_MEMBER WScreen *rootwin_current_scr(WRootWin *rootwin) { - WRegion *r=REGION_ACTIVE_SUB(rootwin); - WScreen *scr; - - /* There should be no non-WScreen as children or managed by us, but... */ - - if(r!=NULL && scr_ok(r)) - return (WScreen*)r; + WScreen *scr, *fb=NULL; FOR_ALL_SCREENS(scr){ - if(REGION_MANAGER(scr)==(WRegion*)rootwin - && REGION_IS_MAPPED(scr)){ - break; + if(REGION_MANAGER(scr)==(WRegion*)rootwin && REGION_IS_MAPPED(scr)){ + fb=scr; + if(REGION_IS_ACTIVE(scr)) + return scr; } } - return scr; + return (fb ? fb : &rootwin->scr); } @@ -610,16 +358,13 @@ WScreen *rootwin_current_scr(WRootWin *rootwin) static DynFunTab rootwin_dynfuntab[]={ {region_map, rootwin_map}, {region_unmap, rootwin_unmap}, - {region_do_set_focus, rootwin_do_set_focus}, - {(DynFun*)region_xwindow, (DynFun*)rootwin_x_window}, {(DynFun*)region_fitrep, (DynFun*)rootwin_fitrep}, - {region_managed_remove, rootwin_managed_remove}, END_DYNFUNTAB }; EXTL_EXPORT -IMPLCLASS(WRootWin, WWindow, rootwin_deinit, rootwin_dynfuntab); +IMPLCLASS(WRootWin, WScreen, rootwin_deinit, rootwin_dynfuntab); /*}}}*/ diff --git a/ioncore/rootwin.h b/ioncore/rootwin.h index 41dd89c..74e50bd 100644 --- a/ioncore/rootwin.h +++ b/ioncore/rootwin.h @@ -1,7 +1,7 @@ /* * ion/ioncore/rootwin.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -17,8 +17,10 @@ #include "screen.h" #include "gr.h" #include "rectangle.h" +#include "screen.h" + -#define WROOTWIN_ROOT(X) ((X)->wwin.win) +#define WROOTWIN_ROOT(X) (((WWindow*)(X))->win) #define FOR_ALL_ROOTWINS(RW) \ for(RW=ioncore_g.rootwins; \ RW!=NULL; \ @@ -26,7 +28,7 @@ DECLCLASS(WRootWin){ - WWindow wwin; + WScreen scr; int xscr; Colormap default_cmap; @@ -44,7 +46,7 @@ extern void rootwin_deinit(WRootWin *rootwin); extern WScreen *rootwin_current_scr(WRootWin *rootwin); extern void rootwin_manage_initial_windows(WRootWin *rootwin); -extern WRootWin *ioncore_manage_rootwin(int xscr, bool noxinerama); +extern WRootWin *create_rootwin(int xscr); #endif /* ION_IONCORE_ROOTWIN_H */ diff --git a/ioncore/saveload.c b/ioncore/saveload.c index e5902b3..bb67ac1 100644 --- a/ioncore/saveload.c +++ b/ioncore/saveload.c @@ -1,7 +1,7 @@ /* * ion/ioncore/saveload.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -226,6 +226,14 @@ bool ioncore_init_layout() FOR_ALL_SCREENS(scr){ ExtlTab scrtab=extl_table_none(); bool scrok=FALSE; + + /* Potential Xinerama or such support should set the screen ID + * of the root window to less than zero, and number its own + * fake screens up from 0. + */ + if(screen_id(scr)<0) + continue; + if(ok) scrok=extl_table_geti_t(tab, screen_id(scr), &scrtab); @@ -278,7 +286,14 @@ bool ioncore_save_layout() return FALSE; FOR_ALL_SCREENS(scr){ - ExtlTab scrtab=region_get_configuration((WRegion*)scr); + ExtlTab scrtab; + + /* See note above */ + if(screen_id(scr)<0) + continue; + + scrtab=region_get_configuration((WRegion*)scr); + if(scrtab==extl_table_none()){ warn(TR("Unable to get configuration for screen %d."), screen_id(scr)); diff --git a/ioncore/saveload.h b/ioncore/saveload.h index 27e3b3e..bc2ad6c 100644 --- a/ioncore/saveload.h +++ b/ioncore/saveload.h @@ -1,7 +1,7 @@ /* * ion/ioncore/saveload.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/screen.c b/ioncore/screen.c index 3b896bf..cac75a0 100644 --- a/ioncore/screen.c +++ b/ioncore/screen.c @@ -1,7 +1,7 @@ /* * ion/ioncore/screen.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -39,6 +39,9 @@ #include "group-ws.h" #include "mplex.h" #include "tags.h" +#include "gr.h" +#include "gr-util.h" +#include "conf.h" WHook *screen_managed_changed_hook=NULL; @@ -51,16 +54,16 @@ static void screen_update_infowin(WScreen *scr); /*{{{ Init/deinit */ -static bool screen_init(WScreen *scr, WRootWin *rootwin, - int id, const WFitParams *fp, bool useroot) +bool screen_init(WScreen *scr, WRootWin *parent, + const WFitParams *fp, int id, Window rootwin) { Window win; XSetWindowAttributes attr; ulong attrflags=0; + bool is_root=FALSE; scr->id=id; scr->atom_workspace=None; - scr->uses_root=useroot; scr->managed_off.x=0; scr->managed_off.y=0; scr->managed_off.w=0; @@ -72,38 +75,40 @@ static bool screen_init(WScreen *scr, WRootWin *rootwin, watch_init(&(scr->notifywin_watch)); watch_init(&(scr->infowin_watch)); - if(useroot){ - win=WROOTWIN_ROOT(rootwin); + if(parent==NULL){ + win=rootwin; + is_root=TRUE; }else{ attr.background_pixmap=ParentRelative; attrflags=CWBackPixmap; - win=XCreateWindow(ioncore_g.dpy, WROOTWIN_ROOT(rootwin), + win=XCreateWindow(ioncore_g.dpy, WROOTWIN_ROOT(parent), fp->g.x, fp->g.y, fp->g.w, fp->g.h, 0, - DefaultDepth(ioncore_g.dpy, rootwin->xscr), + DefaultDepth(ioncore_g.dpy, parent->xscr), InputOutput, - DefaultVisual(ioncore_g.dpy, rootwin->xscr), + DefaultVisual(ioncore_g.dpy, parent->xscr), attrflags, &attr); if(win==None) return FALSE; + } - if(!mplex_do_init((WMPlex*)scr, (WWindow*)rootwin, win, fp, FALSE)) + if(!mplex_do_init((WMPlex*)scr, (WWindow*)parent, fp, win)){ + if(!is_root) + XDestroyWindow(ioncore_g.dpy, win); return FALSE; + } /*scr->mplex.win.region.rootwin=rootwin; region_set_parent((WRegion*)scr, (WRegion*)rootwin);*/ scr->mplex.flags|=MPLEX_ADD_TO_END; scr->mplex.win.region.flags|=REGION_BINDINGS_ARE_GRABBED; - if(useroot) + + if(!is_root){ scr->mplex.win.region.flags|=REGION_MAPPED; + window_select_input((WWindow*)scr, IONCORE_EVENTMASK_SCREEN); + } - window_select_input(&(scr->mplex.win), - FocusChangeMask|EnterWindowMask| - KeyPressMask|KeyReleaseMask| - ButtonPressMask|ButtonReleaseMask| - (useroot ? IONCORE_EVENTMASK_ROOT : 0)); - if(id==0){ scr->atom_workspace=XInternAtom(ioncore_g.dpy, "_ION_WORKSPACE", False); @@ -116,10 +121,12 @@ static bool screen_init(WScreen *scr, WRootWin *rootwin, } } - /* Add rootwin's bindings to screens (ungrabbed) so that bindings - * are called with the proper region. + /* Add all the needed bindings here; mplex does nothing so that + * frames don't have to remove extra bindings. */ - region_add_bindmap((WRegion*)scr, ioncore_rootwin_bindmap); + region_add_bindmap((WRegion*)scr, ioncore_screen_bindmap); + region_add_bindmap((WRegion*)scr, ioncore_mplex_bindmap); + region_add_bindmap((WRegion*)scr, ioncore_mplex_toplevel_bindmap); LINK_ITEM(ioncore_g.screens, scr, next_scr, prev_scr); @@ -127,10 +134,9 @@ static bool screen_init(WScreen *scr, WRootWin *rootwin, } -WScreen *create_screen(WRootWin *rootwin, int id, const WFitParams *fp, - bool useroot) +WScreen *create_screen(WRootWin *parent, const WFitParams *fp, int id) { - CREATEOBJ_IMPL(WScreen, screen, (p, rootwin, id, fp, useroot)); + CREATEOBJ_IMPL(WScreen, screen, (p, parent, fp, id, None)); } @@ -138,9 +144,6 @@ void screen_deinit(WScreen *scr) { UNLINK_ITEM(ioncore_g.screens, scr, next_scr, prev_scr); - if(scr->uses_root) - scr->mplex.win.win=None; - mplex_deinit((WMPlex*)scr); } @@ -266,8 +269,7 @@ void screen_activated(WScreen *scr) static void do_notify(WScreen *scr, Watch *watch, bool right, - const char *str, - char *style, const char *attr) + const char *str, char *style) { WInfoWin *iw=(WInfoWin*)(watch->obj); @@ -304,20 +306,19 @@ static void do_notify(WScreen *scr, Watch *watch, bool right, watch_setup(watch, (Obj*)iw, NULL); } - infowin_set_attr2(iw, attr, NULL); infowin_set_text(iw, str); } void screen_notify(WScreen *scr, const char *str) { - do_notify(scr, &scr->notifywin_watch, FALSE, str, "actnotify", NULL); + do_notify(scr, &scr->notifywin_watch, FALSE, str, "actnotify"); } -void screen_windowinfo(WScreen *scr, const char *str, const char *attr) +void screen_windowinfo(WScreen *scr, const char *str) { - do_notify(scr, &scr->infowin_watch, TRUE, str, "tab-info", attr); + do_notify(scr, &scr->infowin_watch, TRUE, str, "tab-info"); } @@ -326,7 +327,7 @@ void screen_unnotify(WScreen *scr) Obj *iw=scr->notifywin_watch.obj; if(iw!=NULL){ watch_reset(&(scr->notifywin_watch)); - mainloop_defer_destroy(iw); + region_dispose((WRegion*)iw, FALSE); } } @@ -336,7 +337,7 @@ void screen_nowindowinfo(WScreen *scr) Obj *iw=scr->infowin_watch.obj; if(iw!=NULL){ watch_reset(&(scr->infowin_watch)); - mainloop_defer_destroy(iw); + region_dispose((WRegion*)iw, FALSE); } } @@ -397,35 +398,73 @@ static void screen_notify_tag(WScreen *scr) } +GR_DEFATTR(active); +GR_DEFATTR(inactive); +GR_DEFATTR(selected); +GR_DEFATTR(tagged); +GR_DEFATTR(not_tagged); +GR_DEFATTR(not_dragged); +GR_DEFATTR(activity); +GR_DEFATTR(no_activity); + + +static void init_attr() +{ + GR_ALLOCATTR_BEGIN; + GR_ALLOCATTR(active); + GR_ALLOCATTR(inactive); + GR_ALLOCATTR(selected); + GR_ALLOCATTR(tagged); + GR_ALLOCATTR(not_tagged); + GR_ALLOCATTR(not_dragged); + GR_ALLOCATTR(no_activity); + GR_ALLOCATTR(activity); + GR_ALLOCATTR_END; +} + + static void screen_update_infowin(WScreen *scr) { WRegion *reg=mplex_mx_current(&(scr->mplex)); bool tag=(reg!=NULL && region_is_tagged(reg)); - bool act=(reg!=NULL && region_is_activity_r(reg)); + bool act=(reg!=NULL && region_is_activity_r(reg) && !REGION_IS_ACTIVE(scr)); + bool sac=REGION_IS_ACTIVE(scr); if(tag || act){ const char *n=region_displayname(reg); - char *attr=NULL; + WInfoWin *iw; + + screen_windowinfo(scr, n); - libtu_asprintf(&attr, "%s-selected-%s-not_dragged-%s", - (REGION_IS_ACTIVE(scr) ? "active" : "inactive"), - (tag ? "tagged" : "not_tagged"), - (act ? "activity" : "no_activity")); + iw=(WInfoWin*)scr->infowin_watch.obj; - screen_windowinfo(scr, n, attr); /* NULL attr ok */ + if(iw!=NULL){ + GrStyleSpec *spec=infowin_stylespec(iw); + + init_attr(); + + gr_stylespec_unalloc(spec); + + gr_stylespec_set(spec, GR_ATTR(selected)); + gr_stylespec_set(spec, GR_ATTR(not_dragged)); + gr_stylespec_set(spec, sac ? GR_ATTR(active) : GR_ATTR(inactive)); + gr_stylespec_set(spec, tag ? GR_ATTR(tagged) : GR_ATTR(not_tagged)); + gr_stylespec_set(spec, act ? GR_ATTR(activity) : GR_ATTR(no_activity)); + } + }else{ screen_nowindowinfo(scr); } } -static void screen_managed_notify(WScreen *scr, WRegion *reg, const char *how) +static void screen_managed_notify(WScreen *scr, WRegion *reg, WRegionNotify how) { - if(strcmp(how, "sub-activity")==0){ + if(how==ioncore_g.notifies.sub_activity){ /* TODO: multiple calls */ mainloop_defer_action((Obj*)scr, (WDeferredAction*)screen_notify_activity); - }else if(strcmp(how, "tag")==0){ + }else if(how==ioncore_g.notifies.tag){ mainloop_defer_action((Obj*)scr, (WDeferredAction*)screen_notify_tag); } @@ -439,10 +478,7 @@ static void screen_managed_notify(WScreen *scr, WRegion *reg, const char *how) /*EXTL_DOC - * Find the screen with numerical id \var{id}. If Xinerama is - * not present, \var{id} corresponds to X screen numbers. Otherwise - * the ids are some arbitrary ordering of Xinerama rootwins. - * If \var{id} is $-1$, the screen with the highest id is returned. + * Find the screen with numerical id \var{id}. */ EXTL_SAFE EXTL_EXPORT @@ -644,13 +680,16 @@ static WRegion *do_create_initial(WWindow *parent, const WFitParams *fp, static bool create_initial_ws(WScreen *scr) { WRegion *reg=NULL; - WMPlexAttachParams par; - - par.flags=0; + WMPlexAttachParams par=MPLEXATTACHPARAMS_INIT; + ExtlTab lo=ioncore_get_layout("default"); - reg=mplex_do_attach_new(&scr->mplex, &par, - (WRegionCreateFn*)groupws_load_default, - NULL); + if(lo==extl_table_none()){ + reg=mplex_do_attach_new(&scr->mplex, &par, + (WRegionCreateFn*)create_groupws, NULL); + }else{ + reg=mplex_attach_new_(&scr->mplex, &par, 0, lo); + extl_unref_table(lo); + } if(reg==NULL){ warn(TR("Unable to create a workspace on screen %d."), scr->id); diff --git a/ioncore/screen.h b/ioncore/screen.h index 11c83fa..6555c17 100644 --- a/ioncore/screen.h +++ b/ioncore/screen.h @@ -1,7 +1,7 @@ /* * ion/ioncore/screen.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -17,7 +17,6 @@ #include "common.h" #include "mplex.h" #include "rectangle.h" -#include "rootwin.h" #include "pholder.h" #define FOR_ALL_SCREENS(SCR) \ @@ -50,9 +49,15 @@ DECLCLASS(WScreen){ Watch infowin_watch; }; -extern WScreen *create_screen(WRootWin *rootwin, int id, - const WFitParams *fp, - bool useroot); +/* rootwin should only be set if parent is NULL, and this WScreen is + * actually a root window. + */ +extern bool screen_init(WScreen *scr, WRootWin *parent, + const WFitParams *fp, int id, Window rootwin); + +extern WScreen *create_screen(WRootWin *parent, const WFitParams *fp, int id); + +extern void screen_deinit(WScreen *scr); extern int screen_id(WScreen *scr); @@ -62,16 +67,11 @@ extern bool screen_init_layout(WScreen *scr, ExtlTab tab); extern void screen_notify(WScreen *scr, const char *notstr); extern void screen_unnotify(WScreen *scr); -extern void screen_windowinfo(WScreen *scr, const char *name, const char *attr); +extern void screen_windowinfo(WScreen *scr, const char *name); extern void screen_nowindowinfo(WScreen *scr); extern WPHolder *screen_get_rescue_pholder_for(WScreen *scr, WRegion *mgd); -/* For viewports corresponding to Xinerama rootwins is initially set - * to the Xinerama screen number. When Xinerama is not enabled, is - * the X screen number (which is the same for all Xinerama rootwins). - * For all other viewports is undefined. - */ extern WScreen *ioncore_find_screen_id(int id); extern WScreen *ioncore_goto_screen_id(int id); extern WScreen *ioncore_goto_next_screen(); diff --git a/ioncore/selection.c b/ioncore/selection.c index 4bb8cd7..3941436 100644 --- a/ioncore/selection.c +++ b/ioncore/selection.c @@ -1,7 +1,7 @@ /* * ion/ioncore/selection.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/selection.h b/ioncore/selection.h index 6a49786..7710e08 100644 --- a/ioncore/selection.h +++ b/ioncore/selection.h @@ -1,7 +1,7 @@ /* * ion/ioncore/selection.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/sizehint.c b/ioncore/sizehint.c index 50c1c99..b574753 100644 --- a/ioncore/sizehint.c +++ b/ioncore/sizehint.c @@ -1,7 +1,7 @@ /* * ion/ioncore/sizehint.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/sizehint.h b/ioncore/sizehint.h index 6065e74..4ddfb41 100644 --- a/ioncore/sizehint.h +++ b/ioncore/sizehint.h @@ -1,7 +1,7 @@ /* * ion/ioncore/sizehint.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/sizepolicy.c b/ioncore/sizepolicy.c index 6e23875..7101da8 100644 --- a/ioncore/sizepolicy.c +++ b/ioncore/sizepolicy.c @@ -1,7 +1,7 @@ /* * ion/ioncore/sizepolicy.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/sizepolicy.h b/ioncore/sizepolicy.h index 0984737..602652d 100644 --- a/ioncore/sizepolicy.h +++ b/ioncore/sizepolicy.h @@ -1,7 +1,7 @@ /* * ion/ioncore/sizepolicy.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/stacking.c b/ioncore/stacking.c index 8d696cb..9d77ac9 100644 --- a/ioncore/stacking.c +++ b/ioncore/stacking.c @@ -1,7 +1,7 @@ /* * ion/ioncore/stacking.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/stacking.h b/ioncore/stacking.h index a5e3464..2810bda 100644 --- a/ioncore/stacking.h +++ b/ioncore/stacking.h @@ -1,7 +1,7 @@ /* * ion/ioncore/stacking.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/strings.c b/ioncore/strings.c index 9f2bbd3..37487fd 100644 --- a/ioncore/strings.c +++ b/ioncore/strings.c @@ -1,7 +1,7 @@ /* * ion/ioncore/strings.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/strings.h b/ioncore/strings.h index 0f2a1f4..df30189 100644 --- a/ioncore/strings.h +++ b/ioncore/strings.h @@ -1,7 +1,7 @@ /* * ion/ioncore/strings.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/tags.c b/ioncore/tags.c index 6b7d5c2..383af0c 100644 --- a/ioncore/tags.c +++ b/ioncore/tags.c @@ -1,7 +1,7 @@ /* * ion/ioncore/tags.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -11,8 +11,11 @@ #include #include + +#include "global.h" #include "region.h" #include "tags.h" +#include "extlconv.h" static ObjList *taglist=NULL; @@ -34,7 +37,7 @@ bool region_set_tagged(WRegion *reg, int sp) reg->flags|=REGION_TAGGED; objlist_insert_last(&taglist, (Obj*)reg); } - region_notify_change(reg, "tag"); + region_notify_change(reg, ioncore_g.notifies.tag); } return nset; @@ -69,7 +72,7 @@ bool region_is_tagged(WRegion *reg) EXTL_EXPORT void ioncore_clear_tags() { - while(ioncore_tags_take_first()!=NULL) + while(ioncore_tagged_take_first()!=NULL) /* nothing */; } @@ -85,48 +88,34 @@ void ioncore_clear_tags() */ EXTL_SAFE EXTL_EXPORT -WRegion *ioncore_tags_first() +WRegion *ioncore_tagged_first() { return (WRegion*)OBJLIST_FIRST(WRegion*, taglist); } -WRegion *ioncore_tags_take_first() +WRegion *ioncore_tagged_take_first() { WRegion *reg=(WRegion*)objlist_take_first(&taglist); if(reg!=NULL){ reg->flags&=~REGION_TAGGED; - region_notify_change(reg, "tag"); + region_notify_change(reg, ioncore_g.notifies.tag); } return reg; } /*EXTL_DOC - * Returns a list of tagged regions. + * Iterate over tagged regions until \var{iterfn} returns \code{false}. + * The function itself returns \code{true} if it reaches the end of list + * without this happening. */ EXTL_SAFE EXTL_EXPORT -ExtlTab ioncore_tagged_list() +bool ioncore_tagged_i(ExtlFn iterfn) { - int n=0; - ExtlTab tab; - WRegion *region; - ObjListIterTmp tmp; - - region=ioncore_tags_first(); - if(!region) - return extl_table_none(); - - tab=extl_create_table(); - - FOR_ALL_ON_OBJLIST(WRegion*, region, taglist, tmp){ - if(extl_table_seti_o(tab, n+1, (Obj*)region)) - n++; - } - - return tab; + return extl_iter_objlist(iterfn, taglist); } diff --git a/ioncore/tags.h b/ioncore/tags.h index 478d47b..a8fe8f5 100644 --- a/ioncore/tags.h +++ b/ioncore/tags.h @@ -1,7 +1,7 @@ /* * ion/ioncore/tags.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -19,7 +19,7 @@ extern bool region_set_tagged(WRegion *reg, int sp); extern bool region_is_tagged(WRegion *reg); extern void ioncore_clear_tags(); -extern WRegion *ioncore_tags_first(); -extern WRegion *ioncore_tags_take_first(); +extern WRegion *ioncore_tagged_first(); +extern WRegion *ioncore_tagged_take_first(); #endif /* ION_IONCORE_TAGS_H */ diff --git a/ioncore/window.c b/ioncore/window.c index 8d2986f..0b12200 100644 --- a/ioncore/window.c +++ b/ioncore/window.c @@ -1,7 +1,7 @@ /* * ion/ioncore/window.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -57,9 +57,17 @@ void window_release(WWindow *wwin) /*{{{ Init, create */ -bool window_do_init(WWindow *wwin, WWindow *par, Window win, - const WFitParams *fp) +bool window_do_init(WWindow *wwin, WWindow *par, + const WFitParams *fp, Window win) { + if(win==None){ + assert(par!=NULL); + win=create_xwindow(region_rootwin_of((WRegion*)par), + par->win, &(fp->g)); + if(win==None) + return FALSE; + } + wwin->win=win; wwin->xic=NULL; wwin->event_mask=0; @@ -67,10 +75,8 @@ bool window_do_init(WWindow *wwin, WWindow *par, Window win, region_init(&(wwin->region), par, fp); - if(win!=None){ - XSaveContext(ioncore_g.dpy, win, ioncore_g.win_context, - (XPointer)wwin); - } + XSaveContext(ioncore_g.dpy, win, ioncore_g.win_context, + (XPointer)wwin); return TRUE; } @@ -78,14 +84,7 @@ bool window_do_init(WWindow *wwin, WWindow *par, Window win, bool window_init(WWindow *wwin, WWindow *par, const WFitParams *fp) { - Window win; - - win=create_xwindow(region_rootwin_of((WRegion*)par), - par->win, &(fp->g)); - if(win==None) - return FALSE; - /* window_init does not fail */ - return window_do_init(wwin, par, win, fp); + return window_do_init(wwin, par, fp, None); } @@ -93,11 +92,14 @@ void window_deinit(WWindow *wwin) { region_deinit((WRegion*)wwin); + region_pointer_focus_hack(&wwin->region); + if(wwin->xic!=NULL) XDestroyIC(wwin->xic); - + if(wwin->win!=None){ XDeleteContext(ioncore_g.dpy, wwin->win, ioncore_g.win_context); + /* Probably should not try destroy if root window... */ XDestroyWindow(ioncore_g.dpy, wwin->win); } @@ -174,6 +176,8 @@ void window_map(WWindow *wwin) void window_unmap(WWindow *wwin) { + region_pointer_focus_hack(&wwin->region); + XUnmapWindow(ioncore_g.dpy, wwin->win); REGION_MARK_UNMAPPED(wwin); } diff --git a/ioncore/window.h b/ioncore/window.h index b9f4ffa..e4de5bb 100644 --- a/ioncore/window.h +++ b/ioncore/window.h @@ -1,7 +1,7 @@ /* * ion/ioncore/window.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -29,8 +29,8 @@ DECLCLASS(WWindow){ extern bool window_init(WWindow *p, WWindow *parent, const WFitParams *fp); -extern bool window_do_init(WWindow *p, WWindow *parent, Window win, - const WFitParams *fp); +extern bool window_do_init(WWindow *p, WWindow *parent, + const WFitParams *fp, Window win); extern void window_deinit(WWindow *win); DYNFUN void window_draw(WWindow *wwin, bool complete); diff --git a/ioncore/xic.c b/ioncore/xic.c index 304adf4..21339d6 100644 --- a/ioncore/xic.c +++ b/ioncore/xic.c @@ -1,7 +1,7 @@ /* * ion/ioncore/xic.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/xic.h b/ioncore/xic.h index dcc3de6..f745442 100644 --- a/ioncore/xic.h +++ b/ioncore/xic.h @@ -1,7 +1,7 @@ /* * ion/ioncore/xic.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/xwindow.c b/ioncore/xwindow.c index 16491c7..9ce3df2 100644 --- a/ioncore/xwindow.c +++ b/ioncore/xwindow.c @@ -1,7 +1,7 @@ /* * ion/ioncore/xwindow.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/ioncore/xwindow.h b/ioncore/xwindow.h index 50e7db5..6379ddf 100644 --- a/ioncore/xwindow.h +++ b/ioncore/xwindow.h @@ -1,7 +1,7 @@ /* * ion/ioncore/xwindow.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/libmainloop/defer.c b/libmainloop/defer.c index c79e2ce..dfc0e89 100644 --- a/libmainloop/defer.c +++ b/libmainloop/defer.c @@ -1,7 +1,7 @@ /* * ion/libmainloop/defer.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/libmainloop/defer.h b/libmainloop/defer.h index 3c6807e..ee7d400 100644 --- a/libmainloop/defer.h +++ b/libmainloop/defer.h @@ -1,7 +1,7 @@ /* * ion/libmainloop/defer.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/libmainloop/exec.c b/libmainloop/exec.c index 3f0f264..6038e36 100644 --- a/libmainloop/exec.c +++ b/libmainloop/exec.c @@ -1,7 +1,7 @@ /* * ion/mainloop/exec.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/libmainloop/exec.h b/libmainloop/exec.h index c9278b3..796e453 100644 --- a/libmainloop/exec.h +++ b/libmainloop/exec.h @@ -1,7 +1,7 @@ /* * ion/libmainloop/exec.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/libmainloop/hooks.c b/libmainloop/hooks.c index 1a15bc9..9b873a5 100644 --- a/libmainloop/hooks.c +++ b/libmainloop/hooks.c @@ -1,7 +1,7 @@ /* * ion/mainloop/hooks.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -95,6 +95,9 @@ EXTL_SAFE EXTL_EXPORT WHook *mainloop_get_hook(const char *name) { + if(name==NULL) + return NULL; + if(named_hooks!=NULL){ bool found=FALSE; Rb_node node=rb_find_key_n(named_hooks, name, &found); diff --git a/libmainloop/hooks.h b/libmainloop/hooks.h index 63d3554..11487de 100644 --- a/libmainloop/hooks.h +++ b/libmainloop/hooks.h @@ -1,7 +1,7 @@ /* * ion/mainloop/hooks.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/libmainloop/signal.c b/libmainloop/signal.c index ddf6aba..fea01ba 100644 --- a/libmainloop/signal.c +++ b/libmainloop/signal.c @@ -1,7 +1,7 @@ /* * ion/libmainloop/signal.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/libmainloop/signal.h b/libmainloop/signal.h index 7867c18..7e8682e 100644 --- a/libmainloop/signal.h +++ b/libmainloop/signal.h @@ -1,7 +1,7 @@ /* * ion/mainloop/signal.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/libtu/README b/libtu/README index cce76e5..4143c2a 100644 --- a/libtu/README +++ b/libtu/README @@ -1,7 +1,7 @@ libtu -Copyright (c) Tuomo Valkonen 1999-2004. +Copyright (c) Tuomo Valkonen 1999-2007. @@ -29,3 +29,5 @@ is included in snprintf_2.2/ and is used by default. To use the system's versions of these functions, if available, modify system.mk. +The implementation of red-black trees is based on that by +James S. Plank; see README.rb for details. diff --git a/libtu/exact-version b/libtu/exact-version index 20aff08..420d613 100644 --- a/libtu/exact-version +++ b/libtu/exact-version @@ -1,6 +1,18 @@ Context: +[Clean-up and pending updates +Tuomo Valkonen **20070129141139] + +[stringstore_get should work on STRINGID_NONE too. +Tuomo Valkonen **20070126232827] + +[Added stringstore_find/alloc_n +Tuomo Valkonen **20070125191555] + +[Added stringstore_ref +Tuomo Valkonen **20070121200255] + [Path fix Tuomo Valkonen **20061016223205] diff --git a/libtu/np-conv.h b/libtu/np-conv.h deleted file mode 100644 index c6c13c7..0000000 --- a/libtu/np-conv.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * libtu/np-conv.h - * - * Copyright (c) Tuomo Valkonen 1999-2002. - * - * You may distribute and modify this library under the terms of either - * the Clarified Artistic License or the GNU LGPL, version 2.1 or later. - */ - -#include - -#ifdef NP_SIMPLE_IMPL - -#define FN_NUM_TO_SIGNED(T, UMAX, MAX, MIN) \ - static int num_to_##T(T *ret, const NPNum *num, bool allow_uns_big) \ - { \ - if(num->type!=NPNUM_INT) \ - return E_TOKZ_NOTINT; \ - \ - if(!num->negative){ \ - *ret=num->ival; \ - if(allow_uns_big?num->ival>UMAX:num->ival>MAX) \ - return E_TOKZ_RANGE; \ - }else{ \ - *ret=-num->ival; \ - if(num->ival>-(ulong)MIN) \ - return E_TOKZ_RANGE; \ - } \ - return 0; \ - } - -#define FN_NUM_TO_UNSIGNED(T, UMAX, MIN) \ - static int num_to_##T(T *ret, const NPNum *num, bool allow_neg) \ - { \ - if(num->type!=NPNUM_INT) \ - return E_TOKZ_NOTINT; \ - \ - if(!num->negative){ \ - *ret=num->ival; \ - if(num->ival>UMAX) \ - return E_TOKZ_RANGE; \ - }else{ \ - *ret=-num->ival; \ - if(!allow_neg || num->ival>(ulong)-MIN) \ - return E_TOKZ_RANGE; \ - } \ - return 0; \ - } - -#define FN_NUM_TO_FLOAT(T, POW) \ - static int num_to_##T(T *ret, const NPNum *num) \ - { \ - *ret=(num->negative?-num->fval:num->fval); \ - return 0; \ - } - -#else /* NP_SIMPLE_IMPL */ - -#define FN_NUM_TO_SIGNED(T, UMAX, MAX, MIN) \ - static int num_to_##T(T *ret, const NPNum *num, bool allow_uns_big) \ - { \ - if(num->exponent) \ - return E_TOKZ_NOTINT; \ - if(num->nmantissa>0) \ - return E_TOKZ_RANGE; \ - \ - if(!num->negative){ \ - *ret=num->mantissa[0]; \ - if(allow_uns_big?num->mantissa[0]>UMAX:num->mantissa[0]>MAX) \ - return E_TOKZ_RANGE; \ - }else{ \ - *ret=-num->mantissa[0]; \ - if(num->mantissa[0]>-(ulong)MIN) \ - return E_TOKZ_RANGE; \ - } \ - return 0; \ -} - -#define FN_NUM_TO_UNSIGNED(T, UMAX, MIN) \ - static int num_to_##T(T *ret, const NPNum *num, bool allow_neg) \ - { \ - if(num->exponent) \ - return E_TOKZ_NOTINT; \ - if(num->nmantissa>0) \ - return E_TOKZ_RANGE; \ - \ - if(!num->negative){ \ - *ret=num->mantissa[0]; \ - if(num->mantissa[0]>UMAX) \ - return E_TOKZ_RANGE; \ - }else{ \ - *ret=-num->mantissa[0]; \ - if(!allow_neg || num->mantissa[0]>(ulong)-MIN) \ - return E_TOKZ_RANGE; \ - } \ - return 0; \ -} - - -#define FN_NUM_TO_FLOAT(T, POW) \ - static int num_to_##T(T *ret, const NPNum *num) \ - { \ - T d=0; \ - int i; \ - \ - for(i=num->nmantissa;i>=0;i--) \ - d=d*(T)(ULONG_MAX+1.0)+num->mantissa[i]; \ - \ - d*=POW(num->base, num->exponent); \ - *ret=d; \ - \ - return 0; \ - } - -#endif /* NP_SIMPLE_IMPL */ - -FN_NUM_TO_SIGNED(long, ULONG_MAX, LONG_MAX, LONG_MIN) -FN_NUM_TO_SIGNED(char, UCHAR_MAX, CHAR_MAX, CHAR_MIN) -FN_NUM_TO_FLOAT(double, pow) - -#undef NEG diff --git a/libtu/numparser2.h b/libtu/numparser2.h deleted file mode 100644 index b43e2ec..0000000 --- a/libtu/numparser2.h +++ /dev/null @@ -1,272 +0,0 @@ -/* - * libtu/numparser2.h - * - * Copyright (c) Tuomo Valkonen 1999-2002. - * - * You may distribute and modify this library under the terms of either - * the Clarified Artistic License or the GNU LGPL, version 2.1 or later. - */ - -#define MAX_MANTISSA 10 /* should be enough for our needs */ -#define ULONG_SIZE (sizeof(ulong)*8) - -enum{ - NPNUM_INT, - NPNUM_FLOAT -}; - -#ifdef NP_SIMPLE_IMPL - -typedef struct _NPNum{ - int type; - int base; - bool negative; - double fval; - ulong ival; -} NPNum; - -#define NUM_INIT {0, 0, 0, 0.0, 0} - -static int npnum_mulbase_add(NPNum *num, long base, long v) -{ - double iold=num->ival; - - num->fval=num->fval*base+(double)v; - - num->ival*=base; - - if(num->ivaltype=NPNUM_FLOAT; - - num->ival+=v; - - return 0; -} - -#else /* NP_SIMPLE_IMPL */ - -typedef struct _NPNum{ - unsigned char nmantissa; - int type; - int base; - bool negative; - ulong mantissa[MAX_MANTISSA]; - long exponent; -} NPNum; - -#define NUM_INIT {0, 0, 0, 0, {0,}, 0} - -#define ADD_EXP(NUM, X) (NUM)->exponent+=(X); - -#if defined(__GNUG__) && defined(i386) && !defined(NP_NO_I386_ASM) - #define NP_I386_ASM -#endif - -static int npnum_mulbase_add(NPNum *num, long base, long v) -{ - long i, j; - ulong overflow; -#ifndef NP_I386_ASM - ulong val; -#endif - - for(i=num->nmantissa;i>=0;i--){ -#ifdef NP_I386_ASM - __asm__("mul %4\n" - : "=a" (num->mantissa[i]), "=d" (overflow) - : "0" (num->mantissa[i]), "1" (0), "q" (base) - : "eax", "edx"); -#else - overflow=0; - val=num->mantissa[i]; - - if(valmantissa[i]=val; -#endif - if(overflow){ - if(i==num->nmantissa){ - if(num->nmantissa==MAX_MANTISSA) - return E_TOKZ_TOOBIG; - num->nmantissa++; - } - num->mantissa[i+1]+=overflow; - } - } - num->mantissa[0]+=v; - - return 0; -} - -#undef NP_I386_ASM - -#endif /* NP_SIMPLE_IMPL */ - - -/* */ - - -static bool is_end(int c) -{ - /* oops... EOF was missing */ - return (c==EOF || (c!='.' && ispunct(c)) || isspace(c) || iscntrl(c)); -} - - -/* */ - - -static int parse_exponent(NPNum *num, Tokenizer *tokz, int c) -{ - long exp=0; - bool neg=FALSE; - int err=0; - - c=GETCH(); - - if(c=='-' || c=='+'){ - if(c=='-') - neg=TRUE; - c=GETCH(); - } - - for(; 1; c=GETCH()){ - if(isdigit(c)){ - exp*=10; - exp+=c-'0'; - }else if(is_end(c)){ - UNGETCH(c); - break; - }else{ - err=E_TOKZ_NUMFMT; - } - } - - if(neg) - exp*=-1; - -#ifndef NP_SIMPLE_IMPL - ADD_EXP(num, exp); -#else - num->fval*=pow(num->base, exp); -#endif - return err; -} - - -static int parse_number(NPNum *num, Tokenizer *tokz, int c) -{ - int base=10; - int dm=1; - int err=0; - int tmp; -#ifdef NP_SIMPLE_IMPL - double divisor=base; -#endif - - if(c=='-' || c=='+'){ - if(c=='-') - num->negative=TRUE; - c=GETCH(); - if(!isdigit(c)) - err=E_TOKZ_NUMFMT; - } - - if(c=='0'){ - dm=0; - c=GETCH(); - if(c=='x' || c=='X'){ - base=16; - c=GETCH(); - }else if(c=='b' || c=='B'){ - base=2; - c=GETCH(); - }else if('0'<=c && c<='7'){ - base=8; - }else{ - dm=2; - } - } - - num->base=base; - - for(; 1; c=GETCH()){ - if((c=='e' || c=='E') && dm!=0){ - if(dm<2){ - err=E_TOKZ_NUMFMT; - continue; - } - tmp=parse_exponent(num, tokz, c); - if(err==0) - err=tmp; - break; - } - - if(isxdigit(c)){ - if('0'<=c && c<='9') - c-='0'; - else if(isupper(c)) - c-='A'-10; - else - c-='a'-10; - - if(c>=base) - err=E_TOKZ_NUMFMT; - -#ifdef NP_SIMPLE_IMPL - if(dm==3){ - num->fval+=(double)c/divisor; - divisor*=base; - }else -#endif - { - tmp=npnum_mulbase_add(num, base, c); - if(err==0) - err=tmp; - } - - if(dm==1) - dm=2; -#ifndef NP_SIMPLE_IMPL - else if(dm==3) - ADD_EXP(num, -1); -#endif - continue; - } - - if(c=='.'){ - if(dm!=2){ - err=E_TOKZ_NUMFMT; - } - dm=3; -#ifdef NP_SIMPLE_IMPL - num->type=NPNUM_FLOAT; - divisor=base; -#endif - continue; - } - - if(is_end(c)){ - UNGETCH(c); - break; - } - - err=E_TOKZ_NUMFMT; - } - -#ifndef NP_SIMPLE_IMPL - num->type=(num->exponent==0 ? NPNUM_INT : NPNUM_FLOAT); -#endif - - return err; -} diff --git a/libtu/stringstore.c b/libtu/stringstore.c index 6f54387..5529820 100644 --- a/libtu/stringstore.c +++ b/libtu/stringstore.c @@ -1,13 +1,14 @@ /* * libtu/stringstore.c * - * Copyright (c) Tuomo Valkonen 2004. + * Copyright (c) Tuomo Valkonen 2004-2007. * * You may distribute and modify this library under the terms of either * the Clarified Artistic License or the GNU LGPL, version 2.1 or later. */ #include +#include #include "misc.h" #include "output.h" @@ -20,19 +21,42 @@ static Rb_node stringstore=NULL; const char *stringstore_get(StringId id) { - return (const char*)(((Rb_node)id)->k.key); + return (id==STRINGID_NONE + ? NULL + : (const char*)(((Rb_node)id)->k.key)); } + +typedef struct{ + const char *key; + uint len; +} D; + +static int cmp(const void *d_, const char *nodekey) +{ + D *d=(D*)d_; -StringId stringstore_find(const char *str) + int res=strncmp(d->key, nodekey, d->len); + + return (res!=0 + ? res + : (nodekey[d->len]=='\0' ? 0 : 1)); +} + + +StringId stringstore_find_n(const char *str, uint l) { Rb_node node; int found=0; + D d; if(stringstore==NULL) return STRINGID_NONE; - node=rb_find_key_n(stringstore, str, &found); + d.key=str; + d.len=l; + + node=rb_find_gkey_n(stringstore, &d, (Rb_compfn*)cmp, &found); if(!found) return STRINGID_NONE; @@ -41,9 +65,15 @@ StringId stringstore_find(const char *str) } -StringId stringstore_alloc(const char *str) +StringId stringstore_find(const char *str) { - Rb_node node=(Rb_node)stringstore_find(str); + return stringstore_find_n(str, strlen(str)); +} + + +StringId stringstore_alloc_n(const char *str, uint l) +{ + Rb_node node=(Rb_node)stringstore_find_n(str, l); char *s; if(node!=NULL){ @@ -57,7 +87,7 @@ StringId stringstore_alloc(const char *str) return STRINGID_NONE; } - s=scopy(str); + s=scopyn(str, l); if(s==NULL) return STRINGID_NONE; @@ -73,6 +103,12 @@ StringId stringstore_alloc(const char *str) } +StringId stringstore_alloc(const char *str) +{ + return stringstore_alloc_n(str, strlen(str)); +} + + void stringstore_free(StringId id) { Rb_node node=(Rb_node)id; @@ -96,3 +132,12 @@ void stringstore_free(StringId id) } } + +void stringstore_ref(StringId id) +{ + Rb_node node=(Rb_node)id; + + if(node!=NULL) + node->v.ival++; +} + diff --git a/libtu/stringstore.h b/libtu/stringstore.h index 752e573..5510ef4 100644 --- a/libtu/stringstore.h +++ b/libtu/stringstore.h @@ -1,7 +1,7 @@ /* * libtu/stringstore.h * - * Copyright (c) Tuomo Valkonen 2004. + * Copyright (c) Tuomo Valkonen 2004-2007. * * You may distribute and modify this library under the terms of either * the Clarified Artistic License or the GNU LGPL, version 2.1 or later. @@ -17,6 +17,9 @@ typedef void* StringId; extern const char *stringstore_get(StringId id); extern StringId stringstore_find(const char *str); extern StringId stringstore_alloc(const char *str); +extern StringId stringstore_find_n(const char *str, uint l); +extern StringId stringstore_alloc_n(const char *str, uint l); extern void stringstore_free(StringId id); +extern void stringstore_ref(StringId id); #endif /* LIBTU_STRINGSTORE_H */ diff --git a/man/ion3.cs.in b/man/ion3.cs.in index b3a8c91..81efb95 100644 --- a/man/ion3.cs.in +++ b/man/ion3.cs.in @@ -28,10 +28,6 @@ obrazovku (ko Nastaví název sezení. Tato volba ovlivní, kam se ulo¾í pracovní plochy a ostatní soubory. Pokud není nastavená, pou¾ije se ~/.ion3/session_name. .TP -.B \-xinerama 0|1 -Jestli¾e byl Ion sestaven s podporou Xineramy, mù¾ete touto volbou -povolit/zakázat (1/0) její pou¾ití. Implicitnì je Xinerama povolena. -.TP .B \-help Zobrazí nápovìdu k pøíkazovým parametrùm .TP @@ -101,12 +97,12 @@ BINDINGS:WFrame.toplevel .SS Pøiøazení pro práci s plovoucími/odpojenými rámy -BINDINGS:WFloatFrame +BINDINGS:WFrame.floating .SS Pøiøazení pro dla¾dicové plochy a rámy [mod_tiling] BINDINGS:WTiling -BINDINGS:WFrame-on-WTiling +.\" BINDINGS:WFrame.tiled .SS Pøiøazení pro kientská okna diff --git a/man/ion3.de.in b/man/ion3.de.in index 3a2106f..fa60e7b 100644 --- a/man/ion3.de.in +++ b/man/ion3.de.in @@ -30,11 +30,6 @@ Setzt einen Sitzungsnamen. Diese Option beeinflusst wo der Arbeitsbereich und andere Sicherungsdateien abgelegt werden (~/.ion3/sitzungs_name wenn die Option gesetzt wurde). .TP -.B \-xinerama 0|1 -Wenn Ion mit Xinerama Unterstützung kompiliert wurde, kann diese Option benutzt -werden um sie 'an = 1' oder 'aus = 0' zu stellen. Die Voreinstelllung ist -Xineramas Screeninformation zu benutzen. -.TP .B \-help Zeigt die Hilfe für die Kommandozeilenoptionen .TP @@ -107,12 +102,13 @@ BINDINGS:WMoveresMode .SS Bindungen zum teilen der Arbeitsfläche [mod_ionws] BINDINGS:WTiling +.\" BINDINGS:WFrame.tiled .SS Bindungen für den fliessenden Arbeitsbereich und Frames [mod_floatws] BINDINGS:WGroupWS -BINDINGS:WFloatFrame +BINDINGS:WFrame.floating .SS Bindungen für Message- und Anfrageboxen [mod_query] diff --git a/man/ion3.fi.in b/man/ion3.fi.in index ae82a00..82fca51 100644 --- a/man/ion3.fi.in +++ b/man/ion3.fi.in @@ -28,10 +28,6 @@ parametrill .B \-session session_name Istunnon nimi. Tämä vaikuttaa talletustiedostojen sijaintiin. .TP -.B \-xinerama 0|1 -Jos Ion käännettiin Xinerama-tuella, voidaan Xinerama tieto silti jättää -hyödyntämättä asettamalla tämä valinta arvoon 0. -.TP .B \-help Näytä komentorivin ohje. .TP @@ -104,12 +100,12 @@ BINDINGS:WFrame.toplevel .SS Kelluvissa/irroitetuissa kehyksissä toimivat sidonnat -BINDINGS:WFloatFrame +BINDINGS:WFrame.floating .SS Laatoituksien ja laatoitettujen kehysten sidonnat [mod_tiling] BINDINGS:WTiling -BINDINGS:WFrame-on-WTiling +.\" BINDINGS:WFrame.tiled .SS Asiakasikkunoiden sidonnat diff --git a/man/ion3.in b/man/ion3.in index 5ddbb33..b9ab3f1 100644 --- a/man/ion3.in +++ b/man/ion3.in @@ -28,11 +28,6 @@ in the DISPLAY environment variable. Set session name. This option affects where workspace and other save files are put (~/.ion3/session_name if option set). .TP -.B \-xinerama 0|1 -If Ion was compiled with Xinerama support, this option can be used to -enable/disable (1/0) the use of it. The default is to use Xinerama -screen information. -.TP .B \-help Show help on command line options .TP @@ -102,12 +97,12 @@ BINDINGS:WFrame.toplevel .SS Bindings for floating/detached frames -BINDINGS:WFloatFrame +BINDINGS:WFrame.floating .SS Bindings for tilings and tiled frames [mod_tiling] BINDINGS:WTiling -BINDINGS:WFrame-on-WTiling +.\" BINDINGS:WFrame.tiled .SS Bindings for client windows diff --git a/man/pwm3.cs.in b/man/pwm3.cs.in index a45f74c..548a16f 100644 --- a/man/pwm3.cs.in +++ b/man/pwm3.cs.in @@ -30,10 +30,6 @@ obrazovku (ko Nastaví název sezení. Tato volba ovlivní, kam se ulo¾í pracovní plochy a ostatní soubory. Pokud není nastavená, pou¾ije se ~/.pwm3/session_name. .TP -.B \-xinerama 0|1 -Jestli¾e byl Ioncore sestaven s podporou Xineramy, mù¾ete touto volbou -povolit/zakázat (1/0) její pou¾ití. Implicitnì je Xinerama _zakázána_. -.TP .B \-help Zobrazí nápovìdu k pøíkazovým parametrùm .TP @@ -74,7 +70,7 @@ BINDINGS:WMoveresMode BINDINGS:WGroupWS -BINDINGS:WFloatFrame +BINDINGS:WFrame.floating .SS Pøiøazení pro menu [mod_menu] diff --git a/man/pwm3.de.in b/man/pwm3.de.in index fe38739..5f6138d 100644 --- a/man/pwm3.de.in +++ b/man/pwm3.de.in @@ -32,11 +32,6 @@ Setzt einen Sitzungsnamen. Diese Option beeinflusst wo der Arbeitsbereich und andere Sicherungsdateien abgelegt werden (~/.pwm3/sitzungs_name wenn die Option gesetzt wurde). .TP -.B \-xinerama 0|1 -Wenn Ion mit Xinerama Unterstützung kompiliert wurde, kann diese Option benutzt -werden um sie 'an = 1' oder 'aus = 0' zu stellen. Die Voreinstelllung ist -Xineramas Screeninformation 'NICHT' zu benutzen. -.TP .B \-help Zeigt die Hilfe für die Kommandozeilenoptionen .TP @@ -78,7 +73,7 @@ BINDINGS:WMoveresMode BINDINGS:WGroupWS -BINDINGS:WFloatFrame +BINDINGS:WFrame.floating .SS Bindungen für die Menüs [mod_menu] diff --git a/man/pwm3.fi.in b/man/pwm3.fi.in index 6e634c9..40c140f 100644 --- a/man/pwm3.fi.in +++ b/man/pwm3.fi.in @@ -29,12 +29,6 @@ parametrill .B \-sessionname session_name Istunnon nimi. Tämä vaikuttaa talletustiedostojen sijaintiin. .TP -.B \-xinerama 0|1 -PWM ei oletuksena käytä Xinerama-tietoa Ionista poiketen. Jos se kuitenkin -käännettiin Xinerama-tuella, voidaan tuo tieto ottaa käyttää asettamalla -tämän parametrin arvoksi 1. Tuolloin kaikilla Xinerama-näytöillä on -erilliset työpöydät. -.TP .B \-help Näytä komentorivin ohje. .TP @@ -75,7 +69,7 @@ BINDINGS:WMoveresMode BINDINGS:WGroupWS -BINDINGS:WFloatFrame +BINDINGS:WFrame.floating .SS Valikoiden sidonnat [mod_menu] diff --git a/man/pwm3.in b/man/pwm3.in index 50df639..e38625b 100644 --- a/man/pwm3.in +++ b/man/pwm3.in @@ -31,11 +31,6 @@ in the DISPLAY environment variable. Set session name. This option affects where workspace and other save files are put (~/.pwm3/session_name if option set). .TP -.B \-xinerama 0|1 -If Ioncore was compiled with Xinerama support, this option can be used to -enable/disable (1/0) the use of it. The default is _not_ to use Xinerama -screen information. -.TP .B \-help Show help on command line options .TP @@ -75,7 +70,7 @@ BINDINGS:WMoveresMode BINDINGS:WGroupWS -BINDINGS:WFloatFrame +BINDINGS:WFrame.floating .SS Bindings for menus [mod_menu] diff --git a/mod_dock/dock.c b/mod_dock/dock.c index 3b18513..c67ce6d 100644 --- a/mod_dock/dock.c +++ b/mod_dock/dock.c @@ -2,7 +2,7 @@ * Ion dock module * Copyright (C) 2003 Tom Payne * Copyright (C) 2003 Per Olofsson - * Copyright (C) 2004-2006 Tuomo Valkonen + * Copyright (C) 2004-2007 Tuomo Valkonen * * by Tom Payne * based on code by Per Olofsson @@ -905,7 +905,7 @@ static void dock_draw(WDock *dock, bool complete) { WRectangle geom=REGION_GEOM(dock); geom.x=geom.y=0; - grbrush_draw_border(dock->brush, &geom, "dock"); + grbrush_draw_border(dock->brush, &geom); } break; case DOCK_OUTLINE_STYLE_EACH: @@ -913,8 +913,7 @@ static void dock_draw(WDock *dock, bool complete) WDockApp *dockapp; for(dockapp=dock->dockapps; dockapp!=NULL; dockapp=dockapp->next){ - grbrush_draw_border(dock->brush, &dockapp->tile_geom, - "dock"); + grbrush_draw_border(dock->brush, &dockapp->tile_geom); } } break; diff --git a/mod_menu/grabmenu.c b/mod_menu/grabmenu.c index cc94437..79a01ce 100644 --- a/mod_menu/grabmenu.c +++ b/mod_menu/grabmenu.c @@ -1,7 +1,7 @@ /* * ion/mod_menu/grabmenu.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -37,8 +37,10 @@ static bool grabmenu_handler(WRegion *reg, XEvent *xev) if(reg==NULL) return FALSE; - if(menu->gm_state==ev->state && ev->keycode==menu->gm_kcb) + if((menu->gm_state==ev->state || menu->gm_state==AnyModifier) + && ev->keycode==menu->gm_kcb){ menu_select_next(menu); + } return FALSE; } @@ -53,12 +55,17 @@ WMenu *mod_menu_do_grabmenu(WMPlex *mplex, ExtlFn handler, ExtlTab tab, WMPlexAttachParams par; WMenu *menu; XKeyEvent *ev; + uint state, kcb; + bool sub; - ev=ioncore_current_key_event(); - - if(ev==NULL) + if(!ioncore_current_key(&kcb, &state, &sub)) return NULL; + if(state==0){ + /* TODO: cycle key? */ + return mod_menu_do_menu(mplex, handler, tab, param); + } + fnp.handler=handler; fnp.tab=tab; fnp.pmenu_mode=FALSE; @@ -77,10 +84,10 @@ WMenu *mod_menu_do_grabmenu(WMPlex *mplex, ExtlFn handler, ExtlTab tab, (void*)&fnp); if(menu==NULL) - return FALSE; + return NULL; - menu->gm_kcb=ev->keycode; - menu->gm_state=ev->state; + menu->gm_kcb=kcb; + menu->gm_state=state; ioncore_grab_establish((WRegion*)menu, grabmenu_handler, NULL, 0); diff --git a/mod_menu/main.c b/mod_menu/main.c index 98df15b..601e11e 100644 --- a/mod_menu/main.c +++ b/mod_menu/main.c @@ -1,7 +1,7 @@ /* * ion/mod_menu/main.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_menu/main.h b/mod_menu/main.h index c5568b8..e779d15 100644 --- a/mod_menu/main.h +++ b/mod_menu/main.h @@ -1,7 +1,7 @@ /* * ion/mod_menu/main.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_menu/menu.c b/mod_menu/menu.c index b8ec9cf..d891c23 100644 --- a/mod_menu/menu.c +++ b/mod_menu/menu.c @@ -1,7 +1,7 @@ /* * ion/mod_menu/menu.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include "menu.h" #include "main.h" @@ -85,22 +87,35 @@ static void get_inner_geom(WMenu *menu, WRectangle *geom) } +GR_DEFATTR(active); +GR_DEFATTR(inactive); +GR_DEFATTR(selected); +GR_DEFATTR(unselected); +GR_DEFATTR(normal); +GR_DEFATTR(submenu); + + +static void init_attr() +{ + GR_ALLOCATTR_BEGIN; + GR_ALLOCATTR(active); + GR_ALLOCATTR(inactive); + GR_ALLOCATTR(selected); + GR_ALLOCATTR(unselected); + GR_ALLOCATTR(normal); + GR_ALLOCATTR(submenu); + GR_ALLOCATTR_END; +} + + static void menu_draw_entry(WMenu *menu, int i, const WRectangle *igeom, bool complete) { WRectangle geom; - int a; - - static const char *attrs[]={ - "active-selected-normal", - "active-selected-submenu", - "active-unselected-normal", - "active-unselected-submenu", - "inactive-selected-normal", - "inactive-selected-submenu", - "inactive-unselected-normal", - "inactive-unselected-submenu", - }; + GrAttr sa, aa; + + aa=(REGION_IS_ACTIVE(menu) ? GR_ATTR(active) : GR_ATTR(inactive)); + sa=(menu->selected_entry==i ? GR_ATTR(selected) : GR_ATTR(unselected)); if(menu->entry_brush==NULL) return; @@ -109,14 +124,15 @@ static void menu_draw_entry(WMenu *menu, int i, const WRectangle *igeom, geom.h=menu->entry_h; geom.y+=(i-menu->first_entry)*(menu->entry_h+menu->entry_spacing); - a=((REGION_IS_ACTIVE(menu) ? 0 : 4) - |(menu->selected_entry==i ? 0 : 2) - |(menu->entries[i].flags&WMENUENTRY_SUBMENU ? 1 : 0)); - - grbrush_begin(menu->entry_brush, &geom, GRBRUSH_AMEND); + grbrush_begin(menu->entry_brush, &geom, GRBRUSH_AMEND|GRBRUSH_KEEP_ATTR); + + grbrush_init_attr(menu->entry_brush, &menu->entries[i].attr); + + grbrush_set_attr(menu->entry_brush, aa); + grbrush_set_attr(menu->entry_brush, sa); grbrush_draw_textbox(menu->entry_brush, &geom, menu->entries[i].title, - attrs[a], complete); + complete); grbrush_end(menu->entry_brush); } @@ -126,10 +142,10 @@ void menu_draw_entries(WMenu *menu, bool complete) { WRectangle igeom; int i, mx; - + if(menu->entry_brush==NULL) return; - + get_inner_geom(menu, &igeom); mx=menu->first_entry+menu->vis_entries; @@ -142,8 +158,8 @@ void menu_draw_entries(WMenu *menu, bool complete) void menu_draw(WMenu *menu, bool complete) { + GrAttr aa=(REGION_IS_ACTIVE(menu) ? GR_ATTR(active) : GR_ATTR(inactive)); WRectangle geom; - const char *substyle=(REGION_IS_ACTIVE(menu) ? "active" : "inactive"); if(menu->brush==NULL) return; @@ -153,7 +169,9 @@ void menu_draw(WMenu *menu, bool complete) grbrush_begin(menu->brush, &geom, (complete ? 0 : GRBRUSH_NO_CLEAR_OK)); - grbrush_draw_border(menu->brush, &geom, substyle); + grbrush_set_attr(menu->brush, aa); + + grbrush_draw_border(menu->brush, &geom); menu_draw_entries(menu, FALSE); @@ -491,9 +509,8 @@ static void menu_release_gr(WMenu *menu) static WMenuEntry *preprocess_menu(ExtlTab tab, int *n_entries) { - ExtlTab entry, sub; - ExtlFn fn; WMenuEntry *entries; + ExtlTab entry; int i, n; n=extl_table_get_n(tab); @@ -506,17 +523,40 @@ static WMenuEntry *preprocess_menu(ExtlTab tab, int *n_entries) if(entries==NULL) return NULL; - + + init_attr(); + /* Initialise entries and check submenus */ for(i=1; i<=n; i++){ - entries[i-1].title=NULL; - entries[i-1].flags=0; - if(extl_table_getis(tab, i, "submenu_fn", 'f', &fn)){ - entries[i-1].flags|=WMENUENTRY_SUBMENU; - extl_unref_fn(fn); - }else if(extl_table_getis(tab, i, "submenu", 't', &sub)){ - entries[i-1].flags|=WMENUENTRY_SUBMENU; - extl_unref_table(sub); + WMenuEntry *ent=&entries[i-1]; + + ent->title=NULL; + ent->flags=0; + + gr_stylespec_init(&ent->attr); + + if(extl_table_geti_t(tab, i, &entry)){ + char *attr; + ExtlTab sub; + ExtlFn fn; + + if(extl_table_gets_s(entry, "attr", &attr)){ + gr_stylespec_load_(&ent->attr, attr, TRUE); + free(attr); + } + + if(extl_table_gets_f(entry, "submenu_fn", &fn)){ + ent->flags|=WMENUENTRY_SUBMENU; + extl_unref_fn(fn); + }else if(extl_table_gets_t(entry, "submenu", &sub)){ + ent->flags|=WMENUENTRY_SUBMENU; + extl_unref_table(sub); + } + + if(ent->flags&WMENUENTRY_SUBMENU) + gr_stylespec_set(&ent->attr, GR_ATTR(submenu)); + + extl_unref_table(entry); } } @@ -524,6 +564,8 @@ static WMenuEntry *preprocess_menu(ExtlTab tab, int *n_entries) } +static void deinit_entries(WMenu *menu); + bool menu_init(WMenu *menu, WWindow *par, const WFitParams *fp, const WMenuCreateParams *params) @@ -545,9 +587,9 @@ bool menu_init(WMenu *menu, WWindow *par, const WFitParams *fp, menu->last_fp=*fp; - if(params->pmenu_mode) + if(params->pmenu_mode){ menu->selected_entry=-1; - else{ + }else{ menu->selected_entry=params->initial-1; if(menu->selected_entry<0) menu->selected_entry=0; @@ -575,7 +617,9 @@ bool menu_init(WMenu *menu, WWindow *par, const WFitParams *fp, if(!menu_init_gr(menu, region_rootwin_of((WRegion*)par), win)) goto fail2; - + + init_attr(); + menu_firstfit(menu, params->submenu_mode, &(params->refg)); window_select_input(&(menu->win), IONCORE_EVENTMASK_NORMAL); @@ -591,7 +635,7 @@ fail2: fail: extl_unref_table(menu->tab); extl_unref_fn(menu->handler); - free(menu->entries); + deinit_entries(menu); return FALSE; } @@ -603,11 +647,22 @@ WMenu *create_menu(WWindow *par, const WFitParams *fp, } - -void menu_deinit(WMenu *menu) +static void deinit_entries(WMenu *menu) { int i; + for(i=0; in_entries; i++){ + gr_stylespec_unalloc(&menu->entries[i].attr); + if(menu->entries[i].title!=NULL) + free(menu->entries[i].title); + } + + free(menu->entries); +} + + +void menu_deinit(WMenu *menu) +{ menu_typeahead_clear(menu); if(menu->submenu!=NULL) @@ -616,11 +671,10 @@ void menu_deinit(WMenu *menu) extl_unref_table(menu->tab); extl_unref_fn(menu->handler); - for(i=0; in_entries; i++) - free(menu->entries[i].title); - free(menu->entries); + deinit_entries(menu); menu_release_gr(menu); + window_deinit((WWindow*)menu); } @@ -931,7 +985,7 @@ EXTL_EXPORT_MEMBER void menu_cancel(WMenu *menu) { if(region_manager_allows_destroying((WRegion*)menu)) - mainloop_defer_destroy((Obj*)menu); + region_dispose_((WRegion*)menu); } diff --git a/mod_menu/menu.h b/mod_menu/menu.h index a79d36a..38dd1f8 100644 --- a/mod_menu/menu.h +++ b/mod_menu/menu.h @@ -1,7 +1,7 @@ /* * ion/mod_menu/menu.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -25,6 +25,7 @@ INTRSTRUCT(WMenuEntry); DECLSTRUCT(WMenuEntry){ char *title; int flags; + GrStyleSpec attr; }; DECLCLASS(WMenu){ diff --git a/mod_menu/mkmenu.c b/mod_menu/mkmenu.c index 5f4fecf..0c27f73 100644 --- a/mod_menu/mkmenu.c +++ b/mod_menu/mkmenu.c @@ -1,7 +1,7 @@ /* * ion/mod_menu/mkmenu.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_menu/mkmenu.h b/mod_menu/mkmenu.h index 2efed2f..610047f 100644 --- a/mod_menu/mkmenu.h +++ b/mod_menu/mkmenu.h @@ -1,7 +1,7 @@ /* * ion/mod_menu/mkmenu.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_menu/mod_menu.lua b/mod_menu/mod_menu.lua index 6375e9f..913ad16 100644 --- a/mod_menu/mod_menu.lua +++ b/mod_menu/mod_menu.lua @@ -1,7 +1,7 @@ -- -- ion/mod_menu/mod_menu.lua -- Menu opening helper routines. -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by @@ -29,11 +29,11 @@ assert(mod_menu and menudb) local function menu_(reg, sub, menu_or_name, fn, check) if check then -- Check that no other menus are open in reg. - local l=reg:managed_list() - for i, r in pairs(l) do - if obj_is(r, "WMenu") then - return - end + local ok=reg:managed_i(function(r) + return not obj_is(r, "WMenu") + end) + if not ok then + return end end diff --git a/mod_mgmtmode/main.c b/mod_mgmtmode/main.c index fc5ecc6..ef62c52 100644 --- a/mod_mgmtmode/main.c +++ b/mod_mgmtmode/main.c @@ -1,7 +1,7 @@ /* * ion/mod_mgmtmode/main.c * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_mgmtmode/main.h b/mod_mgmtmode/main.h index 30f61f3..5c9fde4 100644 --- a/mod_mgmtmode/main.h +++ b/mod_mgmtmode/main.h @@ -1,7 +1,7 @@ /* * ion/mod_mgmtmode/main.h * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_mgmtmode/mgmtmode.c b/mod_mgmtmode/mgmtmode.c index 92a3d27..4b86aa4 100644 --- a/mod_mgmtmode/mgmtmode.c +++ b/mod_mgmtmode/mgmtmode.c @@ -1,7 +1,7 @@ /* * ion/mod_mgmtmode/mgmtmode.c * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_mgmtmode/mgmtmode.h b/mod_mgmtmode/mgmtmode.h index 1e5ee64..daf7eae 100644 --- a/mod_mgmtmode/mgmtmode.h +++ b/mod_mgmtmode/mgmtmode.h @@ -1,7 +1,7 @@ /* * ion/mod_mgmtmode/mgmtmode.h * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_panews/Makefile b/mod_panews/Makefile deleted file mode 100644 index c1b79fb..0000000 --- a/mod_panews/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -## -## mod_panews workspace module Makefile -## - -# System-specific configuration is in system.mk -TOPDIR=.. -include $(TOPDIR)/build/system-inc.mk - -###################################### - -INCLUDES += $(X11_INCLUDES) $(LIBTU_INCLUDES) $(LIBEXTL_INCLUDES) -I.. -CFLAGS += $(XOPEN_SOURCE) $(C99_SOURCE) - -SOURCES=main.c panews.c placement.c splitext.c unusedwin.c - -MAKE_EXPORTS=mod_panews - -MODULE=mod_panews -MODULE_STUB=mod_panews.lua - -###################################### - -include $(TOPDIR)/build/rules.mk - -###################################### - -_install: module_install diff --git a/mod_panews/main.c b/mod_panews/main.c deleted file mode 100644 index b3f4f10..0000000 --- a/mod_panews/main.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * ion/panews/main.c - * - * Copyright (c) Tuomo Valkonen 1999-2006. - * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - */ - -#include - -#include -#include -#include -#include -#include -#include - -#include "main.h" -#include "panews.h" -#include "placement.h" -#include "exports.h" - - -/*{{{ Module information */ - - -#include "../version.h" - -char mod_panews_ion_api_version[]=ION_API_VERSION; - - -/*}}}*/ - - -/*{{{ Bindmaps */ - - -WBindmap *mod_panews_panews_bindmap=NULL; -WBindmap *mod_panews_frame_bindmap=NULL; -WBindmap *mod_panews_unusedwin_bindmap=NULL; - - -/*}}}*/ - - -/*{{{ Module init & deinit */ - - -void mod_panews_deinit() -{ - mod_panews_unregister_exports(); - ioncore_unregister_regclass(&CLASSDESCR(WPaneWS)); - - if(mod_panews_panews_bindmap!=NULL){ - ioncore_free_bindmap("WPaneWS", mod_panews_panews_bindmap); - mod_panews_panews_bindmap=NULL; - } - - if(mod_panews_unusedwin_bindmap!=NULL){ - ioncore_free_bindmap("WUnusedWin", mod_panews_unusedwin_bindmap); - mod_panews_unusedwin_bindmap=NULL; - } - - if(mod_panews_frame_bindmap!=NULL){ - ioncore_free_bindmap("WFrame-on-WPaneWS", mod_panews_frame_bindmap); - mod_panews_frame_bindmap=NULL; - } - - if(panews_init_layout_alt!=NULL){ - destroy_obj((Obj*)panews_init_layout_alt); - panews_init_layout_alt=NULL; - } - - if(panews_make_placement_alt!=NULL){ - destroy_obj((Obj*)panews_make_placement_alt); - panews_make_placement_alt=NULL; - } -} - - -static bool register_regions() -{ - if(!ioncore_register_regclass(&CLASSDESCR(WPaneWS), - (WRegionLoadCreateFn*)panews_load)){ - return FALSE; - } - - return TRUE; -} - - -#define INIT_HOOK_(NM) \ - NM=mainloop_register_hook(#NM, create_hook()); \ - if(NM==NULL) return FALSE; - - -static bool init_hooks() -{ - INIT_HOOK_(panews_init_layout_alt); - INIT_HOOK_(panews_make_placement_alt); - return TRUE; -} - - - -bool mod_panews_init() -{ - if(!init_hooks()) - goto err; - - mod_panews_panews_bindmap=ioncore_alloc_bindmap("WPaneWS", NULL); - mod_panews_unusedwin_bindmap=ioncore_alloc_bindmap_frame("WUnusedWin"); - mod_panews_frame_bindmap=ioncore_alloc_bindmap_frame("WFrame-on-WPaneWS"); - - if(mod_panews_panews_bindmap==NULL || - mod_panews_unusedwin_bindmap==NULL || - mod_panews_frame_bindmap==NULL){ - goto err; - } - - if(!mod_panews_register_exports()) - goto err; - - if(!register_regions()) - goto err; - - /*ioncore_read_config("cfg_panews", NULL, FALSE);*/ - - return TRUE; - -err: - mod_panews_deinit(); - return FALSE; -} - - -/*}}}*/ - diff --git a/mod_panews/main.h b/mod_panews/main.h deleted file mode 100644 index 5dc226c..0000000 --- a/mod_panews/main.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * ion/panews/main.h - * - * Copyright (c) Tuomo Valkonen 1999-2006. - * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - */ - -#ifndef ION_PANEWS_MAIN_H -#define ION_PANEWS_MAIN_H - -#include -#include - -extern bool mod_panews_init(); -extern void mod_panews_deinit(); - -extern WBindmap *mod_panews_panews_bindmap; -extern WBindmap *mod_panews_unusedwin_bindmap; -extern WBindmap *mod_panews_frame_bindmap; - -#endif /* ION_PANEWS_MAIN_H */ diff --git a/mod_panews/mod_panews.lua b/mod_panews/mod_panews.lua deleted file mode 100644 index 65bf32e..0000000 --- a/mod_panews/mod_panews.lua +++ /dev/null @@ -1,562 +0,0 @@ --- --- ion/mod_panews/mod_panews.lua --- --- Copyright (c) Tuomo Valkonen 2004-2006. --- --- Ion is free software; you can redistribute it and/or modify it under --- the terms of the GNU Lesser General Public License as published by --- the Free Software Foundation; either version 2.1 of the License, or --- (at your option) any later version. --- - - --- This is a slight abuse of the package.loaded variable perhaps, but --- library-like packages should handle checking if they're loaded instead of --- confusing the user with require/include differences. -if package.loaded["templates"] then return end - -if not ioncore.load_module("mod_panews") then - return -end - -assert(not _G["mod_panews"]); -local mod_panews={} -_G["mod_panews"]=mod_panews - -local private={} -local settings={} - --- Settings {{{ - --- Classes: --- (T)erminal --- (V)iewer --- (M)isc -settings.valid_classifications={["V"]=true, ["T"]=true, ["M"]=true,} - --- Xterm, rxvt, aterm, etc. all have "XTerm" as class part of WM_CLASS -settings.terminal_emulators={["XTerm"]=true,} - --- Pixel scale factor from 1280x1024/75dpi -settings.scalef=1.0 - ---settings.b_ratio=(1+math.sqrt(5))/2 ---settings.s_ratio=1 -settings.b_ratio=3 -settings.s_ratio=2 - -settings.b_ratio2=7 -settings.s_ratio2=1 - -settings.templates={} - -settings.templates["default"]={ - type="WSplitFloat", - dir="horizontal", - tls=settings.b_ratio, - brs=settings.s_ratio, - tls_brs_incl_handles=true, - tl={ - type="WSplitPane", - contents={ - type="WSplitFloat", - dir="vertical", - tls=settings.b_ratio2, - brs=settings.s_ratio2, - tls_brs_incl_handles=true, - tl={ - type="WSplitPane", - marker="V:single", - }, - br={ - type="WSplitPane", - marker="M:right", - }, - }, - }, - br={ - type="WSplitPane", - marker="T:up", - }, -} - - -settings.templates["alternative1"]={ - type="WSplitFloat", - dir="horizontal", - tls=settings.s_ratio2, - brs=settings.b_ratio2, - tls_brs_incl_handles=true, - tl={ - type="WSplitPane", - marker="M:down", - }, - br={ - type="WSplitFloat", - dir="vertical", - tls=settings.b_ratio, - brs=settings.s_ratio, - tls_brs_incl_handles=true, - tl={ - type="WSplitPane", - marker="V:single", - }, - br={ - type="WSplitPane", - marker="T:right", - }, - }, -} - - -settings.templates["alternative2"]={ - type="WSplitFloat", - dir="vertical", - tls=settings.b_ratio, - brs=settings.s_ratio, - tls_brs_incl_handles=true, - tl={ - type="WSplitFloat", - dir="horizontal", - tls=settings.s_ratio2, - brs=settings.b_ratio2, - tls_brs_incl_handles=true, - tl={ - type="WSplitPane", - marker="M:down", - }, - br={ - type="WSplitPane", - marker="V:single", - }, - }, - br={ - type="WSplitPane", - marker="T:right", - }, -} - - -settings.template=settings.templates["default"] - -settings.shrink_minimum=32 - ---DOC --- Set some module parameters. Currently \var{s} may contain the following --- fields: --- \begin{tabularx}{\linewidth}{lX} --- \tabhead{Field & Description} --- \var{template} & layout template for newly created \type{WPaneWS} --- workspaces. This can be either a table or one of the --- predefined layouts 'default', 'alternative1', and --- 'alternative2'. \\ --- \var{scalef} & Scale factor for classification heuristics to work --- with different screen resolutions. The default is 1.0 --- and is designed for 1280x1024 at 75dpi. \\ --- \var{valid_classifications} & A table with valid window classifications --- as valid keys. \\ --- \end{tabularx} -function mod_panews.set(s) - if s.template then - local ok=false - if type(s.template)=="string" then - if settings.templates[s.template] then - settings.template=settings.templates[s.template] - ok=true - end - elseif type(s.template)=="table" then - settings.template=s.template - ok=true - end - if not ok then - ioncore.warn_traced("Invalid template.") - end - end - if s.scalef then - if type(s.scalef)~="number" or s.scalef<=0 then - ioncore.warn_traced('Invalid scale factor') - else - settings.scalef=s.scalef - end - end - - if type(s.valid_classifications)=="table" then - settings.valid_classifications=s.valid_classifications - end -end - - ---DOC --- Get some module settings. See \fnref{mod_panews.set} for documentation --- on the contents of the returned table. -function mod_panews.get() - return table.copy(settings, true) -end - - --- }}} - - --- Helper code {{{ - -local function sfind(s, p) - local function drop2(a, b, ...) - return unpack(arg) - end - return drop2(string.find(s, p)) -end - - -function private.div_length(w, r1, r2) - local a=math.ceil(w*r1/(r1+r2)) - return a, w-a -end - -function private.split3(d, ls, cs, rs, lo, co, ro) - return { - tls = ls+cs, - brs = rs, - dir = d, - tl = { - tls = ls, - brs = cs, - dir = d, - tl = (lo or {}), - br = (co or {}), - }, - br = (ro or {}), - } -end - -function private.center3(d, ts, cs, lo, co, ro) - local sc=math.min(ts, cs) - local sl=math.floor((ts-sc)/2) - local sr=ts-sc-sl - local r=private.split3(d, sl, sc, sr, lo, co, ro) - return r -end - -function private.split2(d, ts, ls, rs, lo, ro) - if ls and rs then - assert(ls+rs==ts) - elseif not ls then - ls=ts-rs - else - rs=ts-ls - end - assert(rs>=0 and ls>=0) - return { - type="WSplitSplit", - dir=d, - tls=math.floor(ls), - brs=math.ceil(rs), - tl=lo, - br=ro, - } -end - --- }}} - - --- Classification {{{ - -function private.classify(ws, reg) - if obj_is(reg, "WClientWin") then - -- Check if there's a winprop override - local wp=ioncore.getwinprop(reg) - if wp and wp.panews_classification then - if settings.valid_classifications[wp.panews_classification] then - return wp.panews_classification - end - end - - -- Handle known terminal emulators. - local id=reg:get_ident() - if settings.terminal_emulators[id.class] then - return "T" - end - end - - -- Try size heuristics. - local cg=reg:geom() - - if cg.w<3/8*(1280*settings.scalef) then - return "M" - end - - if cg.h>4/8*(960*settings.scalef) then - return "V" - else - return "T" - end -end - --- }}} - - --- Placement code {{{ - -local max_penalty=5 -local just_some_pixel_count=16 - -function private.fitlevel_(min1, s1, us1, min2, s2, us2) - local p1, p2=4, 0.5 - - if us2>=min2 then - p2=0 - end - - if us1>=math.max(s1/2, min1) then - p1=0 - elseif us1>=min1+just_some_pixel_count then - p1=1 - elseif us1>=min1 then - p1=2 - elseif us1>0 then - p1=3 - end - - return p1+p2 -end - -function private.fitlevel(frame, node, horiz) - local fg=frame:geom() - local fsh=frame:size_hints() - local sg=node:geom() - if not horiz then - return private.fitlevel_(fsh.min_h, fg.h, sg.h, fsh.min_w, fg.w, sg.w) - else - return private.fitlevel_(fsh.min_w, fg.w, sg.w, fsh.min_h, fg.h, sg.h) - end -end - - -function private.use_unused(p, n, d, forcelevel) - local f=private.fitlevel(p.frame, n, (d=="left" or d=="right")) - if f>forcelevel then - return false, f - end - - if d=="single" then - p.res_node=n - p.res_config={reg=p.frame} - return true, f - end - - -- TODO: Check fit - local sg=n:geom() - local fg=p.frame:geom() - - if d=="up" or d=="down" then - p.res_node=n - local fh=math.min(fg.h, sg.h) - if d=="up" then - p.res_config=private.split2("vertical", sg.h, nil, fh, - {}, {reg=p.frame}) - else - p.res_config=private.split2("vertical", sg.h, fh, nil, - {reg=p.frame}, {}) - end - return true, f - elseif d=="left" or d=="right" then - p.res_node=n - local fw=math.min(fg.w, sg.w) - if d=="left" then - p.res_config=private.split2("horizontal", sg.w, nil, fw, - {}, {reg=p.frame}) - else - p.res_config=private.split2("horizontal", sg.w, fw, nil, - {reg=p.frame}, {}) - end - return true, f - end - - return false, f -end - - -function private.scan_pane(p, node, d) - local function do_scan_active(n, uf) - local t=obj_typename(n) - if t=="WSplitRegion" then - local f=private.fitlevel(p.frame, n, (d=="left" or d=="right")) - if f - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "panews.h" -#include "placement.h" -#include "main.h" -#include "splitext.h" - - -/*{{{ Create/destroy */ - - -bool panews_managed_add(WPaneWS *ws, WRegion *reg) -{ - if(OBJ_IS(reg, WFrame)) - region_add_bindmap(reg, mod_panews_frame_bindmap); - - return tiling_managed_add_default(&(ws->tiling), reg); -} - - -static WRegion *create_frame_panews(WWindow *parent, const WFitParams *fp) -{ - return (WRegion*)create_frame(parent, fp, "frame-tiled-panews"); -} - - -static bool mrsh_init_layout_extl(ExtlFn fn, WPaneWSInitParams *p) -{ - ExtlTab t=extl_create_table(); - bool ret=FALSE; - - extl_table_sets_o(t, "ws", (Obj*)p->ws); - - extl_protect(NULL); - ret=extl_call(fn, "t", "b", t, &ret); - extl_unprotect(NULL); - - if(ret) - ret=extl_table_gets_t(t, "layout", &(p->layout)); - - extl_unref_table(t); - return ret; -} - - -static bool panews_init_layout(WPaneWS *ws) -{ - WPaneWSInitParams p; - - p.ws=ws; - p.layout=extl_table_none(); - - hook_call_p(panews_init_layout_alt, &p, - (WHookMarshallExtl*)mrsh_init_layout_extl); - - if(p.layout!=extl_table_none()){ - ws->tiling.split_tree=tiling_load_node(&(ws->tiling), - ®ION_GEOM(ws), - p.layout); - extl_unref_table(p.layout); - } - - if(ws->tiling.split_tree==NULL) - ws->tiling.split_tree=(WSplit*)create_splitunused(®ION_GEOM(ws), ws); - - if(ws->tiling.split_tree!=NULL) - ws->tiling.split_tree->ws_if_root=&(ws->tiling); - - return (ws->tiling.split_tree!=NULL); -} - - -bool panews_init(WPaneWS *ws, WWindow *parent, const WFitParams *fp, - bool ilo) -{ - if(!tiling_init(&(ws->tiling), parent, fp, - create_frame_panews, FALSE)) - return FALSE; - - region_add_bindmap((WRegion*)ws, mod_panews_panews_bindmap); - - assert(ws->tiling.split_tree==NULL); - - if(ilo){ - if(!panews_init_layout(ws)){ - panews_deinit(ws); - return FALSE; - } - } - - return TRUE; -} - - -WPaneWS *create_panews(WWindow *parent, const WFitParams *fp, bool cu) -{ - CREATEOBJ_IMPL(WPaneWS, panews, (p, parent, fp, cu)); -} - - -WPaneWS *create_panews_simple(WWindow *parent, const WFitParams *fp) -{ - return create_panews(parent, fp, TRUE); -} - - -void panews_deinit(WPaneWS *ws) -{ - tiling_deinit(&(ws->tiling)); -} - - -static WSplitRegion *get_node_check(WPaneWS *ws, WRegion *reg) -{ - WSplitRegion *node; - - if(reg==NULL) - return NULL; - - node=splittree_node_of(reg); - - if(node==NULL || REGION_MANAGER(reg)!=(WRegion*)ws) - return NULL; - - return node; -} - - -static void panews_do_managed_remove(WPaneWS *ws, WRegion *reg) -{ - tiling_do_managed_remove(&(ws->tiling), reg); - if(OBJ_IS(reg, WFrame)) - region_remove_bindmap(reg, mod_panews_frame_bindmap); -} - - -static bool plainregionfilter(WSplit *node) -{ - return (strcmp(OBJ_TYPESTR(node), "WSplitRegion")==0); -} - - - -void panews_managed_remove(WPaneWS *ws, WRegion *reg) -{ - bool ds=OBJ_IS_BEING_DESTROYED(ws); - bool act=REGION_IS_ACTIVE(reg); - bool mcf=region_may_control_focus((WRegion*)ws); - WSplitRegion *node=get_node_check(ws, reg); - WRegion *other=NULL; - - other=tiling_do_get_nextto(&(ws->tiling), reg, SPLIT_ANY, PRIMN_ANY, FALSE); - - panews_do_managed_remove(ws, reg); - - if(node==(WSplitRegion*)(ws->tiling.stdispnode)) - ws->tiling.stdispnode=NULL; - - if(node==NULL) - return; - - splittree_remove((WSplit*)node, !ds); - - if(!ds){ - if(other==NULL){ - if(ws->tiling.split_tree==NULL){ - warn(TR("Unable to re-initialise workspace. Destroying.")); - mainloop_defer_destroy((Obj*)ws); - }else if(act && mcf){ - /* We don't want to give the stdisp focus, even if one exists. - * Or do we? - */ - tiling_fallback_focus(&ws->tiling, FALSE); - } - }else if(act && mcf){ - region_warp(other); - } - } -} - - -/*}}}*/ - - -/*{{{ Misc. */ - - -bool panews_managed_prepare_focus(WPaneWS *ws, WRegion *reg, - int flags, WPrepareFocusResult *res) -{ - if(flags®ION_GOTO_ENTERWINDOW){ - WSplitRegion *other, *node=get_node_check(ws, reg); - if(node!=NULL && OBJ_IS(node, WSplitUnused)){ - /* An unused region - do not focus unless there are no - * normal regions in its pane. - */ - other=split_tree_find_region_in_pane_of((WSplit*)node); - if(other!=NULL){ - tiling_managed_prepare_focus(&(ws->tiling), other->reg, - flags&~REGION_GOTO_ENTERWINDOW, - res); - return FALSE; - } - } - } - - return tiling_managed_prepare_focus(&(ws->tiling), reg, flags, res); -} - - -static bool filter_no_stdisp_unused(WSplit *split) -{ - return (OBJ_IS(split, WSplitRegion) - && !OBJ_IS(split, WSplitST) - && !OBJ_IS(split, WSplitUnused)); -} - - -bool panews_managed_may_destroy(WPaneWS *ws, WRegion *reg) -{ - if(region_manager_allows_destroying((WRegion*)ws)) - return TRUE; - - if(tiling_do_get_nextto(&(ws->tiling), reg, - SPLIT_ANY, PRIMN_ANY, FALSE)==NULL){ - return FALSE; - } - - return TRUE; -} - - -bool panews_may_destroy(WPaneWS *ws) -{ - if(split_current_todir(ws->tiling.split_tree, SPLIT_ANY, PRIMN_ANY, - filter_no_stdisp_unused)!=NULL){ - warn(TR("Refusing to close non-empty workspace.")); - return FALSE; - } - - return TRUE; -} - - -/* -static WRegion *panews_rqclose_propagate(WPaneWS *ws, WRegion *sub) -{ - WSplitRegion *node=NULL; - WRegion *reg=NULL; - - if(sub==NULL){ - if(ws->tiling.split_tree!=NULL){ - node=(WSplitRegion*)split_current_todir(ws->tiling.split_tree, - SPLIT_ANY, PRIMN_ANY, - filter_no_stdisp_unused); - } - if(node==NULL){ - mainloop_defer_destroy((Obj*)ws); - return (WRegion*)ws; - } - if(node->reg==NULL) - return NULL; - sub=node->reg; - }else{ - node=get_node_check(ws, sub); - if(node==NULL) - return NULL; - } - - - return (region_rqclose(sub) ? sub : NULL); -} -*/ - - -/*}}}*/ - - -/*{{{ Save */ - - -ExtlTab panews_get_configuration(WPaneWS *ws) -{ - return tiling_get_configuration(&(ws->tiling)); -} - - -/*}}}*/ - - -/*{{{ Load */ - - -static WSplit *load_splitunused(WPaneWS *ws, const WRectangle *geom, - ExtlTab tab) -{ - return (WSplit*)create_splitunused(geom, (WPaneWS*)ws); -} - - -static WSplit *load_splitpane(WPaneWS *ws, const WRectangle *geom, ExtlTab tab) -{ - ExtlTab t; - WSplitPane *pane; - WSplit *cnt; - - pane=create_splitpane(geom, NULL); - if(pane==NULL) - return NULL; - - if(extl_table_gets_t(tab, "contents", &t)){ - cnt=tiling_load_node(&(ws->tiling), geom, t); - extl_unref_table(t); - }else{ - cnt=load_splitunused(ws, geom, extl_table_none()); - } - - if(cnt==NULL){ - destroy_obj((Obj*)pane); - return NULL; - } - - pane->contents=cnt; - cnt->parent=&(pane->isplit); - - assert(pane->marker==NULL); - extl_table_gets_s(tab, "marker", &(pane->marker)); - - return (WSplit*)pane; -} - - -static WSplit *panews_load_node(WPaneWS *ws, const WRectangle *geom, - ExtlTab tab) -{ - char *s=NULL; - - if(!extl_table_gets_s(tab, "type", &s)){ - WRegion *reg=NULL; - /* Shortcuts for templates.lua */ - if(extl_table_gets_o(tab, "reg", (Obj**)®)){ - if(OBJ_IS(reg, WRegion)) - return load_splitregion_doit(&(ws->tiling), geom, tab); - }else{ - return load_splitunused(ws, geom, tab); - } - }else{ - if(strcmp(s, "WSplitPane")==0) - return load_splitpane(ws, geom, tab); - else if(strcmp(s, "WSplitUnused")==0) - return load_splitunused(ws, geom, tab); - } - - return tiling_load_node_default(&(ws->tiling), geom, tab); -} - - -WRegion *panews_load(WWindow *par, const WFitParams *fp, ExtlTab tab) -{ - WPaneWS *ws; - ExtlTab treetab; - - ws=create_panews(par, fp, FALSE); - - if(ws==NULL) - return NULL; - - if(extl_table_gets_t(tab, "split_tree", &treetab)){ - ws->tiling.split_tree=tiling_load_node(&(ws->tiling), ®ION_GEOM(ws), - treetab); - extl_unref_table(treetab); - } - - if(ws->tiling.split_tree==NULL){ - if(!panews_init_layout(ws)){ - destroy_obj((Obj*)ws); - return NULL; - } - } - - ws->tiling.split_tree->ws_if_root=ws; - split_restack(ws->tiling.split_tree, ws->tiling.dummywin, Above); - - return (WRegion*)ws; -} - - -/*}}}*/ - - -/*{{{ Dynamic function table and class implementation */ - - -static DynFunTab panews_dynfuntab[]={ - {region_managed_remove, - panews_managed_remove}, - - {(DynFun*)region_prepare_manage, - (DynFun*)panews_prepare_manage}, - - {(DynFun*)region_get_configuration, - (DynFun*)panews_get_configuration}, - - {(DynFun*)region_may_destroy, - (DynFun*)panews_may_destroy}, - - {(DynFun*)region_managed_may_destroy, - (DynFun*)panews_managed_may_destroy}, - - {(DynFun*)tiling_managed_add, - (DynFun*)panews_managed_add}, - - {(DynFun*)tiling_load_node, - (DynFun*)panews_load_node}, - - {(DynFun*)tiling_do_get_nextto, - (DynFun*)panews_do_get_nextto}, - - {(DynFun*)tiling_do_get_farthest, - (DynFun*)panews_do_get_farthest}, - - {(DynFun*)region_managed_prepare_focus, - (DynFun*)panews_managed_prepare_focus}, - - /* - {(DynFun*)region_rqclose_propagate, - (DynFun*)panews_rqclose_propagate},*/ - - END_DYNFUNTAB -}; - - -EXTL_EXPORT -IMPLCLASS(WPaneWS, WTiling, panews_deinit, panews_dynfuntab); - - -/*}}}*/ - diff --git a/mod_panews/panews.h b/mod_panews/panews.h deleted file mode 100644 index 1402523..0000000 --- a/mod_panews/panews.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * ion/panews/panews.h - * - * Copyright (c) Tuomo Valkonen 1999-2006. - * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - */ - -#ifndef ION_PANEWS_PANEWS_H -#define ION_PANEWS_PANEWS_H - -#include -#include -#include -#include -#include - -#include - - -INTRCLASS(WPaneWS); -DECLCLASS(WPaneWS){ - WTiling tiling; -}; - - -extern void panews_deinit(WPaneWS *ws); -extern bool panews_init(WPaneWS *ws, WWindow *parent, const WFitParams *fp, - bool cu); -extern WPaneWS *create_panews(WWindow *parent, const WFitParams *fp, bool cu); -extern WPaneWS *create_panews_simple(WWindow *parent, const WFitParams *fp); -extern WRegion *panews_load(WWindow *par, const WFitParams *fp, ExtlTab tab); - -/* Dynfun implementations */ - -extern bool panews_managed_may_destroy(WPaneWS *ws, WRegion *reg); -extern void panews_managed_remove(WPaneWS *ws, WRegion *reg); -extern bool panews_managed_add(WPaneWS *ws, WRegion *reg); -extern WRegion *panews_managed_control_focus(WPaneWS *ws, WRegion *reg); - -extern ExtlTab panews_get_configuration(WPaneWS *ws); -extern WRegion *panews_load(WWindow *par, const WFitParams *fp, ExtlTab tab); - -#endif /* ION_PANEWS_PANEWS_H */ diff --git a/mod_panews/placement.c b/mod_panews/placement.c deleted file mode 100644 index 73e2690..0000000 --- a/mod_panews/placement.c +++ /dev/null @@ -1,320 +0,0 @@ -/* - * ion/mod_panews/placement.h - * - * Copyright (c) Tuomo Valkonen 1999-2006. - * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - */ - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "placement.h" -#include "panews.h" -#include "splitext.h" -#include "unusedwin.h" - - -WHook *panews_init_layout_alt=NULL; -WHook *panews_make_placement_alt=NULL; - - -/*{{{ create_frame_for */ - - -static WFrame *create_frame_for(WPaneWS *ws, WRegion *reg) -{ - WWindow *par=REGION_PARENT(ws); - WFitParams fp; - WRectangle mg; - WFrame *frame; - - if(par==NULL) - return NULL; - - fp.g=REGION_GEOM(ws); - fp.mode=REGION_FIT_BOUNDS; - - frame=(WFrame*)ws->tiling.create_frame_fn(par, &fp); - - if(frame==NULL) - return NULL; - - frame->flags|=FRAME_DEST_EMPTY; - - mplex_managed_geom((WMPlex*)frame, &mg); - - fp.g.w=REGION_GEOM(reg).w+(REGION_GEOM(frame).w-mg.w); - fp.g.h=REGION_GEOM(reg).h+(REGION_GEOM(frame).h-mg.h); - fp.mode=REGION_FIT_EXACT; - - region_fitrep((WRegion*)frame, NULL, &fp); - - return (WFrame*)frame; -} - - -/*}}}*/ - - -/*{{{ Placement scan */ - - -static bool mrsh_layout_extl(ExtlFn fn, WPaneWSPlacementParams *p) -{ - ExtlTab t=extl_create_table(); - bool ret=FALSE; - - extl_table_sets_o(t, "ws", (Obj*)p->ws); - extl_table_sets_o(t, "frame", (Obj*)p->frame); - extl_table_sets_o(t, "reg", (Obj*)p->reg); - extl_table_sets_o(t, "specifier", (Obj*)p->specifier); - - extl_protect(NULL); - extl_call(fn, "t", "b", t, &ret); - extl_unprotect(NULL); - - if(ret){ - ret=FALSE; - - extl_table_gets_i(t, "res_w", &(p->res_w)); - extl_table_gets_i(t, "res_h", &(p->res_h)); - - if(extl_table_gets_o(t, "res_node", (Obj**)&(p->res_node))){ - if(OBJ_IS(p->res_node, WSplitUnused)){ - if(!extl_table_gets_t(t, "res_config", &(p->res_config))){ - warn(TR("Malfunctioning placement hook; condition #%d."), 1); - goto err; - } - }else if(!OBJ_IS(p->res_node, WSplitRegion)){ - warn(TR("Malfunctioning placement hook; condition #%d."), 2); - goto err; - } - } - } - - extl_unref_table(t); - - return ret; - -err: - p->res_node=NULL; - extl_unref_table(t); - return FALSE; -} - - -static bool plainregionfilter(WSplit *node) -{ - return (strcmp(OBJ_TYPESTR(node), "WSplitRegion")==0); -} - - -static bool fallback_filter(WSplit *node) -{ - return (OBJ_IS(node, WSplitUnused) || plainregionfilter(node)); -} - - -static bool fallback_layout(WPaneWSPlacementParams *p) -{ - if(p->ws->tiling.split_tree==NULL) - return FALSE; - - if(p->specifier!=NULL){ - p->res_node=(WSplit*)p->specifier; - }else{ - p->res_node=split_current_todir(p->ws->tiling.split_tree, SPLIT_ANY, - PRIMN_ANY, fallback_filter); - } - - if(p->res_node!=NULL && OBJ_IS(p->res_node, WSplitUnused)){ - p->res_config=extl_create_table(); - if(p->res_config==extl_table_none() || p->frame==NULL) - return FALSE; - extl_table_sets_o(p->res_config, "reg", (Obj*)(p->frame)); - } - - return (p->res_node!=NULL); -} - - -/*}}}*/ - - -/*{{{ Split/replace unused code */ - - -static bool do_replace(WPaneWS *ws, WFrame *frame, WRegion *reg, - WPaneWSPlacementParams *rs) -{ - WSplit *u=rs->res_node; - WSplit *node=tiling_load_node(&(ws->tiling), &(u->geom), rs->res_config); - - assert(OBJ_IS(u, WSplitUnused)); - - if(node==NULL){ - warn(TR("Malfunctioning placement hook; condition #%d."), 3); - return FALSE; - } - - if(REGION_MANAGER(frame)!=(WRegion*)ws){ - warn(TR("Malfunctioning placement hook; condition #%d."), 4); - destroy_obj((Obj*)node); - return FALSE; - } - - if(u->parent!=NULL) - splitinner_replace(u->parent, u, node); - else - splittree_changeroot((WSplit*)u, node); - - u->parent=NULL; - mainloop_defer_destroy((Obj*)u); - - if(ws->tiling.stdispnode!=NULL) - split_regularise_stdisp(ws->tiling.stdispnode); - - if(ws->tiling.split_tree!=NULL) - split_restack(ws->tiling.split_tree, ws->tiling.dummywin, Above); - - return TRUE; -} - -/*}}}*/ - - -/*{{{ The main dynfun */ - - -static bool current_unused(WPaneWS *ws) -{ - return OBJ_IS(tiling_current(&ws->tiling), WUnusedWin); -} - - -static WRegion *panews_get_target(WPaneWS *ws, WSplitUnused *specifier, - WRegion *reg) -{ - WRegion *target=NULL; - WFrame *frame=create_frame_for(ws, reg); - WSplit **tree=&(ws->tiling.split_tree); - WPaneWSPlacementParams rs; - - assert(ws->tiling.split_tree!=NULL); - - rs.ws=ws; - rs.frame=frame; - rs.reg=reg; - rs.specifier=specifier; - rs.res_node=NULL; - rs.res_config=extl_table_none(); - rs.res_w=-1; - rs.res_h=-1; - - if(frame!=NULL){ - split_update_bounds(*tree, TRUE); - - assert(panews_make_placement_alt!=NULL); - - hook_call_p(panews_make_placement_alt, &rs, - (WHookMarshallExtl*)mrsh_layout_extl); - } - - if(rs.res_node==NULL && specifier==NULL) - fallback_layout(&rs); - - if(rs.res_node!=NULL){ - /* Resize */ - if(rs.res_w>0 || rs.res_h>0){ - WRectangle grq=rs.res_node->geom; - int gflags=REGION_RQGEOM_WEAK_ALL; - - if(rs.res_w>0){ - grq.w=rs.res_w; - gflags&=~REGION_RQGEOM_WEAK_W; - } - - if(rs.res_h>0){ - grq.h=rs.res_h; - gflags&=~REGION_RQGEOM_WEAK_H; - } - - splittree_rqgeom(rs.res_node, gflags, &grq, NULL); - } - - if(OBJ_IS(rs.res_node, WSplitUnused)){ - if(frame!=NULL){ - if(do_replace(ws, frame, reg, &rs)) - target=(WRegion*)frame; - } - }else{ - assert(OBJ_IS(rs.res_node, WSplitRegion)); - target=((WSplitRegion*)rs.res_node)->reg; - } - - extl_unref_table(rs.res_config); - } - - if(frame!=NULL && target!=(WRegion*)frame) - destroy_obj((Obj*)frame); - - if(target!=NULL && current_unused(ws)) - region_goto(target); - - return target; -} - - -WPHolder *panews_prepare_manage(WPaneWS *ws, const WClientWin *cwin, - const WManageParams *param, int redir) -{ - WRegion *target=panews_get_target(ws, NULL, (WRegion*)cwin); - WPHolder *ph; - - if(target!=NULL){ - ph=region_prepare_manage(target, cwin, param, MANAGE_REDIR_PREFER_YES); - if(ph!=NULL) - return ph; - } - - warn(TR("Ooops... could not find a region to attach client window to " - "on workspace %s."), region_name((WRegion*)ws)); - return NULL; -} - - -bool panews_handle_unused_drop(WPaneWS *ws, WSplitUnused *specifier, - WRegion *reg) -{ - WRegion *target=panews_get_target(ws, specifier, reg); - - if(target==NULL || !OBJ_IS(target, WMPlex)) - return FALSE; - - return (mplex_attach_simple((WMPlex*)target, reg, - MPLEX_ATTACH_SWITCHTO)!=NULL); -} - - -/*}}}*/ - diff --git a/mod_panews/placement.h b/mod_panews/placement.h deleted file mode 100644 index 23dd9fe..0000000 --- a/mod_panews/placement.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * ion/mod_panews/placement.h - * - * Copyright (c) Tuomo Valkonen 1999-2006. - * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - */ - -#ifndef ION_MOD_PANEWS_PLACEMENT_H -#define ION_MOD_PANEWS_PLACEMENT_H - -#include -#include -#include -#include -#include -#include -#include "panews.h" -#include "splitext.h" - - -typedef struct{ - WPaneWS *ws; - ExtlTab layout; -} WPaneWSInitParams; - - -typedef struct{ - WPaneWS *ws; - WFrame *frame; - WRegion *reg; - WSplitUnused *specifier; - - WSplit *res_node; - ExtlTab res_config; - int res_w, res_h; -} WPaneWSPlacementParams; - - -/* Handlers of this hook should accept WPaneWSInitParams as parameter. */ -extern WHook *panews_init_layout_alt; -/* Handlers of this hook should accept WPaneWSPlacementParams as parameter. */ -extern WHook *panews_make_placement_alt; - - -extern WPHolder *panews_prepare_manage(WPaneWS *ws, const WClientWin *cwin, - const WManageParams *param, - int redir); -extern bool panews_handle_unused_drop(WPaneWS *ws, WSplitUnused *specifier, - WRegion *reg); - -#endif /* ION_MOD_PANEWS_PLACEMENT_H */ diff --git a/mod_panews/splitext.c b/mod_panews/splitext.c deleted file mode 100644 index ad392c5..0000000 --- a/mod_panews/splitext.c +++ /dev/null @@ -1,617 +0,0 @@ -/* - * ion/panews/splitext.c - * - * Copyright (c) Tuomo Valkonen 1999-2006. - * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "splitext.h" -#include "unusedwin.h" - - -#define GEOM(X) (((WSplit*)(X))->geom) - - -/*{{{ Init/deinit */ - - -bool splitunused_init(WSplitUnused *split, const WRectangle *geom, - WPaneWS *ws) -{ - WWindow *par=REGION_PARENT(ws); - WUnusedWin *uwin; - WFitParams fp; - - assert(par!=NULL); - - fp.g=*geom; - fp.mode=REGION_FIT_EXACT; - - uwin=create_unusedwin(par, &fp); - - if(uwin==NULL) - return FALSE; - - if(!splitregion_init(&(split->regnode), geom, (WRegion*)uwin)){ - destroy_obj((Obj*)uwin); - return FALSE; - } - - if(!tiling_managed_add(&ws->tiling, (WRegion*)uwin)){ - split->regnode.reg=NULL; - destroy_obj((Obj*)uwin); - return FALSE; - } - - return TRUE; -} - - -WSplitUnused *create_splitunused(const WRectangle *geom, WPaneWS *ws) -{ - CREATEOBJ_IMPL(WSplitUnused, splitunused, (p, geom, ws)); -} - - -bool splitpane_init(WSplitPane *pane, const WRectangle *geom, WSplit *cnt) -{ - pane->contents=cnt; - pane->marker=NULL; - - if(!splitinner_init(&(pane->isplit), geom)) - return FALSE; - - return TRUE; -} - - -WSplitPane *create_splitpane(const WRectangle *geom, WSplit *cnt) -{ - CREATEOBJ_IMPL(WSplitPane, splitpane, (p, geom, cnt)); -} - - -void splitunused_deinit(WSplitUnused *split) -{ - if(split->regnode.reg!=NULL){ - destroy_obj((Obj*)split->regnode.reg); - split->regnode.reg=NULL; - } - - splitregion_deinit(&(split->regnode)); -} - - -void splitpane_deinit(WSplitPane *split) -{ - if(split->contents!=NULL){ - WSplit *tmp=split->contents; - split->contents=NULL; - tmp->parent=NULL; - destroy_obj((Obj*)tmp); - } - splitinner_deinit(&(split->isplit)); -} - - -/*}}}*/ - - -/*{{{ X window handling */ - - -static void splitpane_stacking(WSplitPane *pane, - Window *bottomret, Window *topret) -{ - - *bottomret=None; - *topret=None; - - if(pane->contents!=NULL) - split_stacking(pane->contents, bottomret, topret); -} - - -static void splitpane_restack(WSplitPane *pane, Window other, int mode) -{ - if(pane->contents!=None) - split_restack(pane->contents, other, mode); -} - - -static void stack_restack_reg(WRegion *reg, Window *other, int *mode) -{ - Window b=None, t=None; - - if(reg!=NULL){ - region_restack(reg, *other, *mode); - region_stacking(reg, &b, &t); - if(t!=None){ - *other=t; - *mode=Above; - } - } -} - - -static void stack_restack_split(WSplit *split, Window *other, int *mode) -{ - Window b=None, t=None; - - if(split!=NULL){ - split_restack(split, *other, *mode); - split_stacking(split, &b, &t); - if(t!=None){ - *other=t; - *mode=Above; - } - } -} - - -static void splitpane_reparent(WSplitPane *pane, WWindow *target) -{ - if(pane->contents!=NULL) - split_reparent(pane->contents, target); -} - - -static void reparentreg(WRegion *reg, WWindow *target) -{ - WRectangle g=REGION_GEOM(reg); - region_reparent(reg, target, &g, REGION_FIT_EXACT); -} - - -/*}}}*/ - - -/*{{{ Geometry */ - - -static void set_unused_bounds(WSplit *node) -{ - node->min_w=0; - node->min_h=0; - node->max_w=INT_MAX; - node->max_h=INT_MAX; - node->unused_w=node->geom.w; - node->unused_h=node->geom.h; -} - - -static void copy_bounds(WSplit *dst, const WSplit *src) -{ - dst->min_w=src->min_w; - dst->min_h=src->min_h; - dst->max_w=src->max_w; - dst->max_h=src->max_h; - dst->unused_w=src->unused_w; - dst->unused_h=src->unused_h; -} - - -static void splitunused_update_bounds(WSplitUnused *node, bool recursive) -{ - set_unused_bounds((WSplit*)node); -} - - -static void splitpane_update_bounds(WSplitPane *node, bool recursive) -{ - if(node->contents!=NULL){ - if(recursive) - split_update_bounds(node->contents, recursive); - copy_bounds((WSplit*)node, node->contents); - }else{ - set_unused_bounds((WSplit*)node); - } -} - - -static int infadd(int x, int y) -{ - return ((x==INT_MAX || y==INT_MAX) ? INT_MAX : (x+y)); -} - - -static void splitpane_do_resize(WSplitPane *pane, const WRectangle *ng, - int hprimn, int vprimn, bool transpose) -{ - if(transpose && pane->marker!=NULL){ - char *growdir=strchr(pane->marker, ':'); - if(growdir!=NULL){ - const char *newdir=NULL; - growdir++; - - if(strcmp(growdir, "right")==0) - newdir="down"; - else if(strcmp(growdir, "left")==0) - newdir="up"; - if(strcmp(growdir, "down")==0) - newdir="right"; - else if(strcmp(growdir, "up")==0) - newdir="left"; - - if(newdir!=NULL){ - char *newmarker=NULL; - *growdir='\0'; - libtu_asprintf(&newmarker, "%s:%s", pane->marker, newdir); - if(newmarker==NULL){ - *growdir=':'; - }else{ - free(pane->marker); - pane->marker=newmarker; - } - } - } - - } - - ((WSplit*)pane)->geom=*ng; - - if(pane->contents!=NULL) - split_do_resize(pane->contents, ng, hprimn, vprimn, transpose); -} - - -static void splitpane_do_rqsize(WSplitPane *pane, WSplit *node, - RootwardAmount *ha, RootwardAmount *va, - WRectangle *rg, bool tryonly) -{ - WSplitInner *par=((WSplit*)pane)->parent; - - if(par!=NULL){ - splitinner_do_rqsize(par, (WSplit*)pane, ha, va, rg, tryonly); - if(!tryonly) - ((WSplit*)pane)->geom=*rg; - }else{ - *rg=GEOM(pane); - } -} - - -/*}}}*/ - - -/*{{{ Tree manipulation */ - - -static void splitpane_replace(WSplitPane *pane, WSplit *child, WSplit *what) -{ - assert(child==pane->contents && what!=NULL); - - child->parent=NULL; - pane->contents=what; - what->parent=(WSplitInner*)pane; - what->ws_if_root=NULL; /* May not be needed */ -} - - -static WPaneWS *find_ws(WSplit *split) -{ - if(split->parent!=NULL) - return find_ws((WSplit*)split->parent); - - if(split->ws_if_root!=NULL) - return OBJ_CAST(split->ws_if_root, WPaneWS); - - return NULL; -} - - -static void splitpane_remove(WSplitPane *pane, WSplit *child, - bool reclaim_space) -{ - WSplitInner *parent=((WSplit*)pane)->parent; - WSplitUnused *un; - WPaneWS *ws=find_ws((WSplit*)pane); - - assert(child==pane->contents); - - pane->contents=NULL; - child->parent=NULL; - - if(ws!=NULL - && !OBJ_IS_BEING_DESTROYED(ws) - && !OBJ_IS_BEING_DESTROYED(pane)){ - pane->contents=(WSplit*)create_splitunused(&GEOM(pane), ws); - if(pane->contents!=NULL){ - pane->contents->parent=(WSplitInner*)pane; - return; - } - } - - if(parent!=NULL) - splitinner_remove(parent, (WSplit*)pane, reclaim_space); - else - splittree_changeroot((WSplit*)pane, NULL); - - destroy_obj((Obj*)pane); -} - - -/*}}}*/ - - -/*{{{ Tree traversal */ - - -static bool filter_any(WSplit *split) -{ - return OBJ_IS(split, WSplitRegion); -} - - -static bool filter_no_unused(WSplit *split) -{ - return (OBJ_IS(split, WSplitRegion) - && !OBJ_IS(split, WSplitUnused)); -} - - -static bool filter_no_stdisp(WSplit *split) -{ - return (OBJ_IS(split, WSplitRegion) - && !OBJ_IS(split, WSplitST)); -} - - -static bool filter_no_stdisp_unused(WSplit *split) -{ - return (OBJ_IS(split, WSplitRegion) - && !OBJ_IS(split, WSplitST) - && !OBJ_IS(split, WSplitUnused)); - -} - - -static WSplit *splitpane_current_todir(WSplitPane *pane, int dir, int primn, - WSplitFilter *filter) -{ - WSplit *ret=NULL; - - if(pane->contents==NULL) - return NULL; - - /* Try non-unused first */ - if(filter==filter_no_stdisp){ - ret=split_current_todir(pane->contents, dir, primn, - filter_no_stdisp_unused); - }else if(filter==filter_any){ - ret=split_current_todir(pane->contents, dir, primn, - filter_no_unused); - } - - if(ret==NULL) - ret=split_current_todir(pane->contents, dir, primn, filter); - - return ret; -} - - -static void splitpane_forall(WSplitPane *pane, WSplitFn *fn) -{ - if(pane->contents!=NULL) - fn(pane->contents); -} - - -static WSplit *splitpane_current(WSplitPane *pane) -{ - return pane->contents; -} - - -static WSplitRegion *get_node_check(WPaneWS *ws, WRegion *reg) -{ - WSplitRegion *node; - - if(reg==NULL) - return NULL; - - node=splittree_node_of(reg); - - if(node==NULL || REGION_MANAGER(reg)!=(WRegion*)ws) - return NULL; - - return node; -} - - -static WSplitRegion *do_get_nextto(WSplit *node, int dir, int primn, - bool any, bool paneonly) -{ - WSplitFilter *filter=(any ? filter_no_unused : filter_no_stdisp_unused); - WSplit *nextto=NULL; - - while(node->parent!=NULL){ - if(OBJ_IS(node, WSplitPane)){ - if(paneonly) - break; - filter=(any ? filter_any : filter_no_stdisp); - } - nextto=splitinner_nextto(node->parent, node, dir, primn, filter); - if(nextto!=NULL) - break; - node=(WSplit*)(node->parent); - } - - if(OBJ_IS(nextto, WSplitRegion)) - return (WSplitRegion*)nextto; - return NULL; -} - - -WRegion *panews_do_get_nextto(WPaneWS *ws, WRegion *reg, - int dir, int primn, bool any) -{ - WSplitRegion *node=get_node_check(ws, reg), *nextto=NULL; - - if(node==NULL) - return NULL; - - nextto=do_get_nextto((WSplit*)node, dir, primn, TRUE, FALSE); - - if(nextto!=NULL) - return nextto->reg; - - return NULL; -} - -WRegion *panews_do_get_farthest(WPaneWS *ws, - int dir, int primn, bool any) -{ - WSplitFilter *filter=(any ? filter_any : filter_no_stdisp); - WSplit *node=NULL; - if(ws->tiling.split_tree!=NULL) - node=split_current_todir(ws->tiling.split_tree, dir, primn, filter); - if(node!=NULL && OBJ_IS(node, WSplitRegion)) - return ((WSplitRegion*)node)->reg; - return NULL; -} - - -WSplitRegion *split_tree_find_region_in_pane_of(WSplit *node) -{ - return do_get_nextto(node, SPLIT_ANY, PRIMN_ANY, FALSE, TRUE); -} - - -/*}}}*/ - - -/*{{{ Markers and other exports */ - - -/*EXTL_DOC - * Get marker. - */ -EXTL_SAFE -EXTL_EXPORT_MEMBER -const char *splitpane_marker(WSplitPane *pane) -{ - return pane->marker; -} - - -/*EXTL_DOC - * Set marker. - */ -EXTL_EXPORT_MEMBER -bool splitpane_set_marker(WSplitPane *pane, const char *s) -{ - char *s2=NULL; - - if(s!=NULL){ - s2=scopy(s); - if(s2==NULL) - return FALSE; - } - - if(pane->marker==NULL) - free(pane->marker); - - pane->marker=s2; - - return TRUE; -} - - -/*EXTL_DOC - * Get root of contained sub-split tree. - */ -EXTL_SAFE -EXTL_EXPORT_MEMBER -WSplit *splitpane_contents(WSplitPane *pane) -{ - return pane->contents; -} - - -/*}}}*/ - - -/*{{{ Save support */ - - -static bool splitunused_get_config(WSplitUnused *node, ExtlTab *ret) -{ - *ret=split_base_config((WSplit*)node); - return TRUE; -} - - -static bool splitpane_get_config(WSplitPane *pane, ExtlTab *ret) -{ - *ret=split_base_config((WSplit*)pane); - - if(pane->contents!=NULL){ - ExtlTab t; - if(!split_get_config(pane->contents, &t)){ - extl_unref_table(*ret); - return FALSE; - } - extl_table_sets_t(*ret, "contents", t); - extl_unref_table(t); - } - - extl_table_sets_s(*ret, "marker", pane->marker); - - return TRUE; -} - - -/*}}}*/ - - -/*{{{ The classes */ - - -static DynFunTab splitunused_dynfuntab[]={ - {split_update_bounds, splitunused_update_bounds}, - {(DynFun*)split_get_config, (DynFun*)splitunused_get_config}, - END_DYNFUNTAB, -}; - - -static DynFunTab splitpane_dynfuntab[]={ - {split_update_bounds, splitpane_update_bounds}, - {split_do_resize, splitpane_do_resize}, - {splitinner_do_rqsize, splitpane_do_rqsize}, - {splitinner_replace, splitpane_replace}, - {splitinner_remove, splitpane_remove}, - {(DynFun*)split_current_todir, (DynFun*)splitpane_current_todir}, - {(DynFun*)splitinner_current, (DynFun*)splitpane_current}, - {(DynFun*)split_get_config, (DynFun*)splitpane_get_config}, - {splitinner_forall, splitpane_forall}, - {split_stacking, splitpane_stacking}, - {split_restack, splitpane_restack}, - {split_reparent, splitpane_reparent}, - END_DYNFUNTAB, -}; - - -EXTL_EXPORT -IMPLCLASS(WSplitUnused, WSplitRegion, splitunused_deinit, splitunused_dynfuntab); - -EXTL_EXPORT -IMPLCLASS(WSplitPane, WSplitInner, splitpane_deinit, splitpane_dynfuntab); - - -/*}}}*/ - diff --git a/mod_panews/splitext.h b/mod_panews/splitext.h deleted file mode 100644 index 0bc73e3..0000000 --- a/mod_panews/splitext.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * ion/panews/splitext.h - * - * Copyright (c) Tuomo Valkonen 1999-2006. - * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - */ - -#ifndef ION_PANEWS_SPLITEXT_H -#define ION_PANEWS_SPLITEXT_H - -#include -#include - -INTRCLASS(WSplitUnused); -INTRCLASS(WSplitPane); - -#include "panews.h" - -DECLCLASS(WSplitUnused){ - WSplitRegion regnode; -}; - -DECLCLASS(WSplitPane){ - WSplitInner isplit; - WSplit *contents; - char *marker; -}; - -extern bool splitunused_init(WSplitUnused *split, const WRectangle *geom, - WPaneWS *ws); -extern bool splitpane_init(WSplitPane *split, const WRectangle *geom, - WSplit *cnt); - -extern WSplitUnused *create_splitunused(const WRectangle *geom, - WPaneWS *ws); -extern WSplitPane *create_splitpane(const WRectangle *geom, WSplit *cnt); - -extern void splitunused_deinit(WSplitUnused *split); -extern void splitpane_deinit(WSplitPane *split); - -extern const char *splitpane_get_marker(WSplitPane *pane); -extern bool splitpane_set_marker(WSplitPane *pane, const char *s); - -extern WRegion *panews_do_get_nextto(WPaneWS *ws, WRegion *reg, - int dir, int primn, bool any); -extern WRegion *panews_do_get_farthest(WPaneWS *ws, - int dir, int primn, bool any); - -extern WSplitRegion *split_tree_find_region_in_pane_of(WSplit *node); - -#endif /* ION_PANEWS_SPLITEXT_H */ diff --git a/mod_panews/unusedwin.c b/mod_panews/unusedwin.c deleted file mode 100644 index 7e030f0..0000000 --- a/mod_panews/unusedwin.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - * ion/panews/unusedwin.c - * - * Copyright (c) Tuomo Valkonen 1999-2006. - * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "unusedwin.h" -#include "splitext.h" -#include "placement.h" -#include "main.h" - - -/*{{{ Init/deinit */ - - -static void unusedwin_getbrush(WUnusedWin *uwin) -{ - GrBrush *brush=gr_get_brush(uwin->wwin.win, - region_rootwin_of((WRegion*)uwin), - "frame-tiled-panews-unused"); - - if(brush!=NULL){ - if(uwin->brush!=NULL) - grbrush_release(uwin->brush); - - uwin->brush=brush; - - grbrush_enable_transparency(brush, GR_TRANSPARENCY_YES); - } -} - - -bool unusedwin_init(WUnusedWin *uwin, WWindow *parent, const WFitParams *fp) -{ - uwin->brush=NULL; - - if(!window_init(&(uwin->wwin), parent, fp)) - return FALSE; - - unusedwin_getbrush(uwin); - - region_add_bindmap((WRegion*)uwin, mod_panews_unusedwin_bindmap); - - window_select_input(&(uwin->wwin), IONCORE_EVENTMASK_NORMAL); - - ((WRegion*)uwin)->flags|=REGION_PLEASE_WARP; - - return TRUE; -} - - -WUnusedWin *create_unusedwin(WWindow *parent, const WFitParams *fp) -{ - CREATEOBJ_IMPL(WUnusedWin, unusedwin, (p, parent, fp)); -} - - -void unusedwin_deinit(WUnusedWin *uwin) -{ - if(uwin->brush!=NULL){ - grbrush_release(uwin->brush); - uwin->brush=NULL; - } - - window_deinit(&(uwin->wwin)); -} - - -/*}}}*/ - - -/*{{{ unusedwin_press */ - - -static void unusedwin_border_inner_geom(const WUnusedWin *uwin, - WRectangle *geom) -{ - GrBorderWidths bdw; - - geom->x=0; - geom->y=0; - geom->w=REGION_GEOM(uwin).w; - geom->h=REGION_GEOM(uwin).h; - - if(uwin->brush!=NULL){ - grbrush_get_border_widths(uwin->brush, &bdw); - - geom->x+=bdw.left; - geom->y+=bdw.top; - geom->w-=bdw.left+bdw.right; - geom->h-=bdw.top+bdw.bottom; - } - - geom->w=maxof(geom->w, 0); - geom->h=maxof(geom->h, 0); -} - - -static int unusedwin_press(WUnusedWin *uwin, XButtonEvent *ev, - WRegion **reg_ret) -{ - WRectangle g; - - *reg_ret=NULL; - - window_p_resize_prepare(&uwin->wwin, ev); - - /* Check border */ - - unusedwin_border_inner_geom(uwin, &g); - - if(rectangle_contains(&g, ev->x, ev->y)) - return FRAME_AREA_CLIENT; - - return FRAME_AREA_BORDER; -} - - -/*}}}*/ - - -/*{{{ unusedwin_handle_drop */ - - -static bool unusedwin_handle_drop(WUnusedWin *uwin, int x, int y, - WRegion *dropped) -{ - WSplitUnused *us=OBJ_CAST(splittree_node_of((WRegion*)uwin), - WSplitUnused); - WPaneWS *ws=REGION_MANAGER_CHK(uwin, WPaneWS); - - if(us==NULL || ws==NULL) - return FALSE; - - return panews_handle_unused_drop(ws, us, dropped); -} - - -/*}}}*/ - - -/*{{{ Drawing */ - - -static void unusedwin_updategr(WUnusedWin *uwin) -{ - unusedwin_getbrush(uwin); - region_updategr_default((WRegion*)uwin); -} - - -static void unusedwin_draw(WUnusedWin *uwin, bool complete) -{ - WRectangle g; - const char *substyle=(REGION_IS_ACTIVE(uwin) - ? "active" - : "inactive"); - - if(uwin->brush==NULL) - return; - - g.x=0; - g.y=0; - g.w=REGION_GEOM(uwin).w; - g.h=REGION_GEOM(uwin).h; - - grbrush_begin(uwin->brush, &g, (complete ? 0 : GRBRUSH_NO_CLEAR_OK)); - - grbrush_draw_border(uwin->brush, &g, substyle); - - grbrush_end(uwin->brush); -} - - -/*}}}*/ - - -/*{{{ The class */ - - -static DynFunTab unusedwin_dynfuntab[]={ - {region_updategr, unusedwin_updategr}, - {window_draw, unusedwin_draw}, - {(DynFun*)window_press, (DynFun*)unusedwin_press}, - {(DynFun*)region_handle_drop, (DynFun*)unusedwin_handle_drop}, - END_DYNFUNTAB, -}; - - -IMPLCLASS(WUnusedWin, WWindow, unusedwin_deinit, unusedwin_dynfuntab); - - -/*}}}*/ - diff --git a/mod_panews/unusedwin.h b/mod_panews/unusedwin.h deleted file mode 100644 index bcdc5ba..0000000 --- a/mod_panews/unusedwin.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * ion/panews/unusedwin.h - * - * Copyright (c) Tuomo Valkonen 1999-2006. - * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - */ - -#ifndef ION_PANEWS_UNUSEDWIN_H -#define ION_PANEWS_UNUSEDWIN_H - -#include -#include - -INTRCLASS(WUnusedWin); - -DECLCLASS(WUnusedWin){ - WWindow wwin; - GrBrush *brush; -}; - -extern bool unusedwin_init(WUnusedWin *pwin, - WWindow *parent, const WFitParams *fp); -extern WUnusedWin *create_unusedwin(WWindow *parent, const WFitParams *fp); - -#endif /* ION_PANEWS_UNUSEDWIN_H */ diff --git a/mod_query/complete.c b/mod_query/complete.c index 0bc2df3..87cd934 100644 --- a/mod_query/complete.c +++ b/mod_query/complete.c @@ -1,7 +1,7 @@ /* * ion/mod_query/complete.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/complete.h b/mod_query/complete.h index f7aa910..d9c9773 100644 --- a/mod_query/complete.h +++ b/mod_query/complete.h @@ -1,7 +1,7 @@ /* * ion/mod_query/complete.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/edln.c b/mod_query/edln.c index 99283f4..911dee7 100644 --- a/mod_query/edln.c +++ b/mod_query/edln.c @@ -1,7 +1,7 @@ /* * ion/mod_query/edln.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -644,10 +644,10 @@ static int search(Edln *edln, int from, bool bwd, bool match) char *tmpstr=history_search_str(edln); if(tmpstr==NULL) return edln->histent; - e=mod_query_history_search(tmpstr, from, bwd); + e=mod_query_history_search(tmpstr, from, bwd, FALSE); free(tmpstr); }else{ - e=mod_query_history_search(edln->context, from, bwd); + e=mod_query_history_search(edln->context, from, bwd, FALSE); } return e; diff --git a/mod_query/edln.h b/mod_query/edln.h index 9d95de5..ea00f6f 100644 --- a/mod_query/edln.h +++ b/mod_query/edln.h @@ -1,7 +1,7 @@ /* * ion/mod_query/edln.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/fwarn.c b/mod_query/fwarn.c index 7280f85..e10d277 100644 --- a/mod_query/fwarn.c +++ b/mod_query/fwarn.c @@ -1,7 +1,7 @@ /* * ion/mod_query/query.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/fwarn.h b/mod_query/fwarn.h index 6dfee37..6e91a64 100644 --- a/mod_query/fwarn.h +++ b/mod_query/fwarn.h @@ -1,7 +1,7 @@ /* * ion/mod_query/fwarn.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/history.c b/mod_query/history.c index 05b6aa5..168f606 100644 --- a/mod_query/history.c +++ b/mod_query/history.c @@ -1,7 +1,7 @@ /* * ion/mod_query/history.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -52,9 +52,10 @@ bool mod_query_history_push(const char *str) void mod_query_history_push_(char *str) { - int ndx=mod_query_history_search(str, 0, FALSE); + int ndx=mod_query_history_search(str, 0, FALSE, TRUE); if(ndx==0){ + free(str); return; /* First entry already */ }else if(ndx>0){ int i, j; @@ -110,7 +111,7 @@ void mod_query_history_clear() -static bool match(const char *h, const char *b) +static bool match(const char *h, const char *b, bool exact) { const char *h_; @@ -124,8 +125,10 @@ static bool match(const char *h, const char *b) if(h_!=NULL) h=h_+1; } - - return (strncmp(h, b, strlen(b))==0); + + return (exact + ? strcmp(h, b)==0 + : strncmp(h, b, strlen(b))==0); } @@ -140,17 +143,18 @@ static const char *skip_colon(const char *s) * Try to find matching history entry. Returns -1 if none was * found. The parameter \var{from} specifies where to start * searching from, and \var{bwd} causes backward search from - * that point. + * that point. If \var{exact} is not set, \var{s} only required + * to be a prefix of the match. */ EXTL_SAFE EXTL_EXPORT -int mod_query_history_search(const char *s, int from, bool bwd) +int mod_query_history_search(const char *s, int from, bool bwd, bool exact) { while(1){ int i=get_index(from); if(i<0) return -1; - if(match(hist[i], s)) + if(match(hist[i], s, exact)) return from; if(bwd) from--; @@ -172,7 +176,7 @@ uint mod_query_history_complete(const char *s, char ***h_ret) int j=get_index(i); if(j<0) break; - if(match(hist[j], s)){ + if(match(hist[j], s, FALSE)){ h[n]=scopy(skip_colon(hist[j])); if(h[n]!=NULL) n++; diff --git a/mod_query/history.h b/mod_query/history.h index 005d62e..f27be88 100644 --- a/mod_query/history.h +++ b/mod_query/history.h @@ -1,7 +1,7 @@ /* * ion/mod_query/history.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -19,7 +19,8 @@ extern const char *mod_query_history_get(int n); extern bool mod_query_history_push(const char *s); extern void mod_query_history_push_(char *s); extern void mod_query_history_clear(); -extern int mod_query_history_search(const char *s, int from, bool bwd); +extern int mod_query_history_search(const char *s, int from, bool bwd, + bool exact); extern uint mod_query_history_complete(const char *s, char ***h_ret); extern ExtlTab mod_query_history_table(); diff --git a/mod_query/input.c b/mod_query/input.c index ee19026..7f8ac99 100644 --- a/mod_query/input.c +++ b/mod_query/input.c @@ -1,7 +1,7 @@ /* * ion/mod_query/input.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -162,7 +162,7 @@ EXTL_EXPORT_MEMBER void input_cancel(WInput *input) { if(region_manager_allows_destroying((WRegion*)input)) - mainloop_defer_destroy((Obj*)input); + region_dispose_((WRegion*)input); } diff --git a/mod_query/input.h b/mod_query/input.h index 21abf71..4f9f758 100644 --- a/mod_query/input.h +++ b/mod_query/input.h @@ -1,7 +1,7 @@ /* * ion/mod_query/input.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/inputp.h b/mod_query/inputp.h index 1da92b5..d91960f 100644 --- a/mod_query/inputp.h +++ b/mod_query/inputp.h @@ -1,7 +1,7 @@ /* * ion/mod_query/inputp.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/listing.c b/mod_query/listing.c index 9ceb41d..271d17e 100644 --- a/mod_query/listing.c +++ b/mod_query/listing.c @@ -1,7 +1,7 @@ /* * ion/mod_query/listing.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -141,12 +141,12 @@ static void string_calc_parts(GrBrush *brush, int maxw, char *str, static void draw_multirow(GrBrush *brush, int x, int y, int h, char *str, WListingItemInfo *iinf, - int maxw, int ciw, int wrapw, const char *style) + int maxw, int ciw, int wrapw) { int i, l; if(iinf==NULL){ - grbrush_draw_string(brush, x, y, str, strlen(str), TRUE, style); + grbrush_draw_string(brush, x, y, str, strlen(str), TRUE); return; } @@ -158,10 +158,10 @@ static void draw_multirow(GrBrush *brush, int x, int y, int h, l=iinf->part_lens[0]; } - grbrush_draw_string(brush, x, y, str, l, TRUE, style); + grbrush_draw_string(brush, x, y, str, l, TRUE); for(i=1; in_parts; i++){ - grbrush_draw_string(brush, x+maxw-wrapw, y, "\\", 1, TRUE, style); + grbrush_draw_string(brush, x+maxw-wrapw, y, "\\", 1, TRUE); y+=h; str+=l; @@ -171,7 +171,7 @@ static void draw_multirow(GrBrush *brush, int x, int y, int h, } l=iinf->part_lens[i]; - grbrush_draw_string(brush, x, y, str, l, TRUE, style); + grbrush_draw_string(brush, x, y, str, l, TRUE); } } @@ -348,8 +348,7 @@ void init_listing(WListing *l) static void do_draw_listing(GrBrush *brush, const WRectangle *geom, - WListing *l, const char *style, - const char *selstyle) + WListing *l, GrAttr selattr) { int wrapw=grbrush_get_text_width(brush, "\\", 1); int ciw=grbrush_get_text_width(brush, CONT_INDENT, CONT_INDENT_LEN); @@ -372,10 +371,15 @@ static void do_draw_listing(GrBrush *brush, const WRectangle *geom, if(i>=l->nstrs) return; + if(i==l->selected_str) + grbrush_set_attr(brush, selattr); + draw_multirow(brush, geom->x+x, y, l->itemh, l->strs[i], (l->iteminfos!=NULL ? &(l->iteminfos[i]) : NULL), - geom->w-x, ciw, wrapw, - (i==l->selected_str ? selstyle : style)); + geom->w-x, ciw, wrapw); + + if(i==l->selected_str) + grbrush_unset_attr(brush, selattr); y+=l->itemh*ITEMROWS(l, i); r+=ITEMROWS(l, i); @@ -388,18 +392,18 @@ static void do_draw_listing(GrBrush *brush, const WRectangle *geom, void draw_listing(GrBrush *brush, const WRectangle *geom, - WListing *l, bool complete, const char *style, - const char *selstyle) + WListing *l, bool complete, GrAttr selattr) { WRectangle geom2; GrBorderWidths bdw; - - grbrush_begin(brush, geom, GRBRUSH_AMEND|GRBRUSH_NEED_CLIP); - + + grbrush_begin(brush, geom, GRBRUSH_AMEND|GRBRUSH_KEEP_ATTR + |GRBRUSH_NEED_CLIP); + if(complete) grbrush_clear_area(brush, geom); - grbrush_draw_border(brush, geom, style); + grbrush_draw_border(brush, geom); grbrush_get_border_widths(brush, &bdw); @@ -408,7 +412,7 @@ void draw_listing(GrBrush *brush, const WRectangle *geom, geom2.w=geom->w-bdw.left-bdw.right; geom2.h=geom->h-bdw.top-bdw.bottom; - do_draw_listing(brush, &geom2, l, style, selstyle); + do_draw_listing(brush, &geom2, l, selattr); grbrush_end(brush); } diff --git a/mod_query/listing.h b/mod_query/listing.h index 457ec08..b4d10f0 100644 --- a/mod_query/listing.h +++ b/mod_query/listing.h @@ -1,7 +1,7 @@ /* * ion/mod_query/listing.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -41,8 +41,7 @@ extern void setup_listing(WListing *l, char **strs, int nstrs, bool onecol); extern void deinit_listing(WListing *l); extern void fit_listing(GrBrush *brush, const WRectangle *geom, WListing *l); extern void draw_listing(GrBrush *brush, const WRectangle *geom, WListing *l, - bool complete, const char *style, - const char *selstyle); + bool complete, GrAttr selattr); extern bool scrollup_listing(WListing *l); extern bool scrolldown_listing(WListing *l); extern bool listing_select(WListing *l, int i); diff --git a/mod_query/main.c b/mod_query/main.c index 9eb7323..aeef9ae 100644 --- a/mod_query/main.c +++ b/mod_query/main.c @@ -1,7 +1,7 @@ /* * ion/mod_query/main.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -55,7 +55,8 @@ WBindmap *mod_query_wedln_bindmap=NULL; ModQueryConfig mod_query_config={ 250, - TRUE + TRUE, + FALSE }; @@ -68,6 +69,8 @@ ModQueryConfig mod_query_config={ * (default: true). \\ * \var{autoshowcompl_delay} & (integer) auto-show-completions delay * in milliseconds (default: 250). \\ + * \var{caseicompl} & (boolean) Turn some completions case-insensitive + * (default: false). \\ * \end{tabularx} */ EXTL_EXPORT @@ -76,6 +79,7 @@ void mod_query_set(ExtlTab tab) ModQueryConfig *c=&mod_query_config; extl_table_gets_b(tab, "autoshowcompl", &c->autoshowcompl); + extl_table_gets_b(tab, "caseicompl", &c->caseicompl); if(extl_table_gets_i(tab, "autoshowcompl_delay", &c->autoshowcompl_delay)){ @@ -87,6 +91,7 @@ void mod_query_set(ExtlTab tab) * Get module configuration. For more information see * \fnref{mod_query.set}. */ +EXTL_SAFE EXTL_EXPORT ExtlTab mod_query_get() { @@ -94,6 +99,7 @@ ExtlTab mod_query_get() ExtlTab tab=extl_create_table(); extl_table_sets_b(tab, "autoshowcompl", c->autoshowcompl); + extl_table_sets_b(tab, "caseicompl", c->caseicompl); extl_table_sets_i(tab, "autoshowcompl_delay", c->autoshowcompl_delay); return tab; diff --git a/mod_query/main.h b/mod_query/main.h index 2d57b13..0a3f34f 100644 --- a/mod_query/main.h +++ b/mod_query/main.h @@ -1,7 +1,7 @@ /* * ion/mod_query/main.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -20,6 +20,7 @@ INTRSTRUCT(ModQueryConfig); DECLSTRUCT(ModQueryConfig){ int autoshowcompl_delay; bool autoshowcompl; + bool caseicompl; }; diff --git a/mod_query/mod_query.lua b/mod_query/mod_query.lua index 0f51738..243f987 100644 --- a/mod_query/mod_query.lua +++ b/mod_query/mod_query.lua @@ -1,7 +1,7 @@ -- -- ion/query/mod_query.lua -- Some common queries for Ion -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by @@ -31,14 +31,6 @@ local DIE_TIMEOUT_NO_ERRORCODE=2 -- 2 seconds -- Generic helper functions {{{ -function mod_query.make_completor(completefn) - local function completor(cp, str, point) - cp:set_completions(completefn(str, point)) - end - return completor -end - - --DOC -- Low-level query routine. \var{mplex} is the \type{WMPlex} to display -- the query in, \var{prompt} the prompt string, and \var{initvalue} @@ -60,12 +52,13 @@ function mod_query.query(mplex, prompt, initvalue, handler, completor, end -- Check that no other queries are open in the mplex. - local l=mplex:managed_list() - for i, r in pairs(l) do - if obj_is(r, "WEdln") then - return - end + local ok=mplex:managed_i(function(r) + return not obj_is(r, "WEdln") + end) + if not ok then + return end + local wedln=mod_query.do_query(mplex, prompt, initvalue, handle_it, completor, cycle) if context then @@ -175,6 +168,20 @@ function mod_query.file_completor(wedln, str) end +function mod_query.get_initdir(mplex) + --if mod_query.last_dir then + -- return mod_query.last_dir + --end + local wd=(ioncore.get_dir_for(mplex) or os.getenv("PWD")) + if wd==nil then + wd="/" + elseif string.sub(wd, -1)~="/" then + wd=wd .. "/" + end + return wd +end + + function mod_query.query_execfile(mplex, prompt, prog) assert(prog~=nil) local function handle_execwith(mplex, str) @@ -200,39 +207,10 @@ function mod_query.query_execwith(mplex, prompt, dflt, prog, completor, end -function mod_query.get_initdir(mplex) - --if mod_query.last_dir then - -- return mod_query.last_dir - --end - local wd=(ioncore.get_dir_for(mplex) or os.getenv("PWD")) - if wd==nil then - wd="/" - elseif string.sub(wd, -1)~="/" then - wd=wd .. "/" - end - return wd -end - - -local MAXDEPTH=10 - +-- }}} -function mod_query.complete_from_list(list, str) - local results={} - local len=string.len(str) - if len==0 then - results=list - else - for _, m in pairs(list) do - if string.sub(m, 1, len)==str then - table.insert(results, m) - end - end - end - - return results -end +-- Completion helpers {{{ local pipes={} @@ -325,6 +303,85 @@ function mod_query.popen_completions(cp, cmd, fn, reshnd) end +local function mk_completion_test(str, sub_ok, casei_ok) + if not str then + return function(s) return true end + end + + local function mk(str, sub_ok) + if sub_ok then + return function(s) return string.find(s, str, 1, true) end + else + local len=string.len(str) + return function(s) return string.sub(s, 1, len)==str end + end + end + + local casei=(casei_ok and mod_query.get().caseicompl) + + if not casei then + return mk(str, sub_ok) + else + local fn=mk(string.lower(str), sub_ok) + return function(s) return fn(string.lower(s)) end + end +end + + +local function mk_completion_add(entries, str, sub_ok, casei_ok) + local tst=mk_completion_test(str, sub_ok, casei_ok) + + return function(s) + if s and tst(s) then + table.insert(entries, s) + end + end +end + + +function mod_query.complete_keys(list, str, sub_ok, casei_ok) + local results={} + local test_add=mk_completion_add(results, str, sub_ok, casei_ok) + + for m, _ in pairs(list) do + test_add(m) + end + + return results +end + + +function mod_query.complete_name(str, iter) + local sub_ok_first=true + local casei_ok=true + local entries={} + local tst_add=mk_completion_add(entries, str, sub_ok_first, casei_ok) + + iter(function(reg) + tst_add(reg:name()) + return true + end) + + if #entries==0 and not sub_ok_first then + local tst_add2=mk_completion_add(entries, str, true, casei_ok) + iter(function(reg) + tst_add2(reg:name()) + return true + end) + end + + return entries +end + + +function mod_query.make_completor(completefn) + local function completor(cp, str, point) + cp:set_completions(completefn(str, point)) + end + return completor +end + + -- }}} @@ -340,36 +397,24 @@ function mod_query.call_warn(mplex, fn) end -function mod_query.complete_name(str, list) - local entries={} - local l=string.len(str) - for i, reg in pairs(list) do - local nm=reg:name() - if nm and string.sub(nm, 1, l)==str then - table.insert(entries, nm) - end - end - if #entries==0 then - for i, reg in pairs(list) do - local nm=reg:name() - if nm and string.find(nm, str, 1, true) then - table.insert(entries, nm) - end - end - end - return entries -end - function mod_query.complete_clientwin(str) - return mod_query.complete_name(str, ioncore.clientwin_list()) + return mod_query.complete_name(str, ioncore.clientwin_i) end + function mod_query.complete_workspace(str) - return mod_query.complete_name(str, ioncore.region_list("WGroupWS")) + local function iter(fn) + return ioncore.region_i(function(obj) + return (not obj_is(obj, "WGroupWS") + or fn(obj)) + end) + end + return mod_query.complete_name(str, iter) end + function mod_query.complete_region(str) - return mod_query.complete_name(str, ioncore.region_list()) + return mod_query.complete_name(str, ioncore.region_i) end @@ -383,6 +428,7 @@ function mod_query.gotoclient_handler(frame, str) end end + function mod_query.attachclient_handler(frame, str) local cwin=ioncore.lookup_clientwin(str) @@ -423,18 +469,37 @@ function mod_query.workspace_handler(mplex, name) local ws=ioncore.lookup_region(name, "WGroupWS") if ws then ws:goto() - return - end + else + local function create_handler(mplex_, layout) + if not layout or layout=="" then + layout="default" + end + + if not ioncore.getlayout(layout) then + mod_query.warn(mplex_, TR("Unknown layout")) + else + local scr=mplex:screen_of() + + local function mkws() + local tmpl={name=name, switchto=true} + if not ioncore.create_ws(scr, tmpl, layout) then + error(TR("Unknown error")) + end + end - local scr=mplex:screen_of() - - local function mkws() - if not ioncore.create_ws(scr, {name=name}) then - error(TR("Unknown error")) + mod_query.call_warn(mplex, mkws) + end end - end - mod_query.call_warn(mplex, mkws) + local function compl_layout(str) + local los=ioncore.getlayout(nil, true) + return mod_query.complete_keys(los, str, true, true) + end + + mod_query.query(mplex, TR("New workspace layout (default):"), nil, + create_handler, mod_query.make_completor(compl_layout), + "workspacelayout") + end end @@ -504,10 +569,20 @@ end --DOC --- This function asks for a name new for the workspace on which the --- query resides. -function mod_query.query_renameworkspace(mplex) - local ws=ioncore.find_manager(mplex, "WGroupWS") +-- This function asks for a name new for the workspace \var{ws}, +-- or the one on which \var{mplex} resides, if it is not set. +-- If \var{mplex} is not set, one is looked for. +function mod_query.query_renameworkspace(mplex, ws) + if not mplex then + assert(ws) + mplex=ioncore.find_manager(ws, "WMPlex") + elseif not ws then + assert(mplex) + ws=ioncore.find_manager(mplex, "WGroupWS") + end + + assert(mplex and ws) + mod_query.query(mplex, TR("Workspace name:"), ws:name(), function(mplex, str) ws:set_name(str) end, nil, "framename") @@ -766,6 +841,8 @@ end mod_query.known_hosts={} +mod_query.hostnicks={} +mod_query.ssh_completions={} function mod_query.get_known_hosts(mplex) @@ -789,8 +866,6 @@ function mod_query.get_known_hosts(mplex) end -mod_query.hostnicks={} - function mod_query.get_hostnicks(mplex) mod_query.hostnicks={} local f @@ -800,7 +875,7 @@ function mod_query.get_hostnicks(mplex) if h then f=io.open(h.."/.ssh/config") end - if not f then + if not f then warn(TR("Failed to open ~/.ssh/config")) return end @@ -837,21 +912,10 @@ function mod_query.complete_ssh(str) end local res = {} - - if string.len(host)==0 then - if string.len(user)==0 then - return mod_query.ssh_completions - end - - for _, v in ipairs(mod_query.ssh_completions) do - table.insert(res, user .. v) - end - return res - end + local tst = mk_completion_test(host, true, false) for _, v in ipairs(mod_query.ssh_completions) do - local s, e=string.find(v, host, 1, true) - if s==1 and e>=1 then + if tst(v) then table.insert(res, user .. v) end end @@ -859,7 +923,6 @@ function mod_query.complete_ssh(str) return res end -mod_query.ssh_completions={} --DOC -- This query asks for a host to connect to with SSH. @@ -1086,7 +1149,7 @@ function mod_query.query_menu(mplex, themenu, prompt) end local function xform_name(n, is_submenu) - return (string.lower(string.gsub(n, "[-%s]+", "-")) + return (string.lower(string.gsub(n, "[-/%s]+", "-")) ..(is_submenu and "/" or "")) end @@ -1116,13 +1179,8 @@ function mod_query.query_menu(mplex, themenu, prompt) local ntab=xform_menu({}, menu, "") local function complete(str) - local results={} - for s, e in pairs(ntab) do - if string.find(s, str, 1, true) then - table.insert(results, s) - end - end - return results + -- casei_ok false, because everything is already in lower case + return mod_query.complete_keys(ntab, str, true, false) end local function handle(mplex, str) @@ -1188,14 +1246,16 @@ function mod_query.show_tree(mplex, reg, max_depth) indent, reg:xid()) end - if (not max_depth or max_depth > d) and reg.managed_list then - local mgd=reg:managed_list() - if #mgd > 0 then - s=s .. "\n" .. indent .. "---" - for k, v in pairs(mgd) do - s=s .. "\n" .. get_info(v, indent, d+1) - end - end + if (not max_depth or max_depth > d) and reg.managed_i then + local first=true + reg:managed_i(function(sub) + if first then + s=s .. "\n" .. indent .. "---" + first=false + end + s=s .. "\n" .. get_info(sub, indent, d+1) + return true + end) end return s diff --git a/mod_query/mod_query_chdir.lua b/mod_query/mod_query_chdir.lua index 3b408d2..8c60cb1 100644 --- a/mod_query/mod_query_chdir.lua +++ b/mod_query/mod_query_chdir.lua @@ -1,7 +1,7 @@ -- -- ion/query/mod_query_chdir.lua -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/query.c b/mod_query/query.c index b56c087..9318c89 100644 --- a/mod_query/query.c +++ b/mod_query/query.c @@ -1,7 +1,7 @@ /* * ion/mod_query/query.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -20,7 +20,7 @@ #include "wedln.h" -static void create_cycle_binding(WEdln *wedln, XKeyEvent *ev, ExtlFn cycle) +static void create_cycle_binding(WEdln *wedln, uint kcb, uint state, ExtlFn cycle) { WBindmap *bindmap=create_bindmap(); WBinding b; @@ -28,9 +28,9 @@ static void create_cycle_binding(WEdln *wedln, XKeyEvent *ev, ExtlFn cycle) if(bindmap==NULL) return; - b.ksb=XKeycodeToKeysym(ioncore_g.dpy, ev->keycode, 0); - b.kcb=ev->keycode; - b.state=ev->state; + b.ksb=XKeycodeToKeysym(ioncore_g.dpy, kcb, 0); + b.kcb=kcb; + b.state=state; b.act=BINDING_KEYPRESS; b.area=0; b.wait=FALSE; @@ -67,7 +67,6 @@ WEdln *mod_query_do_query(WMPlex *mplex, const char *prompt, const char *dflt, WRectangle geom; WEdlnCreateParams fnp; WMPlexAttachParams par; - XKeyEvent *ev=ioncore_current_key_event(); WEdln *wedln; fnp.prompt=prompt; @@ -85,9 +84,13 @@ WEdln *mod_query_do_query(WMPlex *mplex, const char *prompt, const char *dflt, (WRegionCreateFn*)create_wedln, (void*)&fnp); - if(wedln!=NULL && ev!=NULL && cycle!=extl_fn_none()) - create_cycle_binding(wedln, ev, cycle); + if(wedln!=NULL && cycle!=extl_fn_none()){ + uint kcb, state; + bool sub; + if(ioncore_current_key(&kcb, &state, &sub) && !sub) + create_cycle_binding(wedln, kcb, state, cycle); + } return wedln; } diff --git a/mod_query/query.h b/mod_query/query.h index 9387a17..87b60ee 100644 --- a/mod_query/query.h +++ b/mod_query/query.h @@ -1,7 +1,7 @@ /* * ion/mod_query/query.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/wedln-wrappers.c b/mod_query/wedln-wrappers.c index 3043d05..fa5f0e4 100644 --- a/mod_query/wedln-wrappers.c +++ b/mod_query/wedln-wrappers.c @@ -1,7 +1,7 @@ /* * ion/mod_query/wedln-wrappers.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/wedln.c b/mod_query/wedln.c index 094f22c..fa9193c 100644 --- a/mod_query/wedln.c +++ b/mod_query/wedln.c @@ -1,7 +1,7 @@ /* * ion/mod_query/wedln.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -25,6 +25,7 @@ #include #include #include +#include #include "edln.h" #include "wedln.h" #include "inputp.h" @@ -50,12 +51,14 @@ static int calc_text_y(WEdln *wedln, const WRectangle *geom) static int wedln_draw_strsect(WEdln *wedln, const WRectangle *geom, int x, int y, const char *str, int len, - const char *attr) + GrAttr a) { if(len==0) return 0; - grbrush_draw_string(WEDLN_BRUSH(wedln), x, y, str, len, TRUE, attr); + grbrush_set_attr(WEDLN_BRUSH(wedln), a); + grbrush_draw_string(WEDLN_BRUSH(wedln), x, y, str, len, TRUE); + grbrush_unset_attr(WEDLN_BRUSH(wedln), a); return grbrush_get_text_width(WEDLN_BRUSH(wedln), str, len); } @@ -73,9 +76,34 @@ static void dispu(const char* s, int l) } #endif -#define DSTRSECT(LEN, INV) \ - if(LEN>0){tx+=wedln_draw_strsect(wedln, geom, geom->x+tx, ty, str, LEN, INV); \ - str+=LEN; len-=LEN;} +#define DSTRSECT(LEN, A) \ + if(LEN>0){ \ + tx+=wedln_draw_strsect(wedln, geom, geom->x+tx, ty, \ + str, LEN, GR_ATTR(A)); \ + str+=LEN; len-=LEN; \ + } + + +GR_DEFATTR(active); +GR_DEFATTR(inactive); +GR_DEFATTR(normal); +GR_DEFATTR(selection); +GR_DEFATTR(cursor); +GR_DEFATTR(prompt); +GR_DEFATTR(info); + +static void init_attr() +{ + GR_ALLOCATTR_BEGIN; + GR_ALLOCATTR(active); + GR_ALLOCATTR(inactive); + GR_ALLOCATTR(normal); + GR_ALLOCATTR(selection); + GR_ALLOCATTR(cursor); + GR_ALLOCATTR(prompt); + GR_ALLOCATTR(info); + GR_ALLOCATTR_END; +} static void wedln_do_draw_str_box(WEdln *wedln, const WRectangle *geom, @@ -83,43 +111,30 @@ static void wedln_do_draw_str_box(WEdln *wedln, const WRectangle *geom, int mark, int tx) { int len=strlen(str), ll=0, ty=0; - const char *normalstyle=(REGION_IS_ACTIVE(wedln) - ? "active-normal" : "inactive-normal"); - const char *selectionstyle=(REGION_IS_ACTIVE(wedln) - ? "active-selection" : "inactive-selection"); - const char *cursorstyle=(REGION_IS_ACTIVE(wedln) - ? "active-cursor" : "inactive-cursor"); - - /*if(txw){ - WRectangle g=*geom; - g.x+=tx; - g.w-=tx; - grbrush_clear_area(WEDLN_BRUSH(wedln), &g); - }*/ ty=calc_text_y(wedln, geom); if(mark<=cursor){ if(mark>=0){ - DSTRSECT(mark, normalstyle); - DSTRSECT(cursor-mark, selectionstyle); + DSTRSECT(mark, normal); + DSTRSECT(cursor-mark, selection); }else{ - DSTRSECT(cursor, normalstyle); + DSTRSECT(cursor, normal); } if(len==0){ tx+=wedln_draw_strsect(wedln, geom, geom->x+tx, ty, - " ", 1, cursorstyle); + " ", 1, GR_ATTR(cursor)); }else{ ll=str_nextoff(str, 0); - DSTRSECT(ll, cursorstyle); + DSTRSECT(ll, cursor); } }else{ - DSTRSECT(cursor, normalstyle); + DSTRSECT(cursor, normal); ll=str_nextoff(str, 0); - DSTRSECT(ll, cursorstyle); - DSTRSECT(mark-cursor-ll, selectionstyle); + DSTRSECT(ll, cursor); + DSTRSECT(mark-cursor-ll, selection); } - DSTRSECT(len, normalstyle); + DSTRSECT(len, normal); if(txw){ WRectangle g=*geom; @@ -150,7 +165,8 @@ static void wedln_draw_str_box(WEdln *wedln, const WRectangle *geom, if(dstart!=0) tx=grbrush_get_text_width(WEDLN_BRUSH(wedln), str+vstart, dstart); - grbrush_begin(WEDLN_BRUSH(wedln), geom, GRBRUSH_AMEND|GRBRUSH_NEED_CLIP); + grbrush_begin(WEDLN_BRUSH(wedln), geom, + GRBRUSH_AMEND|GRBRUSH_KEEP_ATTR|GRBRUSH_NEED_CLIP); wedln_do_draw_str_box(wedln, geom, str+vstart+dstart, point, mark, tx); @@ -350,17 +366,10 @@ void wedln_draw_completions(WEdln *wedln, bool complete) WRectangle geom; if(wedln->compl_list.strs!=NULL && WEDLN_BRUSH(wedln)!=NULL){ - const char *style=(REGION_IS_ACTIVE(wedln) - ? "active" - : "inactive"); - const char *selstyle=(REGION_IS_ACTIVE(wedln) - ? "active-selection" - : "inactive-selection"); - get_completions_geom(wedln, G_CURRENT, &geom); draw_listing(WEDLN_BRUSH(wedln), &geom, &(wedln->compl_list), - complete, style, selstyle); + complete, GR_ATTR(selection)); } } @@ -369,7 +378,6 @@ void wedln_draw_textarea(WEdln *wedln) { WRectangle geom; int ty; - const char *style=(REGION_IS_ACTIVE(wedln) ? "active" : "inactive"); if(WEDLN_BRUSH(wedln)==NULL) return; @@ -378,30 +386,29 @@ void wedln_draw_textarea(WEdln *wedln) /*grbrush_begin(WEDLN_BRUSH(wedln), &geom, GRBRUSH_AMEND);*/ - grbrush_draw_border(WEDLN_BRUSH(wedln), &geom, style); + grbrush_draw_border(WEDLN_BRUSH(wedln), &geom); get_inner_geom(wedln, G_CURRENT, &geom); ty=calc_text_y(wedln, &geom); + grbrush_set_attr(WEDLN_BRUSH(wedln), GR_ATTR(prompt)); + if(wedln->prompt!=NULL){ - const char *promptstyle=(REGION_IS_ACTIVE(wedln) - ? "active-prompt" - : "inactive-prompt"); grbrush_draw_string(WEDLN_BRUSH(wedln), geom.x, ty, - wedln->prompt, wedln->prompt_len, TRUE, - promptstyle); + wedln->prompt, wedln->prompt_len, TRUE); } if(wedln->info!=NULL){ int x=geom.x+geom.w-wedln->info_w; - const char *promptstyle=(REGION_IS_ACTIVE(wedln) - ? "active-prompt-info" - : "inactive-prompt-info"); + + grbrush_set_attr(WEDLN_BRUSH(wedln), GR_ATTR(info)); grbrush_draw_string(WEDLN_BRUSH(wedln), x, ty, - wedln->info, wedln->info_len, TRUE, - promptstyle); + wedln->info, wedln->info_len, TRUE); + grbrush_unset_attr(WEDLN_BRUSH(wedln), GR_ATTR(info)); } + + grbrush_unset_attr(WEDLN_BRUSH(wedln), GR_ATTR(prompt)); get_textarea_geom(wedln, G_CURRENT, &geom); @@ -412,7 +419,7 @@ void wedln_draw_textarea(WEdln *wedln) } -void wedln_draw(WEdln *wedln, bool complete) +static void wedln_draw_(WEdln *wedln, bool complete, bool completions) { WRectangle g; int f=(complete ? 0 : GRBRUSH_NO_CLEAR_OK); @@ -424,13 +431,24 @@ void wedln_draw(WEdln *wedln, bool complete) grbrush_begin(WEDLN_BRUSH(wedln), &g, f); - wedln_draw_completions(wedln, FALSE); + grbrush_set_attr(WEDLN_BRUSH(wedln), REGION_IS_ACTIVE(wedln) + ? GR_ATTR(active) + : GR_ATTR(inactive)); + + if(completions) + wedln_draw_completions(wedln, FALSE); + wedln_draw_textarea(wedln); grbrush_end(WEDLN_BRUSH(wedln)); } +void wedln_draw(WEdln *wedln, bool complete) +{ + wedln_draw_(wedln, complete, TRUE); +} + /*}}} */ @@ -464,7 +482,7 @@ static void wedln_set_info(WEdln *wedln, const char *info) get_textarea_geom(wedln, G_CURRENT, &tageom); wedln_update_cursor(wedln, tageom.w); - wedln_draw_textarea(wedln); + wedln_draw_(wedln, FALSE, FALSE); } @@ -526,7 +544,8 @@ static void free_completions(char **ptr, int i) { while(i>0){ i--; - free(ptr[i]); + if(ptr[i]!=NULL) + free(ptr[i]); } free(ptr); } @@ -595,19 +614,14 @@ void wedln_set_completions(WEdln *wedln, ExtlTab completions, int cycle) extl_table_gets_s(completions, "common_beg", &beg); extl_table_gets_s(completions, "common_end", &end); - if(wedln_do_set_completions(wedln, ptr, n, beg, end, cycle, FALSE)) - return; + if(!wedln_do_set_completions(wedln, ptr, n, beg, end, cycle, FALSE)) + wedln_hide_completions(wedln); + + return; allocfail: wedln_hide_completions(wedln); free_completions(ptr, i); - while(i>0){ - i--; - /* edln_do_completions may NULL things */ - if(ptr[i]!=NULL) - free(ptr[i]); - } - free(ptr); } @@ -899,6 +913,8 @@ static bool wedln_init(WEdln *wedln, WWindow *par, const WFitParams *fp, { wedln->vstart=0; + init_attr(); + if(!wedln_init_prompt(wedln, params->prompt)) return FALSE; diff --git a/mod_query/wedln.h b/mod_query/wedln.h index 40c0529..e966b41 100644 --- a/mod_query/wedln.h +++ b/mod_query/wedln.h @@ -1,7 +1,7 @@ /* * ion/mod_query/wedln.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_query/wmessage.c b/mod_query/wmessage.c index aa6002d..b8c5fa4 100644 --- a/mod_query/wmessage.c +++ b/mod_query/wmessage.c @@ -1,7 +1,7 @@ /* * ion/mod_query/wmessage.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -16,6 +16,7 @@ #include #include #include +#include #include "wmessage.h" #include "inputp.h" @@ -77,9 +78,21 @@ static void wmsg_calc_size(WMessage *wmsg, WRectangle *geom) /*{{{ Draw */ +GR_DEFATTR(active); +GR_DEFATTR(inactive); + + +static void init_attr() +{ + GR_ALLOCATTR_BEGIN; + GR_ALLOCATTR(active); + GR_ALLOCATTR(inactive); + GR_ALLOCATTR_END; +} + + static void wmsg_draw(WMessage *wmsg, bool complete) { - const char *style=(REGION_IS_ACTIVE(wmsg) ? "active" : "inactive"); WRectangle geom; if(WMSG_BRUSH(wmsg)==NULL) @@ -90,8 +103,12 @@ static void wmsg_draw(WMessage *wmsg, bool complete) grbrush_begin(WMSG_BRUSH(wmsg), &geom, (complete ? 0 : GRBRUSH_NO_CLEAR_OK)); + grbrush_set_attr(WMSG_BRUSH(wmsg), REGION_IS_ACTIVE(wmsg) + ? GR_ATTR(active) + : GR_ATTR(inactive)); + draw_listing(WMSG_BRUSH(wmsg), &geom, &(wmsg->listing), - FALSE, style, style); + FALSE, GRATTR_NONE); grbrush_end(WMSG_BRUSH(wmsg)); } @@ -174,6 +191,8 @@ static bool wmsg_init(WMessage *wmsg, WWindow *par, const WFitParams *fp, p=p+l+1; } + init_attr(); + init_listing(&(wmsg->listing)); setup_listing(&(wmsg->listing), ptr, k, TRUE); diff --git a/mod_query/wmessage.h b/mod_query/wmessage.h index bc05b52..be1bfca 100644 --- a/mod_query/wmessage.h +++ b/mod_query/wmessage.h @@ -1,7 +1,7 @@ /* * ion/mod_query/wmessage.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_sm/sm.c b/mod_sm/sm.c index 6971f7d..d47a546 100644 --- a/mod_sm/sm.c +++ b/mod_sm/sm.c @@ -1,7 +1,7 @@ /* * ion/mod_sm/sm.c * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_sm/sm_matchwin.c b/mod_sm/sm_matchwin.c index d64f671..eb5b7a2 100644 --- a/mod_sm/sm_matchwin.c +++ b/mod_sm/sm_matchwin.c @@ -1,7 +1,7 @@ /* * ion/mod_sm/sm_mathcwin.c * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Based on the code of the 'sm' module for Ion1 by an unknown contributor. * diff --git a/mod_sm/sm_matchwin.h b/mod_sm/sm_matchwin.h index 2dd45f3..def2a97 100644 --- a/mod_sm/sm_matchwin.h +++ b/mod_sm/sm_matchwin.h @@ -1,7 +1,7 @@ /* * ion/mod_sm/sm_mathcwin.c * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Based on the code of the 'sm' module for Ion1 by an unknown contributor. * diff --git a/mod_sm/sm_session.c b/mod_sm/sm_session.c index 7472e8b..a4373d0 100644 --- a/mod_sm/sm_session.c +++ b/mod_sm/sm_session.c @@ -1,7 +1,7 @@ /* * ion/mod_sm/sm_session.c * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Based on the code of the 'sm' module for Ion1 by an unknown contributor. * diff --git a/mod_sm/sm_session.h b/mod_sm/sm_session.h index 306bf99..3fa3532 100644 --- a/mod_sm/sm_session.h +++ b/mod_sm/sm_session.h @@ -1,7 +1,7 @@ /* * ion/mod_sm/sm_session.h * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Based on the code of the 'sm' module for Ion1 by an unknown contributor. * diff --git a/mod_sp/main.c b/mod_sp/main.c index b827ae2..c9f13b4 100644 --- a/mod_sp/main.c +++ b/mod_sp/main.c @@ -1,7 +1,7 @@ /* * ion/mod_sp/main.c * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_sp/main.h b/mod_sp/main.h index f290b35..45b85e0 100644 --- a/mod_sp/main.h +++ b/mod_sp/main.h @@ -1,7 +1,7 @@ /* * ion/mod_sp/main.h * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_statusbar/draw.c b/mod_statusbar/draw.c index 29e9f02..19ba93a 100644 --- a/mod_statusbar/draw.c +++ b/mod_statusbar/draw.c @@ -1,7 +1,7 @@ /* * ion/mod_statusbar/draw.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -109,7 +109,7 @@ void statusbar_calculate_xs(WStatusBar *sb) static void draw_elems(GrBrush *brush, WRectangle *g, int ty, WSBElem *elems, int nelems, bool needfill, - const char *dfltattr, bool complete) + bool complete) { int prevx=g->x; int maxx=g->x+g->w; @@ -125,8 +125,15 @@ static void draw_elems(GrBrush *brush, WRectangle *g, int ty, const char *s=(elems->text!=NULL ? elems->text : STATUSBAR_NX_STR); - grbrush_draw_string(brush, elems->x, ty, s, strlen(s), needfill, - elems->attr ? elems->attr : dfltattr); + + grbrush_set_attr(brush, elems->attr); + grbrush_set_attr(brush, elems->meter); + + grbrush_draw_string(brush, elems->x, ty, s, strlen(s), needfill); + + grbrush_unset_attr(brush, elems->meter); + grbrush_unset_attr(brush, elems->attr); + prevx=elems->x+elems->text_w; } elems++; @@ -162,7 +169,7 @@ void statusbar_draw(WStatusBar *sb, bool complete) grbrush_begin(sb->brush, &g, (complete ? 0 : GRBRUSH_NO_CLEAR_OK)); - grbrush_draw_border(sb->brush, &g, NULL); + grbrush_draw_border(sb->brush, &g); if(sb->elems==NULL) return; @@ -174,8 +181,7 @@ void statusbar_draw(WStatusBar *sb, bool complete) ty=(g.y+fnte.baseline+(g.h-fnte.max_height)/2); - draw_elems(sb->brush, &g, ty, sb->elems, sb->nelems, - TRUE, NULL, complete); + draw_elems(sb->brush, &g, ty, sb->elems, sb->nelems, TRUE, complete); grbrush_end(sb->brush); } diff --git a/mod_statusbar/draw.h b/mod_statusbar/draw.h index c30a86f..0724973 100644 --- a/mod_statusbar/draw.h +++ b/mod_statusbar/draw.h @@ -1,7 +1,7 @@ /* * ion/mod_statusbar/draw.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_statusbar/main.c b/mod_statusbar/main.c index 9ec4f20..bf0e1d0 100644 --- a/mod_statusbar/main.c +++ b/mod_statusbar/main.c @@ -1,7 +1,7 @@ /* * ion/mod_statusbar/main.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -94,7 +94,6 @@ static bool wait_statusd_init(int outfd, int errfd, ExtlFn dh, ExtlFn eh) int nfds=maxof(outfd, errfd); int retval; bool dummy, doneseen, eagain=FALSE; - const char *timeout_msg=TR("ion-statusd launch timeout."); if(gettimeofday(&endtime, NULL)!=0){ warn_err(); diff --git a/mod_statusbar/main.h b/mod_statusbar/main.h index b8ec8d2..fa4dbfd 100644 --- a/mod_statusbar/main.h +++ b/mod_statusbar/main.h @@ -1,7 +1,7 @@ /* * ion/mod_statusbar/main.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_statusbar/mod_statusbar.lua b/mod_statusbar/mod_statusbar.lua index aeef9cb..3164927 100644 --- a/mod_statusbar/mod_statusbar.lua +++ b/mod_statusbar/mod_statusbar.lua @@ -1,7 +1,7 @@ -- -- ion/mod_statusbar/mod_statusbar.lua -- --- Copyright (c) Tuomo Valkonen 2004-2006. +-- Copyright (c) Tuomo Valkonen 2004-2007. -- -- Ion is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License as published by diff --git a/mod_statusbar/statusbar.c b/mod_statusbar/statusbar.c index 1568b9f..261560c 100644 --- a/mod_statusbar/statusbar.c +++ b/mod_statusbar/statusbar.c @@ -1,7 +1,7 @@ /* * ion/mod_statusbar/statusbar.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -10,6 +10,7 @@ */ #include +#include #include #include @@ -23,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +44,6 @@ static void statusbar_rearrange(WStatusBar *sb, bool rs); static void do_calc_systray_w(WStatusBar *p, WSBElem *el); static void statusbar_calc_systray_w(WStatusBar *p); - static WStatusBar *statusbars=NULL; @@ -113,15 +114,16 @@ void statusbar_deinit(WStatusBar *p) /*{{{ Content stuff */ + static void init_sbelem(WSBElem *el) { el->type=WSBELEM_NONE; - el->meter=NULL; el->text_w=0; el->text=NULL; el->max_w=0; el->tmpl=NULL; - el->attr=NULL; + el->meter=STRINGID_NONE; + el->attr=STRINGID_NONE; el->stretch=0; el->align=WSBELEM_ALIGN_CENTER; el->zeropad=0; @@ -130,6 +132,20 @@ static void init_sbelem(WSBElem *el) } +static bool gets_stringstore(ExtlTab t, const char *str, StringId *id) +{ + char *s; + + if(extl_table_gets_s(t, str, &s)){ + *id=stringstore_alloc(s); + free(s); + return (*id!=STRINGID_NONE); + } + + return FALSE; +} + + static WSBElem *get_sbelems(ExtlTab t, int *nret, int *filleridxret) { int i, n=extl_table_get_n(t); @@ -157,15 +173,20 @@ static WSBElem *get_sbelems(ExtlTab t, int *nret, int *filleridxret) if(el[i].type==WSBELEM_TEXT || el[i].type==WSBELEM_STRETCH){ extl_table_gets_s(tt, "text", &(el[i].text)); }else if(el[i].type==WSBELEM_METER){ - extl_table_gets_s(tt, "meter", &(el[i].meter)); + gets_stringstore(tt, "meter", &(el[i].meter)); extl_table_gets_s(tt, "tmpl", &(el[i].tmpl)); extl_table_gets_i(tt, "align", &(el[i].align)); extl_table_gets_i(tt, "zeropad", &(el[i].zeropad)); el[i].zeropad=maxof(el[i].zeropad, 0); }else if(el[i].type==WSBELEM_SYSTRAY){ - extl_table_gets_s(tt, "meter", &(el[i].meter)); + const char *tmp; + + gets_stringstore(tt, "meter", &(el[i].meter)); extl_table_gets_i(tt, "align", &(el[i].align)); - if(el[i].meter==NULL || strcmp(el[i].meter, "systray")==0) + + tmp=stringstore_get(el[i].meter); + + if(tmp==NULL || strcmp(tmp, "systray")==0) systrayidx=i; }else if(el[i].type==WSBELEM_FILLER){ *filleridxret=i; @@ -198,12 +219,12 @@ static void free_sbelems(WSBElem *el, int n) for(i=0; imin_height=p->natural_h; h->max_set=TRUE; - h->max_width=p->natural_w; + h->max_width=INT_MAX;/*p->natural_w;*/ h->max_height=p->natural_h; } @@ -354,17 +375,22 @@ static WSBElem *statusbar_associate_systray(WStatusBar *sb, WRegion *reg) extl_table_gets_s(cwin->proptab, "statusbar", &name); for(i=0; inelems; i++){ + const char *meter; + if(sb->elems[i].type!=WSBELEM_SYSTRAY) continue; - if(sb->elems[i].meter==NULL){ + + meter=stringstore_get(sb->elems[i].meter); + + if(meter==NULL){ fbel=&sb->elems[i]; continue; } - if(name!=NULL && strcmp(sb->elems[i].meter, name)==0){ + if(name!=NULL && strcmp(meter, name)==0){ el=&sb->elems[i]; break; } - if(strcmp(sb->elems[i].meter, "systray")==0) + if(strcmp(meter, "systray")==0) fbel=&sb->elems[i]; } @@ -721,7 +747,7 @@ ExtlTab statusbar_get_template_table(WStatusBar *sb) extl_table_sets_i(tt, "type", sb->elems[i].type); extl_table_sets_s(tt, "text", sb->elems[i].text); - extl_table_sets_s(tt, "meter", sb->elems[i].meter); + extl_table_sets_s(tt, "meter", stringstore_get(sb->elems[i].meter)); extl_table_sets_s(tt, "tmpl", sb->elems[i].tmpl); extl_table_sets_i(tt, "align", sb->elems[i].align); extl_table_sets_i(tt, "zeropad", sb->elems[i].zeropad); @@ -844,6 +870,8 @@ void statusbar_update(WStatusBar *sb, ExtlTab t) return; for(i=0; inelems; i++){ + const char *meter; + el=&(sb->elems[i]); if(el->type!=WSBELEM_METER) @@ -854,16 +882,18 @@ void statusbar_update(WStatusBar *sb, ExtlTab t) el->text=NULL; } - if(el->attr!=NULL){ - free(el->attr); - el->attr=NULL; + if(el->attr!=GRATTR_NONE){ + stringstore_free(el->attr); + el->attr=GRATTR_NONE; } - if(el->meter!=NULL){ + meter=stringstore_get(el->meter); + + if(meter!=NULL){ const char *str; char *attrnm; - extl_table_gets_s(t, el->meter, &(el->text)); + extl_table_gets_s(t, meter, &(el->text)); if(el->text==NULL){ str=STATUSBAR_NX_STR; @@ -900,9 +930,13 @@ void statusbar_update(WStatusBar *sb, ExtlTab t) grow=TRUE; } - attrnm=scat(el->meter, "_hint"); + attrnm=scat(meter, "_hint"); if(attrnm!=NULL){ - extl_table_gets_s(t, attrnm, &(el->attr)); + char *s; + if(extl_table_gets_s(t, attrnm, &s)){ + el->attr=stringstore_alloc(s); + free(s); + } free(attrnm); } } diff --git a/mod_statusbar/statusbar.h b/mod_statusbar/statusbar.h index 73999ad..8392f16 100644 --- a/mod_statusbar/statusbar.h +++ b/mod_statusbar/statusbar.h @@ -1,7 +1,7 @@ /* * ion/mod_statusbar/statusbar.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -48,10 +48,10 @@ DECLSTRUCT(WSBElem){ int stretch; int text_w; char *text; - char *meter; int max_w; char *tmpl; - char *attr; + StringId meter; + StringId attr; int zeropad; int x; PtrList *traywins; diff --git a/mod_tiling/main.c b/mod_tiling/main.c index 5901c1c..4787870 100644 --- a/mod_tiling/main.c +++ b/mod_tiling/main.c @@ -1,7 +1,7 @@ /* * ion/mod_tiling/main.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/main.h b/mod_tiling/main.h index 35d9ddf..08bb446 100644 --- a/mod_tiling/main.h +++ b/mod_tiling/main.h @@ -1,7 +1,7 @@ /* * ion/mod_tiling/main.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/ops.c b/mod_tiling/ops.c index c86a80a..4836552 100644 --- a/mod_tiling/ops.c +++ b/mod_tiling/ops.c @@ -1,7 +1,7 @@ /* * ion/mod_tiling/ops.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -9,109 +9,14 @@ * (at your option) any later version. */ -#include - #include #include #include +#include #include -#include -#include #include "tiling.h" -static WGroup *find_group(WRegion *reg, bool *detach_framed) -{ - WRegion *mgr=REGION_MANAGER(reg); - bool was_grouped=FALSE; - - if(OBJ_IS(mgr, WMPlex)){ - WMPlex *mplex=(WMPlex*)mgr; - *detach_framed=TRUE; - mgr=REGION_MANAGER(mgr); - if(OBJ_IS(mgr, WGroup)){ - assert(mplex->mgd!=NULL); - if(mplex->mgd->reg==reg && mplex->mgd->mgr_next==NULL){ - /* Nothing to detach */ - return NULL; - } - } - }else{ - was_grouped=OBJ_IS(mgr, WGroup); - *detach_framed=FALSE; - } - - while(mgr!=NULL){ - mgr=REGION_MANAGER(mgr); - if(OBJ_IS(mgr, WGroup)) - break; - } - - if(mgr==NULL && was_grouped) - warn(TR("Already detached.")); - - return (WGroup*)mgr; -} - - -static void get_relative_geom(WRectangle *g, WRegion *reg, WRegion *mgr) -{ - WWindow *rel=REGION_PARENT(mgr), *w; - - *g=REGION_GEOM(reg); - - for(w=REGION_PARENT(reg); - w!=rel && (WRegion*)w!=mgr; - w=REGION_PARENT(w)){ - - g->x+=REGION_GEOM(w).x; - g->y+=REGION_GEOM(w).y; - } -} - - -/*EXTL_DOC - * Detach \var{reg}, i.e. make it managed by its nearest ancestor - * \type{WGroup}, framed if \var{reg} is not itself \type{WFrame}. - */ -EXTL_EXPORT -bool mod_tiling_detach(WRegion *reg) -{ - bool detach_framed=!OBJ_IS(reg, WFrame); - WGroupAttachParams ap=GROUPATTACHPARAMS_INIT; - WRegionAttachData data; - WGroup *grp; - - grp=find_group(reg, &detach_framed); - - if(grp==NULL) - return FALSE; - - ap.switchto_set=TRUE; - ap.switchto=region_may_control_focus(reg); - - ap.geom_set=TRUE; - get_relative_geom(&ap.geom, reg, (WRegion*)grp); - - /* TODO: Retain (root-relative) geometry of reg for framed - * detach instead of making a frame of this size? - */ - - data.type=REGION_ATTACH_REPARENT; - data.u.reg=reg; - - if(detach_framed){ - WFramedParam fp=FRAMEDPARAM_INIT; - - return (region_attach_framed((WRegion*)grp, &fp, - (WRegionAttachFn*)group_do_attach, - &ap, &data)!=NULL); - }else{ - return (group_do_attach(grp, &ap, &data)!=NULL); - } -} - - static WRegion *mkbottom_fn(WWindow *parent, const WFitParams *fp, void *param) { diff --git a/mod_tiling/panehandle.c b/mod_tiling/panehandle.c index 586385d..480e02d 100644 --- a/mod_tiling/panehandle.c +++ b/mod_tiling/panehandle.c @@ -1,7 +1,7 @@ /* - * ion/panews/panehandle.c + * ion/mod_tiling/panehandle.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -113,7 +113,7 @@ static void panehandle_draw(WPaneHandle *pwin, bool complete) grbrush_begin(pwin->brush, &g, (complete ? 0 : GRBRUSH_NO_CLEAR_OK)); - grbrush_draw_borderline(pwin->brush, &g, NULL, pwin->bline); + grbrush_draw_borderline(pwin->brush, &g, pwin->bline); grbrush_end(pwin->brush); } diff --git a/mod_tiling/panehandle.h b/mod_tiling/panehandle.h index c4ad184..fe06f3e 100644 --- a/mod_tiling/panehandle.h +++ b/mod_tiling/panehandle.h @@ -1,7 +1,7 @@ /* - * ion/panews/panehandle.h + * ion/mod_tiling/panehandle.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/placement.c b/mod_tiling/placement.c index 47cfa76..07de5f4 100644 --- a/mod_tiling/placement.c +++ b/mod_tiling/placement.c @@ -1,7 +1,7 @@ /* * ion/mod_tiling/placement.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/placement.h b/mod_tiling/placement.h index 9094b62..a61f892 100644 --- a/mod_tiling/placement.h +++ b/mod_tiling/placement.h @@ -1,7 +1,7 @@ /* * ion/mod_tiling/placement.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/split-stdisp.c b/mod_tiling/split-stdisp.c index d1c55f2..352ba41 100644 --- a/mod_tiling/split-stdisp.c +++ b/mod_tiling/split-stdisp.c @@ -1,7 +1,7 @@ /* * ion/mod_tiling/split-stdisp.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/split-stdisp.h b/mod_tiling/split-stdisp.h index 5d41fe1..4f6ca59 100644 --- a/mod_tiling/split-stdisp.h +++ b/mod_tiling/split-stdisp.h @@ -1,7 +1,7 @@ /* * ion/mod_tiling/split-stdisp.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/split.c b/mod_tiling/split.c index 54864d7..c3edc5e 100644 --- a/mod_tiling/split.c +++ b/mod_tiling/split.c @@ -1,7 +1,7 @@ /* * ion/mod_tiling/split.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/split.h b/mod_tiling/split.h index fa74122..10a0e5f 100644 --- a/mod_tiling/split.h +++ b/mod_tiling/split.h @@ -1,7 +1,7 @@ /* * ion/mod_tiling/split.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/splitfloat.c b/mod_tiling/splitfloat.c index 6ab6b31..ff71afd 100644 --- a/mod_tiling/splitfloat.c +++ b/mod_tiling/splitfloat.c @@ -1,7 +1,7 @@ /* - * ion/panews/splitext.c + * ion/mod_tiling/splitext.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/mod_tiling/splitfloat.h b/mod_tiling/splitfloat.h index 9bb428e..8d51b59 100644 --- a/mod_tiling/splitfloat.h +++ b/mod_tiling/splitfloat.h @@ -1,7 +1,7 @@ /* - * ion/panews/splitfloat.h + * ion/mod_tiling/splitfloat.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -9,8 +9,8 @@ * (at your option) any later version. */ -#ifndef ION_PANEWS_SPLITFLOAT_H -#define ION_PANEWS_SPLITFLOAT_H +#ifndef ION_MOD_TILING_SPLITFLOAT_H +#define ION_MOD_TILING_SPLITFLOAT_H #include #include @@ -53,4 +53,4 @@ extern WSplitRegion *splittree_split_floating(WSplit *node, int dir, WRegionSimpleCreateFn *fn, WTiling *ws); -#endif /* ION_PANEWS_SPLITFLOAT_H */ +#endif /* ION_MOD_TILING_SPLITFLOAT_H */ diff --git a/mod_tiling/tiling.c b/mod_tiling/tiling.c index 2ab56b0..159f001 100644 --- a/mod_tiling/tiling.c +++ b/mod_tiling/tiling.c @@ -1,7 +1,7 @@ /* * ion/mod_tiling/tiling.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -731,7 +731,7 @@ void tiling_managed_remove(WTiling *ws, WRegion *reg) if(!ds){ if(other==NULL) - mainloop_defer_destroy((Obj*)ws); + region_dispose((WRegion*)ws, mcf); else if(act && mcf) region_warp(other); } @@ -1125,17 +1125,20 @@ WRegion *tiling_current(WTiling *ws) /*EXTL_DOC - * Returns a list of regions managed by the workspace (frames, mostly). + * Iterate over managed regions of \var{ws} until \var{iterfn} returns + * \code{false}. + * The function itself returns \code{true} if it reaches the end of list + * without this happening. */ EXTL_SAFE EXTL_EXPORT_MEMBER -ExtlTab tiling_managed_list(WTiling *ws) +bool tiling_managed_i(WTiling *ws, ExtlFn iterfn) { PtrListIterTmp tmp; ptrlist_iter_init(&tmp, ws->managed_list); - return extl_obj_iterable_to_table((ObjIterator*)ptrlist_iter, &tmp); + return extl_iter_objlist_(iterfn, (ObjIterator*)ptrlist_iter, &tmp); } diff --git a/mod_tiling/tiling.h b/mod_tiling/tiling.h index 5b7a8e7..7d93469 100644 --- a/mod_tiling/tiling.h +++ b/mod_tiling/tiling.h @@ -1,7 +1,7 @@ /* * ion/mod_tiling/tiling.h * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by diff --git a/pwm/Makefile b/pwm/Makefile index 84c3946..0bfbed5 100644 --- a/pwm/Makefile +++ b/pwm/Makefile @@ -21,7 +21,7 @@ INCLUDES += $(X11_INCLUDES) INCLUDES += $(LIBMAINLOOP_INCLUDES) $(LIBTU_INCLUDES) $(LIBEXTL_INCLUDES) INCLUDES += -I.. -LIBS += $(X11_LIBS) $(XINERAMA_LIBS) +LIBS += $(X11_LIBS) LIBS += $(WHOLEA) $(LIBMAINLOOP_LIBS) $(LIBEXTL_LIBS) $(LIBTU_LIBS) $(NO_WHOLEA) LIBS += $(LUA_LIBS) $(DL_LIBS) LIBS += -lm diff --git a/pwm/cfg_pwm.lua b/pwm/cfg_pwm.lua index 1fe7df4..ca01137 100644 --- a/pwm/cfg_pwm.lua +++ b/pwm/cfg_pwm.lua @@ -40,7 +40,6 @@ dopath("cfg_ioncore") --dopath("mod_query") dopath("mod_menu") --dopath("mod_tiling") ---dopath("mod_panews") --dopath("mod_statusbar") dopath("mod_dock") --dopath("mod_sp") diff --git a/pwm/pwm.c b/pwm/pwm.c index 773aace..bbb042f 100644 --- a/pwm/pwm.c +++ b/pwm/pwm.c @@ -1,7 +1,7 @@ /* * ion/pwm/pwm.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -48,16 +48,8 @@ static OptParserOpt pwm_opts[]={ DUMMY_TR("Add directory to search path")}, {OPT_ID('o'), "oneroot", 0, NULL, - DUMMY_TR("Manage default root window/non-Xinerama screen only")}, - -#if defined(CF_XINERAMA) || defined(CF_SUN_XINERAMA) - {OPT_ID('x'), "xinerama", OPT_ARG, "1|0", - DUMMY_TR("Use Xinerama screen information (default: 0/no)")}, -#else - {OPT_ID('x'), "xinerama", OPT_ARG, "?", - DUMMY_TR("Ignored: not compiled with Xinerama support")}, -#endif - + DUMMY_TR("Manage default screen only")}, + {OPT_ID('s'), "session", OPT_ARG, "session_name", DUMMY_TR("Name of session (affects savefiles)")}, @@ -97,7 +89,7 @@ int main(int argc, char*argv[]) const char *cfgfile="cfg_pwm"; const char *display=NULL; char *cmd=NULL; - int stflags=IONCORE_STARTUP_NOXINERAMA; + int stflags=0; int opt; ErrorLog el; FILE *ef=NULL; @@ -139,17 +131,6 @@ int main(int argc, char*argv[]) case OPT_ID('o'): stflags|=IONCORE_STARTUP_ONEROOT; break; - case OPT_ID('x'): - { - const char *p=optparser_get_arg(); - if(strcmp(p, "1")==0) - stflags&=~IONCORE_STARTUP_NOXINERAMA; - else if(strcmp(p, "0")==0) - stflags|=IONCORE_STARTUP_NOXINERAMA; - else - warn(TR("Invalid parameter to -xinerama.")); - } - break; case OPT_ID('s'): extl_set_sessiondir(optparser_get_arg()); break; diff --git a/system.mk b/system.mk index 06ce3b1..e091318 100644 --- a/system.mk +++ b/system.mk @@ -81,13 +81,6 @@ X11_PREFIX=/usr/X11R6 X11_LIBS=-L$(X11_PREFIX)/lib -lX11 -lXext X11_INCLUDES=-I$(X11_PREFIX)/include -# Change commenting to disable Xinerama support -XINERAMA_LIBS=-lXinerama -DEFINES += -DCF_XINERAMA -# For Solaris -#XINERAMA_LIBS= -#DEFINES += -DCF_SUN_XINERAMA - # XFree86 libraries up to 4.3.0 have a bug that will cause Ion to segfault # if Opera is used when i18n support is enabled. The following setting # should work around that situation. diff --git a/version.h b/version.h index e5a60c9..4688aae 100644 --- a/version.h +++ b/version.h @@ -1,2 +1,2 @@ -#define ION_VERSION "3ds-20061223" +#define ION_VERSION "3ds-20070203" #define ION_API_VERSION "3-"ION_VERSION
    Figure 3: Most common manager-managed relations
     
    tExtlTabExtlTab Reference to Lua table
    fExltFnExltFn Reference to Lua function.
    o