forked from KolibriOS/kolibrios
cmm: various updates
git-svn-id: svn://kolibrios.org@6791 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
54932fe994
commit
94e30f2af4
@ -42,7 +42,7 @@ void Copy(dword pcth, char cut)
|
|||||||
size_buf += 20;
|
size_buf += 20;
|
||||||
buff_data = malloc(size_buf);
|
buff_data = malloc(size_buf);
|
||||||
ESDWORD[buff_data] = size_buf;
|
ESDWORD[buff_data] = size_buf;
|
||||||
ESDWORD[buff_data+4] = 3;
|
ESDWORD[buff_data+4] = SLOT_DATA_TYPE_RAW;
|
||||||
ESINT[buff_data+8] = selected_count;
|
ESINT[buff_data+8] = selected_count;
|
||||||
copy_buf_offset = buff_data + 10;
|
copy_buf_offset = buff_data + 10;
|
||||||
for (i=0; i<files.count; i++)
|
for (i=0; i<files.count; i++)
|
||||||
|
@ -32,9 +32,9 @@ dword Clipboard::GetSlotCount()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define SLOT_DATA_TYPE_TEXT 0
|
#define SLOT_DATA_TYPE_TEXT 0
|
||||||
#define SLOT_DATA_TYPE_IMAGE 1
|
#define SLOT_DATA_TYPE_TEXT_WITH_BLOCK_SELECTION 1
|
||||||
#define SLOT_DATA_TYPE_RAW 2
|
#define SLOT_DATA_TYPE_IMAGE 2
|
||||||
#define SLOT_DATA_TYPE_RESERVED 3
|
#define SLOT_DATA_TYPE_RAW 3
|
||||||
dword Clipboard::GetSlotData( ECX) //ECX = slot number
|
dword Clipboard::GetSlotData( ECX) //ECX = slot number
|
||||||
{
|
{
|
||||||
dword result;
|
dword result;
|
||||||
|
@ -38,6 +38,11 @@
|
|||||||
#define SCAN_CODE_PGDN 081
|
#define SCAN_CODE_PGDN 081
|
||||||
#define SCAN_CODE_PGUP 073
|
#define SCAN_CODE_PGUP 073
|
||||||
|
|
||||||
|
#define SCAN_CODE_KEY_C 046
|
||||||
|
#define SCAN_CODE_KEY_M 050
|
||||||
|
#define SCAN_CODE_KEY_O 024
|
||||||
|
#define SCAN_CODE_KEY_P 025
|
||||||
|
|
||||||
#define KEY_LSHIFT 00000000001b
|
#define KEY_LSHIFT 00000000001b
|
||||||
#define KEY_RSHIFT 00000000010b
|
#define KEY_RSHIFT 00000000010b
|
||||||
#define KEY_LCTRL 00000000100b
|
#define KEY_LCTRL 00000000100b
|
||||||
|
@ -58,8 +58,6 @@ char program_path[4096];
|
|||||||
#define EVENT_MASK_NETWORK 010000000b
|
#define EVENT_MASK_NETWORK 010000000b
|
||||||
#define EVENT_MASK_DEBUG 100000000b
|
#define EVENT_MASK_DEBUG 100000000b
|
||||||
|
|
||||||
//ARGS FUNCTION
|
|
||||||
#define END_ARGS 0xFF00FF
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "../lib/system.h"
|
#include "../lib/system.h"
|
||||||
@ -120,23 +118,23 @@ inline fastcall dword GetFreeRAM()
|
|||||||
$mov eax, 18
|
$mov eax, 18
|
||||||
$mov ebx, 16
|
$mov ebx, 16
|
||||||
$int 0x40
|
$int 0x40
|
||||||
//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
|
//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
|
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
|
||||||
{
|
{
|
||||||
$mov eax, 68
|
$mov eax, 68
|
||||||
$mov ebx, 16
|
$mov ebx, 16
|
||||||
$int 0x40
|
$int 0x40
|
||||||
//return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà
|
//return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fastcall dword RuleDriver(ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó
|
inline fastcall dword RuleDriver(ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó
|
||||||
{
|
{
|
||||||
$mov eax, 68
|
$mov eax, 68
|
||||||
$mov ebx, 17
|
$mov ebx, 17
|
||||||
$int 0x40
|
$int 0x40
|
||||||
//return eax = îïðåäåëÿåòñÿ äðàéâåðîì
|
//return eax = îïðåäåëÿåòñÿ äðàéâåðîì
|
||||||
}
|
}
|
||||||
|
|
||||||
struct proc_info
|
struct proc_info
|
||||||
@ -257,7 +255,7 @@ inline fastcall void SetCurDir( ECX)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
|
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
|
||||||
#define SYS_LANG_ENG 1
|
#define SYS_LANG_ENG 1
|
||||||
#define SYS_LANG_FIN 2
|
#define SYS_LANG_FIN 2
|
||||||
#define SYS_LANG_GER 3
|
#define SYS_LANG_GER 3
|
||||||
@ -364,6 +362,18 @@ inline fastcall void DrawTitle( ECX)
|
|||||||
$int 0x40;
|
$int 0x40;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @EDX is a procewss id, -1 for self
|
||||||
|
// @ESI is a new LayerBehaviour
|
||||||
|
// @RETURN: EAX, 0 is fail, 1 is success
|
||||||
|
#define WINDOW_LAYER_ALWAYS_ON_TOP 1
|
||||||
|
inline fastcall dword SetWindowLayerBehaviour(EDX, ESI)
|
||||||
|
{
|
||||||
|
EAX = 18;
|
||||||
|
EBX = 25;
|
||||||
|
ECX = 2;
|
||||||
|
$int 64
|
||||||
|
}
|
||||||
|
|
||||||
:void WriteTextB(dword x,y,byte fontType, dword color, str_offset)
|
:void WriteTextB(dword x,y,byte fontType, dword color, str_offset)
|
||||||
{
|
{
|
||||||
EAX = 4;
|
EAX = 4;
|
||||||
@ -414,11 +424,11 @@ inline fastcall void DrawTitle( ECX)
|
|||||||
$int 0x40;
|
$int 0x40;
|
||||||
}
|
}
|
||||||
|
|
||||||
:dword GetPixelColor(dword x, x_size, y)
|
:dword GetPixelColorFromScreen(dword _x, _y)
|
||||||
{
|
{
|
||||||
$mov eax, 35
|
EAX = 35;
|
||||||
EBX= y*x_size+x;
|
EBX = _y * screen.width + _x;
|
||||||
$int 0x40
|
$int 64
|
||||||
}
|
}
|
||||||
|
|
||||||
:void _PutImage(dword x,y, w,h, data_offset)
|
:void _PutImage(dword x,y, w,h, data_offset)
|
||||||
@ -490,6 +500,37 @@ inline RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
|
|||||||
$int 0x40
|
$int 0x40
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DefineDragableWindow(dword _x, _y, _w, _h)
|
||||||
|
{
|
||||||
|
DefineAndDrawWindow(_x, _y, _w, _h, 0x41,0x000000,NULL,0b);
|
||||||
|
}
|
||||||
|
|
||||||
|
:void EventDragWindow()
|
||||||
|
{
|
||||||
|
dword tmp_x,tmp_y;
|
||||||
|
dword z1,z2;
|
||||||
|
tmp_x = mouse.x;
|
||||||
|
tmp_y = mouse.y;
|
||||||
|
do {
|
||||||
|
mouse.get();
|
||||||
|
if (tmp_x!=mouse.x) || (tmp_y!=mouse.y)
|
||||||
|
{
|
||||||
|
z1 = Form.left + mouse.x - tmp_x;
|
||||||
|
z2 = Form.top + mouse.y - tmp_y;
|
||||||
|
if(z1<=10) || (z1>20000) z1=0; else if(z1>screen.width-Form.width-10)z1=screen.width-Form.width;
|
||||||
|
if(z2<=10) || (z2>20000) z2=0; else if(z2>screen.height-Form.height-10)z2=screen.height-Form.height;
|
||||||
|
MoveSize(z1 , z2, OLD, OLD);
|
||||||
|
draw_window();
|
||||||
|
}
|
||||||
|
pause(1);
|
||||||
|
} while (mouse.lkm);
|
||||||
|
}
|
||||||
|
|
||||||
|
:void DefineHiddenButton(dword _x, _y, _w, _h, _id)
|
||||||
|
{
|
||||||
|
DefineButton(_x, _y, _w, _h, _id + BT_HIDE, 0);
|
||||||
|
}
|
||||||
|
|
||||||
inline fastcall void DeleteButton( EDX)
|
inline fastcall void DeleteButton( EDX)
|
||||||
{
|
{
|
||||||
EAX = 8;
|
EAX = 8;
|
||||||
@ -601,7 +642,7 @@ char __BUF_DIR__[4096];
|
|||||||
dword path;
|
dword path;
|
||||||
} self;
|
} self;
|
||||||
|
|
||||||
dword __generator; // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
|
dword __generator; // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
|
||||||
|
|
||||||
:dword program_path_length;
|
:dword program_path_length;
|
||||||
|
|
||||||
|
@ -794,6 +794,7 @@ inline signed csshexdec(dword text)
|
|||||||
|
|
||||||
inline cdecl int sprintf(dword buf, format,...)
|
inline cdecl int sprintf(dword buf, format,...)
|
||||||
{
|
{
|
||||||
|
#define END_ARGS 0xFF00FF //ARGS FUNCTION
|
||||||
byte s;
|
byte s;
|
||||||
char X[10];
|
char X[10];
|
||||||
dword ret, tmp, l;
|
dword ret, tmp, l;
|
||||||
|
@ -116,7 +116,7 @@ void main()
|
|||||||
TEXT_Y = WIN_SIZE_Y/2-4;
|
TEXT_Y = WIN_SIZE_Y/2-4;
|
||||||
|
|
||||||
//emulate multithread :)
|
//emulate multithread :)
|
||||||
while (GetPixelColor(SCREEN_SIZE_X-1, SCREEN_SIZE_X, WIN_Y)==0x333333) WIN_Y+=WIN_SIZE_Y+17;
|
while (GetPixelColorFromScreen(SCREEN_SIZE_X-1, WIN_Y)==0x333333) WIN_Y+=WIN_SIZE_Y+17;
|
||||||
|
|
||||||
shadow_buf_24 = malloc(WIN_SIZE_X*WIN_SIZE_Y*3);
|
shadow_buf_24 = malloc(WIN_SIZE_X*WIN_SIZE_Y*3);
|
||||||
shadow_buf_32 = malloc(WIN_SIZE_X*WIN_SIZE_Y*4+8);
|
shadow_buf_32 = malloc(WIN_SIZE_X*WIN_SIZE_Y*4+8);
|
||||||
|
Loading…
Reference in New Issue
Block a user