人気の15件
Total : 1330 |
プロジェクトデータ - Daemon - ヒデ - API草案目次全般型typedef signed char s1; typedef signed short int s2; typedef signed long int s4; typedef signed long long int s8; typedef unsigned char u1; typedef unsigned short int u2; typedef unsigned long int u4; typedef unsigned long long int u8; typedefか#defineかは検討中。。 #define s1 signed char #define s2 signed short int #define s4 signed long int #define s8 signed long long int #define u1 unsigned char #define u2 unsigned short int #define u4 unsigned long int #define u8 unsigned long long int クラス・構造体class Rect
{
public:
u4 Mu4_Top;
u4 Mu4_Left;
u4 Mu4_Right;
u4 Mu4_Bottom;
Rect( void );
Rect( u4 u4_Top, u4 u4_Left, u4 u4_Right, u4 u4_Bottom );
void SetRect( u4 u4_Top, u4 u4_Left, u4 u4_Right, u4 u4_Bottom );
};
Rect::Rect( void );Rect::Rect( void )
: Mu4_Top( 0 ), Mu4_Left( 0 ), Mu4_Right( 0 ), Mu4_Bottom( 0 )
{
}
Rect::Rect( u4 u4_Top, u4 u4_Left, u4 u4_Right, u4 u4_Bottom );Rect::Rect( u4 u4_Top, u4 u4_Left, u4 u4_Right, u4 u4_Bottom )
: Mu4_Top( u4_Top ), Mu4_Left( u4_Left ), Mu4_Right( u4_Right ), Mu4_Bottom( u4_Bottom )
{
}
s4 Rect::SetRect( u4 u4_Top, u4 u4_Left, u4 u4_Right, u4 u4_Bottom );void Rect::SetRect( u4 u4_Top, u4 u4_Left, u4 u4_Right, u4 u4_Bottom )
{
Mu4_Top = u4_Top;
Mu4_Left = u4_Left;
Mu4_Right = u4_Right;
Mu4_Bottom = u4_Bottom;
}
ウィンドウ関連ウィンドウクラスウィンドウ本体のクラス。本体はアプリケーションが持つ。 class Window
{
private:
s4 Ms4_X;
s4 Ms4_Y;
u4 Mu4_Width;
u4 Mu4_Height;
Rect Mrc_DrawArea;
char* Pc_Caption;
u4 u4_Control;
u4 u4_State;
void* P_Object[16];
public:
Window( void );
~Window( void );
s4 Register( void ); //ウィンドウ登録
s4 Move( s4 s4_X, s4 s4_Y ); //ウィンドウ移動(絶対座標)
s4 Resize( u4 u4_Width, u4 u4_Height ); //ウィンドウサイズ変更(絶対サイズ)
s4 SizeMax( void ); //ウィンドウ最大化 or 標準 切り替え
s4 SizeMin( void ); //ウィンドウ最小化 or 標準 切り替え
s4 SizeStd( void ); //ウィンドウ標準化
s4 Close( void ); //ウィンドウを閉じる
s4 ResizeDrawArea( u4 u4_Top, u4 u4_Left, u4 u4_Right, u4 u4_Bottom ); //描画エリアサイズ変更(ウィンドウに対する座標)
//ゲッター
s4 GetWindowX( void );
s4 GetWindowY( void );
u4 GetWidth( void );
u4 GetHeight( void );
u4 GetDATop( void );
u4 GetDALeft( void );
u4 GetDARight( void );
u4 GetDABottom( void );
};
s4 Window::RegisterWindow( void );ウィンドウマネージャにウィンドウを登録し、描画してもらうようにする。 s4 Window::RegisterWindow( void )
{
//システムコール。
}
オブジェクトクラスenum ObjectType
{
OBJTYPE_MENU, //メニューバー
OBJTYPE_ADDRESS, //アドレスバー
OBJTYPE_VSCROLL, //垂直スクロールバー
OBJTYPE_HSCROLL, //水平スクロールバー
OBJTYPE_MAX
};
class Object
{
protected:
u4 Mu4_Type; //オブジェクトの種類
Window* MP_Window;
};
メニュークラスclass Menu : public Object
{
private:
MenuList* MP_MenuList;
public:
Menu( Window* P_Window );
Menu( Window* P_Window, MenuList* P_MenuList );
~Menu( void );
};
メニューリストクラスメニューを特殊なリスト構造にしたもの。 class MenuList
{
private:
char Mc_Caption[64];
MenuList* MP_NextMenu;
MenuList* MP_ChildList;
public:
MenuList( void );
s4 SetMenu( const char* CPc_Caption, MenuList* P_NextList, MenuList* P_ChildList );
};
MenuList::MenuList( void );MenuList::MenuList( void )
: MP_NextMenu( NULL ), MP_ChildList( NULL )
{
Mc_Caption[0] = NULL;
}
s4 MenuList::SetMenu( const char* CPc_Caption, MenuList* P_NextList, MenuList* P_ChildList );s4 MenuList::SetMenu( const char* CPc_Caption, MenuList* P_NextList, MenuList* P_ChildList )
{
sprintf( Mc_Caption, "%s", CPc_Caption );
MP_NextMenu = P_NextList;
MP_ChildList = P_ChildList;
}
アドレスバークラスclass Address : public Object
{
private:
char* MPc_Address;
public:
Address( Window* P_Window );
Address( Window* P_Window, char* Pc_Address );
~Address( void );
???? Input( ?? );
};
スクロールバークラスclass Scroll : public Object
{
private:
u4 Mu4_PartialLength; //全体に対する表示領域の長さ。全体:0xffffffff
u4 Mu4_Position;
public:
Scroll( Window* P_Window );
Scroll( Window* P_Window, u4 u4_PartialLength = 0xb0000000, u4 u4_Position = 0 );
~Scroll( void );
};
アプリケーション側のソースとりあえず、こんな感じってところで。 #include <Mul_light.h>
int MLMain()
{
Window MainWindow;
Menu MenuBar;
Address AddressBar;
while( true )
{
}
}
|