Support Mac

This commit is contained in:
idea4good 2017-12-15 22:49:45 +08:00
parent 565ef43706
commit 9ab9571b3d
5 changed files with 19 additions and 20 deletions

View File

@ -3,15 +3,14 @@
超轻量UI框架 - GuiLite是由6千行左右的C/C++代码编写而成它像MFCQT一样为开发者提供界面支持。
- GuiLite可以嵌入到其他平台中与Android、Linux、Windows、Mac、MFC、QT、 **VR****单片机** 一起玩耍相互支持。开发者可以用GuiLite开发界面的跨平台部分同时也充分使用MFCQTAndroidLinuxWindowsMac的界面特性让自己的界面集百家之长又不失个性实现方法见GuiliteSamples/HostMonitor/BuildXXX
- GuiLite鼓励混合编程开发者可以用C/C++编写的GuiLite接管UI部分用JavaGoC#Python发开业务部分让软件获得界面效率和开发效率的双提升实现方法见GuiliteSamples/HostMonitor/BuildAndroid
- GuiLite可以完美运行在AndroidWindows包含VRMac**单片机**和**市面所有的 ARM Linux物联网终端**设备上
- GuiLite可以嵌入在MFC、QT、 Android等其他UI系统中。让你的界面集百家之长又不失个性
- GuiLite鼓励混合编程开发者可以用C/C++编写的GuiLite接管UI部分用JavaGoC#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层的一个部分它现实叠加界面元素而存在

View File

@ -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)
@ -284,4 +284,4 @@ int build_bmp(char *filename, unsigned int width, unsigned int height, unsigned
fclose(fp);
return 0;
}
}

View File

@ -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;
}
@ -151,4 +151,4 @@ int c_hid_pipe::write_hid_msg(MSG_INFO* msg, unsigned int display_id)
}
msg->dwMsgId |= ((display_id) << 24);//merge display ID in message.
return s_hid_fifo.write(msg, sizeof(MSG_INFO));
}
}

View File

@ -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;
}

View File

@ -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)
@ -287,4 +287,4 @@ void c_wave_ctrl::save_foreground()
*p_des++ = m_surface->get_pixel(x, y, m_z_order);
}
}
}
}