Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 6637 → Rev 6638

/programs/cmm/clipview/clipview
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/cmm/clipview/clipview.c
17,7 → 17,7
// //
//===================================================//
 
?define WINDOW_HEADER "Clipboard Viewer v1.01"
?define WINDOW_HEADER "Clipboard Viewer v1.02"
?define T_DELETE_LAST_SLOT "Delete last slot"
?define T_DELETE_ALL_SLOTS "Delete all slots"
?define T_RESET_BUFFER_LOCK "Reset the lock buffer"
149,18 → 149,24
scrollbar_v_draw(#scroll1);
}
 
replace_char(dword in_str, char from_char, to_char, int length) {
int i;
for (i=0; i<length; i++) {
if (ESBYTE[in_str+i] == from_char) ESBYTE[in_str+i] = to_char;
}
ESBYTE[in_str+length]=0;
}
 
void Draw_List()
{
int i, yyy, list_last, slot_data_type_number;
dword text_color = 0x000000;
char line_text[512];
int i, yyy, list_last, slot_data_type_number, length;
dword line_text[2048];
dword size_kb;
dword text_color = 0;
 
list.count = clipboard.GetSlotCount();
list.CheckDoesValuesOkey();
 
 
if (list.count > list.visible) list_last = list.visible; else list_last = list.count;
 
for (i=0; i<list.visible; i++;) DeleteButton(list.first + i + 100);
181,11 → 187,15
DefineButton(list.x+list.w - 95, yyy, 50, list.item_h, 100+i+BT_HIDE, NULL);
DefineButton(list.x+list.w - 95 + 51, yyy, 40, list.item_h, 300+i+BT_HIDE, NULL);
 
strlcpy(#line_text, clipboard.slot_data.content, list.w-236 - 95/list.font_w-3);
length = list.w-236 - 95 / list.font_w - 2;
if (clipboard.slot_data.size-8 < length) length = clipboard.slot_data.size-8;
memmov(#line_text, clipboard.slot_data.content, length);
replace_char(#line_text, 0, 31, length); // 31 is a dot
WriteText(list.x+236, yyy+list.text_y, list.font_type, text_color, #line_text);
}
DrawBar(list.x,i*list.item_h+list.y, list.w, -i*list.item_h+ list.h, 0xFFFfff);
if (!list.count) WriteText(-strlen(T_CLIPBOARD_IS_EMPTY)*list.font_w + list.w / 2 + list.x + 1, list.h / 2 - 8 + list.y, list.font_type, 0x999999, T_CLIPBOARD_IS_EMPTY);
if (!list.count) WriteText(-strlen(T_CLIPBOARD_IS_EMPTY)*list.font_w + list.w / 2 + list.x + 1,
list.h / 2 - 8 + list.y, list.font_type, 0x999999, T_CLIPBOARD_IS_EMPTY);
DrawScroller();
}
 
/programs/cmm/dicty/speaker.raw
File deleted
\ No newline at end of file
/programs/cmm/dicty/speaker.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/cmm/dicty/dicty.c
8,35 → 8,33
#include "..\lib\gui.h"
#include "..\lib\obj\box_lib.h"
 
unsigned char speaker[23*40*3]= FROM "speaker.raw";
 
#ifdef LANG_RUS
#define WINDOW_TITLE "‘«®¢ à¨ª 2.0"
#define WINDOW_TITLE "‘«®¢ à¨ª 2.2"
#define DICTIONARY_NOT_FOUND "‘«®¢ àì ­¥ ­ ©¤¥­"
#define DICTIONARY_LOADED "‘«®¢ àì § £à㦥­"
#define WORD_NOT_FOUND "‘«®¢® ­¥ ­ ©¤¥­® ¢ á«®¢ à¥"
#define ERROR "Žè¨¡ª  #"
#define ERROR "Žè¨¡ª  #%d"
#else
#define WINDOW_TITLE "Dictionary v2.0"
#define WINDOW_TITLE "Dictionary v2.2"
#define DICTIONARY_NOT_FOUND "Dictionary not found"
#define DICTIONARY_LOADED "Dictionary loaded"
#define WORD_NOT_FOUND "Word isn't found in the dictionary"
#define ERROR "Error #"
#define ERROR "Error #%d"
#endif
 
proc_info Form;
char edword[256], search_word[256], translate_result[4096];
#define PRONOUNCED_FILE "/sys/pronounced.txt"
#define SPEECH_PATH "/kolibrios/media/speech/speech"
#define TOPH 44
 
#define TEXT_ENG_RUS "ENG\26RUS"
#define TEXT_RUS_ENG "RUS\26ENG"
#define TEXT_VOCABULARIES "ENG RUS"
#define ENG_RUS 0
#define RUS_ENG 1
#define BUTTON_CHANGE_LANGUAGE 10
int active_dict=2;
 
int mouse_dd, speaker_id;
int mouse_dd;
edit_box edit1= {200,16,16,0xffffff,0x94AECE,0xffffff,0x94AECE,0,248,#edword,#mouse_dd,100000000000010b};
 
 
62,24 → 60,11
 
case evButton:
id=GetButtonID();
if (id==01) { KillProcess(speaker_id); ExitProcess(); }
if (id==10) { OpenDictionary(ENG_RUS); DrawLangButtons(); }
if (id==11) { OpenDictionary(RUS_ENG); DrawLangButtons(); }
if (id==15)
{
if (GetProcessSlot(speaker_id)!=0))
{
KillProcess(speaker_id);
pause(50);
if (id==01) ExitProcess();
if (id==BUTTON_CHANGE_LANGUAGE) {
if (active_dict == ENG_RUS) OpenDictionary(RUS_ENG); else OpenDictionary(ENG_RUS);
DrawLangButtons();
}
else
{
if (WriteFile(strlen(#translate_result)+1, #translate_result, PRONOUNCED_FILE)!=0) break;
pause(50);
speaker_id = RunProgram(SPEECH_PATH, PRONOUNCED_FILE);
}
SpeakerDraw();
}
break;
 
case evKey:
91,7 → 76,7
case evReDraw:
system.color.get();
DefineAndDrawWindow(215,120,400,250,0x73,system.color.work,WINDOW_TITLE);
DefineAndDrawWindow(215,120,500,350,0x73,system.color.work,WINDOW_TITLE);
GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2) break;
if (Form.height<140) { MoveSize(OLD,OLD,OLD,140); break; }
102,6 → 87,7
edit_box_draw stdcall(#edit1);
DrawWideRectangle(edit1.left-2, edit1.top-2, edit1.width+3, 19, 2, 0xffffff);
DrawRectangle(edit1.left-3, edit1.top-3, edit1.width+4, 20, system.color.work_graph);
WriteText(Form.width-120, edit1.top, 0x90, system.color.work_text, TEXT_VOCABULARIES);
DrawTranslation();
DrawLangButtons();
}
111,34 → 97,16
 
void DrawLangButtons()
{
DrawCaptButton(Form.width-130, edit1.top-3, 50,19, 10, system.color.work_button, system.color.work_button_text, TEXT_ENG_RUS);
DrawCaptButton(Form.width-70, edit1.top-3, 50,19, 11, system.color.work_button, system.color.work_button_text, TEXT_RUS_ENG);
PutShadow(-active_dict*60 + Form.width-70, edit1.top-3, 50,19, 1, 2);
SpeakerDraw();
dword direction;
DefineButton(Form.width-88, edit1.top-4, 20, 20, BUTTON_CHANGE_LANGUAGE, system.color.work_button);
if (active_dict == ENG_RUS) direction = "\26"; else direction = "\27";
WriteText(Form.width-82, edit1.top-1, 10000001b, system.color.work_button_text, direction);
}
 
void SpeakerDraw()
{
dword x, y;
x = Form.cwidth-38;
y = Form.cheight-32;
if (active_dict)
{
DeleteButton(15);
DrawBar(x,y,23,20,0xFFFFFF);
}
else
{
DefineButton(x-5, y-5, 23+10, 20+9, 15+BT_HIDE+BT_NOFRAME, 0);
if (GetProcessSlot(speaker_id)==0)) _PutImage(x, y, 23,20, #speaker); else _PutImage(x, y, 23,20, 23*20*3+#speaker);
}
}
 
void Translate()
{
dword translation_start, translation_end;
 
KillProcess(speaker_id);
sprintf(#search_word, "\10%s\13", #edword);
strupr(#search_word);
 
165,7 → 133,6
{
dword res;
if (dict_id==active_dict) return;
KillProcess(speaker_id);
active_dict = dict_id;
if (io.buffer_data) free(io.buffer_data);
if (active_dict==ENG_RUS) res=io.read("dictionaries/eng - rus.dict");
187,34 → 154,17
 
void DrawTranslation()
{
int text_break=0;
char tt[4096]='';
int y_pos=TOPH+1;
char draw_buf[4096];
strcpy(#draw_buf, #translate_result);
strlcpy(#draw_buf, #translate_result, sizeof(draw_buf));
DrawBar(0, y_pos, Form.width-9, Form.cheight - y_pos, 0xFFFFFF);
strttl(#draw_buf);
WriteTextB(10+1, y_pos+8, 10000001b, 0x800080, #search_word);
while (draw_buf)
{
text_break= Form.width/6-6;
if (text_break>strlen(#draw_buf))
{
WriteText(10, y_pos+31, 0x80, 0, #draw_buf);
break;
 
DrawTextViewArea(10, y_pos+31, Form.cwidth-20, Form.cheight-30, 15,
#draw_buf, -1, 0x000000);
}
while (draw_buf[text_break]<>' ') && (text_break>0) text_break--;
strcpy(#tt, #draw_buf+text_break+1);
draw_buf[text_break]=0x0;
WriteText(10, y_pos+31, 0x80, 0, #draw_buf);
strcpy(#draw_buf, #tt);
y_pos+=12;
if (y_pos+24+8>Form.cheight) break;
}
SpeakerDraw();
}
 
 
stop:
/programs/cmm/lib/gui.h
291,9 → 291,6
buf_end = strlen(buf_start) + buf_start;
label_length_max = w / 8; // 8 big font char width
 
//DrawRectangle(x-2, y-2, w+4, h+4, system.color.work_graph);
//DrawRectangle3D(x-1, y-1, w+2, h+2, 0xDDDddd, 0xffffff);
 
loop()
{
if (bg_col!=-1) DrawBar(x, y, w+1, line_h, bg_col);