wxWidgets 2.8 and qrcode-win32-3.1.1
От: Chehov85 Россия  
Дата: 03.08.11 11:35
Оценка:
Каким образом можно использовать библиотеку qrcode-win32-3.1.1 вместе с wxWidgets, в общем нужно так сказать не саму библиотеку использовать а юзать из ее набора qrcodelib.dll, помогите плизз...
Re: wxWidgets 2.8 and qrcode-win32-3.1.1
От: Chehov85 Россия  
Дата: 03.08.11 11:46
Оценка:
Здравствуйте, Chehov85, Вы писали:

C>Каким образом можно использовать библиотеку qrcode-win32-3.1.1 вместе с wxWidgets, в общем нужно так сказать не саму библиотеку использовать а юзать из ее набора qrcodelib.dll, помогите плизз...


Среда CodeBlocks

скинул qrcodelib.dll к экзешнику приложения, а к опциям Linker Settings добавил qrcodelib.lib из поставки, пытаюсь выполнить demo код


QRcode_List *qrcodes;
 QRcode_List *entry;
 QRcode *qrcode;

 qrcodes = QRcode_encodeStringStructured("Welcome to...");
 entry = qrcodes;
 while(entry != NULL) {
    qrcode = entry->code;
    // do something
     entry = entry->next;
 }
 QRcode_List_free(entry);



но выдает ошибку:

...qrtestMain.cpp|100|error: too few arguments to function 'QRcode_List* QRcode_encodeStringStructured(const char*, int, QRecLevel, QRencodeMode, int)'
...qrencode.h|401|note: declared here
Re[2]: wxWidgets 2.8 and qrcode-win32-3.1.1
От: Chehov85 Россия  
Дата: 03.08.11 11:47
Оценка:
Здравствуйте, Chehov85, Вы писали:

C>Здравствуйте, Chehov85, Вы писали:


C>>Каким образом можно использовать библиотеку qrcode-win32-3.1.1 вместе с wxWidgets, в общем нужно так сказать не саму библиотеку использовать а юзать из ее набора qrcodelib.dll, помогите плизз...


C>Среда CodeBlocks


C>скинул qrcodelib.dll к экзешнику приложения, а к опциям Linker Settings добавил qrcodelib.lib из поставки, пытаюсь выполнить demo код



C>
C>QRcode_List *qrcodes;
C> QRcode_List *entry;
C> QRcode *qrcode;

C> qrcodes = QRcode_encodeStringStructured("Welcome to...");
C> entry = qrcodes;
C> while(entry != NULL) {
C>    qrcode = entry->code;
C>    // do something
C>     entry = entry->next;
C> }
C> QRcode_List_free(entry);
C>



C>но выдает ошибку:


C>...qrtestMain.cpp|100|error: too few arguments to function 'QRcode_List* QRcode_encodeStringStructured(const char*, int, QRecLevel, QRencodeMode, int)'

C>...qrencode.h|401|note: declared here

Вот заголовочный:


/**
 * qrencode - QR Code encoder
 *
 * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */

