initial commit
This commit is contained in:
commit
cff2a21efc
550 files changed
+154887
No files matched your search
@@ -0,0 +1,47 @@
|
||||
// Copyright (c) 2013-15, LKC Technologies, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer. Redistributions in binary
|
||||
// form must reproduce the above copyright notice, this list of conditions and
|
||||
// the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||
// HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CODE128_H
|
||||
#define CODE128_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Since the FNCn characters are not ASCII, define versions here to
|
||||
// simplify encoding strings that include them.
|
||||
#define CODE128_FNC1 '\xf1'
|
||||
#define CODE128_FNC2 '\xf2'
|
||||
#define CODE128_FNC3 '\xf3'
|
||||
#define CODE128_FNC4 '\xf4'
|
||||
|
||||
size_t code128_estimate_len(const char * s);
|
||||
size_t code128_encode_gs1(const char * s, char * out, size_t maxlength);
|
||||
size_t code128_encode_raw(const char * s, char * out, size_t maxlength);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CODE128_H
|
||||
@@ -0,0 +1,118 @@
|
||||
/**
|
||||
* @file lv_barcode.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_BARCODE_H
|
||||
#define LV_BARCODE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../../lv_conf_internal.h"
|
||||
#include "../../misc/lv_types.h"
|
||||
#include "../../misc/lv_color.h"
|
||||
#include "../../widgets/canvas/lv_canvas.h"
|
||||
|
||||
#if LV_USE_BARCODE
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_barcode_class;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Create an empty barcode (an `lv_canvas`) object.
|
||||
* @param parent point to an object where to create the barcode
|
||||
* @return pointer to the created barcode object
|
||||
*/
|
||||
lv_obj_t * lv_barcode_create(lv_obj_t * parent);
|
||||
|
||||
/**
|
||||
* Set the dark color of a barcode object
|
||||
* @param obj pointer to barcode object
|
||||
* @param color dark color of the barcode
|
||||
*/
|
||||
void lv_barcode_set_dark_color(lv_obj_t * obj, lv_color_t color);
|
||||
|
||||
/**
|
||||
* Set the light color of a barcode object
|
||||
* @param obj pointer to barcode object
|
||||
* @param color light color of the barcode
|
||||
*/
|
||||
void lv_barcode_set_light_color(lv_obj_t * obj, lv_color_t color);
|
||||
|
||||
/**
|
||||
* Set the scale of a barcode object
|
||||
* @param obj pointer to barcode object
|
||||
* @param scale scale factor
|
||||
*/
|
||||
void lv_barcode_set_scale(lv_obj_t * obj, uint16_t scale);
|
||||
|
||||
/**
|
||||
* Set the direction of a barcode object
|
||||
* @param obj pointer to barcode object
|
||||
* @param direction draw direction (`LV_DIR_HOR` or `LB_DIR_VER`)
|
||||
*/
|
||||
void lv_barcode_set_direction(lv_obj_t * obj, lv_dir_t direction);
|
||||
|
||||
/**
|
||||
* Set the tiled mode of a barcode object
|
||||
* @param obj pointer to barcode object
|
||||
* @param tiled true: tiled mode, false: normal mode (default)
|
||||
*/
|
||||
void lv_barcode_set_tiled(lv_obj_t * obj, bool tiled);
|
||||
|
||||
/**
|
||||
* Set the data of a barcode object
|
||||
* @param obj pointer to barcode object
|
||||
* @param data data to display
|
||||
* @return LV_RESULT_OK: if no error; LV_RESULT_INVALID: on error
|
||||
*/
|
||||
lv_result_t lv_barcode_update(lv_obj_t * obj, const char * data);
|
||||
|
||||
/**
|
||||
* Get the dark color of a barcode object
|
||||
* @param obj pointer to barcode object
|
||||
* @return dark color of the barcode
|
||||
*/
|
||||
lv_color_t lv_barcode_get_dark_color(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the light color of a barcode object
|
||||
* @param obj pointer to barcode object
|
||||
* @return light color of the barcode
|
||||
*/
|
||||
lv_color_t lv_barcode_get_light_color(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the scale of a barcode object
|
||||
* @param obj pointer to barcode object
|
||||
* @return scale factor
|
||||
*/
|
||||
uint16_t lv_barcode_get_scale(lv_obj_t * obj);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_USE_BARCODE*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_BARCODE_H*/
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* @file lv_barcode_private.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_BARCODE_PRIVATE_H
|
||||
#define LV_BARCODE_PRIVATE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
#include "../../widgets/canvas/lv_canvas_private.h"
|
||||
#include "lv_barcode.h"
|
||||
|
||||
#if LV_USE_BARCODE
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/*Data of barcode*/
|
||||
struct _lv_barcode_t {
|
||||
lv_canvas_t canvas;
|
||||
lv_color_t dark_color;
|
||||
lv_color_t light_color;
|
||||
uint16_t scale;
|
||||
lv_dir_t direction;
|
||||
bool tiled;
|
||||
};
|
||||
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /* LV_USE_BARCODE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_BARCODE_PRIVATE_H*/
|
||||
Reference in new issue
Block a user