NMABarCode: libnma Reference Manual

## NMABarCode NMABarCode |

## Functions

NMABarCode * | nma_bar_code_new ()
void | nma_bar_code_set_text ()
int | nma_bar_code_get_size ()
void | nma_bar_code_draw ()

## Properties

int | size | Read
char * | text | Write

## Types and Values

#define | NMA_BAR_CODE_TEXT
#define | NMA_BAR_CODE_SIZE

## Object Hierarchy

        GObject
        ╰── NMABarCode

## Description

A Bar Code object provides the means of drawing a QR code onto a cairo context. Useful for rendering Wi-Fi network credential in a form that can be optically scanned with a phone camera.

## Functions

### nma_bar_code_new ()

    NMABarCode *
    nma_bar_code_new (const char *text);

#### Parameters

text | set the bar code text |

#### Returns

the bar code instance.

[transfer full]

Since: 1.8.22

### nma_bar_code_set_text ()

    void
    nma_bar_code_set_text (NMABarCode *self,
                           const char *text);

Regenerates the QR code for a different text.

#### Parameters

self | bar code instance |
text | new bar code text |

Since: 1.8.22

### nma_bar_code_get_size ()

    int
    nma_bar_code_get_size (NMABarCode *self);

#### Parameters

self | bar code instance |

#### Returns

the side of a QR code square.

Since: 1.8.22

### nma_bar_code_draw ()

    void
    nma_bar_code_draw (NMABarCode *self,
                       cairo_t *cr);

Draws the QR code onto the given context.

#### Parameters

self | bar code instance |
cr | cairo context |

Since: 1.8.22

## Types and Values

### NMA_BAR_CODE_TEXT

    #define NMA_BAR_CODE_TEXT "text"

### NMA_BAR_CODE_SIZE

    #define NMA_BAR_CODE_SIZE "size"

## Property Details

### The `“size”` property

      “size”                     int

Owner: NMABarCode

Flags: Read

Default value: 0

### The `“text”` property

      “text”                     char *

Owner: NMABarCode

Flags: Write

Default value: ""