/** \mainpage
 * Libqrencode is a library for encoding data in a QR Code symbol, a kind of 2D
 * symbology.
 *
 * \section encoding Encoding
 * 
 * There are two ways to encode data: <b>encoding a string</b> or 
 * <b>encoding a structured data</b>.
 *
 * \subsection encoding-string Encoding a string
 * You can encode a string by calling QRcode_encodeString().
 * The given string is parsed automatically and encoded. If you want to encode
 * data that can be represented as a C string style (NUL terminated), you can
 * simply use this way.
 *
 * If the input data contains Kanji (Shift-JIS) characters and you want to
 * encode them as Kanji in QR Code, you should give QR_MODE_KANJI as a hint.
 * Otherwise, all of non-alphanumeric characters are encoded as 8 bit data.
 * If you want to encode a whole string in 8 bit mode, use
 * QRcode_encodeString8bit() instead.
 *
 * Please note that a C string can not contain NUL character. If your data
 * contains NUL, you should chose the second way.
 *
 * \subsection encoding-input Encoding a structured data
 * You can construct a structured input data manually. If the structure of the
 * input data is known, you can use this way.
 * At first, create a ::QRinput object by QRinput_new(). Then add input data
 * to the QRinput object by QRinput_append(). Finally call QRcode_encodeInput()
 * to encode the QRinput data.
 * You can reuse the QRinput data again to encode it in other symbols with
 * different parameters.
 *
 * \section result Result
 * The encoded symbol is resulted as a ::QRcode object. It will contain
 * its version number, width of the symbol and an array represents the symbol.
 * See ::QRcode for the details. You can free the object by QRcode_free().
 *
 * Please note that the version of the result may be larger than specified.
 * In such cases, the input data would be too large to be encoded in a
 * symbol of the specified version.
 *
 * \section structured Structured append
 * Libqrencode can generate "Structured-appended" symbols that enables to split
 * a large data set into mulitple QR codes. A QR code reader concatenates
 * multiple QR code symbols into a string.
 * Just like QRcode_encodeString(), you can use QRcode_encodeStringStructured()
 * to generate structured-appended symbols. This functions returns an instance
 * of ::QRcode_List. The returned list is a singly-linked list of QRcode: you
 * can retrieve each QR code in this way:
 *  
 * \code
 * QRcode_List *qrcodes;
 * QRcode_List *entry;
 * QRcode *qrcode;
 *
 * qrcodes = QRcode_encodeStringStructured(...);
 * entry = qrcodes;
 * while(entry != NULL) {
 *     qrcode = entry->code;
 *     // do something
 *     entry = entry->next;
 * }
 * QRcode_List_free(entry);
 * \endcode
 *
 * Instead of using auto-parsing functions, you can construct your own
 * structured input. At first, instantiate an object of ::QRinput_Struct
 * by calling QRinput_Struct_new(). This object can hold multiple ::QRinput,
 * and one QR code is generated for a ::QRinput.
 * QRinput_Struct_appendInput() appends a ::QRinput to a ::QRinput_Struct
 * object. In order to generate structured-appended symbols, it is required to
 * embed headers to each symbol. You can use
 * QRinput_Struct_insertStructuredAppendHeaders() to insert appropriate
 * headers to each symbol. You should call this function just once before
 * encoding symbols.
 */

#ifndef __QRENCODE_H__
#define __QRENCODE_H__

#if defined(__cplusplus)
extern "C" {
#endif

/**
 * Encoding mode.
 */
typedef enum {
    QR_MODE_NUL = -1,  ///< Terminator (NUL character). Internal use only
    QR_MODE_NUM = 0,   ///< Numeric mode
    QR_MODE_AN,        ///< Alphabet-numeric mode
    QR_MODE_8,         ///< 8-bit data mode
    QR_MODE_KANJI,     ///< Kanji (shift-jis) mode
    QR_MODE_STRUCTURE, ///< Internal use only
} QRencodeMode;

/**
 * Level of error correction.
 */
typedef enum {
    QR_ECLEVEL_L = 0, ///< lowest
    QR_ECLEVEL_M,
    QR_ECLEVEL_Q,
    QR_ECLEVEL_H      ///< highest
} QRecLevel;

/******************************************************************************
 * Input data (qrinput.c)
 *****************************************************************************/

/**
 * Singly linked list to contain input strings. An instance of this class
 * contains its version and error correction level too. It is required to
 * set them by QRinput_setVersion() and QRinput_setErrorCorrectionLevel(),
 * or use QRinput_new2() to instantiate an object.
 */
typedef struct _QRinput QRinput;

/**
 * Instantiate an input data object. The version is set to 0 (auto-select)
 * and the error correction level is set to QR_ECLEVEL_L.
 * @return an input object (initialized). On error, NULL is returned and errno
 *         is set to indicate the error.
 * @throw ENOMEM unable to allocate memory.
 */
extern QRinput *QRinput_new(void);

/**
 * Instantiate an input data object.
 * @param version version number.
 * @param level Error correction level.
 * @return an input object (initialized). On error, NULL is returned and errno
 *         is set to indicate the error.
 * @throw ENOMEM unable to allocate memory for input objects.
 * @throw EINVAL invalid arguments.
 */
extern QRinput *QRinput_new2(int version, QRecLevel level);

/**
 * Append data to an input object.
 * The data is copied and appended to the input object.
 * @param input input object.
 * @param mode encoding mode.
 * @param size size of data (byte).
 * @param data a pointer to the memory area of the input data.
 * @retval 0 success.
 * @retval -1 an error occurred and errno is set to indeicate the error.
 *            See Execptions for the details.
 * @throw ENOMEM unable to allocate memory.
 * @throw EINVAL input data is invalid.
 *
 */
extern int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned char *data);

