From 028bc423a0115876c6803b070ae88771e9c30a13 Mon Sep 17 00:00:00 2001 From: Paul Liverman III Date: Tue, 2 Aug 2016 16:30:59 -0700 Subject: [PATCH] wip shits --- config.ld | 1 + docs/index.html | 7 ++- docs/modules/main.html | 106 +++++++++++++++++++++++++++++++++++++++++ docs/modules/pop.html | 41 +++++----------- docs/modules/util.html | 3 +- init.lua | 9 ++-- init.moon | 13 ++--- main.lua | 2 + main.moon | 9 ++++ 9 files changed, 151 insertions(+), 40 deletions(-) create mode 100644 docs/modules/main.html create mode 100644 main.lua create mode 100644 main.moon diff --git a/config.ld b/config.ld index 5b6276b..6bd76c4 100644 --- a/config.ld +++ b/config.ld @@ -1,5 +1,6 @@ file = { "init.moon", + "main.moon", "util.moon", } diff --git a/docs/index.html b/docs/index.html index 35c5e20..e915515 100644 --- a/docs/index.html +++ b/docs/index.html @@ -32,6 +32,7 @@

Modules

@@ -48,6 +49,10 @@ pop The Pop.Box GUI itself. + + main + A demo program for Pop.Box. + util Utility functions, intended for internal use only. @@ -58,7 +63,7 @@
generated by LDoc 1.4.3 -Last updated 2016-08-02 16:09:51 +Last updated 2016-08-02 16:30:36
diff --git a/docs/modules/main.html b/docs/modules/main.html new file mode 100644 index 0000000..714655c --- /dev/null +++ b/docs/modules/main.html @@ -0,0 +1,106 @@ + + + + + Documentation + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module main

+

A demo program for Pop.Box.

+

+ +

+

Info:

+
    +
  • Copyright: Paul Liverman III (2016)
  • +
  • License: The MIT License (MIT)
  • +
+ + +

Functions

+ + + + + +
pop () + +
+ +
+
+ + +

Functions

+ +
+
+ + pop () +
+
+ + + + + + + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.3 +Last updated 2016-08-02 16:30:36 +
+
+ + diff --git a/docs/modules/pop.html b/docs/modules/pop.html index 0c642dd..0c8fb2b 100644 --- a/docs/modules/pop.html +++ b/docs/modules/pop.html @@ -41,6 +41,7 @@

Modules

@@ -56,7 +57,7 @@

Info:

@@ -128,20 +129,16 @@

Issues

- - - - - + - + - +
- - pop-todo1 -
-
- Find out what happens if someone requires the init.lua / init.moon file instead of the directory, add an error message for this. - - - - - - - -
-
- - load-todo2 + + load-todo1
Determine if extensions should have a reference saved (and the possibility of a load function?) @@ -565,8 +548,8 @@ table.insert element.parent, element.parent\removeChild(element),
- - mousemoved-todo3 + + mousemoved-todo2
Implement a way for an element to attach itself to love.mousemoved() events? @@ -579,8 +562,8 @@ table.insert element.parent, element.parent\removeChild(element),
- - mousereleased-todo4 + + mousereleased-todo3
Figure out how to bring a focused element to the front of view (aka the first element in its parent's children). @@ -604,7 +587,7 @@ table.insert element.parent, element.parent\removeChild(element),
generated by LDoc 1.4.3 -Last updated 2016-08-02 16:09:51 +Last updated 2016-08-02 16:30:36
diff --git a/docs/modules/util.html b/docs/modules/util.html index 0be7d8b..5f3d3b1 100644 --- a/docs/modules/util.html +++ b/docs/modules/util.html @@ -39,6 +39,7 @@

Modules

@@ -112,7 +113,7 @@
generated by LDoc 1.4.3 -Last updated 2016-08-02 16:09:51 +Last updated 2016-08-02 16:30:36
diff --git a/init.lua b/init.lua index c35b794..1e2f50b 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ local pop = { - _VERSION = 'Pop.Box v0.0.0', + _VERSION = '0.0.0', _DESCRIPTION = 'GUI library for LOVE, designed for ease of use', _URL = 'http://github.com/Guard13007/Pop.Box', _LICENSE = 'The MIT License (MIT)', @@ -8,6 +8,10 @@ local pop = { if not (love.getVersion) then error("Pop.Box only supports LOVE versions >= 0.9.1") end +if (...):sub(-4) == "init" then + error("Pop.Box must be required by its containing folder") +end +local path = ... local filesystem, graphics do local _obj_0 = love @@ -16,8 +20,7 @@ end local insert insert = table.insert local inheritsFromElement -inheritsFromElement = require(tostring(...) .. "/util").inheritsFromElement -local path = ... +inheritsFromElement = require(tostring(path) .. "/util").inheritsFromElement pop.elements = { } pop.skins = { } pop.screen = false diff --git a/init.moon b/init.moon index f2ab5ea..51a857e 100644 --- a/init.moon +++ b/init.moon @@ -2,10 +2,10 @@ --- @module pop --- @copyright Paul Liverman III (2015-2016) --- @license The MIT License (MIT) ---- @release v0.0.0 +--- @release 0.0.0 pop = { - _VERSION: 'Pop.Box v0.0.0' + _VERSION: '0.0.0' _DESCRIPTION: 'GUI library for LOVE, designed for ease of use' _URL: 'http://github.com/Guard13007/Pop.Box' _LICENSE: 'The MIT License (MIT)' @@ -15,13 +15,14 @@ pop = { unless love.getVersion error "Pop.Box only supports LOVE versions >= 0.9.1" ---- @todo Find out what happens if someone requires the `init.lua` / `init.moon` file instead of the directory, add an error message for this. +if (...)\sub(-4) == "init" + error "Pop.Box must be required by its containing folder" + +path = ... import filesystem, graphics from love import insert from table -import inheritsFromElement from require "#{...}/util" - -path = ... +import inheritsFromElement from require "#{path}/util" --- @table pop --- @field elements All GUI classes are stored here. diff --git a/main.lua b/main.lua new file mode 100644 index 0000000..0956661 --- /dev/null +++ b/main.lua @@ -0,0 +1,2 @@ +local pop = require("init") +return print(pop, pop.elements) diff --git a/main.moon b/main.moon new file mode 100644 index 0000000..dabb10c --- /dev/null +++ b/main.moon @@ -0,0 +1,9 @@ +--- A demo program for Pop.Box. +--- @copyright Paul Liverman III (2016) +--- @license The MIT License (MIT) + +--- @todo write this! + +pop = require "init" + +print(pop, pop.elements)
pop-todo1Find out what happens if someone requires the init.lua / init.moon file instead of the directory, add an error message for this.
load-todo2load-todo1 Determine if extensions should have a reference saved (and the possibility of a load function?) require into pop.extensions by filename
mousemoved-todo3mousemoved-todo2 Implement a way for an element to attach itself to love.mousemoved() events?
mousereleased-todo4mousereleased-todo3 Figure out how to bring a focused element to the front of view (aka the first element in its parent's children). (If I do it right here, the for loop above may break! I need to test/figure this out.) NOTE this might cause an error in the above for loop! @@ -536,22 +533,8 @@ table.insert element.parent, element.parent\removeChild(element),