CMM: easy icon set in program

git-svn-id: svn://kolibrios.org@7229 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2018-04-16 09:30:24 +00:00
parent c925f4b9bb
commit 63e302c544
15 changed files with 50 additions and 46 deletions

View File

@ -11,7 +11,6 @@
#include "../lib/obj/proc_lib.h" #include "../lib/obj/proc_lib.h"
#include "../lib/obj/http.h" #include "../lib/obj/http.h"
#include "../lib/cursor.h" #include "../lib/cursor.h"
#include "../lib/patterns/libimg_load_skin.h"
#include "../lib/patterns/simple_open_dialog.h" #include "../lib/patterns/simple_open_dialog.h"
#include "../lib/patterns/history.h" #include "../lib/patterns/history.h"
#include "../lib/patterns/http_downloader.h" #include "../lib/patterns/http_downloader.h"

View File

@ -24,7 +24,6 @@
#include "..\lib\obj\http.h" #include "..\lib\obj\http.h"
#include "..\lib\obj\iconv.h" #include "..\lib\obj\iconv.h"
//useful patterns //useful patterns
#include "..\lib\patterns\libimg_load_skin.h"
#include "..\lib\patterns\history.h" #include "..\lib\patterns\history.h"
#include "..\lib\patterns\http_downloader.h" #include "..\lib\patterns\http_downloader.h"

View File

@ -7,8 +7,6 @@
#include "../lib/obj/libimg.h" #include "../lib/obj/libimg.h"
#include "../lib/obj/box_lib.h" #include "../lib/obj/box_lib.h"
#include "../lib/patterns/libimg_load_skin.h"
#ifndef AUTOBUILD #ifndef AUTOBUILD
#include "lang.h--" #include "lang.h--"
#endif #endif

View File

@ -23,7 +23,6 @@
#include "../lib/obj/box_lib.h" #include "../lib/obj/box_lib.h"
#include "../lib/patterns/history.h" #include "../lib/patterns/history.h"
#include "../lib/patterns/libimg_load_skin.h"
//images //images
#include "imgs/left_p.txt" #include "imgs/left_p.txt"

View File

@ -5,9 +5,10 @@
if exist iconedit ( if exist iconedit (
"C:\Program Files (x86)\WinImage\winimage.exe" "C:\Users\Leency\Desktop\kolibri.img" /H /Q /I iconedit "C:\Program Files\WinImage\winimage.exe" "D:\Soft\Kolibri\QEMU\kolibri.img" /H /Q /I iconedit
cd D:\Kolibri\Infrastructure\QEMU d:
call "D:\Kolibri\Infrastructure\QEMU\qemu-kos-img.bat" cd "D:\Soft\Kolibri\QEMU"
call "D:\Soft\Kolibri\QEMU\qemu-kos-img.bat"
) else ( ) else (
@pause @pause
) )

View File

@ -18,7 +18,6 @@ pipet aside color view
#include "../lib/mem.h" #include "../lib/mem.h"
#include "../lib/obj/libimg.h" #include "../lib/obj/libimg.h"
#include "../lib/patterns/rgb.h" #include "../lib/patterns/rgb.h"
#include "../lib/patterns/libimg_load_skin.h"
#include "colors_mas.h" #include "colors_mas.h"

View File

@ -18,8 +18,6 @@
#include "../lib/obj/libio.h" #include "../lib/obj/libio.h"
#endif #endif
:byte init_imglib_check;
//library //library
dword libimg = #alibimg; dword libimg = #alibimg;
char alibimg[21] = "/sys/lib/libimg.obj\0"; char alibimg[21] = "/sys/lib/libimg.obj\0";
@ -229,5 +227,9 @@ struct _Image
} }
} }
#ifndef INCLUDE_LIBIMG_LOAD_SKIN_H
#include "../lib/patterns/libimg_load_skin.h"
#endif
#endif #endif

View File