/**
 * Get current version.
 * @param input input object.
 * @return current version.
 */
extern int QRinput_getVersion(QRinput *input);

/**
 * Set version of the QR-code that is to be encoded.
 * @param input input object.
 * @param version version number (0 = auto)
 * @retval 0 success.
 * @retval -1 invalid argument.
 */
extern int QRinput_setVersion(QRinput *input, int version);

/**
 * Get current error correction level.
 * @param input input object.
 * @return Current error correcntion level.
 */
extern QRecLevel QRinput_getErrorCorrectionLevel(QRinput *input);

/**
 * Set error correction level of the QR-code that is to be encoded.
 * @param input input object.
 * @param level Error correction level.
 * @retval 0 success.
 * @retval -1 invalid argument.
 */
extern int QRinput_setErrorCorrectionLevel(QRinput *input, QRecLevel level);

/**
 * Free the input object.
 * All of data chunks in the input object are freed too.
 * @param input input object.
 */
extern void QRinput_free(QRinput *input);

/**
 * Validate the input data.
 * @param mode encoding mode.
 * @param size size of data (byte).
 * @param data a pointer to the memory area of the input data.
 * @retval 0 success.
 * @retval -1 invalid arguments.
 */
extern int QRinput_check(QRencodeMode mode, int size, const unsigned char *data);

/**
 * Set of QRinput for structured symbols.
 */
typedef struct _QRinput_Struct QRinput_Struct;

/**
 * Instantiate a set of input data object.
 * @return an instance of QRinput_Struct. On error, NULL is returned and errno
 *         is set to indicate the error.
 * @throw ENOMEM unable to allocate memory.
 */
extern QRinput_Struct *QRinput_Struct_new(void);

/**
 * Set parity of structured symbols.
 * @param s structured input object.
 * @param parity parity of s.
 */
extern void QRinput_Struct_setParity(QRinput_Struct *s, unsigned char parity);

/**
 * Append a QRinput object to the set.
 * @warning never append the same QRinput object twice or more.
 * @param s structured input object.
 * @param input an input object.
 * @retval >0 number of input objects in the structure.
 * @retval -1 an error occurred. See Exceptions for the details.
 * @throw ENOMEM unable to allocate memory.
 */
extern int QRinput_Struct_appendInput(QRinput_Struct *s, QRinput *input);

/**
 * Free all of QRinput in the set.
 * @param s a structured input object.
 */
extern void QRinput_Struct_free(QRinput_Struct *s);

/**
 * Split a QRinput to QRinput_Struct. It calculates a parity, set it, then
 * insert structured-append headers.
 * @param input input object. Version number and error correction level must be
 *        set.
 * @return a set of input data. On error, NULL is returned, and errno is set
 *         to indicate the error. See Exceptions for the details.
 * @throw ERANGE input data is too large.
 * @throw EINVAL invalid input data.
 * @throw ENOMEM unable to allocate memory.
 */
extern QRinput_Struct *QRinput_splitQRinputToStruct(QRinput *input);

/**
 * Insert structured-append headers to the input structure. It calculates
 * a parity and set it if the parity is not set yet.
 * @param s input structure
 * @retval 0 success.
 * @retval -1 an error occurred and errno is set to indeicate the error.
 *            See Execptions for the details.
 * @throw EINVAL invalid input object.
 * @throw ENOMEM unable to allocate memory.
 */
extern int QRinput_Struct_insertStructuredAppendHeaders(QRinput_Struct *s);

/******************************************************************************
 * QRcode output (qrencode.c)
 *****************************************************************************/

/**
 * QRcode class.
 * Symbol data is represented as an array contains width*width uchars.
 * Each uchar represents a module (dot). If the less significant bit of
 * the uchar is 1, the corresponding module is black. The other bits are
 * meaningless for usual applications, but here its specification is described.
 *
 * <pre>
 * MSB 76543210 LSB
 *     |||||||`- 1=black/0=white
 *     ||||||`-- data and ecc code area
 *     |||||`--- format information
 *     ||||`---- version information
 *     |||`----- timing pattern
 *     ||`------ alignment pattern
 *     |`------- finder pattern and separator
 *     `-------- non-data modules (format, timing, etc.)
 * </pre>
 */
typedef struct {
    int version;         ///< version of the symbol
    int width;           ///< width of the symbol
    unsigned char *data; ///< symbol data
} QRcode;

/**
 * Singly-linked list of QRcode. Used to represent a structured symbols.
 * A list is terminated with NULL.
 */
