Coder Social home page Coder Social logo

ugui's People

Contributors

achimdoebler avatar sermus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ugui's Issues

Font HSpace & VSpace not applicable to BTNS, CHBX

For example correct buttons, need correct code from this place:
7120: txt.h_space = 2;
7121: txt.v_space = 2;
to
7120: txt.h_space = btn->h_space;
7121: txt.v_space = btn->v_space;
e.g. for CheckBoxes

ugui with arduino/teensy

Hello, I try to implemente ugui with arduino/teensy 3.2, but unfortunately if I implement in the sketch #include "ugui.c" I get follow error:

invalid conversion from 'void*' to 'void ()(UG_COLOR) {aka void ()(long unsigned int)}' [-fpermissive]

?? whats wrong?

UG_Init documentation?

Seems that the UG_Init isn't documented. Given that nothing works without it, this seems like a critical oversight. Not hard to figure out from the source, but it 's still sort of a pain.

how to create font with monochrome oled

hi all ,
how to create font for monochrome ?

UGUI default for the RGB888/565 lcd.
so how to add font for the monochrome lcd(like ssd1306)

void _UG_PutChar( char chr, UG_S16 x, UG_S16 y, UG_COLOR fc, UG_COLOR bc, const UG_FONT* font)

HW:
SSD1306 monochrome

ugui_config.h
#ifndef __UGUI_CONFIG_H
#define __UGUI_CONFIG_H

/* -------------------------------------------------------------------------------- /
/
-- CONFIG SECTION -- /
/
-------------------------------------------------------------------------------- */

//#define USE_MULTITASKING

/* Enable color mode /
//#define USE_COLOR_RGB888 // RGB = 0xFF,0xFF,0xFF
//#define USE_COLOR_RGB565 // RGB = 0bRRRRRGGGGGGBBBBB
#define USE_COLOR_NONE //monochrome
/
Enable needed fonts here */
#define USE_FONT_4X6
//#define USE_FONT_5X8
//#define USE_FONT_5X12
//#define USE_FONT_6X8
//#define USE_FONT_6X10
//#define USE_FONT_7X12
//#define USE_FONT_8X8
//#define USE_FONT_8X12_CYRILLIC
//#define USE_FONT_8X12
//#define USE_FONT_8X12
//#define USE_FONT_8X14
//#define USE_FONT_10X16
//#define USE_FONT_12X16
//#define USE_FONT_12X20
//#define USE_FONT_16X26
//#define USE_FONT_22X36
//#define USE_FONT_24X40
//#define USE_FONT_32X53

/* Specify platform-dependent integer types here */

#define __UG_FONT_DATA const
typedef uint8_t UG_U8;
typedef int8_t UG_S8;
typedef uint16_t UG_U16;
typedef int16_t UG_S16;
typedef uint32_t UG_U32;
typedef int32_t UG_S32;

/* Example for dsPIC33
typedef unsigned char UG_U8;
typedef signed char UG_S8;
typedef unsigned int UG_U16;
typedef signed int UG_S16;
typedef unsigned long int UG_U32;
typedef signed long int UG_S32;
*/

/* -------------------------------------------------------------------------------- /
/
-------------------------------------------------------------------------------- */

/* Feature enablers */
#define USE_PRERENDER_EVENT
#define USE_POSTRENDER_EVENT

#define LCD_WIDTH_PIXELS 128
#define LCD_HEIGHT_PIXELS 64
#endif

Font kerning support

Hi

Am I right that UG does not support font kerning? The thing where an I is smaller then an O. Does every letter uses the same width?

Is there some pre-work since I'm very likely going to implement that.

Arduino Compile Issue

Hi,
Following is my code on Arduino IDE using ATMEGA2560 Board.
`#include <SPI.h>
#include "ugui.h"
#include "ugui_config.h"

#define DISPLAY_WIDTH 160
#define DISPLAY_HEIGHT 128

#define MAX_OBJECTS 10
#define BuffOUT 40

char bufferOut[BuffOUT];
void window_1_callback(UG_MESSAGE *msg);
UG_GUI gui1963;
UG_COLOR color[3];

void my_int_func(UG_S16 x,UG_S16 y,UG_COLOR z)
{
unsigned int sum=0;
sum=x+y+z;
}

void setup()
{
void (*foo)(UG_S16,UG_S16,UG_COLOR);
foo = &my_int_func;

UG_Init(&gui1963, foo(2,2,3), 160, 128); 

UG_COLOR color[3];        
UG_WINDOW window_1;
UG_BUTTON button_1;
UG_BUTTON button_2;
UG_BUTTON button_3;
UG_TEXTBOX textbox_1;
UG_OBJECT obj_buff_wnd_1[MAX_OBJECTS];

UG_Init(&gui1963, foo(2,2,3), 160, 128);    

}

void loop()
{
// put your main code here, to run repeatedly:

}`