@ -20,14 +20,6 @@
ESDWORD[struct_pointer+12] = ESDWORD[image_pointer+24]; ESDWORD[struct_pointer+12] = ESDWORD[image_pointer+24];
} }
:void Libimg_FillTransparent(dword struct_pointer, w, h, new_transparent_color)
{
dword i, max_i, image_data;
image_data = ESDWORD[struct_pointer + 24];
max_i = w * h * 4 + image_data;
for (i = image_data; i < max_i; i += 4) if (DSDWORD[i]==0) DSDWORD[i] = new_transparent_color;
}
:void Libimg_ReplaceColor(dword struct_pointer, w, h, old_color, new_color) :void Libimg_ReplaceColor(dword struct_pointer, w, h, old_color, new_color)
{ {
dword i, max_i, image_data; dword i, max_i, image_data;
@ -36,4 +28,19 @@
for (i = image_data; i < max_i; i += 4) if (DSDWORD[i]==old_color) DSDWORD[i] = new_color; for (i = image_data; i < max_i; i += 4) if (DSDWORD[i]==old_color) DSDWORD[i] = new_color;
} }
:void Libimg_FillTransparent(dword struct_pointer, w, h, new_color)
{
Libimg_ReplaceColor(struct_pointer, w, h, 0, new_color);
}
:libimg_image icons32draw;
:void DrawIcon32(dword x,y, bg, icon_n) {
//load_dll(libimg, #libimg_init,1);
if (!icons32draw.image) {
Libimg_LoadImage(#icons32draw, "/sys/icons32.png");
Libimg_FillTransparent(icons32draw.image, icons32draw.w, icons32draw.h, bg);
}
if (icon_n>=0) img_draw stdcall(icons32draw.image, x, y, 32, 32, 0, icon_n*32);
}
#endif #endif

View File

@ -4,13 +4,12 @@
2008-2017 2008-2017
*/ */
#define MEMSIZE 4096 * 12 #define MEMSIZE 4096 * 15
#include "..\lib\gui.h" #include "..\lib\gui.h"
#include "..\lib\random.h" #include "..\lib\random.h"
#include "..\lib\obj\libio.h" #include "..\lib\obj\libio.h"
#include "..\lib\obj\libimg.h" #include "..\lib\obj\libimg.h"
#include "..\lib\patterns\libimg_load_skin.h"
proc_info Form; proc_info Form;

View File

@ -18,8 +18,6 @@ od_filter filter2 = { 8, "MP3\0\0" };
#include "..\lib\obj\libimg.h" #include "..\lib\obj\libimg.h"
#include "..\lib\obj\libini.h" #include "..\lib\obj\libini.h"
#include "..\lib\patterns\libimg_load_skin.h"
#define ABOUT_MESSAGE "'Pixies Player v1.4\n\nOpen file: O key\nChange skin: F1/F2 #define ABOUT_MESSAGE "'Pixies Player v1.4\n\nOpen file: O key\nChange skin: F1/F2
Play/Stop: Space or P key\nStart playing selected file: Enter Play/Stop: Space or P key\nStart playing selected file: Enter
Goto next/previous track: Ctrl + Left/Right Goto next/previous track: Ctrl + Left/Right

View File

@ -18,7 +18,6 @@
#include "../lib/obj/proc_lib.h" #include "../lib/obj/proc_lib.h"
#include "../lib/obj/box_lib.h" #include "../lib/obj/box_lib.h"
#include "../lib/patterns/libimg_load_skin.h"
#include "../lib/patterns/simple_open_dialog.h" #include "../lib/patterns/simple_open_dialog.h"
//===================================================// //===================================================//
@ -36,7 +35,7 @@ od_filter filter2 = { 15, "MP3\0WAV\0XM\0\0" };
A tiny music folder player. A tiny music folder player.
Supports MP3, WAV, XM audio file formats. Supports MP3, WAV, XM audio file formats.
Controls: Hot keys:
Open file: O key Open file: O key
Play/Stop: Space or P key Play/Stop: Space or P key
Start playing selected file: Enter Start playing selected file: Enter
@ -145,7 +144,7 @@ void main()
if (mouse.dblclick) EventStartPlayingSelectedItem(); if (mouse.dblclick) EventStartPlayingSelectedItem();
if (mouse.down) && (mouse.key&MOUSE_LEFT) if (mouse.down) && (mouse.key&MOUSE_LEFT)
&& (list.ProcessMouse(mouse.x, mouse.y)) DrawPlayList(); && (list.ProcessMouse(mouse.x, mouse.y)) DrawPlayList();
if (mouse.down) && (mouse.key&MOUSE_RIGHT) CreateThread(#EventShowAbout,#menu_stak+4092); if (mouse.down) && (mouse.key&MOUSE_RIGHT) EventShowAbout();
} }
if(mouse.key&MOUSE_LEFT) && (mouse.x<14) if(mouse.key&MOUSE_LEFT) && (mouse.x<14)
&& (window_mode == WINDOW_MODE_SMALL) EventDragWindow(); && (window_mode == WINDOW_MODE_SMALL) EventDragWindow();
@ -180,6 +179,7 @@ void main()
if (key_scancode==SCAN_CODE_ENTER) EventStartPlayingSelectedItem(); if (key_scancode==SCAN_CODE_ENTER) EventStartPlayingSelectedItem();
if (key_scancode==SCAN_CODE_DEL) EventDeleteItem(); if (key_scancode==SCAN_CODE_DEL) EventDeleteItem();
if (key_scancode==SCAN_CODE_KEY_P)||(key_scancode==SCAN_CODE_SPACE) EventPlayAndPause(); if (key_scancode==SCAN_CODE_KEY_P)||(key_scancode==SCAN_CODE_SPACE) EventPlayAndPause();
if (key_scancode==SCAN_CODE_F1) EventShowAbout();
if (list.ProcessKey(key_scancode)) DrawPlayList(); if (list.ProcessKey(key_scancode)) DrawPlayList();
break; break;
case evReDraw: case evReDraw:
@ -518,6 +518,11 @@ void EventDeleteItem()
} }
void EventShowAbout() void EventShowAbout()
{
CreateThread(#ShowAboutThread,#menu_stak+4092);
}
void ShowAboutThread()
{ {
proc_info pop_up; proc_info pop_up;
loop() switch(WaitEvent()) loop() switch(WaitEvent())
@ -532,14 +537,18 @@ void EventShowAbout()
case evReDraw: case evReDraw:
DefineDragableWindow(150, 200, 400, 346); DefineDragableWindow(150, 200, 400, 346);
GetProcessInfo(#pop_up, SelfInfo); GetProcessInfo(#pop_up, SelfInfo);
DrawBar(0, 0, pop_up.width, pop_up.height, theme.color_top_panel_bg); DrawBar(0, 0, pop_up.width, pop_up.height, theme.color_top_panel_bg);
DrawRectangle(0, 0, pop_up.width, pop_up.height, theme.color_list_border); DrawRectangle(0, 0, pop_up.width, pop_up.height, theme.color_list_border);
WriteTextLines(10, 10, 0x90, theme.color_top_panel_song_name, ABOUT_MESSAGE, 19);
DefineHiddenButton(pop_up.width - 27, 1, 26, 15, BUTTON_WINDOW_CLOSE); DefineHiddenButton(pop_up.width - 27, 1, 26, 15, BUTTON_WINDOW_CLOSE);
img_draw stdcall(skin.image, pop_up.width-28, 0, 28, 18, skin.w - 29, 0); img_draw stdcall(skin.image, pop_up.width-28, 0, 28, 18, skin.w - 29, 0);
DrawCaptButton(pop_up.width-10-80, pop_up.height - 34, 80, 24, 2, DrawCaptButton(pop_up.width-10-80, pop_up.height - 34, 80, 24, 2,
theme.color_list_active_bg, theme.color_top_panel_song_name, "Cool"); theme.color_list_active_bg, theme.color_top_panel_song_name, "Cool");
WriteTextLines(10, 10, 0x90, theme.color_top_panel_song_name, ABOUT_MESSAGE, 19);
DrawIcon32(10, 48, theme.color_top_panel_bg, 65);
} }
} }