typedef struct _QRcode_List QRcode_List;

struct _QRcode_List {
    QRcode *code;
    QRcode_List *next;
};

/**
 * Create a symbol from the input data.
 * @warning This function is THREAD UNSAFE.
 * @param input input data.
 * @return an instance of QRcode class. The version of the result QRcode may
 *         be larger than the designated version. On error, NULL is returned,
 *         and errno is set to indicate the error. See Exceptions for the
 *         details.
 * @throw EINVAL invalid input object.
 * @throw ENOMEM unable to allocate memory for input objects.
 */
extern QRcode *QRcode_encodeInput(QRinput *input);

/**
 * Create a symbol from the string. The library automatically parses the input
 * string and encodes in a QR Code symbol.
 * @warning This function is THREAD UNSAFE.
 * @param string input string. It must be NULL terminated.
 * @param version version of the symbol. If 0, the library chooses the minimum
 *                version for the given input data.
 * @param level error correction level.
 * @param hint tell the library how non-alphanumerical characters should be
 *             encoded. If QR_MODE_KANJI is given, kanji characters will be
 *             encoded as Shif-JIS characters. If QR_MODE_8 is given, all of
 *             non-alphanumerical characters will be encoded as is. If you want
 *             to embed UTF-8 string, choose this.
 * @param casesensitive case-sensitive(1) or not(0).
 * @return an instance of QRcode class. The version of the result QRcode may
 *         be larger than the designated version. On error, NULL is returned,
 *         and errno is set to indicate the error. See Exceptions for the
 *         details.
 * @throw EINVAL invalid input object.
 * @throw ENOMEM unable to allocate memory for input objects.
 */
extern QRcode *QRcode_encodeString(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive);

/**
 * Same to QRcode_encodeString(), but encode whole data in 8-bit mode.
 * @warning This function is THREAD UNSAFE.
 */
extern QRcode *QRcode_encodeString8bit(const char *string, int version, QRecLevel level);

/**
 * Free the instance of QRcode class.
 * @param qrcode an instance of QRcode class.
 */
extern void QRcode_free(QRcode *qrcode);

/**
 * Create structured symbols from the input data.
 * @warning This function is THREAD UNSAFE.
 * @param s
 * @return a singly-linked list of QRcode.
 */
extern QRcode_List *QRcode_encodeInputStructured(QRinput_Struct *s);

/**
 * Create structured symbols from the string. The library automatically parses
 * the input string and encodes in a QR Code symbol.
 * @warning This function is THREAD UNSAFE.
 * @param string input string. It should be NULL terminated.
 * @param version version of the symbol.
 * @param level error correction level.
 * @param hint tell the library how non-alphanumerical characters should be
 *             encoded. If QR_MODE_KANJI is given, kanji characters will be
 *             encoded as Shif-JIS characters. If QR_MODE_8 is given, all of
 *             non-alphanumerical characters will be encoded as is. If you want
 *             to embed UTF-8 string, choose this.
 * @param casesensitive case-sensitive(1) or not(0).
 * @return a singly-linked list of QRcode. On error, NULL is returned, and
 *         errno is set to indicate the error. See Exceptions for the details.
 * @throw EINVAL invalid input object.
 * @throw ENOMEM unable to allocate memory for input objects.
 */
extern QRcode_List *QRcode_encodeStringStructured(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive);

/**
 * Same to QRcode_encodeStringStructured(), but encode whole data in 8-bit mode.
 * @warning This function is THREAD UNSAFE.
 */
extern QRcode_List *QRcode_encodeString8bitStructured(const char *string, int version, QRecLevel level);

/**
 * Return the number of symbols included in a QRcode_List.
 * @param qrlist a head entry of a QRcode_List.
 * @return number of symbols in the list.
 */
extern int QRcode_List_size(QRcode_List *qrlist);

/**
 * Free the QRcode_List.
 * @param qrlist a head entry of a QRcode_List.
 */
extern void QRcode_List_free(QRcode_List *qrlist);

#if defined(__cplusplus)
}
#endif

#endif /* __QRENCODE_H__ */
Re[3]: wxWidgets 2.8 and qrcode-win32-3.1.1
От: Chehov85 Россия  
Дата: 03.08.11 11:50
Оценка:
Здравствуйте, Chehov85, Вы писали:

C>Здравствуйте, Chehov85, Вы писали:


