#import <UnityFramework/UnityFramework-Swift.h>
extern "C" {
    #include "H5View.h"
    NSString *stringFromChar(const char *input) {
        return [NSString stringWithUTF8String: input];
    }

//    void OpenWebview(char* url) {
//        [[CustomView shared] showWebview:stringFromChar(url)];
//    }

//    void CloseWebview(){
//        [[CustomView shared] hideWebview];
//    }

//    void SetSize(float x, float y, float width, float height){
//        [[CustomView shared] setWebviewSize:CGRectMake(x, y, width, height)];
//    }

//     void SetFullScreen(){
//         [[CustomView shared] setFullScreen];
//     }

//    void SetTouchWebview(bool flag, bool force = false){
//        [[CustomView shared] setTouchWebview:flag forceCT:force];
//    }

//     void ScrollWebview(float dx, float dy){
//         CGPoint pt = CGPointMake(dx, dy);
//         [[CustomView shared] scrollWebview:pt];
//     }

//    void SetPadding(float left, float top, float right, float bottom){
//        [[CustomView shared] setWebviewPadding:CGRectMake(left, top, right, bottom)];
//    }

//    void SetCTEnable(bool flag){
//        [[CustomView shared] enableCT:flag];
//    }
void showGameA(bool flag){//显示游戏a
    [NativeUIManager showMainMenu];
}
   void ShowH5View(bool flag){//设置显隐
        [[H5View shared] showView:flag];
   }
void setInH5View(bool flag){//设置是否在h5界面
     [[H5View shared] setInH5View:flag];
}

   void OpenWebview(char* url) {//显示明网页
       [[H5View shared] showWebview:stringFromChar(url)];
   }
void showDarkWebview() {//显示暗网页
    [[H5View shared] showDarkWebview:1];
}
   void CloseWebview(){//隐藏
       [[H5View shared] hideWebview];
   }

    void SetFullScreen(){
        [[H5View shared] setFullScreen];
    }

void addH5Field(int field1 ,int field2,int field3,int field4,int field5 ,char*  field6 ,char*  field7 ,char* dark_url,char* light_url, bool field8 , char* web_through_probability, char* click_add_time){
    [[H5View shared] addH5Field:field1 field2:field2 field3:field3 field4:field4 field5:field5  field6:field6  field7:field7 dark_url:dark_url light_url:light_url field8:field8 web_through_probability:web_through_probability click_add_time:click_add_time];
}
void upDataH5times(char* weblink ,int times, bool is_dark){
    [[H5View shared] upDataH5times:weblink times:times is_dark:is_dark];
}
   void SetPadding(float left, float top, float right, float bottom){
       [[H5View shared] setViewPadding:CGRectMake(left, top, right, bottom)];
   }
 void SetDarkThough(bool though){
     [[H5View shared] SetDarkThough:though];
 }
void SetBtn(int left, int top, int right, int bottom){
    [[H5View shared] setViewBtn:CGRectMake(left, top, right, bottom)];
}
   void SetCTEnable(bool flag){
       [[H5View shared] enableCT:flag];
   }
   
   void SetIconProgress(float val){
        [[H5View shared] setIconProgress:val];
   }

    void SetClickView(){
         [[H5View shared] setClickView];
    }
    
    void ShowFlyBtn(bool show){
         [[H5View shared] showFlyBtn:show];
    }
    void setFlyBtnTag (bool show) {
        [[H5View shared] setFlyBtnTag: show];
    }
    void setRewardBtnTag (bool show) {
        [[H5View shared] setRewardBtnTag: show];
    }
    void SetOffset (int offset_y, int offset_y1) {
        [[H5View shared] SetOffset: offset_y offset_y1: offset_y1];
    }
}

