Some coding style adaptations for compiling the OPJViewer GUI under Linux. It compile...
authorGiuseppe Baruffa <gbaruffa@users.noreply.github.com>
Thu, 29 Mar 2007 08:27:03 +0000 (08:27 +0000)
committerGiuseppe Baruffa <gbaruffa@users.noreply.github.com>
Thu, 29 Mar 2007 08:27:03 +0000 (08:27 +0000)
OPJViewer/source/OPJViewer.cpp
OPJViewer/source/OPJViewer.h
OPJViewer/source/about_htm.h
OPJViewer/source/imagj2k.cpp
OPJViewer/source/imagjp2.cpp
OPJViewer/source/imagmj2.cpp
OPJViewer/source/wxj2kparser.cpp
OPJViewer/source/wxjp2parser.cpp

index ea075dcc29d2d6aca40cc3e39f3d33ac1705542e..d796fbb273f282b058f06d8f6a6f1d4213a4f49f 100644 (file)
@@ -136,8 +136,9 @@ bool OPJViewerApp::OnInit(void)
 \r
     wxChar **wxArgv = new wxChar *[argc + 1];\r
 \r
-    for (int n = 0; n < argc; n++ ) {\r
-        wxMB2WXbuf warg = wxConvertMB2WX(argv[n]);\r
+       int n;\r
+    for (n = 0; n < argc; n++ ) {\r
+        wxMB2WXbuf warg = wxConvertMB2WX((char *) argv[n]);\r
         wxArgv[n] = wxStrdup(warg);\r
     }\r
 \r
@@ -570,7 +571,7 @@ void OPJFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
     wxHtmlWindow *html;\r
     wxDialog dlg(this, wxID_ANY, wxString(_("About")));\r
 \r
-    wxMemoryFSHandler::AddFile("opj_logo.xpm", wxBitmap(opj_logo), wxBITMAP_TYPE_XPM);\r
+    wxMemoryFSHandler::AddFile(wxT("opj_logo.xpm"), wxBitmap(opj_logo), wxBITMAP_TYPE_XPM);\r
 \r
     topsizer = new wxBoxSizer(wxVERTICAL);\r
 \r
@@ -1304,7 +1305,7 @@ void OPJMarkerTree::OnItemExpanding(wxTreeEvent& event)
        else\r
                text = wxT("invalid item");\r
 \r
-       if (strcmp(data->GetDesc1(), wxT("INFO-CSTREAM")))\r
+       if (wxStrcmp(data->GetDesc1(), wxT("INFO-CSTREAM")))\r
                return;\r
 \r
        wxLogMessage(wxT("Expanding... (%s -> %s, %s, %d, %d)"),\r
@@ -1364,7 +1365,7 @@ void OPJMarkerTree::OnSelChanged(wxTreeEvent& event)
                                text << wxT(" ");\r
 \r
                        if (pos < max_read) {\r
-                               text << wxString::Format(wxT("%02X "), wxT(buffer[pos]));\r
+                               text << wxString::Format(wxT("%02X "), buffer[pos]);\r
                        } else\r
                                text << wxT("   ");\r
                        pos++;\r
index ac64e3932eb9a6d832deed215b47da7606e92cea..2dde2f73a3f136a0a4eb8ebd1caf7c236abc83e0 100644 (file)
@@ -96,8 +96,9 @@
 #include "wx/statline.h"\r
 #include <wx/fs_mem.h>\r
 \r
+#include <wx/imaglist.h>\r
 \r
-#include "libopenjpeg\openjpeg.h"\r
+#include "libopenjpeg/openjpeg.h"\r
 \r
 #include "imagj2k.h"\r
 #include "imagjp2.h"\r
index bb295f72065ed4e51bb1ed2253756481332934ee..c0c0c280ab87b1565b742e601b2830b66326b1b5 100644 (file)
@@ -30,19 +30,18 @@ wxT("<font size=-2 color=green>- Compiled with JPWL support</font><br>")
 #ifdef USE_JPSEC\r
 wxT("<font size=-2 color=green>- Compiled with JPSEC support</font>")\r
 #endif // USE_JPSEC\r
-wxT(\r
-"</td>"\r
+wxT("</td>"\r
 "</tr>"\r
 "<tr>"\r
 "<td colspan=2 bgcolor=#CC3300 height=3 valign=center></td>"\r
 "</tr>"\r
 "<tr>"\r
 "<td colspan=2>"\r
-"<font size=-2 color=#444444>OpenJPEG is &copy; 2002-2007 <a href=\"http://www.tele.ucl.ac.be/\">TELE</a> - <a href=\"http://www.uclouvain.be/\">Universit Catholique de Louvain</a></font><br>"\r
-"<font size=-2 color=#444444>OPJViewer is also &copy; 2007 <a href=\"http://dsplab.diei.unipg.it/\">DSPLab</a> - <a href=\"http://www.unipg.it/\">Universit degli studi di Perugia</a></font>"\r
+"<font size=-2 color=#444444>OpenJPEG is &copy; 2002-2007 <a href=\"http://www.tele.ucl.ac.be/\">TELE</a> - <a href=\"http://www.uclouvain.be/\">Universite' Catholique de Louvain</a></font><br>"\r
+"<font size=-2 color=#444444>OPJViewer is also &copy; 2007 <a href=\"http://dsplab.diei.unipg.it/\">DSPLab</a> - <a href=\"http://www.unipg.it/\">Universita' degli studi di Perugia</a></font>"\r
 "</td>"\r
 "</tr>"\r
 "</table>"\r
 "</body>"\r
 "</html>"\r
-);
\ No newline at end of file
+);\r
index 9f972095f51a87de149835f7b4d6c10303273b45..4a7ed492d515fa86fbd06c3944cd31bb1998a8e0 100644 (file)
@@ -82,35 +82,29 @@ IMPLEMENT_DYNAMIC_CLASS(wxJ2KHandler,wxImageHandler)
 \r
 /* sample error callback expecting a FILE* client object */\r
 void j2k_error_callback(const char *msg, void *client_data) {\r
-       char m_msg[MAX_MESSAGE_LEN];\r
        int message_len = strlen(msg) - 1;\r
        if (msg[message_len] != '\n')\r
                message_len = MAX_MESSAGE_LEN;\r
-       sprintf(m_msg, "[ERROR] %.*s", message_len, msg);\r
     wxMutexGuiEnter();\r
-       wxLogMessage(m_msg);\r
+       wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);\r
     wxMutexGuiLeave();\r
 }\r
 /* sample warning callback expecting a FILE* client object */\r
 void j2k_warning_callback(const char *msg, void *client_data) {\r
-       char m_msg[MAX_MESSAGE_LEN];\r
        int message_len = strlen(msg) - 1;\r
        if (msg[message_len] != '\n')\r
                message_len = MAX_MESSAGE_LEN;\r
-       sprintf(m_msg, "[WARNING] %.*s", message_len, msg);\r
     wxMutexGuiEnter();\r
-       wxLogMessage(m_msg);\r
+       wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);\r
     wxMutexGuiLeave();\r
 }\r
 /* sample debug callback expecting no client object */\r
 void j2k_info_callback(const char *msg, void *client_data) {\r
-       char m_msg[MAX_MESSAGE_LEN];\r
        int message_len = strlen(msg) - 1;\r
        if (msg[message_len] != '\n')\r
                message_len = MAX_MESSAGE_LEN;\r
-       sprintf(m_msg, "[INFO] %.*s", message_len, msg);\r
     wxMutexGuiEnter();\r
-       wxLogMessage(m_msg);\r
+       wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);\r
     wxMutexGuiLeave();\r
 }\r
 \r
