mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-27 14:07:03 +00:00
This PR adds the support of scaling in CPView. There are two new public methods in CPView : -(void)scaleUnitSquareToSize: and -(void)setScaleSize: -(void)scaleUnitSquareToSize: works exactly as in COCOA, it means if you set a first scale to 0.5 and then 0.5 again, the scaleSize of the view will be 0.25 -(void)setScaleSize: works with the value given. If you set 0.5 after you just seted 0.5 the scaleSize will be 0.5. This method is definitly better in using, specially when using the scaleSize binding with a slider. Test app in Tests/Manual/ScalingTest
99 lines
2.9 KiB
JavaScript
99 lines
2.9 KiB
JavaScript
/*
|
|
* Jakefile
|
|
* ScalingTest
|
|
*
|
|
* Created by You on July 23, 2013.
|
|
* Copyright 2013, Your Company All rights reserved.
|
|
*/
|
|
|
|
var ENV = require("system").env,
|
|
FILE = require("file"),
|
|
JAKE = require("jake"),
|
|
task = JAKE.task,
|
|
FileList = JAKE.FileList,
|
|
app = require("cappuccino/jake").app,
|
|
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
|
|
OS = require("os");
|
|
|
|
app ("ScalingTest", function(task)
|
|
{
|
|
ENV["OBJJ_INCLUDE_PATHS"] = "Frameworks";
|
|
|
|
if (configuration === "Debug")
|
|
ENV["OBJJ_INCLUDE_PATHS"] = FILE.join(ENV["OBJJ_INCLUDE_PATHS"], configuration);
|
|
|
|
task.setBuildIntermediatesPath(FILE.join("Build", "ScalingTest.build", configuration));
|
|
task.setBuildPath(FILE.join("Build", configuration));
|
|
|
|
task.setProductName("ScalingTest");
|
|
task.setIdentifier("com.yourcompany.ScalingTest");
|
|
task.setVersion("1.0");
|
|
task.setAuthor("Your Company");
|
|
task.setEmail("feedback @nospam@ yourcompany.com");
|
|
task.setSummary("ScalingTest");
|
|
task.setSources(new FileList("**/*.j").exclude(FILE.join("Build", "**")).exclude(FILE.join("Frameworks", "Source", "**")));
|
|
task.setResources(new FileList("Resources/**"));
|
|
task.setIndexFilePath("index.html");
|
|
task.setInfoPlistPath("Info.plist");
|
|
|
|
if (configuration === "Debug")
|
|
task.setCompilerFlags("-DDEBUG -g");
|
|
else
|
|
task.setCompilerFlags("-O");
|
|
});
|
|
|
|
task ("default", ["ScalingTest"], function()
|
|
{
|
|
printResults(configuration);
|
|
});
|
|
|
|
task ("build", ["default"]);
|
|
|
|
task ("debug", function()
|
|
{
|
|
ENV["CONFIGURATION"] = "Debug";
|
|
JAKE.subjake(["."], "build", ENV);
|
|
});
|
|
|
|
task ("release", function()
|
|
{
|
|
ENV["CONFIGURATION"] = "Release";
|
|
JAKE.subjake(["."], "build", ENV);
|
|
});
|
|
|
|
task ("run", ["debug"], function()
|
|
{
|
|
OS.system(["open", FILE.join("Build", "Debug", "ScalingTest", "index.html")]);
|
|
});
|
|
|
|
task ("run-release", ["release"], function()
|
|
{
|
|
OS.system(["open", FILE.join("Build", "Release", "ScalingTest", "index.html")]);
|
|
});
|
|
|
|
task ("deploy", ["release"], function()
|
|
{
|
|
FILE.mkdirs(FILE.join("Build", "Deployment", "ScalingTest"));
|
|
OS.system(["press", "-f", FILE.join("Build", "Release", "ScalingTest"), FILE.join("Build", "Deployment", "ScalingTest")]);
|
|
printResults("Deployment")
|
|
});
|
|
|
|
task ("desktop", ["release"], function()
|
|
{
|
|
FILE.mkdirs(FILE.join("Build", "Desktop", "ScalingTest"));
|
|
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "ScalingTest"), FILE.join("Build", "Desktop", "ScalingTest", "ScalingTest.app"));
|
|
printResults("Desktop")
|
|
});
|
|
|
|
task ("run-desktop", ["desktop"], function()
|
|
{
|
|
OS.system([FILE.join("Build", "Desktop", "ScalingTest", "ScalingTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
|
});
|
|
|
|
function printResults(configuration)
|
|
{
|
|
print("----------------------------");
|
|
print(configuration+" app built at path: "+FILE.join("Build", configuration, "ScalingTest"));
|
|
print("----------------------------");
|
|
}
|