/*
 * This file is auto-generated, do not modify!
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#pragma once
#include <fu-input-stream.h>
/**
 * FuEdidDescriptorTag:
 */
typedef enum {
    /**
     * FU_EDID_DESCRIPTOR_TAG_DISPLAY_PRODUCT_SERIAL_NUMBER:
     */
    FU_EDID_DESCRIPTOR_TAG_DISPLAY_PRODUCT_SERIAL_NUMBER = 0xFF,
    /**
     * FU_EDID_DESCRIPTOR_TAG_ALPHANUMERIC_DATA_STRING:
     */
    FU_EDID_DESCRIPTOR_TAG_ALPHANUMERIC_DATA_STRING = 0xFE,
    /**
     * FU_EDID_DESCRIPTOR_TAG_DISPLAY_RANGE_LIMITS:
     */
    FU_EDID_DESCRIPTOR_TAG_DISPLAY_RANGE_LIMITS = 0xFD,
    /**
     * FU_EDID_DESCRIPTOR_TAG_DISPLAY_PRODUCT_NAME:
     */
    FU_EDID_DESCRIPTOR_TAG_DISPLAY_PRODUCT_NAME = 0xFC,
    /**
     * FU_EDID_DESCRIPTOR_TAG_COLOR_POINT_DATA:
     */
    FU_EDID_DESCRIPTOR_TAG_COLOR_POINT_DATA = 0xFB,
    /**
     * FU_EDID_DESCRIPTOR_TAG_STANDARD_TIMING_IDENTIFICATIONS:
     */
    FU_EDID_DESCRIPTOR_TAG_STANDARD_TIMING_IDENTIFICATIONS = 0xFA,
    /**
     * FU_EDID_DESCRIPTOR_TAG_DISPLAY_COLOR_MANAGEMENT_DATA:
     */
    FU_EDID_DESCRIPTOR_TAG_DISPLAY_COLOR_MANAGEMENT_DATA = 0xF9,
    /**
     * FU_EDID_DESCRIPTOR_TAG_CVT_TIMING_CODES:
     */
    FU_EDID_DESCRIPTOR_TAG_CVT_TIMING_CODES = 0xF8,
    /**
     * FU_EDID_DESCRIPTOR_TAG_ESTABLISHED_TIMINGS:
     */
    FU_EDID_DESCRIPTOR_TAG_ESTABLISHED_TIMINGS = 0xF7,
    /**
     * FU_EDID_DESCRIPTOR_TAG_DUMMY_DESCRIPTOR:
     */
    FU_EDID_DESCRIPTOR_TAG_DUMMY_DESCRIPTOR = 0x10,
}  FuEdidDescriptorTag;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructEdidDescriptor;

FuStructEdidDescriptor *fu_struct_edid_descriptor_ref(FuStructEdidDescriptor *st) G_GNUC_NON_NULL(1);
void fu_struct_edid_descriptor_unref(FuStructEdidDescriptor *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructEdidDescriptor, fu_struct_edid_descriptor_unref)
FuStructEdidDescriptor *fu_struct_edid_descriptor_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructEdidDescriptor *fu_struct_edid_descriptor_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_edid_descriptor_get_kind(const FuStructEdidDescriptor *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_edid_descriptor_get_subkind(const FuStructEdidDescriptor *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuEdidDescriptorTag fu_struct_edid_descriptor_get_tag(const FuStructEdidDescriptor *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_edid_descriptor_get_data(const FuStructEdidDescriptor *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_edid_descriptor_set_kind(FuStructEdidDescriptor *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_edid_descriptor_set_subkind(FuStructEdidDescriptor *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_edid_descriptor_set_tag(FuStructEdidDescriptor *st, FuEdidDescriptorTag value) G_GNUC_NON_NULL(1);
gboolean fu_struct_edid_descriptor_set_data(FuStructEdidDescriptor *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_EDID_DESCRIPTOR_OFFSET_KIND 0x0
#define FU_STRUCT_EDID_DESCRIPTOR_OFFSET_SUBKIND 0x2
#define FU_STRUCT_EDID_DESCRIPTOR_OFFSET_TAG 0x3
#define FU_STRUCT_EDID_DESCRIPTOR_OFFSET_DATA 0x5
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_EDID_DESCRIPTOR_SIZE_DATA 0xD
#define FU_STRUCT_EDID_DESCRIPTOR_N_ELEMENTS_DATA 13
#define FU_STRUCT_EDID_DESCRIPTOR_SIZE 0x12
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructEdid;

FuStructEdid *fu_struct_edid_ref(FuStructEdid *st) G_GNUC_NON_NULL(1);
void fu_struct_edid_unref(FuStructEdid *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructEdid, fu_struct_edid_unref)
FuStructEdid *fu_struct_edid_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructEdid *fu_struct_edid_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_edid_get_manufacturer_name(const FuStructEdid *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_edid_get_product_code(const FuStructEdid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_edid_get_serial_number(const FuStructEdid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_edid_get_week_of_manufacture(const FuStructEdid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_edid_get_year_of_manufacture(const FuStructEdid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_edid_get_revision_number(const FuStructEdid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_edid_get_data_blocks(const FuStructEdid *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_edid_get_extension_block_count(const FuStructEdid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_edid_get_checksum(const FuStructEdid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_edid_set_manufacturer_name(FuStructEdid *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_edid_set_product_code(FuStructEdid *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_edid_set_serial_number(FuStructEdid *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_edid_set_week_of_manufacture(FuStructEdid *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_edid_set_year_of_manufacture(FuStructEdid *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_edid_set_revision_number(FuStructEdid *st, guint8 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_edid_set_data_blocks(FuStructEdid *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_edid_set_extension_block_count(FuStructEdid *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_edid_set_checksum(FuStructEdid *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_EDID_OFFSET_HEADER 0x0
#define FU_STRUCT_EDID_OFFSET_MANUFACTURER_NAME 0x8
#define FU_STRUCT_EDID_OFFSET_PRODUCT_CODE 0xA
#define FU_STRUCT_EDID_OFFSET_SERIAL_NUMBER 0xC
#define FU_STRUCT_EDID_OFFSET_WEEK_OF_MANUFACTURE 0x10
#define FU_STRUCT_EDID_OFFSET_YEAR_OF_MANUFACTURE 0x11
#define FU_STRUCT_EDID_OFFSET_EDID_VERSION_NUMBER 0x12
#define FU_STRUCT_EDID_OFFSET_REVISION_NUMBER 0x13
#define FU_STRUCT_EDID_OFFSET_DATA_BLOCKS 0x36
#define FU_STRUCT_EDID_OFFSET_EXTENSION_BLOCK_COUNT 0x7E
#define FU_STRUCT_EDID_OFFSET_CHECKSUM 0x7F
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_EDID_SIZE_HEADER 0x8
#define FU_STRUCT_EDID_N_ELEMENTS_HEADER 8
#define FU_STRUCT_EDID_SIZE_MANUFACTURER_NAME 0x2
#define FU_STRUCT_EDID_N_ELEMENTS_MANUFACTURER_NAME 2
#define FU_STRUCT_EDID_SIZE_DATA_BLOCKS 0x48
#define FU_STRUCT_EDID_N_ELEMENTS_DATA_BLOCKS 72
#define FU_STRUCT_EDID_SIZE 0x80
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_EDID_DEFAULT_HEADER "\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00"
#define FU_STRUCT_EDID_DEFAULT_EDID_VERSION_NUMBER 0x1
#define FU_STRUCT_EDID_DEFAULT_REVISION_NUMBER 0x3
#endif
