Added #39 a new feature the imports custom code during compilation. We also improved the compiler.

This commit is contained in:
Llewellyn van der Merwe 2017-02-01 15:17:04 +02:00
parent ea2b2ea4c4
commit 1a79b92b07
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
458 changed files with 7127 additions and 6251 deletions

View File

@ -1,4 +1,4 @@
# Component Builder (2.2.6)
# Component Builder (2.2.9)
This is a [Joomla 3.x](http://www.joomla.org/) component.
@ -8,7 +8,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc
Whether you're a seasoned [Joomla](http://www.joomla.org/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.2.6) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.2.9) with **ALL** its features and **ALL** concepts totally open-source and free!
Once installed upgrades are quick and easy via the default Joomla upgrade area.
@ -104,13 +104,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:info@vdm.io)
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 20th January, 2017
+ *Version*: 2.2.6
+ *Last Build*: 1st February, 2017
+ *Version*: 2.2.9
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **86216**
+ *File count*: **549**
+ *Folder count*: **100**
+ *Line count*: **90719**
+ *File count*: **583**
+ *Folder count*: **104**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

View File

@ -1,4 +1,4 @@
# Component Builder (2.2.6)
# Component Builder (2.2.9)
This is a [Joomla 3.x](http://www.joomla.org/) component.
@ -8,7 +8,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc
Whether you're a seasoned [Joomla](http://www.joomla.org/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.2.6) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.2.9) with **ALL** its features and **ALL** concepts totally open-source and free!
Once installed upgrades are quick and easy via the default Joomla upgrade area.
@ -104,13 +104,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:info@vdm.io)
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 20th January, 2017
+ *Version*: 2.2.6
+ *Last Build*: 1st February, 2017
+ *Version*: 2.2.9
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **86216**
+ *File count*: **549**
+ *Folder count*: **100**
+ *Line count*: **90719**
+ *File count*: **583**
+ *Folder count*: **104**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

View File

