/*
* 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 <libtu/setparam.h>
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));
}
}
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));
}
}
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)
/*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
}
+ObjList *ioncore_activity_list()
+{
+ return actlist;
+}
+
+
/*EXTL_DOC
* Go to first region on activity list.
*/