lc-soft / lcui Goto Github PK
View Code? Open in Web Editor NEWA small C library for building user interfaces with C, XML and CSS.
Home Page: https://lcui.org
License: MIT License
A small C library for building user interfaces with C, XML and CSS.
Home Page: https://lcui.org
License: MIT License
一张样式表的固定内存占用大约为1000字节,而通常实际数据只占其中的一小部分,有些浪费,可考虑改用 Dict 结构存储。
Would you like to replace more defines for constant values by enumerations to stress their relationships?
正常情况下,在修改几个部件的样式后应该会在一两帧内得到应用,然而实际测试发现有时会需要近1秒的时间才应用新样式,能感到明显的延迟现象。
设置 20 ms 间隔循环调用的定时器,使用过程中会间断性的出现延迟问题,延迟时间 300ms 到 1000ms 不等。
Would you like to add the configuration script "AX_PTHREAD" to your build specification?
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中载入,可以支持所有功能。
脚本语言优势:
恩,有兴趣可以去看看:www.lua.org
#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(); /* 进入主循环 */
}
当部件添加新样式类然后删除该样式类时,部件已计算的样式依然是拥有样式类时的样式,因为移除样式类后,部件样式表里的一些样式属性已经失效,而计算样式时会忽略这些无效的样式属性,导致部分样式在计算后并未刷新。
There is #include "afxres.h"
in LCUI.rc
, which fails to build in VS without MFC installed. Is it intended?
修改之前的圆角边框绘制代码以使其能够正常绘制。
使用 rgba(255,255,255,0.4) 这类值时,textview 上绘制的文本颜色并没有变化,但设置成 #fff 这类颜色时又有效果。
Graphical output in 16-bit color screen is not normal
使用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看来没有被正式支持,不过还是暴露出一些可移植性问题。
The currently used image scaling algorithm is nearest neighbor interpolation, and the scaled image is jagged and needs improvement.
I have seen that no loop is used around a call of the function "LCUICond_Wait".
Would you like to reuse anything from my message on the topic "spurious wakeup"?
I would like to point out that an identifier like "__LCUI_WIDGET_EVENT_H__
" does not fit to the expected naming convention of the C++ language standard.
Would you like to adjust your selection for unique names?
在解析 border 属性值时,由于边框色是 transparent,被判定为无效的颜色,导致整个 border 属性值无效。
如题,在LCUI初始化时检测触摸屏并启用触摸屏支持后,程序出现段错误后终止。
当部件数量达到上万级别的时候排序操作会非常耗时,在当前版本中,每个部件都会排序一次,排序算法为插入排序,一万个部件会排序一万次,而每次排序都要遍历一次部件列表,总计遍历一亿次。
参考 css 的 linear-gradient(),只需实现最基本的从左至右、从上到下的颜色渐变绘制。
github中的代码编译不了,代码不全?第一个错误是LCUI_ScreenInfo没定义,搜索了所有文件都没有该定义
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.
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.
在 Ubuntu 系统下,NotoSansCJK.ttc 字体包含了 Thin、Regular、Bold、Italic、Bold Italic 等风格,然而载入字体文件时只默认选择了 Thin 风格,没选择 Regular 风格。
Problem
Expected effect
IssueHunt has been backed by the following sponsors. Become a sponsor
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.
这是 LCFinder 的测试结果,向部件里追加子部件时的速度感觉很慢,按理来说1000多个部件应该在几毫秒以内追加完才对,然而过了几十秒都没追加完。。。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.