@ -31,6 +31,20 @@
<action name="custom_admin_view.export" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EXPORT" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EXPORT_DESC" />
<action name="custom_admin_view.import" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_IMPORT" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_IMPORT_DESC" />
<action name="custom_admin_view.submenu" title="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_SUBMENU" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_SUBMENU_DESC" />
<action name="custom_code.access" title="COM_COMPONENTBUILDER_CUSTOM_CODES_ACCESS" description="COM_COMPONENTBUILDER_CUSTOM_CODES_ACCESS_DESC" />
<action name="custom_code.batch" title="COM_COMPONENTBUILDER_CUSTOM_CODES_BATCH_USE" description="COM_COMPONENTBUILDER_CUSTOM_CODES_BATCH_USE_DESC" />
<action name="custom_code.create" title="COM_COMPONENTBUILDER_CUSTOM_CODES_CREATE" description="COM_COMPONENTBUILDER_CUSTOM_CODES_CREATE_DESC" />
<action name="custom_code.dashboard_list" title="COM_COMPONENTBUILDER_CUSTOM_CODES_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_CUSTOM_CODES_DASHBOARD_LIST_DESC" />
<action name="custom_code.delete" title="COM_COMPONENTBUILDER_CUSTOM_CODES_DELETE" description="COM_COMPONENTBUILDER_CUSTOM_CODES_DELETE_DESC" />
<action name="custom_code.edit" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_DESC" />
<action name="custom_code.edit.created_by" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_CREATED_BY_DESC" />
<action name="custom_code.edit.created" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_CREATED_DATE_DESC" />
<action name="custom_code.edit.own" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_OWN" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_OWN_DESC" />
<action name="custom_code.edit.state" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_STATE" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_STATE_DESC" />
<action name="custom_code.version" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_VERSION" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_VERSION_DESC" />
<action name="custom_code.export" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EXPORT" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EXPORT_DESC" />
<action name="custom_code.import" title="COM_COMPONENTBUILDER_CUSTOM_CODES_IMPORT" description="COM_COMPONENTBUILDER_CUSTOM_CODES_IMPORT_DESC" />
<action name="custom_code.submenu" title="COM_COMPONENTBUILDER_CUSTOM_CODES_SUBMENU" description="COM_COMPONENTBUILDER_CUSTOM_CODES_SUBMENU_DESC" />
<action name="dynamic_get.access" title="COM_COMPONENTBUILDER_DYNAMIC_GETS_ACCESS" description="COM_COMPONENTBUILDER_DYNAMIC_GETS_ACCESS_DESC" />
<action name="dynamic_get.batch" title="COM_COMPONENTBUILDER_DYNAMIC_GETS_BATCH_USE" description="COM_COMPONENTBUILDER_DYNAMIC_GETS_BATCH_USE_DESC" />
<action name="dynamic_get.create" title="COM_COMPONENTBUILDER_DYNAMIC_GETS_CREATE" description="COM_COMPONENTBUILDER_DYNAMIC_GETS_CREATE_DESC" />
@ -170,6 +184,17 @@
<action name="dynamic_get.access" title="COM_COMPONENTBUILDER_DYNAMIC_GETS_ACCESS" description="COM_COMPONENTBUILDER_DYNAMIC_GETS_ACCESS_DESC" />
<action name="dynamic_get.version" title="COM_COMPONENTBUILDER_DYNAMIC_GETS_EDIT_VERSION" description="COM_COMPONENTBUILDER_DYNAMIC_GETS_EDIT_VERSION_DESC" />
</section>
<section name="custom_code">
<action name="custom_code.edit" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_DESC" />
<action name="custom_code.edit.own" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_OWN" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_OWN_DESC" />
<action name="custom_code.edit.state" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_STATE" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_STATE_DESC" />
<action name="custom_code.edit.created_by" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_CREATED_BY_DESC" />
<action name="custom_code.edit.created" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_CREATED_DATE_DESC" />
<action name="custom_code.create" title="COM_COMPONENTBUILDER_CUSTOM_CODES_CREATE" description="COM_COMPONENTBUILDER_CUSTOM_CODES_CREATE_DESC" />
<action name="custom_code.delete" title="COM_COMPONENTBUILDER_CUSTOM_CODES_DELETE" description="COM_COMPONENTBUILDER_CUSTOM_CODES_DELETE_DESC" />
<action name="custom_code.access" title="COM_COMPONENTBUILDER_CUSTOM_CODES_ACCESS" description="COM_COMPONENTBUILDER_CUSTOM_CODES_ACCESS_DESC" />
<action name="custom_code.version" title="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_VERSION" description="COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT_VERSION_DESC" />
</section>
<section name="snippet">
<action name="core.edit" title="COM_COMPONENTBUILDER_SNIPPETS_EDIT" description="COM_COMPONENTBUILDER_SNIPPETS_EDIT_DESC" />
<action name="core.edit.state" title="COM_COMPONENTBUILDER_SNIPPETS_EDIT_STATE" description="COM_COMPONENTBUILDER_SNIPPETS_EDIT_STATE_DESC" />

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@version 2.2.9
@build 1st February, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@version @update number 94 of this MVC
@build 13th January, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@version @update number 94 of this MVC
@build 13th January, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.css

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 77 of this MVC
@build 26th December, 2016
@created 6th May, 2015
@package Component Builder
@subpackage component.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 77 of this MVC
@build 26th December, 2016
@created 6th May, 2015
@package Component Builder
@subpackage components.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 18 of this MVC
@build 13th January, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_view.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 18 of this MVC
@build 13th January, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_views.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 14 of this MVC
@build 31st January, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_code.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 14 of this MVC
@build 31st January, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_codes.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@version 2.2.9
@build 1st February, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dashboard.css

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 81 of this MVC
@build 15th January, 2017
@created 21st May, 2015
@package Component Builder
@subpackage dynamic_get.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 81 of this MVC
@build 15th January, 2017
@created 21st May, 2015
@package Component Builder
@subpackage dynamic_gets.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@version @update number 36 of this MVC
@build 12th January, 2017
@created 30th April, 2015
@package Component Builder
@subpackage field.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@version @update number 36 of this MVC
@build 12th January, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@version @update number 12 of this MVC
@build 20th October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtype.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@version @update number 12 of this MVC
@build 20th October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.css

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 6 of this MVC
@build 17th October, 2016
@created 4th March, 2016
@package Component Builder
@subpackage help_document.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 6 of this MVC
@build 17th October, 2016
@created 4th March, 2016
@package Component Builder
@subpackage help_documents.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 65 of this MVC
@build 18th October, 2016
@created 18th May, 2015
@package Component Builder
@subpackage layout.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 65 of this MVC
@build 18th October, 2016
@created 18th May, 2015
@package Component Builder
@subpackage layouts.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 44 of this MVC
@build 29th January, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_view.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 44 of this MVC
@build 29th January, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_views.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 16 of this MVC
@build 20th October, 2016
@created 19th May, 2015
@package Component Builder
@subpackage snippet.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 16 of this MVC
@build 20th October, 2016
@created 19th May, 2015
@package Component Builder
@subpackage snippets.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 39 of this MVC
@build 18th October, 2016
@created 26th May, 2015
@package Component Builder
@subpackage template.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

