diff --git a/include/Mw/LowLevel.h b/include/Mw/LowLevel.h index 6089e48..0c53bd3 100644 --- a/include/Mw/LowLevel.h +++ b/include/Mw/LowLevel.h @@ -39,7 +39,6 @@ struct _MwLLCommon { int type; int coordinate_type; MwBool supports_transparency; - const char** known_mime_types; MwLLHandler handler; }; diff --git a/include/Mw/StringDefs.h b/include/Mw/StringDefs.h index 5f9e3e4..885e07e 100644 --- a/include/Mw/StringDefs.h +++ b/include/Mw/StringDefs.h @@ -63,7 +63,6 @@ #define MwNforeground "Sforeground" #define MwNsubForeground "SsubForeground" #define MwNtitleForeground "StitleForeground" -#define MwNacceptedMimeType "SacceptedMimeType" #define MwNvulkanExtension "SEvulkanExtension" diff --git a/src/backend/gdi.c b/src/backend/gdi.c index e9f3d4c..aa5f7c1 100644 --- a/src/backend/gdi.c +++ b/src/backend/gdi.c @@ -20,15 +20,6 @@ static struct symtbl { UINT(WINAPI* DragQueryFileW)(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch); UINT(WINAPI* DragQueryFileA)(HDROP hDrop, UINT iFile, LPSTR lpszFile, UINT cch); - HRESULT(WINAPI* FindMimeFromData)( - LPBC pBC, - LPCWSTR pwzUrl, - LPVOID pBuffer, - DWORD cbSize, - LPCWSTR pwzMimeProposed, - DWORD dwMimeFlags, - LPWSTR* ppwzMimeOut, - DWORD dwReserved); void (*DragAcceptFiles)(HWND hWnd, BOOL fAccept); void (*DragFinish)(HDROP hDrop); } wsymtbl; @@ -188,36 +179,9 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { count = wsymtbl.DragQueryFileW(hDrop, 0xFFFFFFFF, NULL, 0); for(i = 0; i < count; i++) { - wchar_t path[MAX_PATH]; - char path_normal[MAX_PATH]; - char* mime_type_normal; - wchar_t* mime_type = NULL; - int mime_type_size; - HRESULT hr; - int i; - - wsymtbl.DragQueryFileW(hDrop, i, path, MAX_PATH); - wsymtbl.DragQueryFileA(hDrop, i, path_normal, MAX_PATH); - hr = wsymtbl.FindMimeFromData(NULL, path, NULL, 0, - NULL, 0, &mime_type, 0x0); - - mime_type_size = WideCharToMultiByte(CP_ACP, 0, mime_type, -1, NULL, 0, NULL, FALSE); - mime_type_normal = malloc(sizeof(mime_type_size)); - WideCharToMultiByte(CP_ACP, 0, mime_type, -1, mime_type_normal, mime_type_size, NULL, FALSE); - - if(mime_type_size == 0) { - printf("Error converting mime type to multi-byte: %ld\n", GetLastError()); - } else { - if(u->ll->common.known_mime_types) { - for(n = 0; n < arrlen(u->ll->common.known_mime_types); n++) { - if(strcmp(mime_type_normal, u->ll->common.known_mime_types[n]) == 0) { - MwLLDispatch(u->ll, drag_and_drop, path_normal); - } - } - } else { - MwLLDispatch(u->ll, drag_and_drop, path_normal); - } - } + char path[MAX_PATH]; + wsymtbl.DragQueryFileA(hDrop, i, path, MAX_PATH); + MwLLDispatch(u->ll, drag_and_drop, path); } wsymtbl.DragFinish(hDrop); break; @@ -1106,7 +1070,6 @@ static int MwLLGDICallInitImpl(void) { SHELL32_FUNC(DragQueryFileA); SHELL32_FUNC(DragAcceptFiles); SHELL32_FUNC(DragFinish); - URLMON_FUNC(FindMimeFromData); wsymtbl.has_drag_and_drop = MwTRUE; } diff --git a/src/core.c b/src/core.c index d1a5d9b..eb81536 100644 --- a/src/core.c +++ b/src/core.c @@ -707,12 +707,6 @@ void MwSetText(MwWidget handle, const char* key, const char* value) { if(strcmp(key, MwNbackground) == 0 || strcmp(key, MwNforeground) == 0 || strcmp(key, MwNsubBackground) == 0 || strcmp(key, MwNsubForeground) == 0) { MwForceRender(handle); } - - if(strcmp(key, MwNacceptedMimeType) == 0) { - if(handle->lowlevel != NULL) { - arrput(handle->lowlevel->common.known_mime_types, value); - } - } } void MwSetVoid(MwWidget handle, const char* key, void* value) { diff --git a/src/lowlevel.c b/src/lowlevel.c index aca10c2..38a1ab0 100644 --- a/src/lowlevel.c +++ b/src/lowlevel.c @@ -64,7 +64,6 @@ void MwLLCreateCommon(MwLL handle) { memset(handle->common.handler, 0, sizeof(*handle->common.handler)); handle->common.supports_transparency = 0; - handle->common.known_mime_types = NULL; } void MwLLDestroyCommon(MwLL handle) {