home *** CD-ROM | disk | FTP | other *** search
- /*
- You have to recompile this file if you wan't to create your own icon library for UniView
- ...or you can use some kind of resource hacker to replace icons in current iconlib.uvp
- file => It is LEGAL, because ...
-
- This file is distributed under following license:
- * Files contained in this distribution are copyrighted by Andrej Krutak
- * It is allowed to alter all files contained in this package (including icons)
- as long, as you mention me as original author in some place and as long
- as you don't give me responsibility for damages caused by this s/w.
-
- (C) 2002 Andrej Krutak
-
-
- DESCRIPTION OF ICON LIBRARY INTERFACE:
-
- Icon library for UniView isn't a simple DLL with icons. Because each library
- should handle all following versions of UniView (and their file types), it has
- to use some special interface...
-
- The first thing that each icon library (IL) should pass is the standard plugin interface
- support. This means, each plugin must contain function 'uvplugin_main' and must
- response to messages UVMSG_INITPLUGIN and others - like the function in this file.
-
- 2nd important thing that IL has to have is the 'uv_associate_getIconID' function.
- This function must be __stdcall and must be exported as '_uv_associate_getIconID'.
- Let's check some example to understand the function:
-
- When a file, that is using IL icon, is being associated, this function is called.
-
- We have, for example, a TXT extension, which is going to get IL icon. UniView makes
- all the associations and finds out, that it requires icon from IL. So it calls our
- function (uv_associate_getIconID) with extension as parameter (in form '.txt').
- The 'objective' of our function is to return index of image in UVP file. The best
- way to get this index is to explicitly create a table (like ext_uv_18), which contains
- extensions... I think, this algorithm can you 'resolve' by your self...
-
- So we return 1 based index (or 0 if this extension isn't included in current version of
- IL). That's all - there's nothing more to do with our plugin...
-
- In general, you'll never have to completely rewrite this sources, because the basic idea
- of this procedure will stay for a long time :-) For every new version of UniView there
- will be also a new version of this plugin (w/sources) available on my homesite...
-
- Best regards!
-
- Andrej Krutak, krutak@gymrk.sk, http://www.gymrk.sk/andrek/
- */
-
- #include <windows.h>
- #include <stdio.h>
- #include "plugin.h"
-
- int __stdcall uvplugin_main(HINSTANCE plgI, DWORD message, DWORD wParam, DWORD lParam)
- {
- switch (message) {
- case UVMSG_INITPLUGIN:
- {
- up_initdata* updata=(up_initdata*)wParam;
-
- updata->items_count=0;
- strcpy(updata->plugin_name, "UniView icon library (*)");
- updata->version_1=1;
- updata->version_2=8;
- }
- return 0;
- case UVMSG_EXIT:
- return 0;
- case UVMSG_STOPEXIT:
- return 0;
- }
- return 0;
- }
-
- char *ext_uv_18[] = {
- ".aa", ".aif", ".aifc", ".aiff", ".atk", ".au", ".avi", ".bie", ".bmp", ".cmu", ".dat", ".dib", ".dic", ".diz",
- ".doo", ".exc", ".fac", ".face", ".fit", ".fits", ".fts", ".g3", ".gif", ".icl", ".ico", ".icon", ".iff", ".img", ".ini",
- ".jpe", ".jpeg", ".jpg", ".lbm", ".leaf", ".m1v", ".mac", ".macp", ".mda", ".mdp", ".mgr", ".mid", ".mov", ".mp2", ".mpa", ".mpe",
- ".mpeg", ".mpg", ".mpnt", ".mpv2", ".ngg", ".nol", ".npm", ".paint", ".pbm", ".pcx", ".pdb", ".pgm", ".pi1", ".pi3", ".png",
- ".pnm", ".pntg", ".ppm", ".qrt", ".ras", ".rast", ".raw", ".rgb", ".rle", ".rmi", ".rtf", ".scp", ".scr", ".sgi", ".sir", ".snd",
- ".sr", ".tga", ".tif", ".tiff", ".txt", ".urt", ".wav", ".wbmp", ".wfa", ".wri", ".xbm", ".xim", ".xpm", ".ybm", ".yuv", ".ecw", ".mtv"
- };
-
- int __stdcall uv_associate_getIconID(char *extension)
- {
- int i;
-
- for (i=0; i<sizeof(ext_uv_18)/sizeof(char*); i++) {
- if (!strcmpi(ext_uv_18[i], extension))
- return i+1;
- }
- return 0;
- }
-