I encounter following error when compiling. Kindly provide an insight of whats going wrong?

testugui:27:43: error: invalid use of void expression

 UG_Init(&gui1963, foo(2,2,3), 160, 128);
                                       ^

testugui:37:43: error: invalid use of void expression

 UG_Init(&gui1963, foo(2,2,3), 160, 128);

Regards,

Invalid color conversion done in UG_DrawBMP for a BMP 565 format screen

In UG_DrawBMP(),
invalid color conversion done when BMP format is 565.

just before this line the color is set to 888 format, but that causes wrong colors to be displayed on a 565 format screen
https://github.com/achimdoebler/UGUI/blob/master/ugui.c#L5840

a possible fix:

         tmp = *p++;
         #ifdef USE_COLOR_RGB565
            UG_DrawPixel( xp++ , yp , tmp );
         #else
            /* Convert RGB565 to RGB888 */
            r = (tmp>>11)&0x1F;
            r<<=3;
            g = (tmp>>5)&0x3F;
            g<<=2;
            b = (tmp)&0x1F;
            b<<=3;
            c = ((UG_COLOR)r<<16) | ((UG_COLOR)g<<8) | (UG_COLOR)b;
            UG_DrawPixel( xp++ , yp , c );
         #endif

Window function is not working.

Hi guys,
I am working with ssd1963 display, with arm cortex m4. I have ported ugui for my display and test all the basics functions. They are working fine for me but when I am trying to create a window as per written in reference guide, it is no showing anything. Any help in this regards 'll be highly appreciable.
Thanks.

driver :DRIVER_FILL_AREA defined but don't know how to use it

Dear my friends:

In the code , there are the define of DRIVER_FILL_AREA, but there are no samples , how to write the porting code .
I tried some ,but faild
The uGUI has too many forks and too many changes.
Can anyone helps?
THANKS.
sorry for my pool english, hope you can get my point and Thanks for you time reading this. :)

v0.31 beta commit contains unmerged code

v0.31 beta commit contains changes from forked repositories. The proper way to include those changes would have been a merge/pull request. The corresponding changes need to be merged in for visibility in Git.

ugui.c : stack address is assigned to a non-local variable

In line 5650:

msg.src = &obj;

Instance where a stack address is assigned to a non-local variable. Storing the address of a local variable in non-local memory can cause a dangling pointer bug if the address is used after the function returns.

How to set grayscale or mono?

Dear:

The uGUi is really great project! it is powerful~!
When I use this I can't find the place to set it into grayscale or mono mode?
I think maybe there are missing ?
Thanks for your time and Thanks for your reply if there are.
:)

Inconsistent API UG_PutChar UG_PutString

UGUI/ugui.h

Lines 898 to 899 in ce0bccb

void UG_PutString( UG_S16 x, UG_S16 y, char* str );
void UG_PutChar( char chr, UG_S16 x, UG_S16 y, UG_COLOR fc, UG_COLOR bc );

UG_PutString, as with most other functions, has the location first, then the object, and also use the previously set colors.
UG_PutChar, on the other hand, has the object first, then the location, and then color information.
This makes for an inconsistent UI.

Add extern C to prevent name mangling

Without

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

at the beginning and later proper closing the library will not compile in C++ project.

Adafruit_GFX + Adafruit_ILI9341 + uGUI not work

Hello guys!

First of all many tanks to @achimdoebler , this is a very time saver library!

The only big problem (in my case) is that i'm trying to use it together with Arduino Adafruit_GFX and a modified version of Adafruit_ILI9341 libraries but, after compiling and uploading on my Arduino Uno with 2.4 tft lcd shield (8bit bus and 18bit colors) , what appears is a randomly colored pixels on the screen.

All examples on the Adafruit libraries work well so, i think i'm doing something wrong with the implementation of the uGUI lib.

My code is as following:
In my EXAMPLE i modified the ugui_config.h and i've included all relevant code in guitest.ino.
Then, in the UGUI.h file i replaced #include <system.h> with #include <Arduino.h>.

Someone has already tried to run the library with Arduino?
In that case you could post your implementation code?

Many thanks.

Inconsistent API

UGUI/ugui.h

Lines 898 to 899 in ce0bccb

void UG_PutString( UG_S16 x, UG_S16 y, char* str );
void UG_PutChar( char chr, UG_S16 x, UG_S16 y, UG_COLOR fc, UG_COLOR bc );

UG_PutString, as with most other functions, has the location first, then the object.
UG_PutChar, on the other hand, has the object first, then the location.
Additionally UG_PutChar sets the foreground&background colors, but UG_PutString does not have any color information. Other graphics primitives have only the foreground color.
This makes for an inconsistent UI.

