From 66fa691f3f037006be09e5abfe747bcbbe4fe2c1 Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 06:50:29 +0000 Subject: [PATCH] 2002/09/15 23:38:37 darcs-hash:20040130065029-2ba56-118cd1703e29a64b301efb4f772095ff77dc6463.gz --- CHANGES | 2 ++ src/org/xwt/Template.java | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 768add5..b8c6055 100644 --- a/CHANGES +++ b/CHANGES @@ -408,4 +408,6 @@ 15-Sep megacz Platform.java: disable 2d acceleration on Mac OS X 10.2 +15-Sep megacz Template.java: added callback for retheme operation + diff --git a/src/org/xwt/Template.java b/src/org/xwt/Template.java index f345718..324fea1 100644 --- a/src/org/xwt/Template.java +++ b/src/org/xwt/Template.java @@ -273,11 +273,8 @@ public class Template { } /** adds a theme mapping, retemplatizing as needed */ - public static void retheme(String from, String to) { - if (Log.on) Log.log(Template.class, "retheming from " + from + " to " + to); + public static void retheme(Function callback) { XWF.flushXWFs(); - Resources.mapFrom.addElement(from); - Resources.mapTo.addElement(to); // clear changed marker and relink Template[] t = new Template[cache.size()]; @@ -293,6 +290,17 @@ public class Template { Box b = ((Surface)Surface.allSurfaces.elementAt(i)).root; if (b != null) reapply(b); } + + if (callback != null) + try { + callback.call(Context.enter(), null, null, new Object[] { new Double(1.0), new Double(1.0) }); + } catch (EcmaError ex) { + if (Log.on) Log.log(Template.class, "WARNING: uncaught interpreter exception: " + ex.getMessage()); + if (Log.on) Log.log(Template.class, " thrown from within progress callback at " + ex.getSourceName() + ":" + ex.getLineNumber()); + } catch (JavaScriptException ex) { + if (Log.on) Log.log(Template.class, "WARNING: uncaught ecmascript exception: " + ex.getMessage()); + if (Log.on) Log.log(Template.class, " thrown from within progress callback at " + ex.sourceFile + ":" + ex.line); + } } /** template reapplication procedure */ -- 1.7.10.4