C>>Здравствуйте, Chehov85, Вы писали:


C>>>Каким образом можно использовать библиотеку qrcode-win32-3.1.1 вместе с wxWidgets, в общем нужно так сказать не саму библиотеку использовать а юзать из ее набора qrcodelib.dll, помогите плизз...


C>>Среда CodeBlocks


C>>скинул qrcodelib.dll к экзешнику приложения, а к опциям Linker Settings добавил qrcodelib.lib из поставки, пытаюсь выполнить demo код



C>>
C>>QRcode_List *qrcodes;
C>> QRcode_List *entry;
C>> QRcode *qrcode;

C>> qrcodes = QRcode_encodeStringStructured("Welcome to...");
C>> entry = qrcodes;
C>> while(entry != NULL) {
C>>    qrcode = entry->code;
C>>    // do something
C>>     entry = entry->next;
C>> }
C>> QRcode_List_free(entry);
C>>



C>>но выдает ошибку:


C>>...qrtestMain.cpp|100|error: too few arguments to function 'QRcode_List* QRcode_encodeStringStructured(const char*, int, QRecLevel, QRencodeMode, int)'

C>>...qrencode.h|401|note: declared here

C>Вот заголовочный:



C>
C>/**
C> * qrencode - QR Code encoder
C> *
C> * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
C> *
C> * This library is free software; you can redistribute it and/or
C> * modify it under the terms of the GNU Lesser General Public
C> * License as published by the Free Software Foundation; either
C> * version 2.1 of the License, or any later version.
C> *
C> * This library is distributed in the hope that it will be useful,
C> * but WITHOUT ANY WARRANTY; without even the implied warranty of
C> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
C> * Lesser General Public License for more details.
C> *
C> * You should have received a copy of the GNU Lesser General Public
C> * License along with this library; if not, write to the Free Software
C> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
C> */

C>/** \mainpage
C> * Libqrencode is a library for encoding data in a QR Code symbol, a kind of 2D
C> * symbology.
C> *
C> * \section encoding Encoding
C> * 
C> * There are two ways to encode data: <b>encoding a string</b> or 
C> * <b>encoding a structured data</b>.
C> *
C> * \subsection encoding-string Encoding a string
C> * You can encode a string by calling QRcode_encodeString().
C> * The given string is parsed automatically and encoded. If you want to encode
C> * data that can be represented as a C string style (NUL terminated), you can
C> * simply use this way.
C> *
C> * If the input data contains Kanji (Shift-JIS) characters and you want to
C> * encode them as Kanji in QR Code, you should give QR_MODE_KANJI as a hint.
C> * Otherwise, all of non-alphanumeric characters are encoded as 8 bit data.
C> * If you want to encode a whole string in 8 bit mode, use
C> * QRcode_encodeString8bit() instead.
C> *
C> * Please note that a C string can not contain NUL character. If your data
C> * contains NUL, you should chose the second way.
C> *
C> * \subsection encoding-input Encoding a structured data
C> * You can construct a structured input data manually. If the structure of the
C> * input data is known, you can use this way.
C> * At first, create a ::QRinput object by QRinput_new(). Then add input data
C> * to the QRinput object by QRinput_append(). Finally call QRcode_encodeInput()
C> * to encode the QRinput data.
C> * You can reuse the QRinput data again to encode it in other symbols with
C> * different parameters.
C> *
C> * \section result Result
C> * The encoded symbol is resulted as a ::QRcode object. It will contain
C> * its version number, width of the symbol and an array represents the symbol.
C> * See ::QRcode for the details. You can free the object by QRcode_free().
C> *
C> * Please note that the version of the result may be larger than specified.
C> * In such cases, the input data would be too large to be encoded in a
C> * symbol of the specified version.
C> *
C> * \section structured Structured append
C> * Libqrencode can generate "Structured-appended" symbols that enables to split
C> * a large data set into mulitple QR codes. A QR code reader concatenates
C> * multiple QR code symbols into a string.
C> * Just like QRcode_encodeString(), you can use QRcode_encodeStringStructured()
C> * to generate structured-appended symbols. This functions returns an instance
C> * of ::QRcode_List. The returned list is a singly-linked list of QRcode: you
C> * can retrieve each QR code in this way:
C> *  
C> * \code
C> * QRcode_List *qrcodes;
C> * QRcode_List *entry;
C> * QRcode *qrcode;
C> *
C> * qrcodes = QRcode_encodeStringStructured(...);
C> * entry = qrcodes;
C> * while(entry != NULL) {
C> *     qrcode = entry->code;
C> *     // do something
C> *     entry = entry->next;
C> * }
C> * QRcode_List_free(entry);
C> * \endcode
C> *
C> * Instead of using auto-parsing functions, you can construct your own
C> * structured input. At first, instantiate an object of ::QRinput_Struct
C> * by calling QRinput_Struct_new(). This object can hold multiple ::QRinput,
C> * and one QR code is generated for a ::QRinput.
C> * QRinput_Struct_appendInput() appends a ::QRinput to a ::QRinput_Struct
C> * object. In order to generate structured-appended symbols, it is required to
C> * embed headers to each symbol. You can use
C> * QRinput_Struct_insertStructuredAppendHeaders() to insert appropriate
C> * headers to each symbol. You should call this function just once before
C> * encoding symbols.
C> */

