***************************************************
        Plug-ins API for ATI Tray Tools v1.0
        API Version 1.4
        (c) 2005 Ray Adams
        All right reserved.
***************************************************
ATI Tray Tools = ATT

What you have for plug-ins? 
1. Full access to low level driver
2. Working with ports, in/out
3. Map frame buffer from physical address space to linear
4. Reading and setting clocks

In next release of API:
New kind of plug-ins. Runtime plugins. All runtime plug-ins will be loaded with 
ATT and all of them, which will have PL_SUSP_RUN flag, 
will be loaded each time after restoring from suspend/sleep/hibernate modes.

If you have your own plug-ins, please email me with information 
about it and if it will be useful for users, 
I will put it in installation package.

---------------------------------------------------------
Non run-time plugins. These plugins only start when you select it from menu.

All plug-ins must export two functions
1. get_plug_inf - return information about plug-in
        This function must fill structure TPlugInfo (look in header files
        for your programing laguage)
2. exec_plugin - return true if success.


*** Get_Plug_Inf ***
As parameter take structure TPlugInfo

Delphi:
    TGet_Plug_Info=procedure (var Info:TPlugInfo);stdcall;

    type TPlugInfo=packed record
         Sign:array[0..3] of char;//std 4 chars to identofy itself as a ATT plugin
         Menu_Text:array[0..50] of char; // text for menu
         PuginType:byte; //type of plugin reserved must be PL_STD
    end;

C++:
typedef struct tagTPlugInfo {
         char Sign[3];    //std 4 chars to identofy itself as a ATT plug-in
         char Menu_Text[50] of char; // text for menu
         char PluginType; //type of plug-in reserved must be PL_STD
} TPlugInfo, *PPlugInfo;
typedef void (STDAPICALLTYPE*  lppget_plug_info)(PPlugInfo Data);

*** Exec_Plugin ***

Delphi:
TExec_Plugin=procedure(Win_Handle:integer;ATT_Proc:Pointer):stdcall;
Win_Handle - handle of ATT main window 
ATT_Proc - pointer to main function to work with ATT


C++:
typedef void (STDAPICALLTYPE*  lppexec_plugin)(uint Win_Handle; void* ATT_Proc);
Win_Handle - handle of ATT main window 
ATT_Proc - pointer to main function which will work with ATT
===========================================================
        Run-Time plugins
===========================================================
Run time plugins starts together with ATT. If enabled in "Run-Time plugins" configuration box.
All runtime plugins must export some additional fucntions.
//////////////////////////////////
//ATT Will execute this function before terminate.
//////////////////////////////////
typedef void (STDAPICALLTYPE*  lppdone_plugin)();

//////////////////////////////////
//ATT will execute this function after resuming from suspend/hibernate mode
//Plug-In must decide waht to do at this time.
//if you don't need any actions just create dummy procedure
//////////////////////////////////
typedef void (STDAPICALLTYPE*  lppsuspend_restore)();

//////////////////////////////////
//Run Configuration for plugin
//////////////////////////////////
typedef void (STDAPICALLTYPE*  lppconfig_plugin)(HWND Win_Handle, void* ATT_Proc);
        Win_Handle - Handle to the ATT configuration window.
        ATT_Proc - pointer to main function which will work with ATT

Look for an example in plugins\example folder. CPU Load Meter Plugin.
A few words about how CPU Load Metter plugin work.
When this plugin executed, its create an invisible window and create Timer function for this window.
After window creating, plugin put and icon in system tray. Then each 1 second, plugins update 
icon in system tray to show current CPU Usage.
In resources, plugin stores 15 small icons which will be displayed while measuring CPU Usage.

How to create run time plugins? Its up to you how :). It can be depended on what this plugin
should do. For example, PCI Register Set is run time plugin. But this plugin doesn't create
any window while executed. When ATI Tray Tools execute "PCI Register Set" plugin, using exec_plugin,
plugin run procedure to program all selected registers and stop execution. Its differ from CPU Load 
plugins because its do nothing after execution.

//////////////////////////////////
// OSD Plugins
//////////////////////////////////
OSD plugins intended to be used in OSD module to show in third line of FlashOSD. OSD Plugins 
must export all standard function 

get_plug_info - Return standard information about plugin. Use Menu text as Name of the plugin.

exec_plugin - This function will be executed at the first time, when plugin loaded with ATT. Plugin
 must do all initialization here.

done_plugin - This function will called at the exit time.

config_plugin - This function will be executed when user press Configure button in OSD 
 configuration module. ATT will pass handle of the configuration window to the plugin.
 Be careful in this function, because ATT will not call exec_plugin function before calling
 configuration function! So you must do all initializations in this function temporarily!
 You can ommit this function if you don't have configuration. 

and special function

get_osd_string - ATT will call this function when OSD used in games. As first parameter ATT will 
 pass pointer to the allocated string (max length 255). Plugin must not free this memory! Only write 
 information to show in OSD. ATT can draw all chars from 0x20 (space) and up to 0x7D (}). Do not
 try to put chars more or less than given region. ATT will not draw them.
For an example look for osdtime plugin. Remember! ATT updated FlashOSD string only once per second.


Information about commands you can find in include files for your language.
plugins.pas - Delphi version
plugins.h   - C++ version

===========================================================
Some example plugins can be found in delphi and vc++ folders.
 