diff modules/ModuleTemplate.lua @ 109:410d036c43b2

- reorganize modularity file structure (part 1)
author Flick <flickerstreak@gmail.com>
date Thu, 08 Jan 2009 00:57:27 +0000
parents
children 729e284b2576
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/ModuleTemplate.lua	Thu Jan 08 00:57:27 2009 +0000
@@ -0,0 +1,73 @@
+--[[
+  ReAction module template
+
+--]]
+
+-- local imports
+local ReAction = ReAction
+local L = ReAction.L
+local _G = _G
+
+-- module declaration
+local moduleID = "MyModuleName"
+local module = ReAction:NewModule( moduleID,
+  -- mixins go here
+)
+
+-- handlers
+function module:OnInitialize()
+  self.db = ReAction.db:RegisterNamespace( moduleID
+    {
+      profile = {
+        -- default profile goes here
+      }
+    }
+  )
+
+  -- register some common events
+  ReAction.RegisterCallback(self, "OnCreateBar")
+  ReAction.RegisterCallback(self, "OnDestroyBar")
+  ReAction.RegisterCallback(self, "OnRefreshBar")
+  ReAction.RegisterCallback(self, "OnEraseBar")
+  ReAction.RegisterCallback(self, "OnRenameBar")
+  ReAction.RegisterCallback(self, "OnConfigModeChanged")
+end
+
+function module:OnEnable()
+
+end
+
+function module:OnDisable()
+
+end
+
+-- apply module features and settings to a bar object (see Bar.lua for Bar API)
+function module:OnCreateBar(event, bar, name)
+
+end
+
+-- remove module features and settings from a bar object
+function module:OnDestroyBar(event, bar, name)
+
+end
+
+-- refresh module features and settings on a bar object
+function module:OnRefreshBar(event, bar, name)
+
+end
+
+-- erase any local configuration entries for the supplied bar name
+function module:OnEraseBar(event, bar, name)
+
+end
+
+-- update any local configuration/option entries with the new bar name index
+function module:OnRenameBar(event, bar, oldName, newName)
+
+end
+
+-- update any local display/options based on config mode (true/false)
+function module:OnConfigModeChanged(event, mode)
+
+end
+