index ce25bb1e796cbb60a11b24cae01185007ecb0ba2..b1a23bde613ca90f3b6b54408c2131bbb03a6494 100644 (file)
@@ -86,35 +86,29 @@ IMPLEMENT_DYNAMIC_CLASS(wxJP2Handler,wxImageHandler)
 \r
 /* sample error callback expecting a FILE* client object */\r
 void jp2_error_callback(const char *msg, void *client_data) {\r
-       char m_msg[MAX_MESSAGE_LEN];\r
        int message_len = strlen(msg) - 1;\r
        if (msg[message_len] != '\n')\r
                message_len = MAX_MESSAGE_LEN;\r
-       sprintf(m_msg, "[ERROR] %.*s", message_len, msg);\r
     wxMutexGuiEnter();\r
-       wxLogMessage(m_msg);\r
+       wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);\r
     wxMutexGuiLeave();\r
 }\r
 /* sample warning callback expecting a FILE* client object */\r
 void jp2_warning_callback(const char *msg, void *client_data) {\r
-       char m_msg[MAX_MESSAGE_LEN];\r
        int message_len = strlen(msg) - 1;\r
        if (msg[message_len] != '\n')\r
                message_len = MAX_MESSAGE_LEN;\r
-       sprintf(m_msg, "[WARNING] %.*s", message_len, msg);\r
     wxMutexGuiEnter();\r
-       wxLogMessage(m_msg);\r
+       wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);\r
     wxMutexGuiLeave();\r
 }\r
 /* sample debug callback expecting no client object */\r
 void jp2_info_callback(const char *msg, void *client_data) {\r
-       char m_msg[MAX_MESSAGE_LEN];\r
        int message_len = strlen(msg) - 1;\r
        if (msg[message_len] != '\n')\r
                message_len = MAX_MESSAGE_LEN;\r
-       sprintf(m_msg, "[INFO] %.*s", message_len, msg);\r
     wxMutexGuiEnter();\r
-       wxLogMessage(m_msg);\r
+       wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);\r
     wxMutexGuiLeave();\r
 }\r
 \r
