Support Mac
This commit is contained in:
parent
565ef43706
commit
9ab9571b3d
11
README.md
11
README.md
|
@ -3,15 +3,14 @@
|
|||
|
||||
超轻量UI框架 - GuiLite是由6千行左右的C/C++代码编写而成,它像MFC,QT一样为开发者提供界面支持。
|
||||
|
||||
- GuiLite可以嵌入到其他平台中,与Android、Linux、Windows、Mac、MFC、QT、 **VR** 、 **单片机** 一起玩耍,相互支持。开发者可以用GuiLite开发界面的跨平台部分,同时也充分使用MFC,QT,Android,Linux,Windows,Mac的界面特性,让自己的界面集百家之长,又不失个性!实现方法见GuiliteSamples/HostMonitor/BuildXXX。
|
||||
- GuiLite鼓励混合编程,开发者可以用C/C++编写的GuiLite接管UI部分,用Java,Go,C#,Python发开业务部分,让软件获得界面效率和开发效率的双提升!实现方法见GuiliteSamples/HostMonitor/BuildAndroid。
|
||||
|
||||
- GuiLite可以完美运行在Android,Windows(包含VR),Mac,**单片机**和**市面所有的 ARM Linux物联网终端**设备上。
|
||||
- GuiLite可以嵌入在MFC、QT、 Android等其他UI系统中。让你的界面集百家之长,又不失个性。
|
||||
- GuiLite鼓励混合编程,开发者可以用C/C++编写的GuiLite接管UI部分,用Java,Go,C#,Python发开业务部分。
|
||||
|
||||
相比其他强大的UI框架,GuiLite只聚焦界面开发(特别是手机风格的滑动界面),只使用最基础的C++特性,直达绘制底层。希望通过减少代码,调用层次,让UI框架的体积最小,效率更高,使之流畅运行在:手机,电脑,单片机等硬件环境上。
|
||||
|
||||
注意:
|
||||
- GuiLite作为框架,本身并不产生界面,界面的集成效果,请参考:[GuiLiteSamples代码库](https://github.com/idea4good/GuiLiteSamples)、[GuiLiteSamples视频](http://v.youku.com/v_show/id_XMzA5NTMzMTYyOA)
|
||||
- Mac的编译,请使用GuiLite在Github上的xmake分支
|
||||
GuiLite作为框架,本身并不产生界面,界面的集成效果,请参考:[GuiLiteSamples代码库](https://github.com/idea4good/GuiLiteSamples)、[GuiLiteSamples视频](http://v.youku.com/v_show/id_XMzA5NTMzMTYyOA)
|
||||
|
||||
## 为什么开发GuiLite?如何使用?
|
||||
任何UI框架都不是为你我而生的,只有掌握核心原理,对其深度定制,才能真正掌握自己的命运!因此,我们开发了GuiLite,希望用这6千行代码揭示UI的核心原理和定制方法。
|
||||
|
@ -60,4 +59,4 @@ surface层:
|
|||
该层属于display层的一个部分;它为左右滑动而存在,每一张滑动页面均对应了一个surface层;surface层决定了一个滑动页面的最终显示效果;通常1个display层会对应多个surface层。
|
||||
|
||||
frame层:
|
||||
该层属于surface层的一个部分;它现实叠加界面元素而存在,
|
||||
该层属于surface层的一个部分;它现实叠加界面元素而存在。
|
||||
|
|
|
@ -157,7 +157,7 @@ void start_real_timer(void (*func)(void* arg))
|
|||
|
||||
unsigned int get_cur_thread_id()
|
||||
{
|
||||
return pthread_self();
|
||||
return (unsigned long)pthread_self();
|
||||
}
|
||||
|
||||
void register_timer(int milli_second,void func(void* ptmr, void* parg))
|
||||
|
@ -203,7 +203,7 @@ T_TIME second_to_day(long second)
|
|||
|
||||
void create_thread(unsigned long* thread_id, void* attr, void *(*start_routine) (void *), void* arg)
|
||||
{
|
||||
pthread_create(thread_id, attr, start_routine, arg);
|
||||
pthread_create((pthread_t*)thread_id, (pthread_attr_t const*)attr, start_routine, arg);
|
||||
}
|
||||
|
||||
void thread_sleep(unsigned int milli_seconds)
|
||||
|
|
|
@ -38,8 +38,8 @@ c_fifo::c_fifo(const char* name)
|
|||
m_read_sem = malloc(sizeof(sem_t));
|
||||
m_write_mutex = malloc(sizeof(pthread_mutex_t));
|
||||
|
||||
sem_init(m_read_sem, 0, 0);
|
||||
pthread_mutex_init(m_write_mutex, NULL);
|
||||
sem_init((sem_t*)m_read_sem, 0, 0);
|
||||
pthread_mutex_init((pthread_mutex_t*)m_write_mutex, NULL);
|
||||
}
|
||||
|
||||
int c_fifo::read(void* buf, int len)
|
||||
|
@ -50,7 +50,7 @@ int c_fifo::read(void* buf, int len)
|
|||
{
|
||||
if (m_tail == m_head)
|
||||
{//empty
|
||||
sem_wait(m_read_sem);
|
||||
sem_wait((sem_t*)m_read_sem);
|
||||
continue;
|
||||
}
|
||||
*pbuf++ = m_buf[m_head];
|
||||
|
@ -70,7 +70,7 @@ int c_fifo::write(void* buf, int len)
|
|||
int i = 0;
|
||||
int tail = m_tail;
|
||||
|
||||
pthread_mutex_lock(m_write_mutex);
|
||||
pthread_mutex_lock((pthread_mutex_t*)m_write_mutex);
|
||||
while(i < len)
|
||||
{
|
||||
if ((m_tail + 1) % FIFO_BUFFER_LEN == m_head)
|
||||
|
@ -79,14 +79,14 @@ int c_fifo::write(void* buf, int len)
|
|||
log_out("Warning: ");
|
||||
log_out(m_name);
|
||||
log_out(" full\n");
|
||||
pthread_mutex_unlock(m_write_mutex);
|
||||
pthread_mutex_unlock((pthread_mutex_t*)m_write_mutex);
|
||||
return 0;
|
||||
}
|
||||
m_buf[m_tail] = *pbuf++;
|
||||
m_tail = (m_tail + 1) % FIFO_BUFFER_LEN;
|
||||
i++;
|
||||
}
|
||||
pthread_mutex_unlock(m_write_mutex);
|
||||
pthread_mutex_unlock((pthread_mutex_t*)m_write_mutex);
|
||||
|
||||
if(i != len)
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ int c_fifo::write(void* buf, int len)
|
|||
}
|
||||
else
|
||||
{
|
||||
sem_post(m_read_sem);
|
||||
sem_post((sem_t*)m_read_sem);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ const GLT_MSG_ENTRY* c_cmd_target::FindMsgEntry(const GLT_MSG_ENTRY *pEntry,
|
|||
|
||||
while (MSG_CALLBACK_NULL != pEntry->callbackType)
|
||||
{
|
||||
if ( (msgType == pEntry->msgType) && (msgId == pEntry->msgId) && (ctrlId == (unsigned short)pEntry->pObject))
|
||||
if ( (msgType == pEntry->msgType) && (msgId == pEntry->msgId) && (void*)ctrlId == pEntry->pObject)
|
||||
{
|
||||
return pEntry;
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ void c_wave_ctrl::refresh_wave(unsigned char frame)
|
|||
//get wave value
|
||||
mid = m_wave->read_wave_data_by_frame(max, min,
|
||||
m_frame_len_map[m_frame_len_map_index++],
|
||||
(frame | (speed << 8) | (((unsigned int)this & 0xffff) << 16)));
|
||||
(frame | (speed << 8) | (((unsigned long)this & 0xffff) << 16)));
|
||||
m_frame_len_map_index %= sizeof(m_frame_len_map);
|
||||
//gain
|
||||
switch(m_gain)
|
||||
|
|
Loading…
Reference in New Issue