View File

@ -9,9 +9,9 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.6
@build 20th January, 2017
@created 30th April, 2015
@version @update number 39 of this MVC
@build 18th October, 2016
@created 26th May, 2015
@package Component Builder
@subpackage templates.css
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,167 +0,0 @@
<?php
/**
* @author Gasper Kozak
* @copyright 2007-2011
This file is part of WideImage.
WideImage is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
WideImage is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with WideImage; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* @package WideImage
**/
/**
* @package Exceptions
*/
class WideImage_NoFontException extends WideImage_Exception {}
/**
* @package Exceptions
*/
class WideImage_InvalidFontFileException extends WideImage_Exception {}
/**
* @package Exceptions
*/
class WideImage_InvalidCanvasMethodException extends WideImage_Exception {}
/**
* @package WideImage
*/
class WideImage_Canvas
{
protected $handle = 0;
protected $image = null;
protected $font = null;
/**
* Creates a canvas object that writes to the image passed as a parameter
*
* Shouldn't be used directly, use WideImage_Image::getCanvas() instead.
*
* @param WideImage_Image $img Image object
*/
function __construct($img)
{
$this->handle = $img->getHandle();
$this->image = $img;
}
/**
* Sets the active font. Can be an instance of
* WideImage_Font_TTF, WideImage_Font_PS, or WideImage_Font_GDF.
*
*
*
*
* @param object $font Font object to set for writeText()
*/
function setFont($font)
{
$this->font = $font;
}
/**
* Creates and sets the current font
*
* The supported font types are: TTF/OTF, PS, and GDF.
* Font type is detected from the extension. If the $file parameter doesn't have an extension, TTF font is presumed.
*
* Note: not all parameters are supported by all fonts.
*
* @param string $file Font file name (string)
* @param int $size Font size (supported for TTF/OTF and PS fonts, ignored for GDF)
* @param int $color Text color
* @param int $bgcolor Background color (supported only for PS font, ignored for TTF and PS)
* @return mixed One of the WideImage_Font_* objects
*/
function useFont($file, $size = 12, $color = 0, $bgcolor = null)
{
$p = strrpos($file, '.');
if ($p === false || $p < strlen($file) - 4)
$ext = 'ttf';
else
$ext = strtolower(substr($file, $p + 1));
if ($ext == 'ttf' || $ext == 'otf')
$font = new WideImage_Font_TTF($file, $size, $color);
elseif ($ext == 'ps')
$font = new WideImage_Font_PS($file, $size, $color, $bgcolor);
elseif ($ext == 'gdf')
$font = new WideImage_Font_GDF($file, $color);
else
throw new WideImage_InvalidFontFileException("'$file' appears to be an invalid font file.");
$this->setFont($font);
return $font;
}
/**
* Write text on the image at specified position
*
* You must set a font with a call to WideImage_Canvas::setFont() prior to writing text to the image.
*
* Smart coordinates are supported for $x and $y arguments, but currently only for TTF/OTF fonts.
*
* Example:
* <code>
* $img = WideImage::load('pic.jpg');
* $canvas = $img->getCanvas();
* $canvas->useFont('Verdana.ttf', 16, $img->allocateColor(255, 0, 0));
* $canvas->writeText('right', 'bottom', 'www.website.com');
* </code>
*
* @param int $x Left
* @param int $y Top
* @param string $text Text to write
* @param int $angle The angle, defaults to 0
*/
function writeText($x, $y, $text, $angle = 0)
{
if ($this->font === null)
throw new WideImage_NoFontException("Can't write text without a font.");
$angle = - floatval($angle);
if ($angle < 0)
$angle = 360 + $angle;
$angle = $angle % 360;
$this->font->writeText($this->image, $x, $y, $text, $angle);
}
/**
* A magic method that allows you to call any PHP function that starts with "image".
*
* This is a shortcut to call custom functions on the image handle.
*
* Example:
* <code>
* $img = WideImage::load('pic.jpg');
* $canvas = $img->getCanvas();
* $canvas->filledRect(10, 10, 20, 30, $img->allocateColor(0, 0, 0));
* $canvas->line(60, 80, 30, 100, $img->allocateColor(255, 0, 0));
* </code>
*/
function __call($method, $params)
{
if (function_exists('image' . $method))
{
array_unshift($params, $this->handle);
call_user_func_array('image' . $method, $params);
}
else
throw new WideImage_InvalidCanvasMethodException("Function doesn't exist: image{$method}.");
}
}