View File

@ -14,7 +14,6 @@ SOFTWARE CENTER v2.8
#include "..\lib\kfont.h" #include "..\lib\kfont.h"
#include "..\lib\list_box.h" #include "..\lib\list_box.h"
#include "..\lib\collection.h" #include "..\lib\collection.h"
#include "..\lib\patterns\libimg_load_skin.h"
proc_info Form; proc_info Form;
llist list; llist list;

View File

@ -18,9 +18,6 @@
#include "../lib/obj/libimg.h" #include "../lib/obj/libimg.h"
#include "../lib/obj/libini.h" #include "../lib/obj/libini.h"
#include "../lib/patterns/libimg_load_skin.h"
//===================================================// //===================================================//
// // // //
// DATA // // DATA //

View File

@ -17,7 +17,6 @@ Copyright (C) 2008 O.Bogomaz
#include "..\lib\obj\libio.h" #include "..\lib\obj\libio.h"
#include "..\lib\obj\libimg.h" #include "..\lib\obj\libimg.h"
#include "..\lib\patterns\libimg_load_skin.h"
libimg_image menu; libimg_image menu;
libimg_image road; libimg_image road;

View File

@ -9,7 +9,6 @@
#include "../lib/obj/libini.h" #include "../lib/obj/libini.h"
#include "../lib/obj/iconv.h" #include "../lib/obj/iconv.h"
#include "../lib/obj/proc_lib.h" #include "../lib/obj/proc_lib.h"
#include "../lib/patterns/libimg_load_skin.h"
#include "../lib/patterns/simple_open_dialog.h" #include "../lib/patterns/simple_open_dialog.h"
#define TOOLBAR_H 34 #define TOOLBAR_H 34