tahoma2d/toonz/sources/common/twain/ttwain_stateM.c

42 lines
977 B
C
Raw Normal View History

2016-03-19 06:57:51 +13:00
/*max@home*/
#include "twain.h"
#include "ttwain_state.h"
#include "ttwainP.h"
#include "ttwain_statePD.h"
#include "ttwain_util.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void TTWAIN_SetState(TWAINSTATE status);
2016-06-15 18:43:10 +12:00
int TTWAIN_LoadSourceManagerPD(void) {
if (TTWAIN_GetState() >= TWAIN_SM_LOADED)
return TRUE; /* DSM already loaded */
TTwainData.DSM_Entry = DSM_Entry;
if (TTwainData.DSM_Entry != 0 /*kUnresolveCFragSymbolAddress*/) {
TTWAIN_SetAvailable(AVAIABLE_YES);
TTWAIN_SetState(TWAIN_SM_LOADED);
} else {
printf("DSM Entry NOT found !\n");
return FALSE;
}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
return (TTWAIN_GetState() >= TWAIN_SM_LOADED);
2016-03-19 06:57:51 +13:00
}
2016-06-15 18:43:10 +12:00
int TTWAIN_UnloadSourceManagerPD(void) {
if (TTWAIN_GetState() == TWAIN_SM_LOADED) {
TTwainData.DSM_Entry = 0;
TTWAIN_SetState(TWAIN_PRESESSION);
}
return (TTWAIN_GetState() == TWAIN_PRESESSION);
2016-03-19 06:57:51 +13:00
}
/*-----------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif