Skip to content

Commit

Permalink
Merge pull request #2 from structuresound/generics
Browse files Browse the repository at this point in the history
Generics
  • Loading branch information
Leif Shackelford committed Aug 17, 2015
2 parents 2e5c645 + f117c71 commit 01787e3
Show file tree
Hide file tree
Showing 20 changed files with 735 additions and 718 deletions.
15 changes: 10 additions & 5 deletions NodeKittenX.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ s.source_files = "blocks/leif/NodeKittenX/*.{h}","blocks/leif/NodeKittenX/Platfo

s.subspec "freetypegl" do |freetypegl|
freetypegl.source_files = "deps/leif/freetype-gl/*.{h,c,cpp}"
#freetypegl.ios.vendored_libraries = "libs/ios/libFreetype2/libFreetype2.a"

freetypegl.subspec "freetype" do |freetype|
freetype.osx.source_files = "deps/miguel/freetype/src/base/*.{h,c}"
freetype.ios.source_files = "deps/miguel/freetype/src/base/ftadvanc.c",
Expand Down Expand Up @@ -87,18 +87,23 @@ s.subspec "freetypegl" do |freetypegl|
"deps/miguel/freetype/src/type42/type42.{h,c}",
"deps/miguel/freetype/src/winfonts/winfnt.{h,c}"
freetype.compiler_flags = '-DFT2_BUILD_LIBRARY=1 -DDARWIN_NO_CARBON -DFT_CONFIG_OPTION_SYSTEM_ZLIB=1'
freetype.xcconfig = { "HEADER_SEARCH_PATHS" => "/Users/leif/ClionProjects/NodeKittenX/deps/miguel/freetype/include" }
#freetype.xcconfig = { "HEADER_SEARCH_PATHS" => "
freetype.xcconfig = { "HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/deps/miguel/freetype/include" }
end
freetypegl.xcconfig = { "HEADER_SEARCH_PATHS" => "/Users/leif/ClionProjects/NodeKittenX/libs/ios/libFreetype2/include" }
end

s.subspec "picojpeg" do |picojpeg|
picojpeg.source_files = "deps/leif/picojpeg/*.{h,c,cpp}"
end

s.subspec "kiwi" do |kiwi|
kiwi.source_files = "deps/leif/kiwi/kiwi/*.{h}"
kiwi.source_files = "deps/leif/kiwi/kiwi/*.{h, hpp}"
end

s.subspec "underscore" do |underscore|
underscore.source_files = "deps/leif/underscore/_.hpp",
"deps/leif/underscore/underscore/underscore.h",
"deps/leif/underscore/underscorehpp/*.hpp"
underscore.xcconfig = { "HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/deps/leif/underscore" }
end

s.subspec "png" do |png|
Expand Down
33 changes: 25 additions & 8 deletions blocks/leif/NodeKittenX/Examples/LayoutExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,35 @@
//
//


#include "LayoutExample.h"

void LayoutExample::moveToView() {
auto container = ContainerView::viewWithSize(size.get().xy);
container
->addRow(V2{.5, .5})
->addColumn(V2{.5, .5});
container->addRow(V2{.5, .5})->setBackgroundColor(Color{.3, .3, .3});
addChild(container);
setLayoutMethod(Layout::Method::Vertical);

addChild(View::view())->setBackgroundColor(Color("red"));
addChild(View::view())->setBackgroundColor(Color("orange"));
addChild(View::view())->setBackgroundColor(Color("yellow"));
addChild(View::view())->setBackgroundColor(Color("green"));
addChild(View::view())->setBackgroundColor(Color("blue"));
auto row = addChild(View::view())->setBackgroundColor(Color("violet"));

row->setLayoutMethod(Layout::Method::Horizontal);
row->addChild(View::view())->setBackgroundColor(Color("red"));
row->addChild(View::view())->setBackgroundColor(Color("orange"));
row->addChild(View::view())->setBackgroundColor(Color("yellow"));
row->addChild(View::view())->setBackgroundColor(Color("green"));
row->addChild(View::view())->setBackgroundColor(Color("blue"));
auto col = row->addChild(View::view())->setBackgroundColor(Color("violet"));

col->setLayoutMethod(Layout::Method::Vertical);
col->addChild(View::view())->setBackgroundColor(Color("red"));
col->addChild(View::view())->setBackgroundColor(Color("orange"));
col->addChild(View::view())->setBackgroundColor(Color("yellow"));
col->addChild(View::view())->setBackgroundColor(Color("green"));
col->addChild(View::view())->setBackgroundColor(Color("blue"));
col->addChild(View::view())->setBackgroundColor(Color("violet"));
}

void LayoutExample::handleUXEvent(shared_ptr<UXEvent> event){

}
Loading

0 comments on commit 01787e3

Please sign in to comment.