View File

@ -1,208 +0,0 @@
<?php
/**
* @author Gasper Kozak
* @copyright 2007-2011
This file is part of WideImage.
WideImage is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
WideImage is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with WideImage; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* @package Internals
**/
/**
* @package Exceptions
*/
class WideImage_InvalidCoordinateException extends WideImage_Exception {}
/**
* A utility class for smart coordinates
*
* @package Internals
**/
class WideImage_Coordinate
{
static protected $coord_align = array("left", "center", "right", "top", "middle", "bottom");
static protected $coord_numeric = array("[0-9]+", "[0-9]+\.[0-9]+", "[0-9]+%", "[0-9]+\.[0-9]+%");
/**
* Parses a numeric or string representation of a corrdinate into a structure
*
* @param string $coord Smart coordinate
* @return array Parsed smart coordinate
*/
static function parse($c)
{
$tokens = array();
$operators = array('+', '-');
$flush_operand = false;
$flush_operator = false;
$current_operand = '';
$current_operator = '';
$coordinate = strval($c);
$expr_len = strlen($coordinate);
for ($i = 0; $i < $expr_len; $i++)
{
$char = $coordinate[$i];
if (in_array($char, $operators))
{
$flush_operand = true;
$flush_operator = true;
$current_operator = $char;
}
else
{
$current_operand .= $char;
if ($i == $expr_len - 1)
$flush_operand = true;
}
if ($flush_operand)
{
if (trim($current_operand) != '')
$tokens[] = array('type' => 'operand', 'value' => trim($current_operand));
$current_operand = '';
$flush_operand = false;
}
if ($flush_operator)
{
$tokens[] = array('type' => 'operator', 'value' => $char);
$flush_operator = false;
}
}
return $tokens;
}
/**
* Evaluates the $coord relatively to $dim
*
* @param string $coord A numeric value or percent string
* @param int $dim Dimension
* @param int $sec_dim Secondary dimension (for align)
* @return int Calculated value
*/
static function evaluate($coord, $dim, $sec_dim = null)
{
$comp_regex = implode('|', self::$coord_align) . '|' . implode('|', self::$coord_numeric);
if (preg_match("/^([+-])?({$comp_regex})$/", $coord, $matches))
{
$sign = intval($matches[1] . "1");
$val = $matches[2];
if (in_array($val, self::$coord_align))
{
if ($sec_dim === null)
{
switch ($val)
{
case 'left':
case 'top':
return 0;
break;
case 'center':
case 'middle':
return $sign * intval($dim / 2);
break;
case 'right':
case 'bottom':
return $sign * $dim;
break;
default:
return null;
}
}
else
{
switch ($val)
{
case 'left':
case 'top':
return 0;
break;
case 'center':
case 'middle':
return $sign * intval($dim / 2 - $sec_dim / 2);
break;
case 'right':
case 'bottom':
return $sign * ($dim - $sec_dim);
break;
default:
return null;
}
}
}
elseif (substr($val, -1) === '%')
return intval(round($sign * $dim * floatval(str_replace('%', '', $val)) / 100));
else
return $sign * intval(round($val));
}
}
/**
* Calculates and fixes a smart coordinate into a numeric value
*
* @param mixed $value Smart coordinate, relative to $dim
* @param int $dim Coordinate to which $value is relative
* @param int $sec_dim Secondary dimension (for align)
* @return int Calculated value
*/
static function fix($value, $dim, $sec_dim = null)
{
$coord_tokens = self::parse($value);
if (count($coord_tokens) == 0 || $coord_tokens[count($coord_tokens) - 1]['type'] != 'operand')
throw new WideImage_InvalidCoordinateException("Couldn't parse coordinate '$value' properly.");
$value = 0;
$operation = 1;
foreach ($coord_tokens as $token)
{
if ($token['type'] == 'operand')
{
$operand_value = self::evaluate($token['value'], $dim, $sec_dim);
if ($operation == 1)
$value = $value + $operand_value;
elseif ($operation == -1)
$value = $value - $operand_value;
else
throw new WideImage_InvalidCoordinateException("Invalid coordinate syntax.");
$operation = 0;
}
elseif ($token['type'] == 'operator')
{
if ($token['value'] == '-')
{
if ($operation == 0)
$operation = -1;
else
$operation = $operation * -1;
}
elseif ($token['value'] == '+')
{
if ($operation == 0)
$operation = '1';
}
}
}
return $value;
}
}

