add resource api

add some resource apis, dialog apis and Ptr util