Go to the documentation of
this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #pragma once
00018
00019 #include "ifnpub.h"
00020 #include "baseinterface.h"
00021 #include <CommCtrl.h>
00022 #include "plugapi.h"
00023
00024
00025 class Renderer;
00026 class MtlBase;
00027
00028 #define IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID Interface_ID(0x5537445b, 0x70a97e02)
00029 #define IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID Interface_ID(0x25d24114, 0xdbe505f)
00030
00031
00032
00057
00058 class IMtlRender_Compatibility_MtlBase : public FPStaticInterface {
00059
00060 public:
00061
00064 void Init(ClassDesc& classDesc);
00065
00069 virtual bool IsCompatibleWithRenderer(ClassDesc& rendererClassDesc) = 0;
00070
00080 #pragma warning(push)
00081 #pragma warning(disable:4100)
00082 virtual bool GetCustomMtlBrowserIcon(
00083 HIMAGELIST& hImageList,
00084 int& inactiveIndex,
00085 int& activeIndex,
00086 int& disabledIndex
00087 )
00088 {
00089 return false;
00090 }
00091 #pragma warning(pop)
00092 };
00093
00094
00095 inline IMtlRender_Compatibility_MtlBase* Get_IMtlRender_Compability_MtlBase(ClassDesc& mtlBaseClassDesc) {
00096
00097 return static_cast<IMtlRender_Compatibility_MtlBase*>(mtlBaseClassDesc.GetInterface(IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID));
00098 }
00099
00100
00101
00118
00119 class IMtlRender_Compatibility_Renderer : public FPStaticInterface {
00120
00121 public:
00122
00125 void Init(ClassDesc& classDesc);
00126
00131 virtual bool IsCompatibleWithMtlBase(ClassDesc& mtlBaseClassDesc) = 0;
00132 };
00133
00134
00135 inline IMtlRender_Compatibility_Renderer* Get_IMtlRender_Compatibility_Renderer(ClassDesc& rendererClassDesc) {
00136
00137 return static_cast<IMtlRender_Compatibility_Renderer*>(rendererClassDesc.GetInterface(IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID));
00138 }
00139
00141
00146 inline bool AreMtlAndRendererCompatible(ClassDesc& mtlBaseClassDesc, ClassDesc& rendererClassDesc) {
00147
00148 IMtlRender_Compatibility_MtlBase* mtlBaseCompatibility = Get_IMtlRender_Compability_MtlBase(mtlBaseClassDesc);
00149 IMtlRender_Compatibility_Renderer* rendererCompatibility = Get_IMtlRender_Compatibility_Renderer(rendererClassDesc);
00150
00151 if((mtlBaseCompatibility == NULL) && (rendererCompatibility == NULL)) {
00152
00153 return true;
00154 }
00155 else if((mtlBaseCompatibility != NULL) && mtlBaseCompatibility->IsCompatibleWithRenderer(rendererClassDesc)) {
00156
00157 return true;
00158 }
00159 else if((rendererCompatibility != NULL) && rendererCompatibility->IsCompatibleWithMtlBase(mtlBaseClassDesc)) {
00160
00161 return true;
00162 }
00163 else {
00164
00165 return false;
00166 }
00167 }
00168
00169
00170
00171
00172
00173 inline void IMtlRender_Compatibility_MtlBase::Init(ClassDesc& classDesc) {
00174
00175 LoadDescriptor(IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID, _M("IMtlRender_Compability_MtlBase"), 0, &classDesc, 0, end);
00176 }
00177
00178
00179
00180
00181
00182 inline void IMtlRender_Compatibility_Renderer::Init(ClassDesc& classDesc) {
00183
00184 LoadDescriptor(IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID, _M("IMtlRender_Compability_Renderer"), 0, &classDesc, 0, end);
00185 }
00186