X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Factivity.c;h=25e2a5aba4587f4c91b9ac1e095d325bafbe9ee2;hb=ae4260bb64817c11f9a7140324cd3e3ba113e297;hp=0f7b7a6e6e3501d3c262e7d11b79dc0871ba12bf;hpb=8366314611bf30a0f31d25bf5f5023186fa87692;p=ion3.git diff --git a/ioncore/activity.c b/ioncore/activity.c index 0f7b7a6..25e2a5a 100644 --- a/ioncore/activity.c +++ b/ioncore/activity.c @@ -1,12 +1,9 @@ /* * 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 - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * See the included file LICENSE for details. */ #include @@ -32,7 +29,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 +43,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,15 +86,15 @@ 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; } /*EXTL_DOC - * Set activity flag of \var{reg}. The \var{how} parameter most be - * one of (set/unset/toggle). + * Set activity flag of \var{reg}. The \var{how} parameter must be + * one of \codestr{set}, \codestr{unset} or \codestr{toggle}. */ EXTL_EXPORT_AS(WRegion, set_activity) bool region_set_activity_extl(WRegion *reg, const char *how) @@ -124,27 +121,20 @@ 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); } /*EXTL_DOC - * Return first regio non activity list. + * Returns first region on activity list. */ EXTL_SAFE EXTL_EXPORT @@ -156,6 +146,12 @@ WRegion *ioncore_activity_first() } +ObjList *ioncore_activity_list() +{ + return actlist; +} + + /*EXTL_DOC * Go to first region on activity list. */