more icons

This commit is contained in:
Nishi 2026-05-13 11:58:37 +09:00
commit e4396add52
12 changed files with 860 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

After

Width:  |  Height:  |  Size: 548 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

After

Width:  |  Height:  |  Size: 538 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 B

After

Width:  |  Height:  |  Size: 607 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

After

Width:  |  Height:  |  Size: 528 B

Before After
Before After

BIN
icon/file_text.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

Before After
Before After

BIN
icon/file_xml.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -16,7 +16,14 @@ struct watchentry {
char* path;
};
static struct watchentry* watchlist = NULL;
struct icon {
char* key;
MwLLPixmap value;
};
static struct icon* icons = NULL;
static struct icon* icons_full = NULL;
static struct watchentry* watchlist = NULL;
static int sort_de(const void* _a, const void* _b) {
struct direntry* a = (struct direntry*)_a;
@ -40,22 +47,9 @@ static void dir_recursion(const char* path, const char* path2, void* tv, int lev
if(path2[strlen(path2) - 1] == '/' || path2[strlen(path2) - 1] == '\\' || tv == NULL) {
px = folder;
} else if(strcmp(path2, "Makefile") == 0) {
px = file_script;
} else if(strcmp(path2, "README") == 0 || strcmp(path2, "LICENSE") == 0) {
px = hand;
} else if((px = shget(icons_full, path2)) != NULL) {
} else if(dot != NULL) {
if(strcmp(dot, ".c") == 0 || strcmp(dot, ".h") == 0) {
px = file_c;
} else if(strcmp(dot, ".sh") == 0 || strcmp(dot, ".js") == 0 || strcmp(dot, ".make") == 0 || strcmp(dot, ".py") == 0 || strcmp(dot, ".mk") == 0) {
px = file_script;
} else if(strcmp(dot, ".exe") == 0 || strcmp(dot, ".dll") == 0 || strcmp(dot, ".so") == 0 || strcmp(dot, ".o") == 0) {
px = file_binary;
} else if(strcmp(dot, ".png") == 0 || strcmp(dot, ".jpg") == 0 || strcmp(dot, ".jpeg") == 0 || strcmp(dot, ".bmp") == 0 || strcmp(dot, ".ico") == 0 || strcmp(dot, ".psd") == 0) {
px = file_image;
} else {
px = file_unknown;
}
px = shget(icons, dot);
}
tv = MwTreeViewAdd(fileview, tv, px, path2);
@ -142,3 +136,45 @@ void dir_tick(void) {
}
}
}
static void put_icon(const char* str, MwLLPixmap px) {
shput(icons, str, px);
}
static void put_icon_full(const char* str, MwLLPixmap px) {
shput(icons_full, str, px);
}
void dir_init(void) {
sh_new_strdup(icons);
shdefault(icons, file_unknown);
put_icon(".c", file_c);
put_icon(".h", file_c);
put_icon(".sh", file_script);
put_icon(".js", file_script);
put_icon(".py", file_script);
put_icon(".make", file_script);
put_icon(".mk", file_script);
put_icon(".pl", file_script);
put_icon(".exe", file_binary);
put_icon(".dll", file_binary);
put_icon(".so", file_binary);
put_icon(".o", file_binary);
put_icon(".a", file_binary);
put_icon(".png", file_image);
put_icon(".jpg", file_image);
put_icon(".jpeg", file_image);
put_icon(".bmp", file_image);
put_icon(".ico", file_image);
put_icon(".psd", file_image);
put_icon(".txt", file_text);
put_icon(".xml", file_xml);
sh_new_strdup(icons_full);
shdefault(icons_full, NULL);
put_icon_full("Makefile", file_script);
put_icon_full("README", hand);
put_icon_full("LICENSE", hand);
}

402
src/icon/file_text.c Normal file
View file

@ -0,0 +1,402 @@
#include <midas.h>
MwU32 icon_file_text[] = {
(18 << 16) | 22,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0xccffff00,
0xccffff00,
0xccffff00,
0xccffff00,
0xccffff00,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x333333ff,
0xffffffff,
0x333333ff,
0xccffff00,
0xccffff00,
0xccffff00,
0xccffff00,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x333333ff,
0xffffffff,
0xffffffff,
0x333333ff,
0xccffff00,
0xccffff00,
0xccffff00,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0x333333ff,
0xccffff00,
0xccffff00,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x333333ff,
0xccffff00,
0x333333ff,
0xffffffff,
0xffffffff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xffffffff,
0xffffffff,
0xff,
0x333333ff,
0xff,
0x333333ff,
0xff,
0x333333ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0x999999ff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
0x999999ff,
0xff,
0x333333ff,
0x333333ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x333333ff,
0xff,
0xccffff00,
0xccffff00,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0
};

402
src/icon/file_xml.c Normal file
View file