index 1a8e1ffb7d6adf5c24556050a3e2ba5dac37d30e..ad637aabac89613395eae1f38ba16fc745979b73 100644 (file)
@@ -86,35 +86,29 @@ IMPLEMENT_DYNAMIC_CLASS(wxMJ2Handler,wxImageHandler)
 \r
 /* sample error callback expecting a FILE* client object */\r
 void mj2_error_callback(const char *msg, void *client_data) {\r
-       char m_msg[MAX_MESSAGE_LEN];\r
        int message_len = strlen(msg) - 1;\r
        if (msg[message_len] != '\n')\r
                message_len = MAX_MESSAGE_LEN;\r
-       sprintf(m_msg, "[ERROR] %.*s", message_len, msg);\r
     wxMutexGuiEnter();\r
-       wxLogMessage(m_msg);\r
+       wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);\r
     wxMutexGuiLeave();\r
 }\r
 /* sample warning callback expecting a FILE* client object */\r
 void mj2_warning_callback(const char *msg, void *client_data) {\r
-       char m_msg[MAX_MESSAGE_LEN];\r
        int message_len = strlen(msg) - 1;\r
        if (msg[message_len] != '\n')\r
                message_len = MAX_MESSAGE_LEN;\r
-       sprintf(m_msg, "[WARNING] %.*s", message_len, msg);\r
     wxMutexGuiEnter();\r
-       wxLogMessage(m_msg);\r
+       wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);\r
     wxMutexGuiLeave();\r
 }\r
 /* sample debug callback expecting no client object */\r
 void mj2_info_callback(const char *msg, void *client_data) {\r
-       char m_msg[MAX_MESSAGE_LEN];\r
        int message_len = strlen(msg) - 1;\r
        if (msg[message_len] != '\n')\r
                message_len = MAX_MESSAGE_LEN;\r
-       sprintf(m_msg, "[INFO] %.*s", message_len, msg);\r
     wxMutexGuiEnter();\r
-       wxLogMessage(m_msg);\r
+       wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);\r
     wxMutexGuiLeave();\r
 }\r
 \r
@@ -396,6 +390,14 @@ int
 my_box_handler_function(my_j2boxtype boxtype, wxInputStream& stream, unsigned long int filepoint, unsigned long int filelimit, int level,\r
                                         char *scansign, unsigned long int *scanpoint);\r
 \r
