module CIbopEnumVariables
    use CVoidEventHandlerCollection
    implicit none
    integer :: Ibop = 0
    
    public
    
    type(VoidEventHandlerCollection) :: OnIbopChange
    
    enum, bind(c)
        !enumerator IBOP_NEUTRAL
        enumerator IBOP_REMOVE
        enumerator IBOP_INSTALL
    end enum
    
    private :: Ibop
    
    contains
    
    subroutine Set_Ibop(v)
        implicit none
        integer , intent(in) :: v
#ifdef ExcludeExtraChanges
        if(Ibop == v) return
#endif
        Ibop = v
#ifdef deb
	    print*, 'Ibop=', Ibop
#endif
        call OnIbopChange%RunAll()
    end subroutine
    
    integer function Get_Ibop()
        implicit none
        Get_Ibop = Ibop
    end function
    
    
    
    
    subroutine Set_Ibop_WN(v)
    !DEC$ ATTRIBUTES DLLEXPORT :: Set_Ibop_WN
    !DEC$ ATTRIBUTES ALIAS: 'Set_Ibop_WN' :: Set_Ibop_WN
        implicit none
        integer , intent(in) :: v
        call Set_Ibop(v)
    end subroutine
    
    integer function Get_Ibop_WN()
    !DEC$ ATTRIBUTES DLLEXPORT :: Get_Ibop_WN
    !DEC$ ATTRIBUTES ALIAS: 'Get_Ibop_WN' :: Get_Ibop_WN
        implicit none
        Get_Ibop_WN = Ibop
    end function
    
    
    
    subroutine Set_Ibop_Install()
        implicit none
        call Set_Ibop(IBOP_INSTALL)
    end subroutine
    
    subroutine Set_Ibop_Remove()
        implicit none
        call Set_Ibop(IBOP_REMOVE)
    end subroutine
    
    
    
    
    logical function Get_RemoveIbop()
    !DEC$ ATTRIBUTES DLLEXPORT :: Get_RemoveIbop
    !DEC$ ATTRIBUTES ALIAS: 'Get_RemoveIbop' :: Get_RemoveIbop
        implicit none
        Get_RemoveIBop = .false. ! Ibop == REMOVE_IBOP
    end function
    
    logical function Get_InstallIbop()
    !DEC$ ATTRIBUTES DLLEXPORT :: Get_InstallIbop
    !DEC$ ATTRIBUTES ALIAS: 'Get_InstallIbop' :: Get_InstallIbop
        implicit none
        Get_InstallIbop = .false. ! Ibop == INSTALL_IBOP
    end function
    
end module CIbopEnumVariables