Import('env')
Import('rtconfig')
Import('RTT_ROOT')
Import('projects')

common_src = Split("""
common/blit.c
common/color.c
common/region.c
common/rtgui_object.c
common/rtgui_system.c
common/rtgui_theme.c
common/rtgui_xml.c
common/dc.c
common/dc_hw.c
common/dc_buffer.c
common/dc_client.c
common/filerw.c
common/image.c
common/image_xpm.c
common/image_hdc.c
common/image_bmp.c
common/image_png.c
common/image_jpg.c
common/image_container.c
common/font.c
common/font_bmp.c
common/font_hz_file.c
common/font_hz_bmp.c
common/asc12font.c
common/asc16font.c
common/hz12font.c
common/hz16font.c
common/framebuffer_driver.c
common/pixel_driver.c
""")

server_src = Split("""
server/driver.c
server/mouse.c
server/panel.c
server/server.c
server/topwin.c
""")

widgets_src = Split("""
widgets/box.c
widgets/button.c
widgets/checkbox.c
widgets/container.c
widgets/combobox.c
widgets/iconbox.c
widgets/label.c
widgets/textview.c
widgets/listctrl.c
widgets/menu.c
widgets/progressbar.c
widgets/radiobox.c
widgets/slider.c
widgets/scrollbar.c
widgets/staticline.c
widgets/textbox.c
widgets/listbox.c
widgets/title.c
widgets/toplevel.c
widgets/notebook.c
widgets/view.c
widgets/list_view.c
widgets/about_view.c
widgets/filelist_view.c
widgets/widget.c
widgets/window.c
widgets/workbench.c
""")

# The set of source files associated with this SConscript file.
src_local = common_src + server_src + widgets_src

for index in range(0, len(src_local)):
	src_local[index] = RTT_ROOT + '/rt-thread/components/rtgui/' + src_local[index]

path = [RTT_ROOT + '/rt-thread/components/rtgui/include',
	RTT_ROOT + '/rt-thread/components/rtgui/common', 
	RTT_ROOT + '/rt-thread/components/rtgui/server', 
	RTT_ROOT + '/rt-thread/components/rtgui/widgets']

# group definitions
group = {}
group['name'] = 'GUI'
group['src'] = File(src_local)
group['CCFLAGS'] = ''
group['CPPPATH'] = path
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''

# add group to project list
projects.append(group)

env.Append(CCFLAGS = group['CCFLAGS'])
env.Append(CPPPATH = group['CPPPATH'])
env.Append(CPPDEFINES = group['CPPDEFINES'])
env.Append(LINKFLAGS = group['LINKFLAGS'])

objs = env.Object(group['src'])

Return('objs')