View File

@ -1,31 +0,0 @@
<?php
/**
* @author Gasper Kozak
* @copyright 2007-2011
This file is part of WideImage.
WideImage is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
WideImage is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with WideImage; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* @package WideImage
**/
/**
* Base Exception class
*
* @package Exceptions
**/
class WideImage_Exception extends RuntimeException {}

View File

@ -1,48 +0,0 @@
<?php
/**
* @author Gasper Kozak
* @copyright 2007-2011
This file is part of WideImage.
WideImage is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
WideImage is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with WideImage; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* @package WideImage
**/
/**
* GDF font support class
*
* @package WideImage
*/
class WideImage_Font_GDF
{
protected $font;
protected $color;
function __construct($face, $color)
{
if (is_int($face) && $face >= 1 && $face <= 5)
$this->font = $face;
else
$this->font = imageloadfont($face);
$this->color = $color;
}
function writeText($image, $x, $y, $text)
{
imagestring($image->getHandle(), $this->font, $x, $y, $text, $this->color);
}
}

View File

@ -1,60 +0,0 @@
<?php
/**
* @author Gasper Kozak
* @copyright 2007-2011
This file is part of WideImage.
WideImage is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
WideImage is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with WideImage; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* @package WideImage
**/
/**
* PS font support class
*
* @package WideImage
*/
class WideImage_Font_PS
{
public $size;
public $color;
public $handle;
function __construct($file, $size, $color, $bgcolor = null)
{
$this->handle = imagepsloadfont($file);
$this->size = $size;
$this->color = $color;
if ($bgcolor === null)
$this->bgcolor = $color;
else
$this->color = $color;
}
function writeText($image, $x, $y, $text, $angle = 0)
{
if ($image->isTrueColor())
$image->alphaBlending(true);
imagepstext($image->getHandle(), $text, $this->handle, $this->size, $this->color, $this->bgcolor, $x, $y, 0, 0, $angle, 4);
}
function __destruct()
{
imagepsfreefont($this->handle);
$this->handle = null;
}
}