HELP with pset function ST7529 driver with MSP430

hi i am planning on using the uGUI for the ST7529 driver using MSP430.
Can you please share the example for how to define the pset function ?

I have gone through the Manual PDF and also the ST7529 datasheet.

I am unable to understand how to define the PSET function.

If someone could help me on this, please.

how to rotate the display?

ugui works well right now ,but i can not rotate display .sometimes i need this feature, is there any way to achieve that goal?

ugui.c compiling errors?

Hello

I am desperate about follow errors:

I try to setup and compile ugui.c on the raspberry pi 3.
when I compile I always get errors like this:
//////compiling /////////////
gcc -Wall -pthread -o ugui ugui.c -lpigpio -lrt
//////ERROR //////////////
ugui.c: In function ‘_UG_PutChar’:
ugui.c:5343:65: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
color = (((fc & 0xFF) * b + (bc & 0xFF) * (256 – b)) >> 8) & 0xFF |//Blue component
^
ugui.c:5345:73: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
(((fc & 0xFF0000) * b + (bc & 0xFF0000) * (256 – b)) >> 8) & 0xFF0000; //Red component
^
ugui.c:5392:75: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
color = (((fc & 0xFF) * b + (bc & 0xFF) * (256 – b)) >> 8) & 0xFF |//Blue component
^
ugui.c:5394:83: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
(((fc & 0xFF0000) * b + (bc & 0xFF0000) * (256 – b)) >> 8) & 0xFF0000; //Red component
^
ugui.c: At top level:
ugui.c:8483:10: error: conflicting types for ‘gui’
UG_GUI gui;
^
ugui.c:79:16: note: previous declaration of ‘gui’ was here
static UG_GUI* gui;

//////////////////////////////////////////////////////////////
//programm-code
/////////////////////////////////////////////////////////////
My main and pset function in the ugui.c file (at the end):

void ST7775R_pset(UG_S16 x ,UG_S16 y,UG_COLOR c)
{
.....
....
}
UG_GUI gui;
int main(void)
{
.....
.....
initST7775R();

UG_Init(&gui, ST7775R_pset, 176, 220);
//UG_SelectGUI(&gui);
UG_Update();

while(1)
{	
color(248,0); //red
sleep(1);
color(7,224); //green
sleep(1);
color(0,31); //blue
sleep(1);
color(248,31); //violet
sleep(1);
color(121,239); //grau
sleep(1);
UG_FontSelect(&FONT_24X40);
UG_SetBackcolor(C_BLACK);
UG_SetForecolor(C_CYAN);
UG_PutString(0,0,"Hello World!");
UG_Update();
sleep(3);	
color(251,43); //rosa
sleep(1);
}

spiClose(h);
gpioTerminate();
return 0;
}

whats wrong???

Font improvement suggestion

I suggest we extend UG_FONT definition with two constants: offset and length. The reason is that if i needed an incomplete character set, for example just numbers, i wouldn't spend ROM space for keeping the rest of the characters. Offset and length means the font defines characters starting from ascii code "offset" and ending by "offset + length"

Multi-point Touch Support

Currently uGUI only has support for a single touch point, however certain dev boards with capacitive touch sensors (the STM32F7-Discovery, for example) have up to 5 or more points that may be activated simultaneously. While the simple solution is to just pass all 5 (or more/less) in one at a time, I think there is room for growth of uGUI in such a way that these multi-touch events could be used to add additional functionality. One such example is rotating a window, where two touch points could be used to adjust the rendering of the window to make it appear rotated, leading to a potentially improved experience and greater usefulness. Not strictly necessary, but something to consider I think.

Provide guide in text format

Hello,

Could you please provide the guide in a text format such as markdown, plain text, or on the github wiki?

When using the PDF it's not possible (at least on OS X) to copy any of the code examples since some character such as underlines appear to be missed for some reason... I've tried both the Chrome and Preview viewers but neither of them really works.

Thanks :)

Add simulation support on Linux

Hi,

I am plagued by that I have to flash the code into the MCU to check the result of GUI everytime.
So is there anyway or will there be a way like simulation on linux to solve this problem?
Thanks a lot!

Checkbox?

I can not find any info of checkbox. I look through wed, guild book and source commit. I just donot know what is the main point of checkbox ,and what is the function it will show to us?

a little suggesttion for us newbie.

A newbie who familer to android always think that callback function will be called when the button pressed ranthre than changed. So i suggest add a new conditional sentence in the callback function (in your demo).

ex: if ( msg->id == OBJ_TYPE_BUTTON && msg->event == OBJ_EVENT_PRESSED )

i spent whole two days to figure this future out. ~( ̄▽ ̄~)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.