add tcc/samples/build_all.sh

git-svn-id: svn://kolibrios.org@7910 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-05-11 07:32:44 +00:00
parent d1df3e2bfe
commit 842c228f23
6 changed files with 30 additions and 74 deletions

View File

@ -307,6 +307,9 @@ void SetElementSizes()
void draw_window()
{
int i;
bool burger_active = false;
if (menu_id == OPEN_FILE) burger_active = true;
SetElementSizes();
DrawBar(0,0, Form.cwidth,PADDING, sc.work);
@ -316,9 +319,9 @@ void draw_window()
DrawBar(0, PADDING, address_box.left-2, TSZE+1, sc.work);
DrawBar(address_box.left+address_box.width+18, PADDING, Form.cwidth-address_box.left-address_box.width-18, TSZE+1, sc.work);
DrawTopPanelButton(BACK_BUTTON, PADDING-1, PADDING, 30);
DrawTopPanelButton(FORWARD_BUTTON, PADDING+TSZE+PADDING-2, PADDING, 31);
DrawTopPanelButton(SANDWICH_BUTTON, Form.cwidth-PADDING-TSZE-3, PADDING, -1); //burger menu
DrawTopPanelButton(BACK_BUTTON, PADDING-1, PADDING, 30, false);
DrawTopPanelButton(FORWARD_BUTTON, PADDING+TSZE+PADDING-2, PADDING, 31, false);
DrawTopPanelButton(SANDWICH_BUTTON, Form.cwidth-PADDING-TSZE-3, PADDING, -1, burger_active); //burger menu
DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, sc.work_graph);
@ -763,10 +766,12 @@ void EventShowEncodingsList()
void ProcessMenuClick()
{
int click_id;
if (menu_id) && (click_id = get_menu_click()) {
click_id += menu_id - 1;
menu_id = NULL;
ProcessEvent(click_id);
if (menu_id) {
if (click_id = get_menu_click()) {
click_id += menu_id - 1;
ProcessEvent(click_id);
}
if (!menu_process_id) menu_id = NULL;
}
}

View File

@ -180,7 +180,7 @@ void draw_window()
DrawEditBoxWebView();
}
DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col);
DrawTopPanelButton(OPEN_PAGE, 10, address_box.top-3, 0);
DrawTopPanelButton(OPEN_PAGE, 10, address_box.top-3, 0, false);
}

View File

@ -209,8 +209,7 @@
:void PutShadow(dword x,y,w,h,skinned,strength)
{
proc_info wForm;
dword shadow_buf, skin_height;
shadow_buf = mem_Alloc(w*h*3);
dword 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);

View File

@ -1,5 +1,5 @@
unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n)
unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed)
{
#define TSZE 25
static libimg_image top_icons;
@ -17,14 +17,21 @@ unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n)
}
DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, semi_white);
DrawOvalBorder(_x, _y, TSZE, TSZE, bg_col_light, bg_col_dark, semi_white, sc.work);
DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id);
if (_icon_n==-1) {
DrawBar(_x+6, _y+5, 16, 16, semi_white);
for (i=0; i<=2; i++) DrawBar(_x+6, i*5+_y+7, 15, 3, sc.work_graph);
} else {
img_draw stdcall(top_icons.image, _x+6, _y+5, 16, 16, 0, _icon_n*16);
img_draw stdcall(top_icons.image, _x+6, _y+5+pressed, 16, 16, 0, _icon_n*16);
}
if (!pressed) {
DrawOvalBorder(_x, _y, TSZE, TSZE, bg_col_light, bg_col_dark, semi_white, sc.work);
} else {
DrawOvalBorder(_x, _y, TSZE, TSZE, sc.work_graph, bg_col_light, semi_white, sc.work);
PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2);
}
return _x;
}

View File

@ -0,0 +1,6 @@
#SHS
../tcc asm_ex.c /kolibrios/develop/tcc/lib/libck.a -o asm_ex
../tcc consoleio.c /kolibrios/develop/tcc/lib/libck.a -o consoleio
../tcc files.c /kolibrios/develop/tcc/lib/libck.a -o files
../tcc winbasics.c /kolibrios/develop/tcc/lib/libck.a -o winbasics
exit

View File

@ -1,61 +0,0 @@
// simple sample by Ghost
#include <stdio.h>
#include <string.h>
#include <kolibrisys.h>
#define FONT0 0
#define FONT1 0x10000000
#define BT_NORMAL 0
#define BT_DEL 0x80000000
#define BT_HIDE 0x40000000
#define BT_NOFRAME 0x20000000
char header[]={" -= C demo programm. Compiled whith KTCC halyavin and andrew_programmer port =- "};
void rotate_str(char *str){
char tmp;
int i;
tmp = str[0];
for(i = 1; str[i]; i++)str[i - 1] = str[i];
str[i - 1] = tmp;
}
void draw_window(){
static int offs = 0;
static int fcolor = 0;
static int col = 0;
_ksys_window_redraw(1);
_ksys_draw_window(100, 100, 300, 120, 0xaabbcc, 2, 0x5080d0, 0, 0x5080d0);
_ksys_write_text(6 - offs, 8, fcolor | FONT0, header, strlen(header));
_ksys_draw_bar(1, 6, 5, 13, 0x05080d0);
_ksys_draw_bar(274, 6, 26, 13, 0x05080d0);
_ksys_make_button(300 - 19, 5, 12, 12, 1 | BT_NORMAL, 0x6688dd);
_ksys_window_redraw(2);
offs = (offs + 1) % 6;
if(!offs)rotate_str(header);
fcolor += (col)?-0x80808:0x80808;
if(fcolor > 0xf80000 || fcolor == 0)col = !col;
}
int main(int argc, char **argv){
while(!0){
switch(_ksys_wait_for_event(10)){
case 2:return 0;
case 3:
if(_ksys_get_button_id() == 1)return 0;
break;
default:
draw_window();
break;
}
}
}