View File

@ -1,75 +0,0 @@
<?php
/**
* @author Gasper Kozak
* @copyright 2007-2011
This file is part of WideImage.
WideImage is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
WideImage is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with WideImage; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* @package WideImage
**/
/**
* TTF font support class
*
* @package WideImage
*/
class WideImage_Font_TTF
{
public $face;
public $size;
public $color;
function __construct($face, $size, $color)
{
$this->face = $face;
$this->size = $size;
$this->color = $color;
}
/**
* Writes text onto an image
*
* @param WideImage_Image $image
* @param mixed $x smart coordinate
* @param mixed $y smart coordinate
* @param string $text
* @param int $angle Angle in degrees clockwise
*/
function writeText($image, $x, $y, $text, $angle = 0)
{
if ($image->isTrueColor())
$image->alphaBlending(true);
$box = imageftbbox($this->size, $angle, $this->face, $text);
$obox = array(
'left' => min($box[0], $box[2], $box[4], $box[6]),
'top' => min($box[1], $box[3], $box[5], $box[7]),
'right' => max($box[0], $box[2], $box[4], $box[6]) - 1,
'bottom' => max($box[1], $box[3], $box[5], $box[7]) - 1
);
$obox['width'] = abs($obox['left']) + abs($obox['right']);
$obox['height'] = abs($obox['top']) + abs($obox['bottom']);
$x = WideImage_Coordinate::fix($x, $image->getWidth(), $obox['width']);
$y = WideImage_Coordinate::fix($y, $image->getHeight(), $obox['height']);
$fixed_x = $x - $obox['left'];
$fixed_y = $y - $obox['top'];
imagettftext($image->getHandle(), $this->size, $angle, $fixed_x, $fixed_y, $this->color, $this->face, $text);
}
}

View File

@ -1,964 +0,0 @@
<?php
/**
* @author Gasper Kozak
* @copyright 2007-2011
This file is part of WideImage.
WideImage is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
WideImage is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with WideImage; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* @package WideImage
**/
/**
* Thrown when an invalid dimension is passed for some operations
*
* @package Exceptions
*/
class WideImage_InvalidImageDimensionException extends WideImage_Exception {}
/**
* Thrown when an image can't be saved (returns false by the mapper)
*
* @package Exceptions
*/
class WideImage_UnknownErrorWhileMappingException extends WideImage_Exception {}
/**
* Base class for images
*
* @package WideImage
*/
abstract class WideImage_Image
{
/**
* Holds the image resource
* @var resource
*/
protected $handle = null;
/**
* Flag that determines if WideImage should call imagedestroy() upon object destruction
* @var bool
*/
protected $handleReleased = false;
/**
* Canvas object
* @var WideImage_Canvas
*/
protected $canvas = null;
/**
* @var string
*/
protected $sdata = null;
/**
* The base class constructor
*
* @param resource $handle Image handle (GD2 resource)
*/
function __construct($handle)
{
WideImage::assertValidImageHandle($handle);
$this->handle = $handle;
}
/**
* Cleanup
*
* Destroys the handle via WideImage_Image::destroy() when called by the GC.
*/
function __destruct()
{
$this->destroy();
}