generateDispatch method

Future<void> generateDispatch({
  1. required String path,
  2. required IOSink exportSink,
  3. Set<String> enumSet = const {},
  4. Set<String> structSet = const {},
  5. Set<String> callbackStructSet = const {},
})

Generates code for dispatch

Implementation

Future<void> generateDispatch({
  required String path,
  required IOSink exportSink,
  Set<String> enumSet = const {},
  Set<String> structSet = const {},
  Set<String> callbackStructSet = const {},
}) async {
  SteamInitializer dispatch = SteamInitializer(
    name: "Dispatch",
    methods: [
      SteamMethod(
        name: "Init",
        nameFlat: "SteamAPI_ManualDispatch_Init",
        returnType: "void",
      ),
      SteamMethod(
        name: "RunFrame",
        nameFlat: "SteamAPI_ManualDispatch_RunFrame",
        returnType: "void",
        params: [
          SteamParam(
            name: "hSteamPipe",
            type: "HSteamPipe",
          ),
        ],
      ),
      SteamMethod(
        name: "GetNextCallback",
        nameFlat: "SteamAPI_ManualDispatch_GetNextCallback",
        returnType: "bool",
        params: [
          SteamParam(
            name: "hSteamPipe",
            type: "HSteamPipe",
          ),
          SteamParam(
            name: "pCallbackMsg",
            type: "CallbackMsg_t *",
          ),
        ],
      ),
      SteamMethod(
        name: "FreeLastCallback",
        nameFlat: "SteamAPI_ManualDispatch_FreeLastCallback",
        returnType: "void",
        params: [
          SteamParam(
            name: "hSteamPipe",
            type: "HSteamPipe",
          ),
        ],
      ),
      SteamMethod(
        name: "GetAPICallResult",
        nameFlat: "SteamAPI_ManualDispatch_GetAPICallResult",
        returnType: "bool",
        params: [
          SteamParam(
            name: "hSteamPipe",
            type: "HSteamPipe",
          ),
          SteamParam(
            name: "hSteamAPICall",
            type: "SteamAPICall_t",
          ),
          SteamParam(
            name: "pCallback",
            type: "void *",
          ),
          SteamParam(
            name: "cubCallback",
            type: "int",
          ),
          SteamParam(
            name: "iCallbackExpected",
            type: "int",
          ),
          SteamParam(
            name: "pbFailed",
            type: "bool *",
          ),
        ],
      ),
    ],
  );

  await dispatch.generateFile(
    path: path,
    exportSink: exportSink,
    enumSet: enumSet,
    structSet: structSet,
    callbackStructSet: callbackStructSet,
  );
}