@ -0,0 +1,402 @@
#include <midas.h>
MwU32 icon_file_xml[] = {
(18 << 16) | 22,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x333333ff,
0x33339900,
0x33339900,
0x33339900,
0x33339900,
0x33339900,
0x333333ff,
0xffffffff,
0xffffffff,
0xfefefeff,
0xfdfdfdff,
0xfdfcfcff,
0xfbfbfbff,
0xfafafaff,
0xf9f9faff,
0xf8f8f8ff,
0xf7f7f7ff,
0x333333ff,
0xf6f5f5ff,
0x333333ff,
0x33339900,
0x33339900,
0x33339900,
0x33339900,
0x333333ff,
0xfffeffff,
0xfefefeff,
0xfdfdfcff,
0xfcfcfcff,
0xfafbfbff,
0xfafafaff,
0xf9f9f9ff,
0xf8f8f8ff,
0xf7f7f7ff,
0xf6f5f6ff,
0x333333ff,
0xf4f4f4ff,
0xf3f3f3ff,
0x333333ff,
0x33339900,
0x33339900,
0x33339900,
0x333333ff,
0xfefdfeff,
0xfcfdfcff,
0xfbfbfbff,
0xfbfafaff,
0xfaf9faff,
0xf8f8f9ff,
0xf8f8f8ff,
0xf7f7f7ff,
0xf5f5f5ff,
0xf5f4f4ff,
0x333333ff,
0xf2f3f3ff,
0xf2f2f1ff,
0xf0f1f0ff,
0x333333ff,
0x33339900,
0x33339900,
0x333333ff,
0xfcfcfcff,
0xfbfbfbff,
0xfafafaff,
0xf9f9f9ff,
0xf8f8f9ff,
0xf7f7f7ff,
0xf6f6f6ff,
0xf6f5f6ff,
0xf5f4f4ff,
0xf3f3f4ff,
0x333333ff,
0xf1f2f1ff,
0xf1f0f0ff,
0xeff0f0ff,
0xeeeeefff,
0x333333ff,
0x33339900,
0x333333ff,
0xfbfbfbff,
0xfaf9faff,
0xf9f9f9ff,
0xf7f8f8ff,
0xf7f7f7ff,
0xf6f6f6ff,
0xf5f5f5ff,
0xf4f4f4ff,
0xf3f3f3ff,
0xf2f2f2ff,
0xff,
0x333333ff,
0xff,
0x333333ff,
0xff,
0x333333ff,
0xff,
0x333333ff,
0xfaf9f9ff,
0xf8f8f9ff,
0xf8f8f8ff,
0xf7f6f7ff,
0xf6f5f6ff,
0xf4f5f5ff,
0xf4f4f3ff,
0xf2f3f2ff,
0xf1f1f1ff,
0xf1f1f0ff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0x333333ff,
0xf8f8f8ff,
0xf7f8f7ff,
0xf6f6f6ff,
0xf6f5f6ff,
0xf5f4f4ff,
0xf4f3f4ff,
0xf3f2f3ff,
0xf1f1f1ff,
0xf1f1f1ff,
0xefefefff,
0xefefeeff,
0xedededff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0xff,
0x333333ff,
0xf7f7f7ff,
0xf6f6f6ff,
0xf5f5f5ff,
0xf5f4f4ff,
0xf3f3f3ff,
0xf2f2f2ff,
0xf1f2f1ff,
0xf0f0f0ff,
0xefeff0ff,
0xeeeeefff,
0xedededff,
0xececedff,
0xebebebff,
0x999999ff,
0x999999ff,
0x999999ff,
0xff,
0x333333ff,
0xf5f5f5ff,
0xf4f5f5ff,
0xf3f3f4ff,
0xf3f3f3ff,
0xf2f2f2ff,
0xa8a8a8ff,
0x303030ff,
0xefefefff,
0x2f2f2fff,
0xa5a5a5ff,
0xecececff,
0xeaebebff,
0xeae9eaff,
0xe8e9e9ff,
0xe8e8e8ff,
0x999999ff,
0xff,
0x333333ff,
0xf5f4f5ff,
0xf4f4f3ff,
0xf3f2f2ff,
0xf2f2f2ff,
0xa8a8a7ff,
0x2f302fff,
0xa6a6a6ff,
0xeeeeedff,
0xa4a5a5ff,
0x2f2f2fff,
0xa3a3a4ff,
0xe9e9eaff,
0xe9e8e9ff,
0xe7e8e8ff,
0xe7e7e7ff,
0x999999ff,
0xff,
0x333333ff,
0xf3f3f3ff,
0xf2f2f2ff,
0xf1f1f1ff,
0xa7a7a7ff,
0x302f30ff,
0xa6a6a6ff,
0xedededff,
0xecececff,
0xebebebff,
0xa3a3a3ff,
0x2e2e2eff,
0xa1a1a1ff,
0xe8e7e7ff,
0xe6e6e6ff,
0xe5e5e5ff,
0x999999ff,
0xff,
0x333333ff,
0xf1f2f1ff,
0xf0f1f1ff,
0xa7a7a7ff,
0x2f2f2fff,
0xa6a6a6ff,
0xedededff,
0xecececff,
0xebebebff,
0xeaeae9ff,
0xe9e9e9ff,
0xa1a1a1ff,
0x2e2e2eff,
0xa0a0a0ff,
0xe5e5e5ff,
0xe4e4e4ff,
0x999999ff,
0xff,
0x333333ff,
0xf1f1f1ff,
0xa6a7a6ff,
0x2f2f2fff,
0xa5a6a6ff,
0xecededff,
0xebebecff,
0xeaeaeaff,
0xeae9e9ff,
0xe8e8e8ff,
0xe8e7e8ff,
0xe7e7e7ff,
0x9f9fa0ff,
0x2d2d2dff,
0x9f9e9fff,
0xe3e3e3ff,
0x999999ff,
0xff,
0x333333ff,
0xefefefff,
0xefefeeff,
0xa6a5a5ff,
0x2f2f2fff,
0xa4a4a4ff,
0xeaeaebff,
0xe9eae9ff,
0xe9e9e8ff,
0xe8e7e7ff,
0xe6e6e6ff,
0xa09f9fff,
0x2d2d2dff,
0x9f9e9eff,
0xe3e2e3ff,
0xe1e1e2ff,
0x999999ff,
0xff,
0x333333ff,
0xeeeeeeff,
0xedededff,
0xecebecff,
0xa4a4a4ff,
0x2e2e2eff,
0xa2a2a2ff,
0xe8e8e8ff,
0xe7e7e7ff,
0xe6e6e6ff,
0x9f9f9fff,
0x2d2d2dff,
0x9f9e9eff,
0xe2e2e2ff,
0xe2e1e1ff,
0xe1e0e0ff,
0x999999ff,
0xff,
0x333333ff,
0xecededff,
0xebececff,
0xebebebff,
0xeae9e9ff,
0xa1a2a2ff,
0x2e2e2eff,
0xa1a0a1ff,
0xe6e5e6ff,
0x9f9f9fff,
0x2d2d2dff,
0x9e9e9eff,
0xe2e2e1ff,
0xe1e1e1ff,
0xe0e0e0ff,
0xdfdfdfff,
0x999999ff,
0xff,
0x333333ff,
0xecebebff,
0xeaeaeaff,
0xe9e9e9ff,
0xe8e8e8ff,
0xe7e7e8ff,
0xa0a0a1ff,
0x2e2d2eff,
0xe4e4e5ff,
0x2d2d2dff,
0x9d9d9dff,
0xe1e2e2ff,
0xe1e1e0ff,
0xe0dfdfff,
0xdedfdeff,
0xdededdff,
0x999999ff,
0xff,
0x333333ff,
0xeaeaeaff,
0xe9e9e9ff,
0xe8e8e8ff,
0xe7e7e7ff,
0xe6e6e6ff,
0xe5e6e5ff,
0xe4e5e5ff,
0xe3e3e3ff,
0xe2e2e2ff,
0xe1e1e1ff,
0xe1e0e0ff,
0xdfdfdfff,
0xdededeff,
0xddddddff,
0xdcdddcff,
0x999999ff,
0xff,
0x333333ff,
0xe9e9e8ff,
0xe8e7e8ff,
0xe6e7e7ff,
0xe6e5e6ff,
0xe5e5e5ff,
0xe3e3e4ff,
0xe3e3e3ff,
0xe2e2e2ff,
0xe1e1e1ff,
0xe0e0e0ff,
0xdfdfdfff,
0xdededeff,
0xddddddff,
0xdcdcdbff,
0xdbdbdbff,
0x999999ff,
0xff,
0x333333ff,
0x333333ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x999999ff,
0x333333ff,
0xff,
0x33339900,
0x33339900,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0
};

View file

@ -5,6 +5,8 @@ int main(int argc, char** argv) {
gui_init();
dir_init();
dir_scan(".");
gui_loop();

View file

@ -11,7 +11,7 @@
#define VERSION "0.0"
#define ICONS ICON(file_c) ICON(file_unknown) ICON(file_script) ICON(file_binary) ICON(file_image) \
#define ICONS ICON(file_c) ICON(file_unknown) ICON(file_script) ICON(file_binary) ICON(file_image) ICON(file_text) ICON(file_xml) \
ICON(folder) \
ICON(hand)
@ -47,6 +47,7 @@ void gui_version(void);
void gui_loop(void);
/* dir.c */
void dir_init(void);
void dir_scan(const char* dir);
void dir_tick(void);