C>#ifndef __QRENCODE_H__
C>#define __QRENCODE_H__

C>#if defined(__cplusplus)
C>extern "C" {
C>#endif

C>/**
C> * Encoding mode.
C> */
C>typedef enum {
C>    QR_MODE_NUL = -1,  ///< Terminator (NUL character). Internal use only
C>    QR_MODE_NUM = 0,   ///< Numeric mode
C>    QR_MODE_AN,        ///< Alphabet-numeric mode
C>    QR_MODE_8,         ///< 8-bit data mode
C>    QR_MODE_KANJI,     ///< Kanji (shift-jis) mode
C>    QR_MODE_STRUCTURE, ///< Internal use only
C>} QRencodeMode;

C>/**
C> * Level of error correction.
C> */
C>typedef enum {
C>    QR_ECLEVEL_L = 0, ///< lowest
C>    QR_ECLEVEL_M,
C>    QR_ECLEVEL_Q,
C>    QR_ECLEVEL_H      ///< highest
C>} QRecLevel;

C>/******************************************************************************
C> * Input data (qrinput.c)
C> *****************************************************************************/

C>/**
C> * Singly linked list to contain input strings. An instance of this class
C> * contains its version and error correction level too. It is required to
C> * set them by QRinput_setVersion() and QRinput_setErrorCorrectionLevel(),
C> * or use QRinput_new2() to instantiate an object.
C> */
C>typedef struct _QRinput QRinput;

C>/**
C> * Instantiate an input data object. The version is set to 0 (auto-select)
C> * and the error correction level is set to QR_ECLEVEL_L.
C> * @return an input object (initialized). On error, NULL is returned and errno
C> *         is set to indicate the error.
C> * @throw ENOMEM unable to allocate memory.
C> */
C>extern QRinput *QRinput_new(void);

C>/**
C> * Instantiate an input data object.
C> * @param version version number.
C> * @param level Error correction level.
C> * @return an input object (initialized). On error, NULL is returned and errno
C> *         is set to indicate the error.
C> * @throw ENOMEM unable to allocate memory for input objects.
C> * @throw EINVAL invalid arguments.
C> */
C>extern QRinput *QRinput_new2(int version, QRecLevel level);

C>/**
C> * Append data to an input object.
C> * The data is copied and appended to the input object.
C> * @param input input object.
C> * @param mode encoding mode.
C> * @param size size of data (byte).
C> * @param data a pointer to the memory area of the input data.
C> * @retval 0 success.
C> * @retval -1 an error occurred and errno is set to indeicate the error.
C> *            See Execptions for the details.
C> * @throw ENOMEM unable to allocate memory.
C> * @throw EINVAL input data is invalid.
C> *
C> */
C>extern int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned char *data);

C>/**
C> * Get current version.
C> * @param input input object.
C> * @return current version.
C> */
C>extern int QRinput_getVersion(QRinput *input);

C>/**
C> * Set version of the QR-code that is to be encoded.
C> * @param input input object.
C> * @param version version number (0 = auto)
C> * @retval 0 success.
C> * @retval -1 invalid argument.
C> */
C>extern int QRinput_setVersion(QRinput *input, int version);

C>/**
C> * Get current error correction level.
C> * @param input input object.
C> * @return Current error correcntion level.
C> */
C>extern QRecLevel QRinput_getErrorCorrectionLevel(QRinput *input);

C>/**
C> * Set error correction level of the QR-code that is to be encoded.
C> * @param input input object.
C> * @param level Error correction level.
C> * @retval 0 success.
C> * @retval -1 invalid argument.
C> */
C>extern int QRinput_setErrorCorrectionLevel(QRinput *input, QRecLevel level);

