Commit 9e6323d9 authored by Elias Alejandro's avatar Elias Alejandro

New upstream version 0.2.5+git20161017

parent 4b7087b6
BSD 3-Clause License
Copyright (c) 2009-2016, Albertas Vyšniauskas
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the software author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Gpick - advanced color picker and palette editor.
Gpick is an application that allows you to sample any color from anywhere on the desktop, and use it to create palettes (i.e. collections of colors) for use in graphic design applications. Gpick also has other features that help in the creation of color palettes, such as:
* The ability to create a palette from an imported image
* Automatic naming of colors
* Color scheme generator
* Import and export from various file formats
## Building from source
### Compiler
Some of C++14 features are required. Compilation is currently only tested on gcc version 5.3.1.
### Build dependencies
SCons 2.4 or newer: a software construction tool ([http://www.scons.org](http://www.scons.org)).
Ragel 6.8 or newer: state machine compiler ([http://www.colm.net/open-source/ragel](http://www.colm.net/open-source/ragel)).
### Dependencies
GTK+ 2.24 ([http://www.gtk.org](http://www.gtk.org)).
Lua 5.3 or 5.2 ([http://www.lua.org](http://www.lua.org)).
Expat ([http://expat.sourceforge.net](http://expat.sourceforge.net)).
Boost 1.58 or newer ([http://www.boost.org](http://www.boost.org)).
Used libraries:
* Filesystem.
* System.
* Test (only when building/running tests).
### Optional dependencies
gettext ([http://www.gnu.org/s/gettext](http://www.gnu.org/s/gettext)). Required if ENABLE\_NLS is enabled. Required by default.
### Building
`scons` to compile all files and place executable file in `build/source/`.
`scons install` to install executable and resources to `DESTDIR`. By default `DESTDIR` is `/usr/local`.
......@@ -17,9 +17,9 @@ vars.Add(BoolVariable('DEBUG', 'Compile with debug information', False))
vars.Add('BUILD_TARGET', 'Build target', '')
vars.Add('TOOLCHAIN', 'Toolchain', 'gcc')
vars.Add(BoolVariable('EXPERIMENTAL_CSS_PARSER', 'Compile with experimental CSS parser', False))
vars.Add(BoolVariable('DOWNLOAD_RESENE_COLOR_LIST', 'Download Resene color list file at program startup', False))
vars.Add('MSVS_VERSION', 'Visual Studio version', '11.0')
vars.Add(BoolVariable('PREBUILD_GRAMMAR', 'Use prebuild grammar files', False))
vars.Add(BoolVariable('USE_GTK3', 'Use GTK3 instead of GTK2', False))
vars.Update(env)
if env['LOCALEDIR'] == '':
......@@ -35,8 +35,9 @@ if not env['BUILD_TARGET']:
if env['BUILD_TARGET'] == 'win32':
if env['TOOLCHAIN'] == 'msvc':
env['TARGET_ARCH'] = 'x86'
env['MSVS'] = {'VERSION': env['MSVS_VERSION']}
env['MSVS'] = {'VERSION': env['MSVS_VERSION']}
env['MSVC_VERSION'] = env['MSVS_VERSION']
env["MSVC_SETUP_RUN"] = False
Tool('msvc')(env)
else:
if sys.platform != 'win32':
......@@ -52,6 +53,16 @@ try:
except OSError: # ignore on systems that don't support umask
pass
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
if os.environ.has_key('CFLAGS'):
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
if not env.GetOption('clean'):
conf = Configure(env)
......@@ -62,6 +73,7 @@ if not env.GetOption('clean'):
programs['XGETTEXT'] = {'checks':{'xgettext':'XGETTEXT'}, 'required':False}
programs['MSGMERGE'] = {'checks':{'msgmerge':'MSGMERGE'}, 'required':False}
programs['MSGCAT'] = {'checks':{'msgcat':'MSGCAT'}, 'required':False}
programs['RAGEL'] = {'checks':{'ragel':'RAGEL'}}
if env['EXPERIMENTAL_CSS_PARSER'] and not env['PREBUILD_GRAMMAR']:
programs['LEMON'] = {'checks':{'lemon':'LEMON'}}
programs['FLEX'] = {'checks':{'flex':'FLEX'}}
......@@ -70,28 +82,19 @@ if not env.GetOption('clean'):
libs = {}
if not env['TOOLCHAIN'] == 'msvc':
libs['GTK_PC'] = {'checks':{'gtk+-2.0':'>= 2.24.0'}}
libs['GIO_PC'] = {'checks':{'gio-unix-2.0':'>= 2.26.0', 'gio-2.0':'>= 2.26.0'}}
libs['LUA_PC'] = {'checks':{'lua':'>= 5.2', 'lua5.2':'>= 5.2'}}
if env['DOWNLOAD_RESENE_COLOR_LIST']:
libs['CURL_PC'] = {'checks':{'libcurl':'>= 7'}}
if not env['USE_GTK3']:
libs['GTK_PC'] = {'checks':{'gtk+-2.0':'>= 2.24.0'}}
libs['GIO_PC'] = {'checks':{'gio-unix-2.0':'>= 2.26.0', 'gio-2.0':'>= 2.26.0'}}
else:
libs['GTK_PC'] = {'checks':{'gtk+-3.0':'>= 3.0.0'}}
libs['CLUTTER_PC'] = {'checks':{'clutter-1.0':'>= 1.0'}}
libs['LUA_PC'] = {'checks':{'lua5.3':'>= 5.3', 'lua':'>= 5.2', 'lua5.2':'>= 5.2'}}
env.ConfirmLibs(conf, libs)
env.ConfirmBoost(conf, '1.58')
env = conf.Finish()
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
if os.environ.has_key('CFLAGS'):
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
Decider('MD5-timestamp')
if not env['TOOLCHAIN'] == 'msvc':
......@@ -110,9 +113,12 @@ if not env['TOOLCHAIN'] == 'msvc':
CFLAGS = ['-Wall', '-O3'],
LINKFLAGS = ['-Wl,-as-needed', '-s'],
)
env.Append(
CPPFLAGS = ['-std=c++14'],
)
if env['BUILD_TARGET'] == 'win32':
env.Append(
env.Append(
LINKFLAGS = ['-Wl,--enable-auto-import', '-static-libgcc', '-static-libstdc++'],
CPPDEFINES = ['_WIN32_WINNT=0x0501'],
)
......@@ -121,21 +127,29 @@ else:
if env['DEBUG']:
env.Append(
CPPFLAGS = ['/Od', '/EHsc', '/MD', '/Gy', '/Zi', '/TP', '/wd4819'],
CPPDEFINES = ['WIN32', '_DEBUG'],
CPPDEFINES = ['WIN32', '_DEBUG', 'NOMINMAX'],
LINKFLAGS = ['/MANIFEST', '/DEBUG'],
)
else:
env.Append(
CPPFLAGS = ['/O2', '/Oi', '/GL', '/EHsc', '/MD', '/Gy', '/Zi', '/TP', '/wd4819'],
CPPDEFINES = ['WIN32', 'NDEBUG'],
CPPDEFINES = ['WIN32', 'NDEBUG', 'NOMINMAX'],
LINKFLAGS = ['/MANIFEST', '/LTCG'],
)
env.Append(
CPPPATH = ['#extern'],
)
extern_libs = SConscript(['extern/SConscript'], exports='env')
executable, parser_files = SConscript(['source/SConscript'], exports='env')
executable, tests, parser_files = SConscript(['source/SConscript'], exports='env')
env.Alias(target="build", source=[
executable
executable,
])
env.Alias(target="test", source=[
tests,
])
if 'debian' in COMMAND_LINE_TARGETS:
......@@ -161,6 +175,7 @@ if env['ENABLE_NLS']:
env.Alias(target="install", source=[
env.InstallProgram(dir=env['DESTDIR'] +'/bin', source=[executable]),
env.InstallData(dir=env['DESTDIR'] +'/share/appdata', source=['share/appdata/gpick.appdata.xml']),
env.InstallData(dir=env['DESTDIR'] +'/share/applications', source=['share/applications/gpick.desktop']),
env.InstallData(dir=env['DESTDIR'] +'/share/doc/gpick', source=['share/doc/gpick/copyright']),
env.InstallData(dir=env['DESTDIR'] +'/share/gpick', source=[env.Glob('share/gpick/*.png'), env.Glob('share/gpick/*.lua'), env.Glob('share/gpick/*.txt')]),
......@@ -174,13 +189,14 @@ env.Alias(target="nsis", source=[
env.WriteNsisVersion("version.py")
])
tarFiles = env.GetSourceFiles( "("+RegexEscape(os.sep)+r"\.)|("+RegexEscape(os.sep)+r"\.svn$)|(^"+RegexEscape(os.sep)+r"build$)", r"(^\.)|(\.pyc$)|(\.orig$)|(~$)|(\.log$)|(\.diff)|(\.mo$)|(^gpick-.*\.tar\.gz$)|(^user-config\.py$)")
tarFiles = env.GetSourceFiles( "("+RegexEscape(os.sep)+r"\.)|("+RegexEscape(os.sep)+r"\.svn$)|(^"+RegexEscape(os.sep)+r"build$)", r"(^\.)|(\.pyc$)|(\.orig$)|(~$)|(\.log$)|(\.diff)|(\.mo$)|(\.patch)|(^gpick-.*\.tar\.gz$)|(^user-config\.py$)")
for item in parser_files:
tarFiles.append(str(item))
if 'TAR' in env:
env.Alias(target="tar", source=[
env.Alias(target = "tar", source = [
env.Template(target = "#version.txt", source = "version.template"),
env.Append(TARFLAGS = ['-z']),
env.Prepend(TARFLAGS = ['--transform', '"s,(^(build/)?),gpick_'+str(env['GPICK_BUILD_VERSION'])+'/,x"']),
env.Tar('gpick_'+str(env['GPICK_BUILD_VERSION'])+'.tar.gz', tarFiles)
......
......@@ -13,14 +13,14 @@ Import('*')
DEBNAME = "gpick"
DEBVERSION = str(env['GPICK_BUILD_VERSION'])+"-1"
DEBMAINT = "Albertas Vyšniauskas <thezbyg@gmail.com>"
DEBMAINT = "Albertas Vyšniauskas <albertas.vysniauskas@gpick.org>"
DEBARCH = env['DEBARCH']
DEBDEPENDS = "libgtk2.0-0 (>= 2.24), libc6 (>= 2.13), liblua5.2-0 (>= 5.2), libcairo2 (>=1.8), libglib2.0-0 (>=2.24)"
DEBPRIORITY = "optional"
DEBSECTION = "graphics"
DEBDESC = "Advanced color picker"
DEBDESCLONG = """ gpick is a program used to pick colors
from anythere on the screen, mix them to
DEBDESCLONG = """ Gpick is a program used to pick colors
from anywhere on the screen, mix them to
get new colors, generate shades and tints
and export palettes to common file formats
or simply copy them to the clipboard
......
......@@ -168,8 +168,8 @@
<Fragment>
<Property Id="ARPCOMMENTS" Value="$(var.Description)" />
<Property Id="ARPPRODUCTICON" Value="GpickIcon" />
<Property Id="ARPURLINFOABOUT" Value="http://gpick.googlecode.com/" />
<Property Id="ARPHELPLINK" Value="http://gpick.googlecode.com/" />
<Property Id="ARPURLINFOABOUT" Value="http://www.gpick.org/" />
<Property Id="ARPHELPLINK" Value="http://www.gpick.org/" />
<CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
<InstallExecuteSequence>
<Custom Action="SetARPINSTALLLOCATION" After="InstallValidate" />
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2009-2016 Albertas Vyšniauskas -->
<component type="desktop">
<id>gpick.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>BSD-3-Clause</project_license>
<name>Gpick</name>
<summary>Advanced color picker and palette editor</summary>
<description>
<p>
Gpick is an application that allows you to sample any color from anywhere
on the desktop, and use it to create palettes (i.e. collections of colors)
for use in graphic design applications.
Gpick also has other features that help in the creation of color palettes,
such as: the ability to create a palette from an imported image, automatic
naming of colors, and a scheme generator.
</p>
</description>
<screenshots>
<screenshot type="default">
<image>http://static.gpick.org/image/appdata-screenshot-0.2.6.png</image>
<caption>The main window showing the application in action</caption>
</screenshot>
</screenshots>
<url type="homepage">http://www.gpick.org</url>
<url type="bugtracker">https://github.com/thezbyg/gpick</url>
<update_contact>albertas.vysniauskas@gpick.org</update_contact>
<developer_name>Albertas Vyšniauskas</developer_name>
<url type="donation">http://www.gpick.org</url>
<url type="help">https://www.gpick.org/help</url>
<translation type="gettext">gpick</translation>
<keywords>
<keyword>color</keyword>
<keyword>picker</keyword>
<keyword>eye</keyword>
<keyword>dropper</keyword>
<keyword>palette</keyword>
<keyword>scheme</keyword>
</keywords>
<url type="translate">http://www.gpick.org/translation</url>
</component>
gpick
This package was debianized by Albertas Vyšniauskas <thezbyg@gmail.com>
This package was debianized by Albertas Vyšniauskas <albertas.vysniauskas@gpick.org>
The home page of gpick is at:
http://code.google.com/p/gpick
The home page of Gpick is at:
http://www.gpick.org
Upstream Author: Albertas Vyšniauskas <thezbyg@gmail.com>
Upstream Author: Albertas Vyšniauskas <albertas.vysniauskas@gpick.org>
This software is copyright (c) 2009 by Albertas Vyšniauskas.
This software is copyright (c) 2009-2016 by Albertas Vyšniauskas.
You are free to distribute this software under the terms of the BSD License.
On Debian systems, the complete text of the BSD license can be found in the file `/usr/share/common-licenses/BSD'.
This diff is collapsed.
This diff is collapsed.
240 248 255 Alice Blue
250 235 215 Antique White
0 255 255 Aqua
127 255 212 Aquamarine
0 127 255 Azure
245 245 220 Beige
255 228 196 Bisque
0 0 0 Black
255 235 205 Blanched Almond
0 0 255 Blue
138 43 226 Blue Violet
165 42 42 Brown
222 184 135 BurlyWood
95 158 160 Cadet Blue
127 255 0 Chartreuse
210 105 30 Chocolate
255 127 80 Coral
100 149 237 Cornflower
255 248 220 Cornsilk
220 20 60 Crimson
0 255 255 Cyan
0 0 139 Dark Blue
0 139 139 Dark Cyan
184 134 11 Dark Goldenrod
169 169 169 Dark Gray
0 100 0 Dark Green
189 183 107 Dark Khaki
139 0 139 Dark Magenta
85 107 47 Dark Olive Green
255 140 0 Dark Orange
153 50 204 Dark Orchid
139 0 0 Dark Red
233 150 122 Dark Salmon
143 188 143 Dark Sea Green
72 61 139 Dark Slate Blue
47 79 79 Dark Slate Gray
0 206 209 Dark Turquoise
148 0 211 Dark Violet
255 20 147 Deep Pink
0 191 255 Deep Sky Blue
105 105 105 Dim Gray
30 144 255 Dodger Blue
0 73 83 Eagle Green
178 34 34 Firebrick
255 250 240 Floral White
34 139 34 Forest Green
255 0 255 Fuchsia
220 220 220 Gainsboro
248 248 255 Ghost White
255 215 0 Gold
218 165 32 Goldenrod
190 190 190 Gray
0 255 0 Green
173 255 47 Green Yellow
240 255 240 Honeydew
255 105 180 Hot Pink
205 92 92 Indian Red
75 0 130 Indigo
255 255 240 Ivory
240 230 140 Khaki
230 230 250 Lavender
255 240 245 Lavender Blush
124 252 0 Lawn Green
255 250 205 Lemon Chiffon
173 216 230 Light Blue
240 128 128 Light Coral
224 255 255 Light Cyan
250 250 210 Light Goldenrod
144 238 144 Light Green
211 211 211 Light Grey
255 182 193 Light Pink
255 160 122 Light Salmon
32 178 170 Light Sea Green
135 206 250 Light Sky Blue
119 136 153 Light Slate Gray
176 196 222 Light Steel Blue
255 255 224 Light Yellow
0 255 0 Lime
50 205 50 Lime Green
250 240 230 Linen
255 0 255 Magenta
176 48 96 Maroon
102 205 170 Medium Aquamarine
0 0 205 Medium Blue
186 85 211 Medium Orchid
147 112 219 Medium Purple
60 179 113 Medium Sea Green
123 104 238 Medium Slate Blue
0 250 154 Medium Spring Green
72 209 204 Medium Turquoise
199 21 133 Medium Violet Red
25 25 112 Midnight Blue
245 255 250 Mint Cream
255 228 225 Misty Rose
255 228 181 Moccasin
255 222 173 Navajo White
0 0 128 Navy
253 245 230 Old Lace
128 128 0 Olive
107 142 35 Olive Drab
255 165 0 Orange
255 69 0 Orange Red
218 112 214 Orchid
238 232 170 Pale Goldenrod
152 251 152 Pale Green
175 238 238 Pale Turquoise
219 112 147 Pale Violet Red
255 239 213 Papaya Whip
255 218 185 Peach Puff
205 133 63 Peru
255 192 203 Pink
221 160 221 Plum
176 224 230 Powder Blue
160 32 240 Purple
155 225 255 Purwa Blue
255 0 0 Red
188 143 143 Rosy Brown
65 105 225 Royal Blue
139 69 19 Saddle Brown
250 128 114 Salmon
244 164 96 Sandy Brown
46 139 87 Sea Green
255 245 238 Seashell
160 82 45 Sienna
192 192 192 Silver
135 206 235 Sky Blue
106 90 205 Slate Blue
112 128 144 Slate Gray
255 250 250 Snow
0 255 127 Spring Green
70 130 180 Steel Blue
210 180 140 Tan
0 128 128 Teal
216 191 216 Thistle
255 99 71 Tomato
64 224 208 Turquoise
238 130 238 Violet
245 222 179 Wheat
255 255 255 White
245 245 245 White Smoke
255 255 0 Yellow
154 205 50 Yellow Green
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (c) 2009-2012, Albertas Vyšniauskas
* Copyright (c) 2009-2016, Albertas Vyšniauskas
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (c) 2009-2012, Albertas Vyšniauskas
* Copyright (c) 2009-2016, Albertas Vyšniauskas
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
......@@ -33,7 +33,7 @@ typedef math::Vec2<double> point;
typedef math::BezierCubicCurve<point, double> bezier;
double bezier_eval_at_x(list<bezier*>& channel, double x, double delta){
for (list<bezier*>::iterator i=channel.begin(); i!=channel.end(); ++i){
for (list<bezier*>::iterator i=channel.begin(); i != channel.end(); ++i){
if (x>=(*i)->p0.x && x<=(*i)->p3.x){
double width = ((*i)->p3.x-(*i)->p0.x);
double t = (x-(*i)->p0.x)/width;
......@@ -268,4 +268,3 @@ double color_ryb_transform_hue(double hue, bool forward){
return 0;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.