+#ifdef __WXMSW__\r
+typedef unsigned __int64 int8byte;\r
+#endif // __WXMSW__\r
+\r
+#ifdef __WXGTK__\r
+typedef unsigned long long int8byte;\r
+#endif // __WXGTK__\r
+\r
 /* internal mini-search for a box signature */\r
 int\r
 my_jpeg2000parse(wxInputStream& stream, unsigned long int filepoint, unsigned long int filelimit, int level,\r
@@ -405,7 +407,7 @@ my_jpeg2000parse(wxInputStream& stream, unsigned long int filepoint, unsigned lo
        //int                     LBox_read;\r
        char                    TBox[5] = "\0\0\0\0";\r
        //int                     TBox_read;\r
-       __int64                 XLBox = 0x0000000000000000;\r
+       int8byte                 XLBox = 0x0000000000000000;\r
        //int                     XLBox_read;\r
        unsigned long int       box_length = 0;\r
        int                     last_box = 0, box_num = 0;\r
@@ -514,7 +516,7 @@ searchjp2c(wxInputStream& stream, unsigned long int fsize, int number)
                wxLogMessage(wxT("MJ2: not found"));\r
        else {\r
 \r
-               wxLogMessage(wxString::Format("MJ2: found at byte %d", scanpoint));\r
+               wxLogMessage(wxString::Format(wxT("MJ2: found at byte %d"), scanpoint));\r
 \r
        };\r
 \r
index 98f9fe7cd2470c12fb46de0bac41c1d2856b4c7b..8401d251a2501ef1417c307ca4bfde04e20a8d60 100644 (file)
@@ -554,6 +554,8 @@ void OPJParseThread::ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOff
                /////////\r
                case SIZ_VAL:\r
                        {\r
+                       int c;\r
+\r
                        if (m_file->Read(twobytes, 2) != 2)\r
                                break;\r
                        unsigned short int rsiz = STREAM_TO_UINT16(twobytes, 0);\r
@@ -603,7 +605,7 @@ void OPJParseThread::ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOff
                        unsigned char *xrsiz = new unsigned char(csiz);\r
                        unsigned char *yrsiz = new unsigned char(csiz);\r
 \r
-                       for (int c = 0; c < csiz; c++) {\r
+                       for (c = 0; c < csiz; c++) {\r
 \r
                                if (m_file->Read(&ssiz[c], 1) != 1)\r
                                        break;\r
index 46698bda3f79223a635874d694ffb5b9acdeecf9..9291f9aa6e789fd2790a6ff09013cc621e78c74c 100644 (file)
@@ -41,7 +41,7 @@ typedef enum {
 } j2filetype;\r
 \r
 /* enumeration for the box types */\r
-#define J2BOXNUM                23\r
+#define j22boxNUM                23\r
 typedef enum {\r
 \r
                        FILE_BOX,\r
@@ -70,7 +70,7 @@ typedef enum {
                        ANY_BOX,\r
                        UNK_BOX\r
 \r
-} j2boxtype;\r
+} j22boxtype;\r
 \r
 /* the box structure itself */\r
 struct boxdef {\r
@@ -80,12 +80,224 @@ struct boxdef {
                char                  descr[LONG_DESCR_LEN];    /* long  description       */\r
                int                   sbox;                     /* is it a superbox?       */\r
                int                   req[J2FILENUM];           /* mandatory box           */\r
-               j2boxtype             ins;                      /* contained in box...     */\r
+               j22boxtype             ins;                      /* contained in box...     */\r
 \r
 };\r
 \r
+\r
+/* jp2 family box signatures */\r
+#define FILE_SIGN           ""\r
+#define JP_SIGN             "jP\040\040"\r
+#define FTYP_SIGN           "ftyp"\r
+#define JP2H_SIGN           "jp2h"\r
+#define IHDR_SIGN           "ihdr"\r
+#define COLR_SIGN           "colr"\r
+#define JP2C_SIGN           "jp2c"\r
+#define JP2I_SIGN           "jp2i"\r
+#define XML_SIGN            "xml\040"\r
+#define UUID_SIGN           "uuid"\r
+#define UINF_SIGN           "uinf"\r
+#define MOOV_SIGN           "moov"\r
+#define MVHD_SIGN           "mvhd"\r
+#define TRAK_SIGN           "trak"\r
+#define TKHD_SIGN           "tkhd"\r
+#define MDIA_SIGN           "mdia"\r
+#define MINF_SIGN           "minf"\r
+#define VMHD_SIGN           "vmhd"\r
+#define STBL_SIGN           "stbl"\r
+#define STSD_SIGN           "stsd"\r
+#define STSZ_SIGN           "stsz"\r
+#define MJP2_SIGN           "mjp2"\r
+#define MDAT_SIGN           "mdat"\r
+#define ANY_SIGN                       ""\r
+#define UNK_SIGN            ""\r
+\r
 /* the possible boxes */\r
-struct boxdef j2box[];\r
+struct boxdef j22box[] =\r
+{\r
+/* sign */     {FILE_SIGN,\r
+/* short */    "placeholder for nothing",\r
+/* long */     "Nothing to say",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {JP_SIGN,\r
+/* short */    "JPEG 2000 Signature box",\r
+/* long */     "This box uniquely identifies the file as being part of the JPEG 2000 family of files",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {FTYP_SIGN,\r
+/* short */    "File Type box",\r
+/* long */     "This box specifies file type, version and compatibility information, including specifying if this file "\r
+                       "is a conforming JP2 file or if it can be read by a conforming JP2 reader",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {JP2H_SIGN,\r
+/* short */    "JP2 Header box",\r
+/* long */     "This box contains a series of boxes that contain header-type information about the file",\r
+/* sbox */     1,\r
+/* req */      {1, 1, 1},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {IHDR_SIGN,\r
+/* short */    "Image Header box",\r
+/* long */     "This box specifies the size of the image and other related fields",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      JP2H_BOX},\r
+\r
+/* sign */     {COLR_SIGN,\r
+/* short */    "Colour Specification box",\r
+/* long */     "This box specifies the colourspace of the image",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      JP2H_BOX},\r
+\r
+/* sign */     {JP2C_SIGN,\r
+/* short */    "Contiguous Codestream box",\r
+/* long */     "This box contains the codestream as defined by Annex A",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {JP2I_SIGN,\r
+/* short */    "Intellectual Property box",\r
+/* long */     "This box contains intellectual property information about the image",\r
+/* sbox */     0,\r
+/* req */      {0, 0, 0},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {XML_SIGN,\r
+/* short */    "XML box",\r
+/* long */     "This box provides a tool by which vendors can add XML formatted information to a JP2 file",\r
+/* sbox */     0,\r
+/* req */      {0, 0, 0},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {UUID_SIGN,\r
+/* short */    "UUID box",\r
+/* long */     "This box provides a tool by which vendors can add additional information to a file "\r
+                       "without risking conflict with other vendors",\r
+/* sbox */     0,\r
+/* req */      {0, 0, 0},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {UINF_SIGN,\r
+/* short */    "UUID Info box",\r
+/* long */     "This box provides a tool by which a vendor may provide access to additional information associated with a UUID",\r
+/* sbox */     0,\r
+/* req */      {0, 0, 0},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {MOOV_SIGN,\r
+/* short */    "Movie box",\r
+/* long */     "This box contains the media data. In video tracks, this box would contain JPEG2000 video frames",\r
+/* sbox */     1,\r
+/* req */      {1, 1, 1},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {MVHD_SIGN,\r
+/* short */    "Movie Header box",\r
+/* long */     "This box defines overall information which is media-independent, and relevant to the entire presentation "\r
+                       "considered as a whole",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      MOOV_BOX},\r
+\r
+/* sign */     {TRAK_SIGN,\r
+/* short */    "Track box",\r
+/* long */     "This is a container box for a single track of a presentation. A presentation may consist of one or more tracks",\r
+/* sbox */     1,\r
+/* req */      {1, 1, 1},\r
+/* ins */      MOOV_BOX},\r
+\r
+/* sign */     {TKHD_SIGN,\r
+/* short */    "Track Header box",\r
+/* long */     "This box specifies the characteristics of a single track. Exactly one Track Header Box is contained in a track",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      TRAK_BOX},\r
+\r
+/* sign */     {MDIA_SIGN,\r
+/* short */    "Media box",\r
+/* long */     "The media declaration container contains all the objects which declare information about the media data "\r
+                       "within a track",\r
+/* sbox */     1,\r
+/* req */      {1, 1, 1},\r
+/* ins */      TRAK_BOX},\r
+\r
+/* sign */     {MINF_SIGN,\r
+/* short */    "Media Information box",\r
+/* long */     "This box contains all the objects which declare characteristic information of the media in the track",\r
+/* sbox */     1,\r
+/* req */      {1, 1, 1},\r
+/* ins */      MDIA_BOX},\r
+\r
+/* sign */     {VMHD_SIGN,\r
+/* short */    "Video Media Header box",\r
+/* long */     "The video media header contains general presentation information, independent of the coding, for video media",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      MINF_BOX},\r
+\r
+/* sign */     {STBL_SIGN,\r
+/* short */    "Sample Table box",\r
+/* long */     "The sample table contains all the time and data indexing of the media samples in a track",\r
+/* sbox */     1,\r
+/* req */      {1, 1, 1},\r
+/* ins */      MINF_BOX},\r
+\r
+/* sign */     {STSD_SIGN,\r
+/* short */    "STSD Sample Description box",\r
+/* long */     "The sample description table gives detailed information about the coding type used, and any initialization "\r
+                       "information needed for that coding",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      MINF_BOX},\r
+\r
+/* sign */     {STSZ_SIGN,\r
+/* short */    "Sample Size box",\r
+/* long */     "This box contains the sample count and a table giving the size of each sample",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      STBL_BOX},\r
+\r
+/* sign */     {MJP2_SIGN,\r
+/* short */    "MJP2 Sample Description box",\r
+/* long */     "The MJP2 sample description table gives detailed information about the coding type used, and any initialization "\r
+                       "information needed for that coding",\r
+/* sbox */     0,\r
+/* req */      {1, 1, 1},\r
+/* ins */      MINF_BOX},\r
+\r
+/* sign */     {MDAT_SIGN,\r
+/* short */    "Media Data box",\r
+/* long */     "The meta-data for a presentation is stored in the single Movie Box which occurs at the top-level of a file",\r
+/* sbox */     1,\r
+/* req */      {1, 1, 1},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {ANY_SIGN,\r
+/* short */    "Any box",\r
+/* long */     "All the existing boxes",\r
+/* sbox */     0,\r
+/* req */      {0, 0, 0},\r
+/* ins */      FILE_BOX},\r
+\r
+/* sign */     {UNK_SIGN,\r
+/* short */    "Unknown Type box",\r
+/* long */     "The signature is not recognised to be that of an existing box",\r
+/* sbox */     0,\r
+/* req */      {0, 0, 0},\r
+/* ins */      ANY_BOX}\r
+\r
+};\r
+\r
 \r
 /* macro functions */\r
 /* From little endian to big endian, 2 and 4 bytes */\r
@@ -131,7 +343,7 @@ void indprint(wxString printout, int level)
 int OPJParseThread::box_handler_function(int boxtype, wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit,\r
                                                 wxTreeItemId parentid, int level, char *scansign, unsigned long int *scanpoint)\r
 {\r
-       switch ((j2boxtype) boxtype) {\r
+       switch ((j22boxtype) boxtype) {\r
 \r
 \r
        /* JPEG 2000 Signature box */\r
@@ -325,7 +537,7 @@ int OPJParseThread::box_handler_function(int boxtype, wxFile *fileid, wxFileOffs
 \r
                        if (METH != 1)\r
                                currid = m_tree->AppendItem(parentid,\r
-                                       wxString::Format("ICC profile: there is one"),\r
+                                       wxString::Format(wxT("ICC profile: there is one")),\r
                                        m_tree->TreeCtrlIcon_File, m_tree->TreeCtrlIcon_File + 1,\r
                                        new OPJMarkerData(wxT("INFO"))\r
                                        );\r
@@ -611,218 +823,6 @@ int OPJParseThread::box_handler_function(int boxtype, wxFile *fileid, wxFileOffs
        return (0);\r
 }\r
 \r
-/* jp2 family box signatures */\r
-#define FILE_SIGN           ""\r
-#define JP_SIGN             "jP\040\040"\r
-#define FTYP_SIGN           "ftyp"\r
-#define JP2H_SIGN           "jp2h"\r
-#define IHDR_SIGN           "ihdr"\r
-#define COLR_SIGN           "colr"\r
-#define JP2C_SIGN           "jp2c"\r
-#define JP2I_SIGN           "jp2i"\r
-#define XML_SIGN            "xml\040"\r
-#define UUID_SIGN           "uuid"\r
-#define UINF_SIGN           "uinf"\r
-#define MOOV_SIGN           "moov"\r
-#define MVHD_SIGN           "mvhd"\r
-#define TRAK_SIGN           "trak"\r
-#define TKHD_SIGN           "tkhd"\r
-#define MDIA_SIGN           "mdia"\r
-#define MINF_SIGN           "minf"\r
-#define VMHD_SIGN           "vmhd"\r
-#define STBL_SIGN           "stbl"\r
-#define STSD_SIGN           "stsd"\r
-#define STSZ_SIGN           "stsz"\r
-#define MJP2_SIGN           "mjp2"\r
-#define MDAT_SIGN           "mdat"\r
-#define ANY_SIGN                       ""\r
-#define UNK_SIGN            ""\r
-\r
-/* the possible boxes */\r
-struct boxdef j2box[] =\r
-{\r
-/* sign */     {FILE_SIGN,\r
-/* short */    "placeholder for nothing",\r
-/* long */     "Nothing to say",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {JP_SIGN,\r
-/* short */    "JPEG 2000 Signature box",\r
-/* long */     "This box uniquely identifies the file as being part of the JPEG 2000 family of files",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {FTYP_SIGN,\r
-/* short */    "File Type box",\r
-/* long */     "This box specifies file type, version and compatibility information, including specifying if this file "\r
-                       "is a conforming JP2 file or if it can be read by a conforming JP2 reader",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {JP2H_SIGN,\r
-/* short */    "JP2 Header box",\r
-/* long */     "This box contains a series of boxes that contain header-type information about the file",\r
-/* sbox */     1,\r
-/* req */      {1, 1, 1},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {IHDR_SIGN,\r
-/* short */    "Image Header box",\r
-/* long */     "This box specifies the size of the image and other related fields",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      JP2H_BOX},\r
-\r
-/* sign */     {COLR_SIGN,\r
-/* short */    "Colour Specification box",\r
-/* long */     "This box specifies the colourspace of the image",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      JP2H_BOX},\r
-\r
-/* sign */     {JP2C_SIGN,\r
-/* short */    "Contiguous Codestream box",\r
-/* long */     "This box contains the codestream as defined by Annex A",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {JP2I_SIGN,\r
-/* short */    "Intellectual Property box",\r
-/* long */     "This box contains intellectual property information about the image",\r
-/* sbox */     0,\r
-/* req */      {0, 0, 0},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {XML_SIGN,\r
-/* short */    "XML box",\r
-/* long */     "This box provides a tool by which vendors can add XML formatted information to a JP2 file",\r
-/* sbox */     0,\r
-/* req */      {0, 0, 0},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {UUID_SIGN,\r
-/* short */    "UUID box",\r
-/* long */     "This box provides a tool by which vendors can add additional information to a file "\r
-                       "without risking conflict with other vendors",\r
-/* sbox */     0,\r
-/* req */      {0, 0, 0},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {UINF_SIGN,\r
-/* short */    "UUID Info box",\r
-/* long */     "This box provides a tool by which a vendor may provide access to additional information associated with a UUID",\r
-/* sbox */     0,\r
-/* req */      {0, 0, 0},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {MOOV_SIGN,\r
-/* short */    "Movie box",\r
-/* long */     "This box contains the media data. In video tracks, this box would contain JPEG2000 video frames",\r
-/* sbox */     1,\r
-/* req */      {1, 1, 1},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {MVHD_SIGN,\r
-/* short */    "Movie Header box",\r
-/* long */     "This box defines overall information which is media-independent, and relevant to the entire presentation "\r
-                       "considered as a whole",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      MOOV_BOX},\r
-\r
-/* sign */     {TRAK_SIGN,\r
-/* short */    "Track box",\r
-/* long */     "This is a container box for a single track of a presentation. A presentation may consist of one or more tracks",\r
-/* sbox */     1,\r
-/* req */      {1, 1, 1},\r
-/* ins */      MOOV_BOX},\r
-\r
-/* sign */     {TKHD_SIGN,\r
-/* short */    "Track Header box",\r
-/* long */     "This box specifies the characteristics of a single track. Exactly one Track Header Box is contained in a track",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      TRAK_BOX},\r
-\r
-/* sign */     {MDIA_SIGN,\r
-/* short */    "Media box",\r
-/* long */     "The media declaration container contains all the objects which declare information about the media data "\r
-                       "within a track",\r
-/* sbox */     1,\r
-/* req */      {1, 1, 1},\r
-/* ins */      TRAK_BOX},\r
-\r
-/* sign */     {MINF_SIGN,\r
-/* short */    "Media Information box",\r
-/* long */     "This box contains all the objects which declare characteristic information of the media in the track",\r
-/* sbox */     1,\r
-/* req */      {1, 1, 1},\r
-/* ins */      MDIA_BOX},\r
-\r
-/* sign */     {VMHD_SIGN,\r
-/* short */    "Video Media Header box",\r
-/* long */     "The video media header contains general presentation information, independent of the coding, for video media",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      MINF_BOX},\r
-\r
-/* sign */     {STBL_SIGN,\r
-/* short */    "Sample Table box",\r
-/* long */     "The sample table contains all the time and data indexing of the media samples in a track",\r
-/* sbox */     1,\r
-/* req */      {1, 1, 1},\r
-/* ins */      MINF_BOX},\r
-\r
-/* sign */     {STSD_SIGN,\r
-/* short */    "STSD Sample Description box",\r
-/* long */     "The sample description table gives detailed information about the coding type used, and any initialization "\r
-                       "information needed for that coding",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      MINF_BOX},\r
-\r
-/* sign */     {STSZ_SIGN,\r
-/* short */    "Sample Size box",\r
-/* long */     "This box contains the sample count and a table giving the size of each sample",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      STBL_BOX},\r
-\r
-/* sign */     {MJP2_SIGN,\r
-/* short */    "MJP2 Sample Description box",\r
-/* long */     "The MJP2 sample description table gives detailed information about the coding type used, and any initialization "\r
-                       "information needed for that coding",\r
-/* sbox */     0,\r
-/* req */      {1, 1, 1},\r
-/* ins */      MINF_BOX},\r
-\r
-/* sign */     {MDAT_SIGN,\r
-/* short */    "Media Data box",\r
-/* long */     "The meta-data for a presentation is stored in the single Movie Box which occurs at the top-level of a file",\r
-/* sbox */     1,\r
-/* req */      {1, 1, 1},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {ANY_SIGN,\r
-/* short */    "Any box",\r
-/* long */     "All the existing boxes",\r
-/* sbox */     0,\r
-/* req */      {0, 0, 0},\r
-/* ins */      FILE_BOX},\r
-\r
-/* sign */     {UNK_SIGN,\r
-/* short */    "Unknown Type box",\r
-/* long */     "The signature is not recognised to be that of an existing box",\r
-/* sbox */     0,\r
-/* req */      {0, 0, 0},\r
-/* ins */      ANY_BOX}\r
-\r
-};\r
 \r
 void OPJParseThread::ParseJP2File(wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit, wxTreeItemId parentid)\r
 {\r
@@ -893,7 +893,7 @@ int OPJParseThread::jpeg2000parse(wxFile *fileid, wxFileOffset filepoint, wxFile
 \r
                /* determine the box type */\r
                for (box_type = JP_BOX; box_type < UNK_BOX; box_type++)\r
-                       if (memcmp(TBox, j2box[box_type].value, 4) == 0)\r
+                       if (memcmp(TBox, j22box[box_type].value, 4) == 0)\r
                                break;  \r
 \r
                /* read the optional XLBox, 8 bytes */\r
@@ -936,7 +936,7 @@ int OPJParseThread::jpeg2000parse(wxFile *fileid, wxFileOffset filepoint, wxFile
 \r
                // box name\r
                wxTreeItemId subcurrid1 = m_tree->AppendItem(currid,\r
-                       wxT("*** ") + wxString(j2box[box_type].name) + wxT(" ***"),\r
+                       wxT("*** ") + wxString::Format(wxT("%s"), j22box[box_type].name) + wxT(" ***"),\r
                        image, imageSel,\r
                        new OPJMarkerData(wxT("INFO"))\r
                        );\r
@@ -955,7 +955,7 @@ int OPJParseThread::jpeg2000parse(wxFile *fileid, wxFileOffset filepoint, wxFile
                        currid, level, scansign, scanpoint);\r
 \r
                /* if it's a superbox go inside it */\r
-               if (j2box[box_type].sbox)\r
+               if (j22box[box_type].sbox)\r
                        jpeg2000parse(fileid, (LBox == 1) ? (filepoint + 16) : (filepoint + 8), filepoint + box_length,\r
                                currid, level + 1, scansign, scanpoint);\r
 \r