C>/**
C> * Free the input object.
C> * All of data chunks in the input object are freed too.
C> * @param input input object.
C> */
C>extern void QRinput_free(QRinput *input);

C>/**
C> * Validate the input data.
C> * @param mode encoding mode.
C> * @param size size of data (byte).
C> * @param data a pointer to the memory area of the input data.
C> * @retval 0 success.
C> * @retval -1 invalid arguments.
C> */
C>extern int QRinput_check(QRencodeMode mode, int size, const unsigned char *data);

C>/**
C> * Set of QRinput for structured symbols.
C> */
C>typedef struct _QRinput_Struct QRinput_Struct;

C>/**
C> * Instantiate a set of input data object.
C> * @return an instance of QRinput_Struct. On error, NULL is returned and errno
C> *         is set to indicate the error.
C> * @throw ENOMEM unable to allocate memory.
C> */
C>extern QRinput_Struct *QRinput_Struct_new(void);

C>/**
C> * Set parity of structured symbols.
C> * @param s structured input object.
C> * @param parity parity of s.
C> */
C>extern void QRinput_Struct_setParity(QRinput_Struct *s, unsigned char parity);

C>/**
C> * Append a QRinput object to the set.
C> * @warning never append the same QRinput object twice or more.
C> * @param s structured input object.
C> * @param input an input object.
C> * @retval >0 number of input objects in the structure.
C> * @retval -1 an error occurred. See Exceptions for the details.
C> * @throw ENOMEM unable to allocate memory.
C> */
C>extern int QRinput_Struct_appendInput(QRinput_Struct *s, QRinput *input);

C>/**
C> * Free all of QRinput in the set.
C> * @param s a structured input object.
C> */
C>extern void QRinput_Struct_free(QRinput_Struct *s);

C>/**
C> * Split a QRinput to QRinput_Struct. It calculates a parity, set it, then
C> * insert structured-append headers.
C> * @param input input object. Version number and error correction level must be
C> *        set.
C> * @return a set of input data. On error, NULL is returned, and errno is set
C> *         to indicate the error. See Exceptions for the details.
C> * @throw ERANGE input data is too large.
C> * @throw EINVAL invalid input data.
C> * @throw ENOMEM unable to allocate memory.
C> */
C>extern QRinput_Struct *QRinput_splitQRinputToStruct(QRinput *input);

C>/**
C> * Insert structured-append headers to the input structure. It calculates
C> * a parity and set it if the parity is not set yet.
C> * @param s input structure
C> * @retval 0 success.
C> * @retval -1 an error occurred and errno is set to indeicate the error.
C> *            See Execptions for the details.
C> * @throw EINVAL invalid input object.
C> * @throw ENOMEM unable to allocate memory.
C> */
C>extern int QRinput_Struct_insertStructuredAppendHeaders(QRinput_Struct *s);

C>/******************************************************************************
C> * QRcode output (qrencode.c)
C> *****************************************************************************/

C>/**
C> * QRcode class.
C> * Symbol data is represented as an array contains width*width uchars.
C> * Each uchar represents a module (dot). If the less significant bit of
C> * the uchar is 1, the corresponding module is black. The other bits are
C> * meaningless for usual applications, but here its specification is described.
C> *
C> * <pre>
C> * MSB 76543210 LSB
C> *     |||||||`- 1=black/0=white
C> *     ||||||`-- data and ecc code area
C> *     |||||`--- format information
C> *     ||||`---- version information
C> *     |||`----- timing pattern
C> *     ||`------ alignment pattern
C> *     |`------- finder pattern and separator
C> *     `-------- non-data modules (format, timing, etc.)
C> * </pre>
C> */
C>typedef struct {
C>    int version;         ///< version of the symbol
C>    int width;           ///< width of the symbol
C>    unsigned char *data; ///< symbol data
C>} QRcode;

C>/**
C> * Singly-linked list of QRcode. Used to represent a structured symbols.
C> * A list is terminated with NULL.
C> */
C>typedef struct _QRcode_List QRcode_List;

C>struct _QRcode_List {
C>    QRcode *code;
C>    QRcode_List *next;
C>};

