mirror of
https://gitee.com/idea4good/GuiLite.git
synced 2026-06-25 14:54:02 +08:00
!16 separate surface from c_wnd, merge core, gui into GuiLite
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
PROJECT(Core)
|
||||
|
||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/..)
|
||||
|
||||
INCLUDE_DIRECTORIES(core_include)
|
||||
|
||||
FILE(GLOB MAIN src/*.cpp)
|
||||
FILE(GLOB ADAPTER src/adapter/api_linux.cpp
|
||||
src/adapter/audio_linux.cpp
|
||||
src/adapter/msg_linux.cpp)
|
||||
|
||||
ADD_LIBRARY(core
|
||||
${MAIN}
|
||||
${ADAPTER})
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/.sync.sh Core
|
||||
)
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "core.vcxproj", "{8C80C76D-F437-4C69-BC94-252AC44171C2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8C80C76D-F437-4C69-BC94-252AC44171C2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8C80C76D-F437-4C69-BC94-252AC44171C2}.Debug|x64.Build.0 = Debug|x64
|
||||
{8C80C76D-F437-4C69-BC94-252AC44171C2}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{8C80C76D-F437-4C69-BC94-252AC44171C2}.Debug|x86.Build.0 = Debug|Win32
|
||||
{8C80C76D-F437-4C69-BC94-252AC44171C2}.Release|x64.ActiveCfg = Release|x64
|
||||
{8C80C76D-F437-4C69-BC94-252AC44171C2}.Release|x64.Build.0 = Release|x64
|
||||
{8C80C76D-F437-4C69-BC94-252AC44171C2}.Release|x86.ActiveCfg = Release|Win32
|
||||
{8C80C76D-F437-4C69-BC94-252AC44171C2}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,184 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{8C80C76D-F437-4C69-BC94-252AC44171C2}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>core</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync_build.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync_build.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync_build.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync_build.bat" "Core"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\adapter\api_win.cpp" />
|
||||
<ClCompile Include="src\adapter\audio_win.cpp" />
|
||||
<ClCompile Include="src\adapter\msg_win.cpp" />
|
||||
<ClCompile Include="src\bitmap.cpp" />
|
||||
<ClCompile Include="src\cmd_target.cpp" />
|
||||
<ClCompile Include="src\display.cpp" />
|
||||
<ClCompile Include="src\surface.cpp" />
|
||||
<ClCompile Include="src\rect.cpp" />
|
||||
<ClCompile Include="src\wave_buffer.cpp" />
|
||||
<ClCompile Include="src\wave_ctrl.cpp" />
|
||||
<ClCompile Include="src\wnd.cpp" />
|
||||
<ClCompile Include="src\word.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="core_include\api.h" />
|
||||
<ClInclude Include="core_include\audio.h" />
|
||||
<ClInclude Include="core_include\bitmap.h" />
|
||||
<ClInclude Include="core_include\cmd_target.h" />
|
||||
<ClInclude Include="core_include\display.h" />
|
||||
<ClInclude Include="core_include\surface.h" />
|
||||
<ClInclude Include="core_include\msg.h" />
|
||||
<ClInclude Include="core_include\rect.h" />
|
||||
<ClInclude Include="core_include\resource.h" />
|
||||
<ClInclude Include="core_include\wave_buffer.h" />
|
||||
<ClInclude Include="core_include\wave_ctrl.h" />
|
||||
<ClInclude Include="core_include\wnd.h" />
|
||||
<ClInclude Include="core_include\word.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,95 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\core_include">
|
||||
<UniqueIdentifier>{3a033a7f-d656-4871-b7fe-f0a16aca7c8d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\bitmap.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\cmd_target.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\rect.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\wave_buffer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\wave_ctrl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\wnd.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\word.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adapter\api_win.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adapter\audio_win.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adapter\msg_win.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\surface.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\display.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="core_include\api.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\audio.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\bitmap.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\cmd_target.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\msg.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\rect.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\wave_buffer.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\wave_ctrl.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\wnd.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\word.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\surface.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\display.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_include\resource.h">
|
||||
<Filter>Header Files\core_include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
||||
@@ -27,18 +27,27 @@ class c_display;
|
||||
class c_surface {
|
||||
friend class c_display; friend class c_bitmap;
|
||||
public:
|
||||
virtual void draw_pixel(int x, int y, unsigned int rgb, unsigned int z_order);
|
||||
virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
|
||||
unsigned int get_pixel(int x, int y, unsigned int z_order);
|
||||
|
||||
int get_width() { return m_width; }
|
||||
int get_height() { return m_height; }
|
||||
unsigned int get_pixel(int x, int y, unsigned int z_order);
|
||||
|
||||
void draw_pixel(int x, int y, unsigned int rgb, unsigned int z_order);
|
||||
void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
|
||||
void draw_hline(int x0, int x1, int y, unsigned int rgb, unsigned int z_order);
|
||||
void draw_vline(int x, int y0, int y1, unsigned int rgb, unsigned int z_order);
|
||||
void draw_line(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
|
||||
void draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order, unsigned int size = 1);
|
||||
int flush_scrren(int left, int top, int right, int bottom);
|
||||
|
||||
inline void draw_rect(c_rect rect, unsigned int rgb, unsigned int size, unsigned int z_order)
|
||||
{
|
||||
draw_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, rgb, z_order, size);
|
||||
}
|
||||
inline void fill_rect(c_rect rect, unsigned int rgb, unsigned int z_order)
|
||||
{
|
||||
fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, rgb, z_order);
|
||||
}
|
||||
|
||||
int flush_scrren(int left, int top, int right, int bottom);
|
||||
bool is_valid(c_rect rect);
|
||||
bool is_active() { return m_is_active; }
|
||||
c_display* get_display() { return m_display; }
|
||||
|
||||
70
core/core_include/theme.h
Normal file
70
core/core_include/theme.h
Normal file
@@ -0,0 +1,70 @@
|
||||
#ifndef MY_RESOURCE_H
|
||||
#define MY_RESOURCE_H
|
||||
|
||||
typedef struct struct_font_info FONT_INFO;
|
||||
typedef struct struct_color_rect COLOR_RECT;
|
||||
typedef struct struct_bitmap_info BITMAP_INFO;
|
||||
|
||||
//Rebuild gui library once you change this file
|
||||
enum FONT_TYPE
|
||||
{
|
||||
FONT_NULL,
|
||||
FONT_DEFAULT,
|
||||
FONT_CUSTOM1,
|
||||
FONT_CUSTOM2,
|
||||
FONT_CUSTOM3,
|
||||
FONT_CUSTOM4,
|
||||
FONT_CUSTOM5,
|
||||
FONT_CUSTOM6,
|
||||
FONT_MAX
|
||||
};
|
||||
|
||||
enum BITMAP_TYPE
|
||||
{
|
||||
BITMAP_UP_ARROW1,
|
||||
BITMAP_UP_ARROW2,
|
||||
BITMAP_DOWN_ARROW1,
|
||||
BITMAP_DOWN_ARROW2,
|
||||
|
||||
BITMAP_CUSTOM1,
|
||||
BITMAP_CUSTOM2,
|
||||
BITMAP_CUSTOM3,
|
||||
BITMAP_CUSTOM4,
|
||||
BITMAP_CUSTOM5,
|
||||
BITMAP_CUSTOM6,
|
||||
|
||||
BITMAP_MAX
|
||||
};
|
||||
|
||||
enum COLOR_TYPE
|
||||
{
|
||||
COLOR_WND_FONT,
|
||||
COLOR_WND_NORMAL,
|
||||
COLOR_WND_PUSHED,
|
||||
COLOR_WND_FOCUS,
|
||||
COLOR_WND_BORDER,
|
||||
|
||||
COLOR_CUSTOME1,
|
||||
COLOR_CUSTOME2,
|
||||
COLOR_CUSTOME3,
|
||||
COLOR_CUSTOME4,
|
||||
COLOR_CUSTOME5,
|
||||
COLOR_CUSTOME6,
|
||||
|
||||
COLOR_MAX
|
||||
};
|
||||
|
||||
class c_theme
|
||||
{
|
||||
public:
|
||||
static int add_font(FONT_TYPE index, const FONT_INFO* font);
|
||||
static const FONT_INFO* get_font(FONT_TYPE index);
|
||||
|
||||
static int add_bitmap(BITMAP_TYPE index, const BITMAP_INFO* bmp);
|
||||
static const BITMAP_INFO* get_bmp(BITMAP_TYPE index);
|
||||
|
||||
static int add_color(COLOR_TYPE index, const unsigned int color);
|
||||
static const unsigned int get_color(COLOR_TYPE index);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,36 +0,0 @@
|
||||
#ifndef WAVE_BUFFER_H
|
||||
#define WAVE_BUFFER_H
|
||||
|
||||
#define WAVE_BUFFER_LEN 1024
|
||||
#define WAVE_READ_CACHE_LEN 8
|
||||
#define BUFFER_EMPTY -1111
|
||||
#define BUFFER_FULL -2222;
|
||||
class c_wave_buffer
|
||||
{
|
||||
public:
|
||||
c_wave_buffer();
|
||||
int write_wave_data(short data);
|
||||
int read_wave_data_by_frame(short &max, short &min, short frame_len, unsigned int sequence, short offset);
|
||||
void reset();
|
||||
void clear_data();
|
||||
short get_cnt();
|
||||
private:
|
||||
int read_data();
|
||||
short m_wave_buf[WAVE_BUFFER_LEN];
|
||||
short m_head;
|
||||
short m_tail;
|
||||
|
||||
int m_min_old;
|
||||
int m_max_old;
|
||||
int m_min_older;
|
||||
int m_max_older;
|
||||
int m_last_data;
|
||||
|
||||
short m_read_cache_min[WAVE_READ_CACHE_LEN];
|
||||
short m_read_cache_mid[WAVE_READ_CACHE_LEN];
|
||||
short m_read_cache_max[WAVE_READ_CACHE_LEN];
|
||||
short m_read_cache_sum;
|
||||
unsigned int m_refresh_sequence;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,74 +0,0 @@
|
||||
#ifndef WAVE_CTRL_H
|
||||
#define WAVE_CTRL_H
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FILL_MODE,
|
||||
SCAN_MODE
|
||||
}E_WAVE_DRAW_MODE;
|
||||
|
||||
class c_wave_buffer;
|
||||
class c_wave_ctrl : public c_wnd
|
||||
{
|
||||
public:
|
||||
c_wave_ctrl();
|
||||
virtual c_wnd* clone(){return new c_wave_ctrl();}
|
||||
virtual void on_init_children();
|
||||
virtual void on_paint();
|
||||
|
||||
void set_wave_name(char* wave_name){ m_wave_name = wave_name;}
|
||||
void set_wave_unit(char* wave_unit){ m_wave_unit = wave_unit;}
|
||||
|
||||
void set_wave_name_font(const FONT_INFO* wave_name_font_type){ m_wave_name_font = wave_name_font_type;}
|
||||
void set_wave_unit_font(const FONT_INFO* wave_unit_font_type){ m_wave_unit_font = wave_unit_font_type;}
|
||||
|
||||
void set_wave_name_color(unsigned int wave_name_color){ m_wave_name_color = wave_name_color;}
|
||||
void set_wave_unit_color(unsigned int wave_unit_color){ m_wave_unit_color = wave_unit_color;}
|
||||
void set_wave_color(unsigned int color){ m_wave_color = color;}
|
||||
void set_wave_in_out_rate(unsigned int data_rate, unsigned int refresh_rate);
|
||||
void set_wave_speed(unsigned int speed);
|
||||
|
||||
void set_max_min(short max_data, short min_data);
|
||||
void set_wave(c_wave_buffer* wave){m_wave = wave;}
|
||||
c_wave_buffer* get_wave(){return m_wave;}
|
||||
void clear_data();
|
||||
bool is_data_enough();
|
||||
void refresh_wave(unsigned char frame);
|
||||
void clear_wave();
|
||||
|
||||
protected:
|
||||
void draw_smooth_vline(int y_min, int y_max, int mid, unsigned int rgb);
|
||||
void restore_background();
|
||||
void save_background();
|
||||
|
||||
char* m_wave_name;
|
||||
char* m_wave_unit;
|
||||
|
||||
const FONT_INFO* m_wave_name_font;
|
||||
const FONT_INFO* m_wave_unit_font;
|
||||
|
||||
unsigned int m_wave_name_color;
|
||||
unsigned int m_wave_unit_color;
|
||||
|
||||
unsigned int m_wave_color;
|
||||
unsigned int m_back_color;
|
||||
|
||||
int m_wave_left;
|
||||
int m_wave_right;
|
||||
int m_wave_top;
|
||||
int m_wave_bottom;
|
||||
|
||||
short m_max_data;
|
||||
short m_min_data;
|
||||
|
||||
private:
|
||||
c_wave_buffer* m_wave;
|
||||
unsigned int* m_bg_fb; //background frame buffer, could be used to draw scale line.
|
||||
int m_wave_cursor;
|
||||
int m_wave_speed; //pixels per refresh
|
||||
unsigned int m_wave_data_rate; //data sample rate
|
||||
unsigned int m_wave_refresh_rate;//refresh cycle in millisecond
|
||||
unsigned char m_frame_len_map[64];
|
||||
unsigned char m_frame_len_map_index;
|
||||
};
|
||||
#endif
|
||||
@@ -103,15 +103,6 @@ protected:
|
||||
|
||||
virtual void on_focus();
|
||||
virtual void on_kill_focus();
|
||||
|
||||
void draw_pixel(int x, int y, unsigned int rgb);
|
||||
void draw_hline(int x0, int x1, int y, unsigned int rgb);
|
||||
void draw_vline(int x, int y0, int y1, unsigned int rgb);
|
||||
void draw_line(int x0, int y0, int x1, int y1, unsigned int rgb);
|
||||
void draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int size = 1);
|
||||
void draw_rect(c_rect rect, unsigned int rgb, unsigned int size = 1);
|
||||
void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb);
|
||||
void fill_rect(c_rect rect, unsigned int rgb);
|
||||
protected:
|
||||
WND_STATUS m_status;
|
||||
unsigned int m_style;
|
||||
|
||||
BIN
core/curl.exe
BIN
core/curl.exe
Binary file not shown.
71
core/src/theme.cpp
Normal file
71
core/src/theme.cpp
Normal file
@@ -0,0 +1,71 @@
|
||||
#include "core_include/api.h"
|
||||
#include "core_include/rect.h"
|
||||
#include "core_include/resource.h"
|
||||
#include "core_include/theme.h"
|
||||
|
||||
static const FONT_INFO* s_font_map[FONT_MAX];
|
||||
static const BITMAP_INFO* s_bmp_map[BITMAP_MAX];
|
||||
static unsigned int s_color_map[COLOR_MAX];
|
||||
|
||||
int c_theme::add_font(FONT_TYPE index, const FONT_INFO* font)
|
||||
{
|
||||
if (index >= FONT_MAX)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return -1;
|
||||
}
|
||||
s_font_map[index] = font;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const FONT_INFO* c_theme::get_font(FONT_TYPE index)
|
||||
{
|
||||
if (index >= FONT_MAX)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return NULL;
|
||||
}
|
||||
return s_font_map[index];
|
||||
}
|
||||
|
||||
int c_theme::add_bitmap(BITMAP_TYPE index, const BITMAP_INFO* bmp)
|
||||
{
|
||||
if (index >= BITMAP_MAX)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return -1;
|
||||
}
|
||||
s_bmp_map[index] = bmp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const BITMAP_INFO* c_theme::get_bmp(BITMAP_TYPE index)
|
||||
{
|
||||
if (index >= BITMAP_MAX)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return NULL;
|
||||
}
|
||||
return s_bmp_map[index];
|
||||
}
|
||||
|
||||
int c_theme::add_color(COLOR_TYPE index, const unsigned int color)
|
||||
{
|
||||
if (index >= COLOR_MAX)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return -1;
|
||||
}
|
||||
s_color_map[index] = color;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const unsigned int c_theme::get_color(COLOR_TYPE index)
|
||||
{
|
||||
if (index >= COLOR_MAX)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return NULL;
|
||||
}
|
||||
return s_color_map[index];
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/wave_buffer.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
|
||||
c_wave_buffer::c_wave_buffer()
|
||||
{
|
||||
m_head = m_tail = m_min_old = m_max_old =
|
||||
m_min_older = m_max_older = m_last_data = m_read_cache_sum = m_refresh_sequence = 0;
|
||||
memset(m_wave_buf, 0, sizeof(m_wave_buf));
|
||||
memset(m_read_cache_min, 0, sizeof(m_read_cache_min));
|
||||
memset(m_read_cache_mid, 0, sizeof(m_read_cache_mid));
|
||||
memset(m_read_cache_max, 0, sizeof(m_read_cache_max));
|
||||
}
|
||||
|
||||
short c_wave_buffer::get_cnt()
|
||||
{
|
||||
return (m_tail >= m_head)?(m_tail - m_head):(m_tail - m_head + WAVE_BUFFER_LEN);
|
||||
}
|
||||
|
||||
int c_wave_buffer::write_wave_data(short data)
|
||||
{
|
||||
if ((m_tail + 1) % WAVE_BUFFER_LEN == m_head)
|
||||
{//full
|
||||
//log_out("wave buf full\n");
|
||||
return BUFFER_FULL;
|
||||
}
|
||||
m_wave_buf[m_tail] = data;
|
||||
m_tail = (m_tail + 1) % WAVE_BUFFER_LEN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int c_wave_buffer::read_data()
|
||||
{
|
||||
if (m_head == m_tail)
|
||||
{//empty
|
||||
//log_out("wave buf empty\n");
|
||||
return BUFFER_EMPTY;
|
||||
}
|
||||
int ret = m_wave_buf[m_head];
|
||||
m_head = (m_head + 1) % WAVE_BUFFER_LEN;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int c_wave_buffer::read_wave_data_by_frame(short &max, short &min, short frame_len, unsigned int sequence, short offset)
|
||||
{
|
||||
if (m_refresh_sequence != sequence)
|
||||
{
|
||||
m_refresh_sequence = sequence;
|
||||
m_read_cache_sum = 0;
|
||||
}
|
||||
else if(offset < m_read_cache_sum)//(m_refresh_sequence == sequence && offset < m_fb_sum)
|
||||
{
|
||||
max = m_read_cache_max[offset];
|
||||
min = m_read_cache_min[offset];
|
||||
return m_read_cache_mid[offset];
|
||||
}
|
||||
|
||||
m_read_cache_sum++;
|
||||
ASSERT(m_read_cache_sum <= WAVE_READ_CACHE_LEN);
|
||||
int i, data;
|
||||
int tmp_min = m_last_data;
|
||||
int tmp_max = m_last_data;
|
||||
int mid = (m_min_old + m_max_old)>>1;
|
||||
|
||||
i = 0;
|
||||
while(i++ < frame_len)
|
||||
{
|
||||
data = read_data();
|
||||
if(BUFFER_EMPTY == data)
|
||||
{
|
||||
break;
|
||||
}
|
||||
m_last_data = data;
|
||||
|
||||
if(data < tmp_min){tmp_min = data;}
|
||||
if(data > tmp_max){tmp_max = data;}
|
||||
}
|
||||
|
||||
min = m_read_cache_min[offset] = MIN(m_min_old, MIN(tmp_min, m_min_older));
|
||||
max = m_read_cache_max[offset] = MAX(m_max_old, MAX(tmp_max, m_max_older));
|
||||
|
||||
m_min_older = m_min_old;
|
||||
m_max_older = m_max_old;
|
||||
m_min_old = tmp_min;
|
||||
m_max_old = tmp_max;
|
||||
return (m_read_cache_mid[offset] = mid);
|
||||
}
|
||||
|
||||
void c_wave_buffer::clear_data()
|
||||
{
|
||||
m_head = m_tail = 0;
|
||||
memset(m_wave_buf, 0, sizeof(m_wave_buf));
|
||||
}
|
||||
|
||||
void c_wave_buffer::reset()
|
||||
{
|
||||
m_head = m_tail;
|
||||
}
|
||||
@@ -1,238 +0,0 @@
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/rect.h"
|
||||
#include "../core_include/cmd_target.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/wave_buffer.h"
|
||||
#include "../core_include/surface.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/wave_ctrl.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define CORRECT(x, high_limit, low_limit) {\
|
||||
x = (x > high_limit) ? high_limit : x;\
|
||||
x = (x < low_limit) ? low_limit : x;\
|
||||
}while(0)
|
||||
|
||||
#define WAVE_CURSOR_WIDTH 8
|
||||
#define WAVE_LINE_WIDTH 1
|
||||
#define WAVE_MARGIN 5
|
||||
|
||||
c_wave_ctrl::c_wave_ctrl()
|
||||
{
|
||||
m_wave = NULL;
|
||||
m_bg_fb = NULL;
|
||||
m_wave_name_font = m_wave_unit_font = NULL;
|
||||
m_wave_name = m_wave_unit = 0;
|
||||
m_max_data = 500;
|
||||
m_min_data = 0;
|
||||
m_wave_speed = 1;
|
||||
m_wave_data_rate = 0;
|
||||
m_wave_refresh_rate = 1000;
|
||||
m_frame_len_map_index = 0;
|
||||
|
||||
m_wave_name_color = m_wave_unit_color = m_wave_color = GL_RGB(255,0,0);
|
||||
m_back_color = GL_RGB(0,0,0);
|
||||
}
|
||||
|
||||
void c_wave_ctrl::on_init_children()
|
||||
{
|
||||
c_rect rect;
|
||||
get_screen_rect(rect);
|
||||
|
||||
m_wave_left = rect.m_left + WAVE_MARGIN;
|
||||
m_wave_right = rect.m_right - WAVE_MARGIN;
|
||||
m_wave_top = rect.m_top + WAVE_MARGIN;
|
||||
m_wave_bottom = rect.m_bottom - WAVE_MARGIN;
|
||||
m_wave_cursor = m_wave_left;
|
||||
|
||||
m_bg_fb = (unsigned int*)calloc(rect.Width() * rect.Height(), 4);
|
||||
}
|
||||
|
||||
void c_wave_ctrl::set_max_min(short max_data, short min_data)
|
||||
{
|
||||
m_max_data = max_data;
|
||||
m_min_data = min_data;
|
||||
}
|
||||
|
||||
void c_wave_ctrl::set_wave_in_out_rate(unsigned int data_rate, unsigned int refresh_rate)
|
||||
{
|
||||
m_wave_data_rate = data_rate;
|
||||
m_wave_refresh_rate = refresh_rate;
|
||||
int read_times_per_second = m_wave_speed * 1000 / m_wave_refresh_rate;
|
||||
|
||||
memset(m_frame_len_map, 0, sizeof(m_frame_len_map));
|
||||
for (unsigned int i = 1; i < sizeof(m_frame_len_map) + 1; i++)
|
||||
{
|
||||
m_frame_len_map[i-1] = data_rate * i / read_times_per_second - data_rate * (i-1) / read_times_per_second;
|
||||
}
|
||||
m_frame_len_map_index = 0;
|
||||
}
|
||||
|
||||
void c_wave_ctrl::set_wave_speed(unsigned int speed)
|
||||
{
|
||||
m_wave_speed = speed;
|
||||
set_wave_in_out_rate(m_wave_data_rate, m_wave_refresh_rate);
|
||||
}
|
||||
|
||||
void c_wave_ctrl::clear_data()
|
||||
{
|
||||
if(m_wave == NULL)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
m_wave->clear_data();
|
||||
}
|
||||
|
||||
bool c_wave_ctrl::is_data_enough()
|
||||
{
|
||||
if(m_wave == NULL)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return false;
|
||||
}
|
||||
return (m_wave->get_cnt() - m_frame_len_map[m_frame_len_map_index] * m_wave_speed);
|
||||
}
|
||||
|
||||
void c_wave_ctrl::refresh_wave(unsigned char frame)
|
||||
{
|
||||
if(m_wave == NULL)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
short max, min, mid;
|
||||
for(short offset = 0; offset < m_wave_speed; offset++)
|
||||
{
|
||||
//get wave value
|
||||
mid = m_wave->read_wave_data_by_frame(max, min,
|
||||
m_frame_len_map[m_frame_len_map_index++],
|
||||
frame, offset);
|
||||
m_frame_len_map_index %= sizeof(m_frame_len_map);
|
||||
|
||||
//map to wave ctrl
|
||||
int y_min,y_max;
|
||||
if(m_max_data == m_min_data)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
y_max = m_wave_bottom + WAVE_LINE_WIDTH - (m_wave_bottom - m_wave_top)*(min - m_min_data)/(m_max_data - m_min_data);
|
||||
y_min = m_wave_bottom - WAVE_LINE_WIDTH - (m_wave_bottom - m_wave_top)*(max - m_min_data)/(m_max_data - m_min_data);
|
||||
mid = m_wave_bottom - (m_wave_bottom - m_wave_top)*(mid - m_min_data)/(m_max_data - m_min_data);
|
||||
|
||||
CORRECT(y_min, m_wave_bottom, m_wave_top);
|
||||
CORRECT(y_max, m_wave_bottom, m_wave_top);
|
||||
CORRECT(mid, m_wave_bottom, m_wave_top);
|
||||
|
||||
if (m_wave_cursor > m_wave_right)
|
||||
{
|
||||
m_wave_cursor = m_wave_left;
|
||||
}
|
||||
draw_smooth_vline(y_min, y_max, mid, m_wave_color);
|
||||
restore_background();
|
||||
m_wave_cursor++;
|
||||
}
|
||||
}
|
||||
|
||||
void c_wave_ctrl::draw_smooth_vline(int y_min, int y_max, int mid, unsigned int rgb)
|
||||
{
|
||||
int dy = y_max - y_min;
|
||||
short r = GL_RGB_R(rgb);
|
||||
short g = GL_RGB_G(rgb);
|
||||
short b = GL_RGB_B(rgb);
|
||||
int index = (dy >> 1) + 2;
|
||||
int y;
|
||||
|
||||
draw_pixel(m_wave_cursor, mid, rgb);
|
||||
|
||||
if (dy < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned char cur_r,cur_g,cur_b;
|
||||
unsigned int cur_rgb;
|
||||
for (int i = 1; i <= (dy >> 1) + 1; ++i )
|
||||
{
|
||||
if ( (mid + i) <= y_max )
|
||||
{
|
||||
y = mid + i;
|
||||
cur_r = r * (index - i) / index;
|
||||
cur_g = g * (index - i) / index;
|
||||
cur_b = b * (index - i) / index;
|
||||
cur_rgb = GL_RGB(cur_r, cur_g, cur_b);
|
||||
draw_pixel(m_wave_cursor, y, cur_rgb);
|
||||
}
|
||||
if ( (mid - i) >= y_min )
|
||||
{
|
||||
y = mid - i;
|
||||
cur_r = r * (index - i) / index;
|
||||
cur_g = g * (index - i) / index;
|
||||
cur_b = b * (index - i) / index;
|
||||
cur_rgb = GL_RGB(cur_r, cur_g, cur_b);
|
||||
draw_pixel(m_wave_cursor, y, cur_rgb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void c_wave_ctrl::on_paint()
|
||||
{
|
||||
c_rect rect;
|
||||
get_screen_rect(rect);
|
||||
|
||||
fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_back_color);
|
||||
|
||||
//show name
|
||||
c_word::draw_string(m_surface, m_z_order, m_wave_name, m_wave_left + 10, rect.m_top, m_wave_name_font, m_wave_name_color, GL_ARGB(0, 0, 0, 0), ALIGN_LEFT);
|
||||
//show unit
|
||||
c_word::draw_string(m_surface, m_z_order, m_wave_unit, m_wave_left + 60, rect.m_top, m_wave_unit_font, m_wave_unit_color, GL_ARGB(0, 0, 0, 0), ALIGN_LEFT);
|
||||
|
||||
save_background();
|
||||
}
|
||||
|
||||
void c_wave_ctrl::clear_wave(void)
|
||||
{
|
||||
fill_rect(m_wave_left, m_wave_top, m_wave_right, m_wave_bottom, m_back_color);
|
||||
m_wave_cursor = m_wave_left;
|
||||
}
|
||||
|
||||
void c_wave_ctrl::restore_background()
|
||||
{
|
||||
int x = m_wave_cursor + WAVE_CURSOR_WIDTH;
|
||||
if (x > m_wave_right)
|
||||
{
|
||||
x -= (m_wave_right - m_wave_left + 1);
|
||||
}
|
||||
|
||||
c_rect rect;
|
||||
get_screen_rect(rect);
|
||||
register int width = rect.Width();
|
||||
register int top = rect.m_top;
|
||||
register int left = rect.m_left;
|
||||
for (int y_pos = (m_wave_top - 1); y_pos <= (m_wave_bottom + 1); y_pos++)
|
||||
{
|
||||
(m_bg_fb) ? draw_pixel(x, y_pos, m_bg_fb[(y_pos - top) * width + (x - left)]) : draw_pixel(x, y_pos, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void c_wave_ctrl::save_background()
|
||||
{
|
||||
if (!m_bg_fb)
|
||||
{
|
||||
return;
|
||||
}
|
||||
c_rect rect;
|
||||
get_screen_rect(rect);
|
||||
|
||||
register unsigned int* p_des = m_bg_fb;
|
||||
for (int y = rect.m_top; y <= rect.m_bottom; y++)
|
||||
{
|
||||
for (int x = rect.m_left; x <= rect.m_right; x++)
|
||||
{
|
||||
*p_des++ = m_surface->get_pixel(x, y, m_z_order);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -603,43 +603,3 @@ void c_wnd::notify_parent(unsigned short msg_id, unsigned int w_param, long l_pa
|
||||
m_parent->on_notify(msg_id, w_param, l_param);
|
||||
}
|
||||
}
|
||||
|
||||
void c_wnd::draw_pixel(int x, int y, unsigned int rgb)
|
||||
{
|
||||
m_surface->draw_pixel(x, y, rgb, m_z_order);
|
||||
}
|
||||
|
||||
void c_wnd::draw_hline(int x0, int x1, int y, unsigned int rgb)
|
||||
{
|
||||
m_surface->draw_hline(x0, x1, y, rgb, m_z_order);
|
||||
}
|
||||
|
||||
void c_wnd::draw_vline(int x, int y0, int y1, unsigned int rgb)
|
||||
{
|
||||
m_surface->draw_vline(x, y0, y1, rgb, m_z_order);
|
||||
}
|
||||
|
||||
void c_wnd::draw_line(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{
|
||||
m_surface->draw_line(x0, y0, x1, y1, rgb, m_z_order);
|
||||
}
|
||||
|
||||
void c_wnd::draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int size)
|
||||
{
|
||||
m_surface->draw_rect(x0, y0, x1, y1, rgb, m_z_order, size);
|
||||
}
|
||||
|
||||
void c_wnd::draw_rect(c_rect rect, unsigned int rgb, unsigned int size)
|
||||
{
|
||||
m_surface->draw_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, rgb, m_z_order, size);
|
||||
}
|
||||
|
||||
void c_wnd::fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{
|
||||
m_surface->fill_rect(x0, y0, x1, y1, rgb, m_z_order);
|
||||
}
|
||||
|
||||
void c_wnd::fill_rect(c_rect rect, unsigned int rgb)
|
||||
{
|
||||
m_surface->fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, rgb, m_z_order);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user