From: Paul Wisbey
Date: Thu, 21 Jul 2016 09:49:51 +0000 (-0700)
Subject: Merge "Fix for the cursor position with the arabic script." into devel/master
X-Git-Tag: dali_1.1.44~3
X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=d00a250741411c386d988e7ac34525cf94a1918e;hp=8d92a2cdf4665c1831b524af0a316208947e27c1
Merge "Fix for the cursor position with the arabic script." into devel/master
---
diff --git a/automated-tests/patch-coverage.pl b/automated-tests/patch-coverage.pl
new file mode 100755
index 0000000..68754eb
--- /dev/null
+++ b/automated-tests/patch-coverage.pl
@@ -0,0 +1,555 @@
+#!/usr/bin/perl
+#
+# Copyright (c) 2016 Samsung Electronics Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+use strict;
+use Git;
+use Getopt::Long;
+use Error qw(:try);
+use Pod::Usage;
+use File::Basename;
+use File::stat;
+use Scalar::Util qw /looks_like_number/;
+use Cwd qw /getcwd/;
+use Term::ANSIColor qw(:constants);
+
+# Program to run gcov on files in patch (that are in source dirs - needs to be dali-aware).
+
+# A) Get patch
+# B) Remove uninteresting files
+# C) Find matching gcno/gcda files
+# D) Copy and rename them to match source prefix (i.e. strip library name off front)
+# E) Generate patch output with covered/uncovered lines marked in green/red
+# F) Generate coverage data for changed lines
+# G) Exit status should be 0 for high coverage (90% line coverage for all new/changed lines)
+# or 1 for low coverage
+
+# Sources for conversion of gcno/gcda files:
+# ~/bin/lcov
+# Python git-coverage (From http://stef.thewalter.net/git-coverage-useful-code-coverage.html)
+
+our $repo = Git->repository();
+our $debug=0;
+our $pd_debug=0;
+our $opt_cached;
+our $opt_head;
+#our $opt_workingtree;
+#our $opt_diff=1;
+our $opt_help;
+our $opt_verbose;
+our $opt_quiet;
+
+my %options = (
+ "cached" => { "optvar"=>\$opt_cached, "desc"=>"Use index" },
+ "head" => { "optvar"=>\$opt_head, "desc"=>"Use git show" },
+ "help" => { "optvar"=>\$opt_help, "desc"=>""},
+ "quiet" => { "optvar"=>\$opt_quiet, "desc"=>""},
+ "verbose" => { "optvar"=>\$opt_verbose, "desc"=>"" });
+
+my %longOptions = map { $_ => $options{$_}->{"optvar"} } keys(%options);
+GetOptions( %longOptions ) or pod2usage(2);
+pod2usage(1) if $opt_help;
+
+
+## Format per file, repeated, no linebreak
+#
+# index c1..c2 c3
+# --- a/
+# +++ b/
+#
+
+# Format of each diff hunk, repeated, no linebreak
+# @@ @@ line
+# 3 lines of context
+# [-|+]lines removed on left, added on right
+# 3 lines of context
+#
+# output:
+sub parse_diff
+{
+ my $patchref = shift;
+ my $file="";
+ my @checklines=();
+ my %b_lines=();
+ my $state = 0;
+ my $store_line=-1;
+ my %files=();
+
+ print "Patch size: ".scalar(@$patchref)."\n" if $pd_debug;
+ for my $line (@$patchref)
+ {
+ if($state == 0)
+ {
+ print "State: $state $line \n" if $pd_debug;
+ # Search for a line matching "+++ b/"
+ if( $line =~ m!^\+\+\+ b/([\w-_\./]*)!)
+ {
+ $file = $1;
+ $state = 1 ;
+ print "Found File: $file\n" if $pd_debug;
+ }
+ }
+ else #elsif($state == 1)
+ {
+ # If we find a line starting with diff, the previous
+ # file's diffs have finished, store them.
+ if( $line =~ /^diff/)
+ {
+ print "State: $state $line \n" if $pd_debug;
+ $state = 0;
+ # if the file had changes, store the new/modified line numbers
+ if( $file && scalar(@checklines))
+ {
+ $files{$file}->{"patch"} = [@checklines];
+ $files{$file}->{"b_lines"} = {%b_lines};
+ @checklines=();
+ %b_lines=();
+ }
+ print("\n\n") if $pd_debug;
+ }
+ # If we find a line starting with @@, it tells us the line numbers
+ # of the old file and new file for this hunk.
+ elsif( $line =~ /^@@/)
+ {
+ print "State: $state $line \n" if $pd_debug;
+
+ # Find the lines in the new file (of the form "+[,])
+ my($start,$space,$length) = ($line =~ /\+([0-9]+)(,| )([0-9]+)?/);
+ if($length || $space eq " ")
+ {
+ if( $space eq " " )
+ {
+ $length=1;
+ }
+ push(@checklines, [$start, $length]);
+ $store_line=$start;
+ }
+ else
+ {
+ $store_line = -1;
+ }
+ if($pd_debug)
+ {
+ my $last = scalar(@checklines)-1;
+ if( $last >= 0 )
+ {
+ print "Checkline:" . $checklines[$last]->[0] . ", " . $checklines[$last]->[1] . "\n";
+ }
+ }
+ }
+ # If we find a line starting with "+", it belongs to the new file's patch
+ elsif( $line =~ /^\+/)
+ {
+ if($store_line >= 0)
+ {
+ chomp;
+ $line = substr($line, 1); # Remove leading +
+ $b_lines{$store_line} = $line;
+ $store_line++;
+ }
+ }
+ }
+ }
+ # Store the final entry
+ $files{$file}->{"patch"} = [@checklines];
+ $files{$file}->{"b_lines"} = {%b_lines};
+
+ my %filter = map { $_ => $files{$_} } grep {m!^dali(-toolkit)?/!} (keys(%files));;
+
+ if($pd_debug)
+ {
+ print("Filtered files:\n");
+ foreach my $file (keys(%filter))
+ {
+ print("$file: ");
+ $patchref = $filter{$file}->{"patch"};
+ foreach my $lineblock (@$patchref)
+ {
+ print "$lineblock->[0]($lineblock->[1]) "
+ }
+ print ( "\n");
+ }
+ }
+
+ return {%filter};
+}
+
+sub show_patch_lines
+{
+ my $filesref = shift;
+ print "\nNumber of files: " . scalar(keys(%$filesref)) . "\n";
+ for my $file (keys(%$filesref))
+ {
+ print("$file:");
+ my $clref = $filesref->{$file}->{"patch"};
+ for my $cl (@$clref)
+ {
+ print("($cl->[0],$cl->[1]) ");
+ }
+ print("\n");
+ }
+}
+
+sub get_gcno_file
+{
+ # Assumes test cases have been run, and "make rename_cov_data" has been executed
+
+ my $file = shift;
+ my ($name, $path, $suffix) = fileparse($file, (".c", ".cpp", ".h"));
+ my $gcno_file = $repo->wc_path() . "/build/tizen/.cov/$name.gcno";
+
+ # Note, will translate headers to their source's object, which
+ # may miss execution code in the headers (e.g. inlines are usually
+ # not all used in the implementation, and require getting coverage
+ # from test cases.
+
+ if( -f $gcno_file )
+ {
+ my $gcno_st = stat($gcno_file);
+ my $fq_file = $repo->wc_path() . $file;
+ my $src_st = stat($fq_file);
+ if($gcno_st->ctime < $src_st->mtime)
+ {
+ print "WARNING: GCNO $gcno_file older than SRC $fq_file\n";
+ $gcno_file="";
+ }
+
+ }
+ else
+ {
+ print("WARNING: No equivalent gcno file for $file\n");
+ }
+ return $gcno_file;
+}
+
+our %gcovfiles=();
+sub get_coverage
+{
+ my $file = shift;
+ my $filesref = shift;
+ print("get_coverage($file)\n") if $debug;
+
+ my $gcno_file = get_gcno_file($file);
+ my @gcov_files = ();
+ my $gcovfile;
+ if( $gcno_file )
+ {
+ print "Running gcov on $gcno_file:\n" if $debug;
+ open( my $fh, "gcov --preserve-paths $gcno_file |") || die "Can't run gcov:$!\n";
+ while( <$fh> )
+ {
+ print $_ if $debug>=3;
+ chomp;
+ if( m!'(.*\.gcov)'$! )
+ {
+ my $coverage_file = $1; # File has / replaced with # and .. replaced with ^
+ my $source_file = $coverage_file;
+ $source_file =~ s!\^!..!g; # Change ^ to ..
+ $source_file =~ s!\#!/!g; # change #'s to /s
+ $source_file =~ s!.gcov$!!; # Strip off .gcov suffix
+
+ print "Matching $file against $source_file\n" if $debug >= 3;
+ # Only want the coverage files matching source file:
+ if(index( $source_file, $file ) > 0 )
+ {
+ $gcovfile = $coverage_file;
+ last;
+ }
+ }
+ }
+ close($fh);
+
+ if($gcovfile)
+ {
+ if($gcovfiles{$gcovfile} == undef)
+ {
+ # Only parse a gcov file once
+ $gcovfiles{$gcovfile}->{"seen"}=1;
+
+ print "Getting coverage data from $gcovfile\n" if $debug;
+
+ open( FH, "< $gcovfile" ) || die "Can't open $gcovfile for reading:$!\n";
+ while()
+ {
+ my ($cov, $line, @code ) = split( /:/, $_ );
+ $cov =~ s/^\s+//; # Strip leading space
+ $line =~ s/^\s+//;
+ my $code=join(":", @code);
+ if($cov =~ /\#/)
+ {
+ # There is no coverage data for these executable lines
+ $gcovfiles{$gcovfile}->{"uncovered"}->{$line}++;
+ $gcovfiles{$gcovfile}->{"src"}->{$line}=$code;
+ }
+ elsif( $cov ne "-" && looks_like_number($cov) && $cov > 0 )
+ {
+ $gcovfiles{$gcovfile}->{"covered"}->{$line}=$cov;
+ $gcovfiles{$gcovfile}->{"src"}->{$line}=$code;
+ }
+ else
+ {
+ # All other lines are not executable.
+ $gcovfiles{$gcovfile}->{"src"}->{$line}=$code;
+ }
+ }
+ close( FH );
+ }
+ $filesref->{$file}->{"coverage"} = $gcovfiles{$gcovfile}; # store hashref
+ }
+ else
+ {
+ # No gcov output - the gcno file produced no coverage of the source/header
+ # Probably means that there is no coverage for the file (with the given
+ # test case - there may be some somewhere, but for the sake of speed, don't
+ # check (yet).
+ }
+ }
+}
+
+# Run the git diff command to get the patch, then check the coverage
+# output for the patch.
+sub run_diff
+{
+ my ($fh, $c) = $repo->command_output_pipe(@_);
+ our @patch=();
+ while(<$fh>)
+ {
+ chomp;
+ push @patch, $_;
+ }
+ $repo->command_close_pipe($fh, $c);
+
+ # @patch has slurped diff for all files...
+ my $filesref = parse_diff ( \@patch );
+ show_patch_lines($filesref) if $debug;
+
+ print "Checking coverage:\n" if $debug;
+
+ my $cwd=getcwd();
+ chdir ".cov" || die "Can't find $cwd/.cov:$!\n";
+
+ for my $file (keys(%$filesref))
+ {
+ my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+ if($suffix eq ".cpp" || $suffix eq ".c" || $suffix eq ".h")
+ {
+ get_coverage($file, $filesref);
+ }
+ }
+ chdir $cwd;
+ return $filesref;
+}
+
+
+sub calc_patch_coverage_percentage
+{
+ my $filesref = shift;
+ my $total_covered_lines = 0;
+ my $total_uncovered_lines = 0;
+
+ foreach my $file (keys(%$filesref))
+ {
+ my $covered_lines = 0;
+ my $uncovered_lines = 0;
+
+ my $patchref = $filesref->{$file}->{"patch"};
+ my $coverage_ref = $filesref->{$file}->{"coverage"};
+ if( $coverage_ref )
+ {
+ for my $patch (@$patchref)
+ {
+ for(my $i = 0; $i < $patch->[1]; $i++ )
+ {
+ my $line = $i + $patch->[0];
+ if($coverage_ref->{"covered"}->{$line})
+ {
+ $covered_lines++;
+ $total_covered_lines++;
+ }
+ if($coverage_ref->{"uncovered"}->{$line})
+ {
+ $uncovered_lines++;
+ $total_uncovered_lines++;
+ }
+ }
+ }
+ $coverage_ref->{"covered_lines"} = $covered_lines;
+ $coverage_ref->{"uncovered_lines"} = $uncovered_lines;
+ my $total = $covered_lines + $uncovered_lines;
+ my $percent = 0;
+ if($total > 0)
+ {
+ $percent = $covered_lines / $total;
+ }
+ $coverage_ref->{"percent_covered"} = 100 * $percent;
+ }
+ }
+ my $total_exec = $total_covered_lines + $total_uncovered_lines;
+ my $percent = 0;
+ if($total_exec > 0) { $percent = 100 * $total_covered_lines / $total_exec; }
+
+ return $percent;
+}
+
+sub patch_output
+{
+ my $filesref = shift;
+ foreach my $file (keys(%$filesref))
+ {
+ my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+ next if($path !~ /^dali/);
+
+ my $patchref = $filesref->{$file}->{"patch"};
+ my $b_lines_ref = $filesref->{$file}->{"b_lines"};
+ my $coverage_ref = $filesref->{$file}->{"coverage"};
+ print BOLD, "$file ";
+
+ if($coverage_ref)
+ {
+ if( $coverage_ref->{"covered_lines"} > 0
+ ||
+ $coverage_ref->{"uncovered_lines"} > 0 )
+ {
+ print GREEN, "Covered: " . $coverage_ref->{"covered_lines"}, RED, " Uncovered: " . $coverage_ref->{"uncovered_lines"}, RESET;
+ }
+ }
+ else
+ {
+ if($suffix eq ".cpp" || $suffix eq ".c" || $suffix eq ".h")
+ {
+ print RED;
+ }
+ print "No coverage found";
+ }
+ print RESET "\n";
+
+ for my $patch (@$patchref)
+ {
+ my $hunkstr="Hunk: " . $patch->[0];
+ if( $patch->[1] > 1 )
+ {
+ $hunkstr .= " - " . ($patch->[0]+$patch->[1]-1);
+ }
+ print BOLD, "$hunkstr\n", RESET;
+ for(my $i = 0; $i < $patch->[1]; $i++ )
+ {
+ my $line = $i + $patch->[0];
+ printf "%-6s ", $line;
+
+ if($coverage_ref)
+ {
+ my $color;
+ if($coverage_ref->{"covered"}->{$line})
+ {
+ $color=GREEN;
+ }
+ elsif($coverage_ref->{"uncovered"}->{$line})
+ {
+ $color=BOLD . RED;
+ }
+ else
+ {
+ $color=BLACK;
+ }
+ my $src=$coverage_ref->{"src"}->{$line};
+ chomp($src);
+ print $color, "$src\n", RESET;
+ }
+ else
+ {
+ # We don't have coverage data, so print it from the patch instead.
+ my $src = $b_lines_ref->{$line};
+ print "$src\n";
+ }
+ }
+ }
+ }
+}
+
+
+################################################################################
+## MAIN ##
+################################################################################
+
+my $cwd = getcwd();
+chdir $repo->wc_path();
+chdir "build/tizen";
+`make rename_cov_data`;
+
+my @cmd=('--no-pager','diff','--no-ext-diff','-U0','--no-color');
+
+my $status = $repo->command("status", "-s");
+if( $status eq "" )
+{
+ # There are no changes in the index or working tree. Use the last patch instead
+ push @cmd, ('HEAD~1','HEAD');
+}
+elsif($opt_cached) # TODO: Remove this option. Instead, need full diff
+{
+ push @cmd, "--cached";
+}
+
+push @cmd, @ARGV;
+my $filesref = run_diff(@cmd);
+
+my $percent = calc_patch_coverage_percentage($filesref);
+if( ! $opt_quiet )
+{
+ patch_output($filesref);
+ my $color=BOLD RED;
+ if($percent>=90)
+ {
+ $color=GREEN;
+ }
+ printf("Percentage of change covered: $color %5.2f%\n" . RESET, $percent);
+}
+exit($percent<90);
+
+
+__END__
+
+=head1 NAME
+
+patch-coverage
+
+=head1 SYNOPSIS
+
+patch-coverage.pl - Determine if patch coverage is below 90%
+
+=head1 DESCRIPTION
+Calculates how well the most recent patch is covered (either the
+patch that is in the index+working directory, or HEAD).
+
+=head1 OPTIONS
+
+=over 28
+
+=item B<-c|--cached>
+Use index files if there is nothing in the working tree
+
+=item B< --help>
+This help
+
+=item B<-q|--quiet>
+Don't generate any output
+
+=head1 RETURN STATUS
+0 if the coverage of source files is > 90%, otherwise 1
+
+=head1 EXAMPLES
+
+
+=cut
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h
index 16cd93d..d22f9c8 100644
--- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h
+++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h
@@ -1,7 +1,8 @@
#ifndef MESH_BUILDER_H
#define MESH_BUILDER_H
+
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,12 +18,8 @@
*
*/
+// EXTERNAL INCLUDES
#include
-#include
-#include
-#include
-#include
-#include
namespace Dali
{
@@ -32,6 +29,7 @@ TextureSet CreateTextureSet();
TextureSet CreateTextureSet( Image image );
Geometry CreateQuadGeometry();
PropertyBuffer CreatePropertyBuffer();
+
}
#endif // MESH_BUILDER_H
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
index 5a8a5d1..f8d7bf8 100644
--- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
+++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
@@ -21,7 +21,6 @@
// EXTERNAL INCLUDES
#include
#include
-#include
// INTERNAL INCLUDES
#include "mesh-builder.h"
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h
index c5c5d0a..28953cb 100644
--- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h
+++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h
@@ -1,5 +1,5 @@
-#ifndef __DALI_TEST_ACTOR_UTILS_H__
-#define __DALI_TEST_ACTOR_UTILS_H__
+#ifndef DALI_TEST_ACTOR_UTILS_H
+#define DALI_TEST_ACTOR_UTILS_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -58,4 +58,4 @@ Image GetTexture( Actor actor );
} // namespace Dali
-#endif // __DALI_TEST_ACTOR_UTILS_H__
+#endif // DALI_TEST_ACTOR_UTILS_H
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h
index 6b2c94a..acdc94a 100644
--- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h
+++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_BITMAP_LOADER_H__
-#define __DALI_TOOLKIT_BITMAP_LOADER_H__
+#ifndef DALI_TOOLKIT_BITMAP_LOADER_H
+#define DALI_TOOLKIT_BITMAP_LOADER_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
@@ -16,14 +16,14 @@
* limitations under the License.
*/
-#define __DALI_BITMAP_LOADER_H__
+#define DALI_BITMAP_LOADER_H
#include
#include
-#include
#include
+#include
+#include
#include
-#include
namespace Dali
{
@@ -63,4 +63,4 @@ public: // Not intended for application developers
} // Dali
-#endif /* __DALI_TOOLKIT_BITMAP_LOADER_H__ */
+#endif // DALI_TOOLKIT_BITMAP_LOADER_H
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp b/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp
index f17e30e..4c711f3 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
#include
#include
-#include
+#include
#include
#include
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
index b5ec1f1..5aff146 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
@@ -64,28 +64,6 @@ struct CallbackFunctor
bool* mCallbackFlag;
};
-
-Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
-{
- BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
-
- // Create the image
- PixelBuffer* pixbuf = imageData.GetBuffer();
- unsigned int size = width * height;
-
- for( size_t i = 0; i < size; i++ )
- {
- pixbuf[i*4+0] = 0xFF * color.r;
- pixbuf[i*4+1] = 0xFF * color.g;
- pixbuf[i*4+2] = 0xFF * color.b;
- pixbuf[i*4+3] = 0xFF * color.a;
- }
-
- imageData.Update();
-
- return imageData;
-}
-
Dali::Integration::Point GetPointDownInside()
{
Dali::Integration::Point point;
@@ -941,3 +919,56 @@ int UtcDaliButtonSetSelectedImageWithImageN(void)
END_TEST;
}
+
+int UtcDaliButtonSetSelectedColorP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliButtonSetSelectedColorP");
+
+ PushButton pushButton = PushButton::New();
+ Stage::GetCurrent().Add( pushButton );
+
+ application.SendNotification();
+ application.Render();
+
+ const Vector4 SET_COLOR = Color::BLUE;
+
+ pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+ pushButton.SetProperty( Button::Property::SELECTED_COLOR, SET_COLOR );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector4 color = pushButton.GetProperty( Button::Property::SELECTED_COLOR );
+
+ DALI_TEST_EQUALS( color, SET_COLOR, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliButtonSetUnSelectedColorP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliButtonSetUnSelectedColorP");
+
+ PushButton pushButton = PushButton::New();
+ Stage::GetCurrent().Add( pushButton );
+
+ application.SendNotification();
+ application.Render();
+
+ const Vector4 SET_COLOR = Color::BLUE;
+
+ pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+ pushButton.SetProperty( Button::Property::UNSELECTED_COLOR, SET_COLOR );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector4 color = pushButton.GetProperty( Button::Property::UNSELECTED_COLOR );
+
+ DALI_TEST_EQUALS( color, SET_COLOR, TEST_LOCATION );
+
+ END_TEST;
+}
+
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
index 1ecf233..fdf25e7 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
@@ -396,7 +396,7 @@ int UtcDaliControlBackgroundColor(void)
Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
Property::Map* resultMap = propValue.GetMap();
DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
- DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get() == "color" );
+ DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get() == "COLOR" );
DALI_TEST_CHECK( resultMap->Find( "mixColor" ) );
DALI_TEST_CHECK( resultMap->Find( "mixColor" )->Get() == Color::RED );
@@ -427,7 +427,7 @@ int UtcDaliControlBackgroundImage(void)
Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
Property::Map* resultMap = propValue.GetMap();
DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
- DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get() == "image" );
+ DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get() == "IMAGE" );
DALI_TEST_CHECK( resultMap->Find( "url" ) );
DALI_TEST_CHECK( resultMap->Find( "url" )->Get() == "TestImage" );
@@ -451,24 +451,24 @@ int UtcDaliControlBackgroundProperties(void)
DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
Property::Map imageMap;
- imageMap[ "rendererType" ] = "image";
+ imageMap[ "rendererType" ] = "IMAGE";
imageMap[ "url" ] = "TestImage";
control.SetProperty( Control::Property::BACKGROUND, imageMap );
Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
Property::Map* resultMap = propValue.GetMap();
DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
- DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get() == "image" );
+ DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get() == "IMAGE" );
DALI_TEST_CHECK( resultMap->Find( "url" ) );
DALI_TEST_CHECK( resultMap->Find( "url" )->Get() == "TestImage" );
Property::Map rendererMap;
- rendererMap["rendererType"] = "color";
+ rendererMap["rendererType"] = "COLOR";
rendererMap["mixColor"] = Color::CYAN;
control.SetProperty( Control::Property::BACKGROUND, rendererMap );
propValue = control.GetProperty( Control::Property::BACKGROUND );
resultMap = propValue.GetMap();
DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
- DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get() == "color" );
+ DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get() == "COLOR" );
DALI_TEST_CHECK( resultMap->Find( "mixColor" ) );
DALI_TEST_CHECK( resultMap->Find( "mixColor" )->Get() == Color::CYAN );
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp
index 43caadd..8b3989f 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,9 +17,9 @@
#include
#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
#include
using namespace Dali;
@@ -52,7 +52,7 @@ int UtcDaliControlRendererCopyAndAssignment(void)
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "color");
+ propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", Color::BLUE);
ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
@@ -85,7 +85,7 @@ int UtcDaliControlRendererSetGetDepthIndex(void)
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "color");
+ propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", Color::BLUE);
ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
@@ -119,7 +119,7 @@ int UtcDaliControlRendererSize(void)
// color renderer
Dali::Property::Map map;
- map[ "rendererType" ] = "color";
+ map[ "rendererType" ] = "COLOR";
map[ "mixColor" ] = Color::MAGENTA;
ControlRenderer colorRenderer = factory.CreateControlRenderer( map );
colorRenderer.SetSize( rendererSize );
@@ -149,7 +149,7 @@ int UtcDaliControlRendererSize(void)
// border renderer
float borderSize = 5.f;
map.Clear();
- map[ "rendererType" ] = "border";
+ map[ "rendererType" ] = "BORDER";
map[ "borderColor" ] = Color::RED;
map[ "borderSize" ] = borderSize;
ControlRenderer borderRenderer = factory.CreateControlRenderer( map );
@@ -160,7 +160,7 @@ int UtcDaliControlRendererSize(void)
// gradient renderer
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "gradient");
+ propertyMap.Insert("rendererType", "GRADIENT");
Vector2 start(-1.f, -1.f);
Vector2 end(1.f, 1.f);
propertyMap.Insert("startPosition", start);
@@ -196,7 +196,7 @@ int UtcDaliControlRendererSetOnOffStage(void)
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "color");
+ propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", Color::BLUE);
ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
@@ -269,7 +269,7 @@ int UtcDaliControlRendererGetPropertyMap1(void)
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "color");
+ propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", Color::BLUE);
ControlRenderer colorRenderer = factory.CreateControlRenderer( propertyMap );
@@ -278,7 +278,7 @@ int UtcDaliControlRendererGetPropertyMap1(void)
Property::Value* typeValue = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( typeValue );
- DALI_TEST_CHECK( typeValue->Get() == "color" );
+ DALI_TEST_CHECK( typeValue->Get() == "COLOR" );
Property::Value* colorValue = resultMap.Find( "mixColor", Property::VECTOR4 );
DALI_TEST_CHECK( colorValue );
@@ -305,7 +305,7 @@ int UtcDaliControlRendererGetPropertyMap2(void)
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "border");
+ propertyMap.Insert("rendererType", "BORDER");
propertyMap.Insert("borderColor", Color::BLUE);
propertyMap.Insert("borderSize", 5.f);
ControlRenderer borderRenderer = factory.CreateControlRenderer( propertyMap );
@@ -316,7 +316,7 @@ int UtcDaliControlRendererGetPropertyMap2(void)
// check the property values from the returned map from control renderer
Property::Value* typeValue = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( typeValue );
- DALI_TEST_CHECK( typeValue->Get() == "border" );
+ DALI_TEST_CHECK( typeValue->Get() == "BORDER" );
Property::Value* colorValue = resultMap.Find( "borderColor", Property::VECTOR4 );
DALI_TEST_CHECK( colorValue );
@@ -327,7 +327,7 @@ int UtcDaliControlRendererGetPropertyMap2(void)
DALI_TEST_CHECK( sizeValue->Get() == 5.f );
Property::Map propertyMap1;
- propertyMap1[ "rendererType" ] = "border";
+ propertyMap1[ "rendererType" ] = "BORDER";
propertyMap1[ "borderColor" ] = Color::CYAN;
propertyMap1[ "borderSize" ] = 10.0f;
borderRenderer = factory.CreateControlRenderer( propertyMap1 );
@@ -335,7 +335,7 @@ int UtcDaliControlRendererGetPropertyMap2(void)
typeValue = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( typeValue );
- DALI_TEST_CHECK( typeValue->Get() == "border" );
+ DALI_TEST_CHECK( typeValue->Get() == "BORDER" );
colorValue = resultMap.Find( "borderColor", Property::VECTOR4 );
DALI_TEST_CHECK( colorValue );
@@ -357,13 +357,13 @@ int UtcDaliControlRendererGetPropertyMap3(void)
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "gradient");
+ propertyMap.Insert("rendererType", "GRADIENT");
Vector2 start(-1.f, -1.f);
Vector2 end(1.f, 1.f);
- propertyMap.Insert("startPosition", start);
- propertyMap.Insert("endPosition", end);
- propertyMap.Insert("spreadMethod", "repeat");
+ propertyMap.Insert("startPosition", start);
+ propertyMap.Insert("endPosition", end);
+ propertyMap.Insert("spreadMethod", "REPEAT");
propertyMap.Insert("stopOffset", Vector2(0.2f, 0.8f));
@@ -380,15 +380,15 @@ int UtcDaliControlRendererGetPropertyMap3(void)
// check the property values from the returned map from control renderer
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "gradient" );
+ DALI_TEST_CHECK( value->Get() == "GRADIENT" );
value = resultMap.Find( "units", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "objectBoundingBox" );
+ DALI_TEST_CHECK( value->Get() == "OBJECT_BOUNDING_BOX" );
value = resultMap.Find( "spreadMethod", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "repeat" );
+ DALI_TEST_CHECK( value->Get() == "REPEAT" );
value = resultMap.Find( "startPosition", Property::VECTOR2 );
DALI_TEST_CHECK( value );
@@ -424,11 +424,11 @@ int UtcDaliControlRendererGetPropertyMap4(void)
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "gradient");
+ propertyMap.Insert("rendererType", "GRADIENT");
Vector2 center(100.f, 100.f);
float radius = 100.f;
- propertyMap.Insert("units", "userSpace");
+ propertyMap.Insert("units", "USER_SPACE");
propertyMap.Insert("center", center);
propertyMap.Insert("radius", radius);
propertyMap.Insert("stopOffset", Vector3(0.1f, 0.3f, 1.1f));
@@ -448,15 +448,15 @@ int UtcDaliControlRendererGetPropertyMap4(void)
// check the property values from the returned map from control renderer
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "gradient" );
+ DALI_TEST_CHECK( value->Get() == "GRADIENT" );
value = resultMap.Find( "units", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "userSpace" );
+ DALI_TEST_CHECK( value->Get() == "USER_SPACE" );
value = resultMap.Find( "spreadMethod", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "pad" );
+ DALI_TEST_CHECK( value->Get() == "PAD" );
value = resultMap.Find( "center", Property::VECTOR2 );
DALI_TEST_CHECK( value );
@@ -493,7 +493,7 @@ int UtcDaliControlRendererGetPropertyMap5(void)
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "image" );
+ propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_IMAGE_FILE_NAME );
propertyMap.Insert( "desiredWidth", 20 );
propertyMap.Insert( "desiredHeight", 30 );
@@ -510,7 +510,7 @@ int UtcDaliControlRendererGetPropertyMap5(void)
// check the property values from the returned map from control renderer
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "image" );
+ DALI_TEST_CHECK( value->Get() == "IMAGE" );
value = resultMap.Find( "url", Property::STRING );
DALI_TEST_CHECK( value );
@@ -543,7 +543,7 @@ int UtcDaliControlRendererGetPropertyMap5(void)
value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "image" );
+ DALI_TEST_CHECK( value->Get() == "IMAGE" );
value = resultMap.Find( "url", Property::STRING );
DALI_TEST_CHECK( value );
@@ -579,7 +579,7 @@ int UtcDaliControlRendererGetPropertyMap6(void)
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "image" );
+ propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_NPATCH_FILE_NAME );
propertyMap.Insert( "borderOnly", true );
ControlRenderer nPatchRenderer = factory.CreateControlRenderer( propertyMap );
@@ -590,7 +590,7 @@ int UtcDaliControlRendererGetPropertyMap6(void)
// check the property values from the returned map from control renderer
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "image" );
+ DALI_TEST_CHECK( value->Get() == "IMAGE" );
value = resultMap.Find( "url", Property::STRING );
DALI_TEST_CHECK( value );
@@ -611,7 +611,7 @@ int UtcDaliControlRendererGetPropertyMap7(void)
// request SvgRenderer with a property map
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "image" );
+ propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_SVG_FILE_NAME );
ControlRenderer svgRenderer = factory.CreateControlRenderer( propertyMap );
@@ -620,7 +620,7 @@ int UtcDaliControlRendererGetPropertyMap7(void)
// check the property values from the returned map from control renderer
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "image" );
+ DALI_TEST_CHECK( value->Get() == "IMAGE" );
value = resultMap.Find( "url", Property::STRING );
DALI_TEST_CHECK( value );
@@ -633,7 +633,7 @@ int UtcDaliControlRendererGetPropertyMap7(void)
// check the property values from the returned map from control renderer
value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "image" );
+ DALI_TEST_CHECK( value->Get() == "IMAGE" );
value = resultMap.Find( "url", Property::STRING );
DALI_TEST_CHECK( value );
@@ -651,11 +651,11 @@ int UtcDaliControlRendererGetPropertyMap8(void)
//Request MeshRenderer using a property map.
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "mesh" );
+ propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_LOCATION );
- propertyMap.Insert( "shaderType", "textureless" );
+ propertyMap.Insert( "shaderType", "TEXTURELESS" );
ControlRenderer meshRenderer = factory.CreateControlRenderer( propertyMap );
Property::Map resultMap;
@@ -664,23 +664,110 @@ int UtcDaliControlRendererGetPropertyMap8(void)
//Check values in the result map are identical to the initial map's values.
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "mesh" );
+ DALI_TEST_EQUALS( value->Get(), "MESH", TEST_LOCATION );
value = resultMap.Find( "objectUrl", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == TEST_OBJ_FILE_NAME );
+ DALI_TEST_EQUALS( value->Get(), TEST_OBJ_FILE_NAME, TEST_LOCATION );
value = resultMap.Find( "materialUrl", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == TEST_MTL_FILE_NAME );
+ DALI_TEST_EQUALS( value->Get(), TEST_MTL_FILE_NAME, TEST_LOCATION );
value = resultMap.Find( "texturesPath", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == TEST_RESOURCE_LOCATION );
+ DALI_TEST_EQUALS( value->Get(), TEST_RESOURCE_LOCATION, TEST_LOCATION );
value = resultMap.Find( "shaderType", Property::STRING );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get() == "textureless" );
+ DALI_TEST_EQUALS( value->Get(), "TEXTURELESS", TEST_LOCATION );
+
+ END_TEST;
+}
+
+//Primitive shape renderer
+int UtcDaliControlRendererGetPropertyMap9(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliControlRendererGetPropertyMap9: PrimitiveRenderer" );
+
+ Vector4 color = Vector4( 1.0, 0.8, 0.6, 1.0);
+ Vector3 dimensions = Vector3( 1.0, 2.0, 3.0 );
+
+ //Request PrimitiveRenderer using a property map.
+ RendererFactory factory = RendererFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+ propertyMap.Insert( "shape", "CUBE" );
+ propertyMap.Insert( "color", color );
+ propertyMap.Insert( "slices", 10 );
+ propertyMap.Insert( "stacks", 20 );
+ propertyMap.Insert( "scaleTopRadius", 30.0f );
+ propertyMap.Insert( "scaleBottomRadius", 40.0f );
+ propertyMap.Insert( "scaleHeight", 50.0f );
+ propertyMap.Insert( "scaleRadius", 60.0f );
+ propertyMap.Insert( "scaleDimensions", dimensions );
+ propertyMap.Insert( "bevelPercentage", 0.3f );
+ propertyMap.Insert( "bevelSmoothness", 0.6f );
+ propertyMap.Insert( "uLightPosition", Vector3( 5.0f, 10.0f, 15.0f) );
+ ControlRenderer primitiveRenderer = factory.CreateControlRenderer( propertyMap );
+
+ Property::Map resultMap;
+ primitiveRenderer.CreatePropertyMap( resultMap );
+
+ //Check values in the result map are identical to the initial map's values.
+ Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), "PRIMITIVE", TEST_LOCATION );
+
+ value = resultMap.Find( "shape", Property::STRING );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), "CUBE", TEST_LOCATION );
+
+ value = resultMap.Find( "color", Property::VECTOR4 );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get() == color );
+ DALI_TEST_EQUALS( value->Get(), color, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( "slices", Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), 10, TEST_LOCATION );
+
+ value = resultMap.Find( "stacks", Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), 20, TEST_LOCATION );
+
+ value = resultMap.Find( "scaleTopRadius", Property::FLOAT );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), 30.0f, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( "scaleBottomRadius", Property::FLOAT );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), 40.0f, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( "scaleHeight", Property::FLOAT );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), 50.0f, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( "scaleRadius", Property::FLOAT );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), 60.0f, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( "scaleDimensions", Property::VECTOR3 );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), dimensions, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( "bevelPercentage", Property::FLOAT );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), 0.3f, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( "bevelSmoothness", Property::FLOAT );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), 0.6f, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( "uLightPosition", Property::VECTOR3 );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get(), Vector3( 5.0f, 10.0f, 15.0f), Math::MACHINE_EPSILON_100, TEST_LOCATION );
END_TEST;
}
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-DebugRenderer.cpp b/automated-tests/src/dali-toolkit/utc-Dali-DebugRenderer.cpp
index 52f16ed..57543d0 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-DebugRenderer.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-DebugRenderer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,10 +14,11 @@
* limitations under the License.
*
*/
+
#include
#include
-#include
-#include
+#include
+#include
#include // for setting environment variable: DALI_DEBUG_RENDERING
@@ -39,7 +40,7 @@ bool IsDebugRenderer( ControlRenderer& renderer )
Property::Value* typeValue = propertyMap.Find( "rendererType", Property::STRING );
if ( typeValue )
{
- isDebugRendererType = ( typeValue->Get() == "debug" );
+ isDebugRendererType = ( typeValue->Get() == "DEBUG" );
}
Actor actor = Actor::New();
@@ -72,7 +73,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
// Test that color renderer is replaced with debug renderer
Property::Map propertyMap1;
- propertyMap1.Insert("rendererType", "color");
+ propertyMap1.Insert("rendererType", "COLOR");
propertyMap1.Insert("mixColor", Color::BLUE);
ControlRenderer colorRenderer = factory.CreateControlRenderer(propertyMap1);
DALI_TEST_CHECK( colorRenderer );
@@ -80,7 +81,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
// Test that border renderer is replaced with debug renderer
Property::Map propertyMap2;
- propertyMap2.Insert("rendererType", "border");
+ propertyMap2.Insert("rendererType", "BORDER");
propertyMap2.Insert("borderColor", Color::BLUE);
propertyMap2.Insert("borderSize", 2.f);
ControlRenderer borderRenderer = factory.CreateControlRenderer(propertyMap2);
@@ -89,27 +90,27 @@ int UtcDaliDebugRendererGetRenderer1(void)
// Test that gradient renderer is replaced with debug renderer
Property::Map propertyMap3;
- propertyMap3.Insert("rendererType", "gradient");
+ propertyMap3.Insert("rendererType", "GRADIENT");
Vector2 start(-1.f, -1.f);
Vector2 end(1.f, 1.f);
- propertyMap3.Insert("gradientStartPosition", start);
- propertyMap3.Insert("gradientEndPosition", end);
- propertyMap3.Insert("gradientSpreadMethod", "repeat");
+ propertyMap3.Insert("startPosition", start);
+ propertyMap3.Insert("endPosition", end);
+ propertyMap3.Insert("spreadMethod", "REPEAT");
Property::Array stopOffsets;
stopOffsets.PushBack( 0.2f );
stopOffsets.PushBack( 0.8f );
- propertyMap3.Insert("gradientStopOffset", stopOffsets);
+ propertyMap3.Insert("stopOffset", stopOffsets);
Property::Array stopColors;
stopColors.PushBack( Color::RED );
stopColors.PushBack( Color::GREEN );
- propertyMap3.Insert("gradientStopColor", stopColors);
+ propertyMap3.Insert("stopColor", stopColors);
ControlRenderer gradientRenderer = factory.CreateControlRenderer(propertyMap3);
DALI_TEST_CHECK( gradientRenderer );
DALI_TEST_CHECK( IsDebugRenderer( gradientRenderer ) );
// Test that image renderer is replaced with debug renderer
Property::Map propertyMap4;
- propertyMap4.Insert( "rendererType", "image" );
+ propertyMap4.Insert( "rendererType", "IMAGE" );
propertyMap4.Insert( "url", TEST_IMAGE_FILE_NAME );
ControlRenderer imageRenderer = factory.CreateControlRenderer( propertyMap4 );
DALI_TEST_CHECK( imageRenderer );
@@ -117,7 +118,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
// Test that n patch renderer is replaced with debug renderer
Property::Map propertyMap5;
- propertyMap5.Insert( "rendererType", "image" );
+ propertyMap5.Insert( "rendererType", "IMAGE" );
propertyMap5.Insert( "url", TEST_NPATCH_FILE_NAME );
ControlRenderer nPatchRenderer = factory.CreateControlRenderer( propertyMap4 );
DALI_TEST_CHECK( nPatchRenderer );
@@ -138,7 +139,7 @@ int UtcDaliDebugRendererGetRenderer2(void)
// Test that color renderer is replaced with debug renderer
Dali::Property::Map map;
- map[ "rendererType" ] = "color";
+ map[ "rendererType" ] = "COLOR";
map[ "mixColor" ] = Color::CYAN;
ControlRenderer colorRenderer = factory.CreateControlRenderer( map);
@@ -147,7 +148,7 @@ int UtcDaliDebugRendererGetRenderer2(void)
// Test that border renderer is replaced with debug renderer
map.Clear();
- map[ "rendererType" ] = "border";
+ map[ "rendererType" ] = "BORDER";
map[ "borderColor" ] = Color::GREEN;
map[ "borderSize" ] = 2.f;
ControlRenderer borderRenderer = factory.CreateControlRenderer( map );
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
index 709282a..6348940 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
#include
#include
-#include
+#include
#include
#include
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
index 82d6a40..a191f43 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
@@ -113,27 +113,6 @@ Dali::Integration::Point GetPointUpOutside()
return point;
}
-Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
-{
- BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
-
- // Create the image
- PixelBuffer* pixbuf = imageData.GetBuffer();
- unsigned int size = width * height;
-
- for( size_t i = 0; i < size; i++ )
- {
- pixbuf[i*4+0] = 0xFF * color.r;
- pixbuf[i*4+1] = 0xFF * color.g;
- pixbuf[i*4+2] = 0xFF * color.b;
- pixbuf[i*4+3] = 0xFF * color.a;
- }
-
- imageData.Update();
-
- return imageData;
-}
-
} //namespace
int UtcDaliPushButtonConstructorP(void)
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp
index 0e33b72..19df59d 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,9 +18,9 @@
#include
#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
#include
using namespace Dali;
@@ -293,7 +293,7 @@ int UtcDaliRendererFactoryGetColorRenderer1(void)
Property::Map propertyMap;
Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
- propertyMap.Insert("rendererType", "color");
+ propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", testColor);
ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
@@ -320,7 +320,7 @@ int UtcDaliRendererFactoryGetColorRenderer2(void)
Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
Dali::Property::Map map;
- map[ "rendererType" ] = "color";
+ map[ "rendererType" ] = "COLOR";
map[ "mixColor" ] = testColor;
ControlRenderer controlRenderer = factory.CreateControlRenderer( map );
DALI_TEST_CHECK( controlRenderer );
@@ -350,7 +350,7 @@ int UtcDaliRendererFactoryGetBorderRenderer1(void)
Property::Map propertyMap;
Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
float testSize = 5.f;
- propertyMap.Insert("rendererType", "border");
+ propertyMap.Insert("rendererType", "BORDER");
propertyMap.Insert("borderColor", testColor);
propertyMap.Insert("borderSize", testSize);
@@ -398,7 +398,7 @@ int UtcDaliRendererFactoryGetBorderRenderer2(void)
float testSize = 5.f;
Dali::Property::Map propertyMap;
- propertyMap[ "rendererType" ] = "border";
+ propertyMap[ "rendererType" ] = "BORDER";
propertyMap[ "borderColor" ] = testColor;
propertyMap[ "borderSize" ] = testSize;
ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
@@ -432,7 +432,7 @@ int UtcDaliRendererFactoryGetBorderRenderer2(void)
// enable the anti-aliasing
Dali::Property::Map map;
- map[ "rendererType" ] = "border";
+ map[ "rendererType" ] = "BORDER";
map[ "borderColor" ] = testColor;
map[ "borderSize" ] = testSize;
map[ "antiAliasing" ] = true;
@@ -456,23 +456,23 @@ int UtcDaliRendererFactoryGetLinearGradientRenderer(void)
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "gradient");
+ propertyMap.Insert("rendererType", "GRADIENT");
Vector2 start(-1.f, -1.f);
Vector2 end(1.f, 1.f);
- propertyMap.Insert("startPosition", start);
- propertyMap.Insert("endPosition", end);
- propertyMap.Insert("spreadMethod", "repeat");
+ propertyMap.Insert("startPosition", start);
+ propertyMap.Insert("endPosition", end);
+ propertyMap.Insert("spreadMethod", "REPEAT");
Property::Array stopOffsets;
stopOffsets.PushBack( 0.2f );
stopOffsets.PushBack( 0.8f );
- propertyMap.Insert("stopOffset", stopOffsets);
+ propertyMap.Insert("stopOffset", stopOffsets);
Property::Array stopColors;
stopColors.PushBack( Color::RED );
stopColors.PushBack( Color::GREEN );
- propertyMap.Insert("stopColor", stopColors);
+ propertyMap.Insert("stopColor", stopColors);
ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
DALI_TEST_CHECK( controlRenderer );
@@ -496,11 +496,11 @@ int UtcDaliRendererFactoryGetRadialGradientRenderer(void)
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "gradient");
+ propertyMap.Insert("rendererType", "GRADIENT");
Vector2 center(100.f, 100.f);
float radius = 100.f;
- propertyMap.Insert("units", "userSpace");
+ propertyMap.Insert("units", "USER_SPACE");
propertyMap.Insert("center", center);
propertyMap.Insert("radius", radius);
@@ -541,18 +541,18 @@ int UtcDaliRendererFactoryDefaultOffsetsGradientRenderer(void)
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
- propertyMap.Insert("rendererType", "gradient");
+ propertyMap.Insert("rendererType", "GRADIENT");
Vector2 start(-1.f, -1.f);
Vector2 end(1.f, 1.f);
- propertyMap.Insert("startPosition", start);
- propertyMap.Insert("endPosition", end);
- propertyMap.Insert("spreadMethod", "repeat");
+ propertyMap.Insert("startPosition", start);
+ propertyMap.Insert("endPosition", end);
+ propertyMap.Insert("spreadMethod", "REPEAT");
Property::Array stopColors;
stopColors.PushBack( Color::RED );
stopColors.PushBack( Color::GREEN );
- propertyMap.Insert("stopColor", stopColors);
+ propertyMap.Insert("stopColor", stopColors);
ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
DALI_TEST_CHECK( controlRenderer );
@@ -576,7 +576,7 @@ int UtcDaliRendererFactoryGetImageRenderer1(void)
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "image" );
+ propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_IMAGE_FILE_NAME );
ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
@@ -658,7 +658,7 @@ int UtcDaliRendererFactoryGetNPatchRenderer1(void)
Integration::ResourcePointer ninePatchResource = CustomizeNinePatch( application, ninePatchImageWidth, ninePatchImageHeight, stretchRangesX, stretchRangesY );
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "image" );
+ propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_NPATCH_FILE_NAME );
{
tet_infoline( "whole grid" );
@@ -722,7 +722,7 @@ int UtcDaliRendererFactoryGetNPatchRenderer2(void)
Integration::ResourcePointer ninePatchResource = CustomizeNinePatch( application, ninePatchImageWidth, ninePatchImageHeight, stretchRangesX, stretchRangesY );
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "image" );
+ propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_NPATCH_FILE_NAME );
{
ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
@@ -960,7 +960,7 @@ int UtcDaliRendererFactoryGetMeshRenderer1(void)
//Set up renderer properties.
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "mesh" );
+ propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
@@ -1012,7 +1012,7 @@ int UtcDaliRendererFactoryGetMeshRenderer2(void)
//Set up renderer properties.
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "mesh" );
+ propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "materialUrl", "" );
propertyMap.Insert( "texturesPath", "" );
@@ -1068,7 +1068,7 @@ int UtcDaliRendererFactoryGetMeshRenderer3(void)
//Set up renderer properties.
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "mesh" );
+ propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
@@ -1124,7 +1124,7 @@ int UtcDaliRendererFactoryGetMeshRenderer4(void)
//Set up renderer properties.
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "mesh" );
+ propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "materialUrl", TEST_SIMPLE_MTL_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
@@ -1180,7 +1180,7 @@ int UtcDaliRendererFactoryGetMeshRendererN1(void)
//Set up renderer properties.
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "mesh" );
+ propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
@@ -1231,7 +1231,7 @@ int UtcDaliRendererFactoryGetMeshRendererN2(void)
//Set up renderer properties.
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "mesh" );
+ propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "materialUrl", "invalid" );
propertyMap.Insert( "texturesPath", "also invalid" );
@@ -1283,7 +1283,7 @@ int UtcDaliRendererFactoryGetMeshRendererN3(void)
//Set up renderer properties.
Property::Map propertyMap;
- propertyMap.Insert( "rendererType", "mesh" );
+ propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", "invalid" );
propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
@@ -1323,3 +1323,235 @@ int UtcDaliRendererFactoryGetMeshRendererN3(void)
END_TEST;
}
+
+//Creates a primitive renderer with the given property map and tests to see if it correctly loads in the given application.
+void TestPrimitiveRendererWithProperties( Property::Map& propertyMap, ToolkitTestApplication& application )
+{
+ RendererFactory factory = RendererFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ //Create a primitive renderer.
+ ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
+ DALI_TEST_CHECK( controlRenderer );
+
+ //Create an actor on stage to house the renderer.
+ Actor actor = Actor::New();
+ actor.SetSize( 200.f, 200.f );
+ Stage::GetCurrent().Add( actor );
+ controlRenderer.SetSize( Vector2( 200.f, 200.f ) );
+ controlRenderer.SetOnStage( actor );
+
+ //Ensure set on stage.
+ DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+
+ //Tell test application to load the renderer.
+ application.SendNotification();
+ application.Render(0);
+
+ Matrix testScaleMatrix;
+ testScaleMatrix.SetIdentityAndScale( Vector3( 1.0, -1.0, 1.0 ) );
+ Matrix actualScaleMatrix;
+
+ //Test to see if the object has been successfully loaded.
+ DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue( "uObjectMatrix", actualScaleMatrix ) );
+ DALI_TEST_EQUALS( actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ //Finish by setting off stage, and ensuring this was successful.
+ controlRenderer.SetOffStage( actor );
+ DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+}
+
+//Test if primitive shape loads correctly when supplied with only the bare minimum requirements, the shape to use.
+int UtcDaliRendererFactoryGetPrimitiveRenderer1(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer1: Request primitive renderer with a shape only" );
+
+ //Set up renderer properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+ propertyMap.Insert( "shape", "CUBE" );
+
+ //Test to see if shape loads correctly.
+ TestPrimitiveRendererWithProperties( propertyMap, application );
+
+ END_TEST;
+}
+
+//Test if primitive shape loads correctly when supplied with all possible parameters
+int UtcDaliRendererFactoryGetPrimitiveRenderer2(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer2: Request primitive renderer with everything" );
+
+ //Set up renderer properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+ propertyMap.Insert( "shape", "CUBE" );
+ propertyMap.Insert( "color", Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( "slices", 10 );
+ propertyMap.Insert( "stacks", 20 );
+ propertyMap.Insert( "scaleTopRadius", 30.0f );
+ propertyMap.Insert( "scaleBottomRadius", 40.0f );
+ propertyMap.Insert( "scaleHeight", 50.0f );
+ propertyMap.Insert( "scaleRadius", 60.0f );
+ propertyMap.Insert( "bevelPercentage", 0.7f );
+
+ //Test to see if shape loads correctly.
+ TestPrimitiveRendererWithProperties( propertyMap, application );
+
+ END_TEST;
+}
+
+//Test if primitive shape loads a sphere correctly.
+int UtcDaliRendererFactoryGetPrimitiveRenderer3(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer3: Request primitive renderer to display a sphere" );
+
+ //Set up renderer properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+ propertyMap.Insert( "shape", "SPHERE" );
+ propertyMap.Insert( "color", Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( "slices", 10 );
+ propertyMap.Insert( "stacks", 20 );
+
+ //Test to see if shape loads correctly.
+ TestPrimitiveRendererWithProperties( propertyMap, application );
+
+ END_TEST;
+}
+
+//Test if primitive shape loads a conic section correctly.
+int UtcDaliRendererFactoryGetPrimitiveRenderer4(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer4: Request primitive renderer to display a conic section" );
+
+ //Set up renderer properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+ propertyMap.Insert( "shape", "CONICAL_FRUSTRUM" );
+ propertyMap.Insert( "color", Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( "slices", 10 );
+ propertyMap.Insert( "scaleTopRadius", 30.0f );
+ propertyMap.Insert( "scaleBottomRadius", 40.0f );
+ propertyMap.Insert( "scaleHeight", 50.0f );
+
+ //Test to see if shape loads correctly.
+ TestPrimitiveRendererWithProperties( propertyMap, application );
+
+ END_TEST;
+}
+
+//Test if primitive shape loads a bevelled cube correctly.
+int UtcDaliRendererFactoryGetPrimitiveRenderer5(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer5: Request primitive renderer to display a bevelled cube" );
+
+ //Set up renderer properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+ propertyMap.Insert( "shape", "BEVELLED_CUBE" );
+ propertyMap.Insert( "color", Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( "bevelPercentage", 0.7f );
+
+ //Test to see if shape loads correctly.
+ TestPrimitiveRendererWithProperties( propertyMap, application );
+
+ END_TEST;
+}
+
+//Test if primitive shape loads an octahedron correctly.
+int UtcDaliRendererFactoryGetPrimitiveRenderer6(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer6: Request primitive renderer to display an octahedron" );
+
+ //Set up renderer properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+ propertyMap.Insert( "shape", "OCTAHEDRON" );
+ propertyMap.Insert( "color", Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+
+ //Test to see if shape loads correctly.
+ TestPrimitiveRendererWithProperties( propertyMap, application );
+
+ END_TEST;
+}
+
+//Test if primitive shape loads a cone correctly.
+int UtcDaliRendererFactoryGetPrimitiveRenderer7(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer7: Request primitive renderer to display a cone" );
+
+ //Set up renderer properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+ propertyMap.Insert( "shape", "CONE" );
+ propertyMap.Insert( "color", Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( "slices", 10 );
+ propertyMap.Insert( "scaleTopRadius", 30.0f );
+ propertyMap.Insert( "scaleHeight", 50.0f );
+
+ //Test to see if shape loads correctly.
+ TestPrimitiveRendererWithProperties( propertyMap, application );
+
+ END_TEST;
+}
+
+//Test if primitive shape loads correctly when light position is manually set.
+int UtcDaliRendererFactoryGetPrimitiveRenderer8(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer8: Request primitive renderer with set light position" );
+
+ //Set up renderer properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+ propertyMap.Insert( "shape", "SPHERE" );
+ propertyMap.Insert( "color", Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( "uLightPosition", Vector3( 0.0, 1.0, 2.0 ) );
+
+ //Test to see if shape loads correctly.
+ TestPrimitiveRendererWithProperties( propertyMap, application );
+
+ END_TEST;
+}
+
+//Test if primitive shape renderer handles the case of not being passed a specific shape to use.
+int UtcDaliRendererFactoryGetPrimitiveRendererN1(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRendererN1: Request primitive renderer without shape" );
+
+ //Set up renderer properties, without supplying shape.
+ Property::Map propertyMap;
+ propertyMap.Insert( "rendererType", "PRIMITIVE" );
+
+ //Test to see if shape loads regardless of missing input.
+ TestPrimitiveRendererWithProperties( propertyMap, application );
+
+ END_TEST;
+}
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp
index fcfc821..4f1e000 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp
@@ -333,7 +333,7 @@ int UtcDaliSetPropertyP(void)
{
Property::Map map;
- map["rendererType"] = "image";
+ map["rendererType"] = "IMAGE";
map["size"] = Vector2(200, 200);
map["url"] = "track2.png";
slider.SetProperty(Slider::Property::TRACK_VISUAL, map);
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
index 52f4f87..2300b50 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
@@ -17,7 +17,7 @@
#include
#include
-#include
+#include
#include
#include
#include
@@ -639,8 +639,13 @@ int utcDaliTextEditorEvent02(void)
CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
DALI_TEST_CHECK( camera );
- Renderer renderer = offscreenRoot.GetChildAt( 1u ).GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ // The offscreen root actor has a container with all the actors which contain the text renderers.
+ Actor container = offscreenRoot.GetChildAt( 1u );
+ for( unsigned int index = 0; index < container.GetChildCount(); ++index )
+ {
+ Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
+ DALI_TEST_CHECK( renderer );
+ }
// Move the cursor and check the position changes.
Vector3 position1 = cursor.GetCurrentPosition();
@@ -762,8 +767,13 @@ int utcDaliTextEditorEvent03(void)
CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
DALI_TEST_CHECK( camera );
- Renderer renderer = offscreenRoot.GetChildAt( 1u ).GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ // The offscreen root actor has a container with all the actors which contain the text renderers.
+ Actor container = offscreenRoot.GetChildAt( 1u );
+ for( unsigned int index = 0; index < container.GetChildCount(); ++index )
+ {
+ Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
+ DALI_TEST_CHECK( renderer );
+ }
Renderer highlight = offscreenRoot.GetChildAt( 2u ).GetRendererAt( 0u );
DALI_TEST_CHECK( highlight );
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
index d3908ea..911a06e 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
#include
#include
-#include
+#include
#include
#include
#include
@@ -867,8 +867,13 @@ int utcDaliTextFieldEvent02(void)
CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
DALI_TEST_CHECK( camera );
- Renderer renderer = offscreenRoot.GetChildAt( 1u ).GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ // The offscreen root actor has a container with all the actors which contain the text renderers.
+ Actor container = offscreenRoot.GetChildAt( 1u );
+ for( unsigned int index = 0; index < container.GetChildCount(); ++index )
+ {
+ Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
+ DALI_TEST_CHECK( renderer );
+ }
// Move the cursor and check the position changes.
Vector3 position1 = cursor.GetCurrentPosition();
@@ -991,8 +996,13 @@ int utcDaliTextFieldEvent03(void)
CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
DALI_TEST_CHECK( camera );
- Renderer renderer = offscreenRoot.GetChildAt( 1u ).GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ // The offscreen root actor has a container with all the actors which contain the text renderers.
+ Actor container = offscreenRoot.GetChildAt( 1u );
+ for( unsigned int index = 0; index < container.GetChildCount(); ++index )
+ {
+ Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
+ DALI_TEST_CHECK( renderer );
+ }
Renderer highlight = offscreenRoot.GetChildAt( 2u ).GetRendererAt( 0u );
DALI_TEST_CHECK( highlight );
@@ -1186,7 +1196,7 @@ int utcDaliTextFieldEvent06(void)
int utcDaliTextFieldEvent07(void)
{
ToolkitTestApplication application;
- tet_infoline(" utcDaliTextFieldEvent06");
+ tet_infoline(" utcDaliTextFieldEvent07");
// Checks Longpress to start edit mode
@@ -1224,7 +1234,7 @@ int utcDaliTextFieldEvent07(void)
int utcDaliTextFieldEvent08(void)
{
ToolkitTestApplication application;
- tet_infoline(" utcDaliTextFieldEvent06");
+ tet_infoline(" utcDaliTextFieldEvent08");
// Checks Longpress when only place holder text
@@ -1258,3 +1268,78 @@ int utcDaliTextFieldEvent08(void)
END_TEST;
}
+
+int utcDaliTextFieldStyleWhilstSelected09(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextFieldEvent09");
+
+ // Change font and styles whilst text is selected whilst word selected
+
+ TextField field = TextField::New();
+ DALI_TEST_CHECK( field );
+ Stage::GetCurrent().Add( field );
+ LoadMarkerImages(application, field);
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
+ field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
+ field.SetSize( 300.f, 50.f );
+ field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Create a tap event to touch the text field.
+ application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+ application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+
+ // Tap first to get the focus.
+ application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+ application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Double tap to select a word.
+ application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
+ application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ field.SetProperty( TextField::Property::INPUT_FONT_FAMILY, "Setting input font family" );
+ DALI_TEST_EQUALS( field.GetProperty( TextField::Property::INPUT_FONT_FAMILY ), "Setting input font family", TEST_LOCATION );
+
+ field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"weight\":\"bold\",\"slant\":\"italic\"}" );
+ DALI_TEST_EQUALS( field.GetProperty( TextField::Property::INPUT_FONT_STYLE ), "{\"weight\":\"bold\",\"slant\":\"italic\"}", TEST_LOCATION );
+
+ field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"width\":\"expanded\",\"slant\":\"italic\"}" );
+ DALI_TEST_EQUALS( field.GetProperty( TextField::Property::INPUT_FONT_STYLE ), "{\"width\":\"expanded\",\"slant\":\"italic\"}", TEST_LOCATION );
+
+ field.SetProperty( TextField::Property::INPUT_POINT_SIZE, 12.f );
+ DALI_TEST_EQUALS( field.GetProperty( TextField::Property::INPUT_POINT_SIZE ), 12.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+
+ field.SetProperty( TextField::Property::TEXT_COLOR, Color::RED );
+ DALI_TEST_EQUALS( field.GetProperty( TextField::Property::TEXT_COLOR ), Color::RED, TEST_LOCATION );
+
+ field.SetProperty( TextField::Property::FONT_STYLE, "{\"weight\":\"bold\",\"slant\":\"italic\"}" );
+ DALI_TEST_EQUALS( field.GetProperty( TextField::Property::FONT_STYLE ), "{\"weight\":\"bold\",\"slant\":\"italic\"}", TEST_LOCATION );
+
+ field.SetProperty( TextField::Property::FONT_STYLE, "{\"width\":\"expanded\"}" );
+ DALI_TEST_EQUALS( field.GetProperty( TextField::Property::FONT_STYLE ), "{\"width\":\"expanded\"}", TEST_LOCATION );
+
+ END_TEST;
+}
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ToolBar.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ToolBar.cpp
index 9adf9cd..db745a4 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-ToolBar.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-ToolBar.cpp
@@ -41,7 +41,7 @@ Actor CreateColorActor( const Vector4& color )
RendererFactory factory = RendererFactory::Get();
Dali::Property::Map map;
- map[ "rendererType" ] = "color";
+ map[ "rendererType" ] = "COLOR";
map[ "mixColor" ] = color;
ControlRenderer colorRenderer = factory.CreateControlRenderer( map );
colorRenderer.SetOnStage( solidColorActor );
diff --git a/build/tizen/Makefile.am b/build/tizen/Makefile.am
index a672053..0d0e733 100644
--- a/build/tizen/Makefile.am
+++ b/build/tizen/Makefile.am
@@ -48,12 +48,14 @@ COVERAGE_OUTPUT_DIR=doc/coverage
# From lcov version 1.10 onwards, branch coverage is off by default and earlier versions do not support the rc option
LCOV_OPTS=`if [ \`printf "\\\`lcov --version | cut -d' ' -f4\\\`\n1.10\n" | sort -V | head -n 1\` = 1.10 ] ; then echo "--rc lcov_branch_coverage=1" ; fi`
-cov_data:
+rename_cov_data:
@test -z $(COVERAGE_DIR) || mkdir -p $(COVERAGE_DIR)
@rm -f $(COVERAGE_DIR)/*
@cp dali-toolkit/.libs/*.gcda dali-toolkit/.libs/*.gcno $(COVERAGE_DIR)
@for i in `find $(COVERAGE_DIR) -name "libdali_toolkit_la-*.gcda" -o -name "libdali_toolkit_la-*.gcno"` ;\
do mv $$i `echo $$i | sed s/libdali_toolkit_la-//` ; echo $$i ; done
+
+cov_data: rename_cov_data
@cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --base-directory . --directory . -c -o dali.info
@cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --remove dali.info "/usr/include/*" "*/dali-env/*" "*solid-color-actor*" "*/dali-toolkit/third-party/*" -o dali.info
@test -z $(COVERAGE_OUTPUT_DIR) || mkdir -p $(COVERAGE_OUTPUT_DIR)
diff --git a/dali-toolkit/devel-api/image-atlas/image-atlas.h b/dali-toolkit/devel-api/image-atlas/image-atlas.h
index 5ef9195..2bc97ae 100644
--- a/dali-toolkit/devel-api/image-atlas/image-atlas.h
+++ b/dali-toolkit/devel-api/image-atlas/image-atlas.h
@@ -1,7 +1,7 @@
-#ifndef __DALI_TOOLKIT_IMAGE_ATLAS_H__
-#define __DALI_TOOLKIT_IMAGE_ATLAS_H__
+#ifndef DALI_TOOLKIT_IMAGE_ATLAS_H
+#define DALI_TOOLKIT_IMAGE_ATLAS_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
#include
#include
#include
-#include
+#include
namespace Dali
{
@@ -153,4 +153,4 @@ public: // Not intended for developer use
} // namespace Dali
-#endif /* __DALI_TOOLKIT_IMAGE_ATLAS_H__ */
+#endif // DALI_TOOLKIT_IMAGE_ATLAS_H
diff --git a/dali-toolkit/devel-api/shader-effects/dissolve-effect.h b/dali-toolkit/devel-api/shader-effects/dissolve-effect.h
index 99036fd..fdea5d0 100644
--- a/dali-toolkit/devel-api/shader-effects/dissolve-effect.h
+++ b/dali-toolkit/devel-api/shader-effects/dissolve-effect.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H__
-#define __DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H__
+#ifndef DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H_
+#define DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
// EXTERNAL INCLUDES
#include
-#include
+#include
namespace Dali
{
@@ -230,4 +230,4 @@ inline Property::Map CreateDissolveEffect( bool useHighPrecision = true )
} // namespace Dali
-#endif // __DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H__
+#endif // DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H
diff --git a/dali-toolkit/devel-api/transition-effects/cube-transition-effect.h b/dali-toolkit/devel-api/transition-effects/cube-transition-effect.h
index 198d352..df51440 100644
--- a/dali-toolkit/devel-api/transition-effects/cube-transition-effect.h
+++ b/dali-toolkit/devel-api/transition-effects/cube-transition-effect.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H__
-#define __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H__
+#ifndef DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H
+#define DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
#include
// EXTERNAL INCLUDES
-#include
+#include
namespace Dali
{
@@ -221,4 +221,4 @@ public: // Not intended for developer use
} // namespace Dali
-#endif /* __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H__ */
+#endif // DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H
diff --git a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
index 4f8e79e..e64289e 100644
--- a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
+++ b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
@@ -28,7 +28,7 @@
#include
#include
#include
-#include
+#include
#include
// INTERNAL INCLUDES
diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-actor.h b/dali-toolkit/internal/controls/bubble-effect/bubble-actor.h
index 213a425..3033032 100644
--- a/dali-toolkit/internal/controls/bubble-effect/bubble-actor.h
+++ b/dali-toolkit/internal/controls/bubble-effect/bubble-actor.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H_
-#define __DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H_
+#ifndef DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H
+#define DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,10 +19,10 @@
*/
// EXTERNAL INCLUDES
-#include
#include
+#include
#include
-#include
+#include
namespace Dali
{
@@ -151,4 +151,4 @@ private:
} // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H_ */
+#endif // DALI_TOOLKIT_INTERNAL_BUBBLE_ACTOR_H
diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-effect.h b/dali-toolkit/internal/controls/bubble-effect/bubble-effect.h
index 9fc065a..6e265f6 100644
--- a/dali-toolkit/internal/controls/bubble-effect/bubble-effect.h
+++ b/dali-toolkit/internal/controls/bubble-effect/bubble-effect.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H_
-#define __DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H_
+#ifndef DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H
+#define DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
// EXTERNAL INCLUDES
#include
-#include
+#include
namespace Dali
{
@@ -128,4 +128,4 @@ inline Shader CreateBubbleShader( unsigned int numBubble )
} // namespace Toolkit
} // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H_ */
+#endif // DALI_TOOLKIT_INTERNAL_BUBBLE_EFFECT_H
diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h
index cbc1fc3..fecbd85 100644
--- a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h
+++ b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__
-#define __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__
+#ifndef DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,11 +23,11 @@
#include
#include
#include
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
// INTERNAL INCLUDES
#include
@@ -197,4 +197,4 @@ inline const Internal::BubbleEmitter& GetImpl(const Dali::Toolkit::BubbleEmitter
} // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H
diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp
index dc00a3c..5e99442 100644
--- a/dali-toolkit/internal/controls/buttons/button-impl.cpp
+++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp
@@ -29,6 +29,7 @@
// INTERNAL INCLUDES
#include
#include
+#include
/**
* Button states and contents
@@ -527,46 +528,53 @@ void Button::SetupContent( Actor& actorToModify, Actor newActor )
}
}
-void Button::SetUnselectedColor( const Vector4& color )
-{
- mUnselectedColor = color;
-
- if( mUnselectedContent && !GetUnselectedImageFilename().empty() )
- {
- // If there is existing unselected content, change the color on it directly.
- mUnselectedContent.SetColor( mUnselectedColor );
- }
- else
- {
- // If there is no existing content, create a new actor to use for flat color.
- Toolkit::Control unselectedContentActor = Toolkit::Control::New();
- unselectedContentActor.SetBackgroundColor( mUnselectedColor );
- SetupContent( mUnselectedContent, unselectedContentActor );
- mUnselectedContent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- }
-}
-
const Vector4 Button::GetUnselectedColor() const
{
return mUnselectedColor;
}
-void Button::SetSelectedColor( const Vector4& color )
+void Button::SetColor( const Vector4& color, Button::PaintState selectedState )
{
- mSelectedColor = color;
+ Actor* contentActor = NULL; // Using a pointer as SetupContent assigns the new Actor to this.
+ bool imageFileExists = false;
- if( mSelectedContent && !GetSelectedImageFilename().empty() )
+ if ( selectedState == SelectedState || selectedState == DisabledSelectedState )
{
- // If there is existing unselected content, change the color on it directly.
- mSelectedContent.SetColor( mSelectedColor );
+ mSelectedColor = color;
+ contentActor = &mSelectedContent;
+ imageFileExists = !GetSelectedImageFilename().empty();
}
else
{
- // If there is no existing content, create a new actor to use for flat color.
- Toolkit::Control selectedContentActor = Toolkit::Control::New();
- selectedContentActor.SetBackgroundColor( mSelectedColor );
- SetupContent( mSelectedContent, selectedContentActor );
- mSelectedContent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mUnselectedColor = color;
+ contentActor = &mUnselectedContent;
+ imageFileExists = !GetUnselectedImageFilename().empty();
+ }
+
+ if ( contentActor )
+ {
+ if( imageFileExists )
+ {
+ // If there is existing unselected content, change the color on it directly.
+ contentActor->SetColor( color );
+ }
+ else
+ {
+ // If there is no existing content, create a new actor to use for flat color.
+ Actor placementActor = Actor::New();
+ Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get();
+ Toolkit::ControlRenderer colorRenderer;
+
+ Property::Map map;
+ map["rendererType"] = "COLOR";
+ map["mixColor"] = color;
+
+ colorRenderer = rendererFactory.CreateControlRenderer( map );
+ colorRenderer.SetOnStage( placementActor );
+
+ SetupContent( *contentActor, placementActor ); //
+ contentActor->SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ }
}
}
@@ -1386,13 +1394,13 @@ void Button::SetProperty( BaseObject* object, Property::Index index, const Prope
case Toolkit::Button::Property::UNSELECTED_COLOR:
{
- GetImplementation( button ).SetUnselectedColor( value.Get< Vector4 >() );
+ GetImplementation( button ).SetColor( value.Get< Vector4 >(), UnselectedState );
break;
}
case Toolkit::Button::Property::SELECTED_COLOR:
{
- GetImplementation( button ).SetSelectedColor( value.Get< Vector4 >() );
+ GetImplementation( button ).SetColor( value.Get< Vector4 >(), SelectedState );
break;
}
diff --git a/dali-toolkit/internal/controls/buttons/button-impl.h b/dali-toolkit/internal/controls/buttons/button-impl.h
index 71a42fe..da2557f 100644
--- a/dali-toolkit/internal/controls/buttons/button-impl.h
+++ b/dali-toolkit/internal/controls/buttons/button-impl.h
@@ -43,18 +43,6 @@ namespace Internal
class Button : public Control
{
-protected:
-
- /**
- * Construct a new Button.
- */
- Button();
-
- /**
- * A reference counted object may only be deleted by calling Unreference()
- */
- virtual ~Button();
-
public:
/**
@@ -285,6 +273,42 @@ public: // Deprecated API
protected:
+ enum ButtonState
+ {
+ ButtonUp, ///< The button is up.
+ ButtonDown, ///< The button is down.
+ };
+
+ /**
+ * Button paint states.
+ */
+ enum PaintState
+ {
+ UnselectedState, ///< The button is unselected.
+ SelectedState, ///< The button is selected.
+ DisabledUnselectedState, ///< The button is disabled and unselected.
+ DisabledSelectedState, ///< The button is disabled and selected.
+ };
+
+ /**
+ * Enum to specify which decoration when getting and setting decorations.
+ */
+ enum DecorationState
+ {
+ UNSELECTED_DECORATION = 0,
+ SELECTED_DECORATION,
+ DECORATION_STATES
+ };
+
+ /**
+ * Construct a new Button.
+ */
+ Button();
+
+ /**
+ * A reference counted object may only be deleted by calling Unreference()
+ */
+ virtual ~Button();
/**
* @return A reference to the label actor.
*/
@@ -494,6 +518,7 @@ protected: // From Control
*/
void OnStageDisconnection();
+
private:
/**
@@ -551,24 +576,18 @@ private:
void SetupContent( Actor& actorToModify, Actor newActor );
/**
- * Sets the color of the unselected image.
- * If no image exists, it is created.
- * @param[in] color The color to use.
- */
- void SetUnselectedColor( const Vector4& color );
-
- /**
* Gets the unselected content color.
* @return The currently used unselected color.
*/
const Vector4 GetUnselectedColor() const;
/**
- * Sets the color of the selected image.
- * If no image exists, it is created.
+ * Sets the color of button in selected or unselected state, if image also supplied this color will be appplied to it.
+ * If no visual exists, it is created.
* @param[in] color The color to use.
+ * @param[in] selectedState The state to apply the color to, SelectedState or DisabledUnselectedState.
*/
- void SetSelectedColor( const Vector4& color );
+ void SetColor( const Vector4& color, PaintState selectedState );
/**
* Gets the selected content color.
@@ -578,33 +597,6 @@ private:
protected:
- enum ButtonState
- {
- ButtonUp, ///< The button is up.
- ButtonDown, ///< The button is down.
- };
-
- /**
- * Button paint states.
- */
- enum PaintState
- {
- UnselectedState, ///< The button is unselected.
- SelectedState, ///< The button is selected.
- DisabledUnselectedState, ///< The button is disabled and unselected.
- DisabledSelectedState, ///< The button is disabled and selected.
- };
-
- /**
- * Enum to specify which decoration when getting and setting decorations.
- */
- enum DecorationState
- {
- UNSELECTED_DECORATION = 0,
- SELECTED_DECORATION,
- DECORATION_STATES
- };
-
ButtonState GetState();
PaintState GetPaintState();
void SetDecoration( DecorationState state, Actor actor );
diff --git a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
index 332d322..4fb7e85 100644
--- a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
+++ b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
@@ -26,8 +26,8 @@
#include
#include
#include
+#include
#include
-#include
// INTERNAL INCLUDES
#include
@@ -161,7 +161,7 @@ void EffectsView::SetType( Toolkit::EffectsView::EffectType type )
Actor self = Self();
Property::Map rendererMap;
- rendererMap.Insert( "rendererType", "image" );
+ rendererMap.Insert( "rendererType", "IMAGE" );
switch( type )
{
diff --git a/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.h b/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.h
index 9c24faa..51388f3 100644
--- a/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.h
+++ b/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_MODEL3D_VIEW_H__
-#define __DALI_TOOLKIT_INTERNAL_MODEL3D_VIEW_H__
+#ifndef DALI_TOOLKIT_INTERNAL_MODEL3D_VIEW_H
+#define DALI_TOOLKIT_INTERNAL_MODEL3D_VIEW_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
*/
// EXTERNAL INCLUDES
-#include
+#include
// INTERNAL INCLUDES
#include
@@ -201,4 +201,4 @@ inline const Toolkit::Internal::Model3dView& GetImpl( const Toolkit::Model3dView
} // namespace Dali
-#endif // __DALI_TOOLKIT_INTERNAL_MODEL_VIEW_H__
+#endif // DALI_TOOLKIT_INTERNAL_MODEL_VIEW_H
diff --git a/dali-toolkit/internal/controls/model3d-view/obj-loader.h b/dali-toolkit/internal/controls/model3d-view/obj-loader.h
index a877bb9..5f4662d 100644
--- a/dali-toolkit/internal/controls/model3d-view/obj-loader.h
+++ b/dali-toolkit/internal/controls/model3d-view/obj-loader.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H__
-#define __DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H__
+#ifndef DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H
+#define DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
*/
// EXTERNAL INCLUDES
-#include
+#include
#include
namespace Dali
@@ -171,4 +171,4 @@ private:
-#endif // __DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H__
+#endif // DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H
diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h b/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
index 1f4bc16..078859d 100644
--- a/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
+++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H__
-#define __DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H__
+#ifndef DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
// EXTERNAL INCLUDES
#include
#include
-#include
+#include
// INTERNAL INCLUDES
#include
@@ -454,4 +454,5 @@ inline const Toolkit::Internal::PageTurnView& GetImplementation(const Toolkit::P
} // namespace Toolkit
} // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H__ */
+
+#endif // DALI_TOOLKIT_INTERNAL_PAGE_TURN_VIEW_IMPL_H
diff --git a/dali-toolkit/internal/controls/renderers/border/border-renderer.h b/dali-toolkit/internal/controls/renderers/border/border-renderer.h
index 56ff901..14eaf42 100644
--- a/dali-toolkit/internal/controls/renderers/border/border-renderer.h
+++ b/dali-toolkit/internal/controls/renderers/border/border-renderer.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__
-#define __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__
+#ifndef DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H
+#define DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,9 @@
* limitations under the License.
*
*/
+
// EXTERNAL INCLUDES
-#include
+#include
// INTERNAL INCLUDES
#include
@@ -146,4 +147,4 @@ private:
} // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H
diff --git a/dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h b/dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h
index 5092075..8349791 100644
--- a/dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h
+++ b/dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H__
-#define __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H__
+#ifndef DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,9 @@
// EXTERNAL INCLUDES
#include
-#include
+#include
+// INTERNAL INCLUDES
#include
namespace Dali
@@ -74,4 +75,4 @@ struct Internal::ControlRenderer::Impl
} // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_DATA_IMPL_H
diff --git a/dali-toolkit/internal/controls/renderers/control-renderer-impl.h b/dali-toolkit/internal/controls/renderers/control-renderer-impl.h
index 3880b0b..a1e91e6 100644
--- a/dali-toolkit/internal/controls/renderers/control-renderer-impl.h
+++ b/dali-toolkit/internal/controls/renderers/control-renderer-impl.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H__
-#define __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H__
+#ifndef DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
+#define DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,15 +18,14 @@
*
*/
-
// EXTERNAL INCLUDES
-#include
#include
-#include
+#include
+#include
// INTERNAL INCLUDES
-#include
#include
+#include
#include
namespace Dali
@@ -251,4 +250,4 @@ inline Internal::ControlRenderer& GetImplementation(Toolkit::ControlRenderer& re
} // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H___ */
+#endif // DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
diff --git a/dali-toolkit/internal/controls/renderers/debug/debug-renderer.cpp b/dali-toolkit/internal/controls/renderers/debug/debug-renderer.cpp
index 1fc45ca..68dd38e 100644
--- a/dali-toolkit/internal/controls/renderers/debug/debug-renderer.cpp
+++ b/dali-toolkit/internal/controls/renderers/debug/debug-renderer.cpp
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
namespace Dali
{
@@ -35,9 +36,6 @@ namespace Internal
namespace
{
-const char * const RENDERER_TYPE("rendererType");
-const char * const RENDERER_TYPE_VALUE("debug");
-
const char * const POSITION_ATTRIBUTE_NAME("aPosition");
const char * const INDEX_NAME("indices");
@@ -82,7 +80,7 @@ void DebugRenderer::DoSetOnStage( Actor& actor )
void DebugRenderer::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
- map.Insert( RENDERER_TYPE, RENDERER_TYPE_VALUE );
+ map.Insert( RENDERER_TYPE, DEBUG_RENDERER );
}
void DebugRenderer::InitializeRenderer()
diff --git a/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp b/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp
index 952bd3b..5923bb5 100644
--- a/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp
+++ b/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp
@@ -59,11 +59,11 @@ const char * const UNITS_NAME("units"); // Property::String "userSpaceOnUse | o
const char * const SPREAD_METHOD_NAME("spreadMethod"); // Property::String "pad | reflect | repeat"
// string values
-const char * const UNIT_USER_SPACE("userSpace");
-const char * const UNIT_BOUNDING_BOX("objectBoundingBox");
-const char * const SPREAD_PAD("pad");
-const char * const SPREAD_REFLECT("reflect");
-const char * const SPREAD_REPEAT("repeat");
+const char * const UNIT_USER_SPACE("USER_SPACE");
+const char * const UNIT_BOUNDING_BOX("OBJECT_BOUNDING_BOX");
+const char * const SPREAD_PAD("PAD");
+const char * const SPREAD_REFLECT("REFLECT");
+const char * const SPREAD_REPEAT("REPEAT");
// uniform names
const char * const UNIFORM_ALIGNMENT_MATRIX_NAME( "uAlignmentMatrix" );
@@ -196,7 +196,7 @@ void GradientRenderer::DoInitialize( Actor& actor, const Property::Map& property
Property::Value* unitsValue = propertyMap.Find( UNITS_NAME );
std::string units;
// The default unit is OBJECT_BOUNDING_BOX.
- // Only need to set new units if 'user-space'
+ // Only need to set new units if 'USER_SPACE'
if( unitsValue && unitsValue->Get( units ) && units == UNIT_USER_SPACE )
{
gradientUnits = Gradient::USER_SPACE_ON_USE;
diff --git a/dali-toolkit/internal/controls/renderers/gradient/gradient.h b/dali-toolkit/internal/controls/renderers/gradient/gradient.h
index 64fd6b5..f08af99 100644
--- a/dali-toolkit/internal/controls/renderers/gradient/gradient.h
+++ b/dali-toolkit/internal/controls/renderers/gradient/gradient.h
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_GRADIENT_H__
-#define __DALI_TOOLKIT_INTERNAL_GRADIENT_H__
+#ifndef DALI_TOOLKIT_INTERNAL_GRADIENT_H
+#define DALI_TOOLKIT_INTERNAL_GRADIENT_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -19,11 +19,11 @@
*/
//EXTERNAL INCLUDES
-#include
-#include
#include
#include
-#include
+#include
+#include
+#include
namespace Dali
{
@@ -177,4 +177,4 @@ protected:
} // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_GRADIENT_RENDERER_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_GRADIENT_RENDERER_H
diff --git a/dali-toolkit/internal/controls/renderers/image-atlas-manager.h b/dali-toolkit/internal/controls/renderers/image-atlas-manager.h
index abe0123..fa1271e 100644
--- a/dali-toolkit/internal/controls/renderers/image-atlas-manager.h
+++ b/dali-toolkit/internal/controls/renderers/image-atlas-manager.h
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_IMAGE_ATLAS_MANAGER_H__
-#define __DALI_TOOLKIT_IMAGE_ATLAS_MANAGER_H__
+#ifndef DALI_TOOLKIT_IMAGE_ATLAS_MANAGER_H
+#define DALI_TOOLKIT_IMAGE_ATLAS_MANAGER_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
#include
#include
#include
-#include
+#include
// INTERNAL INCLUDES
#include
@@ -144,4 +144,4 @@ private:
} // namespace Dali
-#endif // __DALI_TOOLKIT_ATLAS_MANAGER_H__
+#endif // DALI_TOOLKIT_ATLAS_MANAGER_H
diff --git a/dali-toolkit/internal/controls/renderers/mesh/mesh-renderer.cpp b/dali-toolkit/internal/controls/renderers/mesh/mesh-renderer.cpp
index dd52948..acc248c 100644
--- a/dali-toolkit/internal/controls/renderers/mesh/mesh-renderer.cpp
+++ b/dali-toolkit/internal/controls/renderers/mesh/mesh-renderer.cpp
@@ -28,8 +28,6 @@
//INTERNAL INCLUDES
#include
-#include
-#include