C>/**
C> * Create a symbol from the input data.
C> * @warning This function is THREAD UNSAFE.
C> * @param input input data.
C> * @return an instance of QRcode class. The version of the result QRcode may
C> *         be larger than the designated version. On error, NULL is returned,
C> *         and errno is set to indicate the error. See Exceptions for the
C> *         details.
C> * @throw EINVAL invalid input object.
C> * @throw ENOMEM unable to allocate memory for input objects.
C> */
C>extern QRcode *QRcode_encodeInput(QRinput *input);

C>/**
C> * Create a symbol from the string. The library automatically parses the input
C> * string and encodes in a QR Code symbol.
C> * @warning This function is THREAD UNSAFE.
C> * @param string input string. It must be NULL terminated.
C> * @param version version of the symbol. If 0, the library chooses the minimum
C> *                version for the given input data.
C> * @param level error correction level.
C> * @param hint tell the library how non-alphanumerical characters should be
C> *             encoded. If QR_MODE_KANJI is given, kanji characters will be
C> *             encoded as Shif-JIS characters. If QR_MODE_8 is given, all of
C> *             non-alphanumerical characters will be encoded as is. If you want
C> *             to embed UTF-8 string, choose this.
C> * @param casesensitive case-sensitive(1) or not(0).
C> * @return an instance of QRcode class. The version of the result QRcode may
C> *         be larger than the designated version. On error, NULL is returned,
C> *         and errno is set to indicate the error. See Exceptions for the
C> *         details.
C> * @throw EINVAL invalid input object.
C> * @throw ENOMEM unable to allocate memory for input objects.
C> */
C>extern QRcode *QRcode_encodeString(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive);

C>/**
C> * Same to QRcode_encodeString(), but encode whole data in 8-bit mode.
C> * @warning This function is THREAD UNSAFE.
C> */
C>extern QRcode *QRcode_encodeString8bit(const char *string, int version, QRecLevel level);

C>/**
C> * Free the instance of QRcode class.
C> * @param qrcode an instance of QRcode class.
C> */
C>extern void QRcode_free(QRcode *qrcode);

C>/**
C> * Create structured symbols from the input data.
C> * @warning This function is THREAD UNSAFE.
C> * @param s
C> * @return a singly-linked list of QRcode.
C> */
C>extern QRcode_List *QRcode_encodeInputStructured(QRinput_Struct *s);

C>/**
C> * Create structured symbols from the string. The library automatically parses
C> * the input string and encodes in a QR Code symbol.
C> * @warning This function is THREAD UNSAFE.
C> * @param string input string. It should be NULL terminated.
C> * @param version version of the symbol.
C> * @param level error correction level.
C> * @param hint tell the library how non-alphanumerical characters should be
C> *             encoded. If QR_MODE_KANJI is given, kanji characters will be
C> *             encoded as Shif-JIS characters. If QR_MODE_8 is given, all of
C> *             non-alphanumerical characters will be encoded as is. If you want
C> *             to embed UTF-8 string, choose this.
C> * @param casesensitive case-sensitive(1) or not(0).
C> * @return a singly-linked list of QRcode. On error, NULL is returned, and
C> *         errno is set to indicate the error. See Exceptions for the details.
C> * @throw EINVAL invalid input object.
C> * @throw ENOMEM unable to allocate memory for input objects.
C> */
C>extern QRcode_List *QRcode_encodeStringStructured(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive);

C>/**
C> * Same to QRcode_encodeStringStructured(), but encode whole data in 8-bit mode.
C> * @warning This function is THREAD UNSAFE.
C> */
C>extern QRcode_List *QRcode_encodeString8bitStructured(const char *string, int version, QRecLevel level);

C>/**
C> * Return the number of symbols included in a QRcode_List.
C> * @param qrlist a head entry of a QRcode_List.
C> * @return number of symbols in the list.
C> */
C>extern int QRcode_List_size(QRcode_List *qrlist);

C>/**
C> * Free the QRcode_List.
C> * @param qrlist a head entry of a QRcode_List.
C> */
C>extern void QRcode_List_free(QRcode_List *qrlist);

C>#if defined(__cplusplus)
C>}
C>#endif

C>#endif /* __QRENCODE_H__ */
C>


Вот библиотека http://code.google.com/p/qrencode-win32/
Re: wxWidgets 2.8 and qrcode-win32-3.1.1
От: Chehov85 Россия  
Дата: 03.08.11 11:59
Оценка:
Что то я расписал...
В общем как использовать qrcodelib.dll из поставки, средствами wxWidgets?
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.