Author: tom
Date: Mon Mar 23 12:35:41 2009
New Revision: 4905

URL: http://svn.slimdevices.com/jive?rev=4905&view=rev
Log:
Bug: 11440
Description:
offer "on top" framework widgets, with "not on top" being the default.

Modified:
    
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DebugSkin/DebugSkinMeta.lua
    7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua
    7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DebugSkin/DebugSkinMeta.lua
URL: 
http://svn.slimdevices.com/jive/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DebugSkin/DebugSkinMeta.lua?rev=4905&r1=4904&r2=4905&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DebugSkin/DebugSkinMeta.lua 
(original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DebugSkin/DebugSkinMeta.lua 
Mon Mar 23 12:35:41 2009
@@ -76,7 +76,7 @@
                        _debugWidget(meta, screen, w)
                end)
        end)
-       Framework:addWidget(meta.canvas)
+       Framework:addWidget(meta.canvas, true)
 
        meta.mouseListener = Framework:addListener(EVENT_MOUSE_ALL,
                function(event)

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua
URL: 
http://svn.slimdevices.com/jive/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua?rev=4905&r1=4904&r2=4905&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua Mon Mar 
23 12:35:41 2009
@@ -89,6 +89,7 @@
 -- initial global state
 windowStack = {}
 widgets = {} -- global widgets
+onTopWidgets = {} -- global "on top" widgets
 globalListeners = {} -- global listeners
 unusedListeners = {} -- unused listeners
 animations = {} -- active widget animations
@@ -373,16 +374,20 @@
 
 --[[
 
-=head2 jive.ui.Framework:addWidget(widget)
-
-Add a global widget I<widget> to the screen. The global widgets are shown on 
all windows.
-
-=cut
---]]
-function addWidget(self, widget)
+=head2 jive.ui.Framework:addWidget(widget, onTop)
+
+Add a global widget I<widget> to the screen. The global widgets are shown on 
all windows.  If onTop is set, the widget will be drawn after all other widgets.
+
+=cut
+--]]
+       function addWidget(self, widget, onTop)
        _assert(oo.instanceof(widget, Widget))
 
-       widgets[#widgets + 1] = widget
+       if onTop then
+               onTopWidgets[#onTopWidgets + 1] = widget
+       else
+               widgets[#widgets + 1] = widget
+       end
        widget:dispatchNewEvent(EVENT_SHOW)
 
        self:reDraw(nil)
@@ -401,6 +406,7 @@
        _assert(oo.instanceof(widget, Widget))
 
        table.delete(widgets, widget)
+       table.delete(onTopWidgets, widget)
        widget:dispatchNewEvent(EVENT_HIDE)
 
        self:reDraw(nil)

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c
URL: 
http://svn.slimdevices.com/jive/7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c?rev=4905&r1=4904&r2=4905&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c Mon Mar 23 
12:35:41 2009
@@ -133,19 +133,6 @@
         * 1: widget
         * 2: closure
         */
-
-       // window widgets
-       lua_getfield(L, 1, "widgets");
-       lua_pushnil(L);
-       while (lua_next(L, -2) != 0) {
-               lua_pushvalue(L, 2);
-               lua_pushvalue(L, -2);
-               lua_call(L, 1, 1);
-
-               r = r | luaL_optinteger(L, -1, 0);
-               lua_pop(L, 2);
-       }
-       lua_pop(L, 1);
 
        lua_getfield(L, 1, "showFrameworkWidgets");
        if (lua_toboolean(L, -1)) {
@@ -157,13 +144,40 @@
                        lua_pushvalue(L, 2);
                        lua_pushvalue(L, -2);
                        lua_call(L, 1, 1);
-                       
+
                        r = r | luaL_optinteger(L, -1, 0);
                        lua_pop(L, 2);
                }
                lua_pop(L, 2);
        }
        lua_pop(L, 1);
+       
+       // window widgets
+       lua_getfield(L, 1, "widgets");
+       lua_pushnil(L);
+       while (lua_next(L, -2) != 0) {
+               lua_pushvalue(L, 2);
+               lua_pushvalue(L, -2);
+               lua_call(L, 1, 1);
+
+               r = r | luaL_optinteger(L, -1, 0);
+               lua_pop(L, 2);
+       }
+       lua_pop(L, 1);
+
+       // global "on top" widgets
+       jiveL_getframework(L);
+       lua_getfield(L, -1, "onTopWidgets");
+       lua_pushnil(L);
+       while (lua_next(L, -2) != 0) {
+               lua_pushvalue(L, 2);
+               lua_pushvalue(L, -2);
+               lua_call(L, 1, 1);
+
+               r = r | luaL_optinteger(L, -1, 0);
+               lua_pop(L, 2);
+       }
+       lua_pop(L, 2);
 
        lua_pushinteger(L, r);
        return 1;

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to