https://wiki.ugfx.io/api.php?action=feedcontributions&user=Inmarket&feedformat=atom
uGFX Wiki - User contributions [en]
2024-03-29T06:37:03Z
User contributions
MediaWiki 1.26.2
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1890
Changes from V2.x to V3.0
2018-03-10T12:25:22Z
<p>Inmarket: /* The New GDISP API */</p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing. Below is a short summary of the changes. Much more detail will be provided as the V3.0 release comes closer.<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x application code to compile unchanged. It is turned on by default (at least until V3.1). The sections below will talk about where specific items of compatibility has changed.<br />
<br />
A separate configuration option GFX_COMPAT_OLDCOLORS has also been created that controls the old uGFX color names. It also is turned on by default. The reason that this is separate from GFX_COMPAT_V2 is that for some operating systems it may be useful to turn off the old color definitions to prevent symbol conflicts even though you still want V2.x API compatibility.<br />
<br />
All the standard uGFX demo's have been updated to run in pure V3 mode (i.e. without GFX_COMPAT_V2 turned on).<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features (including pixmaps). This will provide greater compatibility with systems such as Arduino and other IDE's. Even drivers can be included in the single-file-make so it is only necessary to include a single source file into your project to include all of uGFX. The original makefile build option is still supported and will work unchanged.<br />
<br />
== Types, Constants and Configuration Options ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code. The old values will still work provided GFX_COMPAT_V2 is turned on.<br />
<br />
General:<br />
* GFXON and GFXOFF replace TRUE/FALSE for configuration options<br />
* GTrue and GFalse replace TRUE/FALSE for the bool_t type.<br />
<br />
GOS:<br />
* The configuration option GFX_OS_CALL_UGFXMAIN now defaults to GFXON if GFX_COMPAT_V2 is turned off.<br />
* Individual GFX_USE_OS_xxx configuration options are replaced by GFX_OS=GFX_OS_xxx. GFX_COMPAT_V2 allows the old configuration options to still be used.<br />
* The configuration option GFX_OS_EXTRA_INIT_FUNCTION has been renamed to GFX_OS_POST_INIT_FUNCTION<br />
* The configuration option GFX_OS_EXTRA_DEINIT_FUNCTION has been renamed to GFX_OS_PRE_DEINIT_FUNCTION<br />
* There is a new configuration option GFX_OS_POST_DEINIT_FUNCTION<br />
<br />
GDISP:<br />
* See below<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed. There are many new types and new functionality is available. See the new GDISP API documentation for more details (when it is available).<br />
<br />
New Functionality:<br />
* New alpha pixel color formats are now supported. GDISP color blending functions have been updated to match.<br />
* More accurate color conversion is available between pixel formats<br />
* Text drawing in other orientations is now available<br />
* All displays can be rotated whether or not the driver supports it. Where the driver doesn't support it directly, the GDISP API performs the necessary rotations on the drawing operations although this may in some cases reduce drawing speed or require extra RAM buffers. Also supported are new partial orientations such as X axis mirroring.<br />
* All drawing now occurs on a single "canvas" rather than on a specific display device. This means that display operations are much more clearly separated from drawing operations. See the multiple display section for more details.<br />
* Flushing of drawing operations to the display can now be much more precisely controlled by the application.<br />
* Significantly improved API.<br />
<br />
Changes:<br />
* The predefined colors GFX_BLACK, GFX_WHITE, GFX_RED etc replace the old color definitions Black, White, Red etc.<br />
* Rounded boxes now require the new configuration option GDISP_NEED_ROUNDBOX.<br />
* Thick lines now require the new configuration option GDISP_NEED_THICKLINES.<br />
* Thick line arcs now require the new configuration option GDISP_NEED_THICKARC.<br />
* Constants gOrientationXXX replace the V2 GDISP_ROTATE_xxx values<br />
* Exact color macros EXACT_xxx_OF are now deprecated. They are still available with GFX_COMPAT_V2 but they work differently. See the new GFX_COLORCONVERT option<br />
* Types gColor, gPixel & gPoint replace the old types color_t, pixel_t, point & point_t<br />
* Types gOrientation, gPowerMode, gJustify replace the old types orientation_t, powermode_t, justify_t<br />
* The configuration options GDISP_NEED_CLIP and GDISP_NEED_VALIDATION are now deprecated (and ignored). They are now effectively always on.<br />
* There is a new configuration option GDISP_NEED_ORIENTATION option which was previously functionality that was bundled into GDISP_NEED_CONTROL.<br />
* There is a new configuration option GDISP_NEED_BLENDING to enable/disable color blending/contrast functions. When GFX_COMPAT_V2 is on then this option is also on by default. <br />
* There are new types to support the new API: gRect, gArea, gBacklight and gContrast<br />
* There is a new configuration option GDISP_NEED_TEXT_ORIENTATION to support text orientation<br />
* There is a new configuration option GDISP_COLORCONVERT to control color conversion strategy<br />
<br />
More details to come...<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently. Instead of having to specify the display device on every drawing operation, now every drawing operation occurs on a virtual "canvas". Displays now overlap a portion of the virtual canvas. This allows some interesting capabilities.<br />
<br />
Case Study 1: Displays can be set to be side-by-side on the virtual canvas and drawing operations can span both display devices. This is similar to the way desktop operating systems handle multiple displays.<br />
<br />
Case Study 2: Two displays may overlap the same area of virtual canvas. This causes a single drawing operation to occur on both displays at the same time. A nice example of this would be a virtual network display that overlaps a physical LCD. Anything drawn on the physical LCD would also be drawn on the virtual network display. This can also be used with pixmaps (which are a type of virtual display). The pixmap could overlap the area of a widget label. Anything drawn on the widget label would automatically get drawn into the pixmap as well.<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking them. This makes drivers much easier to include and build into projects. Unfortunately this means that all uGFX drivers have had to be rewritten and the interface has changed. This means that existing V2.x projects will need to be updated to include the configuration options for the drivers into the gfxconf.h file (or into your makefile C pre-processor symbols). It also means that most V2.x board files will need to be rewritten.<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten. As they are now included as part of the uGFX compile, drivers are not allowed to have symbol conflicts with any other driver in the system. Whilst this is not a huge issue for the drivers themselves (as they are all rewritten for you already in the repository), this requirement also extends to the board files to interface them with actual hardware. This means that all board files will need to be rewritten. GDISP drivers are also structured differently and have new entry points in order to support the new GDISP API capabilities.<br />
<br />
While all board files will need to be rewritten, the new GBUS module will make that process much simpler. Most board interface files will now be much simpler.<br />
<br />
More details to come...<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module. A GBus driver provides a bus type interface to a hardware device. For example, a GBUS driver will exist for:<br />
* STM32 SPI 8 bit bus<br />
* STM32 FMSC 8 bit bus<br />
* STM32 I2C bus<br />
* AT91 9 bit SPI bus<br />
* ChibiOS based 8 bit GPIO parallel bus.<br />
* 16 bit variants of the above<br />
etc.<br />
<br />
Generally the only thing required to use a GBUS is to add the required GBUS driver in your configuration options and then initialise it with the specific CPU pins you want it to use in your display driver board file. This is much simpler than the old way where every driver board file needed to write the full hardware interface code which was often CPU and operating system specific.<br />
<br />
More details to come...<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
The major difference is that instead of specify angle from 0 to 360 degrees, it is now specified from 0.0 to 1.0 in 16:16 fixed point arithmetic. This gives much more accuracy than the previous 1 degree angle and is much faster for the CPU to perform the trig operations.<br />
<br />
More details to come<br />
<br />
== Changes V3.1 and beyond ==<br />
* GWIN event update<br />
* GWIN window manager</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1889
Changes from V2.x to V3.0
2018-03-10T12:24:22Z
<p>Inmarket: /* The New GDISP API */</p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing. Below is a short summary of the changes. Much more detail will be provided as the V3.0 release comes closer.<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x application code to compile unchanged. It is turned on by default (at least until V3.1). The sections below will talk about where specific items of compatibility has changed.<br />
<br />
A separate configuration option GFX_COMPAT_OLDCOLORS has also been created that controls the old uGFX color names. It also is turned on by default. The reason that this is separate from GFX_COMPAT_V2 is that for some operating systems it may be useful to turn off the old color definitions to prevent symbol conflicts even though you still want V2.x API compatibility.<br />
<br />
All the standard uGFX demo's have been updated to run in pure V3 mode (i.e. without GFX_COMPAT_V2 turned on).<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features (including pixmaps). This will provide greater compatibility with systems such as Arduino and other IDE's. Even drivers can be included in the single-file-make so it is only necessary to include a single source file into your project to include all of uGFX. The original makefile build option is still supported and will work unchanged.<br />
<br />
== Types, Constants and Configuration Options ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code. The old values will still work provided GFX_COMPAT_V2 is turned on.<br />
<br />
General:<br />
* GFXON and GFXOFF replace TRUE/FALSE for configuration options<br />
* GTrue and GFalse replace TRUE/FALSE for the bool_t type.<br />
<br />
GOS:<br />
* The configuration option GFX_OS_CALL_UGFXMAIN now defaults to GFXON if GFX_COMPAT_V2 is turned off.<br />
* Individual GFX_USE_OS_xxx configuration options are replaced by GFX_OS=GFX_OS_xxx. GFX_COMPAT_V2 allows the old configuration options to still be used.<br />
* The configuration option GFX_OS_EXTRA_INIT_FUNCTION has been renamed to GFX_OS_POST_INIT_FUNCTION<br />
* The configuration option GFX_OS_EXTRA_DEINIT_FUNCTION has been renamed to GFX_OS_PRE_DEINIT_FUNCTION<br />
* There is a new configuration option GFX_OS_POST_DEINIT_FUNCTION<br />
<br />
GDISP:<br />
* See below<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed. There are many new types and new functionality is available. See the new GDISP API documentation for more details (when it is available).<br />
<br />
New Functionality:<br />
* New alpha pixel color formats are now supported. GDISP blending functions have been updated to match.<br />
* More accurate color conversion is available between pixel formats<br />
* Text drawing in other orientations is now available<br />
* All displays can be rotated whether or not the driver supports it. Where the driver doesn't support it directly, the GDISP API performs the necessary rotations on the drawing operations although this may in some cases reduce drawing speed or require extra RAM buffers. Also supported are new partial orientations such as X axis mirroring.<br />
* All drawing now occurs on a single "canvas" rather than on a specific display device. This means that display operations are much more clearly separated from drawing operations. See the multiple display section for more details.<br />
* Flushing of drawing operations to the display can now be much more precisely controlled by the application.<br />
* Significantly improved API.<br />
<br />
Changes:<br />
* The predefined colors GFX_BLACK, GFX_WHITE, GFX_RED etc replace the old color definitions Black, White, Red etc.<br />
* Rounded boxes now require the new configuration option GDISP_NEED_ROUNDBOX.<br />
* Thick lines now require the new configuration option GDISP_NEED_THICKLINES.<br />
* Thick line arcs now require the new configuration option GDISP_NEED_THICKARC.<br />
* Constants gOrientationXXX replace the V2 GDISP_ROTATE_xxx values<br />
* Exact color macros EXACT_xxx_OF are now deprecated. They are still available with GFX_COMPAT_V2 but they work differently. See the new GFX_COLORCONVERT option<br />
* Types gColor, gPixel & gPoint replace the old types color_t, pixel_t, point & point_t<br />
* Types gOrientation, gPowerMode, gJustify replace the old types orientation_t, powermode_t, justify_t<br />
* The configuration options GDISP_NEED_CLIP and GDISP_NEED_VALIDATION are now deprecated (and ignored). They are now effectively always on.<br />
* There is a new configuration option GDISP_NEED_ORIENTATION option which was previously functionality that was bundled into GDISP_NEED_CONTROL.<br />
* There is a new configuration option GDISP_NEED_BLENDING to enable/disable color blending/contrast functions. When GFX_COMPAT_V2 is on then this option is also on by default. <br />
* There are new types to support the new API: gRect, gArea, gBacklight and gContrast<br />
* There is a new configuration option GDISP_NEED_TEXT_ORIENTATION to support text orientation<br />
* There is a new configuration option GDISP_COLORCONVERT to control color conversion strategy<br />
<br />
More details to come...<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently. Instead of having to specify the display device on every drawing operation, now every drawing operation occurs on a virtual "canvas". Displays now overlap a portion of the virtual canvas. This allows some interesting capabilities.<br />
<br />
Case Study 1: Displays can be set to be side-by-side on the virtual canvas and drawing operations can span both display devices. This is similar to the way desktop operating systems handle multiple displays.<br />
<br />
Case Study 2: Two displays may overlap the same area of virtual canvas. This causes a single drawing operation to occur on both displays at the same time. A nice example of this would be a virtual network display that overlaps a physical LCD. Anything drawn on the physical LCD would also be drawn on the virtual network display. This can also be used with pixmaps (which are a type of virtual display). The pixmap could overlap the area of a widget label. Anything drawn on the widget label would automatically get drawn into the pixmap as well.<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking them. This makes drivers much easier to include and build into projects. Unfortunately this means that all uGFX drivers have had to be rewritten and the interface has changed. This means that existing V2.x projects will need to be updated to include the configuration options for the drivers into the gfxconf.h file (or into your makefile C pre-processor symbols). It also means that most V2.x board files will need to be rewritten.<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten. As they are now included as part of the uGFX compile, drivers are not allowed to have symbol conflicts with any other driver in the system. Whilst this is not a huge issue for the drivers themselves (as they are all rewritten for you already in the repository), this requirement also extends to the board files to interface them with actual hardware. This means that all board files will need to be rewritten. GDISP drivers are also structured differently and have new entry points in order to support the new GDISP API capabilities.<br />
<br />
While all board files will need to be rewritten, the new GBUS module will make that process much simpler. Most board interface files will now be much simpler.<br />
<br />
More details to come...<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module. A GBus driver provides a bus type interface to a hardware device. For example, a GBUS driver will exist for:<br />
* STM32 SPI 8 bit bus<br />
* STM32 FMSC 8 bit bus<br />
* STM32 I2C bus<br />
* AT91 9 bit SPI bus<br />
* ChibiOS based 8 bit GPIO parallel bus.<br />
* 16 bit variants of the above<br />
etc.<br />
<br />
Generally the only thing required to use a GBUS is to add the required GBUS driver in your configuration options and then initialise it with the specific CPU pins you want it to use in your display driver board file. This is much simpler than the old way where every driver board file needed to write the full hardware interface code which was often CPU and operating system specific.<br />
<br />
More details to come...<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
The major difference is that instead of specify angle from 0 to 360 degrees, it is now specified from 0.0 to 1.0 in 16:16 fixed point arithmetic. This gives much more accuracy than the previous 1 degree angle and is much faster for the CPU to perform the trig operations.<br />
<br />
More details to come<br />
<br />
== Changes V3.1 and beyond ==<br />
* GWIN event update<br />
* GWIN window manager</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1888
Changes from V2.x to V3.0
2018-02-24T08:01:34Z
<p>Inmarket: /* New Driver Format */</p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing. Below is a short summary of the changes. Much more detail will be provided as the V3.0 release comes closer.<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x application code to compile unchanged. It is turned on by default (at least until V3.1). The sections below will talk about where specific items of compatibility has changed.<br />
<br />
A separate configuration option GFX_COMPAT_OLDCOLORS has also been created that controls the old uGFX color names. It also is turned on by default. The reason that this is separate from GFX_COMPAT_V2 is that for some operating systems it may be useful to turn off the old color definitions to prevent symbol conflicts even though you still want V2.x API compatibility.<br />
<br />
All the standard uGFX demo's have been updated to run in pure V3 mode (i.e. without GFX_COMPAT_V2 turned on).<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features (including pixmaps). This will provide greater compatibility with systems such as Arduino and other IDE's. Even drivers can be included in the single-file-make so it is only necessary to include a single source file into your project to include all of uGFX. The original makefile build option is still supported and will work unchanged.<br />
<br />
== Types, Constants and Configuration Options ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code. The old values will still work provided GFX_COMPAT_V2 is turned on.<br />
<br />
General:<br />
* GFXON and GFXOFF replace TRUE/FALSE for configuration options<br />
* GTrue and GFalse replace TRUE/FALSE for the bool_t type.<br />
<br />
GOS:<br />
* The configuration option GFX_OS_CALL_UGFXMAIN now defaults to GFXON if GFX_COMPAT_V2 is turned off.<br />
* Individual GFX_USE_OS_xxx configuration options are replaced by GFX_OS=GFX_OS_xxx. GFX_COMPAT_V2 allows the old configuration options to still be used.<br />
* The configuration option GFX_OS_EXTRA_INIT_FUNCTION has been renamed to GFX_OS_POST_INIT_FUNCTION<br />
* The configuration option GFX_OS_EXTRA_DEINIT_FUNCTION has been renamed to GFX_OS_PRE_DEINIT_FUNCTION<br />
* There is a new configuration option GFX_OS_POST_DEINIT_FUNCTION<br />
<br />
GDISP:<br />
* See below<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed. There are many new types and new functionality is available. See the new GDISP API documentation for more details (when it is available).<br />
<br />
New Functionality:<br />
* New alpha pixel color formats are now supported. GDISP blending functions have been updated to match.<br />
* More accurate color conversion is available between pixel formats<br />
* Text drawing in other orientations is now available<br />
* All displays can be rotated whether or not the driver supports it. Where the driver doesn't support it directly, the GDISP API performs the necessary rotations on the drawing operations although this may in some cases reduce drawing speed or require extra RAM buffers. Also supported are new partial orientations such as X axis mirroring.<br />
* All drawing now occurs on a single "canvas" rather than on a specific display device. This means that display operations are much more clearly separated from drawing operations. See the multiple display section for more details.<br />
* Flushing of drawing operations to the display can now be much more precisely controlled by the application.<br />
* Significantly improved API.<br />
<br />
Changes:<br />
* The predefined colors GFXBLACK, GFXWHITE, GFXRED etc replace the old color definitions Black, White, Red etc.<br />
* Rounded boxes now require the new configuration option GDISP_NEED_ROUNDBOX.<br />
* Thick lines now require the new configuration option GDISP_NEED_THICKLINES.<br />
* Thick line arcs now require the new configuration option GDISP_NEED_THICKARC.<br />
* Constants gOrientationXXX replace the V2 GDISP_ROTATE_xxx values<br />
* Exact color macros EXACT_xxx_OF are now deprecated. They are still available with GFX_COMPAT_V2 but they work differently. See the new GFX_COLORCONVERT option<br />
* Types gColor, gPixel & gPoint replace the old types color_t, pixel_t, point & point_t<br />
* Types gOrientation, gPowerMode, gJustify replace the old types orientation_t, powermode_t, justify_t<br />
* The configuration options GDISP_NEED_CLIP and GDISP_NEED_VALIDATION are now deprecated (and ignored). They are now effectively always on.<br />
* There is a new configuration option GDISP_NEED_ORIENTATION option which was previously functionality that was bundled into GDISP_NEED_CONTROL.<br />
* There is a new configuration option GDISP_NEED_BLENDING to enable/disable color blending/contrast functions. When GFX_COMPAT_V2 is on then this option is also on by default. <br />
* There are new types to support the new API: gRect, gArea, gBacklight and gContrast<br />
* There is a new configuration option GDISP_NEED_TEXT_ORIENTATION to support text orientation<br />
* There is a new configuration option GDISP_COLORCONVERT to control color conversion strategy<br />
<br />
More details to come...<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently. Instead of having to specify the display device on every drawing operation, now every drawing operation occurs on a virtual "canvas". Displays now overlap a portion of the virtual canvas. This allows some interesting capabilities.<br />
<br />
Case Study 1: Displays can be set to be side-by-side on the virtual canvas and drawing operations can span both display devices. This is similar to the way desktop operating systems handle multiple displays.<br />
<br />
Case Study 2: Two displays may overlap the same area of virtual canvas. This causes a single drawing operation to occur on both displays at the same time. A nice example of this would be a virtual network display that overlaps a physical LCD. Anything drawn on the physical LCD would also be drawn on the virtual network display. This can also be used with pixmaps (which are a type of virtual display). The pixmap could overlap the area of a widget label. Anything drawn on the widget label would automatically get drawn into the pixmap as well.<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking them. This makes drivers much easier to include and build into projects. Unfortunately this means that all uGFX drivers have had to be rewritten and the interface has changed. This means that existing V2.x projects will need to be updated to include the configuration options for the drivers into the gfxconf.h file (or into your makefile C pre-processor symbols). It also means that most V2.x board files will need to be rewritten.<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten. As they are now included as part of the uGFX compile, drivers are not allowed to have symbol conflicts with any other driver in the system. Whilst this is not a huge issue for the drivers themselves (as they are all rewritten for you already in the repository), this requirement also extends to the board files to interface them with actual hardware. This means that all board files will need to be rewritten. GDISP drivers are also structured differently and have new entry points in order to support the new GDISP API capabilities.<br />
<br />
While all board files will need to be rewritten, the new GBUS module will make that process much simpler. Most board interface files will now be much simpler.<br />
<br />
More details to come...<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module. A GBus driver provides a bus type interface to a hardware device. For example, a GBUS driver will exist for:<br />
* STM32 SPI 8 bit bus<br />
* STM32 FMSC 8 bit bus<br />
* STM32 I2C bus<br />
* AT91 9 bit SPI bus<br />
* ChibiOS based 8 bit GPIO parallel bus.<br />
* 16 bit variants of the above<br />
etc.<br />
<br />
Generally the only thing required to use a GBUS is to add the required GBUS driver in your configuration options and then initialise it with the specific CPU pins you want it to use in your display driver board file. This is much simpler than the old way where every driver board file needed to write the full hardware interface code which was often CPU and operating system specific.<br />
<br />
More details to come...<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
The major difference is that instead of specify angle from 0 to 360 degrees, it is now specified from 0.0 to 1.0 in 16:16 fixed point arithmetic. This gives much more accuracy than the previous 1 degree angle and is much faster for the CPU to perform the trig operations.<br />
<br />
More details to come<br />
<br />
== Changes V3.1 and beyond ==<br />
* GWIN event update<br />
* GWIN window manager</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1887
Changes from V2.x to V3.0
2018-02-24T07:57:06Z
<p>Inmarket: /* The New GDISP API */</p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing. Below is a short summary of the changes. Much more detail will be provided as the V3.0 release comes closer.<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x application code to compile unchanged. It is turned on by default (at least until V3.1). The sections below will talk about where specific items of compatibility has changed.<br />
<br />
A separate configuration option GFX_COMPAT_OLDCOLORS has also been created that controls the old uGFX color names. It also is turned on by default. The reason that this is separate from GFX_COMPAT_V2 is that for some operating systems it may be useful to turn off the old color definitions to prevent symbol conflicts even though you still want V2.x API compatibility.<br />
<br />
All the standard uGFX demo's have been updated to run in pure V3 mode (i.e. without GFX_COMPAT_V2 turned on).<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features (including pixmaps). This will provide greater compatibility with systems such as Arduino and other IDE's. Even drivers can be included in the single-file-make so it is only necessary to include a single source file into your project to include all of uGFX. The original makefile build option is still supported and will work unchanged.<br />
<br />
== Types, Constants and Configuration Options ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code. The old values will still work provided GFX_COMPAT_V2 is turned on.<br />
<br />
General:<br />
* GFXON and GFXOFF replace TRUE/FALSE for configuration options<br />
* GTrue and GFalse replace TRUE/FALSE for the bool_t type.<br />
<br />
GOS:<br />
* The configuration option GFX_OS_CALL_UGFXMAIN now defaults to GFXON if GFX_COMPAT_V2 is turned off.<br />
* Individual GFX_USE_OS_xxx configuration options are replaced by GFX_OS=GFX_OS_xxx. GFX_COMPAT_V2 allows the old configuration options to still be used.<br />
* The configuration option GFX_OS_EXTRA_INIT_FUNCTION has been renamed to GFX_OS_POST_INIT_FUNCTION<br />
* The configuration option GFX_OS_EXTRA_DEINIT_FUNCTION has been renamed to GFX_OS_PRE_DEINIT_FUNCTION<br />
* There is a new configuration option GFX_OS_POST_DEINIT_FUNCTION<br />
<br />
GDISP:<br />
* See below<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed. There are many new types and new functionality is available. See the new GDISP API documentation for more details (when it is available).<br />
<br />
New Functionality:<br />
* New alpha pixel color formats are now supported. GDISP blending functions have been updated to match.<br />
* More accurate color conversion is available between pixel formats<br />
* Text drawing in other orientations is now available<br />
* All displays can be rotated whether or not the driver supports it. Where the driver doesn't support it directly, the GDISP API performs the necessary rotations on the drawing operations although this may in some cases reduce drawing speed or require extra RAM buffers. Also supported are new partial orientations such as X axis mirroring.<br />
* All drawing now occurs on a single "canvas" rather than on a specific display device. This means that display operations are much more clearly separated from drawing operations. See the multiple display section for more details.<br />
* Flushing of drawing operations to the display can now be much more precisely controlled by the application.<br />
* Significantly improved API.<br />
<br />
Changes:<br />
* The predefined colors GFXBLACK, GFXWHITE, GFXRED etc replace the old color definitions Black, White, Red etc.<br />
* Rounded boxes now require the new configuration option GDISP_NEED_ROUNDBOX.<br />
* Thick lines now require the new configuration option GDISP_NEED_THICKLINES.<br />
* Thick line arcs now require the new configuration option GDISP_NEED_THICKARC.<br />
* Constants gOrientationXXX replace the V2 GDISP_ROTATE_xxx values<br />
* Exact color macros EXACT_xxx_OF are now deprecated. They are still available with GFX_COMPAT_V2 but they work differently. See the new GFX_COLORCONVERT option<br />
* Types gColor, gPixel & gPoint replace the old types color_t, pixel_t, point & point_t<br />
* Types gOrientation, gPowerMode, gJustify replace the old types orientation_t, powermode_t, justify_t<br />
* The configuration options GDISP_NEED_CLIP and GDISP_NEED_VALIDATION are now deprecated (and ignored). They are now effectively always on.<br />
* There is a new configuration option GDISP_NEED_ORIENTATION option which was previously functionality that was bundled into GDISP_NEED_CONTROL.<br />
* There is a new configuration option GDISP_NEED_BLENDING to enable/disable color blending/contrast functions. When GFX_COMPAT_V2 is on then this option is also on by default. <br />
* There are new types to support the new API: gRect, gArea, gBacklight and gContrast<br />
* There is a new configuration option GDISP_NEED_TEXT_ORIENTATION to support text orientation<br />
* There is a new configuration option GDISP_COLORCONVERT to control color conversion strategy<br />
<br />
More details to come...<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently. Instead of having to specify the display device on every drawing operation, now every drawing operation occurs on a virtual "canvas". Displays now overlap a portion of the virtual canvas. This allows some interesting capabilities.<br />
<br />
Case Study 1: Displays can be set to be side-by-side on the virtual canvas and drawing operations can span both display devices. This is similar to the way desktop operating systems handle multiple displays.<br />
<br />
Case Study 2: Two displays may overlap the same area of virtual canvas. This causes a single drawing operation to occur on both displays at the same time. A nice example of this would be a virtual network display that overlaps a physical LCD. Anything drawn on the physical LCD would also be drawn on the virtual network display. This can also be used with pixmaps (which are a type of virtual display). The pixmap could overlap the area of a widget label. Anything drawn on the widget label would automatically get drawn into the pixmap as well.<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking them. This makes drivers much easier to include and build into projects. Unfortunately this means that all uGFX drivers have had to be rewritten and the interface has changed. This means that existing V2.x projects will need to be updated to include the configuration options for the drivers into the gfxconf.h file (or into your makefile C pre-processor symbols). It also means that most V2.x board files will need to be rewritten.<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten. As they are now included as part of the uGFX compile, drivers are not allowed to have symbol conflicts with any other driver in the system. Whilst this is not a huge issue for the drivers themselves (as they are all rewritten), this requirement also extends to the board files to interface them with actual hardware. This means that all board files will need to be rewritten. GDISP drivers are also structured differently and have new entry points in order to support the new GDISP API capabilities.<br />
<br />
While all board files will need to be rewritten, the new GBUS module will make that process much simpler. Most board interface files will now be much simpler.<br />
<br />
More details to come...<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module. A GBus driver provides a bus type interface to a hardware device. For example, a GBUS driver will exist for:<br />
* STM32 SPI 8 bit bus<br />
* STM32 FMSC 8 bit bus<br />
* STM32 I2C bus<br />
* AT91 9 bit SPI bus<br />
* ChibiOS based 8 bit GPIO parallel bus.<br />
* 16 bit variants of the above<br />
etc.<br />
<br />
Generally the only thing required to use a GBUS is to add the required GBUS driver in your configuration options and then initialise it with the specific CPU pins you want it to use in your display driver board file. This is much simpler than the old way where every driver board file needed to write the full hardware interface code which was often CPU and operating system specific.<br />
<br />
More details to come...<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
The major difference is that instead of specify angle from 0 to 360 degrees, it is now specified from 0.0 to 1.0 in 16:16 fixed point arithmetic. This gives much more accuracy than the previous 1 degree angle and is much faster for the CPU to perform the trig operations.<br />
<br />
More details to come<br />
<br />
== Changes V3.1 and beyond ==<br />
* GWIN event update<br />
* GWIN window manager</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1886
Changes from V2.x to V3.0
2018-02-24T07:55:41Z
<p>Inmarket: /* The New GDISP API */</p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing. Below is a short summary of the changes. Much more detail will be provided as the V3.0 release comes closer.<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x application code to compile unchanged. It is turned on by default (at least until V3.1). The sections below will talk about where specific items of compatibility has changed.<br />
<br />
A separate configuration option GFX_COMPAT_OLDCOLORS has also been created that controls the old uGFX color names. It also is turned on by default. The reason that this is separate from GFX_COMPAT_V2 is that for some operating systems it may be useful to turn off the old color definitions to prevent symbol conflicts even though you still want V2.x API compatibility.<br />
<br />
All the standard uGFX demo's have been updated to run in pure V3 mode (i.e. without GFX_COMPAT_V2 turned on).<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features (including pixmaps). This will provide greater compatibility with systems such as Arduino and other IDE's. Even drivers can be included in the single-file-make so it is only necessary to include a single source file into your project to include all of uGFX. The original makefile build option is still supported and will work unchanged.<br />
<br />
== Types, Constants and Configuration Options ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code. The old values will still work provided GFX_COMPAT_V2 is turned on.<br />
<br />
General:<br />
* GFXON and GFXOFF replace TRUE/FALSE for configuration options<br />
* GTrue and GFalse replace TRUE/FALSE for the bool_t type.<br />
<br />
GOS:<br />
* The configuration option GFX_OS_CALL_UGFXMAIN now defaults to GFXON if GFX_COMPAT_V2 is turned off.<br />
* Individual GFX_USE_OS_xxx configuration options are replaced by GFX_OS=GFX_OS_xxx. GFX_COMPAT_V2 allows the old configuration options to still be used.<br />
* The configuration option GFX_OS_EXTRA_INIT_FUNCTION has been renamed to GFX_OS_POST_INIT_FUNCTION<br />
* The configuration option GFX_OS_EXTRA_DEINIT_FUNCTION has been renamed to GFX_OS_PRE_DEINIT_FUNCTION<br />
* There is a new configuration option GFX_OS_POST_DEINIT_FUNCTION<br />
<br />
GDISP:<br />
* See below<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed. There are many new types and new functionality is available. See the new GDISP API documentation for more details (when it is available).<br />
<br />
New Functionality:<br />
* New alpha pixel color formats are now supported. GDISP blending functions have been updated to match.<br />
* More accurate color conversion is available between pixel formats<br />
* Text drawing in other orientations is now available<br />
* All displays can be rotated whether or not the driver supports it. Where the driver doesn't support it directly the GDISP API performs the necessary rotations on the drawing operations. Also supported are new partial orientations such as X axis mirroring.<br />
* All drawing now occurs on a single "canvas" rather than on a specific display device. This means that display operations are much more clearly separated from drawing operations. See the multiple display section for more details.<br />
* Flushing of drawing operations to the display can now be much more precisely controlled by the application.<br />
* Significantly improved API.<br />
<br />
Changes:<br />
* The predefined colors GFXBLACK, GFXWHITE, GFXRED etc replace the old color definitions Black, White, Red etc.<br />
* Rounded boxes now require the new configuration option GDISP_NEED_ROUNDBOX.<br />
* Thick lines now require the new configuration option GDISP_NEED_THICKLINES.<br />
* Thick line arcs now require the new configuration option GDISP_NEED_THICKARC.<br />
* Constants gOrientationXXX replace the V2 GDISP_ROTATE_xxx values<br />
* Exact color macros EXACT_xxx_OF are now deprecated. They are still available with GFX_COMPAT_V2 but they work differently. See the new GFX_COLORCONVERT option<br />
* Types gColor, gPixel & gPoint replace the old types color_t, pixel_t, point & point_t<br />
* Types gOrientation, gPowerMode, gJustify replace the old types orientation_t, powermode_t, justify_t<br />
* The configuration options GDISP_NEED_CLIP and GDISP_NEED_VALIDATION are now deprecated (and ignored). They are now effectively always on.<br />
* There is a new configuration option GDISP_NEED_ORIENTATION option which was previously functionality that was bundled into GDISP_NEED_CONTROL.<br />
* There is a new configuration option GDISP_NEED_BLENDING to enable/disable color blending/contrast functions. When GFX_COMPAT_V2 is on then this option is also on by default. <br />
* There are new types to support the new API: gRect, gArea, gBacklight and gContrast<br />
* There is a new configuration option GDISP_NEED_TEXT_ORIENTATION to support text orientation<br />
* There is a new configuration option GDISP_COLORCONVERT to control color conversion strategy<br />
<br />
More details to come...<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently. Instead of having to specify the display device on every drawing operation, now every drawing operation occurs on a virtual "canvas". Displays now overlap a portion of the virtual canvas. This allows some interesting capabilities.<br />
<br />
Case Study 1: Displays can be set to be side-by-side on the virtual canvas and drawing operations can span both display devices. This is similar to the way desktop operating systems handle multiple displays.<br />
<br />
Case Study 2: Two displays may overlap the same area of virtual canvas. This causes a single drawing operation to occur on both displays at the same time. A nice example of this would be a virtual network display that overlaps a physical LCD. Anything drawn on the physical LCD would also be drawn on the virtual network display. This can also be used with pixmaps (which are a type of virtual display). The pixmap could overlap the area of a widget label. Anything drawn on the widget label would automatically get drawn into the pixmap as well.<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking them. This makes drivers much easier to include and build into projects. Unfortunately this means that all uGFX drivers have had to be rewritten and the interface has changed. This means that existing V2.x projects will need to be updated to include the configuration options for the drivers into the gfxconf.h file (or into your makefile C pre-processor symbols). It also means that most V2.x board files will need to be rewritten.<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten. As they are now included as part of the uGFX compile, drivers are not allowed to have symbol conflicts with any other driver in the system. Whilst this is not a huge issue for the drivers themselves (as they are all rewritten), this requirement also extends to the board files to interface them with actual hardware. This means that all board files will need to be rewritten. GDISP drivers are also structured differently and have new entry points in order to support the new GDISP API capabilities.<br />
<br />
While all board files will need to be rewritten, the new GBUS module will make that process much simpler. Most board interface files will now be much simpler.<br />
<br />
More details to come...<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module. A GBus driver provides a bus type interface to a hardware device. For example, a GBUS driver will exist for:<br />
* STM32 SPI 8 bit bus<br />
* STM32 FMSC 8 bit bus<br />
* STM32 I2C bus<br />
* AT91 9 bit SPI bus<br />
* ChibiOS based 8 bit GPIO parallel bus.<br />
* 16 bit variants of the above<br />
etc.<br />
<br />
Generally the only thing required to use a GBUS is to add the required GBUS driver in your configuration options and then initialise it with the specific CPU pins you want it to use in your display driver board file. This is much simpler than the old way where every driver board file needed to write the full hardware interface code which was often CPU and operating system specific.<br />
<br />
More details to come...<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
The major difference is that instead of specify angle from 0 to 360 degrees, it is now specified from 0.0 to 1.0 in 16:16 fixed point arithmetic. This gives much more accuracy than the previous 1 degree angle and is much faster for the CPU to perform the trig operations.<br />
<br />
More details to come<br />
<br />
== Changes V3.1 and beyond ==<br />
* GWIN event update<br />
* GWIN window manager</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1885
Changes from V2.x to V3.0
2018-02-24T07:54:36Z
<p>Inmarket: /* Types, Constants and Configuration Options */</p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing. Below is a short summary of the changes. Much more detail will be provided as the V3.0 release comes closer.<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x application code to compile unchanged. It is turned on by default (at least until V3.1). The sections below will talk about where specific items of compatibility has changed.<br />
<br />
A separate configuration option GFX_COMPAT_OLDCOLORS has also been created that controls the old uGFX color names. It also is turned on by default. The reason that this is separate from GFX_COMPAT_V2 is that for some operating systems it may be useful to turn off the old color definitions to prevent symbol conflicts even though you still want V2.x API compatibility.<br />
<br />
All the standard uGFX demo's have been updated to run in pure V3 mode (i.e. without GFX_COMPAT_V2 turned on).<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features (including pixmaps). This will provide greater compatibility with systems such as Arduino and other IDE's. Even drivers can be included in the single-file-make so it is only necessary to include a single source file into your project to include all of uGFX. The original makefile build option is still supported and will work unchanged.<br />
<br />
== Types, Constants and Configuration Options ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code. The old values will still work provided GFX_COMPAT_V2 is turned on.<br />
<br />
General:<br />
* GFXON and GFXOFF replace TRUE/FALSE for configuration options<br />
* GTrue and GFalse replace TRUE/FALSE for the bool_t type.<br />
<br />
GOS:<br />
* The configuration option GFX_OS_CALL_UGFXMAIN now defaults to GFXON if GFX_COMPAT_V2 is turned off.<br />
* Individual GFX_USE_OS_xxx configuration options are replaced by GFX_OS=GFX_OS_xxx. GFX_COMPAT_V2 allows the old configuration options to still be used.<br />
* The configuration option GFX_OS_EXTRA_INIT_FUNCTION has been renamed to GFX_OS_POST_INIT_FUNCTION<br />
* The configuration option GFX_OS_EXTRA_DEINIT_FUNCTION has been renamed to GFX_OS_PRE_DEINIT_FUNCTION<br />
* There is a new configuration option GFX_OS_POST_DEINIT_FUNCTION<br />
<br />
GDISP:<br />
* See below<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed. There are many new types and new functionality is available. See the new GDISP API documentation for more details (when it is available).<br />
<br />
New Functionality:<br />
* New pixel color supports support Alpha channels. GDISP blending functions have been updated to match.<br />
* More accurate color conversion is available between pixel formats<br />
* Text drawing in other orientations is now available<br />
* All displays can be rotated whether or not the driver supports it. Where the driver doesn't support it directly the GDISP API performs the necessary rotations on the drawing operations. Also supported are new partial orientations such as X axis mirroring.<br />
* All drawing now occurs on a single "canvas" rather than on a specific display device. This means that display operations are much more clearly separated from drawing operations. See the multiple display section for more details.<br />
* Flushing of drawing operations to the display can now be much more precisely controlled by the application.<br />
* Significantly improved API.<br />
<br />
Changes:<br />
* The predefined colors GFXBLACK, GFXWHITE, GFXRED etc replace the old color definitions Black, White, Red etc.<br />
* Rounded boxes now require the new configuration option GDISP_NEED_ROUNDBOX.<br />
* Thick lines now require the new configuration option GDISP_NEED_THICKLINES.<br />
* Thick line arcs now require the new configuration option GDISP_NEED_THICKARC.<br />
* Constants gOrientationXXX replace the V2 GDISP_ROTATE_xxx values<br />
* Exact color macros EXACT_xxx_OF are now deprecated. They are still available with GFX_COMPAT_V2 but they work differently. See the new GFX_COLORCONVERT option<br />
* Types gColor, gPixel & gPoint replace the old types color_t, pixel_t, point & point_t<br />
* Types gOrientation, gPowerMode, gJustify replace the old types orientation_t, powermode_t, justify_t<br />
* The configuration options GDISP_NEED_CLIP and GDISP_NEED_VALIDATION are now deprecated (and ignored). They are now effectively always on.<br />
* There is a new configuration option GDISP_NEED_ORIENTATION option which was previously functionality that was bundled into GDISP_NEED_CONTROL.<br />
* There is a new configuration option GDISP_NEED_BLENDING to enable/disable color blending/contrast functions. When GFX_COMPAT_V2 is on then this option is also on by default. <br />
* There are new types to support the new API: gRect, gArea, gBacklight and gContrast<br />
* There is a new configuration option GDISP_NEED_TEXT_ORIENTATION to support text orientation<br />
* There is a new configuration option GDISP_COLORCONVERT to control color conversion strategy<br />
<br />
More details to come...<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently. Instead of having to specify the display device on every drawing operation, now every drawing operation occurs on a virtual "canvas". Displays now overlap a portion of the virtual canvas. This allows some interesting capabilities.<br />
<br />
Case Study 1: Displays can be set to be side-by-side on the virtual canvas and drawing operations can span both display devices. This is similar to the way desktop operating systems handle multiple displays.<br />
<br />
Case Study 2: Two displays may overlap the same area of virtual canvas. This causes a single drawing operation to occur on both displays at the same time. A nice example of this would be a virtual network display that overlaps a physical LCD. Anything drawn on the physical LCD would also be drawn on the virtual network display. This can also be used with pixmaps (which are a type of virtual display). The pixmap could overlap the area of a widget label. Anything drawn on the widget label would automatically get drawn into the pixmap as well.<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking them. This makes drivers much easier to include and build into projects. Unfortunately this means that all uGFX drivers have had to be rewritten and the interface has changed. This means that existing V2.x projects will need to be updated to include the configuration options for the drivers into the gfxconf.h file (or into your makefile C pre-processor symbols). It also means that most V2.x board files will need to be rewritten.<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten. As they are now included as part of the uGFX compile, drivers are not allowed to have symbol conflicts with any other driver in the system. Whilst this is not a huge issue for the drivers themselves (as they are all rewritten), this requirement also extends to the board files to interface them with actual hardware. This means that all board files will need to be rewritten. GDISP drivers are also structured differently and have new entry points in order to support the new GDISP API capabilities.<br />
<br />
While all board files will need to be rewritten, the new GBUS module will make that process much simpler. Most board interface files will now be much simpler.<br />
<br />
More details to come...<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module. A GBus driver provides a bus type interface to a hardware device. For example, a GBUS driver will exist for:<br />
* STM32 SPI 8 bit bus<br />
* STM32 FMSC 8 bit bus<br />
* STM32 I2C bus<br />
* AT91 9 bit SPI bus<br />
* ChibiOS based 8 bit GPIO parallel bus.<br />
* 16 bit variants of the above<br />
etc.<br />
<br />
Generally the only thing required to use a GBUS is to add the required GBUS driver in your configuration options and then initialise it with the specific CPU pins you want it to use in your display driver board file. This is much simpler than the old way where every driver board file needed to write the full hardware interface code which was often CPU and operating system specific.<br />
<br />
More details to come...<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
The major difference is that instead of specify angle from 0 to 360 degrees, it is now specified from 0.0 to 1.0 in 16:16 fixed point arithmetic. This gives much more accuracy than the previous 1 degree angle and is much faster for the CPU to perform the trig operations.<br />
<br />
More details to come<br />
<br />
== Changes V3.1 and beyond ==<br />
* GWIN event update<br />
* GWIN window manager</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1884
Changes from V2.x to V3.0
2018-02-24T07:53:20Z
<p>Inmarket: /* Single-File-Make */</p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing. Below is a short summary of the changes. Much more detail will be provided as the V3.0 release comes closer.<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x application code to compile unchanged. It is turned on by default (at least until V3.1). The sections below will talk about where specific items of compatibility has changed.<br />
<br />
A separate configuration option GFX_COMPAT_OLDCOLORS has also been created that controls the old uGFX color names. It also is turned on by default. The reason that this is separate from GFX_COMPAT_V2 is that for some operating systems it may be useful to turn off the old color definitions to prevent symbol conflicts even though you still want V2.x API compatibility.<br />
<br />
All the standard uGFX demo's have been updated to run in pure V3 mode (i.e. without GFX_COMPAT_V2 turned on).<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features (including pixmaps). This will provide greater compatibility with systems such as Arduino and other IDE's. Even drivers can be included in the single-file-make so it is only necessary to include a single source file into your project to include all of uGFX. The original makefile build option is still supported and will work unchanged.<br />
<br />
== Types, Constants and Configuration Options ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code. The old values will still work provided GFX_COMPAT_V2 is turned on.<br />
<br />
General:<br />
* GFXON and GFXOFF replace TRUE/FALSE for configuration options<br />
* GTrue and GFalse replace TRUE/FALSE for the bool_t type.<br />
<br />
GOS:<br />
* The configuration option GFX_OS_CALL_UGFXMAIN now defaults to GFXON if GFX_COMPAT_V2 is not set.<br />
* Individual GFX_USE_OS_xxx configuration options are replaced by GFX_OS=GFX_OS_xxx. GFX_COMPAT_V2 allows the old configuration options to still be used.<br />
* The configuration option GFX_OS_EXTRA_INIT_FUNCTION has been renamed to GFX_OS_POST_INIT_FUNCTION<br />
* The configuration option GFX_OS_EXTRA_DEINIT_FUNCTION has been renamed to GFX_OS_PRE_DEINIT_FUNCTION<br />
* There is a new configuration option GFX_OS_POST_DEINIT_FUNCTION<br />
<br />
GDISP:<br />
* See below<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed. There are many new types and new functionality is available. See the new GDISP API documentation for more details (when it is available).<br />
<br />
New Functionality:<br />
* New pixel color supports support Alpha channels. GDISP blending functions have been updated to match.<br />
* More accurate color conversion is available between pixel formats<br />
* Text drawing in other orientations is now available<br />
* All displays can be rotated whether or not the driver supports it. Where the driver doesn't support it directly the GDISP API performs the necessary rotations on the drawing operations. Also supported are new partial orientations such as X axis mirroring.<br />
* All drawing now occurs on a single "canvas" rather than on a specific display device. This means that display operations are much more clearly separated from drawing operations. See the multiple display section for more details.<br />
* Flushing of drawing operations to the display can now be much more precisely controlled by the application.<br />
* Significantly improved API.<br />
<br />
Changes:<br />
* The predefined colors GFXBLACK, GFXWHITE, GFXRED etc replace the old color definitions Black, White, Red etc.<br />
* Rounded boxes now require the new configuration option GDISP_NEED_ROUNDBOX.<br />
* Thick lines now require the new configuration option GDISP_NEED_THICKLINES.<br />
* Thick line arcs now require the new configuration option GDISP_NEED_THICKARC.<br />
* Constants gOrientationXXX replace the V2 GDISP_ROTATE_xxx values<br />
* Exact color macros EXACT_xxx_OF are now deprecated. They are still available with GFX_COMPAT_V2 but they work differently. See the new GFX_COLORCONVERT option<br />
* Types gColor, gPixel & gPoint replace the old types color_t, pixel_t, point & point_t<br />
* Types gOrientation, gPowerMode, gJustify replace the old types orientation_t, powermode_t, justify_t<br />
* The configuration options GDISP_NEED_CLIP and GDISP_NEED_VALIDATION are now deprecated (and ignored). They are now effectively always on.<br />
* There is a new configuration option GDISP_NEED_ORIENTATION option which was previously functionality that was bundled into GDISP_NEED_CONTROL.<br />
* There is a new configuration option GDISP_NEED_BLENDING to enable/disable color blending/contrast functions. When GFX_COMPAT_V2 is on then this option is also on by default. <br />
* There are new types to support the new API: gRect, gArea, gBacklight and gContrast<br />
* There is a new configuration option GDISP_NEED_TEXT_ORIENTATION to support text orientation<br />
* There is a new configuration option GDISP_COLORCONVERT to control color conversion strategy<br />
<br />
More details to come...<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently. Instead of having to specify the display device on every drawing operation, now every drawing operation occurs on a virtual "canvas". Displays now overlap a portion of the virtual canvas. This allows some interesting capabilities.<br />
<br />
Case Study 1: Displays can be set to be side-by-side on the virtual canvas and drawing operations can span both display devices. This is similar to the way desktop operating systems handle multiple displays.<br />
<br />
Case Study 2: Two displays may overlap the same area of virtual canvas. This causes a single drawing operation to occur on both displays at the same time. A nice example of this would be a virtual network display that overlaps a physical LCD. Anything drawn on the physical LCD would also be drawn on the virtual network display. This can also be used with pixmaps (which are a type of virtual display). The pixmap could overlap the area of a widget label. Anything drawn on the widget label would automatically get drawn into the pixmap as well.<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking them. This makes drivers much easier to include and build into projects. Unfortunately this means that all uGFX drivers have had to be rewritten and the interface has changed. This means that existing V2.x projects will need to be updated to include the configuration options for the drivers into the gfxconf.h file (or into your makefile C pre-processor symbols). It also means that most V2.x board files will need to be rewritten.<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten. As they are now included as part of the uGFX compile, drivers are not allowed to have symbol conflicts with any other driver in the system. Whilst this is not a huge issue for the drivers themselves (as they are all rewritten), this requirement also extends to the board files to interface them with actual hardware. This means that all board files will need to be rewritten. GDISP drivers are also structured differently and have new entry points in order to support the new GDISP API capabilities.<br />
<br />
While all board files will need to be rewritten, the new GBUS module will make that process much simpler. Most board interface files will now be much simpler.<br />
<br />
More details to come...<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module. A GBus driver provides a bus type interface to a hardware device. For example, a GBUS driver will exist for:<br />
* STM32 SPI 8 bit bus<br />
* STM32 FMSC 8 bit bus<br />
* STM32 I2C bus<br />
* AT91 9 bit SPI bus<br />
* ChibiOS based 8 bit GPIO parallel bus.<br />
* 16 bit variants of the above<br />
etc.<br />
<br />
Generally the only thing required to use a GBUS is to add the required GBUS driver in your configuration options and then initialise it with the specific CPU pins you want it to use in your display driver board file. This is much simpler than the old way where every driver board file needed to write the full hardware interface code which was often CPU and operating system specific.<br />
<br />
More details to come...<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
The major difference is that instead of specify angle from 0 to 360 degrees, it is now specified from 0.0 to 1.0 in 16:16 fixed point arithmetic. This gives much more accuracy than the previous 1 degree angle and is much faster for the CPU to perform the trig operations.<br />
<br />
More details to come<br />
<br />
== Changes V3.1 and beyond ==<br />
* GWIN event update<br />
* GWIN window manager</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1883
Changes from V2.x to V3.0
2018-02-24T07:52:05Z
<p>Inmarket: </p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing. Below is a short summary of the changes. Much more detail will be provided as the V3.0 release comes closer.<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x application code to compile unchanged. It is turned on by default (at least until V3.1). The sections below will talk about where specific items of compatibility has changed.<br />
<br />
A separate configuration option GFX_COMPAT_OLDCOLORS has also been created that controls the old uGFX color names. It also is turned on by default. The reason that this is separate from GFX_COMPAT_V2 is that for some operating systems it may be useful to turn off the old color definitions to prevent symbol conflicts even though you still want V2.x API compatibility.<br />
<br />
All the standard uGFX demo's have been updated to run in pure V3 mode (i.e. without GFX_COMPAT_V2 turned on).<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features. This will provide greater compatibility with systems such as Arduino and other IDE's. Even drivers can be included in the single-file-make so it is only necessary to include a single source file into your project to include all of uGFX. The original makefile build option is still supported and will work unchanged.<br />
<br />
== Types, Constants and Configuration Options ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code. The old values will still work provided GFX_COMPAT_V2 is turned on.<br />
<br />
General:<br />
* GFXON and GFXOFF replace TRUE/FALSE for configuration options<br />
* GTrue and GFalse replace TRUE/FALSE for the bool_t type.<br />
<br />
GOS:<br />
* The configuration option GFX_OS_CALL_UGFXMAIN now defaults to GFXON if GFX_COMPAT_V2 is not set.<br />
* Individual GFX_USE_OS_xxx configuration options are replaced by GFX_OS=GFX_OS_xxx. GFX_COMPAT_V2 allows the old configuration options to still be used.<br />
* The configuration option GFX_OS_EXTRA_INIT_FUNCTION has been renamed to GFX_OS_POST_INIT_FUNCTION<br />
* The configuration option GFX_OS_EXTRA_DEINIT_FUNCTION has been renamed to GFX_OS_PRE_DEINIT_FUNCTION<br />
* There is a new configuration option GFX_OS_POST_DEINIT_FUNCTION<br />
<br />
GDISP:<br />
* See below<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed. There are many new types and new functionality is available. See the new GDISP API documentation for more details (when it is available).<br />
<br />
New Functionality:<br />
* New pixel color supports support Alpha channels. GDISP blending functions have been updated to match.<br />
* More accurate color conversion is available between pixel formats<br />
* Text drawing in other orientations is now available<br />
* All displays can be rotated whether or not the driver supports it. Where the driver doesn't support it directly the GDISP API performs the necessary rotations on the drawing operations. Also supported are new partial orientations such as X axis mirroring.<br />
* All drawing now occurs on a single "canvas" rather than on a specific display device. This means that display operations are much more clearly separated from drawing operations. See the multiple display section for more details.<br />
* Flushing of drawing operations to the display can now be much more precisely controlled by the application.<br />
* Significantly improved API.<br />
<br />
Changes:<br />
* The predefined colors GFXBLACK, GFXWHITE, GFXRED etc replace the old color definitions Black, White, Red etc.<br />
* Rounded boxes now require the new configuration option GDISP_NEED_ROUNDBOX.<br />
* Thick lines now require the new configuration option GDISP_NEED_THICKLINES.<br />
* Thick line arcs now require the new configuration option GDISP_NEED_THICKARC.<br />
* Constants gOrientationXXX replace the V2 GDISP_ROTATE_xxx values<br />
* Exact color macros EXACT_xxx_OF are now deprecated. They are still available with GFX_COMPAT_V2 but they work differently. See the new GFX_COLORCONVERT option<br />
* Types gColor, gPixel & gPoint replace the old types color_t, pixel_t, point & point_t<br />
* Types gOrientation, gPowerMode, gJustify replace the old types orientation_t, powermode_t, justify_t<br />
* The configuration options GDISP_NEED_CLIP and GDISP_NEED_VALIDATION are now deprecated (and ignored). They are now effectively always on.<br />
* There is a new configuration option GDISP_NEED_ORIENTATION option which was previously functionality that was bundled into GDISP_NEED_CONTROL.<br />
* There is a new configuration option GDISP_NEED_BLENDING to enable/disable color blending/contrast functions. When GFX_COMPAT_V2 is on then this option is also on by default. <br />
* There are new types to support the new API: gRect, gArea, gBacklight and gContrast<br />
* There is a new configuration option GDISP_NEED_TEXT_ORIENTATION to support text orientation<br />
* There is a new configuration option GDISP_COLORCONVERT to control color conversion strategy<br />
<br />
More details to come...<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently. Instead of having to specify the display device on every drawing operation, now every drawing operation occurs on a virtual "canvas". Displays now overlap a portion of the virtual canvas. This allows some interesting capabilities.<br />
<br />
Case Study 1: Displays can be set to be side-by-side on the virtual canvas and drawing operations can span both display devices. This is similar to the way desktop operating systems handle multiple displays.<br />
<br />
Case Study 2: Two displays may overlap the same area of virtual canvas. This causes a single drawing operation to occur on both displays at the same time. A nice example of this would be a virtual network display that overlaps a physical LCD. Anything drawn on the physical LCD would also be drawn on the virtual network display. This can also be used with pixmaps (which are a type of virtual display). The pixmap could overlap the area of a widget label. Anything drawn on the widget label would automatically get drawn into the pixmap as well.<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking them. This makes drivers much easier to include and build into projects. Unfortunately this means that all uGFX drivers have had to be rewritten and the interface has changed. This means that existing V2.x projects will need to be updated to include the configuration options for the drivers into the gfxconf.h file (or into your makefile C pre-processor symbols). It also means that most V2.x board files will need to be rewritten.<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten. As they are now included as part of the uGFX compile, drivers are not allowed to have symbol conflicts with any other driver in the system. Whilst this is not a huge issue for the drivers themselves (as they are all rewritten), this requirement also extends to the board files to interface them with actual hardware. This means that all board files will need to be rewritten. GDISP drivers are also structured differently and have new entry points in order to support the new GDISP API capabilities.<br />
<br />
While all board files will need to be rewritten, the new GBUS module will make that process much simpler. Most board interface files will now be much simpler.<br />
<br />
More details to come...<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module. A GBus driver provides a bus type interface to a hardware device. For example, a GBUS driver will exist for:<br />
* STM32 SPI 8 bit bus<br />
* STM32 FMSC 8 bit bus<br />
* STM32 I2C bus<br />
* AT91 9 bit SPI bus<br />
* ChibiOS based 8 bit GPIO parallel bus.<br />
* 16 bit variants of the above<br />
etc.<br />
<br />
Generally the only thing required to use a GBUS is to add the required GBUS driver in your configuration options and then initialise it with the specific CPU pins you want it to use in your display driver board file. This is much simpler than the old way where every driver board file needed to write the full hardware interface code which was often CPU and operating system specific.<br />
<br />
More details to come...<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
The major difference is that instead of specify angle from 0 to 360 degrees, it is now specified from 0.0 to 1.0 in 16:16 fixed point arithmetic. This gives much more accuracy than the previous 1 degree angle and is much faster for the CPU to perform the trig operations.<br />
<br />
More details to come<br />
<br />
== Changes V3.1 and beyond ==<br />
* GWIN event update<br />
* GWIN window manager</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1882
Changes from V2.x to V3.0
2018-02-24T06:34:51Z
<p>Inmarket: </p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing.<br />
<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x code to compile unchanged. It is turned on by default.<br />
<br />
More details to come<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features.<br />
<br />
More details to come<br />
<br />
== Type and Constant Changes ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code.<br />
<br />
More details to come<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed.<br />
<br />
More details to come<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently.<br />
<br />
More details to come<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking.<br />
<br />
More details to come<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten.<br />
<br />
More details to come<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module.<br />
<br />
More details to come<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
More details to come<br />
<br />
== Changes V3.1 and beyond ==<br />
* GWIN event update<br />
* GWIN window manager</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1881
Changes from V2.x to V3.0
2018-02-24T06:14:48Z
<p>Inmarket: </p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing.<br />
<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x code to compile unchanged. It is turned on by default.<br />
<br />
More details to come<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features.<br />
<br />
More details to come<br />
<br />
== Type and Constant Changes ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code.<br />
<br />
More details to come<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed.<br />
<br />
More details to come<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently.<br />
<br />
More details to come<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking.<br />
<br />
More details to come<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten.<br />
<br />
More details to come<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module.<br />
<br />
More details to come<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
More details to come</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1880
Changes from V2.x to V3.0
2018-02-24T03:29:50Z
<p>Inmarket: </p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing.<br />
<br />
<br />
== Compatibility ==<br />
The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x code to compile unchanged. It is turned on by default.<br />
<br />
== Single-File-Make ==<br />
The single-file-make build mechanism now works with all uGFX features.<br />
<br />
== Type and Constant Changes ==<br />
Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code.<br />
<br />
== The New GDISP API ==<br />
The GDISP API has been significantly changed.<br />
<br />
== Multiple Display Support ==<br />
Multiple display support now works very differently.<br />
<br />
== Adding Drivers To Your Build ==<br />
All drivers are now included using configuration options rather than by linking.<br />
<br />
== New Driver Format ==<br />
All uGFX drivers now use a new internal API and have been rewritten.<br />
<br />
== The New GBUS Module ==<br />
Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module.<br />
<br />
== New Trig Functions ==<br />
There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Changes_from_V2.x_to_V3.0&diff=1879
Changes from V2.x to V3.0
2018-02-24T03:27:48Z
<p>Inmarket: Created page with "There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writ..."</p>
<hr />
<div>There are many major changes from uGFX V2.x to V3.0. While we have tried to maintain compatibility for most uGFX V2 applications there are some areas that will require re-writing.<br />
<br />
<br />
== Major Changes ==<br />
* The configuration option GFX_COMPAT_V2 is now defined that allows most V2.x code to compile unchanged. It is turned on by default.<br />
* The single-file-make build mechanism now works with all uGFX features.<br />
* Many types and constants have been renamed to prevent conflicts with other library, operating systems or other code.<br />
* The GDISP API has been significantly changed.<br />
* Multiple display support now works very differently.<br />
* All drivers are now included using configuration options rather than by linking.<br />
* All uGFX drivers now use a new internal API and have been rewritten.<br />
* Many hardware interface details that needed to be written explicitly into every driver board file are now handled by a new GBUS module.<br />
* There are new triginomic functions that are significantly faster and more accurate than the old functions in GMISC.<br />
<br />
== Compatibility ==<br />
<br />
== Single-File-Make ==<br />
<br />
== Type and Constant Changes ==<br />
<br />
== The New GDISP API ==<br />
<br />
== Multiple Display Support ==<br />
<br />
== Adding Drivers To Your Build ==<br />
<br />
== New Driver Format ==<br />
<br />
== The New GBUS Module ==<br />
<br />
== New Trig Functions ==</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Main_Page&diff=1878
Main Page
2018-02-24T03:07:41Z
<p>Inmarket: </p>
<hr />
<div><div class="div-header">Welcome to the µGFX wiki!</div><br />
<div class="div-block">This is the official documentation of the [http://ugfx.io µGFX] library. Please note that this is just the documentation, the official project website can be found at [http://ugfx.io ugfx.io]. The API reference can be found at [http://api.ugfx.io api.ugfx.io].<br />
<br />
If you're new to µGFX, begin by reading [[Getting Started]].<br />
</div><br />
<div style="width: 50%; float: left;"><br />
<div class="div-header" style="margin-right: 5px;">General</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [[Getting Started]]<br />
* [[Configuration]]<br />
* [[Architecture]]<br />
* [[Board File]]<br />
* [[API Reference]]<br />
* [[Changes from V2.x to V3.0]]<br />
</div><br />
<div class="div-header" style="margin-right: 5px;">Using µGFX on...</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [[BareMetal]]<br />
* [[CMSIS RTOS]]<br />
* [[ChibiOS/RT]]<br />
* [[FreeRTOS]]<br />
* [[RawOS]]<br />
* [[eCos]]<br />
* [[Zephyr]]<br />
* [[Using_Keil_µVision_5_MDK-ARM|Keil RTX]]<br />
* [[Teensy]]<br />
* [[Raspberry Pi]]<br />
* [[Linux]]<br />
* [[Win32]]<br />
* [[Mac OS X]]<br />
</div><br />
<div class="div-header" style="margin-right: 5px;">Using IDEs</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [[Using Keil µVision 5 MDK-ARM|Keil µVision 5 MDK-ARM]]<br />
* [[Using IAR embedded workbench|IAR embedded workbench]]<br />
* [[Using Eclipse|Eclipse]]<br />
* [[Using PSoC Creator|PSoC Creator]]<br />
* [[Using ChibiStudio|ChibiStudio]]<br />
</div><br />
<div class="div-header" style="margin-right: 5px;">Developer Guides</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [[Your First Compile - Windows]]<br />
* [[Creating a custom rendering routine]]<br />
* [[Creating a widget]]<br />
* [[Use_uGFX_repository_as_Git_Submodule|Advanced git guide]]<br />
</div><br />
<div class="div-header" style="margin-right: 5px;">µGFX Design Choices</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [[Display Driver Model]]<br />
</div><br />
</div><br />
<div style="width: 50%; float: right;"><br />
<div class="div-header" style="margin-left: 5px;">Modules</div><br />
<div class="div-block" style="margin-left: 5px;"><br />
* [[GWIN]]<br />
** [[Windows]]<br />
*** [[Console]]<br />
*** [[Graph]]<br />
** [[Widgets]]<br />
*** [[Label]]<br />
*** [[PushButton]]<br />
*** [[RadioButton]]<br />
*** [[CheckBox]]<br />
*** [[List]]<br />
*** [[Slider]]<br />
*** [[Progressbar]]<br />
*** [[ImageBox]]<br />
*** [[TextEdit]]<br />
*** [[Keyboard]]<br />
** [[Containers]]<br />
*** [[Container]]<br />
*** [[Tabset]]<br />
*** [[Frame]]<br />
* [[GAUDIO]]<br />
* [[GFILE]]<br />
* [[GOS]]<br />
* [[GDISP]]<br />
** [[Drawing]]<br />
** [[Font rendering]]<br />
** [[Images]]<br />
* [[GINPUT]]<br />
* [[GTRANS]]<br />
* [[GEVENT]]<br />
* [[GTIMER]]<br />
* [[GQUEUE]]<br />
</div><br />
</div><br />
<br />
__NOTOC__</div>
Inmarket
https://wiki.ugfx.io/index.php?title=GTRANS&diff=1512
GTRANS
2016-02-29T02:13:29Z
<p>Inmarket: </p>
<hr />
<div>The GTRANS module allows you to manage language translations. The language of an application can be changed dynamically during run-time using the GTRANS module.<br />
<br />
== API reference ==<br />
The API reference of the GTRANS module can be found [http://api.ugfx.org/group___g_t_r_a_n_s.html here].<br />
<br />
== Intended usage ==<br />
Each translation is specified by a <code>transTable</code> struct which is essentially a table of strings:<br />
<source lang="c"><br />
typedef struct transTable {<br />
unsigned numEntries; // The number of strings that this table contains<br />
const char** strings; // The translated strings<br />
} transTable;<br />
</source><br />
<br />
A translatable application needs to have a base language. All translations happen relative to that base language. The base language is specified using <code>gtransSetBaseLanguage()</code>. The current language of the application is set using <code>gtransSetLanguage()</code>.<br />
The actual translations take place by calling <code>gtransString()</code>. A string contained in the translation table of the base language is passed to <code>gtransString()</code>. The function returns the corresponding string of the current language that was set using <code>gtransSetLanguage()</code> or the passed string if none was found.<br />
<br />
A wrapper macro named <code>gt()</code> around <code>gtransString()</code> is available to make writing and reading translatable applications easier:<br />
<source lang="c"><br />
#define gt(str) gtransString(str)<br />
</source><br />
<br />
== Optimization ==<br />
Calling <code>gt()</code> (or <code>gtransString()</code> directly) uses the <code>strcmp()</code> function of the standard C library to compare strings. This operation can take a lot of time. For performance critical applications or low-resource systems the application translation speed can be optimized by using <code>gtransIndex()</code> (instead of <code>gtransString()</code>) which directly takes the index of the string in the translation table. However, this introduces the limitation that each string in each of the translation tables need to be at the same position (the same index). Using <code>gtransString()</code> allows to have translation tables of unequal sizes due to the nature of the translation being based on string comparison rather than index accessing of the table.<br />
<br />
== Example ==<br />
Complete examples can be found under ''/demos/modules/gtrans/'' in the uGFX library directory.<br />
<br />
=== Basic Example ===<br />
The following code is a very simple usage example showing how the GTRANS module is used. This is a very minimalistic example with no dependencies other than the [[GDISP]] module to interface a display.<br />
<source lang="c"><br />
#include <stdio.h><br />
#include "gfx.h"<br />
<br />
#define COLOR_BACKGROUND Silver<br />
#define COLOR_TEXT Black<br />
<br />
font_t font;<br />
<br />
// English Translation<br />
static const char* EnglishStrings[] = {<br />
"Welcome",<br />
"The temperature is %d degrees",<br />
"Goodbye",<br />
"This is a translated uGFX application"<br />
};<br />
static const transTable EnglishTranslation = { sizeof(EnglishStrings)/sizeof(EnglishStrings[0]), EnglishStrings };<br />
<br />
// German translation<br />
static const char* GermanStrings[] = {<br />
"Herzlich Willkommen",<br />
"Die Temperatur beträgt %d Grad",<br />
"Auf Wiedersehen",<br />
"Das ist eine übersetzte uGFX Anwendung"<br />
};<br />
static const transTable GermanTranslation = { sizeof(GermanStrings)/sizeof(GermanStrings[0]), GermanStrings };<br />
<br />
// French translation<br />
static const char* FrenchStrings[] = {<br />
"Bienvenue",<br />
"La température est de %d degrés",<br />
"Au revoir",<br />
"Ceci est une application traduit uGFX"<br />
};<br />
static const transTable FrenchTranslation = { sizeof(FrenchStrings)/sizeof(FrenchStrings[0]), FrenchStrings };<br />
<br />
void updateText()<br />
{<br />
coord_t width = 400;<br />
coord_t height = 30;<br />
<br />
// Translate some basic strings<br />
gdispFillStringBox(20, 20, width, height, gt("Welcome"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);<br />
gdispFillStringBox(20, 60, width, height, gt("This is a translated uGFX application"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);<br />
gdispFillStringBox(20, 100, width, height, gt("Goodbye"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);<br />
<br />
// A more complex example using string formatting<br />
char buffer[128];<br />
sprintf(buffer, gt("The temperature is %d degrees"), 18);<br />
gdispFillStringBox(20, 140, width, height, buffer, font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);<br />
}<br />
<br />
int main(void)<br />
{<br />
// Initialize the uGFX library<br />
gfxInit();<br />
gdispClear(COLOR_BACKGROUND);<br />
<br />
// Take the first font we find<br />
font = gdispOpenFont("*");<br />
<br />
// Set the base language of the application<br />
gtransSetBaseLanguage(&EnglishTranslation);<br />
<br />
// Loop through the languages<br />
while (TRUE) {<br />
// English<br />
gtransSetLanguage(&EnglishTranslation);<br />
updateText();<br />
gfxSleepMilliseconds(3000);<br />
<br />
// German<br />
gtransSetLanguage(&GermanTranslation);<br />
updateText();<br />
gfxSleepMilliseconds(3000);<br />
<br />
// French<br />
gtransSetLanguage(&FrenchTranslation);<br />
updateText();<br />
gfxSleepMilliseconds(3000);<br />
}<br />
<br />
return 0;<br />
}<br />
</source><br />
<br />
=== Example with widgets ===<br />
The following example demonstrates how the language of an application using widgets can be translated using GTRANS. The user can select the language using [[PushButton|buttons]].<br />
<source lang="c"><br />
ToDo<br />
</source></div>
Inmarket
https://wiki.ugfx.io/index.php?title=GOS&diff=732
GOS
2014-11-06T07:10:51Z
<p>Inmarket: /* Existing ports */</p>
<hr />
<div>GOS is the module which builds the abstraction layer between µGFX and the underlying system. The underlying system can be an RTOS such as [http://chibios.org ChibiOS] or [http://freertos.org FreeRTOS], or also just a stand-alone library like the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743?icmp=ss1743_pron_pr1_jun2014&sc=stm32cube-pr5 STDperiph library] from STmicroelectronics. The GOS module allows to write completely platform independent application code.<br />
<br />
== API reference ==<br />
The API reference of the GOS module can be found [http://ugfx.org/images/resources/doxygen/master/group___g_o_s.html here].<br />
<br />
== Initialization ==<br />
For code portability reasons the underlying system will be automatically initialized when <code>gosInit()</code> is called unless ''GFX_NO_OS_INIT'' is set to ''TRUE'' in the [[Configuration|configuration file]].<br />
<br />
== Existing ports ==<br />
The following ports already exist and are part of the official repository:<br />
<br />
* ChibiOS/RT<br />
* FreeRTOS<br />
* eCos<br />
* rawrtos<br />
* BareMetal (no OS at all)<br />
* Linux<br />
* Mac OS X<br />
* Windows<br />
<br />
=== BareMetal ===<br />
It's possible to run µGFX directly on a bare-metal system like the stdperipheral library for the STM controller without any underlying OS. Start with the RAW32 implementation. This supports a simple non-preemptive scheduler. You still need to provide some basic routines such as a routine to get the system tick count.<br />
<br />
== Porting ==<br />
Porting uGFX to a new underlying system is fairly easy. Only a couple of functions and data types have to be implemented and declared.<br />
<br />
=== Functions ===<br />
ToDo<br />
<syntaxhighlight lang=c><br />
void gfxHalt(const char *msg);<br />
void gfxExit(void);<br />
void* gfxAlloc(size_t sz);<br />
void* gfxRealloc(void *p, size_t oldsz, size_t newsz);<br />
void gfxFree(void *ptr);<br />
void gfxYield(void);<br />
void gfxSleepMilliseconds(delaytime_t ms);<br />
void gfxSleepMicroseconds(delaytime_t ms);<br />
systemticks_t gfxSystemTicks(void);<br />
systemticks_t gfxMillisecondsToTicks(delaytime_t ms);<br />
void gfxSystemLock(void);<br />
void gfxSystemUnlock(void);<br />
void gfxMutexInit(gfxMutex *pmutex);<br />
void gfxMutexDestroy(gfxMutex *pmutex);<br />
void gfxMutexEnter(gfxMutex *pmutex);<br />
void gfxMutexExit(gfxMutex *pmutex);<br />
void gfxSemInit(gfxSem *psem, semcount_t val, semcount_t limit);<br />
void gfxSemDestroy(gfxSem *psem);<br />
bool_t gfxSemWait(gfxSem *psem, delaytime_t ms);<br />
void gfxSemSignal(gfxSem *psem);<br />
void gfxSemSignalI(gfxSem *psem);<br />
semcount_t gfxSemCounter(gfxSem *pSem);<br />
semcount_t gfxSemCounterI(gfxSem *pSem);<br />
gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio,<br />
DECLARE_THREAD_FUNCTION((*fn),p), void *param);<br />
threadreturn_t gfxThreadWait(gfxThreadHandle thread);<br />
gfxThreadHandle gfxThreadMe(void)<br />
void gfxThreadClose(gfxThreadHandle thread);<br />
</syntaxhighlight><br />
<br />
=== Data types ===<br />
ToDo<br />
<br />
=== Examples ===<br />
When creating a new port, taking a look at existing ones can help a lot. The existing ports can be found under ''/src/gos/'''<br />
<br />
<br />
<br />
[[Category:Module]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Main_Page&diff=729
Main Page
2014-11-06T06:57:59Z
<p>Inmarket: Undo revision 726 by Tectu (talk)</p>
<hr />
<div><div class="div-header">Welcome to the µGFX wiki!</div><br />
<div class="div-block">This is the official documentation of the [http://ugfx.org µGFX] library. Please note that this is just the documentation, the official project website can be found at [http://ugfx.org ugfx.org]<br />
<br />
If you're new to µGFX, begin by reading [[Getting Started]].<br />
</div><br />
<div style="width: 50%; float: left;"><br />
<div class="div-header" style="margin-right: 5px;">General</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [http://ugfx.org/demos Demos]<br />
* [[Getting Started]]<br />
* [[Configuration]]<br />
* [[Architecture]]<br />
* [[Board File]]<br />
* [[API Reference]]<br />
</div><br />
<div class="div-header" style="margin-right: 5px;">Developer Guides</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [[Your First Compile - Windows]]<br />
* [[IDE|Using an IDE]]<br />
* [[Creating a custom rendering routine]]<br />
* [[Creating a widget]]<br />
</div><br />
<div class="div-header" style="margin-right: 5px;">µGFX Design Choices</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [[Display Driver Model]]<br />
</div><br />
</div><br />
<div style="width: 50%; float: right;"><br />
<div class="div-header" style="margin-left: 5px;">Modules</div><br />
<div class="div-block" style="margin-left: 5px;"><br />
* [[GWIN]]<br />
** [[Windows]]<br />
*** [[Console]]<br />
*** [[Graph]]<br />
** [[Widgets]]<br />
*** [[Label]]<br />
*** [[PushButton]]<br />
*** [[RadioButton]]<br />
*** [[CheckBox]]<br />
*** [[List]]<br />
*** [[Slider]]<br />
*** [[Progressbar]]<br />
*** [[Tabs]]<br />
*** [[ImageBox]]<br />
** [[Containers]]<br />
*** [[Container]]<br />
*** [[Frame]]<br />
* [[GAUDIO]]<br />
* [[GFILE]]<br />
* [[GOS]]<br />
* [[GDISP]]<br />
** [[Drawing]]<br />
** [[Font rendering]]<br />
** [[Images]]<br />
* [[GINPUT]]<br />
* [[GEVENT]]<br />
* [[GTIMER]]<br />
* [[GQUEUE]]<br />
</div><br />
</div><br />
<br />
__NOTOC__</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=693
Your First Compile - Windows
2014-10-01T06:31:06Z
<p>Inmarket: /* Set Up Your Folder Structure */</p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can later set up any of a number of development IDE's.<br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will also need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
If you already have cygwin, make sure you update it to the latest version as older versions had problems with the make utility.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in.<br />
<br />
The pathname for this must <b>NOT</b> contain spaces as gmake has BIG problems with paths with spaces in them (yuck!). This applies to any source files as well - gmake simply cannot handle spaces.<br />
<br />
Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Open a command prompt and set the path for the window to include the cygwin utilities.<br />
<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Using the command prompt with the correctly set path (as above), change directory to your new project folder (TestProject). Type "make" to build your first demo. To run it after building:<br />
<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can also use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You may want to use an IDE to do your development. Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use. Set your projects to be a "Custom Makefile" project</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul></li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=692
Your First Compile - Windows
2014-10-01T06:27:53Z
<p>Inmarket: /* Set Up Your Folder Structure */</p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can later set up any of a number of development IDE's.<br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will also need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
If you already have cygwin, make sure you update it to the latest version as older versions had problems with the make utility.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should definitely not contain spaces as gmake has BIG problems with paths with spaces in them (yuck!). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Open a command prompt and set the path for the window to include the cygwin utilities.<br />
<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Using the command prompt with the correctly set path (as above), change directory to your new project folder (TestProject). Type "make" to build your first demo. To run it after building:<br />
<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can also use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You may want to use an IDE to do your development. Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use. Set your projects to be a "Custom Makefile" project</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul></li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=691
Your First Compile - Windows
2014-09-30T03:26:02Z
<p>Inmarket: /* The First Build */</p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can later set up any of a number of development IDE's.<br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will also need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
If you already have cygwin, make sure you update it to the latest version as older versions had problems with the make utility.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Open a command prompt and set the path for the window to include the cygwin utilities.<br />
<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Using the command prompt with the correctly set path (as above), change directory to your new project folder (TestProject). Type "make" to build your first demo. To run it after building:<br />
<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can also use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You may want to use an IDE to do your development. Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use. Set your projects to be a "Custom Makefile" project</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul></li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=690
Your First Compile - Windows
2014-09-30T03:24:08Z
<p>Inmarket: /* Setting Your Environment */</p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can later set up any of a number of development IDE's.<br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will also need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
If you already have cygwin, make sure you update it to the latest version as older versions had problems with the make utility.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Open a command prompt and set the path for the window to include the cygwin utilities.<br />
<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Just type "make" to now build your first demo. To run it after building:<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can also use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You may want to use an IDE to do your development. Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use. Set your projects to be a "Custom Makefile" project</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul></li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=689
Your First Compile - Windows
2014-09-30T03:22:19Z
<p>Inmarket: /* The First Build */</p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can later set up any of a number of development IDE's.<br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will also need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
If you already have cygwin, make sure you update it to the latest version as older versions had problems with the make utility.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Using the command prompt, change directory to your new project folder (TestProject). We now need to set your path to include the cygwin utilities.<br />
<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Just type "make" to now build your first demo. To run it after building:<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can also use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You may want to use an IDE to do your development. Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use. Set your projects to be a "Custom Makefile" project</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul></li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=688
Your First Compile - Windows
2014-09-30T03:20:38Z
<p>Inmarket: /* Getting the bits */</p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can later set up any of a number of development IDE's.<br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will also need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
If you already have cygwin, make sure you update it to the latest version as older versions had problems with the make utility.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Using the command prompt, change directory to your new project folder (TestProject). We now need to set your path to include the cygwin utilities.<br />
<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Just type "make" to now make your first demo. To run it after building:<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can then use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You may want to use an IDE to do your development. Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use. Set your projects to be a "Custom Makefile" project</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul></li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=687
Your First Compile - Windows
2014-09-30T03:19:42Z
<p>Inmarket: /* Setting Your Environment */</p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can later set up any of a number of development IDE's.<br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will also need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
If you already have cygwin, make sure you update it to the latest version as older versions had problems with their make utility.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Using the command prompt, change directory to your new project folder (TestProject). We now need to set your path to include the cygwin utilities.<br />
<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Just type "make" to now make your first demo. To run it after building:<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can then use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You may want to use an IDE to do your development. Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use. Set your projects to be a "Custom Makefile" project</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul></li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=686
Your First Compile - Windows
2014-09-30T03:19:02Z
<p>Inmarket: /* Getting the bits */</p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can later set up any of a number of development IDE's.<br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will also need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
If you already have cygwin, make sure you update it to the latest version as older versions had problems with their make utility.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Using the command prompt, change directory to your new project folder (TestProject). We now need to set your path to include the cygwin utilities.<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Just type "make" to now make your first demo. To run it after building:<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can then use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You may want to use an IDE to do your development. Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use. Set your projects to be a "Custom Makefile" project</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul></li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=685
Your First Compile - Windows
2014-09-30T03:16:57Z
<p>Inmarket: </p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can later set up any of a number of development IDE's.<br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Using the command prompt, change directory to your new project folder (TestProject). We now need to set your path to include the cygwin utilities.<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Just type "make" to now make your first demo. To run it after building:<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can then use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You may want to use an IDE to do your development. Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use. Set your projects to be a "Custom Makefile" project</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul></li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=684
Your First Compile - Windows
2014-09-30T03:13:01Z
<p>Inmarket: </p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can set up any of a number of development IDE's.<br />
<br />
Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul><br />
<br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Using the command prompt, change directory to your new project folder (TestProject). We now need to set your path to include the cygwin utilities.<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Just type "make" to now make your first demo. To run it after building:<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can then use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Your_First_Compile_-_Windows&diff=683
Your First Compile - Windows
2014-09-30T03:11:30Z
<p>Inmarket: Created page with "This guide will help you set up your first compile under windows. We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can set up..."</p>
<hr />
<div>This guide will help you set up your first compile under windows.<br />
We will be compiling one of the uGFX demo's using the command-line. Once you have this working you can set up any of a number of development IDE's.<br />
<br />
Some IDE's worth looking at:<br />
<ul><li>Code::Blocks - very easy to set up and use</li><br />
<li>Eclipse - The standard for cross platform development. Can be tricky for normal windows developers</li><br />
<li>Microsoft Development Studio - The gold standard but pricey and untested with uGFX</li><br />
</ul><br />
<br />
== Getting the bits ==<br />
You will need to download uGFX. See [[Getting Started]] for how to get the uGFX source code.<br />
You will need to get cygwin [http://www.cygwin.com/]. You can either get the 32 bit or 64 bit installer.<br />
<br />
== Installing Cygwin ==<br />
Run the installer and accept the default options until you get to the package selection. In the package selection expand the "Devel" branch and add the following packages:<br />
<ul><li>make</li><br />
<li>mingw-binutils</li><br />
<li>mingw-gcc-core</li><br />
<li>mingw-w32api</li><br />
</ul><br />
<br />
== Set Up Your Folder Structure ==<br />
Select a directory to build your uGFX projects in. The pathname for this should probably not contain spaces (we simply haven't tested that). Create the following folders:<br />
<ul><li>uGFX</li><br />
<li>TestProject</li><br />
</ul><br />
<br />
Into the uGFX directory copy the uGFX source. The uGFX folder will then contain a gfxconf.example.h file (as well as lots of other stuff). This folder will be used as the master source location for all your uGFX projects and is generally treated as a read-only store.<br />
<br />
In the TestProjects directory copy the Makefile from the uGFX/boards/base/Win32/example directory. This will be your project directory and will eventually contain all your project source files. For now we are going to just build one of the predefined demos so the only thing needed is the makefile itself.<br />
<br />
== Setting Your Environment ==<br />
Using the command prompt, change directory to your new project folder (TestProject). We now need to set your path to include the cygwin utilities.<br />
<code><br />
PATH=C:\cygwin\bin;%PATH%<br />
</code><br />
<br />
or<br />
<br />
<code><br />
PATH=C:\cygwin64\bin;%PATH%<br />
</code><br />
<br />
for a 64 bit version of cygwin.<br />
<br />
== The First Build ==<br />
Just type "make" to now make your first demo. To run it after building:<br />
<code><br />
.build/TestProject.exe<br />
</code><br />
<br />
You can then use "make clean" to clean up all the object files etc that were created.<br />
<br />
== What's next ==<br />
<br />
<ol><li>Try change the GFXDEMO setting in the makefile to make a different demo. The demo's can be found in the uGFX/demos directory.</li><br />
<li>Copy one of the demo's source to your project folder. Comment out the GFXDEMO line in the Makefile and add main.c to the SRC line. Making this will now make the demo from the source in your project directory. Play with your local main.c to experiment with uGFX. Note the gfxconf.h file. This file contains the configuration options for any program you create.</li><br />
<li>You are now in a position to start playing with cross-compiling for other platforms. See some of the examples under the uGFX/boards/base directory.</li><br />
</ol></div>
Inmarket
https://wiki.ugfx.io/index.php?title=Main_Page&diff=682
Main Page
2014-09-30T02:34:23Z
<p>Inmarket: </p>
<hr />
<div><div class="div-header">Welcome to the µGFX wiki!</div><br />
<div class="div-block">This is the official documentation of the [http://ugfx.org µGFX] library. Please note that this is just the documentation, the official project website can be found at [http://ugfx.org ugfx.org]<br />
<br />
If you're new to µGFX, begin by reading [[Getting Started]].<br />
</div><br />
<div style="width: 50%; float: left;"><br />
<div class="div-header" style="margin-right: 5px;">General</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [http://ugfx.org/demos Demos]<br />
* [[Getting Started]]<br />
* [[Your First Compile - Windows]]<br />
* [[Configuration]]<br />
* [[Architecture]]<br />
* [[Board File]]<br />
* [[API Reference]]<br />
</div><br />
<div class="div-header" style="margin-right: 5px;">Developer Guides</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [[IDE|Using an IDE]]<br />
* [[Creating a custom rendering routine]]<br />
* [[Creating a widget]]<br />
</div><br />
<div class="div-header" style="margin-right: 5px;">µGFX Design Choices</div><br />
<div class="div-block" style="margin-right: 5px;"><br />
* [[Display Driver Model]]<br />
</div><br />
</div><br />
<div style="width: 50%; float: right;"><br />
<div class="div-header" style="margin-left: 5px;">Modules</div><br />
<div class="div-block" style="margin-left: 5px;"><br />
* [[GWIN]]<br />
** [[Windows]]<br />
*** [[Console]]<br />
*** [[Graph]]<br />
** [[Widgets]]<br />
*** [[Label]]<br />
*** [[PushButton]]<br />
*** [[RadioButton]]<br />
*** [[CheckBox]]<br />
*** [[List]]<br />
*** [[Slider]]<br />
*** [[Progressbar]]<br />
*** [[Tabs]]<br />
*** [[ImageBox]]<br />
** [[Containers]]<br />
*** [[Container]]<br />
*** [[Frame]]<br />
* [[GAUDIO]]<br />
* [[GFILE]]<br />
* [[GOS]]<br />
* [[GDISP]]<br />
** [[Drawing]]<br />
** [[Font rendering]]<br />
** [[Images]]<br />
* [[GINPUT]]<br />
* [[GEVENT]]<br />
* [[GTIMER]]<br />
* [[GQUEUE]]<br />
</div><br />
</div><br />
<br />
__NOTOC__</div>
Inmarket
https://wiki.ugfx.io/index.php?title=API_Reference&diff=673
API Reference
2014-08-16T14:48:12Z
<p>Inmarket: /* What is doxygen? */</p>
<hr />
<div>The µGFX library is fully in-source code documented using [http://doxygen.org doxygen].<br />
<br />
== What is doxygen? ==<br />
From [http://en.wikipedia.org/wiki/Doxygen Wikipedia], the free encyclopedia:<br />
<pre><br />
Doxygen is a documentation generator, a tool for writing software reference documentation.<br />
The documentation is written within code, and is thus relatively easy to keep up to date.<br />
Doxygen can cross reference documentation and code, so that the reader of a document can<br />
easily refer to the actual code.<br />
</pre><br />
<br />
== Where can I find the doxygen documentation? ==<br />
You can explore the doxygen of the latest release as well as of the latest repository state on this page. While we update the release documentation at any new release, the documentation of the current master is refreshed on a weekly base.<br />
<br />
* [http://api.ugfx.org/release stable release]<br />
* [http://api.ugfx.org/master weekly build]<br />
<br />
<br />
<br />
[[Category:General]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Board_File&diff=672
Board File
2014-08-16T14:44:06Z
<p>Inmarket: </p>
<hr />
<div>Certain [[Architecture#Module|modules]] have to communicate to hardware in order to fulfil their tasks. Those modules come with an additional driver layer. Each driver then needs a board file to talk to the actual hardware.<br/><br />
The board file needs to be provided by the user as it's implementation depends not only on the used underlying system (HAL), but also the actual hardware configuration (wiring).<br />
<br />
== Templates ==<br />
Each driver provides a template of it's board file. Copying this file to your project directory and implementing the routines is all there is to do.<br />
<br />
== Supported Boards ==<br />
Some boards have predefined hardware on them. Where they are a common board we provide a makefile (''/boards/base/xxx/board.mk'') which you can include into your own project makefile. This will then automatically include all the standard hardware drivers and board files.<br />
Additional pre-defined board files can also be found in ''/boards/addons''.<br />
<br />
== Modules ==<br />
The following modules require a board file:<br />
* [[GDISP]]<br />
* [[GINPUT]]<br />
* [[GAUDIO]]<br />
<br />
<br />
[[Category:General]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Configuration&diff=671
Configuration
2014-08-16T14:38:14Z
<p>Inmarket: </p>
<hr />
<div>All project specific options for µGFX are defined in the file '''gfxconf.h''' which must be supplied by the user (place it in your project directory). Within each section, the very first option enables or disables the entire module. All the following sub-options only take effect when the module is enabled.<br />
<br />
== Template ==<br />
A template of the '''gfxconf.h''' file can be found in the top-level directory of the µGFX folder. It is called '''gfxconf.example.h'''. You can copy this file to your project directory and rename it to '''gfxconf.h'''.<br />
<br />
In your '''gfxconf.h''' you should leave commented out any options you are leaving them as the default value.<br />
This improves the future compatibility of your project as we make changes to the µGFX <br />
default configuration.<br />
<br />
As the '''gfxconf.example.h''' is kept up to date as we change the source code, it may have more up to date definitions than this document.<br />
<br />
== GOS ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_OS_RAW32<br />
|Use the bare metal port without any underlying OS.<br/>See [[BareMetal]].<br />
|-<br />
|GOS_RAW_HEAP_SIZE<br />
|Set the maximum size of the heap. If set to 0, the C runtime library <code>malloc()</code> and <code>free()</code> are used.<br/>See [[BareMetal#Heap|Heap]].<br />
|-<br />
|INTERRUPTS_ON()<br />
|Optionally set code that is executed when interrupts are turned on.<br/>See [[BareMetal#Interrupts|Interrupts]].<br />
|-<br />
|INTERRUPTS_OFF()<br />
|Optionally set code that is executed when interrupts are turned off.<br/>See [[BareMetal#Interrupts|Interrupts]].<br />
|-<br />
|GFX_USE_OS_CHIBIOS<br />
|Use ChibiOS/RT as the underlying system.<br/>See [[ChibiOS/RT]].<br />
|-<br />
|GFX_USE_OS_FREERTOS<br />
|Use FreeRTOS as the underlying system.<br/>See [[FreeRTOS]].<br />
|-<br />
|GFX_FREERTOS_USE_TRACE<br />
|Enable support for the [http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_Trace/FreeRTOS_Plus_Trace.shtml FreeRTOS+Trace feature].<br/>See [[FreeRTOS#Trace|Trace]].<br />
|-<br />
|GFX_USE_OS_ECOS<br />
|Use eCOS as the underlying system.<br/>See [[eCOS]].<br />
|-<br />
|GFX_USE_OS_WIN32<br />
|Use Windows as the underlying system.<br/>See [[Windows]].<br />
|-<br />
|GFX_USE_OS_LINUX<br />
|Use Linux as the underlying system.<br/>See [[Linux]].<br />
|-<br />
|GFX_USE_OS_OSX<br />
|Use Mac OS X as the underlying system.<br/>See [[Mac_OS_X]].<br />
|-<br />
|GFX_NO_OS_INIT<br />
|Do not initialize the underlying operating system when calling <code>gfxInit()</code>.<br/> See [[GOS#Initialization|Initialization]].<br />
|}<br />
<br />
== GDISP ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GDISP<br />
|Enable or disable the entire GDISP module.<br/>See [[GDISP]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GDISP_NEED_AUTOFLUSH<br />
|Flush drawing operations automatically.<br/>See [[GDISP#Flushing | Flushing]].<br />
|-<br />
|GDISP_NEED_TIMERFLUSH<br />
|Flush drawing operations automatically using a timer.<br/>See [[GDISP#Flushing | Flushing]].<br />
|-<br />
|GDISP_NEED_VALIDATION<br />
|Clip all drawing operations to the screen limits and validate color values.<br/>See [[GDISP#Validation | Validation]].<br />
|-<br />
|GDISP_NEED_CLIP<br />
|Add area clipping feature.<br/>See [[GDISP#Clipping|Clipping]].<br />
|-<br />
|GDISP_NEED_CIRCLE<br />
|Include circle drawing functions.<br/>See [[GDISP#Circle|Circle]].<br />
|-<br />
|GDISP_NEED_ELLIPSE<br />
|Include ellipse drawing functions.<br/>See [[GDISP#Ellipse|Ellipse]].<br />
|-<br />
|GDISP_NEED_ARC<br />
|Include arc drawing functions.<br/>See [[GDISP#Arc|Arc]].<br />
|-<br />
|GDISP_NEED_CONVEX_POLYGON<br />
|Include convex polygon and thick line drawing functions.<br/>See [[GDISP#Polygon|Polygon]].<br />
|-<br />
|GDISP_NEED_SCROLL<br />
|Include scrolling functions.<br/>See [[GDISP#Scrolling|Scrolling]].<br />
|-<br />
|GDISP_NEED_PIXELREAD<br />
|Can pixels be read back from the display/memory?<br/>See [[GDISP#Read_Back|Read Back]].<br />
|-<br />
|GDISP_NEED_CONTROL<br />
|Can hardware aspects like the orientation, backlight and contrast be controlled?<br/>See [[GDISP#Control|Control]].<br />
|-<br />
|GDISP_NEED_QUERY<br />
|Can hardware aspects like backlight and contrast be read back?<br/>See [[GDISP#Query|Query]].<br />
|-style="height:25px"<br />
|-<br />
|GDISP_NEED_MULTITHREAD<br />
|Make all GDISP calls thread safe.<br/>See [[GDISP#Thread_safe|Thread safe]].<br />
|-<br />
|GDISP_NEED_IMAGE<br />
|Include the image decoder feature.<br/>See [[Images]].<br />
|-<br />
|GDISP_NEED_ACCOUNTING<br />
|Include accounting feature which registers the memory usage of each image.<br/>See [[Images#Accounting|Accounting]].<br />
|-<br />
|GDISP_NEED_IMAGE_NATIVE<br />
|Include the decoder for the native image format.<br/>See [[Images#Native|Native]].<br />
|-<br />
|GDISP_NEED_IMAGE_GIF<br />
|Include the decoder for the GIF image format.<br/>See [[Images#GIF|GIF]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP<br />
|Include the decoder for the BMP image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_1<br />
|Include the decoder for the BMP_1 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_4<br />
|Include the decoder for the BMP_4 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_4_RLE<br />
|Include the decoder for the BMP_4_RLE image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_8<br />
|Include the decoder for the BMP_8 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_8_RL<br />
|Include the decoder for the BMP_8_RLE image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_16<br />
|Include the decoder for the BMP_16 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_24<br />
|Include the decoder for the BMP_24 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_32<br />
|Include the decoder for the BMP_32 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_JPG<br />
|Not implemented yet.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GDISP_NEED_IMAGE_PNG<br />
|Not implemented yet.<br/>See [[ToDo|ToDo]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GDISP_NEED_TEXT<br />
|Include the font rendering feature.<br/>See [[GDISP#Font_rendering|Font rendering]].<br />
|-<br />
|GDISP_NEED_ANTIALIAS<br />
|Enable anti-aliasing for fonts.<br/>See [[GDISP#Anti_alias|Anti-Alias]].<br />
|-<br />
|GDISP_NEED_KERNING<br />
|Enable kerning for fonts.<br/>See [[GDISP#Kerning|Kerning]].<br />
|-<br />
|GDISP_NEED_UTF8<br />
|Enable unicode support for fonts.<br/>See [[GDISP#Unicode|Unicode]].<br />
|-<br />
|GDISP_INCLUDE_FONT_UI1<br />
|Include the UI1 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_UI2<br />
|Include the UI2 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_LARGENUMBERS<br />
|Include the largenumbers font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS10<br />
|Include the DejaVu Sans 10 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS12<br />
|Include the DejaVu Sans 12 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS16<br />
|Include the DejaVu Sans 16 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS24<br />
|Include the DejaVu Sans 24 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS32<br />
|Include the DejaVu Sans 32 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12<br />
|Include the DejaVu Sans Bold 12 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_FIXED_10X20<br />
|Include the Fixed 10x20 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_FIXED_7X14<br />
|Include the Fixed 7x14 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_FIXED_5X8<br />
|Include the Fixed 5x8 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS12_AA<br />
|Include the DejaVu Sans 12 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS16_AA<br />
|Include the DejaVu Sans 16 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS24_AA<br />
|Include the DejaVu Sans 24 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS32_AA<br />
|Include the DejaVu Sans 32 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA<br />
|Include the DejaVu Sans Bold 12 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_USER_FONTS<br />
|Include fonts specified by the user.<br/>See [[GDISP#Custon_fonts|Custom Fonts]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GDISP_NEED_STARTUP_LOGO<br />
|Display the uGFX Logo when initializing the GDISP module for one second.<br/>See [[GDISP#Startup_Logo|Start-Up Logo]].<br />
|-<br />
|GDISP_DEFAULT_ORIENTATION<br />
|The default orientation of the used display pnale.<br/>See [[GDISP#Orientation|Orientation]].<br />
|-<br />
|GDISP_LINEBUF_SIZE<br />
|The size of the pixel buffer (in pixels) used for optimizations.<br/>See [[GDISP#Optimizations|Optimizations]].<br />
|-<br />
|GDISP_TOTAL_DISPLAYS<br />
|The total amount of displays used.<br/>See [[GDISP#Multiple_displays|Multiple displays]].<br />
|-<br />
|GDISP_TOTAL_CONTROLLERS<br />
|The total amount of display controllers used.<br/>See [[GDISP#Multiple_displays|Multiple displays]].<br />
|-<br />
|GDISP_USE_GFXNET<br />
|Include support for remote displays.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|-<br />
|GDISP_GFXNET_PORT<br />
|The port to be used for remote displays.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|-<br />
|GDISP_GFXNET_CUSTOM_LWIP_STARTUP<br />
|Is a custom [http://savannah.nongnu.org/projects/lwip/ LwIP] routine defined?.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|-<br />
|GDISP_DONT_WAIT_FOR_NET_DISPLAY<br />
|Don't wait until the remote display has been initialized properly.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|-<br />
|GDISP_GFXNET_UNSAFE_SOCKET<br />
|Use unsafe sockets.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|}<br />
<br />
== GWIN ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GWIN<br />
|Enable or disable the entire GWIN module.<br/>See [[GWIN]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GWIN_NEED_WINDOWMANAGER<br />
|Enable or disable the window manager.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GWIN_REDRAW_IMMEDIATE<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GWIN_REDRAW_SINGLEOP<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GWIN_NEED_CONSOLE<br />
|Include the console window features.<br/>See [[Console|Console]].<br />
|-<br />
|GWIN_CONSOLE_USE_HISTORY<br />
|Enable or disable the console history.<br/>See [[Console#History|History]].<br />
|-<br />
|GWIN_CONSOLE_HISTORY_AVERAGING<br />
|Create an average history buffer.<br/>See [[Console#History|History]].<br />
|-<br />
|GWIN_CONSOLE_HISTORY_ATCREATE<br />
|Create a history buffer at window creation time.<br/>See [[Console#History|History]].<br />
|-<br />
|GWIN_CONSOLE_ESQSEQ<br />
|Include escape sequence features.<br/>See [[Console#Escape_sequences|Escape sequences]].<br />
|-<br />
|GWIN_CONSOLE_USE_BASESTREAM<br />
|Include support for ChibiOS/RT base streams.<br/>See [[Console#ToDo|ToDo]].<br />
|-<br />
|GWIN_CONSOLE_USE_FLOAT<br />
|Include support for floating point numbers.<br/>See [[Console#Float|Float]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GWIN_NEED_GRAPH<br />
|Include the graph window features.<br/>See [[Graph|Graph]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GWIN_NEED_WIDGET<br />
|Enable or disable the widget system.<br/>See [[Widgets|Widgets]].<br />
|-<br />
|GWIN_FLAT_STYLING<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GWIN_NEED_LABEL<br />
|Enable or disable the label widget.<br/>See [[Label|Label]].<br />
|-<br />
|GWIN_NEED_LABEL_ATTRIBUTE<br />
|Include the label attribute feature.<br/>See [[Label#Attribute|Attribute]].<br />
|-<br />
|GWIN_NEED_BUTTON<br />
|Enable or disable the push button widget.<br/>See [[PushButton|PushButton]].<br />
|-<br />
|GWIN_NEED_BUTTON_LAZY_RELEASE<br />
|Enabel or disable the lazy release feature.<br/>See [[PushButton#Cancel_feature|Cancel feature]].<br />
|-<br />
|GWIN_NEED_SLIDER<br />
|Enable or disable the slider widget.<br/>See [[Slider|Slider]].<br />
|-<br />
|GWIN_NEED_CHECKBOX<br />
|Enable or disable the check box widget.<br/>See [[CheckBox|CheckBox]].<br />
|-<br />
|GWIN_NEED_IMAGE<br />
|Enable or disable the image box widget.<br/>See [[ImageBox|ImageBox]].<br />
|-<br />
|GWIN_NEED_IMAGE_ANIMATION<br />
|Include the image box animated images feature.<br/>See [[ImageBox#Animated_Images|Animated Images]].<br />
|-<br />
|GWIN_NEED_RADIO<br />
|Enable or disable the radio button widget.<br/>See [[RadioButton|RadioButton]].<br />
|-<br />
|GWIN_NEED_LIST<br />
|Enable or disable the list widget.<br/>See [[List|List]].<br />
|-<br />
|GWIN_NEED_LIST_IMAGES<br />
|Include the list widget images feature.<br/>See [[List#Images|Images]].<br />
|-<br />
|GWIN_NEED_PROGRESSBAR<br />
|Enable or disable the progress bar widget.<br/>See [[Progressbar|Progressbar]].<br />
|-<br />
|GWIN_NEED_PROGRESSBAR_AUTO<br />
|Include the automatic progress bar feature.<br/>See [[Progressbar#Automatic|Automatic]].<br />
|-<br />
|GWIN_NEED_CONTAINERS<br />
|Enable or disable the containers system.<br/>See [[Containers|Containers]].<br />
|-<br />
|GWIN_NEED_CONTAINER<br />
|Enable or disable the basic container.<br/>See [[Container|Container]].<br />
|-<br />
|GWIN_NEED_FRAME<br />
|Enable or disable the frame container.<br/>See [[Frame|Frame]].<br />
|}<br />
<br />
== GEVENT ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GTIMER<br />
|Enable or disable the entire GTIMER module.<br/>See [[GTIMER]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GTIMER_THREAD_PRIORITY<br />
|The GTIMER thread priority level.<br/See [[GTIMER#Priority|Priority]].<br />
|-<br />
|GTIMER_THREAD_WORKING_SIZE<br />
|The GTIMER thread stack size.<br/>See [[GTIMER#Stack_Size|Stack size]].<br />
|}<br />
<br />
== GQUEUE ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GQUEUE<br />
|Enable or disable the entire GQUEUE module.<br/>See [[GQUEUE]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GQUEUE_NEED_ASYNC<br />
|Enable or disable the asynchronous queue functions.<br/>See [[GQUEUE#Asynchronous|Asynchronous]].<br />
|-<br />
|GQUEUE_NEED_GSYNC<br />
|Enable or disable the ''GET'' synchronous queue functions.<br/>See [[GQUEUE#Asynchronous|Asynchronous]].<br />
|-<br />
|GQUEUE_NEED_FSYNC<br />
|Enable or disable the fully synchronous queue functions.<br/>See [[GQUEUE#Asynchronous|Asynchronous]].<br />
|-<br />
|GQUEUE_NEED_BUFFERS<br />
|Enable or disable the buffers functions.<br/>See [[GQUEUE#Buffers|Buffers]].<br />
|}<br />
<br />
== GINPUT ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GINPUT<br />
|Enable or disable the entire GINPUT module.<br/>See [[GINPUT]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GINPUT_NEED_MOUSE<br />
|Enable or disable support for a pointing device such as a touchscreen.<br/>See [[GINPUT#Touchscreen|Touchscreen]].<br />
|-<br />
|GINPUT_NEED_KEYBOARD<br />
|Not implemented yet.<br />
|-<br />
|GINPUT_NEED_TOGGLE<br />
|Enable or disable support for digital inputs.<br/>See [[#Digital_input|digital inputs]].<br />
|-<br />
|GINPUT_NEED_DIAL<br />
|Enable or disable support for analog inputs.<br/>See [[#Analog_input|analog inputs]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GINPUT_MOUSE_CALIBRATE_EXTREMES<br />
|If this is set to ''TRUE'', the calibration points are displayed at the very corner of the display. This gives an overall more accurate result but they are less intuitive.<br/>See [[GINPUT#Calibration|calibration]].<br />
|-<br />
|GINPUT_MOUSE_MAX_CALIBRATION_ERROR<br />
|This macro is part of the config file of the driver in your board directory and takes a pixel value. It defines how big the pixel offset of the test point can be before the calibration process is repeated automatically.<br/>See [[GINPUT#Calibration|calibration]].<br />
|}<br />
<br />
== GFILE ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GFILE<br />
|Enable or disable the entire GFILE module.<br/>See [[GFILE]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GFILE_NEED_PRINTG<br />
|Enable or disable print functions support.<br/>See [[GFILE#GFILE#String_manipulation_.26_printing | String manipulation & printing]].<br />
|-<br />
|GFILE_NEED_SCANG<br />
|Enable or disable scan functions support.<br/>See [[GFILE#GFILE#String_manipulation_.26_printing | String manipulation & printing]].<br />
|-<br />
|GFILE_NEED_STRINGS<br />
|Enable or disable string manipulation functions support.<br/>See [[GFILE#GFILE#String_manipulation_.26_printing | String manipulation & printing]].<br />
|-<br />
|GFILE_NEED_STDIO<br />
|Enable or disable STDIO emulation.<br/>See [[GFILE#STDIO_emulation | STDIO emulation]].<br />
|-<br />
|GFILE_ALLOW_FLOATS<br />
|Enable or disable float support.<br/>See [[GFILE#STDIO_emulation | STDIO emulation]].<br />
|-<br />
| GFILE_ALLOW_DEVICESPECIFIC<br />
|Allows opening files with a 'x|' prefix in order to ensure the file is opened with the specified file system.<br/>See [[GFILE#Multiple_file_systems|Multiple file systems]].<br />
|-<br />
| GFILE_MAX_GFILES<br />
|Specify the maximum number of files that can be opened at a time.<br/>See [[GFILE#ToDo|ToDo]].<br />
|-<br />
|GFILE_NEED_NOAUTOMOUNT<br />
|Enable or disable automatic file system mounting feature.<br/>See [[FATFS#Mounting|Mounting]].<br />
|-<br />
|GFILE_NEED_NOAUTOSYNC<br />
|Enable or disable automatic file system synchronization feature.<br/>See [[FATFS#Syncronization|Syncronization]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GFILE_NEED_FATFS<br />
|Enable or disable FatFS support.<br/>See [[FATFS]].<br />
|-<br />
|GFILE_NEED_ROMFS<br />
|Enable or disable ROMFS support.<br/>See [[ROMFS]].<br />
|-<br />
|GFILE_NEED_RAMFS<br />
|Enable or disable RAMFS support.<br/>See [[RAMFS]].<br />
|-<br />
|GFILE_NEED_MEMFS<br />
|Enable or disable MEMFS support.<br/>See [[MEMFS]].<br />
|-<br />
|GFILE_NEED_NATIVEFS<br />
|Enable or disable NATIVEFS support.<br/>See [[NATIVEFS]].<br />
|-<br />
|GFILE_NEED_CHIBIOSFS<br />
|Enable or disable CHIBIOSFS support.<br/>See [[CHIBIOSFS]].<br />
|}<br />
<br />
== GAUDIO ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GAUDIO<br />
|Enable or disable the entire GAUDIO module.<br/>See [[GAUDIO]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GAUDIO_NEED_PLAY<br />
|Enable or disable the play-back system (audio output).<br/>See [[GAUDIO#PlayBack|PlayBack]].<br />
|-<br />
|GAUDIO_NEED_RECORD<br />
|Enable or disable the record system (audio input).<br/>See [[GAUDIO#Record|Record]].<br />
|}<br />
<br />
== GADC ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GADC<br />
|Enable or disable the entire GADC module.<br/>See [[GADC]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GADC_MAX_LOWSPEED_DEVICES<br />
|Specify the maximum amount of low speed GADC devices.<br/>See [[GADC]].<br />
|}<br />
<br />
== GMISC ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GMISC<br />
|Enable or disable the entire GMISC module.<br/>See [[GMISC]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GMISC_NEED_ARRAOPS<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_NEED_FASTTRIG<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_NEED_FIXEDTRIG<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_NEED_INVSQRT<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_INVSQRT_MIXED_ENDIAN<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_INVSQRT_REAL_SLOW<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|}<br />
<br />
<br />
<br />
[[Category:General]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Configuration&diff=670
Configuration
2014-08-16T14:34:34Z
<p>Inmarket: /* Template */</p>
<hr />
<div>All project specific options for µGFX are defined in the file '''gfxconf.h''' which must be supplied by the user (place it in your project directory). Within each section, the very first option enables or disables the entire module. All the following options do only take effect when the module is enable.<br />
<br />
== Template ==<br />
A template of the '''gfxconf.h''' file can be found in the top-level directory of the µGFX folder. It is called '''gfxconf.example.h'''. You can copy this file to your project directory and rename it to '''gfxconf.h'''.<br />
<br />
In your '''gfxconf.h''' you should leave commented out any options you are leaving them as the default value.<br />
This improves the future compatibility of your project as we make changes to the µGFX <br />
default configuration.<br />
<br />
== GOS ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_OS_RAW32<br />
|Use the bare metal port without any underlying OS.<br/>See [[BareMetal]].<br />
|-<br />
|GOS_RAW_HEAP_SIZE<br />
|Set the maximum size of the heap. If set to 0, the C runtime library <code>malloc()</code> and <code>free()</code> are used.<br/>See [[BareMetal#Heap|Heap]].<br />
|-<br />
|INTERRUPTS_ON()<br />
|Optionally set code that is executed when interrupts are turned on.<br/>See [[BareMetal#Interrupts|Interrupts]].<br />
|-<br />
|INTERRUPTS_OFF()<br />
|Optionally set code that is executed when interrupts are turned off.<br/>See [[BareMetal#Interrupts|Interrupts]].<br />
|-<br />
|GFX_USE_OS_CHIBIOS<br />
|Use ChibiOS/RT as the underlying system.<br/>See [[ChibiOS/RT]].<br />
|-<br />
|GFX_USE_OS_FREERTOS<br />
|Use FreeRTOS as the underlying system.<br/>See [[FreeRTOS]].<br />
|-<br />
|GFX_FREERTOS_USE_TRACE<br />
|Enable support for the [http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_Trace/FreeRTOS_Plus_Trace.shtml FreeRTOS+Trace feature].<br/>See [[FreeRTOS#Trace|Trace]].<br />
|-<br />
|GFX_USE_OS_ECOS<br />
|Use eCOS as the underlying system.<br/>See [[eCOS]].<br />
|-<br />
|GFX_USE_OS_WIN32<br />
|Use Windows as the underlying system.<br/>See [[Windows]].<br />
|-<br />
|GFX_USE_OS_LINUX<br />
|Use Linux as the underlying system.<br/>See [[Linux]].<br />
|-<br />
|GFX_USE_OS_OSX<br />
|Use Mac OS X as the underlying system.<br/>See [[Mac_OS_X]].<br />
|-<br />
|GFX_NO_OS_INIT<br />
|Do not initialize the underlying operating system when calling <code>gfxInit()</code>.<br/> See [[GOS#Initialization|Initialization]].<br />
|}<br />
<br />
== GDISP ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GDISP<br />
|Enable or disable the entire GDISP module.<br/>See [[GDISP]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GDISP_NEED_AUTOFLUSH<br />
|Flush drawing operations automatically.<br/>See [[GDISP#Flushing | Flushing]].<br />
|-<br />
|GDISP_NEED_TIMERFLUSH<br />
|Flush drawing operations automatically using a timer.<br/>See [[GDISP#Flushing | Flushing]].<br />
|-<br />
|GDISP_NEED_VALIDATION<br />
|Clip all drawing operations to the screen limits and validate color values.<br/>See [[GDISP#Validation | Validation]].<br />
|-<br />
|GDISP_NEED_CLIP<br />
|Add area clipping feature.<br/>See [[GDISP#Clipping|Clipping]].<br />
|-<br />
|GDISP_NEED_CIRCLE<br />
|Include circle drawing functions.<br/>See [[GDISP#Circle|Circle]].<br />
|-<br />
|GDISP_NEED_ELLIPSE<br />
|Include ellipse drawing functions.<br/>See [[GDISP#Ellipse|Ellipse]].<br />
|-<br />
|GDISP_NEED_ARC<br />
|Include arc drawing functions.<br/>See [[GDISP#Arc|Arc]].<br />
|-<br />
|GDISP_NEED_CONVEX_POLYGON<br />
|Include convex polygon and thick line drawing functions.<br/>See [[GDISP#Polygon|Polygon]].<br />
|-<br />
|GDISP_NEED_SCROLL<br />
|Include scrolling functions.<br/>See [[GDISP#Scrolling|Scrolling]].<br />
|-<br />
|GDISP_NEED_PIXELREAD<br />
|Can pixels be read back from the display/memory?<br/>See [[GDISP#Read_Back|Read Back]].<br />
|-<br />
|GDISP_NEED_CONTROL<br />
|Can hardware aspects like the orientation, backlight and contrast be controlled?<br/>See [[GDISP#Control|Control]].<br />
|-<br />
|GDISP_NEED_QUERY<br />
|Can hardware aspects like backlight and contrast be read back?<br/>See [[GDISP#Query|Query]].<br />
|-style="height:25px"<br />
|-<br />
|GDISP_NEED_MULTITHREAD<br />
|Make all GDISP calls thread safe.<br/>See [[GDISP#Thread_safe|Thread safe]].<br />
|-<br />
|GDISP_NEED_IMAGE<br />
|Include the image decoder feature.<br/>See [[Images]].<br />
|-<br />
|GDISP_NEED_ACCOUNTING<br />
|Include accounting feature which registers the memory usage of each image.<br/>See [[Images#Accounting|Accounting]].<br />
|-<br />
|GDISP_NEED_IMAGE_NATIVE<br />
|Include the decoder for the native image format.<br/>See [[Images#Native|Native]].<br />
|-<br />
|GDISP_NEED_IMAGE_GIF<br />
|Include the decoder for the GIF image format.<br/>See [[Images#GIF|GIF]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP<br />
|Include the decoder for the BMP image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_1<br />
|Include the decoder for the BMP_1 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_4<br />
|Include the decoder for the BMP_4 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_4_RLE<br />
|Include the decoder for the BMP_4_RLE image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_8<br />
|Include the decoder for the BMP_8 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_8_RL<br />
|Include the decoder for the BMP_8_RLE image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_16<br />
|Include the decoder for the BMP_16 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_24<br />
|Include the decoder for the BMP_24 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_BMP_32<br />
|Include the decoder for the BMP_32 image format.<br/>See [[Images#BMP|BMP]].<br />
|-<br />
|GDISP_NEED_IMAGE_JPG<br />
|Not implemented yet.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GDISP_NEED_IMAGE_PNG<br />
|Not implemented yet.<br/>See [[ToDo|ToDo]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GDISP_NEED_TEXT<br />
|Include the font rendering feature.<br/>See [[GDISP#Font_rendering|Font rendering]].<br />
|-<br />
|GDISP_NEED_ANTIALIAS<br />
|Enable anti-aliasing for fonts.<br/>See [[GDISP#Anti_alias|Anti-Alias]].<br />
|-<br />
|GDISP_NEED_KERNING<br />
|Enable kerning for fonts.<br/>See [[GDISP#Kerning|Kerning]].<br />
|-<br />
|GDISP_NEED_UTF8<br />
|Enable unicode support for fonts.<br/>See [[GDISP#Unicode|Unicode]].<br />
|-<br />
|GDISP_INCLUDE_FONT_UI1<br />
|Include the UI1 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_UI2<br />
|Include the UI2 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_LARGENUMBERS<br />
|Include the largenumbers font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS10<br />
|Include the DejaVu Sans 10 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS12<br />
|Include the DejaVu Sans 12 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS16<br />
|Include the DejaVu Sans 16 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS24<br />
|Include the DejaVu Sans 24 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS32<br />
|Include the DejaVu Sans 32 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12<br />
|Include the DejaVu Sans Bold 12 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_FIXED_10X20<br />
|Include the Fixed 10x20 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_FIXED_7X14<br />
|Include the Fixed 7x14 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_FIXED_5X8<br />
|Include the Fixed 5x8 font.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS12_AA<br />
|Include the DejaVu Sans 12 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS16_AA<br />
|Include the DejaVu Sans 16 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS24_AA<br />
|Include the DejaVu Sans 24 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANS32_AA<br />
|Include the DejaVu Sans 32 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA<br />
|Include the DejaVu Sans Bold 12 font with anti-aliasing.<br/>See [[GDISP#Fonts|Fonts]].<br />
|-<br />
|GDISP_INCLUDE_USER_FONTS<br />
|Include fonts specified by the user.<br/>See [[GDISP#Custon_fonts|Custom Fonts]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GDISP_NEED_STARTUP_LOGO<br />
|Display the uGFX Logo when initializing the GDISP module for one second.<br/>See [[GDISP#Startup_Logo|Start-Up Logo]].<br />
|-<br />
|GDISP_DEFAULT_ORIENTATION<br />
|The default orientation of the used display pnale.<br/>See [[GDISP#Orientation|Orientation]].<br />
|-<br />
|GDISP_LINEBUF_SIZE<br />
|The size of the pixel buffer (in pixels) used for optimizations.<br/>See [[GDISP#Optimizations|Optimizations]].<br />
|-<br />
|GDISP_TOTAL_DISPLAYS<br />
|The total amount of displays used.<br/>See [[GDISP#Multiple_displays|Multiple displays]].<br />
|-<br />
|GDISP_TOTAL_CONTROLLERS<br />
|The total amount of display controllers used.<br/>See [[GDISP#Multiple_displays|Multiple displays]].<br />
|-<br />
|GDISP_USE_GFXNET<br />
|Include support for remote displays.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|-<br />
|GDISP_GFXNET_PORT<br />
|The port to be used for remote displays.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|-<br />
|GDISP_GFXNET_CUSTOM_LWIP_STARTUP<br />
|Is a custom [http://savannah.nongnu.org/projects/lwip/ LwIP] routine defined?.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|-<br />
|GDISP_DONT_WAIT_FOR_NET_DISPLAY<br />
|Don't wait until the remote display has been initialized properly.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|-<br />
|GDISP_GFXNET_UNSAFE_SOCKET<br />
|Use unsafe sockets.<br/>See [[GDISP#Remote_displays|Remote displays]].<br />
|}<br />
<br />
== GWIN ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GWIN<br />
|Enable or disable the entire GWIN module.<br/>See [[GWIN]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GWIN_NEED_WINDOWMANAGER<br />
|Enable or disable the window manager.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GWIN_REDRAW_IMMEDIATE<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GWIN_REDRAW_SINGLEOP<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GWIN_NEED_CONSOLE<br />
|Include the console window features.<br/>See [[Console|Console]].<br />
|-<br />
|GWIN_CONSOLE_USE_HISTORY<br />
|Enable or disable the console history.<br/>See [[Console#History|History]].<br />
|-<br />
|GWIN_CONSOLE_HISTORY_AVERAGING<br />
|Create an average history buffer.<br/>See [[Console#History|History]].<br />
|-<br />
|GWIN_CONSOLE_HISTORY_ATCREATE<br />
|Create a history buffer at window creation time.<br/>See [[Console#History|History]].<br />
|-<br />
|GWIN_CONSOLE_ESQSEQ<br />
|Include escape sequence features.<br/>See [[Console#Escape_sequences|Escape sequences]].<br />
|-<br />
|GWIN_CONSOLE_USE_BASESTREAM<br />
|Include support for ChibiOS/RT base streams.<br/>See [[Console#ToDo|ToDo]].<br />
|-<br />
|GWIN_CONSOLE_USE_FLOAT<br />
|Include support for floating point numbers.<br/>See [[Console#Float|Float]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GWIN_NEED_GRAPH<br />
|Include the graph window features.<br/>See [[Graph|Graph]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GWIN_NEED_WIDGET<br />
|Enable or disable the widget system.<br/>See [[Widgets|Widgets]].<br />
|-<br />
|GWIN_FLAT_STYLING<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GWIN_NEED_LABEL<br />
|Enable or disable the label widget.<br/>See [[Label|Label]].<br />
|-<br />
|GWIN_NEED_LABEL_ATTRIBUTE<br />
|Include the label attribute feature.<br/>See [[Label#Attribute|Attribute]].<br />
|-<br />
|GWIN_NEED_BUTTON<br />
|Enable or disable the push button widget.<br/>See [[PushButton|PushButton]].<br />
|-<br />
|GWIN_NEED_BUTTON_LAZY_RELEASE<br />
|Enabel or disable the lazy release feature.<br/>See [[PushButton#Cancel_feature|Cancel feature]].<br />
|-<br />
|GWIN_NEED_SLIDER<br />
|Enable or disable the slider widget.<br/>See [[Slider|Slider]].<br />
|-<br />
|GWIN_NEED_CHECKBOX<br />
|Enable or disable the check box widget.<br/>See [[CheckBox|CheckBox]].<br />
|-<br />
|GWIN_NEED_IMAGE<br />
|Enable or disable the image box widget.<br/>See [[ImageBox|ImageBox]].<br />
|-<br />
|GWIN_NEED_IMAGE_ANIMATION<br />
|Include the image box animated images feature.<br/>See [[ImageBox#Animated_Images|Animated Images]].<br />
|-<br />
|GWIN_NEED_RADIO<br />
|Enable or disable the radio button widget.<br/>See [[RadioButton|RadioButton]].<br />
|-<br />
|GWIN_NEED_LIST<br />
|Enable or disable the list widget.<br/>See [[List|List]].<br />
|-<br />
|GWIN_NEED_LIST_IMAGES<br />
|Include the list widget images feature.<br/>See [[List#Images|Images]].<br />
|-<br />
|GWIN_NEED_PROGRESSBAR<br />
|Enable or disable the progress bar widget.<br/>See [[Progressbar|Progressbar]].<br />
|-<br />
|GWIN_NEED_PROGRESSBAR_AUTO<br />
|Include the automatic progress bar feature.<br/>See [[Progressbar#Automatic|Automatic]].<br />
|-<br />
|GWIN_NEED_CONTAINERS<br />
|Enable or disable the containers system.<br/>See [[Containers|Containers]].<br />
|-<br />
|GWIN_NEED_CONTAINER<br />
|Enable or disable the basic container.<br/>See [[Container|Container]].<br />
|-<br />
|GWIN_NEED_FRAME<br />
|Enable or disable the frame container.<br/>See [[Frame|Frame]].<br />
|}<br />
<br />
== GEVENT ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GTIMER<br />
|Enable or disable the entire GTIMER module.<br/>See [[GTIMER]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GTIMER_THREAD_PRIORITY<br />
|The GTIMER thread priority level.<br/See [[GTIMER#Priority|Priority]].<br />
|-<br />
|GTIMER_THREAD_WORKING_SIZE<br />
|The GTIMER thread stack size.<br/>See [[GTIMER#Stack_Size|Stack size]].<br />
|}<br />
<br />
== GQUEUE ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GQUEUE<br />
|Enable or disable the entire GQUEUE module.<br/>See [[GQUEUE]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GQUEUE_NEED_ASYNC<br />
|Enable or disable the asynchronous queue functions.<br/>See [[GQUEUE#Asynchronous|Asynchronous]].<br />
|-<br />
|GQUEUE_NEED_GSYNC<br />
|Enable or disable the ''GET'' synchronous queue functions.<br/>See [[GQUEUE#Asynchronous|Asynchronous]].<br />
|-<br />
|GQUEUE_NEED_FSYNC<br />
|Enable or disable the fully synchronous queue functions.<br/>See [[GQUEUE#Asynchronous|Asynchronous]].<br />
|-<br />
|GQUEUE_NEED_BUFFERS<br />
|Enable or disable the buffers functions.<br/>See [[GQUEUE#Buffers|Buffers]].<br />
|}<br />
<br />
== GINPUT ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GINPUT<br />
|Enable or disable the entire GINPUT module.<br/>See [[GINPUT]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GINPUT_NEED_MOUSE<br />
|Enable or disable support for a pointing device such as a touchscreen.<br/>See [[GINPUT#Touchscreen|Touchscreen]].<br />
|-<br />
|GINPUT_NEED_KEYBOARD<br />
|Not implemented yet.<br />
|-<br />
|GINPUT_NEED_TOGGLE<br />
|Enable or disable support for digital inputs.<br/>See [[#Digital_input|digital inputs]].<br />
|-<br />
|GINPUT_NEED_DIAL<br />
|Enable or disable support for analog inputs.<br/>See [[#Analog_input|analog inputs]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GINPUT_MOUSE_CALIBRATE_EXTREMES<br />
|If this is set to ''TRUE'', the calibration points are displayed at the very corner of the display. This gives an overall more accurate result but they are less intuitive.<br/>See [[GINPUT#Calibration|calibration]].<br />
|-<br />
|GINPUT_MOUSE_MAX_CALIBRATION_ERROR<br />
|This macro is part of the config file of the driver in your board directory and takes a pixel value. It defines how big the pixel offset of the test point can be before the calibration process is repeated automatically.<br/>See [[GINPUT#Calibration|calibration]].<br />
|}<br />
<br />
== GFILE ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GFILE<br />
|Enable or disable the entire GFILE module.<br/>See [[GFILE]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GFILE_NEED_PRINTG<br />
|Enable or disable print functions support.<br/>See [[GFILE#GFILE#String_manipulation_.26_printing | String manipulation & printing]].<br />
|-<br />
|GFILE_NEED_SCANG<br />
|Enable or disable scan functions support.<br/>See [[GFILE#GFILE#String_manipulation_.26_printing | String manipulation & printing]].<br />
|-<br />
|GFILE_NEED_STRINGS<br />
|Enable or disable string manipulation functions support.<br/>See [[GFILE#GFILE#String_manipulation_.26_printing | String manipulation & printing]].<br />
|-<br />
|GFILE_NEED_STDIO<br />
|Enable or disable STDIO emulation.<br/>See [[GFILE#STDIO_emulation | STDIO emulation]].<br />
|-<br />
|GFILE_ALLOW_FLOATS<br />
|Enable or disable float support.<br/>See [[GFILE#STDIO_emulation | STDIO emulation]].<br />
|-<br />
| GFILE_ALLOW_DEVICESPECIFIC<br />
|Allows opening files with a 'x|' prefix in order to ensure the file is opened with the specified file system.<br/>See [[GFILE#Multiple_file_systems|Multiple file systems]].<br />
|-<br />
| GFILE_MAX_GFILES<br />
|Specify the maximum number of files that can be opened at a time.<br/>See [[GFILE#ToDo|ToDo]].<br />
|-<br />
|GFILE_NEED_NOAUTOMOUNT<br />
|Enable or disable automatic file system mounting feature.<br/>See [[FATFS#Mounting|Mounting]].<br />
|-<br />
|GFILE_NEED_NOAUTOSYNC<br />
|Enable or disable automatic file system synchronization feature.<br/>See [[FATFS#Syncronization|Syncronization]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GFILE_NEED_FATFS<br />
|Enable or disable FatFS support.<br/>See [[FATFS]].<br />
|-<br />
|GFILE_NEED_ROMFS<br />
|Enable or disable ROMFS support.<br/>See [[ROMFS]].<br />
|-<br />
|GFILE_NEED_RAMFS<br />
|Enable or disable RAMFS support.<br/>See [[RAMFS]].<br />
|-<br />
|GFILE_NEED_MEMFS<br />
|Enable or disable MEMFS support.<br/>See [[MEMFS]].<br />
|-<br />
|GFILE_NEED_NATIVEFS<br />
|Enable or disable NATIVEFS support.<br/>See [[NATIVEFS]].<br />
|-<br />
|GFILE_NEED_CHIBIOSFS<br />
|Enable or disable CHIBIOSFS support.<br/>See [[CHIBIOSFS]].<br />
|}<br />
<br />
== GAUDIO ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GAUDIO<br />
|Enable or disable the entire GAUDIO module.<br/>See [[GAUDIO]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GAUDIO_NEED_PLAY<br />
|Enable or disable the play-back system (audio output).<br/>See [[GAUDIO#PlayBack|PlayBack]].<br />
|-<br />
|GAUDIO_NEED_RECORD<br />
|Enable or disable the record system (audio input).<br/>See [[GAUDIO#Record|Record]].<br />
|}<br />
<br />
== GADC ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GADC<br />
|Enable or disable the entire GADC module.<br/>See [[GADC]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GADC_MAX_LOWSPEED_DEVICES<br />
|Specify the maximum amount of low speed GADC devices.<br/>See [[GADC]].<br />
|}<br />
<br />
== GMISC ==<br />
{| class="wikitable"<br />
! scope="col"|Option<br />
! scope="col"|Description<br />
|-<br />
|GFX_USE_GMISC<br />
|Enable or disable the entire GMISC module.<br/>See [[GMISC]].<br />
|-style="height:25px"<br />
|<br />
|-<br />
|GMISC_NEED_ARRAOPS<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_NEED_FASTTRIG<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_NEED_FIXEDTRIG<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_NEED_INVSQRT<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_INVSQRT_MIXED_ENDIAN<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|-<br />
|GMISC_INVSQRT_REAL_SLOW<br />
|ToDo.<br/>See [[ToDo|ToDo]].<br />
|}<br />
<br />
<br />
<br />
[[Category:General]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Container&diff=669
Container
2014-08-16T14:25:00Z
<p>Inmarket: /* Transparency */</p>
<hr />
<div>The basic container widget can be used to group other widgets together. It's a simple blank rectangle and it can be used as a parent for other widgets.<br />
<br />
A widget can be added as a child to a container by adding the containers [[GHandle]] to the childs widget init structure:<br />
<syntaxhighlight lang=c><br />
GHandle ghContainer;<br />
GHandle ghChild;<br />
...<br />
wi.g.parent = ghContainer;<br />
...<br />
ghChild = gwinCreateXxx(0, &wi);<br />
</syntaxhighlight><br />
<br />
<br />
== API reference ==<br />
The API reference for the frame container can be found [http://api.ugfx.org/master/group___frame.html here].<br />
<br />
== Custom Draw Routines ==<br />
The container widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinContainerDraw_Std<br />
| The client area is filled with the background color.<br />
|-<br />
|gwinContainerDraw_Transparent<br />
| The client area is not filled in at all.<br />
|-<br />
|gwinContainerDraw_Image<br />
| The parameter is an open gdispImage that is tiled to fill the client area of the frame.<br />
|}<br />
<br />
== Border ==<br />
The container widget can optionally be rendered with a border. To enable the border, '''GWIN_CONTAINER_BORDER''' has to be passed as a flag to the <code>gwinContainerCreate()</code> routine.<br />
<br />
'''''Note:''' If you want to use the container as a pop-up or top-level window element, you might want to take a look at the [[frame]] widget instead.''<br />
<br />
== Transparency ==<br />
The container widget can optionally be rendered transparent by using the '''gwinContainerDraw_Transparent''' custom draw routine.<br />
<br />
== Example ==<br />
The following example shows how to create a container and adding a button to it.<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
static GHandle ghContainer;<br />
static GHandle ghButton;<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
gwinWidgetClearInit(&wi);<br />
<br />
// Apply the container parameters<br />
wi.g.show = FALSE;<br />
wi.g.width = 200;<br />
wi.g.height = 150;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Container";<br />
ghContainer = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER);<br />
wi.g.show = TRUE;<br />
<br />
// Apply the button parameters <br />
wi.g.width = 120;<br />
wi.g.height = 30;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Button";<br />
wi.g.parent = ghContainer;<br />
ghButton = gwinButtonCreate(0, &wi);<br />
<br />
// Make the container become visible - therefore all its children<br />
// become visible as well<br />
gwinShow(ghContainer);<br />
}<br />
<br />
int main(void) {<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("*"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Create the widget<br />
createWidgets();<br />
<br />
while(1) {<br />
gfxSleepMilliseconds(1000);<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
[[Category:Container]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Container&diff=668
Container
2014-08-16T14:23:34Z
<p>Inmarket: </p>
<hr />
<div>The basic container widget can be used to group other widgets together. It's a simple blank rectangle and it can be used as a parent for other widgets.<br />
<br />
A widget can be added as a child to a container by adding the containers [[GHandle]] to the childs widget init structure:<br />
<syntaxhighlight lang=c><br />
GHandle ghContainer;<br />
GHandle ghChild;<br />
...<br />
wi.g.parent = ghContainer;<br />
...<br />
ghChild = gwinCreateXxx(0, &wi);<br />
</syntaxhighlight><br />
<br />
<br />
== API reference ==<br />
The API reference for the frame container can be found [http://api.ugfx.org/master/group___frame.html here].<br />
<br />
== Custom Draw Routines ==<br />
The container widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinContainerDraw_Std<br />
| The client area is filled with the background color.<br />
|-<br />
|gwinContainerDraw_Transparent<br />
| The client area is not filled in at all.<br />
|-<br />
|gwinContainerDraw_Image<br />
| The parameter is an open gdispImage that is tiled to fill the client area of the frame.<br />
|}<br />
<br />
== Border ==<br />
The container widget can optionally be rendered with a border. To enable the border, '''GWIN_CONTAINER_BORDER''' has to be passed as a flag to the <code>gwinContainerCreate()</code> routine.<br />
<br />
'''''Note:''' If you want to use the container as a pop-up or top-level window element, you might want to take a look at the [[frame]] widget instead.''<br />
<br />
== Transparency ==<br />
The container widget can optionally be rendered transparent by passing using the '''gwinContainerDraw_Transparent''' custom draw routine.<br />
<br />
== Example ==<br />
The following example shows how to create a container and adding a button to it.<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
static GHandle ghContainer;<br />
static GHandle ghButton;<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
gwinWidgetClearInit(&wi);<br />
<br />
// Apply the container parameters<br />
wi.g.show = FALSE;<br />
wi.g.width = 200;<br />
wi.g.height = 150;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Container";<br />
ghContainer = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER);<br />
wi.g.show = TRUE;<br />
<br />
// Apply the button parameters <br />
wi.g.width = 120;<br />
wi.g.height = 30;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Button";<br />
wi.g.parent = ghContainer;<br />
ghButton = gwinButtonCreate(0, &wi);<br />
<br />
// Make the container become visible - therefore all its children<br />
// become visible as well<br />
gwinShow(ghContainer);<br />
}<br />
<br />
int main(void) {<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("*"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Create the widget<br />
createWidgets();<br />
<br />
while(1) {<br />
gfxSleepMilliseconds(1000);<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
[[Category:Container]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Frame&diff=667
Frame
2014-08-16T14:19:37Z
<p>Inmarket: /* Example */</p>
<hr />
<div>[[File:Frame_example_1.PNG|right|frame|Color picker example using the frame widget.]]The frame widget is based on the [[container]]. It behaves like a window similar to the ones you know from your computer. It has a border, a window title and an optional button to close it.<br />
<br />
== API reference ==<br />
The API reference for the basic container can be found [http://ugfx.org/images/resources/doxygen/master/group___frame.html here].<br />
<br />
== Custom Draw Routines ==<br />
The frame widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinFrameDraw_Std<br />
| The client area is filled with the background color.<br />
|-<br />
|gwinFrameDraw_Transparent<br />
| The client area is not filled in at all.<br />
|-<br />
|gwinFrameDraw_Image<br />
| The parameter is an open gdispImage that is tiled to fill the client area of the frame.<br />
|}<br />
<br />
== Window title ==<br />
The frames window title can either be set using the <code>wi.g.text</code> parameter of the [[Containers#Container_creation|initialization struct]] or the <code>gwinSetText()</code> API call.<br />
<br />
== Buttons ==<br />
The frame widget can optionally implement a close button. It shows up as an 'x' in the top right hand corner. If the button is pressed, <code>gwinDestroy()</code> is automatically called on the frame widget. Therefore, the entire widget including all its children will be destroyed.<br />
<br />
The close button can be enabled by passing <code>GWIN_FRAME_CLOSE_BTN</code> as a flag to the <code>gwinFrameCreate()</code> routine.<br />
<br />
== Example ==<br />
The following example shows how to create and use the frame widget. Several other widgets are added to the frame in order to create some kind of color picker dialog.<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
#include "stdio.h"<br />
<br />
static GListener gl;<br />
static GHandle ghFrame1;<br />
static GHandle ghSliderR, ghSliderG, ghSliderB;<br />
static GHandle ghButton1, ghButton2, ghButton3;<br />
static GHandle ghWindow1;<br />
<br />
static void _updateColor(void) {<br />
uint32_t color;<br />
<br />
color = (unsigned)gwinSliderGetPosition(ghSliderR) << 16;<br />
color |= (unsigned)gwinSliderGetPosition(ghSliderG) << 8;<br />
color |= (unsigned)gwinSliderGetPosition(ghSliderB) << 0;<br />
<br />
gwinSetBgColor(ghWindow1, HTML2COLOR(color));<br />
gwinClear(ghWindow1);<br />
}<br />
<br />
static void _createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
gwinWidgetClearInit(&wi);<br />
wi.g.show = TRUE;<br />
<br />
// Apply the frame parameters <br />
wi.g.width = 300;<br />
wi.g.height = 200;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Colorpicker";<br />
ghFrame1 = gwinFrameCreate(0, &wi, GWIN_FRAME_CLOSE_BTN | GWIN_FRAME_MINMAX_BTN);<br />
<br />
// Apply the button parameters<br />
wi.g.width = 60;<br />
wi.g.height = 20;<br />
wi.g.x = 10;<br />
wi.g.y = 10;<br />
wi.text = "Random";<br />
wi.g.parent = ghFrame1;<br />
ghButton1 = gwinButtonCreate(0, &wi);<br />
<br />
// Apply the slider parameters<br />
wi.g.width = 200;<br />
wi.g.height = 20;<br />
wi.g.x = 80;<br />
wi.g.y += 0;<br />
wi.text = "Red";<br />
wi.g.parent = ghFrame1;<br />
ghSliderR = gwinSliderCreate(0, &wi);<br />
gwinSliderSetRange(ghSliderR, 0, 255);<br />
gwinSliderSetPosition(ghSliderR, 180);<br />
<br />
// Apply the button parameters<br />
wi.g.width = 60;<br />
wi.g.height = 20;<br />
wi.g.x = 10;<br />
wi.g.y += 25;<br />
wi.text = "Random";<br />
wi.g.parent = ghFrame1;<br />
ghButton2 = gwinButtonCreate(0, &wi);<br />
<br />
// Apply the slider parameters<br />
wi.g.width = 200;<br />
wi.g.height = 20;<br />
wi.g.x = 80;<br />
wi.g.y += 0;<br />
wi.text = "Green";<br />
wi.g.parent = ghFrame1;<br />
ghSliderG = gwinSliderCreate(0, &wi);<br />
gwinSliderSetRange(ghSliderG, 0, 255);<br />
gwinSliderSetPosition(ghSliderG, 60);<br />
<br />
// Apply the button parameters<br />
wi.g.width = 60;<br />
wi.g.height = 20;<br />
wi.g.x = 10;<br />
wi.g.y += 25;<br />
wi.text = "Random";<br />
wi.g.parent = ghFrame1;<br />
ghButton3 = gwinButtonCreate(0, &wi);<br />
<br />
// Apply the slider parameters<br />
wi.g.width = 200;<br />
wi.g.height = 20;<br />
wi.g.x = 80;<br />
wi.g.y += 0;<br />
wi.text = "Blue";<br />
wi.g.parent = ghFrame1;<br />
ghSliderB = gwinSliderCreate(0, &wi);<br />
gwinSliderSetRange(ghSliderB, 0, 255);<br />
gwinSliderSetPosition(ghSliderB, 235);<br />
<br />
// Color Preview<br />
wi.g.width = 270;<br />
wi.g.height = 65;<br />
wi.g.x = 10;<br />
wi.g.y = 90;<br />
ghWindow1 = gwinWindowCreate(0, &wi.g);<br />
<br />
_updateColor();<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("*"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// create the widget<br />
_createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_SLIDER:<br />
if (((GEventGWinSlider *)pe)->slider == ghSliderR || \<br />
ghSliderG || \<br />
ghSliderB ) {<br />
_updateColor();<br />
}<br />
break;<br />
<br />
case GEVENT_GWIN_BUTTON:<br />
if (((GEventGWinButton *)pe)->button == ghButton1) {<br />
gwinSliderSetPosition(ghSliderR, rand() % 256);<br />
} else if (((GEventGWinButton *)pe)->button == ghButton2) {<br />
gwinSliderSetPosition(ghSliderG, rand() % 256);<br />
} else if (((GEventGWinButton *)pe)->button == ghButton3) {<br />
gwinSliderSetPosition(ghSliderB, rand() % 256);<br />
}<br />
<br />
_updateColor();<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
<br />
[[Category:Container]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Frame&diff=666
Frame
2014-08-16T14:18:19Z
<p>Inmarket: </p>
<hr />
<div>[[File:Frame_example_1.PNG|right|frame|Color picker example using the frame widget.]]The frame widget is based on the [[container]]. It behaves like a window similar to the ones you know from your computer. It has a border, a window title and an optional button to close it.<br />
<br />
== API reference ==<br />
The API reference for the basic container can be found [http://ugfx.org/images/resources/doxygen/master/group___frame.html here].<br />
<br />
== Custom Draw Routines ==<br />
The frame widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinFrameDraw_Std<br />
| The client area is filled with the background color.<br />
|-<br />
|gwinFrameDraw_Transparent<br />
| The client area is not filled in at all.<br />
|-<br />
|gwinFrameDraw_Image<br />
| The parameter is an open gdispImage that is tiled to fill the client area of the frame.<br />
|}<br />
<br />
== Window title ==<br />
The frames window title can either be set using the <code>wi.g.text</code> parameter of the [[Containers#Container_creation|initialization struct]] or the <code>gwinSetText()</code> API call.<br />
<br />
== Buttons ==<br />
The frame widget can optionally implement a close button. It shows up as an 'x' in the top right hand corner. If the button is pressed, <code>gwinDestroy()</code> is automatically called on the frame widget. Therefore, the entire widget including all its children will be destroyed.<br />
<br />
The close button can be enabled by passing <code>GWIN_FRAME_CLOSE_BTN</code> as a flag to the <code>gwinFrameCreate()</code> routine.<br />
<br />
== Example ==<br />
The following example shows how to create and use the frame widget. Several other widgets are added to the frame in order to create some kind of color picker dialog.<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
#include "stdio.h"<br />
<br />
static GListener gl;<br />
static GHandle ghFrame1;<br />
static GHandle ghSliderR, ghSliderG, ghSliderB;<br />
static GHandle ghButton1, ghButton2, ghButton3;<br />
static GHandle ghWindow1;<br />
<br />
static void _updateColor(void) {<br />
uint32_t color;<br />
<br />
color = (unsigned)gwinSliderGetPosition(ghSliderR) << 16;<br />
color |= (unsigned)gwinSliderGetPosition(ghSliderG) << 8;<br />
color |= (unsigned)gwinSliderGetPosition(ghSliderB) << 0;<br />
<br />
gwinSetBgColor(ghWindow1, HTML2COLOR(color));<br />
gwinClear(ghWindow1);<br />
}<br />
<br />
static void _createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
gwinWidgetClearInit(&wi);<br />
wi.g.show = TRUE;<br />
<br />
// Apply the frame parameters <br />
wi.g.width = 300;<br />
wi.g.height = 200;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Colorpicker";<br />
ghFrame1 = gwinFrameCreate(0, &wi, GWIN_FRAME_BORDER | GWIN_FRAME_CLOSE_BTN | GWIN_FRAME_MINMAX_BTN);<br />
<br />
// Apply the button parameters<br />
wi.g.width = 60;<br />
wi.g.height = 20;<br />
wi.g.x = 10;<br />
wi.g.y = 10;<br />
wi.text = "Random";<br />
wi.g.parent = ghFrame1;<br />
ghButton1 = gwinButtonCreate(0, &wi);<br />
<br />
// Apply the slider parameters<br />
wi.g.width = 200;<br />
wi.g.height = 20;<br />
wi.g.x = 80;<br />
wi.g.y += 0;<br />
wi.text = "Red";<br />
wi.g.parent = ghFrame1;<br />
ghSliderR = gwinSliderCreate(0, &wi);<br />
gwinSliderSetRange(ghSliderR, 0, 255);<br />
gwinSliderSetPosition(ghSliderR, 180);<br />
<br />
// Apply the button parameters<br />
wi.g.width = 60;<br />
wi.g.height = 20;<br />
wi.g.x = 10;<br />
wi.g.y += 25;<br />
wi.text = "Random";<br />
wi.g.parent = ghFrame1;<br />
ghButton2 = gwinButtonCreate(0, &wi);<br />
<br />
// Apply the slider parameters<br />
wi.g.width = 200;<br />
wi.g.height = 20;<br />
wi.g.x = 80;<br />
wi.g.y += 0;<br />
wi.text = "Green";<br />
wi.g.parent = ghFrame1;<br />
ghSliderG = gwinSliderCreate(0, &wi);<br />
gwinSliderSetRange(ghSliderG, 0, 255);<br />
gwinSliderSetPosition(ghSliderG, 60);<br />
<br />
// Apply the button parameters<br />
wi.g.width = 60;<br />
wi.g.height = 20;<br />
wi.g.x = 10;<br />
wi.g.y += 25;<br />
wi.text = "Random";<br />
wi.g.parent = ghFrame1;<br />
ghButton3 = gwinButtonCreate(0, &wi);<br />
<br />
// Apply the slider parameters<br />
wi.g.width = 200;<br />
wi.g.height = 20;<br />
wi.g.x = 80;<br />
wi.g.y += 0;<br />
wi.text = "Blue";<br />
wi.g.parent = ghFrame1;<br />
ghSliderB = gwinSliderCreate(0, &wi);<br />
gwinSliderSetRange(ghSliderB, 0, 255);<br />
gwinSliderSetPosition(ghSliderB, 235);<br />
<br />
// Color Preview<br />
wi.g.width = 270;<br />
wi.g.height = 65;<br />
wi.g.x = 10;<br />
wi.g.y = 90;<br />
ghWindow1 = gwinWindowCreate(0, &wi.g);<br />
<br />
_updateColor();<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("*"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// create the widget<br />
_createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_SLIDER:<br />
if (((GEventGWinSlider *)pe)->slider == ghSliderR || \<br />
ghSliderG || \<br />
ghSliderB ) {<br />
_updateColor();<br />
}<br />
break;<br />
<br />
case GEVENT_GWIN_BUTTON:<br />
if (((GEventGWinButton *)pe)->button == ghButton1) {<br />
gwinSliderSetPosition(ghSliderR, rand() % 256);<br />
} else if (((GEventGWinButton *)pe)->button == ghButton2) {<br />
gwinSliderSetPosition(ghSliderG, rand() % 256);<br />
} else if (((GEventGWinButton *)pe)->button == ghButton3) {<br />
gwinSliderSetPosition(ghSliderB, rand() % 256);<br />
}<br />
<br />
_updateColor();<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
<br />
[[Category:Container]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Progressbar&diff=665
Progressbar
2014-08-16T06:33:33Z
<p>Inmarket: </p>
<hr />
<div>A progressbar is a rectangular box to visualize the progression of a progress or an operation. The progressbar widget can either be controlled manually or automatically. In both cases, the range of the progressbar can be changed through the <code>gwinProgressbarSetRange()</code> call. The default values are 0 to 100. Furthermore, the resolution can be modified through <code>gwinProgressbarSetResolution()</code>. This changes the size of the steps in which the progressbar will be incremented or decremented. The default resolution is 1.<br />
<br />
== API reference ==<br />
The API reference of the progressbar can be found [http://ugfx.org/images/resources/doxygen/master/group___progressbar.html here].<br />
<br />
== Custom Draw Routines ==<br />
The slider widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinProgressbarDraw_Std<br />
| The standard progress bar look.<br />
|-<br />
|gwinProgressbarDraw_Image<br />
| The parameter is an open gdispImage that is tiled to fill the active part of the progress bar.<br />
|}<br />
<br />
== Manual ==<br />
There are two ways to change the value that a progressbar displays:<br />
<br />
* <code>gwinProgressbarSetPosition()</code><br />
* <code>gwinProgressbarIncrease()</code> and <code>gwinProgressbarDecrease()</code><br />
You can also use them together and mix them up. Note that the increase and decrease call increment and decrement by the resolution that was set using <code>gwinProgressbarSetResolution()</code>.<br />
<br />
=== Example ===<br />
The following example shows how a progressbar is created and controlled manually. The range of the progressbar has not been modified and is therefore 0 to 100. The resolution has not been modified either and is therefore 1.<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
GHandle ghProgressbar;<br />
<br />
static void _createWidget(void) {<br />
GWidgetInit wi;<br />
<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
wi.g.y = 10; wi.g.x = 10; wi.g.width = 200; wi.g.height = 20; wi.text = "Progress 1";<br />
ghProgressbar = gwinProgressbarCreate(NULL, &wi);<br />
}<br />
<br />
int main(void) {<br />
gfxInit();<br />
<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
_createWidget();<br />
<br />
// use any of these however you need them<br />
gwinProgressbarSetPosition(ghProgressbar, 42);<br />
gwinProgressbarIncrement(ghProgressbar);<br />
gwinProgressbarDecrement(ghProgressbar);<br />
<br />
while (1) {<br />
gfxSleepMilliseconds(500);<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
== Automatic ==<br />
'''''Note:''' You have to set <code>GWIN_PROGRESSBAR_AUTO</code> to ''TRUE'' in your [[gfxconf.h]] to use this feature.''<br />
<br />
Using the <code>gwinProgressbarStart()</code> call, a progressbar can be automatically increased from its current to its maximum value. The [[GTIMER]] module is internally used for this purpose. No event is generated once the progressbar reached its maximum value.<br />
<br />
The following example shows how a progressbar is created and controlled automatically. The range of the progressbar has not been modified and is therefore 0 to 100. The resolution is set to 10 and the timer interval to 500ms. Therefore it will take around 5 seconds until the progressbar reached its maximum value.<br />
<br />
=== Example ===<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
GHandle ghProgressbar;<br />
<br />
static void _createWidget(void) {<br />
GWidgetInit wi;<br />
<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
wi.g.y = 10; wi.g.x = 10; wi.g.width = 200; wi.g.height = 20; wi.text = "Progress 1";<br />
ghProgressbar = gwinProgressbarCreate(NULL, &wi);<br />
}<br />
<br />
int main(void) {<br />
gfxInit();<br />
<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
_createWidget();<br />
<br />
gwinProgressbarSetResolution(ghProgressbar, 10);<br />
gwinProgressbarStart(ghProgressbar, 500);<br />
<br />
while (1) {<br />
gfxSleepMilliseconds(500);<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Slider&diff=664
Slider
2014-08-16T06:30:34Z
<p>Inmarket: </p>
<hr />
<div>A slider is a bar shaped element in which a much smaller bar can be moved from the lowest (0) to the highest (100) value. The text attribute of the slider is displayed in the very center of the slider bar.<br />
<br />
== API reference ==<br />
The API reference of the slider widget can be found [http://ugfx.org/images/resources/doxygen/master/group___slider.html here].<br />
<br />
== Custom Draw Routines ==<br />
The slider widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinSliderDraw_Std<br />
| The standard slider look.<br />
|-<br />
|gwinSliderDraw_Image<br />
| The parameter is an open gdispImage that is tiled to fill the active part of the slider.<br />
|}<br />
<br />
== Example ==<br />
The following example shows how to create and use a vertical and a horizontal slider:<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
static GListener gl;<br />
static GHandle ghSlider1, ghSlider2;<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
// create Slider1<br />
wi.g.y = 10; wi.g.x = 10; wi.g.width = 200; wi.g.height = 20; wi.text = "S1";<br />
ghSlider1 = gwinSliderCreate(NULL, &wi);<br />
<br />
// create Slider2<br />
wi.g.y = 40; wi.g.x = 10; wi.g.width = 20; wi.g.height = 200; wi.text = "S2";<br />
ghSlider2 = gwinSliderCreate(NULL, &wi);<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// create the widget<br />
createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_SLIDER:<br />
printf("Slider %s = %d\n", gwinGetText(((GEventGWinSlider *)pe)->slider),<br />
((GEventGWinSlider *)pe)->position<br />
);<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=CheckBox&diff=663
CheckBox
2014-08-16T06:23:15Z
<p>Inmarket: /* Custom Draw Routines */</p>
<hr />
<div>A checkbox is a small stand-alone GUI element which only knows the two states '''checked''' and '''unchecked'''. The text attribute of a checkbox gets drawn by default on the left side of the checkbox. The width of the widget is supposed to be larger in order to contain the text.<br />
<br />
== API reference ==<br />
The API reference of the checkbox widget can be found [http://ugfx.org/images/resources/doxygen/master/group___checkbox.html here].<br />
<br />
== Custom Draw Routines ==<br />
The checkbox widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinCheckboxDraw_CheckOnLeft<br />
| The check is on the left of the text (default).<br />
|-<br />
|gwinCheckboxDraw_CheckOnRight<br />
| The check is on the right of the text.<br />
|}<br />
<br />
== Example ==<br />
The following example shows how to use the checkbox widget:<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
static GListener gl;<br />
static GHandle ghCheckbox1;<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
// Apply the checkbox parameters <br />
wi.g.width = 100; // includes text<br />
wi.g.height = 20;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Checkbox";<br />
<br />
// Create the actual checkbox <br />
ghCheckbox1 = gwinCheckboxCreate(NULL, &wi);<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// create the widget<br />
createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_CHECKBOX:<br />
if (((GEventGWinCheckbox*)pe)->checkbox == ghCheckbox1) {<br />
// The state of our checkbox has changed<br />
printf("Checkbox state: %d\r\n", ((GEventGWinCheckbox*)pe)->isChecked);<br />
}<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=CheckBox&diff=662
CheckBox
2014-08-16T06:21:59Z
<p>Inmarket: </p>
<hr />
<div>A checkbox is a small stand-alone GUI element which only knows the two states '''checked''' and '''unchecked'''. The text attribute of a checkbox gets drawn by default on the left side of the checkbox. The width of the widget is supposed to be larger in order to contain the text.<br />
<br />
== API reference ==<br />
The API reference of the checkbox widget can be found [http://ugfx.org/images/resources/doxygen/master/group___checkbox.html here].<br />
<br />
== Custom Draw Routines ==<br />
The checkbox widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinCheckboxDraw_CheckOnLeft<br />
|<br />
| The check is on the left of the text (default).<br />
|-<br />
|gwinCheckboxDraw_CheckOnRight<br />
| The check is on the right of the text.<br />
|}<br />
<br />
== Example ==<br />
The following example shows how to use the checkbox widget:<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
static GListener gl;<br />
static GHandle ghCheckbox1;<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
// Apply the checkbox parameters <br />
wi.g.width = 100; // includes text<br />
wi.g.height = 20;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Checkbox";<br />
<br />
// Create the actual checkbox <br />
ghCheckbox1 = gwinCheckboxCreate(NULL, &wi);<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// create the widget<br />
createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_CHECKBOX:<br />
if (((GEventGWinCheckbox*)pe)->checkbox == ghCheckbox1) {<br />
// The state of our checkbox has changed<br />
printf("Checkbox state: %d\r\n", ((GEventGWinCheckbox*)pe)->isChecked);<br />
}<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=RadioButton&diff=661
RadioButton
2014-08-16T06:18:11Z
<p>Inmarket: /* Custom Draw Routines */</p>
<hr />
<div>A radio button is a widget that only works together in a group of two or more radio buttons. Inside this group of radio buttons, only one button can be checked at a time. When you click on another raido button, the current one gets disabled and the new one becomes gets the checked state.<br />
<br />
== API reference ==<br />
The API reference for the radio button widget can be found [http://ugfx.org/images/resources/doxygen/master/group___radio_button.html here].<br />
<br />
== Custom Draw Routines ==<br />
The radio button widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinRadioDraw_Radio<br />
| The standard radio button look with text to the right. If GDISP_NEED_CIRCLE is defined a round radio is drawn.<br />
|-<br />
|gwinRadioDraw_Button<br />
| Looks like a standard push button<br />
|-<br />
|gwinRadioDraw_Tab<br />
| A tab look<br />
|}<br />
<br />
== Example ==<br />
The following example shows how to use the radio button widget. In this example we create two groups where each group consists of three radio buttons:<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
#define GROUP1 0 // this will be the first radio button group<br />
#define GROUP2 1 // this will be the second radio button group<br />
<br />
static GListener gl;<br />
static GHandle ghRadio11, ghRadio12, ghRadio13; // the first group<br />
static GHandle ghRadio21, ghRadio22, ghRadio23; // the second group<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
// create Radio11<br />
wi.g.y = 10; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 1";<br />
ghRadio11 = gwinRadioCreate(NULL, &wi, GROUP1);<br />
<br />
// create Radio12<br />
wi.g.y = 50; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 2";<br />
ghRadio12 = gwinRadioCreate(NULL, &wi, GROUP1);<br />
<br />
// create Radio13<br />
wi.g.y = 90; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 3";<br />
ghRadio13 = gwinRadioCreate(NULL, &wi, GROUP1);<br />
<br />
// create Radio21<br />
wi.g.y = 10; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 1";<br />
ghRadio21 = gwinRadioCreate(NULL, &wi, GROUP2);<br />
<br />
// create Radio22<br />
wi.g.y = 50; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 2";<br />
ghRadio22 = gwinRadioCreate(NULL, &wi, GROUP2);<br />
<br />
// create Radio23<br />
wi.g.y = 90; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 3";<br />
ghRadio23 = gwinRadioCreate(NULL, &wi, GROUP2);<br />
<br />
// Check the first radio buttons<br />
gwinRadioPress(ghRadio11);<br />
gwinRadioPress(ghRadio21);<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// create the widget<br />
createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_RADIO:<br />
printf("group: %u radio: %s\n", ((GEventGWinRadio *)pe)->group,<br />
gwinGetText(((GEventGWinRadio *)pe)->radio)<br />
);<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=RadioButton&diff=660
RadioButton
2014-08-16T06:17:11Z
<p>Inmarket: /* Custom Draw Routines */</p>
<hr />
<div>A radio button is a widget that only works together in a group of two or more radio buttons. Inside this group of radio buttons, only one button can be checked at a time. When you click on another raido button, the current one gets disabled and the new one becomes gets the checked state.<br />
<br />
== API reference ==<br />
The API reference for the radio button widget can be found [http://ugfx.org/images/resources/doxygen/master/group___radio_button.html here].<br />
<br />
== Custom Draw Routines ==<br />
The radio button widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinRadioDraw_Radio<br />
| The standard radio button look. If GDISP_NEED_CIRCLE is defined a round radio is drawn.<br />
|-<br />
|gwinRadioDraw_Button<br />
| Looks like a standard push button<br />
|-<br />
|gwinRadioDraw_Tab<br />
| A tab look<br />
|}<br />
<br />
== Example ==<br />
The following example shows how to use the radio button widget. In this example we create two groups where each group consists of three radio buttons:<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
#define GROUP1 0 // this will be the first radio button group<br />
#define GROUP2 1 // this will be the second radio button group<br />
<br />
static GListener gl;<br />
static GHandle ghRadio11, ghRadio12, ghRadio13; // the first group<br />
static GHandle ghRadio21, ghRadio22, ghRadio23; // the second group<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
// create Radio11<br />
wi.g.y = 10; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 1";<br />
ghRadio11 = gwinRadioCreate(NULL, &wi, GROUP1);<br />
<br />
// create Radio12<br />
wi.g.y = 50; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 2";<br />
ghRadio12 = gwinRadioCreate(NULL, &wi, GROUP1);<br />
<br />
// create Radio13<br />
wi.g.y = 90; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 3";<br />
ghRadio13 = gwinRadioCreate(NULL, &wi, GROUP1);<br />
<br />
// create Radio21<br />
wi.g.y = 10; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 1";<br />
ghRadio21 = gwinRadioCreate(NULL, &wi, GROUP2);<br />
<br />
// create Radio22<br />
wi.g.y = 50; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 2";<br />
ghRadio22 = gwinRadioCreate(NULL, &wi, GROUP2);<br />
<br />
// create Radio23<br />
wi.g.y = 90; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 3";<br />
ghRadio23 = gwinRadioCreate(NULL, &wi, GROUP2);<br />
<br />
// Check the first radio buttons<br />
gwinRadioPress(ghRadio11);<br />
gwinRadioPress(ghRadio21);<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// create the widget<br />
createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_RADIO:<br />
printf("group: %u radio: %s\n", ((GEventGWinRadio *)pe)->group,<br />
gwinGetText(((GEventGWinRadio *)pe)->radio)<br />
);<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=RadioButton&diff=659
RadioButton
2014-08-16T06:16:47Z
<p>Inmarket: </p>
<hr />
<div>A radio button is a widget that only works together in a group of two or more radio buttons. Inside this group of radio buttons, only one button can be checked at a time. When you click on another raido button, the current one gets disabled and the new one becomes gets the checked state.<br />
<br />
== API reference ==<br />
The API reference for the radio button widget can be found [http://ugfx.org/images/resources/doxygen/master/group___radio_button.html here].<br />
<br />
== Custom Draw Routines ==<br />
The radio button widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Description<br />
|-<br />
|gwinRadioDraw_Radio<br />
|<br />
| The standard radio button look. If GDISP_NEED_CIRCLE is defined a round radio is drawn.<br />
|-<br />
|gwinRadioDraw_Button<br />
| Looks like a standard push button<br />
|-<br />
|gwinRadioDraw_Tab<br />
| A tab look<br />
|}<br />
<br />
== Example ==<br />
The following example shows how to use the radio button widget. In this example we create two groups where each group consists of three radio buttons:<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
#define GROUP1 0 // this will be the first radio button group<br />
#define GROUP2 1 // this will be the second radio button group<br />
<br />
static GListener gl;<br />
static GHandle ghRadio11, ghRadio12, ghRadio13; // the first group<br />
static GHandle ghRadio21, ghRadio22, ghRadio23; // the second group<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
// create Radio11<br />
wi.g.y = 10; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 1";<br />
ghRadio11 = gwinRadioCreate(NULL, &wi, GROUP1);<br />
<br />
// create Radio12<br />
wi.g.y = 50; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 2";<br />
ghRadio12 = gwinRadioCreate(NULL, &wi, GROUP1);<br />
<br />
// create Radio13<br />
wi.g.y = 90; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 3";<br />
ghRadio13 = gwinRadioCreate(NULL, &wi, GROUP1);<br />
<br />
// create Radio21<br />
wi.g.y = 10; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 1";<br />
ghRadio21 = gwinRadioCreate(NULL, &wi, GROUP2);<br />
<br />
// create Radio22<br />
wi.g.y = 50; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 2";<br />
ghRadio22 = gwinRadioCreate(NULL, &wi, GROUP2);<br />
<br />
// create Radio23<br />
wi.g.y = 90; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 3";<br />
ghRadio23 = gwinRadioCreate(NULL, &wi, GROUP2);<br />
<br />
// Check the first radio buttons<br />
gwinRadioPress(ghRadio11);<br />
gwinRadioPress(ghRadio21);<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// create the widget<br />
createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_RADIO:<br />
printf("group: %u radio: %s\n", ((GEventGWinRadio *)pe)->group,<br />
gwinGetText(((GEventGWinRadio *)pe)->radio)<br />
);<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=PushButton&diff=658
PushButton
2014-08-16T06:08:22Z
<p>Inmarket: /* Custom Draw Routines */</p>
<hr />
<div>A push button is a stand-alone [[widgets|widget]] with a static size and a text where the text is drawn centered inside the button area. A push button can have the state '''pressed''' or '''unpressed'''.<br />
<br />
== API Reference ==<br />
The API reference for the push button widget can be found [http://ugfx.org/images/resources/doxygen/master/group___button.html here].<br />
<br />
== Custom Draw Routines ==<br />
The button widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. Some require certain features to be turned on in your [[gfxconf.h]] file. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Define<br />
! scope="col"|Description<br />
|-<br />
|gwinButtonDraw_Normal<br />
|<br />
| The standard button look<br />
|-<br />
|gwinButtonDraw_Rounded<br />
| GDISP_NEED_ARC<br />
| A button with rounded corners<br />
|-<br />
|gwinButtonDraw_Ellipse<br />
| GDISP_NEED_ELLIPSE<br />
| An elliptical button<br />
|-<br />
|gwinButtonDraw_ArrowUp<br />
| GDISP_NEED_CONVEX_POLYGON<br />
| An up arrow<br />
|-<br />
|gwinButtonDraw_ArrowDown<br />
| GDISP_NEED_CONVEX_POLYGON<br />
| An down arrow<br />
|-<br />
|gwinButtonDraw_ArrowLeft<br />
| GDISP_NEED_CONVEX_POLYGON<br />
| An left arrow<br />
|-<br />
|gwinButtonDraw_ArrowRight<br />
| GDISP_NEED_CONVEX_POLYGON<br />
| An right arrow<br />
|-<br />
|gwinButtonDraw_Image<br />
| GDISP_NEED_IMAGE<br />
| An image button. The param must be a gdispImage pointer. See the API documentation for details.<br />
|}<br />
<br />
== Cancel feature ==<br />
The button implementation allows it to cancel a button pressed event: When you push a button but release it outside of it's area, the action is canceled. However, this feature can become a problem with touchscreen systems which have a lot of noise on the output coordinates. When you have a small button, the chance that just one point is outside of the area of a small button is very high.<br />
<br />
To fix this issue, there's the macro <code>GWIN_BUTTON_LAZY_RELEASE</code> available. When you set it to '''TRUE''' in your [[gfxconf.h]], the cancel feature get's disabled.<br />
<br />
Of course the real solution is to fix the noise. One of the things that may help is reducing your SPI frequency if your touch is connected via SPI. There is a demo program that allows you to fine-tune the parameters for your touch driver in ''tools/ginput_touch_driver_test''. Compile and run it and each step will help you adjust one of the touch parameters. Unfortunately the parameters are not run-time changable. You need to run a test, alter the paremter, recompile and then run it again. Also don't try to do all the parameters at the same time as the setting of one can affect the setting of others - so do the tests one step at a time.<br />
<br />
== Example ==<br />
The following example shows how to use a push button widget:<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
static GListener gl;<br />
static GHandle ghButton1;<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
// Apply the button parameters <br />
wi.g.width = 100;<br />
wi.g.height = 30;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Push Button";<br />
<br />
// Create the actual button<br />
ghButton1 = gwinButtonCreate(NULL, &wi);<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// create the widget<br />
createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_BUTTON:<br />
if (((GEventGWinButton*)pe)->button == ghButton1) {<br />
// Our button has been pressed<br />
printf("Button clicked\r\n");<br />
}<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=PushButton&diff=657
PushButton
2014-08-16T06:05:45Z
<p>Inmarket: </p>
<hr />
<div>A push button is a stand-alone [[widgets|widget]] with a static size and a text where the text is drawn centered inside the button area. A push button can have the state '''pressed''' or '''unpressed'''.<br />
<br />
== API Reference ==<br />
The API reference for the push button widget can be found [http://ugfx.org/images/resources/doxygen/master/group___button.html here].<br />
<br />
== Custom Draw Routines ==<br />
The button widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:<br />
{| class="wikitable"<br />
! scope="col"|Custom Draw Routine<br />
! scope="col"|Define<br />
! scope="col"|Description<br />
|- |gwinButtonDraw_Normal | | The standard button look<br />
|- |gwinButtonDraw_Rounded | GDISP_NEED_ARC | A button with rounded corners<br />
|- |gwinButtonDraw_Ellipse | GDISP_NEED_ELLIPSE | An elliptical button<br />
|- |gwinButtonDraw_ArrowUp | GDISP_NEED_CONVEX_POLYGON | An up arrow<br />
|- |gwinButtonDraw_ArrowDown | GDISP_NEED_CONVEX_POLYGON | An down arrow<br />
|- |gwinButtonDraw_ArrowLeft | GDISP_NEED_CONVEX_POLYGON | An left arrow<br />
|- |gwinButtonDraw_ArrowRight | GDISP_NEED_CONVEX_POLYGON | An right arrow<br />
|- |gwinButtonDraw_Image | GDISP_NEED_IMAGE | An image button. The param must be a gdispImage pointer. See the API documentation for details.<br />
|}<br />
<br />
== Cancel feature ==<br />
The button implementation allows it to cancel a button pressed event: When you push a button but release it outside of it's area, the action is canceled. However, this feature can become a problem with touchscreen systems which have a lot of noise on the output coordinates. When you have a small button, the chance that just one point is outside of the area of a small button is very high.<br />
<br />
To fix this issue, there's the macro <code>GWIN_BUTTON_LAZY_RELEASE</code> available. When you set it to '''TRUE''' in your [[gfxconf.h]], the cancel feature get's disabled.<br />
<br />
Of course the real solution is to fix the noise. One of the things that may help is reducing your SPI frequency if your touch is connected via SPI. There is a demo program that allows you to fine-tune the parameters for your touch driver in ''tools/ginput_touch_driver_test''. Compile and run it and each step will help you adjust one of the touch parameters. Unfortunately the parameters are not run-time changable. You need to run a test, alter the paremter, recompile and then run it again. Also don't try to do all the parameters at the same time as the setting of one can affect the setting of others - so do the tests one step at a time.<br />
<br />
== Example ==<br />
The following example shows how to use a push button widget:<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
static GListener gl;<br />
static GHandle ghButton1;<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
// Apply the button parameters <br />
wi.g.width = 100;<br />
wi.g.height = 30;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Push Button";<br />
<br />
// Create the actual button<br />
ghButton1 = gwinButtonCreate(NULL, &wi);<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// create the widget<br />
createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_BUTTON:<br />
if (((GEventGWinButton*)pe)->button == ghButton1) {<br />
// Our button has been pressed<br />
printf("Button clicked\r\n");<br />
}<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=PushButton&diff=656
PushButton
2014-08-16T05:47:33Z
<p>Inmarket: /* Cancel feature */</p>
<hr />
<div>A push button is a stand-alone [[widgets|widget]] with a static size and a text where the text is drawn centered inside the button area. A push button only know the state '''pressed''' and '''unpressed'''.<br />
<br />
== Cancel feature ==<br />
The button implementation allows it to cancel a button pressed event: When you push a button but release it outside of it's area, the action is canceled. However, this feature can become a problem with touchscreen systems which have a lot of noise on the output coordinates. When you have a small button, the chance that just one point is outside of the area of a small button is very high.<br />
<br />
To fix this issue, there's the macro <code>GWIN_BUTTON_LAZY_RELEASE</code> available. When you set it to '''TRUE''' in your [[gfxconf.h]], the cancel feature get's disabled.<br />
<br />
Of course the real solution is to fix the noise. One of the things that may help is reducing your SPI frequency if your touch is connected via SPI. There is a demo program that allows you to fine-tune the parameters for your touch driver in ''tools/ginput_touch_driver_test''. Compile and run it and each step will help you adjust one of the touch parameters. Unfortunately the parameters are not run-time changable. You need to run a test, alter the paremter, recompile and then run it again. Also don't try to do all the parameters at the same time as the setting of one can affect the setting of others - so do the tests one step at a time.<br />
<br />
== API Reference ==<br />
The API reference for the push button widget can be found [http://ugfx.org/images/resources/doxygen/master/group___button.html here].<br />
<br />
== Example ==<br />
The following example shows how to use a push button widget:<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
static GListener gl;<br />
static GHandle ghButton1;<br />
<br />
static void createWidgets(void) {<br />
GWidgetInit wi;<br />
<br />
// Apply some default values for GWIN<br />
wi.customDraw = 0;<br />
wi.customParam = 0;<br />
wi.customStyle = 0;<br />
wi.g.show = TRUE;<br />
<br />
// Apply the button parameters <br />
wi.g.width = 100;<br />
wi.g.height = 30;<br />
wi.g.y = 10;<br />
wi.g.x = 10;<br />
wi.text = "Push Button";<br />
<br />
// Create the actual button<br />
ghButton1 = gwinButtonCreate(NULL, &wi);<br />
}<br />
<br />
int main(void) {<br />
GEvent* pe;<br />
<br />
// Initialize the display<br />
gfxInit();<br />
<br />
// Set the widget defaults<br />
gwinSetDefaultFont(gdispOpenFont("UI2"));<br />
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);<br />
gdispClear(White);<br />
<br />
// Attach the mouse input<br />
gwinAttachMouse(0);<br />
<br />
// create the widget<br />
createWidgets();<br />
<br />
// We want to listen for widget events<br />
geventListenerInit(&gl);<br />
gwinAttachListener(&gl);<br />
<br />
while(1) {<br />
// Get an Event<br />
pe = geventEventWait(&gl, TIME_INFINITE);<br />
<br />
switch(pe->type) {<br />
case GEVENT_GWIN_BUTTON:<br />
if (((GEventGWinButton*)pe)->button == ghButton1) {<br />
// Our button has been pressed<br />
printf("Button clicked\r\n");<br />
}<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
<br />
[[Category:Widget]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Console&diff=655
Console
2014-08-16T05:34:05Z
<p>Inmarket: /* Float */</p>
<hr />
<div>The console widget is a rectangular window with a fore- and background color. The widget does currently not accept any input and can only output text using <code>gwinPrintf()</code>. The widget is capable of handling line breaks when the text reaches the end of the window and it can also handle text scrolling when you insert new lines at the bottom when the window is already filled.<br />
<br />
== Scrolling ==<br />
The console widget can scroll text upwards if a new line is inserted at the bottom when the window is already filled. This feature can be enabled by setting the <code>GDISP_NEED_SCROLL</code> macro to ''TRUE'' in your [[gfxconf.h]]. If this feature is not enabled, the console will simply clear itself and begin to write at the top again once the window is full.<br />
Note that some display controllers are not capable of scrolling (they don't natively support scrolling and there is no pixel read-back capability). For these display's setting <code>GDISP_NEED_SCROLL</code> will result in a compile error.<br />
<br />
== Float ==<br />
The console is capable of printing float values through <code>gwinPrintf()</code> when <code>GWIN_CONSOLE_USE_FLOAT</code> is set to ''TRUE'' in your [[gfxconf.h]]. Note float operations may be slow if your CPU does not support floating arithmetic.<br />
<br />
== History ==<br />
In its bare state, the console does not keep track of its content. This means that making the console invisible using <code>gwinSetVisible()</code> will lose all the content that has previously written to it - it will simply be empty once it becomes visible again. Everything that gets written to the console during the invisible state is also lost.<br />
To enable the history feature which prevents this behavior, set <code>GWIN_CONSOLE_USE_HISTORY</code> to ''TRUE'' in your [[gfxconf.h]]. The API call <code>gwinConsoleSetBuffer()</code> is now available to enable or disable the history at any time. The console will automatically allocate the required buffer depending on it's window size. Once the history is disabled again, the buffer will be deallocated.<br />
<br />
Alternatively, you can also set <code>GWIN_CONSOLE_HISTORY_ATCREATE</code> to ''TRUE''. Every console widget will then automatically turn on the history feature when it's being created.<br />
<br />
== Buffer size ==<br />
The buffer size will be automatically allocated by the console widget once <code>gwinConsoleSetBuffer()</code> is being called to enable the history. It's crucial to get the correct buffer size (enough to hold the correct content but not too much in order to save memory) to prevent false behavior. Therefore, it's not possible to submit a customs sized buffer.<br />
<br />
<br />
== Escape sequences ==<br />
One major problem that comes with the history buffer is that the font color does not get stored. As we have to use as little RAM as possible, we cannot add a color attribute to each character. Setting a color per line would also be a very limiting feature. To workaround the problem, escape sequences have been introduced to the console widget. These capabilities can be enabled by setting <code>GWIN_CONSOLE_ESCSEQ</code> to ''TRUE''. There are escape sequences to control the color and the format of the text:<br />
<br />
{| class="wikitable"<br />
! scope="col"|Escape<br />
! scope="col"|Description"<br />
|-<br />
|ESC color <br />
|Change subsequent text color <br/>color: 0 = black, 1 = red, 2 = green, 3 = yellow, 4 = blue, 5 = magenta, 6 = cyan, 7 = white<br />
|-<br />
|ESC C<br />
|Revert subsequent text color to the window default<br />
|-<br />
|ESC u<br />
|Turn on underline<br />
|-<br />
|ESC U<br />
|Turn off underline<br />
|-<br />
|ESC b<br />
|Turn on bold<br />
|-<br />
|ESC B<br />
|Turn off bold<br />
|-<br />
|ESC J<br />
|Clear the window <br />
|-<br />
|}<br />
An escape sequence is introduced by '''\033'''. Please refer to the example below to see how to use the escape sequences properly.<br />
<br />
== API reference ==<br />
The API reference of the console window can be found [http://ugfx.org/images/resources/doxygen/master/group___console.html here].<br />
<br />
== Example ==<br />
The following example creates three individual console windows and outputs text to them. It also takes usage of the escape sequences.<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
/* The handles for three consoles */<br />
GHandle GW1, GW2, GW3;<br />
<br />
int main(void) {<br />
uint8_t i;<br />
font_t font1, font2;<br />
<br />
/* initialize and clear the display */<br />
gfxInit();<br />
<br />
/* Set some fonts */<br />
font1 = gdispOpenFont("UI2");<br />
font2 = gdispOpenFont("DejaVu Sans 12");<br />
gwinSetDefaultFont(font1);<br />
<br />
/* create the three console windows */<br />
{<br />
GWindowInit wi;<br />
<br />
wi.show = TRUE;<br />
wi.x = 0; wi.y = 0; wi.width = gdispGetWidth(); wi.height = gdispGetHeight()/2;<br />
GW1 = gwinConsoleCreate(0, &wi);<br />
wi.y = gdispGetHeight()/2; wi.width = gdispGetWidth()/2; wi.height = gdispGetHeight();<br />
GW2 = gwinConsoleCreate(0, &wi);<br />
wi.x = gdispGetWidth()/2; wi.height = gdispGetHeight();<br />
GW3 = gwinConsoleCreate(0, &wi);<br />
}<br />
<br />
/* Use a special font for GW1 */<br />
gwinSetFont(GW1, font2);<br />
<br />
/* Set the fore- and background colors for each console */<br />
gwinSetColor(GW1, Green);<br />
gwinSetBgColor(GW1, Black);<br />
gwinSetColor(GW2, White);<br />
gwinSetBgColor(GW2, Blue);<br />
gwinSetColor(GW3, Black);<br />
gwinSetBgColor(GW3, Red);<br />
<br />
/* clear all console windows - to set background */<br />
gwinClear(GW1);<br />
gwinClear(GW2);<br />
gwinClear(GW3);<br />
<br />
/* Output some data on the first console */<br />
for(i = 0; i < 10; i++) {<br />
gwinPrintf(GW1, "Hello \033buGFX\033B!\r\n");<br />
}<br />
<br />
/* Output some data on the second console */<br />
for(i = 0; i < 16; i++) {<br />
gwinPrintf(GW2, "Message Nr.: \0331\033b%d\033B\033C\r\n", i+1);<br />
}<br />
<br />
/* Output some data on the third console */<br />
for(i = 0; i < 18; i++) {<br />
gwinPrintf(GW3, "Message Nr.: \033u%d\033U\r\n", i+1);<br />
}<br />
<br />
while(TRUE) {<br />
gfxSleepMilliseconds(500);<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
The result of the program looks like this:<br />
<br />
<br />
<br />
[[Category:Window]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=Console&diff=654
Console
2014-08-16T05:32:38Z
<p>Inmarket: /* Scrolling */</p>
<hr />
<div>The console widget is a rectangular window with a fore- and background color. The widget does currently not accept any input and can only output text using <code>gwinPrintf()</code>. The widget is capable of handling line breaks when the text reaches the end of the window and it can also handle text scrolling when you insert new lines at the bottom when the window is already filled.<br />
<br />
== Scrolling ==<br />
The console widget can scroll text upwards if a new line is inserted at the bottom when the window is already filled. This feature can be enabled by setting the <code>GDISP_NEED_SCROLL</code> macro to ''TRUE'' in your [[gfxconf.h]]. If this feature is not enabled, the console will simply clear itself and begin to write at the top again once the window is full.<br />
Note that some display controllers are not capable of scrolling (they don't natively support scrolling and there is no pixel read-back capability). For these display's setting <code>GDISP_NEED_SCROLL</code> will result in a compile error.<br />
<br />
== Float ==<br />
The console is capable of printing float values through <code>gwinPrintf()</code> when <code>GWIN_CONSOLE_USE_FLOAT</code> is set to ''TRUE'' in your [[gfxconf.h]]. Note that this feature requires a lot of memory and CPU time.<br />
<br />
== History ==<br />
In its bare state, the console does not keep track of its content. This means that making the console invisible using <code>gwinSetVisible()</code> will lose all the content that has previously written to it - it will simply be empty once it becomes visible again. Everything that gets written to the console during the invisible state is also lost.<br />
To enable the history feature which prevents this behavior, set <code>GWIN_CONSOLE_USE_HISTORY</code> to ''TRUE'' in your [[gfxconf.h]]. The API call <code>gwinConsoleSetBuffer()</code> is now available to enable or disable the history at any time. The console will automatically allocate the required buffer depending on it's window size. Once the history is disabled again, the buffer will be deallocated.<br />
<br />
Alternatively, you can also set <code>GWIN_CONSOLE_HISTORY_ATCREATE</code> to ''TRUE''. Every console widget will then automatically turn on the history feature when it's being created.<br />
<br />
== Buffer size ==<br />
The buffer size will be automatically allocated by the console widget once <code>gwinConsoleSetBuffer()</code> is being called to enable the history. It's crucial to get the correct buffer size (enough to hold the correct content but not too much in order to save memory) to prevent false behavior. Therefore, it's not possible to submit a customs sized buffer.<br />
<br />
<br />
== Escape sequences ==<br />
One major problem that comes with the history buffer is that the font color does not get stored. As we have to use as little RAM as possible, we cannot add a color attribute to each character. Setting a color per line would also be a very limiting feature. To workaround the problem, escape sequences have been introduced to the console widget. These capabilities can be enabled by setting <code>GWIN_CONSOLE_ESCSEQ</code> to ''TRUE''. There are escape sequences to control the color and the format of the text:<br />
<br />
{| class="wikitable"<br />
! scope="col"|Escape<br />
! scope="col"|Description"<br />
|-<br />
|ESC color <br />
|Change subsequent text color <br/>color: 0 = black, 1 = red, 2 = green, 3 = yellow, 4 = blue, 5 = magenta, 6 = cyan, 7 = white<br />
|-<br />
|ESC C<br />
|Revert subsequent text color to the window default<br />
|-<br />
|ESC u<br />
|Turn on underline<br />
|-<br />
|ESC U<br />
|Turn off underline<br />
|-<br />
|ESC b<br />
|Turn on bold<br />
|-<br />
|ESC B<br />
|Turn off bold<br />
|-<br />
|ESC J<br />
|Clear the window <br />
|-<br />
|}<br />
An escape sequence is introduced by '''\033'''. Please refer to the example below to see how to use the escape sequences properly.<br />
<br />
== API reference ==<br />
The API reference of the console window can be found [http://ugfx.org/images/resources/doxygen/master/group___console.html here].<br />
<br />
== Example ==<br />
The following example creates three individual console windows and outputs text to them. It also takes usage of the escape sequences.<br />
<syntaxhighlight lang=c><br />
#include "gfx.h"<br />
<br />
/* The handles for three consoles */<br />
GHandle GW1, GW2, GW3;<br />
<br />
int main(void) {<br />
uint8_t i;<br />
font_t font1, font2;<br />
<br />
/* initialize and clear the display */<br />
gfxInit();<br />
<br />
/* Set some fonts */<br />
font1 = gdispOpenFont("UI2");<br />
font2 = gdispOpenFont("DejaVu Sans 12");<br />
gwinSetDefaultFont(font1);<br />
<br />
/* create the three console windows */<br />
{<br />
GWindowInit wi;<br />
<br />
wi.show = TRUE;<br />
wi.x = 0; wi.y = 0; wi.width = gdispGetWidth(); wi.height = gdispGetHeight()/2;<br />
GW1 = gwinConsoleCreate(0, &wi);<br />
wi.y = gdispGetHeight()/2; wi.width = gdispGetWidth()/2; wi.height = gdispGetHeight();<br />
GW2 = gwinConsoleCreate(0, &wi);<br />
wi.x = gdispGetWidth()/2; wi.height = gdispGetHeight();<br />
GW3 = gwinConsoleCreate(0, &wi);<br />
}<br />
<br />
/* Use a special font for GW1 */<br />
gwinSetFont(GW1, font2);<br />
<br />
/* Set the fore- and background colors for each console */<br />
gwinSetColor(GW1, Green);<br />
gwinSetBgColor(GW1, Black);<br />
gwinSetColor(GW2, White);<br />
gwinSetBgColor(GW2, Blue);<br />
gwinSetColor(GW3, Black);<br />
gwinSetBgColor(GW3, Red);<br />
<br />
/* clear all console windows - to set background */<br />
gwinClear(GW1);<br />
gwinClear(GW2);<br />
gwinClear(GW3);<br />
<br />
/* Output some data on the first console */<br />
for(i = 0; i < 10; i++) {<br />
gwinPrintf(GW1, "Hello \033buGFX\033B!\r\n");<br />
}<br />
<br />
/* Output some data on the second console */<br />
for(i = 0; i < 16; i++) {<br />
gwinPrintf(GW2, "Message Nr.: \0331\033b%d\033B\033C\r\n", i+1);<br />
}<br />
<br />
/* Output some data on the third console */<br />
for(i = 0; i < 18; i++) {<br />
gwinPrintf(GW3, "Message Nr.: \033u%d\033U\r\n", i+1);<br />
}<br />
<br />
while(TRUE) {<br />
gfxSleepMilliseconds(500);<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
The result of the program looks like this:<br />
<br />
<br />
<br />
[[Category:Window]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=GFILE&diff=653
GFILE
2014-08-16T05:20:57Z
<p>Inmarket: /* File system descriptor */</p>
<hr />
<div>The GFILE module provides an operating system independent way of reading and writing files no matter whether they are stored in RAM, FLASH, an SD-Card or the host operating systems native file system. Optionally, GFILE also provides an [http://en.wikipedia.org/wiki/C_file_input/output stdio] emulation layer so that existing applications can be ported to an embedded target much more easily.<br />
<br />
A ROM file system is also available enabling files to be compiled directly into the program code as a direct replacement (or as well as) the operating systems native file I/O sub-system. This is ideal for operating systems that don't have a native file system (i.e. most RTOSes).<br />
<br />
== API reference ==<br />
The API reference of the GFILE module can be found [http://ugfx.org/images/resources/doxygen/master/group___g_f_i_l_e.html here].<br />
<br />
== File handling ==<br />
The following set of functions is available as soon as the GFILE module has been enabled:<br />
<syntaxhighlight lang=c><br />
bool_t gfileExists(const char *fname);<br />
bool_t gfileDelete(const char *fname);<br />
long int gfileGetFilesize(const char *fname);<br />
bool_t gfileRename(const char *oldname, const char *newname);<br />
GFILE* gfileOpen(const char *fname, const char *mode);<br />
void gfileClose(GFILE *f);<br />
size_t gfileRead(GFILE *f, void *buf, size_t len);<br />
size_t gfileWrite(GFILE *f, const void *buf, size_t len);<br />
long int gfileGetPos(GFILE *f);<br />
bool_t gfileSetPos(GFILE *f, long int pos);<br />
long int gfileGetSize(GFILE *f);<br />
bool_t gfileEOF(GFILE *f);<br />
bool_t gfileMount(char fs, const char *drive);<br />
bool_t gfileUnmount(char fs, const char *drive);<br />
bool_t gfileSync(GFILE *f);<br />
</syntaxhighlight><br />
<br />
== File systems ==<br />
Many different file systems can be used with GFILE:<br />
* [[FATFS]] - uses the FatFS file system library for FAT file systems<br />
* [[PETITFS]] - uses the PetitFS file system library for FAT file systems<br />
* [[NATIVEFS]] - The native operating system file system<br />
* [[ROMFS]] - A file system that stores files in the code itself (usually in ROM/FLASH)<br />
* [[MEMFS]] - A virtual file for accessing memory pointers as if they were files<br />
* [[CHIBIOSFS]] - A virtual file for accessing ChibiOS BaseFileStream files (Not fully tested)<br />
* [[RAMFS]] - A temporary file system using <code>gfxAlloc()</code> (Not implemented yet)<br />
<br />
== Multiple file systems ==<br />
GFILE supports using more than one file system at once. When searching for a file, the file systems are scanned one after another. This feature is very handy when creating demo programs or using a different target system when developing your application as the application code does not need to be modified even if the underlying file system changes.<br />
<br />
It's also possible to specify from which file system you want the file to come from by using '''N|''' as a prefix for your file name where ''N'' is the file system descriptor if you set <code>GFILE_ALLOW_DEVICESPECIFIC</code> to ''TRUE'' in your [[gfxconf.h]].<br />
<br />
== File system descriptor ==<br />
Each file system has it's own descriptor:<br />
<br />
{| class="wikitable"<br />
! scope="col"|File system<br />
! scope="col"|Description<br />
|-<br />
|ROMFS<br />
|S<br />
|-<br />
|RAMFS<br />
|R<br />
|-<br />
|FATFS/PETITFS<br />
|F<br />
|-<br />
|NATIVEFS<br />
|N<br />
|}<br />
It is possible to have more than just one file system of the same type. For example, you can have more than just one SD card in your system. This capability is handled by the actual file system. In case of FatFS, one would be provided with different partition letters (just like in DOS).<br />
<br />
== String manipulation & printing ==<br />
GFILE provides a rich set of functions to manipulate strings and print data equivalent to the standard C functions <code>printf()</code>, <code>scanf()</code>, <code>sprintf()</code> etc.<br />
<syntaxhighlight lang=c><br />
#if GFILE_NEED_PRINTG<br />
int vfnprintg(GFILE *f, int maxlen, const char *fmt, va_list arg);<br />
int fnprintg(GFILE *f, int maxlen, const char *fmt, ...);<br />
#define vfprintg(f,m,a) vfnprintg(f,0,m,a)<br />
#define fprintg(f,m,...) fnprintg(f,0,m,...)<br />
#define vprintg(m,a) vfnprintg(gfileStdOut,0,m,a)<br />
#define printg(m,...) fnprintg(gfileStdOut,0,m,...)<br />
<br />
#if GFILE_NEED_STRINGS<br />
int vsnprintg(char *buf, int maxlen, const char *fmt, va_list arg);<br />
int snprintg(char *buf, int maxlen, const char *fmt, ...);<br />
#define vsprintg(s,m,a) vsnprintg(s,0,m,a)<br />
#define sprintg(s,m,...) snprintg(s,0,m,...)<br />
#endif<br />
#endif<br />
<br />
#if GFILE_NEED_SCANG<br />
int vfscang(GFILE *f, const char *fmt, va_list arg);<br />
int fscang(GFILE *f, const char *fmt, ...);<br />
#define vscang(f,a) vfscang(gfileStdIn,f,a)<br />
#define scang(f,...) fscang(gfileStdIn,f,...)<br />
<br />
#if GFILE_NEED_STRINGS<br />
int vsscang(const char *buf, const char *fmt, va_list arg);<br />
int sscang(const char *buf, const char *fmt, ...);<br />
#endif<br />
#endif<br />
</syntaxhighlight><br />
Float support is available when <code>GFILE_ALLOW_FLOATS</code> is set to ''TRUE'' in your [[gfxconf.h]].<br />
<br />
== STDIO emulation ==<br />
The optional [http://en.wikipedia.org/wiki/C_file_input/output stdio] emulation can be activated by setting <code>GFILE_NEED_STDIO</code> to ''TRUE'' in your [[gfxconf.h]]. A large set of stdio functions are then available. <br />
<br />
'''''Note:''' The standard C include file stdio.h should not be included when using STDIO emulation as ''gfx.h'' provides the necessary definitions which may be slightly different to the definitions in stdio.<br />
<br />
<br />
<br />
[[Category:Module]]</div>
Inmarket
https://wiki.ugfx.io/index.php?title=GFILE&diff=652
GFILE
2014-08-16T05:20:32Z
<p>Inmarket: /* File system descriptor */</p>
<hr />
<div>The GFILE module provides an operating system independent way of reading and writing files no matter whether they are stored in RAM, FLASH, an SD-Card or the host operating systems native file system. Optionally, GFILE also provides an [http://en.wikipedia.org/wiki/C_file_input/output stdio] emulation layer so that existing applications can be ported to an embedded target much more easily.<br />
<br />
A ROM file system is also available enabling files to be compiled directly into the program code as a direct replacement (or as well as) the operating systems native file I/O sub-system. This is ideal for operating systems that don't have a native file system (i.e. most RTOSes).<br />
<br />
== API reference ==<br />
The API reference of the GFILE module can be found [http://ugfx.org/images/resources/doxygen/master/group___g_f_i_l_e.html here].<br />
<br />
== File handling ==<br />
The following set of functions is available as soon as the GFILE module has been enabled:<br />
<syntaxhighlight lang=c><br />
bool_t gfileExists(const char *fname);<br />
bool_t gfileDelete(const char *fname);<br />
long int gfileGetFilesize(const char *fname);<br />
bool_t gfileRename(const char *oldname, const char *newname);<br />
GFILE* gfileOpen(const char *fname, const char *mode);<br />
void gfileClose(GFILE *f);<br />
size_t gfileRead(GFILE *f, void *buf, size_t len);<br />
size_t gfileWrite(GFILE *f, const void *buf, size_t len);<br />
long int gfileGetPos(GFILE *f);<br />
bool_t gfileSetPos(GFILE *f, long int pos);<br />
long int gfileGetSize(GFILE *f);<br />
bool_t gfileEOF(GFILE *f);<br />
bool_t gfileMount(char fs, const char *drive);<br />
bool_t gfileUnmount(char fs, const char *drive);<br />
bool_t gfileSync(GFILE *f);<br />
</syntaxhighlight><br />
<br />
== File systems ==<br />
Many different file systems can be used with GFILE:<br />
* [[FATFS]] - uses the FatFS file system library for FAT file systems<br />
* [[PETITFS]] - uses the PetitFS file system library for FAT file systems<br />
* [[NATIVEFS]] - The native operating system file system<br />
* [[ROMFS]] - A file system that stores files in the code itself (usually in ROM/FLASH)<br />
* [[MEMFS]] - A virtual file for accessing memory pointers as if they were files<br />
* [[CHIBIOSFS]] - A virtual file for accessing ChibiOS BaseFileStream files (Not fully tested)<br />
* [[RAMFS]] - A temporary file system using <code>gfxAlloc()</code> (Not implemented yet)<br />
<br />
== Multiple file systems ==<br />
GFILE supports using more than one file system at once. When searching for a file, the file systems are scanned one after another. This feature is very handy when creating demo programs or using a different target system when developing your application as the application code does not need to be modified even if the underlying file system changes.<br />
<br />
It's also possible to specify from which file system you want the file to come from by using '''N|''' as a prefix for your file name where ''N'' is the file system descriptor if you set <code>GFILE_ALLOW_DEVICESPECIFIC</code> to ''TRUE'' in your [[gfxconf.h]].<br />
<br />
== File system descriptor ==<br />
Each file system has it's own descriptor:<br />
<br />
{| class="wikitable"<br />
! scope="col"|File system<br />
! scope="col"|Description<br />
|-<br />
|ROMFS/PETITFS<br />
|S<br />
|-<br />
|RAMFS<br />
|R<br />
|-<br />
|FATFS<br />
|F<br />
|-<br />
|NATIVEFS<br />
|N<br />
|}<br />
It is possible to have more than just one file system of the same type. For example, you can have more than just one SD card in your system. This capability is handled by the actual file system. In case of FatFS, one would be provided with different partition letters (just like in DOS).<br />
<br />
== String manipulation & printing ==<br />
GFILE provides a rich set of functions to manipulate strings and print data equivalent to the standard C functions <code>printf()</code>, <code>scanf()</code>, <code>sprintf()</code> etc.<br />
<syntaxhighlight lang=c><br />
#if GFILE_NEED_PRINTG<br />
int vfnprintg(GFILE *f, int maxlen, const char *fmt, va_list arg);<br />
int fnprintg(GFILE *f, int maxlen, const char *fmt, ...);<br />
#define vfprintg(f,m,a) vfnprintg(f,0,m,a)<br />
#define fprintg(f,m,...) fnprintg(f,0,m,...)<br />
#define vprintg(m,a) vfnprintg(gfileStdOut,0,m,a)<br />
#define printg(m,...) fnprintg(gfileStdOut,0,m,...)<br />
<br />
#if GFILE_NEED_STRINGS<br />
int vsnprintg(char *buf, int maxlen, const char *fmt, va_list arg);<br />
int snprintg(char *buf, int maxlen, const char *fmt, ...);<br />
#define vsprintg(s,m,a) vsnprintg(s,0,m,a)<br />
#define sprintg(s,m,...) snprintg(s,0,m,...)<br />
#endif<br />
#endif<br />
<br />
#if GFILE_NEED_SCANG<br />
int vfscang(GFILE *f, const char *fmt, va_list arg);<br />
int fscang(GFILE *f, const char *fmt, ...);<br />
#define vscang(f,a) vfscang(gfileStdIn,f,a)<br />
#define scang(f,...) fscang(gfileStdIn,f,...)<br />
<br />
#if GFILE_NEED_STRINGS<br />
int vsscang(const char *buf, const char *fmt, va_list arg);<br />
int sscang(const char *buf, const char *fmt, ...);<br />
#endif<br />
#endif<br />
</syntaxhighlight><br />
Float support is available when <code>GFILE_ALLOW_FLOATS</code> is set to ''TRUE'' in your [[gfxconf.h]].<br />
<br />
== STDIO emulation ==<br />
The optional [http://en.wikipedia.org/wiki/C_file_input/output stdio] emulation can be activated by setting <code>GFILE_NEED_STDIO</code> to ''TRUE'' in your [[gfxconf.h]]. A large set of stdio functions are then available. <br />
<br />
'''''Note:''' The standard C include file stdio.h should not be included when using STDIO emulation as ''gfx.h'' provides the necessary definitions which may be slightly different to the definitions in stdio.<br />
<br />
<br />
<br />
[[Category:Module]]</div>
Inmarket