Author: titmuss
Date: Tue Apr 22 07:23:30 2008
New Revision: 2313
URL: http://svn.slimdevices.com?rev=2313&root=Jive&view=rev
Log:
Bug: N/A
Description:
Use Framework.constants in the jive applets.
Modified:
7.1/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFactoryReset/SetupFactoryResetApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupSSH/SetupSSHApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWelcome/SetupWelcomeApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWireless/SetupWirelessApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestDisplay/TestDisplayApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestIR/TestIRApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestKeypad/TestKeypadApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestMotion/TestMotionApplet.lua
Modified: 7.1/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
--- 7.1/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua (original)
+++ 7.1/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua Tue Apr
22 07:23:30 2008
@@ -166,6 +166,10 @@
=cut
--]]
function constants(module)
+ module.EVENT_UNUSED = jive.ui.EVENT_UNUSED
+ module.EVENT_CONSUME = jive.ui.EVENT_CONSUME
+ module.EVENT_QUIT = jive.ui.EVENT_QUIT
+
module.EVENT_SCROLL = jive.ui.EVENT_SCROLL
module.EVENT_ACTION = jive.ui.EVENT_ACTION
module.EVENT_KEY_DOWN = jive.ui.EVENT_KEY_DOWN
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFactoryReset/SetupFactoryResetApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFactoryReset/SetupFactoryResetApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFactoryReset/SetupFactoryResetApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFactoryReset/SetupFactoryResetApplet.lua
Tue Apr 22 07:23:30 2008
@@ -15,14 +15,10 @@
local Window = require("jive.ui.Window")
local log =
require("jive.utils.log").logger("applets.setup")
-
-local EVENT_ALL_INPUT = jive.ui.EVENT_ALL_INPUT
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-
local appletManager = appletManager
-module(...)
+module(..., Framework.constants)
oo.class(_M, Applet)
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua
Tue Apr 22 07:23:30 2008
@@ -42,8 +42,6 @@
local JIVE_VERSION = jive.JIVE_VERSION
-local EVENT_ACTION = jive.ui.EVENT_ACTION
-local EVENT_WINDOW_POP = jive.ui.EVENT_WINDOW_POP
local LAYER_FRAME = jive.ui.LAYER_FRAME
local LAYER_CONTENT_ON_STAGE = jive.ui.LAYER_CONTENT_ON_STAGE
@@ -54,31 +52,13 @@
local LAYOUT_CENTER = jive.ui.LAYOUT_CENTER
local LAYOUT_NONE = jive.ui.LAYOUT_NONE
-local EVENT_ALL_INPUT = jive.ui.EVENT_ALL_INPUT
-local EVENT_KEY_PRESS = jive.ui.EVENT_KEY_PRESS
-local EVENT_KEY_HOLD = jive.ui.EVENT_KEY_HOLD
-local EVENT_WINDOW_ACTIVE = jive.ui.EVENT_WINDOW_ACTIVE
-local EVENT_WINDOW_INACTIVE = jive.ui.EVENT_WINDOW_INACTIVE
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-local EVENT_UNUSED = jive.ui.EVENT_UNUSED
-
-local KEY_FWD = jive.ui.KEY_FWD
-local KEY_REW = jive.ui.KEY_REW
-local KEY_GO = jive.ui.KEY_GO
-local KEY_BACK = jive.ui.KEY_BACK
-local KEY_UP = jive.ui.KEY_UP
-local KEY_DOWN = jive.ui.KEY_DOWN
-local KEY_LEFT = jive.ui.KEY_LEFT
-local KEY_RIGHT = jive.ui.KEY_RIGHT
-local KEY_HOME = jive.ui.KEY_HOME
-
local firmwareupgradeTitleStyle = 'settingstitle'
local DEFAULT_FIRMWARE_URL =
"http://www.slimdevices.com/update/firmware/7.0/jive.bin"
local SDCARD_PATH = "/mnt/mmc/"
-module(...)
+module(..., Framework.constants)
oo.class(_M, Applet)
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupSSH/SetupSSHApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupSSH/SetupSSHApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupSSH/SetupSSHApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupSSH/SetupSSHApplet.lua
Tue Apr 22 07:23:30 2008
@@ -21,10 +21,7 @@
local log =
require("jive.utils.log").logger("applets.setup")
-local EVENT_ALL = jive.ui.EVENT_ALL
-
-
-module(...)
+module(..., Framework.constants)
oo.class(_M, Applet)
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWelcome/SetupWelcomeApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWelcome/SetupWelcomeApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWelcome/SetupWelcomeApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWelcome/SetupWelcomeApplet.lua
Tue Apr 22 07:23:30 2008
@@ -40,17 +40,6 @@
local table = require("jive.utils.table")
local appletManager = appletManager
-local EVENT_KEY_PRESS = jive.ui.EVENT_KEY_PRESS
-local EVENT_KEY_HOLD = jive.ui.EVENT_KEY_HOLD
-local EVENT_SCROLL = jive.ui.EVENT_SCROLL
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-local EVENT_ACTION = jive.ui.EVENT_ACTION
-local EVENT_WINDOW_POP = jive.ui.EVENT_WINDOW_POP
-local KEY_GO = jive.ui.KEY_GO
-local KEY_BACK = jive.ui.KEY_BACK
-local KEY_FWD = jive.ui.KEY_FWD
-local KEY_REW = jive.ui.KEY_REW
-local KEY_HOME = jive.ui.KEY_HOME
local jiveMain = jiveMain
local jnt = jnt
@@ -58,7 +47,7 @@
local welcomeTitleStyle = 'settingstitle'
-module(...)
+module(..., Framework.constants)
oo.class(_M, Applet)
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWireless/SetupWirelessApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWireless/SetupWirelessApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWireless/SetupWirelessApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SetupWireless/SetupWirelessApplet.lua
Tue Apr 22 07:23:30 2008
@@ -38,9 +38,6 @@
local jnt = jnt
-local EVENT_ACTION = jive.ui.EVENT_ACTION
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-local EVENT_WINDOW_POP = jive.ui.EVENT_WINDOW_POP
local LAYER_FRAME = jive.ui.LAYER_FRAME
local LAYER_CONTENT_ON_STAGE = jive.ui.LAYER_CONTENT_ON_STAGE
@@ -51,29 +48,12 @@
local LAYOUT_CENTER = jive.ui.LAYOUT_CENTER
local LAYOUT_NONE = jive.ui.LAYOUT_NONE
-local EVENT_KEY_PRESS = jive.ui.EVENT_KEY_PRESS
-local EVENT_WINDOW_POP = jive.ui.EVENT_WINDOW_POP
-local EVENT_WINDOW_ACTIVE = jive.ui.EVENT_WINDOW_ACTIVE
-local EVENT_WINDOW_INACTIVE = jive.ui.EVENT_WINDOW_INACTIVE
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-local EVENT_UNUSED = jive.ui.EVENT_UNUSED
-
-local KEY_FWD = jive.ui.KEY_FWD
-local KEY_REW = jive.ui.KEY_REW
-local KEY_GO = jive.ui.KEY_GO
-local KEY_BACK = jive.ui.KEY_BACK
-local KEY_UP = jive.ui.KEY_UP
-local KEY_DOWN = jive.ui.KEY_DOWN
-local KEY_LEFT = jive.ui.KEY_LEFT
-local KEY_RIGHT = jive.ui.KEY_RIGHT
-
-
-- configuration
local CONNECT_TIMEOUT = 30
local wirelessTitleStyle = 'settingstitle'
-module(...)
+module(..., Framework.constants)
oo.class(_M, Applet)
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
Tue Apr 22 07:23:30 2008
@@ -41,9 +41,6 @@
local iconbar = iconbar
local appletManager = appletManager
-local EVENT_ACTION = jive.ui.EVENT_ACTION
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-local EVENT_WINDOW_POP = jive.ui.EVENT_WINDOW_POP
local LAYER_FRAME = jive.ui.LAYER_FRAME
local LAYER_CONTENT_ON_STAGE = jive.ui.LAYER_CONTENT_ON_STAGE
@@ -54,27 +51,11 @@
local LAYOUT_CENTER = jive.ui.LAYOUT_CENTER
local LAYOUT_NONE = jive.ui.LAYOUT_NONE
-local EVENT_KEY_DOWN = jive.ui.EVENT_KEY_DOWN
-local EVENT_KEY_PRESS = jive.ui.EVENT_KEY_PRESS
-local EVENT_KEY_HOLD = jive.ui.EVENT_KEY_HOLD
-local EVENT_ALL_INPUT = jive.ui.EVENT_ALL_INPUT
-local EVENT_SCROLL = jive.ui.EVENT_SCROLL
-local EVENT_SWITCH = 0x400000 -- XXXX fixme when public
-local EVENT_MOTION = 0x800000 -- XXXX fixme when public
-local EVENT_WINDOW_PUSH = jive.ui.EVENT_WINDOW_PUSH
-local EVENT_VISIBLE_ALL = jive.ui.EVENT_VISIBLE_ALL
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-local EVENT_UNUSED = jive.ui.EVENT_UNUSED
-
-local KEY_ADD = jive.ui.KEY_ADD
-local KEY_PLAY = jive.ui.KEY_PLAY
-local KEY_HOME = jive.ui.KEY_HOME
-
local SW_AC_POWER = 0
local SW_PHONE_DETECT = 1
local squeezeboxjiveTitleStyle = 'settingstitle'
-module(...)
+module(..., Framework.constants)
oo.class(_M, Applet)
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestDisplay/TestDisplayApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestDisplay/TestDisplayApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestDisplay/TestDisplayApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestDisplay/TestDisplayApplet.lua
Tue Apr 22 07:23:30 2008
@@ -15,15 +15,8 @@
local Timer = require("jive.ui.Timer")
local math = require("math")
-local EVENT_KEY_PRESS = jive.ui.EVENT_KEY_PRESS
-local EVENT_WINDOW_RESIZE = jive.ui.EVENT_WINDOW_RESIZE
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-local KEY_GO = jive.ui.KEY_GO
-local KEY_BACK = jive.ui.KEY_BACK
-
-
-module(...)
+module(..., Framework.constants)
oo.class(_M, Applet)
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestIR/TestIRApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestIR/TestIRApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestIR/TestIRApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestIR/TestIRApplet.lua
Tue Apr 22 07:23:30 2008
@@ -17,21 +17,6 @@
local Framework = require("jive.ui.Framework")
local log = require("jive.utils.log").logger("applets.misc")
-
-local EVENT_SCROLL = jive.ui.EVENT_SCROLL
-local EVENT_KEY_DOWN = jive.ui.EVENT_KEY_DOWN
-local EVENT_KEY_PRESS = jive.ui.EVENT_KEY_PRESS
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-local EVENT_UNUSED = jive.ui.EVENT_UNUSED
-local KEY_ADD = jive.ui.KEY_ADD
-local KEY_PLAY = jive.ui.KEY_PLAY
-local KEY_REW = jive.ui.KEY_REW
-local KEY_PAUSE = jive.ui.KEY_PAUSE
-local KEY_FWD = jive.ui.KEY_FWD
-local KEY_VOLUME_UP = jive.ui.KEY_VOLUME_UP
-local KEY_VOLUME_DOWN = jive.ui.KEY_VOLUME_DOWN
-local KEY_GO = jive.ui.KEY_GO
-local KEY_BACK = jive.ui.KEY_BACK
local bin_path = "/usr/bin/testir"
@@ -65,7 +50,7 @@
{ key=KEY_BRIGHTNESS, x=185, y=289, dx=222, dy=314, ir="0x768904fb" },
}
-module(...)
+module(..., Framework.constants)
oo.class(_M, Applet)
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestKeypad/TestKeypadApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestKeypad/TestKeypadApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestKeypad/TestKeypadApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestKeypad/TestKeypadApplet.lua
Tue Apr 22 07:23:30 2008
@@ -17,27 +17,9 @@
local Popup = require("jive.ui.Popup")
local Textarea = require("jive.ui.Textarea")
-local EVENT_KEY_ALL = jive.ui.EVENT_KEY_ALL
-local EVENT_KEY_DOWN = jive.ui.EVENT_KEY_DOWN
-local EVENT_KEY_UP = jive.ui.EVENT_KEY_UP
-local EVENT_KEY_PRESS = jive.ui.EVENT_KEY_PRESS
-local EVENT_KEY_HOLD = jive.ui.EVENT_KEY_HOLD
-local EVENT_CONSUME = jive.ui.EVENT_CONSUME
-local EVENT_UNUSED = jive.ui.EVENT_UNUSED
-local EVENT_ACTION = jive.ui.EVENT_ACTION
-local EVENT_SCROLL = jive.ui.EVENT_SCROLL
-local KEY_FWD = jive.ui.KEY_FWD
-local KEY_REW = jive.ui.KEY_REW
-local KEY_HOME = jive.ui.KEY_HOME
-local KEY_PLAY = jive.ui.KEY_PLAY
-local KEY_ADD = jive.ui.KEY_ADD
-local KEY_BACK = jive.ui.KEY_BACK
-local KEY_PAUSE = jive.ui.KEY_PAUSE
-local KEY_VOLUME_DOWN = jive.ui.KEY_VOLUME_DOWN
-local KEY_VOLUME_UP = jive.ui.KEY_VOLUME_UP
-local KEY_GO = jive.ui.KEY_GO
-local WHEEL_CW = jive.ui.KEY_DOWN
-local WHEEL_CCW = jive.ui.KEY_UP
+
+module(..., Framework.constants)
+oo.class(_M, Applet)
local keyState = {}
@@ -55,21 +37,15 @@
{ key = KEY_VOLUME_DOWN, name = "KEY_VOLUME_DOWN", x = 92, y = 215 },
{ key = KEY_VOLUME_UP, name = "KEY_VOLUME_UP", x = 140, y = 215 },
{ key = KEY_GO, name = "KEY_GO", x = 115, y = 110 },
- { key = WHEEL_CW, name = "WHEEL_CW", x = 160, y = 110 },
- { key = WHEEL_CCW, name = "WHEEL_CCW", x = 75, y = 110 },
+ { key = KEY_UP, name = "KEY_UP", x = 160, y = 110 },
+ { key = KEY_DOWN, name = "KEY_DOWN", x = 75, y = 110 },
}
-
local stateToColor = {}
stateToColor[EVENT_KEY_UP] = 0x00FF00FF
stateToColor[EVENT_KEY_DOWN] = 0xFF0000FF
stateToColor[EVENT_KEY_PRESS] = 0x0000FFFF
stateToColor[EVENT_KEY_HOLD] = 0xFFFFFFFF
-
-
-
-module(...)
-oo.class(_M, Applet)
-- test if all buttons have been pressed and released
@@ -122,26 +98,26 @@
wheelState = wheelState + dir
if wheelState > 0 then
- if keyState[WHEEL_CW] == EVENT_KEY_UP then
+ if keyState[KEY_UP] == EVENT_KEY_UP then
wheelState = 0
elseif wheelState >= 12 then
- keyState[WHEEL_CW] = EVENT_KEY_UP
+ keyState[KEY_UP] = EVENT_KEY_UP
else
- keyState[WHEEL_CW] = EVENT_KEY_DOWN
+ keyState[KEY_UP] = EVENT_KEY_DOWN
end
end
if wheelState < 0 then
- if keyState[WHEEL_CCW] == EVENT_KEY_UP then
+ if keyState[KEY_DOWN] == EVENT_KEY_UP then
wheelState = 0
elseif wheelState <= -12 then
- keyState[WHEEL_CCW] = EVENT_KEY_UP
+ keyState[KEY_DOWN] = EVENT_KEY_UP
else
- keyState[WHEEL_CCW] = EVENT_KEY_DOWN
+ keyState[KEY_DOWN] = EVENT_KEY_DOWN
end
end
end
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestMotion/TestMotionApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestMotion/TestMotionApplet.lua?rev=2313&root=Jive&r1=2312&r2=2313&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestMotion/TestMotionApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/TestMotion/TestMotionApplet.lua
Tue Apr 22 07:23:30 2008
@@ -20,13 +20,7 @@
local Window = require("jive.ui.Window")
-local EVENT_KEY_PRESS = jive.ui.EVENT_KEY_PRESS
-local EVENT_MOTION = 0x800000 -- XXXX fixme when public
-local KEY_GO = jive.ui.KEY_GO
-local KEY_BACK = jive.ui.KEY_BACK
-
-
-module(...)
+module(..., Framework.constants)
oo.class(_M, Applet)
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins