GithubHelp home page GithubHelp logo

lc-soft / lcui Goto Github PK

View Code? Open in Web Editor NEW
4.1K 148.0 358.0 20.71 MB

A small C library for building user interfaces with C, XML and CSS.

Home Page: https://lcui.org

License: MIT License

Shell 0.21% C++ 4.35% C 90.31% CSS 0.70% Makefile 0.74% M4 2.11% CMake 0.32% HTML 1.25%
gui-framework c gui-toolkit cross-platform-gui windows uwp

lcui's People

Contributors

anshulxyz avatar arcticlampyrid avatar campbellowen avatar coderobe avatar dependabot[bot] avatar fakeguru avatar frankhb avatar gitter-badger avatar hyugabokko avatar jduo avatar lc-soft avatar maximelkin avatar michaellrowley avatar odknt avatar piamancini avatar reinforce-ii avatar timgates42 avatar toluschr avatar vbalyasnyy avatar whoatedacake 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

lcui's Issues

需减少样式表的内存占用

一张样式表的固定内存占用大约为1000字节,而通常实际数据只占其中的一小部分,有些浪费,可考虑改用 Dict 结构存储。

部件样式的更新有延迟现象

正常情况下,在修改几个部件的样式后应该会在一两帧内得到应用,然而实际测试发现有时会需要近1秒的时间才应用新样式,能感到明显的延迟现象。

An error occured when compiling a LCUI's sample on CentOS

I successfully compiled and installed LCUI library on CentOS 6.4 x86_64 (in the Oracle VirtualBox), but an error occured when compiling the "helloworld" sample (./test/helloworld.c).

LCUI version is the latest release: 0.15.

[root@bogon test]# gcc helloworld.c -l LCUI
/usr/local/lib/libLCUI.so: undefined reference to `clock_gettime'
collect2: ld 返回 1

GCC VERSION: 4.4.7

Thank you for the LCUI project and I wonder if you can help me.

有没有考虑过做脚本语言绑定?

恩,就是不知道你的学习机的速度能不能跑脚本……介绍一下Lua:

编译以后总大小140K左右,占运行内存大概400K左右,速度上,大概比C慢50倍左右。

如果你的学习机跑的是linux,可以将你的LCUI编译为Lua的一个so库,在Lua中载入,可以支持所有功能。

脚本语言优势:

  1. 快速开发:可以很快实现一个Demo,修改代码十分容易
  2. 编写简单:代码量比C/C++等静态语言少,写起来快
  3. 原型设计:很快能设计最终产品的一个原型
  4. 效率评估:脚本语言比C慢,很容易显示出效率瓶颈的位置,可以在该位置用C优化
  5. 架构评估:可以根据绑定时遇到的问题,判断架构本身是否良好。

恩,有兴趣可以去看看:www.lua.org

malloc(): memory corruption (fast): 0x00007f5efe9e1710

#include <LCUI_Build.h>
#include LC_LCUI_H
#include LC_WIDGET_H 
#include LC_WINDOW_H
#include LC_BUTTON_H

static void
destroy( LCUI_Widget *widget, LCUI_WidgetEvent *unused )
{
    LCUI_MainLoop_Quit(NULL);
}

int main(void) 
{
    LCUI_Widget *window, *button;

    setenv( "LCUI_FONTFILE", "/home/zhuzx/NetBeansProjects/CGUI/fonts/simfang.ttf", FALSE );
    LCUI_Init();
    window  = Widget_New("window");
    button  = Widget_New("button");

    /* 设定窗口标题的文本 */
    Window_SetTitleText(window, "测试按钮"); 
    /* 改变窗口的尺寸 */
    Widget_Resize( window, Size(320, 240) );
    /* 将窗口客户区作为按钮的容器添加进去 */
    Window_ClientArea_Add( window, button );
    /* 居中显示按钮 */
    Widget_SetAlign( button, ALIGN_MIDDLE_CENTER, Pos(0, 0) );
    /* 禁用部件的自动尺寸调整 */
    Widget_SetAutoSize( button, FALSE, 0 );
    /* 自定义按钮的尺寸 */
    Widget_Resize( button, Size(180, 70) );

    /* 设定按钮上显示的文本内容,和label部件的用法一样,支持样式标签 */
    Button_Text( button, 
        "<size=30px><color=255,0,0>彩</color>"
        "<color=0,255,0>色</color>"
        "<color=0,0,255>的</color>"
        "<color=255,255,0>按</color>"
        "<color=255,255,255>钮</color></size>");

    /* 显示部件 */
    Widget_Show( button );
    Widget_Show( window ); 
    Widget_Event_Connect( Window_GetCloseButton(window), EVENT_CLICKED, destroy );
    return LCUI_Main(); /* 进入主循环 */
}

需为部件补充缺省样式

当部件添加新样式类然后删除该样式类时,部件已计算的样式依然是拥有样式类时的样式,因为移除样式类后,部件样式表里的一些样式属性已经失效,而计算样式时会忽略这些无效的样式属性,导致部分样式在计算后并未刷新。

MFC dependency in .rc file

There is #include "afxres.h" in LCUI.rc, which fails to build in VS without MFC installed. Is it intended?

textview 不支持透明色

使用 rgba(255,255,255,0.4) 这类值时,textview 上绘制的文本颜色并没有变化,但设置成 #fff 这类颜色时又有效果。

x64转换警告

使用VC++ x64编译出现大量warning C4267:

warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据
warning C4267: “return”: 从“size_t”转换到“int”,可能丢失数据
warning C4267: “=”: 从“size_t”转换到“unsigned int”,可能丢失数据
warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据
warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据
warning C4267: “函数”: 从“size_t”转换到“int”,可能丢失数据
warning C4267: “=”: 从“size_t”转换到“uint_t”,可能丢失数据

虽然x64看来没有被正式支持,不过还是暴露出一些可移植性问题。

Improve bitmap scaling quality

The currently used image scaling algorithm is nearest neighbor interpolation, and the scaled image is jagged and needs improvement.

触屏的问题

如题,在LCUI初始化时检测触摸屏并启用触摸屏支持后,程序出现段错误后终止。

改进部件的排序

当部件数量达到上万级别的时候排序操作会非常耗时,在当前版本中,每个部件都会排序一次,排序算法为插入排序,一万个部件会排序一万次,而每次排序都要遍历一次部件列表,总计遍历一亿次。

编译不了

github中的代码编译不了,代码不全?第一个错误是LCUI_ScreenInfo没定义,搜索了所有文件都没有该定义

Error occurs when building LCUI on GNU/Linux

I'm trying to build LCUI on my Fedora box but make fails, here is the error message in short:

catch_screen.c: In function 'catch_screen':
catch_screen.c:79:3: error: incompatible type for argument 1 of 'LCUIScreen_CatchGraph'
   LCUIScreen_CatchGraph( area, &graph );

and here is the full ouput

➜  LCUI git:(master) ✗ ./configure
...
Build with tslib support ........... : yes
Build with libpng support .......... : yes
Build with libjpeg support ......... : yes
Build with libiconv support ........ : no
Build with font-engine support ..... : none
Build with thread support .......... : pthread
Build with video support ........... : framebuffer

➜  LCUI git:(master) ✗ make
Making all in src
make[1]: Entering directory `/home/xcy/workspace/LCUI/src'
Making all in bmp
make[2]: Entering directory `/home/xcy/workspace/LCUI/src/bmp'
  CC       bmp.lo
  CC       jpeg.lo
  CC       png.lo
png.c: In function 'Graph_WritePNG':
png.c:124:29: warning: variable 'pos' set but not used [-Wunused-but-set-variable]
         int x, y, row_size, pos;
                             ^
  CC       load_image.lo
  CCLD     libbmp.la
make[2]: Leaving directory `/home/xcy/workspace/LCUI/src/bmp'
Making all in misc
make[2]: Entering directory `/home/xcy/workspace/LCUI/src/misc'
  CC       catch_screen.lo
catch_screen.c: In function 'catch_screen':
catch_screen.c:79:3: error: incompatible type for argument 1 of 'LCUIScreen_CatchGraph'
   LCUIScreen_CatchGraph( area, &graph );
   ^
In file included from catch_screen.c:46:0:
/home/xcy/workspace/LCUI/include/LCUI/LCUI_Display.h:82:14: note: expected 'struct LCUI_Graph *' but argument is of type 'LCUI_Rect'
 LCUI_API int LCUIScreen_CatchGraph( LCUI_Graph *graph, LCUI_Rect rect );
              ^
catch_screen.c:79:3: error: incompatible type for argument 2 of 'LCUIScreen_CatchGraph'
   LCUIScreen_CatchGraph( area, &graph );
   ^
In file included from catch_screen.c:46:0:
/home/xcy/workspace/LCUI/include/LCUI/LCUI_Display.h:82:14: note: expected 'LCUI_Rect' but argument is of type 'struct LCUI_Graph *'
 LCUI_API int LCUIScreen_CatchGraph( LCUI_Graph *graph, LCUI_Rect rect );
              ^
make[2]: *** [catch_screen.lo] Error 1
make[2]: Leaving directory `/home/xcy/workspace/LCUI/src/misc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/xcy/workspace/LCUI/src'
make: *** [all-recursive] Error 1
➜  LCUI git:(master) ✗ uname -a                  
Linux fedora 3.14.7-200.fc20.x86_64 #1 SMP Wed Jun 11 22:38:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

If you want to know more details please let me know.

Possible name clash

According to ISO C11 7.31.6, macros that begin with LC_ and an uppercase letter may be used by the implementation. Though they are not explicitly reserved by ISO C(e.g. as identifiers containing double underscores), there are risks.
Furthermore, POSIX.1-2013 explicitly states that the names with prefix LC_[A-Z] are reserved once the header <locale.h> is included. That means if the client code uses both <locale.h> and LCUI, it could never be conforming to POSIX.

Improve input method support for windows [$20]

Issuehunt badges

Problem

  • The top left of the screen will display an input box.
  • The candidate box is positioned at the top left of the screen.

image

Expected effect

  • No additional controls will be displayed.
  • The candidate box should be positioned at the text caret, like this:

image


IssueHunt Summary

1354092549 1354092549 has been rewarded.

Backers (Total: $20.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

需更改链表的遍历方式

当前是直接使用 LinkedList_ForEach() 宏来遍历链表的,但在 VisualStudio 中会把它当成函数定义,导致它所在的函数无法被索引。

qq 20160813135755

Copying permission statement at the beginning of the files

Some files like LCUI_Font.h and LCUI_Input.h have redundant "\n" at the end of lines of copying permission statement. What is worse, they use horizontal tab to align, so the "\n" are often unaligned when the text editor configuration varies.
In some files like LCUI_InputMethod.h it is just missing.

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.