/programs/cmm/TWB/colors.h |
---|
186,7 → 186,7 |
else |
for (ii=0; color_specs[ii].name!=0; ii++) |
{ |
if (!strcmp(color_str, color_specs[ii].name)) return color_specs[ii].rgb; |
if (!strcmpi(color_str, color_specs[ii].name)) return color_specs[ii].rgb; |
} |
return text_colors[0]; |
/programs/cmm/appearance/appearance.c |
---|
11,8 → 11,8 |
#include "..\lib\dll.h" |
#include "..\lib\file_system.h" |
#include "..\lib\list_box.h" |
#include "..\lib\figures.h" |
#include "..\lib\lib.obj\box_lib.h" |
#include "..\lib\gui.h" |
#include "..\lib\obj\box_lib.h" |
#ifdef LANG_RUS |
?define WINDOW_HEADER "á¯à ¢«¥¨¥ ⥬®©" |
165,7 → 165,7 |
mem_Init(); |
SetEventMask(0x27); |
if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("'Fatal Error: library doesn't exists /rd/1/lib/box_lib.obj' -E"); |
if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("'Fatal Error: library doesn't exists /rd/1/lib/box_obj' -E"); |
list[SKINS].current = list[WALLPAPERS].current = -1; |
list[SKINS].first = list[WALLPAPERS].first = 0; |
TabClick(WALLPAPERS); |
/programs/cmm/browser/WebView.c |
---|
11,7 → 11,7 |
#define MEMSIZE 0x100000 |
#include "..\lib\kolibri.h" |
#include "..\lib\strings.h" |
#include "..\lib\figures.h" |
#include "..\lib\gui.h" |
#include "..\lib\encoding.h" |
#include "..\lib\file_system.h" |
#include "..\lib\mem.h" |
21,10 → 21,10 |
#include "..\lib\cursor.h" |
//*.obj libraries |
#include "..\lib\lib.obj\box_lib.h" |
#include "..\lib\lib.obj\libio_lib.h" |
#include "..\lib\lib.obj\libimg_lib.h" |
#include "..\lib\lib.obj\http.h" |
#include "..\lib\obj\box_lib.h" |
#include "..\lib\obj\libio_lib.h" |
#include "..\lib\obj\libimg_lib.h" |
#include "..\lib\obj\http.h" |
//useful patterns |
#include "..\lib\patterns\libimg_load_skin.h" |
/programs/cmm/dicty/dicty.c |
---|
3,9 → 3,9 |
#include "..\lib\strings.h" |
#include "..\lib\mem.h" |
#include "..\lib\file_system.h" |
#include "..\lib\figures.h" |
#include "..\lib\gui.h" |
#include "..\lib\dll.h" |
#include "..\lib\lib.obj\box_lib.h" |
#include "..\lib\obj\box_lib.h" |
unsigned char speaker[23*40*3]= FROM "speaker.raw"; |
35,7 → 35,7 |
{ |
int id, key; |
mem_Init(); |
if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("Error while loading GUI library /sys/lib/boxlib.obj"); |
if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("Error while loading GUI library /sys/lib/boxobj"); |
dict_folder = abspath(DICT_DIRECROTY); |
OpenDictionary(0); |
/programs/cmm/downloader/Downloader.c |
---|
2,7 → 2,7 |
//libraries |
#include "..\lib\kolibri.h" |
#include "..\lib\strings.h" |
#include "..\lib\figures.h" |
#include "..\lib\gui.h" |
#include "..\lib\encoding.h" |
#include "..\lib\draw_buf.h" |
#include "..\lib\file_system.h" |
10,9 → 10,9 |
#include "..\lib\dll.h" |
#include "..\lib\list_box.h" |
//*.obj libraries |
#include "..\lib\lib.obj\box_lib.h" |
#include "..\lib\lib.obj\libio_lib.h" |
#include "..\lib\lib.obj\http.h" |
#include "..\lib\obj\box_lib.h" |
#include "..\lib\obj\libio_lib.h" |
#include "..\lib\obj\http.h" |
char header[]="New Downloader v0.6"; |
49,7 → 49,7 |
char notify_message[4296]; |
mem_Init(); |
if (load_dll2(boxlib, #box_lib_init,0)!=0) {notify("System Error: library doesn't exists /rd/1/lib/box_lib.obj"); ExitProcess();} |
if (load_dll2(boxlib, #box_lib_init,0)!=0) {notify("System Error: library doesn't exists /rd/1/lib/box_obj"); ExitProcess();} |
if (load_dll2(libio, #libio_init,1)!=0) notify("Error: library doesn't exists - libio"); |
if (load_dll2(libHTTP, #http_lib_init,1)!=0) notify("Error: library doesn't exists - http"); |
if (!URL) strcpy(#URL, "http://builds.kolibrios.org/eng/latest-iso.7z"); |
/programs/cmm/end/end.c |
---|
1,6 → 1,6 |
#define MEMSIZE 0x3E80 |
#include "..\lib\kolibri.h" |
#include "..\lib\figures.h" |
#include "..\lib\gui.h" |
#include "..\lib\strings.h" |
#include "..\lib\random.h" |
#include "..\lib\mem.h" |
/programs/cmm/eolite/Eolite.c |
---|
13,13 → 13,13 |
#include "..\lib\mem.h" |
#include "..\lib\dll.h" |
#include "..\lib\file_system.h" |
#include "..\lib\figures.h" |
#include "..\lib\gui.h" |
#include "..\lib\list_box.h" |
#include "..\lib\copyf.h" |
#include "..\lib\random.h" |
//obj |
#include "..\lib\lib.obj\libini.h" |
#include "..\lib\lib.obj\box_lib.h" |
#include "..\lib\obj\libini.h" |
#include "..\lib\obj\box_lib.h" |
//images |
#include "imgs\toolbar.txt" |
#include "imgs\left_p.txt" |
38,7 → 38,7 |
?define WAIT_DELETING_FOLDER "¤ «ï¥âáï ¯ ¯ª . ®¤®¦¨â¥..." |
?define NOT_CREATE_FOLDER "¥ 㤠«®áì ᮧ¤ âì ¯ ¯ªã." |
?define NOT_CREATE_FILE "¥ 㤠«®áì ᮧ¤ âì ä ©«." |
?define ERROR_1 "訡ª ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ /rd/1/lib/box_lib.obj" |
?define ERROR_1 "訡ª ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ /rd/1/lib/box_obj" |
?define T_PASTE_WINDOW "®¯¨àãî..." |
?define T_PASTE_WINDOW_TEXT "®¯¨àã¥âáï ä ©«:" |
?define T_CANCEL_PASTE "®¯¨à®¢ ¨¥ ¯à¥ªà 饮. ¯ª ᪮¯¨à®¢ ¥ ¯®«®áâìî." |
56,7 → 56,7 |
?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." |
?define NOT_CREATE_FOLDER "Kataloogi ei saa luua." |
?define NOT_CREATE_FILE "Faili ei saa luua." |
?define ERROR_1 "Viga teegi laadimisel /rd/1/lib/box_lib.obj" |
?define ERROR_1 "Viga teegi laadimisel /rd/1/lib/box_obj" |
?define T_PASTE_WINDOW "Kopeerin..." |
?define T_PASTE_WINDOW_TEXT "Kopeerin faili:" |
?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely." |
74,7 → 74,7 |
?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." |
?define NOT_CREATE_FOLDER "Folder can not be created." |
?define NOT_CREATE_FILE "File can not be created." |
?define ERROR_1 "Error while loading library /rd/1/lib/box_lib.obj" |
?define ERROR_1 "Error while loading library /rd/1/lib/box_obj" |
?define T_PASTE_WINDOW "Copying..." |
?define T_PASTE_WINDOW_TEXT "Copying file:" |
?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely." |
/programs/cmm/lib/figures.h |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/lib/socket_new.h |
---|
File deleted |
/programs/cmm/lib/lib.obj/libio_lib.h |
---|
File deleted |
/programs/cmm/lib/lib.obj/libini.h |
---|
File deleted |
/programs/cmm/lib/lib.obj/network.h |
---|
File deleted |
/programs/cmm/lib/lib.obj/libimg_lib.h |
---|
File deleted |
/programs/cmm/lib/lib.obj/box_lib.h |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/lib/lib.obj/iconv.h |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/lib/lib.obj/http.h |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/lib/lib.obj/xml.h |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/lib/lib.obj/truetype.h |
---|
File deleted |
/programs/cmm/lib/lib.obj/netcode.h |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/lib/lib.obj |
---|
Property changes: |
Deleted: tsvn:logminsize |
-5 |
\ No newline at end of property |
/programs/cmm/lib/gui.h |
---|
0,0 → 1,162 |
//#include "strings.h" |
:void DrawRectangle(dword x,y,w,h,color1) |
{ |
if (w<=0) || (h<=0) return; |
DrawBar(x,y,w,1,color1); |
DrawBar(x,y+h,w,1,color1); |
DrawBar(x,y,1,h,color1); |
DrawBar(x+w,y,1,h+1,color1); |
} |
:void DrawRectangle3D(dword x,y,w,h,color1,color2) |
{ |
if (w<=0) || (h<=0) return; |
DrawBar(x,y,w+1,1,color1); |
DrawBar(x,y+1,1,h-1,color1); |
DrawBar(x+w,y+1,1,h,color2); |
DrawBar(x,y+h,w,1,color2); |
} |
:void DrawCaptButton(dword x,y,w,h,id,color_b, color_t,text) |
{ |
if (id>0) DefineButton(x,y,w,h,id,color_b); |
WriteText(-strlen(text)*6+w/2+x+1,h/2-3+y,0x80,color_t,text); |
} |
:void WriteTextCenter(dword x,y,w,color_t,text) |
{ |
WriteText(-strlen(text)*6+w/2+x+1,y,0x80,color_t,text); |
} |
:void DrawCircle(int x, y, r) |
{ |
int i; |
float px=0, py=r, ii = r * 3.1415926 * 2; |
FOR (i = 0; i < ii; i++) |
{ |
PutPixel(px + x, y - py, 0); |
px = py / r + px; |
py = -px / r + py; |
} |
} |
:void CheckBox(dword x,y,w,h, bt_id, text, graph_color, text_color, is_checked) |
{ |
DefineButton(x-1, y-1, strlen(text)*6 + w + 17, h+2, bt_id+BT_HIDE+BT_NOFRAME, graph_color); |
WriteText(x+w+8, h / 2 + y -3, 0x80, text_color, text); |
DrawRectangle(x, y, w, h, graph_color); |
if (is_checked == 0) |
{ |
DrawRectangle3D(x+1, y+1, w-2, h-2, 0xDDDddd, 0xffffff); |
DrawBar(x+2, y+2, w-3, h-3, 0xffffff); |
} |
else if (is_checked == 1) |
{ |
DrawRectangle(x+1, y+1, w-2, h-2, 0xffffff); |
DrawBar(x+2, y+2, w-3, h-3, graph_color); |
} |
else if (is_checked == 2) //not active |
{ |
DrawRectangle(x+1, y+1, w-2, h-2, 0xffffff); |
DrawBar(x+2, y+2, w-3, h-3, 0x888888); |
} |
} |
:void MoreLessBox(dword x,y,s, bt_id_more, bt_id_less, color_border, color_button, color_text, value, text) |
{ |
#define VALUE_FIELD_W 26; |
DrawRectangle(x, y, VALUE_FIELD_W, s, color_border); |
DrawRectangle3D(x+1, y+1, VALUE_FIELD_W-2, s-2, 0xDDDddd, 0xffffff); |
DrawBar(x+2, y+2, VALUE_FIELD_W-3, s-3, 0xffffff); |
WriteText(x+6, s / 2 + y -3, 0x80, color_text, itoa(value)); |
DrawCaptButton(VALUE_FIELD_W + x + 1, y, s, s, bt_id_more, color_button, color_text, "+"); |
DrawCaptButton(VALUE_FIELD_W + x + s + 2, y, s, s, bt_id_less, color_button, color_text, "-"); |
WriteText(x+VALUE_FIELD_W+s+s+10, s / 2 + y -3, 0x80, color_text, text); |
} |
:void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent) |
{ |
int progress_w; |
static int fill_old; |
//if (progress_percent<=0) {DrawBar(st_x,st_y, st_x + st_w + fill_old + 15,st_h+1, col_fon); fill_old=0; return;} |
if (progress_percent<=0) || (progress_percent>=100) return; |
DrawRectangle(st_x, st_y, st_w,st_h, col_border); |
DrawRectangle3D(st_x+1, st_y+1, st_w-2,st_h-2, 0xFFFfff, 0xFFFfff); |
if (progress_percent>0) && (progress_percent<=100) |
{ |
progress_w = st_w - 3 * progress_percent / 100; |
DrawBar(st_x+2, st_y+2, progress_w, st_h-3, col_fill); |
DrawBar(st_x+2+progress_w, st_y+2, st_w-progress_w-3, st_h-3, 0xFFFfff); |
} |
} |
:void DrawLink(dword x,y,font_type,btn_id, inscription) |
{ |
int w; |
WriteText(x,y,font_type,0x4E00E7,inscription); |
if (font_type==0x80) w = strlen(inscription)*6; else w = strlen(inscription)*7; |
DefineButton(x-1,y-1,w,10,btn_id+BT_HIDE,0); |
DrawBar(x,y+8,w,1,0x4E00E7); |
} |
:void PutShadow(dword x,y,w,h,skinned,strength) |
{ |
proc_info wForm; |
dword shadow_buf, skin_height; |
shadow_buf = mem_Alloc(w*h*3); |
GetProcessInfo(#wForm, SelfInfo); |
CopyScreen(shadow_buf, 5*skinned+x+wForm.left, GetSkinHeight()*skinned+y+wForm.top, w, h); |
ShadowImage(shadow_buf, w, h, strength); |
_PutImage(x,y,w,h,shadow_buf); |
mem_Free(shadow_buf); |
} |
:void DrawPopup(dword x,y,w,h,skinned, col_work,col_border) |
{ |
DrawRectangle(x,y,w,h,col_border); |
DrawBar(x+1,y+1,w-1,1,0xFFFfff); |
DrawBar(x+1,y+2,1,h-2,0xFFFfff); |
if (col_work!=-1) DrawBar(x+2,y+2,w-2,h-2,col_work); |
DrawPopupShadow(x,y,w,h-1,skinned); |
} |
:void DrawPopupShadow(dword x,y,w,h,skinned) |
{ |
PutShadow(w+x+1,y,1,h+2,skinned,2); |
PutShadow(w+x+2,y+1,1,h+2,skinned,1); |
PutShadow(x,y+h+2,w+2,1,skinned,2); |
PutShadow(x+1,y+h+3,w+1,1,skinned,1); |
} |
:void GrayScaleImage(dword color_image, w, h) |
{ |
dword i,gray,rr,gg,bb; |
for (i = 0; i < w*h*3; i+=3) |
{ |
rr = DSBYTE[i+color_image]; |
gg = DSBYTE[i+1+color_image]; |
bb = DSBYTE[i+2+color_image]; |
gray = rr*rr; |
gray += gg*gg; |
gray += bb*bb; |
gray = sqrt(gray) / 3; |
DSBYTE[i +color_image] = DSBYTE[i+1+color_image] = DSBYTE[i+2+color_image] = gray; |
} |
} |
:void ShadowImage(dword color_image, w, h, strength) |
{ |
dword col, to; |
strength = 10 - strength; |
to = w*h*3 + color_image; |
for ( ; color_image < to; color_image++) |
{ |
col = strength * DSBYTE[color_image] / 10; |
DSBYTE[color_image] = col; |
} |
} |
/programs/cmm/lib/obj/box_lib.h |
---|
0,0 → 1,172 |
//BOX_LIB - Asper |
dword boxlib = #aEdit_box_lib; |
char aEdit_box_lib[]="/sys/lib/box_obj"; |
dword box_lib_init = #aboxlib_init; |
dword edit_box_draw = #aEdit_box_draw; |
dword edit_box_key = #aEdit_box_key; |
dword edit_box_mouse = #aEdit_box_mouse; |
dword version_ed = #aVersion_ed; |
dword scrollbar_v_draw = #aScrollbar_v_draw; |
dword scrollbar_v_mouse = #aScrollbar_v_mouse; |
dword scrollbar_h_draw = #aScrollbar_h_draw; |
dword scrollbar_h_mouse = #aScrollbar_h_mouse; |
dword version_scrollbar = #aVersion_scrollbar; |
dword PathShow_prepare = #aPathShow_prepare; |
dword PathShow_draw = #aPathShow_draw; |
dword progressbar_draw = #aProgressbar_draw; |
dword progressbar_progress = #aProgressbar_progress; |
dword check_box_draw = #aCheck_box_draw; |
dword check_box_mouse = #aCheck_box_mouse; |
dword version_ch = #aVersion_ch; |
dword frame_draw = #aFrame_draw; |
$DD 2 dup 0 |
char aEdit_box_draw [] = "edit_box"; |
char aEdit_box_key [] = "edit_box_key"; |
char aEdit_box_mouse[] = "edit_box_mouse"; |
char aVersion_ed [] = "version_ed"; |
char aboxlib_init[] = "lib_init"; |
char aScrollbar_v_draw [] = "scrollbar_v_draw"; |
char aScrollbar_v_mouse[] = "scrollbar_v_mouse"; |
char aScrollbar_h_draw [] = "scrollbar_h_draw"; |
char aScrollbar_h_mouse[] = "scrollbar_h_mouse"; |
char aVersion_scrollbar[] = "version_scrollbar"; |
char aCheck_box_draw [] = "check_box_draw2"; |
char aCheck_box_mouse [] = "check_box_mouse2"; |
char aVersion_ch [] = "version_ch2"; |
char aOption_box_draw [] = "option_box_draw"; |
char aOption_box_mouse [] = "option_box_mouse"; |
char aVersion_op [] = "version_op" ; |
char aPathShow_prepare [] = "PathShow_prepare"; |
char aPathShow_draw [] = "PathShow_draw"; |
char aProgressbar_draw [] = "progressbar_draw"; |
char aProgressbar_progress[] = "progressbar_progress"; |
char aFrame_draw[] = "frame_draw"; |
struct PathShow_data |
{ |
dword type; |
word start_y, |
start_x, |
font_size_x, // 6 - for font 0, 8 - for font 1 |
area_size_x; |
dword font_number, // 0 - monospace, 1 - variable |
background_flag, |
font_color, |
background_color, |
text_pointer, |
work_area_pointer, |
temp_text_length; |
}; |
/* |
char temp[128]; |
PathShow_data PathShow = {0, 100,20, 6, 200, 0, 1, 0x0, 0xFFFfff, #email_text, #temp, 0}; |
PathShow_prepare stdcall(#PathShow); |
PathShow_draw stdcall(#PathShow); |
*/ |
struct edit_box{ |
dword width, left, top, color, shift_color, focus_border_color, blur_border_color, |
text_color, max, text, mouse_variable, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, shift_old; |
}; |
struct checkbox2 |
{ |
dword |
left_s, |
top_s, |
ch_text_margin, |
color, |
border_color, |
text_color, |
text, |
flags, |
size_of_str; |
}; |
//flags for checkbox2 |
#define CH_FLAG_EN 10b |
#define CH_FLAG_TOP 0x0 |
#define CH_FLAG_MIDDLE 100b |
#define CH_FLAG_BOTTOM 1000b |
struct scroll_bar |
{ |
word size_x, |
start_x, |
size_y, |
start_y; |
dword btn_height, |
type, |
max_area, |
cur_area, |
position, |
bckg_col, |
frnt_col, |
line_col, |
redraw; |
word delta, |
delta2, |
r_size_x, |
r_start_x, |
r_size_y, |
r_start_y; |
dword m_pos, |
m_pos_2, |
m_keys, |
run_size, |
position2, |
work_size, |
all_redraw, |
ar_offset; |
}; |
struct progress_bar |
{ |
dword |
value, |
left, |
top, |
width, |
height, |
style, |
min, |
max, |
back_color, |
progress_color, |
frame_color; |
}; |
struct frame |
{ |
dword type; |
word size_x; |
word start_x; |
word size_y; |
word start_y; |
dword ext_col; |
dword int_col; |
dword draw_text_flag; // 0-not,1-yes |
dword text_pointer; |
dword text_position; // 0-up,1-bottom |
dword font_number; // 0-monospace,1-variable |
dword font_size_y; |
dword font_color; |
dword font_backgr_color; |
}; |
/programs/cmm/lib/obj/xml.h |
---|
0,0 → 1,126 |
dword XML = #aXML_lib; |
char aXML_lib[] = "/sys/lib/xml.obj"; |
dword XML_lib_init = #aXMLlib_init; |
dword initializeParser = #aInitializeParser; |
dword releaseParser = #aReleaseParser; |
dword parse = #aParse; |
dword initializeClassParser = #aInitializeClassParser; |
dword releaseCkassParser = #aReleaseClassParser; |
dword classFromElement = #aClassFromElement; |
dword classFromString = #aClassFromString; |
$DD 2 dup 0 |
char aXMLlib_init [] = "lib_init"; |
char aInitializeParser[] = "ax_initializeParser"; |
char aReleaseParser[] = "ax_releaseParser"; |
char aParse[] = "ax_parse"; |
char aInitializeClassParser[] = "ax_initializeClassParser"; |
char aReleaseClassParser[] = "ax_releaseClassParser"; |
char aClassFromElement[] = "ax_classFromElement"; |
char aClassFromString[] = "ax_classFromString"; |
//----------------------------------------------------------------------------- |
// Error Codes |
//----------------------------------------------------------------------------- |
#define RC_OK 0 // everything is ok |
#define RC_MEMORY 1 // out of memory |
#define RC_EMPTY_NAME 10 // name empty or not defined |
#define RC_ATTR_DEFINED 11 // attribute already defined |
#define RC_ELEM_DEFINED 12 // element already defined |
#define RC_SCHEMA_EMPTY 13 // schema does not contains a document |
#define RC_DOCUMENT_DEFINED 14 // schema contains more than one document |
#define RC_UNDEFINED_CLASS 15 // can't find collection in reference |
#define RC_UNDEFINED_GROUP 16 // can't find a group in include |
#define RC_INVALID_ID 17 // id is not a valid number |
#define RC_INVALID_IGNORE 18 // ignore is not 'yes' or 'no' |
#define RC_INVALID_ENTITY_REFERENCE 20 // must be amp, quot, lt, gt, or apos |
#define RC_UNEXPECTED_END 21 // found last char too early |
#define RC_INVALID_CHAR 22 // wrong char |
#define RC_OVERFLOW 23 // number to big in char reference |
#define RC_NO_START_TAG 24 // xml does not start with a tag |
#define RC_TAG_MISMATCH 25 // invalid close tag |
#define RC_INVALID_TAG 26 // invalid root element |
#define RC_INVALID_ATTRIBUTE 27 // unknown attribute |
#define RC_INVALID_PI 28 // invalid processing instruction (<?xml) |
#define RC_INVALID_DOCTYPE 29 // duplicate doctype or after main element |
#define RC_VERSION_EXPECTED 30 // version is missing in xml declaration |
//----------------------------------------------------------------------------- |
// Structures |
//----------------------------------------------------------------------------- |
struct AXElementClass |
{ |
dword offset; // (int) Offset of the element in attribute list |
dword name; // (char*) Name of the element (not zero terminated) |
dword nameLimit; // (char*) End of the name of the element |
dword size; // (unsigned int) size in bytes of an element of this class |
dword id; // (unsigned int) container, text or mixed |
dword type; // (unsigned int) container, text or mixed |
dword propertyCount; // (unsigned int) number of attributes and text elements |
dword childCount; // (unsigned int) number of child classes |
dword attributes; // (int*) (internal) attribute map |
dword elements; // (int*) (internal) element map |
dword children; // (AXElementClass*) The list of child classes. |
// The order is the one defined in the class |
// definition file. |
dword reserved; // (int) |
dword reserved2; // (void*) |
}; |
struct AXClassContext |
{ |
dword base; // (void*) |
dword limit; // (void*) |
dword chunks; // (void*) |
dword chunkSize; // (int) |
dword errorCode; // (int) |
dword line; // (int) |
dword column; // (int) |
dword classes; // (AXElementClass**) all global classes |
dword rootClass; // (AXElementClass*) the root class |
dword rootElement; // (AXElement*) |
}; |
struct AXAttribute |
{ |
dword begin; // (const char*) the value (not zero terminated) |
// This slot can also contain an element if |
// a <element> has been defined in schema; |
// use ax_getElement() to retrieve it. |
dword limit; // (const char*) the end of the value |
}; |
struct AXElement |
{ |
dword id; // (int) the class of the element |
dword nextSibling; // (AXElement*) the next sibling element |
dword firstChild; // (AXElement*) the first child element |
dword lastChild; // (AXElement*) the last child element |
AXAttribute reserved; // (AXAttribute) do not use |
AXAttribute attributes; // (AXAttribute[]) the array of attributes |
}; |
struct AXParseContext |
{ |
dword base; // (void*) |
dword limit; // (void*) |
dword chunks; // (void*) |
dword chunkSize; // (int) |
dword errorCode; // (int) |
dword source; // (const char*) |
dword current; // (const char*) |
dword line; // (int) |
dword column; // (int) |
dword root; // (AXElement*) |
AXAttribute version; // (AXAttribute) |
AXAttribute encoding; // (AXAttribute) |
dword strict; // (int) |
dword reserved1; // (int) |
AXElement reserved2; // (AXElement) |
}; |
/programs/cmm/lib/obj/libini.h |
---|
0,0 → 1,25 |
dword libini = #alibini; |
char alibini[] = "/sys/lib/libini.obj"; |
dword lib_init = #alib_init; |
dword ini_enum_sections = #aini_enum_sections; |
dword ini_enum_keys = #aini_enum_keys; |
dword ini_get_str = #aini_get_str; |
dword ini_get_int = #aini_get_int; |
dword ini_get_color = #aini_get_color; |
dword ini_set_str = #aini_set_str; |
dword ini_set_int = #aini_set_int; |
//dword ini_set_color = #aini_set_color; |
//dword ini_get_shortcut = #aini_get_shortcut; |
$DD 2 dup 0 |
char alib_init[] = "lib_init"; |
char aini_enum_sections[] = "ini_enum_sections"; |
char aini_enum_keys[] = "ini_enum_keys"; |
char aini_get_str[] = "ini_get_str"; |
char aini_get_int[] = "ini_get_int"; |
char aini_set_str[] = "ini_set_str"; |
char aini_set_int[] = "ini_set_int"; |
//char aini_get_shortcut[] = "ini_get_shortcut"; |
char aini_get_color[] = "ini_get_color"; |
//char aini_set_color[] = "ini_set_color"; |
/programs/cmm/lib/obj/http.h |
---|
0,0 → 1,56 |
//HTTP library |
dword libHTTP = #alibHTTP; |
char alibHTTP[23] = "/sys/lib/http.obj\0"; |
dword http_lib_init = #aLib_init; |
dword http_get = #aHTTPget; |
dword http_head = #aHTTPhead; |
dword http_post = #aHTTPpost; |
dword http_find_header_field = #aFHF; |
dword http_process = #aHTTPprocess; |
dword http_free = #aHTTPfree; |
dword http_stop = #aHTTPstop; |
dword uri_escape = #aURIescape; |
dword uri_unescape = #aURIunescape; |
$DD 2 dup 0 |
char aLib_init[9] = "lib_init\0"; |
char aHTTPget[4] = "get\0"; |
char aHTTPhead[5] = "head\0"; |
char aHTTPpost[5] = "post\0"; |
char aFHF[18] = "find_header_field\0"; |
char aHTTPprocess[8] = "process\0"; |
char aHTTPfree[5] = "free\0"; |
char aHTTPstop[5] = "stop\0"; |
char aURIescape[7] = "escape\0"; |
char aURIunescape[9] = "unescape\0"; |
#define FLAG_HTTP11 1 << 0 |
#define FLAG_GOT_HEADER 1 << 1 |
#define FLAG_GOT_ALL_DATA 1 << 2 |
#define FLAG_CONTENT_LENGTH 1 << 3 |
#define FLAG_CHUNKED 1 << 4 |
#define FLAG_CONNECTED 1 << 5 |
// error flags go into the upper word |
#define FLAG_INVALID_HEADER 1 << 16 |
#define FLAG_NO_RAM 1 << 17 |
#define FLAG_SOCKET_ERROR 1 << 18 |
#define FLAG_TIMEOUT_ERROR 1 << 19 |
#define FLAG_TRANSFER_FAILED 1 << 20 |
struct http_msg{ |
dword socket; |
dword flags; |
dword write_ptr; |
dword buffer_length; |
dword chunk_ptr; |
dword timestamp; |
dword status; |
dword header_length; |
dword content_ptr; |
dword content_length; |
dword content_received; |
char http_header; |
}; |
/programs/cmm/lib/obj/iconv.h |
---|
0,0 → 1,59 |
//convert text characters |
dword iconv_lib = #a_iconv_lib; |
char a_iconv_lib[19]="/sys/lib/iconv.obj\0"; |
dword iconv_open = #aIconv_open; |
dword iconv = #aIconv; |
$DD 2 dup 0 |
char aIconv_open[11] = "iconv_open\0"; |
char aIconv[6] = "iconv\0"; |
dword ChangeCharset(dword from_chs, to_chs, conv_buf) |
{ |
dword cd, in_len, out_len, new_buf; |
iconv_open stdcall (from_chs, to_chs); //CP866, CP1251, CP1252, KOI8-RU, UTF-8, ISO8859-5 |
if (EAX==-1) |
{ |
debug(from_chs); |
debug(to_chs); |
debug("iconv: wrong charset,\nuse only CP866, CP1251, CP1252, KOI8-RU, UTF-8, ISO8859-5"); |
return 0; |
} |
cd = EAX; |
in_len = out_len = strlen(conv_buf)+1; |
new_buf = mem_Alloc(in_len); |
iconv stdcall (cd, #conv_buf, #in_len, #new_buf, #out_len); |
cd = EAX; |
if (cd!=0) |
{ |
debug("iconv: something is wrong with stdcall iconv()"); |
debugi(cd); |
debug("in_len"); |
debugi(in_len); |
debug("out_len"); |
debugi(out_len); |
new_buf = free(new_buf); |
return 0; |
} |
strcpy(conv_buf, new_buf); |
free(new_buf); |
return conv_buf; |
} |
char *charsets[] = { " ", "UTF-8", "KOI8-RU", "CP1251", "CP1252", "ISO8859-5", "CP866"}; |
int cur_charset; |
enum { |
CH_NULL, |
CH_UTF8, |
CH_KOI8, |
CH_CP1251, |
CH_CP1252, |
CH_ISO8859_5, |
CH_CP866 |
}; |
/programs/cmm/lib/obj/libimg_lib.h |
---|
0,0 → 1,102 |
//Asper |
//library |
dword libimg = #alibimg; |
char alibimg[21] = "/sys/lib/libimg.obj\0"; |
dword libimg_init = #alibimg_init; |
dword img_is_img = #aimg_is_img; |
dword img_to_rgb2 = #aimg_to_rgb2; |
dword img_decode = #aimg_decode; |
dword img_destroy = #aimg_destroy; |
dword img_draw = #aimg_draw; |
//dword img_flip = #aimg_flip; |
//dword img_rotate = #aimg_rotate; |
$DD 2 dup 0 |
//import libimg , \ |
char alibimg_init[9] = "lib_init\0"; |
char aimg_is_img[11] = "img_is_img\0"; |
char aimg_to_rgb2[12] = "img_to_rgb2\0"; |
char aimg_decode[11] = "img_decode\0"; |
char aimg_destroy[12] = "img_destroy\0"; |
char aimg_draw[9] = "img_draw\0"; |
//char aimg_flip[9] = "img_flip\0"; |
//char aimg_rotate[11] = "img_rotate\0 "; |
dword load_image(dword filename) |
{ |
//align 4 |
dword img_data=0; |
dword img_data_len=0; |
dword fh=0; |
dword image=0; |
byte tmp_buf[40]; |
$and img_data, 0 |
//$mov eax, filename |
//$push eax |
//invoke file.open, eax, O_READ |
file_open stdcall (filename, O_READ); |
$or eax, eax |
$jnz loc05 |
$stc |
return 0; |
@loc05: |
$mov fh, eax |
//invoke file.size |
file_size stdcall (filename); |
$mov img_data_len, ebx |
//stdcall mem.Alloc, ebx |
mem_Alloc(EBX); |
$test eax, eax |
$jz error_close |
$mov img_data, eax |
//invoke file.read, [fh], eax, [img_data_len] |
file_read stdcall (fh, EAX, img_data_len); |
$cmp eax, -1 |
$jz error_close |
$cmp eax, img_data_len |
$jnz error_close |
//invoke file.close, [fh] |
file_close stdcall (fh); |
$inc eax |
$jz error_ |
//; img.decode checks for img.is_img |
//; //invoke img.is_img, [img_data], [img_data_len] |
//; $or eax, eax |
//; $jz exit |
//invoke img.decode, [img_data], [img_data_len], 0 |
EAX=img_data; |
img_decode stdcall (EAX, img_data_len,0); |
$or eax, eax |
$jz error_ |
$cmp image, 0 |
$pushf |
$mov image, eax |
//call init_frame |
$popf |
//call update_image_sizes |
mem_Free(img_data);//free_img_data(img_data); |
$clc |
return image; |
@error_free: |
//invoke img.destroy, [image] |
img_destroy stdcall (image); |
$jmp error_ |
@error_pop: |
$pop eax |
$jmp error_ |
@error_close: |
//invoke file.close, [fh] |
file_close stdcall (fh); |
@error_: |
mem_Free(img_data); |
$stc |
return 0; |
} |
/programs/cmm/lib/obj/libio_lib.h |
---|
0,0 → 1,34 |
//Asper |
//library |
dword libio = #alibio; |
char alibio[21] = "/sys/lib/libio.obj\0"; //"libio.obj\0"; |
dword libio_init = #alibio_init; |
dword file_size = #afile_size; |
dword file_open = #afile_open; |
dword file_read = #afile_read; |
dword file_close = #afile_close; |
$DD 2 dup 0 |
//import libio , \ |
char alibio_init[9] = "lib_init\0"; |
char afile_size[11] = "file_size\0"; |
char afile_open[12] = "file_open\0"; |
char afile_read[11] = "file_read\0"; |
char afile_close[12] = "file_close\0"; |
//align 4 |
//dword fh=0; |
#define O_BINARY 0 |
#define O_READ 1 |
#define O_WRITE 2 |
#define O_CREATE 4 |
#define O_SHARE 8 |
#define O_TEXT 16 |
#define SEEK_SET 0 |
#define SEEK_CUR 1 |
#define SEEK_END 2 |
/programs/cmm/lib/obj/netcode.h |
---|
0,0 → 1,19 |
//Network library |
dword netcode_lib = #a_netcode_lib; |
char a_netcode_lib[21]="/sys/lib/netcode.obj\0"; |
dword base64_encode = #aBase64_encode; |
dword base64_decode = #aBase64_decode; |
dword qp_decode = #aQp_decode; |
$DD 2 dup 0 |
char aBase64_encode[14] = "base64_encode\0"; |
char aBase64_decode[14] = "base64_decode\0"; |
char aQp_decode[10] = "qp_decode\0"; |
/*int base64_encode(char inp[], char outp[], int len); |
Кодирование массива inp длиной len в массив outp (строку с '\0'). Функция возвращает длину outp. |
int base64_decode(char inp[], char outp[], int len); |
Декодирование массива inp длиной len в массив outp (строку с '\0'). Функция возвращает длину outp.*/ |
/programs/cmm/lib/obj/network.h |
---|
0,0 → 1,63 |
//Network library |
dword network_lib = #a_network_lib; |
char a_network_lib[21]="/sys/lib/network.obj\0"; |
dword network_lib_init = #aLib_init; |
dword inet_addr = #aInet_addr; //"192.168.0.1" -> dword IP |
dword inet_ntoa = #aInet_ntoa; |
dword getaddrinfo = #aGetaddrinfo; |
dword getaddrinfo_start = #aGetaddrinfo_start; |
dword getaddrinfo_process = #aGetaddrinfo_process; |
dword getaddrinfo_abort = #aGetaddrinfo_abort; |
dword freeaddrinfo = #aFreeaddrinfo; |
$DD 2 dup 0 |
char aLib_init[9] = "lib_init\0"; |
char aInet_addr[10] = "inet_addr\0"; |
char aInet_ntoa[10] = "inet_ntoa\0"; |
char aGetaddrinfo[12] = "getaddrinfo\0"; |
char aGetaddrinfo_start[18] = "getaddrinfo_start\0"; |
char aGetaddrinfo_process[20] = "getaddrinfo_process\0"; |
char aGetaddrinfo_abort[18] = "getaddrinfo_abort\0"; |
char aFreeaddrinfo[13] = "freeaddrinfo\0"; |
/* |
addr соответствует IP 10.101.102.103 |
itoa((addr&0xFF000000)>>24) равно 103 |
itoa((addr&0xFF0000)>>16) —это 102 |
itoa((addr&0xFF00)>>8) — это 101 |
itoa(addr&0xFF) — это 10 |
*/ |
dword GetIPfromAdress(dword addr) |
{ |
dword lpointer, IPa; |
getaddrinfo stdcall (addr, 0, 0, #lpointer); |
if (EAX!=0) IPa = 0; else IPa = DSDWORD[DSDWORD[lpointer+24]+4]; |
freeaddrinfo stdcall (lpointer); |
return IPa; |
} |
/* |
//Convert the string from standard IPv4 dotted notation to integer IP addr. |
inet_addr stdcall ("192.168.0.1"); |
server_IP = EAX; |
char* __stdcall inet_ntoa(struct in_addr in); |
Convert the Internet host address to standard IPv4 dotted notation. |
getaddrinfo(__in const char* hostname, __in const char* servname, |
__in const struct addrinfo* hints, __out struct addrinfo **res); |
struct addrinfo { |
int ai_flags; |
int ai_family; |
int ai_socktype; |
int ai_protocol; |
size_t ai_addrlen; |
struct sockaddr *ai_addr; |
char *ai_canonname; |
struct addrinfo *ai_next; |
}; |
*/ |
/programs/cmm/lib/obj/truetype.h |
---|
0,0 → 1,27 |
//ýòî âñòàâèòü ïîñëå çàãðóçêè îñíîâíûõ áèáëèîòåê |
char fontinfo[28]; |
dword libtruetype = #att; |
char att[] = "/sys/lib/truetype.obj"; //"truetype.obj\0"; |
dword truetype = #att_truetype; |
dword get_length = #att_get_length; |
dword get_width = #att_get_width; |
dword text_out = #att_text_out; |
dword init_font = #att_init_font; |
$DD 2 dup 0 |
//import libimg , \ |
char att_truetype[] = "truetype"; |
char att_get_length[] = "get_length"; |
char att_get_width[] = "get_width"; |
char att_text_out[] = "text_out"; |
char att_init_font[] = "init_font"; |
//load_dll2(libtruetype, #truetype,0); |
//à ýòî - â ìîìåíò îòðèñîâêè îêíà |
//text_out stdcall (#text, -1, 40, 0xFF0000, 100, 100); |
/programs/cmm/lib/obj |
---|
Property changes: |
Added: tsvn:logminsize |
+5 |
\ No newline at end of property |
/programs/cmm/lib/socket.h |
---|
0,0 → 1,96 |
#define SOCK_STREAM 1 |
#define SOCK_DGRAM 2 |
#define AF_INET4 2 |
#define MSG_PEEK 0x02 |
#define MSG_DONTWAIT 0x40 |
dword errorcode; |
struct sockaddr_in{ |
word sin_family; |
word sin_port; |
dword sin_addr; |
char padding[8]; |
}; |
inline fastcall dword Socket(ECX, EDX, ESI) |
{ |
$push ebx |
$mov eax, 75 |
$mov ebx, 0 |
$int 0x40 |
errorcode = EBX; |
$pop ebx |
} |
inline fastcall dword Close(ECX) |
{ |
$push ebx |
$mov eax, 75 |
$mov ebx, 1 |
$int 0x40 |
errorcode = EBX; |
$pop ebx |
} |
inline fastcall dword Bind(ECX, EDX, ESI) |
{ |
$push ebx |
$mov eax, 75 |
$mov ebx, 2 |
$int 0x40 |
errorcode = EBX; |
$pop ebx |
} |
inline fastcall dword Listen(ECX, EDX) |
{ |
$push ebx |
$mov eax, 75 |
$mov ebx, 3 |
$int 0x40 |
errorcode = EBX; |
$pop ebx |
} |
inline fastcall dword Connect(ECX, EDX, ESI) |
{ |
$push ebx |
$mov eax, 75 |
$mov ebx, 4 |
$int 0x40 |
errorcode = EBX; |
$pop ebx |
} |
inline fastcall dword Accept(ECX, EDX, ESI) |
{ |
$push ebx |
$mov eax, 75 |
$mov ebx, 5 |
$int 0x40 |
errorcode = EBX; |
$pop ebx |
} |
inline fastcall dword Send(ECX, EDX, ESI, EDI) |
{ |
$push ebx |
$mov eax, 75 |
$mov ebx, 6 |
$int 0x40 |
errorcode = EBX; |
$pop ebx |
} |
inline fastcall dword Receive(ECX, EDX, ESI, EDI) |
{ |
$push ebx |
$mov eax, 75 |
$mov ebx, 7 |
$int 0x40 |
errorcode = EBX; |
$pop ebx |
} |
/programs/cmm/liza/liza.c |
---|
7,19 → 7,19 |
#include "../lib/mem.h" |
#include "../lib/dll.h" |
#include "../lib/encoding.h" |
#include "../lib/figures.h" |
#include "../lib/gui.h" |
#include "../lib/file_system.h" |
#include "../lib/list_box.h" |
#include "../lib/socket_new.h" |
#include "../lib/socket.h" |
#include "../lib/draw_buf.h" |
#include "../lib/cursor.h" |
//*.obj libraries |
#include "../lib/lib.obj/box_lib.h" |
#include "../lib/lib.obj/network.h" |
#include "../lib/lib.obj/libio_lib.h" |
#include "../lib/lib.obj/libimg_lib.h" |
#include "../lib/lib.obj/netcode.h" |
#include "../lib/lib.obj/iconv.h" |
#include "../lib/obj/box_lib.h" |
#include "../lib/obj/network.h" |
#include "../lib/obj/libio_lib.h" |
#include "../lib/obj/libimg_lib.h" |
#include "../lib/obj/netcode.h" |
#include "../lib/obj/iconv.h" |
//images |
byte letter_icons[sizeof(file "img/letter_icons.raw")] = FROM "img/letter_icons.raw"; |
#include "img/letter_icons.h" |
102,7 → 102,7 |
void main() { |
mem_Init(); |
CursorPointer.Load(#CursorFile); |
if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("Error while loading library - box_lib.obj"); |
if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("Error while loading library - box_obj"); |
if (load_dll2(network_lib, #network_lib_init,0)!=0) notify("Error while loading library - network.obj"); |
if (load_dll2(netcode_lib, #base64_encode,0)!=0) notify("Error while loading library - netcode.obj"); |
if (load_dll2(iconv_lib, #iconv_open,0)!=0) { notify("Error while loading library - iconv.obj"); use_iconv=2; } |
/programs/cmm/notify/notify.c |
---|
5,7 → 5,7 |
#include "..\lib\kolibri.h" |
#include "..\lib\strings.h" |
#include "..\lib\mem.h" |
#include "..\lib\figures.h" |
#include "..\lib\gui.h" |
dword shadow_buf_24, shadow_buf_32, lighter_pixel1, lighter_pixel2; |
/programs/cmm/panels_cfg/panels_cfg.c |
---|
5,11 → 5,11 |
#include "..\lib\mem.h" |
#include "..\lib\file_system.h" |
#include "..\lib\dll.h" |
#include "..\lib\figures.h" |
#include "..\lib\gui.h" |
#include "..\lib\lib.obj\libio_lib.h" |
#include "..\lib\lib.obj\libini.h" |
#include "..\lib\lib.obj\box_lib.h" |
#include "..\lib\obj\libio_lib.h" |
#include "..\lib\obj\libini.h" |
#include "..\lib\obj\box_lib.h" |
#include "..\lib\patterns\libimg_load_skin.h" |
/programs/cmm/pixie/pixie.c |
---|
11,12 → 11,12 |
#include "..\lib\dll.h" |
#include "..\lib\file_system.h" |
#include "..\lib\list_box.h" |
#include "..\lib\figures.h" |
#include "..\lib\gui.h" |
#include "..\lib\lib.obj\box_lib.h" |
#include "..\lib\lib.obj\libio_lib.h" |
#include "..\lib\lib.obj\libimg_lib.h" |
#include "..\lib\lib.obj\libini.h" |
#include "..\lib\obj\box_lib.h" |
#include "..\lib\obj\libio_lib.h" |
#include "..\lib\obj\libimg_lib.h" |
#include "..\lib\obj\libini.h" |
#include "..\lib\patterns\libimg_load_skin.h" |
/programs/cmm/software_widget/software_widget.c |
---|
8,11 → 8,11 |
#include "..\lib\mem.h" |
#include "..\lib\file_system.h" |
#include "..\lib\dll.h" |
#include "..\lib\figures.h" |
#include "..\lib\gui.h" |
#include "..\lib\lib.obj\libio_lib.h" |
#include "..\lib\lib.obj\libimg_lib.h" |
#include "..\lib\lib.obj\libini.h" |
#include "..\lib\obj\libio_lib.h" |
#include "..\lib\obj\libimg_lib.h" |
#include "..\lib\obj\libini.h" |
#include "..\lib\patterns\libimg_load_skin.h" |
/programs/cmm/tmpdisk/t_gui.c |
---|
2,8 → 2,8 |
///////////////////////// GUI //////////////////// |
///////////////////////////////////////////////////////////////////////////////////////// |
#include "..\lib\figures.h" |
#include "..\lib\lib.obj\box_lib.h" |
#include "..\lib\gui.h" |
#include "..\lib\obj\box_lib.h" |
#ifdef LANG_RUS |
unsigned char *but_text[]={ |
/programs/cmm/tmpdisk/tmpdisk.c |
---|
5,8 → 5,8 |
#include "..\lib\file_system.h" |
#include "..\lib\dll.h" |
#include "..\lib\lib.obj\libio_lib.h" |
#include "..\lib\lib.obj\libini.h" |
#include "..\lib\obj\libio_lib.h" |
#include "..\lib\obj\libini.h" |
#ifndef AUTOBUILD |
#include "lang.h--" |