use _DEBUG for real output of _DBG_PRINTF

This commit is contained in:
Vincent Wei
2019-03-27 10:08:01 +08:00
parent 8dd64e7f2d
commit 338fb0276e
57 changed files with 323 additions and 304 deletions
+2 -2
View File
@@ -2479,9 +2479,9 @@ dnl define _GNU_SOURCE for pthread_rwlock_t
CFLAGS="$CFLAGS -D_GNU_SOURCE"
if test "x$devel_mode" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_DEBUG"
CPPFLAGS="$CPPFLAGS -DDEBUG"
if test "x$detail_debug" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DDEBUG"
CPPFLAGS="$CPPFLAGS -D_DEBUG"
fi
if test "$ac_cv_prog_gcc" = "yes"; then
+9 -13
View File
@@ -2055,6 +2055,13 @@ int init_minigui_printf (int (*output_char) (int ch),
#define TCS_CLRLINE(fp)
#endif
#define _MG_PRINTF(fmt, ...) \
do { \
TCS_GREEN (stdout); \
fprintf (stdout, fmt, ##__VA_ARGS__); \
TCS_NONE (stdout); \
} while (0)
#define _WRN_PRINTF(fmt, ...) \
do { \
TCS_PURPLE (stderr); \
@@ -2071,25 +2078,14 @@ int init_minigui_printf (int (*output_char) (int ch),
TCS_NONE (stderr); \
} while (0)
#ifdef _DEBUG
# define _MG_PRINTF(fmt, ...) \
do { \
TCS_GREEN (stdout); \
fprintf (stdout, fmt, ##__VA_ARGS__); \
TCS_NONE (stdout); \
} while (0)
# ifdef DEBUG
# define _DBG_PRINTF(fmt, ...) \
#if defined(_DEBUG)
# define _DBG_PRINTF(fmt, ...) \
do { \
TCS_YELLOW (stderr); \
fprintf (stderr, fmt, ##__VA_ARGS__); \
TCS_NONE (stderr); \
} while (0)
# else
# define _DBG_PRINTF(fmt, ...)
# endif
#else
# define _MG_PRINTF(fmt, ...)
# define _DBG_PRINTF(fmt, ...)
#endif
+17 -17
View File
@@ -451,17 +451,17 @@ static void print_ranges(int* ranges, int nr_ranges, PBIDISLEDITDATA sled)
int start_byte_index = get_achar_text_index(sled, sled->selStart);
int end_byte_index = get_achar_text_index (sled, sled->selEnd);
if(ranges){
_MG_PRINTF("sel_achar-[%d,%d], sel_byte = [%d, %d]\n",
_DBG_PRINTF("sel_achar-[%d,%d], sel_byte = [%d, %d]\n",
sled->selStart, sled->selEnd,
start_byte_index, end_byte_index);
_MG_PRINTF("nr_ranges = %d.\n ranges = ", nr_ranges);
_DBG_PRINTF("nr_ranges = %d.\n ranges = ", nr_ranges);
for (i=0; i<nr_ranges; i++)
{
_MG_PRINTF ("[%d, %d)-",
_DBG_PRINTF ("[%d, %d)-",
ranges[i<<1], ranges[(i<<1)+1]);
}
_MG_PRINTF("\n");
_DBG_PRINTF("\n");
}
}
#endif
@@ -644,8 +644,8 @@ static void set_caret_pos (HWND hWnd, PBIDISLEDITDATA sled, int x, BOOL bSel)
if(out_achars <= ACHARSLEN){
out_chars = get_achar_text_index(sled, out_achars);
}
_DBG_PRINTF ("editPos=%d,out_chars=%d\n", out_achars, out_chars);
#endif
_MG_PRINTF ("editPos=%d,out_chars=%d\n", out_achars, out_chars);
}
if (!bSel) {
sled->selStart = sled->selEnd = 0;
@@ -944,7 +944,7 @@ static void del_selected_text (HWND hWnd, PBIDISLEDITDATA sled)
end_byte_index = MAX (s, e);
_MG_PRINTF("delete: sel_achar-[%d,%d], sel_byte = [%d, %d]\n",
_DBG_PRINTF("delete: sel_achar-[%d,%d], sel_byte = [%d, %d]\n",
sled->selStart, sled->selEnd,
start_byte_index, end_byte_index);
@@ -1243,15 +1243,15 @@ get_insert_pos (PLOGFONT logfont, PBIDISLEDITDATA sled, char *newtext,
static void print_text(PBIDISLEDITDATA sled)
{
int i;
_MG_PRINTF("sled->text = [");
_DBG_PRINTF("sled->text = [");
for (i=0; i<TEXTLEN; i++)
_MG_PRINTF("%c", TEXT[i]);
_MG_PRINTF ("]\n");
_DBG_PRINTF("%c", TEXT[i]);
_DBG_PRINTF ("]\n");
/* output hexstring.*/
_MG_PRINTF("sled->text = [");
_DBG_PRINTF("sled->text = [");
for (i=0; i<TEXTLEN; i++)
_MG_PRINTF("%0x ", TEXT[i]);
_MG_PRINTF ("]\n");
_DBG_PRINTF("%0x ", TEXT[i]);
_DBG_PRINTF ("]\n");
}
#endif
@@ -1336,12 +1336,12 @@ sleInsertText (HWND hWnd, PBIDISLEDITDATA sled, char *newtext,
#ifdef _DEBUG
{
int i = 0;
_MG_PRINTF ("string = %s.\n", TEXT);
_MG_PRINTF ("editPos = %d.\n", sled->editPos);
_DBG_PRINTF ("string = %s.\n", TEXT);
_DBG_PRINTF ("editPos = %d.\n", sled->editPos);
for (i = 0; i < sled->achar_content.achars_len; i++) {
_MG_PRINTF ("map[%d] = %d,", i,
_DBG_PRINTF ("map[%d] = %d,", i,
sled->achar_content.achar_map[i].byte_index);
_MG_PRINTF ("\n");
_DBG_PRINTF ("\n");
}
}
#endif
@@ -2488,7 +2488,7 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
unsigned char charBuffer [4];
int chars;
_MG_PRINTF("get char-----------------char----%p\n", (PVOID)wParam);
_DBG_PRINTF("get char-----------------char----%p\n", (PVOID)wParam);
if (dwStyle & ES_READONLY)
return 0;
+1 -1
View File
@@ -352,7 +352,7 @@ static LRESULT ComboBoxCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
DWORD list_style, edit_style;
if (!(pData = calloc (1, sizeof (COMBOBOXDATA)))) {
_MG_PRINTF ("CONTROL>ComboBox: Create control failure!\n");
_WRN_PRINTF ("CONTROL>ComboBox: Create control failure!\n");
return -1;
}
+2 -2
View File
@@ -565,7 +565,7 @@ static void lstOnDrawSListBoxItems (HWND hWnd, HDC hdc,
if (!pWin->we_rdr)
{
_MG_PRINTF ("CONTROL>ListBox: NULL LFRDR.\n");
_WRN_PRINTF ("CONTROL>ListBox: NULL LFRDR.\n");
return;
}
@@ -710,7 +710,7 @@ static int lstSelectItem (HWND hwnd, PLISTBOXDATA pData, int newSel)
#ifdef _DEBUG
if (!newItem)
_MG_PRINTF ("CONTROL>ListBox: return value of lstGetItem is NULL. \n");
_WRN_PRINTF ("CONTROL>ListBox: return value of lstGetItem is NULL. \n");
#endif
if (GetWindowStyle (hwnd) & LBS_MULTIPLESEL) {
+1 -1
View File
@@ -104,7 +104,7 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
case MSG_CREATE:
if (!(pData = malloc (sizeof (PROGRESSDATA)))) {
_MG_PRINTF ("CONTROL>ProgressBar: Create control failure!\n");
_WRN_PRINTF ("CONTROL>ProgressBar: Create control failure!\n");
return -1;
}
+11 -11
View File
@@ -174,13 +174,13 @@ static int init_sbdata (HWND hwnd, PSCROLLBARDATA pdata, RECT * scRect)
if (!GetWindowRect (hwnd, scRect))
{
_MG_PRINTF ("ScrollBar Rect error!\n");
_WRN_PRINTF ("ScrollBar Rect error!\n");
return -1;
}
if ((win_style & SBS_NOSHAFT) && (win_style & SBS_NOARROW))
{
_MG_PRINTF ("ScrollBar styles error!\n");
_WRN_PRINTF ("ScrollBar styles error!\n");
return -1;
}
if (!(win_style & SBS_HORZ))
@@ -285,7 +285,7 @@ int track_thumb (HWND hwnd, PSCROLLBARDATA data, int x, int y)
if (!data)
{
_MG_PRINTF ("addtional data2 is NULL\n");
_WRN_PRINTF ("addtional data2 is NULL\n");
return -1;
}
@@ -364,7 +364,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
/* create the main data construction for the control */
if (!(data = (PSCROLLBARDATA) malloc (sizeof (SCROLLBARDATA))))
{
_MG_PRINTF ("Create ScrollBar control failure!\n");
_WRN_PRINTF ("Create ScrollBar control failure!\n");
return -1;
}
memset (data, 0 , sizeof (SCROLLBARDATA));
@@ -373,7 +373,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if(0 != init_sbdata(hwnd, data, &rc))
{
free(data);
_MG_PRINTF ("Create ScrollBar control failure!\n");
_WRN_PRINTF ("Create ScrollBar control failure!\n");
return -1;
}
@@ -404,7 +404,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (!data)
{
_MG_PRINTF ("addition data2 is NULL \n");
_WRN_PRINTF ("addition data2 is NULL \n");
return 1;
}
@@ -1081,7 +1081,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
{
if (info->nMax < info->nMin)
{
_MG_PRINTF ( "Error range\n");
_WRN_PRINTF ( "Error range\n");
return -1;
}
new_nMin = info->nMin;
@@ -1093,7 +1093,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (info->nPage > new_nMax - new_nMin + 1
|| info->nPage <= 0)
{
_MG_PRINTF ( "Error page step\n");
_WRN_PRINTF ( "Error page step\n");
return -1;
}
new_nPage = info->nPage;
@@ -1112,7 +1112,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (info->nPos < new_nMin ||
info->nPos > new_nMax)
{
_MG_PRINTF ( "Error postion to set");
_WRN_PRINTF ( "Error postion to set");
return -1;
}
new_nPos = info->nPos;
@@ -1171,7 +1171,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if(max < data->curPos || min > data->curPos)
{
_MG_PRINTF ( "Error range to set\n");
_WRN_PRINTF ( "Error range to set\n");
return -1;
}
data->minPos = min;
@@ -1200,7 +1200,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if(max < data->curPos || min > data->curPos)
{
_MG_PRINTF ( "Error range to set\n");
_WRN_PRINTF ( "Error range to set\n");
return -1;
}
data->minPos = min;
+3 -3
View File
@@ -916,7 +916,7 @@ textdoc_insert_text (TextDoc *txtdoc, const char* newtext, int len)
/* insert last strings */
/* FIXME */
if (!nextnode) {
_MG_PRINTF ("CONTROL>TextEdit: (Warning) nextnode is NULL!\n");
_WRN_PRINTF ("CONTROL>TextEdit: (Warning) nextnode is NULL!\n");
/* set_current_node (txtdoc, LASTNODE(txtdoc), FALSE, TRUE); */
}
else {
@@ -1446,7 +1446,7 @@ static int get_line_nr (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
HDC hdc;
if (!node) {
_MG_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to get_line_nr\n");
_WRN_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to get_line_nr\n");
return 0;
}
@@ -1571,7 +1571,7 @@ set_line_width (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
HDC hdc;
if (!node) {
_MG_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to set_line_width\n");
_WRN_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to set_line_width\n");
return -1;
}
+2 -2
View File
@@ -64,7 +64,7 @@ static void TrackBarOnDraw (HWND hwnd, HDC hdc, TRACKBARDATA* pData, DWORD dwSty
win_rdr = GetWindowInfo(hwnd)->we_rdr;
if (!win_rdr) {
_MG_PRINTF ("CONTROL>TrackBar: window renderer is NULL.\n");
_WRN_PRINTF ("CONTROL>TrackBar: window renderer is NULL.\n");
return;
}
@@ -217,7 +217,7 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
{
case MSG_CREATE:
if (!(pData = malloc (sizeof (TRACKBARDATA)))) {
_MG_PRINTF ("CONTROL>TrackBar: Create control failure!\n");
_WRN_PRINTF ("CONTROL>TrackBar: Create control failure!\n");
return -1;
}
pData->nMax = 10;
+18 -18
View File
@@ -216,7 +216,7 @@ static int LWZReadByte (MG_RWops *area, int flag, int input_code_size)
while (code >= clear_code) {
*sp++ = table[1][code];
if (code == table[0][code]) {
_MG_PRINTF ("EX_CTRL>GIF89a: circular table entry\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: circular table entry\n");
return -1;
}
code = table[0][code];
@@ -259,7 +259,7 @@ static int GetCode(MG_RWops *area, int code_size, int flag)
if ((curbit + code_size) >= lastbit) {
if (done) {
if (curbit >= lastbit)
_MG_PRINTF ("EX_CTRL>GIF89a: bad decode\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad decode\n");
return -1;
}
buf[0] = buf[last_byte - 2];
@@ -362,7 +362,7 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
version [3] = '\0';
if (strcmp ((const char*)version, "87a") != 0 && strcmp ((const char*)version, "89a") != 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: GIF version number not 87a or 89a.\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: GIF version number not 87a or 89a.\n");
return -1; /* image loading error*/
}
@@ -373,7 +373,7 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
GifScreen->disposal = 0;
if (!ReadOK (area, buf, 7)) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad screen descriptor\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad screen descriptor\n");
return -1; /* image loading error*/
}
GifScreen->Width = LM_to_uint (buf[0], buf[1]);
@@ -384,10 +384,10 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
GifScreen->AspectRatio = buf[6];
if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
_MG_PRINTF ("EX_CTRL>GIF89a: have global colormap: %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: have global colormap: %d\n",
GifScreen->Background);
if (ReadColorMap (area, GifScreen->BitPixel, GifScreen->ColorMap)) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad global colormap\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad global colormap\n");
return -1; /* image loading error*/
}
}
@@ -399,7 +399,7 @@ static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifSc
{
unsigned char buf[16];
if (!ReadOK (area, buf, 9)) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
return -1;
}
@@ -414,9 +414,9 @@ static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifSc
ImageDesc->interlace = BitSet(buf[8], INTERLACE);
if (ImageDesc->haveColorMap) {
_MG_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
if (ReadColorMap (area, ImageDesc->bitPixel, ImageDesc->ColorMap) < 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
return -1;
}
} else {
@@ -437,12 +437,12 @@ static int ReadImage (MG_RWops* area, MYBITMAP* bmp, IMAGEDESC* ImageDesc, GIFSC
* initialize the compression routines
*/
if (!ReadOK (area, &c, 1)) {
_MG_PRINTF ("EX_CTRL>GIF89a: eof on image data\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: eof on image data\n");
return -1;
}
if (LWZReadByte (area, TRUE, c) < 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: error reading image\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: error reading image\n");
return -1;
}
@@ -549,11 +549,11 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
anim->bk.a = 0;
}
_MG_PRINTF ("EX_CTRL>GIF89a: Background: %d, %d, %d.\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: Background: %d, %d, %d.\n",
anim->bk.r, anim->bk.g, anim->bk.b);
if ((ok = ReadOK (area, &c, 1)) == 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
goto error;
}
@@ -561,11 +561,11 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
switch (c) {
case '!':
if ( (ok = ReadOK (area, &c, 1)) == 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
goto error;
}
DoExtension (area, c, &GifScreen);
_MG_PRINTF ("EX_CTRL>GIF89a: Extension info: %d, %d, %d, %d, %d, %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: Extension info: %d, %d, %d, %d, %d, %d\n",
GifScreen.Width, GifScreen.Height,
GifScreen.AspectRatio, GifScreen.delayTime,
GifScreen.disposal, GifScreen.transparent);
@@ -579,7 +579,7 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
if (ReadImage (area, &mybmp, &ImageDesc, &GifScreen, 0) < 0)
goto error;
}
_MG_PRINTF ("EX_CTRL>GIF89a: Image Descriptor: %d, %d, %d, %d, %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: Image Descriptor: %d, %d, %d, %d, %d\n",
ImageDesc.Top, ImageDesc.Left,
ImageDesc.Width, ImageDesc.Height,
ImageDesc.haveColorMap);
@@ -595,14 +595,14 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
frame->width = mybmp.w;
frame->height = mybmp.h;
frame->delay_time = (GifScreen.delayTime>10)?GifScreen.delayTime:10;
_MG_PRINTF ("EX_CTRL>GIF89a: frame info: %d, %d, %d, %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: frame info: %d, %d, %d, %d\n",
frame->off_x, frame->off_y, frame->delay_time,
GifScreen.transparent);
if ((frame->mem_dc = CreateMemDCFromMyBitmap (&mybmp, ImageDesc.ColorMap)) == 0) {
free (mybmp.bits);
free (frame);
_MG_PRINTF ("EX_CTRL>GIF89a: Error when expand frame bitmap.\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: Error when expand frame bitmap.\n");
goto error;
}
frame->bits = mybmp.bits;
+1 -1
View File
@@ -1108,7 +1108,7 @@ void GridCellTypeNumber_set_text_value(gvGridCellData* cell, int row, int col, c
if (INF[0] != 'I' && INF[0] != 'i')
cell->data.number.num = number;
else
_MG_PRINTF ("EX_CTRL>Grid: The inputed number is too big!\n");
_WRN_PRINTF ("EX_CTRL>Grid: The inputed number is too big!\n");
}
double GridCellTypeNumber_get_double_value(gvGridCellData* cell, int row, int col)
+12 -12
View File
@@ -536,24 +536,24 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
}
if (fontops_info->type == NULL) {
_MG_PRINTF ("FONT>DevFont: invalid font type: %s.\n", font_name);
_WRN_PRINTF ("FONT>DevFont: invalid font type: %s.\n", font_name);
return NULL;
}
/*find the first charset*/
if (!fontGetCharsetFromName (font_name, charset)) {
_MG_PRINTF ("FONT>DevFont: Invalid charset name: %s.\n", font_name);
_WRN_PRINTF ("FONT>DevFont: Invalid charset name: %s.\n", font_name);
return NULL;
}
if ((charset_ops = GetCharsetOpsEx (charset)) == NULL) {
_MG_PRINTF ("FONT>DevFont: Invalid charset name %s of font %s.\n",
_WRN_PRINTF ("FONT>DevFont: Invalid charset name %s of font %s.\n",
charset, font_name);
return NULL;
}
if (find_devfont(font_name, (charset_ops->bytes_maxlen_char > 1))) {
_MG_PRINTF ("FONT>DevFont: Duplicated devfont name (%s).\n",
_WRN_PRINTF ("FONT>DevFont: Duplicated devfont name (%s).\n",
font_name);
return NULL;
}
@@ -569,7 +569,7 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
font_name, data);
if (devfont->data == NULL) {
_MG_PRINTF ("FONT>DevFont: error in loading font %s from %s file\n",
_WRN_PRINTF ("FONT>DevFont: error in loading font %s from %s file\n",
font_name, (const char*) data);
free (devfont);
return NULL;
@@ -724,7 +724,7 @@ BOOL font_InitIncoreFonts (void)
#ifdef _MGFONT_RBF
for (i = 0; i < NR_RBFONTS; i++) {
if (!add_dev_font (incore_rbfonts [i]->name, incore_rbfonts [i]->data, FALSE)) {
_MG_PRINTF ("FONT>DevFont: can not init incore font: %s\n", incore_rbfonts [i]->name);
_WRN_PRINTF ("FONT>DevFont: can not init incore font: %s\n", incore_rbfonts [i]->name);
return FALSE;
}
}
@@ -733,7 +733,7 @@ BOOL font_InitIncoreFonts (void)
#ifdef _MGFONT_VBF
for (i = 0; i < NR_VBFONTS && incore_vbfonts[i]; i++) {
if (!add_dev_font (incore_vbfonts [i]->name, incore_vbfonts [i], FALSE)) {
_MG_PRINTF ("FONT>DevFont: can not init incore font: %s\n", incore_vbfonts [i]->name);
_WRN_PRINTF ("FONT>DevFont: can not init incore font: %s\n", incore_vbfonts [i]->name);
return FALSE;
}
}
@@ -743,7 +743,7 @@ BOOL font_InitIncoreFonts (void)
for (i = 0; i < NR_UPFONTS && incore_upfonts[i]; i++) {
const char* name = ((UPFV1_FILE_HEADER*)(incore_upfonts [i]->root_dir))->font_name;
if (!add_dev_font (name, incore_upfonts [i], FALSE)) {
_MG_PRINTF ("FONT>DevFont: can not init incore font: %s\n", name);
_WRN_PRINTF ("FONT>DevFont: can not init incore font: %s\n", name);
return FALSE;
}
}
@@ -751,7 +751,7 @@ BOOL font_InitIncoreFonts (void)
#ifdef _MGFONT_SEF
if(!initialize_scripteasy()) {
_MG_PRINTF (stderr, "GDI: Can not initialize ScriptEasy fonts!\n");
_WRN_PRINTF (stderr, "GDI: Can not initialize ScriptEasy fonts!\n");
return FALSE;
}
#endif
@@ -920,7 +920,7 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
/*get font number in minigui etc*/
if (GetMgEtcIntValue (etc_section, "font_number", &font_num) < 0 ) {
_MG_PRINTF ("FONT>DevFont: can't find font_number in section %s.\n",
_WRN_PRINTF ("FONT>DevFont: can't find font_number in section %s.\n",
etc_section);
return FALSE;
}
@@ -929,14 +929,14 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
for (i=0; i<font_num; i++) {
snprintf (key, sizeof(key)-1, "name%d", i);
if (GetMgEtcValue (etc_section, key, font_name, LEN_UNIDEVFONT_NAME) < 0) {
_MG_PRINTF ("FONT>DevFont: can't get name of key %s in section %s.\n",
_WRN_PRINTF ("FONT>DevFont: can't get name of key %s in section %s.\n",
key, etc_section);
continue;
}
snprintf (key, sizeof(key)-1, "fontfile%d", i);
if (GetMgEtcValue (etc_section, key, font_file_name, MAX_PATH) < 0) {
_MG_PRINTF ("FONT>DevFont: can't get font_file of key %s in section %s.\n",
_WRN_PRINTF ("FONT>DevFont: can't get font_file of key %s in section %s.\n",
key, etc_section);
continue;
}
-2
View File
@@ -44,8 +44,6 @@
#include <string.h>
#include <ctype.h>
#define DEBUG
#include "common.h"
#include "minigui.h"
#include "gdi.h"
+4 -4
View File
@@ -76,7 +76,7 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
/* Load face */
if (TT_Open_Face (ttf_engine, file_name, &ttf_glyph_info->face) != TT_Err_Ok) {
_MG_PRINTF ("FONT>FT1: TT_Open_Face error.\n");
_WRN_PRINTF ("FONT>FT1: TT_Open_Face error.\n");
goto error_after_create_info;
}
@@ -119,7 +119,7 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
}
if (i == n) {
_MG_PRINTF ("FONT>FT1: no unicode map table\n");
_WRN_PRINTF ("FONT>FT1: no unicode map table\n");
goto error_after_create_face;
}
@@ -129,7 +129,7 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
= (properties.num_Glyphs > 255) ? 255 : properties.num_Glyphs - 1;
if (TT_New_Glyph (ttf_glyph_info->face, &ttf_glyph_info->glyph) != TT_Err_Ok) {
_MG_PRINTF ("FONT>FT1: TT_New_Glyph error.\n");
_WRN_PRINTF ("FONT>FT1: TT_New_Glyph error.\n");
goto error_after_create_face;
}
ttf_inst_info->ttf_glyph_info = ttf_glyph_info;
@@ -820,7 +820,7 @@ BOOL font_InitFreetypeLibrary (void)
#ifdef _MGFONT_TTF_CACHE
if (__mg_ttc_sys_init(_MGMAX_TTF_CACHE, _MGTTF_CACHE_SIZE * 1024)) {
_MG_PRINTF ("FONT>FT1: init ttf cache sys failed\n");
_WRN_PRINTF ("FONT>FT1: init ttf cache sys failed\n");
goto error_library;
}
#endif
+8 -8
View File
@@ -296,12 +296,12 @@ load_or_search_glyph (FTINSTANCEINFO* ft_inst_info, FT_Face* face,
*face = ft_face_info->face;
ft_inst_info->cur_index = gv;
if (FT_Load_Glyph (*face, ft_inst_info->cur_index, ft_load_flags)) {
_MG_PRINTF ("FONT>FT2: FT_Load_Glyph error\n");
_WRN_PRINTF ("FONT>FT2: FT_Load_Glyph error\n");
return -1;
}
if (FT_Get_Glyph ((*face)->glyph, &(ft_inst_info->glyph))) {
_MG_PRINTF ("FONT>FT2: FT_Get_Glyph error\n");
_WRN_PRINTF ("FONT>FT2: FT_Get_Glyph error\n");
return -1;
}
@@ -310,19 +310,19 @@ load_or_search_glyph (FTINSTANCEINFO* ft_inst_info, FT_Face* face,
FT_Glyph ft_glyph_tmp;
if (get_cached_face (ft_inst_info, face)) {
_MG_PRINTF ("FONT>FT2: can't access font file %p\n", face);
_WRN_PRINTF ("FONT>FT2: can't access font file %p\n", face);
return 0;
}
ft_inst_info->cur_index = gv;
if (FTC_ImageCache_Lookup (ft_image_cache, &ft_inst_info->image_type,
ft_inst_info->cur_index, &ft_glyph_tmp, NULL)) {
_MG_PRINTF ("FONT>FT2: can't access image cache.\n");
_WRN_PRINTF ("FONT>FT2: can't access image cache.\n");
return -1;
}
if (FT_Glyph_Copy (ft_glyph_tmp, &ft_inst_info->glyph)) {
_MG_PRINTF ("FONT>FT2: can't copy glyph from cache.\n");
_WRN_PRINTF ("FONT>FT2: can't copy glyph from cache.\n");
return -1;
}
@@ -854,7 +854,7 @@ new_instance (LOGFONT* logfont, DEVFONT* devfont, BOOL need_sbc_font)
if (FTC_Manager_LookupFace (ft_cache_manager,
(FTC_FaceID)ft_face_info, &face)) {
/* can't access the font file. do not render anything */
_MG_PRINTF ("FONT>FT2: can't access font file %p\n", ft_face_info);
_WRN_PRINTF ("FONT>FT2: can't access font file %p\n", ft_face_info);
goto out_lock;
}
#else
@@ -1023,7 +1023,7 @@ static Glyph32 get_glyph_value (LOGFONT* logfont, DEVFONT* devfont, Achar32 ac)
gv = FT_Get_Char_Index (face, uc);
#else /* !_MGFONT_TTF_CACHE */
if (get_cached_face (ft_inst_info, &face)) {
_MG_PRINTF ("FONT>FT2: can't access cached face %p\n", ft_inst_info->ft_face_info);
_WRN_PRINTF ("FONT>FT2: can't access cached face %p\n", ft_inst_info->ft_face_info);
goto error;
}
@@ -1242,7 +1242,7 @@ BOOL font_InitFreetypeLibrary (void)
#endif
if (__mg_ttc_sys_init (_MGMAX_TTF_CACHE, _MGTTF_CACHE_SIZE * 1024)) {
_MG_PRINTF ("FONT>FT2: init ttf cache sys failed\n");
_WRN_PRINTF ("FONT>FT2: init ttf cache sys failed\n");
goto error_library;
}
-2
View File
@@ -44,8 +44,6 @@
#include <stdlib.h>
#include <string.h>
#define DEBUG
#include "common.h"
#if defined(_MGCHARSET_UNICODE) && defined(_MGCOMPLEX_SCRIPTS)
+4 -4
View File
@@ -164,14 +164,14 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
qpf_info = (QPFINFO*) calloc (1, sizeof(QPFINFO));
if (!(fp = fopen (file_name, "rb"))) {
_MG_PRINTF ("FONT>QPF: open file error: %s.\n",
_WRN_PRINTF ("FONT>QPF: open file error: %s.\n",
file_name);
goto error;
}
file_size = get_opened_file_size (fp);
if (file_size == 0) {
_MG_PRINTF ("FONT>QPF: empty font file: %s.\n",
_WRN_PRINTF ("FONT>QPF: empty font file: %s.\n",
file_name);
goto error;
}
@@ -180,14 +180,14 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
if ((qpf_info->height
= fontGetHeightFromName (font_name)) == -1) {
_MG_PRINTF ("FONT>QPF: Invalid font name (height): %s.\n",
_WRN_PRINTF ("FONT>QPF: Invalid font name (height): %s.\n",
font_name);
goto error;
}
if ((qpf_info->width
= fontGetWidthFromName (font_name)) == -1) {
_MG_PRINTF ("FONT>QPF: Invalid font name (width): %s.\n",
_WRN_PRINTF ("FONT>QPF: Invalid font name (width): %s.\n",
font_name);
goto error;
}
+24 -23
View File
@@ -72,7 +72,7 @@
#include "bidi.h"
#include "unicode-bidi.h"
#ifdef DEBUG
#ifdef _DEBUG
#include <assert.h>
@@ -98,7 +98,7 @@ static inline void validate_run_list(BidiRun *run_list)
// do nothing.
}
#endif /* !DEBUG */
#endif /* !_DEBUG */
static BidiRun* new_run(void)
{
@@ -452,7 +452,7 @@ static BidiRun *get_adjacent_run(BidiRun *list,
return ppp;
}
#ifdef DEBUG
#ifdef _DEBUG
/*======================================================================
* For debugging, define some functions for printing the types and the
* levels.
@@ -551,7 +551,7 @@ static void print_pairing_nodes(BidiPairingNode *nodes)
_DBG_PRINTF ("\n");
}
#endif /* DEBUG */
#endif /* _DEBUG */
/*=========================================================================
* define macros for push and pop the status in to / out of the stack
@@ -802,9 +802,9 @@ BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
base_level_per_iso_level[0] = base_level;
#ifdef DEBUG
#ifdef _DEBUG
print_types_re (main_run_list);
#endif /* DEBUG */
#endif /* _DEBUG */
/* Explicit Levels and Directions */
_DBG_PRINTF ("explicit levels and directions\n");
@@ -1044,12 +1044,12 @@ BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
compact_list (main_run_list);
#ifdef DEBUG
#ifdef _DEBUG
print_types_re (main_run_list);
print_bidi_string (bidi_types, len);
print_resolved_levels (main_run_list);
print_resolved_types (main_run_list);
#endif /* DEBUG */
#endif /* _DEBUG */
/* 4. Resolving weak types. Also calculate the maximum isolate level */
max_iso_level = 0;
@@ -1224,10 +1224,10 @@ BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
compact_neutrals (main_run_list);
#ifdef DEBUG
#ifdef _DEBUG
print_resolved_levels (main_run_list);
print_resolved_types (main_run_list);
#endif /* DEBUG */
#endif /* _DEBUG */
/* 5. Resolving Neutral Types */
@@ -1307,9 +1307,9 @@ BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
/* The list must now be sorted for the next algo to work! */
sort_pairing_nodes(&pairing_nodes);
#ifdef DEBUG
#ifdef _DEBUG
print_pairing_nodes (pairing_nodes);
#endif /* DEBUG */
#endif /* _DEBUG */
/* Start the N0 */
{
@@ -1398,10 +1398,10 @@ BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
}
}
#ifdef DEBUG
#ifdef _DEBUG
print_resolved_levels (main_run_list);
print_resolved_types (main_run_list);
#endif /* DEBUG */
#endif /* _DEBUG */
}
_DBG_PRINTF ("resolving neutral types - N1+N2\n");
@@ -1437,10 +1437,10 @@ BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
compact_list (main_run_list);
#ifdef DEBUG
#ifdef _DEBUG
print_resolved_levels (main_run_list);
print_resolved_types (main_run_list);
#endif /* DEBUG */
#endif /* _DEBUG */
/* 6. Resolving implicit levels */
_DBG_PRINTF ("resolving implicit levels\n");
@@ -1471,11 +1471,11 @@ BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
compact_list (main_run_list);
#ifdef DEBUG
#ifdef _DEBUG
print_bidi_string (bidi_types, len);
print_resolved_levels (main_run_list);
print_resolved_types (main_run_list);
#endif /* DEBUG */
#endif /* _DEBUG */
/* Reinsert the explicit codes & BN's that are already removed, from the
explicits_list to main_run_list. */
@@ -1496,11 +1496,11 @@ BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
p->level = p->prev->level;
}
#ifdef DEBUG
#ifdef _DEBUG
print_types_re (main_run_list);
print_resolved_levels (main_run_list);
print_resolved_types (main_run_list);
#endif /* DEBUG */
#endif /* _DEBUG */
_DBG_PRINTF ("reset the embedding levels, 1, 2, 3.\n");
{
@@ -1554,11 +1554,11 @@ BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
if (!shadow_run_list (main_run_list, list, FALSE)) goto out;
}
#ifdef DEBUG
#ifdef _DEBUG
print_types_re (main_run_list);
print_resolved_levels (main_run_list);
print_resolved_types (main_run_list);
#endif /* DEBUG */
#endif /* _DEBUG */
{
int pos = 0;
@@ -1821,7 +1821,8 @@ BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevelsAlt(
max_level = UBidiGetParagraphEmbeddingLevels(bidi_ts, brk_ts, nr_ucs,
&base_dir, els);
if (max_level == 0) {
_DBG_PRINTF("%s: failed to get paragraph embedding levels.\n");
_DBG_PRINTF("%s: failed to get paragraph embedding levels.\n",
__FUNCTION__);
memset (els, 0, nr_ucs);
}
}
+7 -6
View File
@@ -58,7 +58,7 @@
#include "unicode-bidi.h"
#ifdef DEBUG
#ifdef _DEBUG
/*======================================================================
* For debugging, define some functions for printing joining types and
* properties.
@@ -91,7 +91,7 @@ static void print_joining_types(const BidiLevel *embedding_levels,
_DBG_PRINTF ("\n");
}
#endif /* DEBUG */
#endif /* _DEBUG */
#define UNIBIDI_CONSISTENT_LEVEL(i) \
(BIDI_IS_EXPLICIT_OR_BN (bidi_types[(i)]) \
@@ -107,9 +107,9 @@ void GUIAPI UBidiJoinArabic(const BidiType *bidi_types,
{
if (len == 0) return;
#ifdef DEBUG
#ifdef _DEBUG
print_joining_types (embedding_levels, len, ar_props);
#endif /* DEBUG */
#endif /* _DEBUG */
/* The joining algorithm turned out very very dirty :(. That's what happens
* when you follow the standard which has never been implemented closely
@@ -187,9 +187,10 @@ void GUIAPI UBidiJoinArabic(const BidiType *bidi_types,
}
#ifdef DEBUG
#ifdef _DEBUG
print_joining_types (embedding_levels, len, ar_props);
#endif /* DEBUG */
#endif /* _DEBUG */
}
#endif /* _MGCHARSET_UNICODE */
+4 -4
View File
@@ -67,24 +67,24 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
int tmp;
if ((tmp = fontGetWidthFromName (font_name)) == -1) {
_MG_PRINTF ("FONT>UPF: Invalid font name (width): %s.\n", font_name);
_WRN_PRINTF ("FONT>UPF: Invalid font name (width): %s.\n", font_name);
goto error;
}
upf_info->width = (Uint8)tmp;
if ((tmp = fontGetHeightFromName (font_name)) == -1) {
_MG_PRINTF ("FONT>UPF: Invalid font name (height): %s.\n", font_name);
_WRN_PRINTF ("FONT>UPF: Invalid font name (height): %s.\n", font_name);
goto error;
}
upf_info->height = (Uint8)tmp;
if ((fp = fopen (file_name, "rb")) == NULL) {
_MG_PRINTF ("FONT>UPF: can't open font file: %s\n", file_name);
_WRN_PRINTF ("FONT>UPF: can't open font file: %s\n", file_name);
goto error;
}
if ((file_size = get_opened_file_size (fp)) <= 0) {
_MG_PRINTF ("FONT>UPF: empty font file: %s\n", file_name);
_WRN_PRINTF ("FONT>UPF: empty font file: %s\n", file_name);
goto error;
}
+10 -10
View File
@@ -226,70 +226,70 @@ BOOL mg_InitControlClass ()
#ifdef _MGCTRL_TREEVIEW
if (!RegisterTreeViewControl ()) {
_MG_PRINTF ("Init MiniGUI control error: TreeView.\n");
_WRN_PRINTF ("Init MiniGUI control error: TreeView.\n");
return FALSE;
}
#endif
#ifdef _MGCTRL_TREEVIEW_RDR
if (!RegisterTreeViewRdrControl ()) {
_MG_PRINTF ("Init MiniGUI control error: TreeView_rdr.\n");
_WRN_PRINTF ("Init MiniGUI control error: TreeView_rdr.\n");
return FALSE;
}
#endif
#ifdef _MGCTRL_MONTHCAL
if (!RegisterMonthCalendarControl ()) {
_MG_PRINTF ("Init MiniGUI control error: MonthCalendar.\n");
_WRN_PRINTF ("Init MiniGUI control error: MonthCalendar.\n");
return FALSE;
}
#endif
#ifdef _MGCTRL_SPINBOX
if (!RegisterSpinControl ()) {
_MG_PRINTF ("Init MiniGUI control error: Spin.\n");
_WRN_PRINTF ("Init MiniGUI control error: Spin.\n");
return FALSE;
}
#endif
#ifdef _MGCTRL_COOLBAR
if (!RegisterCoolBarControl ()) {
_MG_PRINTF ("Init MiniGUI control error: CoolBar.\n");
_WRN_PRINTF ("Init MiniGUI control error: CoolBar.\n");
return FALSE;
}
#endif
#ifdef _MGCTRL_LISTVIEW
if (!RegisterListViewControl ()) {
_MG_PRINTF ("Init MiniGUI control error: ListView.\n");
_WRN_PRINTF ("Init MiniGUI control error: ListView.\n");
return FALSE;
}
#endif
#ifdef _MGCTRL_GRIDVIEW
if (!RegisterGridViewControl ()) {
_MG_PRINTF ("Init MiniGUI control error: GridView.\n");
_WRN_PRINTF ("Init MiniGUI control error: GridView.\n");
return FALSE;
}
#endif
#ifdef _MGCTRL_ICONVIEW
if (!RegisterIconViewControl ()) {
_MG_PRINTF ("Init MiniGUI control error: IconView.\n");
_WRN_PRINTF ("Init MiniGUI control error: IconView.\n");
return FALSE;
}
#endif
#ifdef _MGCTRL_ANIMATION
if (!RegisterAnimationControl ()) {
_MG_PRINTF ("Init MiniGUI control error: Animation.\n");
_WRN_PRINTF ("Init MiniGUI control error: Animation.\n");
return FALSE;
}
#endif
#ifdef _MGCTRL_SCROLLBAR
if (!RegisterScrollBarControl ()) {
_MG_PRINTF ("Init MiniGUI control error: ScrollBar.\n");
_WRN_PRINTF ("Init MiniGUI control error: ScrollBar.\n");
return FALSE;
}
#endif
+2 -2
View File
@@ -64,7 +64,7 @@ char* gui_GetIconFile(const char* rdr_name, char* file, char* _szValue)
if (GetMgEtcValue (rdr_name, file,
iconname, sizeof(szValue)-(iconname-szValue)) < 0 ) {
_MG_PRINTF ("SYSRES: can't get %s's value from section %s in etc.\n",
_WRN_PRINTF ("SYSRES: can't get %s's value from section %s in etc.\n",
file, rdr_name);
return NULL;
}
@@ -81,7 +81,7 @@ BOOL gui_LoadIconRes(HDC hdc, const char* rdr_name, char* file)
if (LoadResource(szValue, RES_TYPE_ICON, (DWORD)hdc) != NULL)
return TRUE;
_MG_PRINTF ("SYSRES: can't get %s's value from section %s in etc.\n",
_WRN_PRINTF ("SYSRES: can't get %s's value from section %s in etc.\n",
file, rdr_name);
return FALSE;
+11 -11
View File
@@ -605,30 +605,30 @@ void dump_window_element_data (HWND hwnd)
return;
if (pwnd->wed == NULL) {
_MG_PRINTF ("GUI>DumpWED: No attributes in list.\n");
_WRN_PRINTF ("GUI>DumpWED: No attributes in list.\n");
return;
}
_MG_PRINTF ("GUI>DumpWED: The attributes of window elements:\n");
_WRN_PRINTF ("GUI>DumpWED: The attributes of window elements:\n");
list_for_each (me, &pwnd->wed->list) {
wed = list_entry (me, WND_ELEMENT_DATA, list);
switch (wed->id & WE_ATTR_TYPE_MASK) {
case WE_ATTR_TYPE_FONT:
_MG_PRINTF ("\tfont in list:%s-%s-%s.\n",
_WRN_PRINTF ("\tfont in list:%s-%s-%s.\n",
((PLOGFONT)(wed->data))->type,
((PLOGFONT)(wed->data))->family,
((PLOGFONT)(wed->data))->charset);
break;
case WE_ATTR_TYPE_METRICS:
_MG_PRINTF ("\tmetrics in list:%d.\n", (int)wed->data);
_WRN_PRINTF ("\tmetrics in list:%d.\n", (int)wed->data);
break;
case WE_ATTR_TYPE_COLOR:
_MG_PRINTF ("\tcolor in list: %p.\n", (PVOID)wed->data);
_WRN_PRINTF ("\tcolor in list: %p.\n", (PVOID)wed->data);
}
}
_MG_PRINTF ("GUI>DumpWED: Done\n");
_WRN_PRINTF ("GUI>DumpWED: Done\n");
}
#endif /* _DEBUG */
@@ -723,7 +723,7 @@ GetWindowElementPixelEx (HWND hwnd, HDC hdc, int we_attr_id)
gal_pixel pixel;
if ((we_attr_id & WE_ATTR_TYPE_MASK) != WE_ATTR_TYPE_COLOR) {
_MG_PRINTF ("GUI: Can't get color; invalid attr id: %x.\n", we_attr_id);
_WRN_PRINTF ("GUI: Can't get color; invalid attr id: %x.\n", we_attr_id);
return -1;
}
@@ -795,7 +795,7 @@ BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
if (!rdr || !rdr->name || rdr->name[0] == '\0')
return FALSE;
_MG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n",
_WRN_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n",
rdr->name);
for (i = 0; i < WE_METRICS_NUMBER; i++) {
@@ -821,7 +821,7 @@ BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
if (szCKeyNames[i][j]) {
if (GetMgEtcValue (rdr->name, szCKeyNames[i][j],
buff, 12) != ETC_OK) {
_MG_PRINTF ("GUI>InitWEA: InitWindowElementAttrs error: \
_WRN_PRINTF ("GUI>InitWEA: InitWindowElementAttrs error: \
Can not Get %s color. \n", szCKeyNames[i][j]);
return FALSE;
}
@@ -851,7 +851,7 @@ BOOL mg_InitLFManager (void)
return FALSE;
if (rdr->init && 0 != rdr->init (rdr)) {
_MG_PRINTF ("GUI>InitLFM: failed to initialize default renderer's private info.\n");
_WRN_PRINTF ("GUI>InitLFM: failed to initialize default renderer's private info.\n");
return FALSE;
}
@@ -863,7 +863,7 @@ BOOL mg_InitLFManager (void)
if (rdr->init && 0 != rdr->init (rdr)) {
wnd_lf_info[i].wnd_rdr = NULL;
_MG_PRINTF ("GUI>InitLFM: fail to initialize renderer[%d]'s private info.\n", i);
_WRN_PRINTF ("GUI>InitLFM: fail to initialize renderer[%d]'s private info.\n", i);
continue;
}
}
+7 -7
View File
@@ -1368,7 +1368,7 @@ static void mnuDrawMenuBarItem (HWND hwnd, HDC hdc, PMENUITEM pmi,
return;
if (!pWin->we_rdr) {
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
_WRN_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return;
}
@@ -2009,7 +2009,7 @@ static int mnuDrawMenuPic (HWND hwnd, HDC hdc, RECT* rect,
if (NULL == pWin) return -1;
if (!pWin->we_rdr) {
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
_WRN_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return -1;
}
@@ -2254,7 +2254,7 @@ static void draw_bottom_scroll_button(PTRACKMENUINFO ptmi)
if (NULL == pWin) return;
if (!pWin->we_rdr) {
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
_WRN_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return;
}
@@ -2294,7 +2294,7 @@ static int mnuShowPopupMenu (PTRACKMENUINFO ptmi)
if (NULL == pWin) return -1;
if (!pWin->we_rdr) {
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
_WRN_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return -1;
}
@@ -2614,7 +2614,7 @@ static void draw_top_scroll_button(PTRACKMENUINFO ptmi)
if (NULL == pWin) return;
if (!pWin->we_rdr) {
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
_WRN_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return;
}
@@ -2657,7 +2657,7 @@ static int show_scroll_popup_menu (PTRACKMENUINFO ptmi)
if (NULL == pWin) return -1;
if (!pWin->we_rdr) {
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
_WRN_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return -1;
}
@@ -3087,7 +3087,7 @@ static void mnuHiliteMenuItem (PTRACKMENUINFO ptmi, PMENUITEM pmi, BOOL bHilite)
if (NULL == pWin) return;
if (!pWin->we_rdr) {
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
_WRN_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return;
}
+8 -8
View File
@@ -3517,10 +3517,10 @@ void GUIAPI MainWindowThreadCleanup (HWND hMainWnd)
{
PMAINWIN pWin = (PMAINWIN)hMainWnd;
_MG_PRINTF ("GUI>Window: MainWindowThreadCleanup called: %p (%s)\n", pWin, pWin->spCaption);
_WRN_PRINTF ("GUI>Window: MainWindowThreadCleanup called: %p (%s)\n", pWin, pWin->spCaption);
if (!MG_IS_DESTROYED_WINDOW (hMainWnd)) {
_MG_PRINTF ("GUI>Window: Unexpected calling of "
_WRN_PRINTF ("GUI>Window: Unexpected calling of "
"(MainWindowThreadCleanup); Window (%p) "
"not destroyed yet!\n", hMainWnd);
return;
@@ -3529,7 +3529,7 @@ void GUIAPI MainWindowThreadCleanup (HWND hMainWnd)
#ifdef _MGRM_THREADS
if (pWin->pHosting == NULL) {
mg_FreeMsgQueueThisThread ();
_MG_PRINTF ("GUI>Window: Message queure is freed: %p (%s)\n", pWin, pWin->spCaption);
_WRN_PRINTF ("GUI>Window: Message queure is freed: %p (%s)\n", pWin, pWin->spCaption);
}
#endif
@@ -5964,7 +5964,7 @@ static int gui_GenerateMaskRect(HWND hWnd, RECT4MASK* rect, int rect_size)
(MASKRECT *) calloc (rect_size, sizeof (MASKRECT));
if (!pCtrl->mask_rects) {
_MG_PRINTF ("GUI>Window: Not enough memory!\n");
_WRN_PRINTF ("GUI>Window: Not enough memory!\n");
free (rect);
return FALSE;
}
@@ -5979,7 +5979,7 @@ static int gui_GenerateMaskRect(HWND hWnd, RECT4MASK* rect, int rect_size)
new_maskrect =
(MASKRECT *) calloc (rect_size, sizeof (MASKRECT));
if (!new_maskrect) {
_MG_PRINTF ("GUI>Window: Not enough memory!\n");
_WRN_PRINTF ("GUI>Window: Not enough memory!\n");
free (rect);
return FALSE;
}
@@ -6094,7 +6094,7 @@ BOOL GUIAPI SetWindowRegion (HWND hWnd, const CLIPRGN * region)
(MASKRECT *) calloc (rect_size, sizeof (MASKRECT));
if (!pCtrl->mask_rects) {
_MG_PRINTF ("GUI>Window: Not enough memory!\n");
_WRN_PRINTF ("GUI>Window: Not enough memory!\n");
return FALSE;
}
}
@@ -6108,7 +6108,7 @@ BOOL GUIAPI SetWindowRegion (HWND hWnd, const CLIPRGN * region)
(MASKRECT *) calloc (rect_size, sizeof (MASKRECT));
if (!new_maskrect) {
_MG_PRINTF ("GUI>Window: Not enough memory!\n");
_WRN_PRINTF ("GUI>Window: Not enough memory!\n");
return FALSE;
}
free (pCtrl->mask_rects);
@@ -6144,7 +6144,7 @@ BOOL GUIAPI SetWindowRegion (HWND hWnd, const CLIPRGN * region)
rect = (RECT4MASK *) calloc(rect_size, sizeof(RECT4MASK));
if(rect == NULL) {
_MG_PRINTF ("GUI>Window: Not enough memory!\n");
_WRN_PRINTF ("GUI>Window: Not enough memory!\n");
return FALSE;
}
+1 -1
View File
@@ -265,7 +265,7 @@ int mg_InitIAL (void)
_ERR_PRINTF ("IAL: Does not find the request engine: %s.\n", engine);
if (NR_INPUTS) {
__mg_cur_input = inputs;
_MG_PRINTF ("IAL: Use the first engine: %s\n", __mg_cur_input->id);
_WRN_PRINTF ("IAL: Use the first engine: %s\n", __mg_cur_input->id);
}
else
return ERR_NO_MATCH;
+2 -2
View File
@@ -251,13 +251,13 @@ BOOL InitIPAQH3600Input (INPUT* input, const char* mdev, const char* mtype)
{
ts = open (TS_DEVICE, O_RDONLY);
if (ts < 0) {
_MG_PRINTF ("IAL>%s: Can not open touch screen!\n", __FILE__);
_WRN_PRINTF ("IAL>%s: Can not open touch screen!\n", __FILE__);
return FALSE;
}
btn_fd = open (KBD_DEVICE, O_RDONLY);
if (btn_fd < 0 ) {
_MG_PRINTF ("IAL>%s: Can not open button key!\n", __FILE__);
_WRN_PRINTF ("IAL>%s: Can not open button key!\n", __FILE__);
return FALSE;
}
+2 -2
View File
@@ -379,13 +379,13 @@ BOOL InitIPAQH5400Input (INPUT* input, const char* mdev, const char* mtype)
{
ts_fd = open (mdev, O_RDONLY);
if (ts_fd < 0) {
_MG_PRINTF ("IAL>%s: Can not open touch screen device: %s!\n", __FILE__, mdev);
_WRN_PRINTF ("IAL>%s: Can not open touch screen device: %s!\n", __FILE__, mdev);
return FALSE;
}
kbd_fd = TTY_Open ();
if (kbd_fd < 0 ) {
_MG_PRINTF ("IAL>%s: Can not open button key!\n", __FILE__);
_WRN_PRINTF ("IAL>%s: Can not open button key!\n", __FILE__);
return FALSE;
}
+1 -1
View File
@@ -338,7 +338,7 @@ BOOL InitJZ4740Input(INPUT* input, const char* mdev, const char* mtype)
touch_fd = open (TS_DEVICE, O_NONBLOCK);
if (!touch_fd) {
_MG_PRINTF ("IAL>TSLib: can not open ts device\n");
_WRN_PRINTF ("IAL>TSLib: can not open ts device\n");
return FALSE;
}
+1 -1
View File
@@ -341,7 +341,7 @@ BOOL InitlideInput(INPUT* input, const char* mdev, const char* mtype)
touch_fd = open (TS_DEVICE, O_NONBLOCK);
if (!touch_fd) {
_MG_PRINTF ("IAL>TSLib: can not open ts device\n");
_WRN_PRINTF ("IAL>TSLib: can not open ts device\n");
return FALSE;
}
+3 -3
View File
@@ -140,19 +140,19 @@ BOOL InitTSLibInput(INPUT* input, const char* mdev, const char* mtype)
}
if (tsdevice == NULL) {
_MG_PRINTF ("IAL>TSLib: Please specify the ts device\n");
_WRN_PRINTF ("IAL>TSLib: Please specify the ts device\n");
return FALSE;
}
ts = ts_open (tsdevice, 0);
if (!ts) {
_MG_PRINTF ("IAL>TSLib: can not open ts device\n");
_WRN_PRINTF ("IAL>TSLib: can not open ts device\n");
return FALSE;
}
if (ts_config (ts)) {
_MG_PRINTF ("IAL>TSLib: can not config ts device\n");
_WRN_PRINTF ("IAL>TSLib: can not config ts device\n");
return FALSE;
}
+9 -9
View File
@@ -52,7 +52,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
/* the cbType of struct CURSORDIR. */
wTemp = MGUI_ReadLE16FP (fp);
if(wTemp != 2) {
_MG_PRINTF ("LoadCursorFromFile: bad file type: %d\n", wTemp);
_WRN_PRINTF ("LoadCursorFromFile: bad file type: %d\n", wTemp);
goto error;
}
@@ -63,7 +63,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
w = fgetc (fp); /* the width of first cursor. */
h = fgetc (fp); /* the height of first cursor. */
if (w != CURSORWIDTH || h != CURSORHEIGHT) {
_MG_PRINTF ("LoadCursorFromFile: bad first cursor width (%d) and height (%d)\n", w, h);
_WRN_PRINTF ("LoadCursorFromFile: bad first cursor width (%d) and height (%d)\n", w, h);
goto error;
}
@@ -85,21 +85,21 @@ static HCURSOR load_cursor_from_file (const char* filename)
imagew = MGUI_ReadLE32FP (fp);
imageh = MGUI_ReadLE32FP (fp);
if (imagew != CURSORWIDTH || imageh != (CURSORHEIGHT*2)) {
_MG_PRINTF ("LoadCursorFromFile: bad cursor image width (%d) and height (%d)\n", imagew, imageh);
_WRN_PRINTF ("LoadCursorFromFile: bad cursor image width (%d) and height (%d)\n", imagew, imageh);
goto error;
}
/* check the biPlanes member; */
wTemp = MGUI_ReadLE16FP (fp);
if (wTemp != 1) {
_MG_PRINTF ("LoadCursorFromFile: bad planes (%d)\n", wTemp);
_WRN_PRINTF ("LoadCursorFromFile: bad planes (%d)\n", wTemp);
goto error;
}
/* check the biBitCount member; */
wTemp = MGUI_ReadLE16FP (fp);
if (wTemp > 4) {
_MG_PRINTF ("LoadCursorFromFile: bad bit count (%d)\n", wTemp);
_WRN_PRINTF ("LoadCursorFromFile: bad bit count (%d)\n", wTemp);
goto error;
}
@@ -112,13 +112,13 @@ static HCURSOR load_cursor_from_file (const char* filename)
/* allocate memory for image. */
if ((image = (BYTE*)ALLOCATE_LOCAL (imagesize)) == NULL) {
_MG_PRINTF ("LoadCursorFromFile: error when allocating memory for image (%d)\n", imagesize);
_WRN_PRINTF ("LoadCursorFromFile: error when allocating memory for image (%d)\n", imagesize);
goto error;
}
/* read image */
if (fread (image, 1, imagesize, fp) < imagesize) {
_MG_PRINTF ("LoadCursorFromFile: error when reading data from file\n");
_WRN_PRINTF ("LoadCursorFromFile: error when reading data from file\n");
goto error;
}
@@ -130,7 +130,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
return csr;
error:
_MG_PRINTF ("LoadCursorFromFile: failed when loading cursor from %s\n", filename);
_WRN_PRINTF ("LoadCursorFromFile: failed when loading cursor from %s\n", filename);
fclose (fp);
return csr;
}
@@ -201,7 +201,7 @@ static HCURSOR load_cursor_from_mem (const void* area)
p + (imagesize - MONOSIZE), p, colornum);
error:
_MG_PRINTF ("LoadCursorFromMem: failed when loading cursor from %p\n", area);
_WRN_PRINTF ("LoadCursorFromMem: failed when loading cursor from %p\n", area);
return 0;
}
+4 -4
View File
@@ -195,7 +195,7 @@ static int dskAddNewMainWindow (PMAINWIN pWin)
pWin->idx_znode = dskAllocZOrderNode (pWin);
if (pWin->idx_znode <= 0) {
_MG_PRINTF ("KERNEL>Desktop: Alloc zorder node for main window fail.\n");
_WRN_PRINTF ("KERNEL>Desktop: Alloc zorder node for main window fail.\n");
return -1;
}
@@ -1218,7 +1218,7 @@ static int dskStartDragWindow (PMAINWIN pWin, const DRAGINFO* drag_info)
SetCursor (GetSystemCursor (IDC_SIZENESW));
break;
default:
_MG_PRINTF ("KERNEL>Desktop: Drag and drop window: bad location\n");
_WRN_PRINTF ("KERNEL>Desktop: Drag and drop window: bad location\n");
break;
}
@@ -1297,7 +1297,7 @@ static int do_drag_drop_window (UINT msg, int x, int y)
break;
default:
_MG_PRINTF ("KERNEL>Desktop: do_drag_drop_window: bad location\n");
_WRN_PRINTF ("KERNEL>Desktop: do_drag_drop_window: bad location\n");
break;
}
@@ -1735,7 +1735,7 @@ static int dskOnNewCtrlInstance (PCONTROL pParent, PCONTROL pNewCtrl)
pNewCtrl->idx_znode = dskAllocZOrderNode ((PMAINWIN)pNewCtrl);
if (pNewCtrl->idx_znode <= 0) {
_MG_PRINTF ("KERNEL>Desktop: Alloc zorder node for control fail.\n");
_WRN_PRINTF ("KERNEL>Desktop: Alloc zorder node for control fail.\n");
return -1;
}
+2 -2
View File
@@ -882,7 +882,7 @@ static int srvStartDragWindow (int cli, int idx_znode,
SetCursor (GetSystemCursor (IDC_SIZENESW));
break;
default:
_MG_PRINTF ("KERNEL>Desktop: Drag and drop window: bad location\n");
_WRN_PRINTF ("KERNEL>Desktop: Drag and drop window: bad location\n");
break;
}
@@ -980,7 +980,7 @@ int __mg_do_drag_drop_window (int msg, int x, int y)
break;
default:
_MG_PRINTF ("KERNEL>Desktop: __mg_do_drag_drop_window: bad location\n");
_WRN_PRINTF ("KERNEL>Desktop: __mg_do_drag_drop_window: bad location\n");
break;
}
+1 -1
View File
@@ -96,7 +96,7 @@ BOOL mg_InitDesktop (void)
*/
ret = kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
if (ret < 0) {
_MG_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
return FALSE;
}
+3 -3
View File
@@ -104,7 +104,7 @@ BOOL mg_InitDesktop (void)
ret = kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
if (ret < 0) {
_MG_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
return FALSE;
}
@@ -120,7 +120,7 @@ BOOL mg_InitDesktop (void)
// Init Window Management information.
if (!InitWndManagementInfo()) {
_MG_PRINTF ("KERNEL>Desktop: Can not initialize window management information!\n");
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize window management information!\n");
return FALSE;
}
@@ -133,7 +133,7 @@ void* DesktopMain (void* data)
/* init message queue of desktop thread */
if (!(__mg_dsk_msg_queue = mg_InitMsgQueueThisThread ()) ) {
_MG_PRINTF ("KERNEL>Desktop: mg_InitMsgQueueThisThread failure!\n");
_WRN_PRINTF ("KERNEL>Desktop: mg_InitMsgQueueThisThread failure!\n");
return NULL;
}
+1 -1
View File
@@ -1493,7 +1493,7 @@ int CreateNodeRoundMaskRect (ZORDERINFO* zi, ZORDERNODE* node,
(unsigned char*)GET_MASKRECT_USAGEBMP(zi),
zi->size_maskrect_usage_bmp, 1);
if (free_slot == -1) {
_MG_PRINTF ("KERNEL: __mg_lookfor_unused_slot failed\n");
_WRN_PRINTF ("KERNEL: __mg_lookfor_unused_slot failed\n");
return -1;
}
+1 -1
View File
@@ -490,7 +490,7 @@ BOOL PeekMessageEx (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax
#ifdef _MGRM_THREADS
if (!(pMsgQueue = GetMsgQueueThisThread ())) {
_MG_PRINTF ("Kernel>message: no message queue.\n");
_WRN_PRINTF ("Kernel>message: no message queue.\n");
return FALSE;
}
#else
+4 -4
View File
@@ -383,7 +383,7 @@ BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
PMSGQUEUE pMsgQueue;
if (id == 0) {
_MG_PRINTF ("KERNEL>Timer: bad identifier (%ld).\n", id);
_WRN_PRINTF ("KERNEL>Timer: bad identifier (%ld).\n", id);
return FALSE;
}
@@ -393,7 +393,7 @@ BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
#ifdef _MGRM_THREADS
if (!(pMsgQueue = GetMsgQueueThisThread ())) {
_MG_PRINTF ("KERNEL>Timer: Not a GUI thread.\n");
_WRN_PRINTF ("KERNEL>Timer: Not a GUI thread.\n");
return FALSE;
}
#else
@@ -409,13 +409,13 @@ BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
slot = i;
}
else if (timerstr[i]->hWnd == hWnd && timerstr[i]->id == id) {
_MG_PRINTF ("KERNEL>Timer: duplicated call to SetTimerEx (%p, %ld).\n", hWnd, id);
_WRN_PRINTF ("KERNEL>Timer: duplicated call to SetTimerEx (%p, %ld).\n", hWnd, id);
goto badret;
}
}
if (slot < 0 || slot == DEF_NR_TIMERS) {
_MG_PRINTF ("KERNEL>Timer: No more slot for new timer (total: %d)\n", DEF_NR_TIMERS);
_WRN_PRINTF ("KERNEL>Timer: No more slot for new timer (total: %d)\n", DEF_NR_TIMERS);
goto badret;
}
+1 -1
View File
@@ -125,7 +125,7 @@ int kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
sizeof (MASKRECT) * DEF_NR_MASKRECT);
if (!__mg_zorder_info) {
_MG_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
_WRN_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
return -1;
}
+1 -1
View File
@@ -80,7 +80,7 @@ static int create_clip_board (const char* cb_name, size_t size)
for (i = 0; i < NR_CLIPBOARDS; i++) {
if (strncmp (cb_name, cbs [i].name, LEN_CLIPBOARD_NAME) == 0) {
_MG_PRINTF ("MISC>ClipBoard: create error: already existed.\n");
_WRN_PRINTF ("MISC>ClipBoard: create error: already existed.\n");
return CBERR_BADNAME;
}
if (empty < 0 && cbs [i].name [0] == '\0') {
+3 -3
View File
@@ -130,7 +130,7 @@ static int mem_seek(MG_RWops *context, int offset, int whence)
newpos = context->hidden.mem.stop+offset;
break;
default:
_MG_PRINTF ("MISC>RWOps: Unknown value for 'whence'\n");
_WRN_PRINTF ("MISC>RWOps: Unknown value for 'whence'\n");
return(-1);
}
if ( newpos < context->hidden.mem.base ) {
@@ -257,7 +257,7 @@ MG_RWops *MGUI_RWFromFile(const char *file, const char *mode)
fp = fopen(file, (char*)mode);
#endif
if ( fp == NULL ) {
_MG_PRINTF ("MISC>RWOps: Couldn't open %s\n", file);
_WRN_PRINTF ("MISC>RWOps: Couldn't open %s\n", file);
} else {
rwops = MGUI_RWFromFP(fp, 1);
}
@@ -339,7 +339,7 @@ MG_RWops *MGUI_AllocRW(void)
area = (MG_RWops *)malloc(sizeof *area);
if ( area == NULL ) {
_MG_PRINTF ("MISC>RWOps: Out of memory\n");
_WRN_PRINTF ("MISC>RWOps: Out of memory\n");
}
else
area->type = RWAREA_TYPE_UNKNOWN;
+12 -12
View File
@@ -121,7 +121,7 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
version [3] = '\0';
if (strcmp(version, "87a") != 0 && strcmp(version, "89a") != 0) {
_MG_PRINTF ("MYBMP>Gif: GIF version number is not 87a or 89a\n");
_WRN_PRINTF ("MYBMP>Gif: GIF version number is not 87a or 89a\n");
return NULL; /* image loading error*/
}
@@ -139,7 +139,7 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
info->gif89.disposal = 0;
if (!ReadOK (fp, buf, 7)) {
_MG_PRINTF ("MYBMP>Gif: bad screen descriptor\n");
_WRN_PRINTF ("MYBMP>Gif: bad screen descriptor\n");
goto fini; /* image loading error*/
}
@@ -152,7 +152,7 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
if (ReadColorMap(fp, info->screen.BitPixel, info->screen.ColorMap)) {
_MG_PRINTF ("MYBMP>Gif: bad global colormap\n");
_WRN_PRINTF ("MYBMP>Gif: bad global colormap\n");
goto fini; /* image loading error*/
}
}
@@ -160,12 +160,12 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
do
{
if (!ReadOK (fp, &c, 1)) {
_MG_PRINTF ("MYBMP>Gif: EOF on image data\n");
_WRN_PRINTF ("MYBMP>Gif: EOF on image data\n");
goto fini;
}
if (';' == c) {/* GIF terminator */
_MG_PRINTF ("MYBMP>Gif: no image \n" );
_WRN_PRINTF ("MYBMP>Gif: no image \n" );
goto fini;
}
@@ -199,7 +199,7 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
if (!ReadOK (fp, buf, 9)) { /* Read the Image Descriptor*/
_MG_PRINTF ("MYBMP>Gif: bad image size\n");
_WRN_PRINTF ("MYBMP>Gif: bad image size\n");
goto fini;
}
@@ -209,7 +209,7 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
if (!info->useGColormap) {
memset (info->screen.ColorMap , 0 , 3*256);
if (0 != ReadColorMap(fp, info->bitPixel, info->screen.ColorMap)) {
_MG_PRINTF ("MYBMP>Gif: bad local colormap\n");
_WRN_PRINTF ("MYBMP>Gif: bad local colormap\n");
goto fini;
}
}
@@ -337,7 +337,7 @@ GetCode(MG_RWops *src, int code_size, int flag , void * info)
if ((curbit + code_size) >= lastbit) {
if (done) {
if (curbit >= lastbit)
_MG_PRINTF ("MYBMP>Gif: bad decode\n");
_WRN_PRINTF ("MYBMP>Gif: bad decode\n");
return -1;
}
buf[0] = buf[last_byte - 2];
@@ -430,7 +430,7 @@ LWZReadByte(MG_RWops *src, int flag, int input_code_size , void * info_data)
while ((count = GetDataBlock(src, buf , info)) > 0);
if (count != 0) {
_MG_PRINTF ("MYBMP>Gif: missing EOD in data stream (common occurence)");
_WRN_PRINTF ("MYBMP>Gif: missing EOD in data stream (common occurence)");
}
return -2;
}
@@ -443,7 +443,7 @@ LWZReadByte(MG_RWops *src, int flag, int input_code_size , void * info_data)
while (code >= clear_code) {
*sp++ = table[1][code];
if (code == table[0][code]) {
_MG_PRINTF ("MYBMP>Gif: circular table entry\n");
_WRN_PRINTF ("MYBMP>Gif: circular table entry\n");
return -1;
}
code = table[0][code];
@@ -481,11 +481,11 @@ ReadImage(MG_RWops* src, MYBITMAP* bmp, int len, int height,
* Initialize the compression routines
*/
if (!ReadOK(src, &c, 1)) {
_MG_PRINTF ("MYBMP>Gif: EOF on image data\n");
_WRN_PRINTF ("MYBMP>Gif: EOF on image data\n");
return 0;
}
if (LWZReadByte(src, TRUE, c , info) < 0) {
_MG_PRINTF ("MYBMP>Gif: error reading image\n");
_WRN_PRINTF ("MYBMP>Gif: error reading image\n");
return 0;
}
+1 -1
View File
@@ -363,7 +363,7 @@ int GUIAPI SaveMyBitmapToFile (PMYBITMAP my_bmp, RGB* pal, const char* spFileNam
return ERR_BMP_CANT_SAVE;
if (!(fp = MGUI_RWFromFile (spFileName, "wb+"))) {
_MG_PRINTF ("MYBMP>WinBMP: Saving BMP file: fopen error.\n");
_WRN_PRINTF ("MYBMP>WinBMP: Saving BMP file: fopen error.\n");
return ERR_BMP_FILEIO;
}
+20 -20
View File
@@ -150,7 +150,7 @@ static BOOL SMI_MapMem (_THIS)
break;
}
_MG_PRINTF ("NEWGAL>FBCON>SMI: Physical MMIO at 0x%08lX\n", (unsigned long)memBase);
_DBG_PRINTF ("NEWGAL>FBCON>SMI: Physical MMIO at 0x%08lX\n", (unsigned long)memBase);
{
void** result = (void*)(&pSmi->MapBase);
@@ -161,13 +161,13 @@ static BOOL SMI_MapMem (_THIS)
result);
if (err) {
perror ("pci_device_map_range");
_MG_PRINTF ("NEWGAL>FBCON>SMI: pci_device_map_range failure: %s.\n", strerror (err));
_WRN_PRINTF ("NEWGAL>FBCON>SMI: pci_device_map_range failure: %s.\n", strerror (err));
return FALSE;
}
}
if (pSmi->MapBase == NULL) {
_MG_PRINTF ("NEWGAL>FBCON>SMI: Internal error: could not map MMIO registers.\n");
_WRN_PRINTF ("NEWGAL>FBCON>SMI: Internal error: could not map MMIO registers.\n");
return FALSE;
}
@@ -216,11 +216,11 @@ static BOOL SMI_MapMem (_THIS)
break;
}
_MG_PRINTF ("NEWGAL>FBCON>SMI: Logical MMIO at %p - %p\n", pSmi->MapBase,
_DBG_PRINTF ("NEWGAL>FBCON>SMI: Logical MMIO at %p - %p\n", pSmi->MapBase,
pSmi->MapBase + pSmi->MapSize - 1);
_MG_PRINTF ("NEWGAL>FBCON>SMI: DPR=%p, VPR=%p, IOBase=%p\n",
_DBG_PRINTF ("NEWGAL>FBCON>SMI: DPR=%p, VPR=%p, IOBase=%p\n",
pSmi->DPRBase, pSmi->VPRBase, pSmi->IOBase);
_MG_PRINTF ("NEWGAL>FBCON>SMI: DataPort=%p - %p\n", pSmi->DataPortBase,
_DBG_PRINTF ("NEWGAL>FBCON>SMI: DataPort=%p - %p\n", pSmi->DataPortBase,
pSmi->DataPortBase + pSmi->DataPortSize - 1);
pSmi->memPhysBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM);
@@ -262,7 +262,7 @@ static BOOL SMI_MapMem (_THIS)
pSmi->videoRAMBytes = pSmi->videoRAMKBytes * 1024;
_MG_PRINTF ("NEWGAL>FBCON>SMI: videoram: %dkB\n", pSmi->videoRAMKBytes);
_DBG_PRINTF ("NEWGAL>FBCON>SMI: videoram: %dkB\n", pSmi->videoRAMKBytes);
if (pSmi->videoRAMBytes) {
/* Map the frame buffer */
@@ -286,20 +286,20 @@ static BOOL SMI_MapMem (_THIS)
if (err) {
perror ("pci_device_map_range");
_MG_PRINTF ("NEWGAL>FBCON>SMI: pci_device_map_range failure.\n");
_WRN_PRINTF ("NEWGAL>FBCON>SMI: pci_device_map_range failure.\n");
return FALSE;
}
}
if (pSmi->FBBase == NULL) {
_MG_PRINTF ("NEWGAL>FBCON>SMI: Internal error: could not "
_WRN_PRINTF ("NEWGAL>FBCON>SMI: Internal error: could not "
"map framebuffer.\n");
return FALSE;
}
_MG_PRINTF ("NEWGAL>FBCON>SMI: Physical frame buffer at 0x%08lX offset: 0x%08lX\n",
_DBG_PRINTF ("NEWGAL>FBCON>SMI: Physical frame buffer at 0x%08lX offset: 0x%08lX\n",
pSmi->memPhysBase, pSmi->fbOffset);
_MG_PRINTF ("NEWGAL>FBCON>SMI: Logical frame buffer at %p - %p\n", pSmi->FBBase,
_DBG_PRINTF ("NEWGAL>FBCON>SMI: Logical frame buffer at %p - %p\n", pSmi->FBBase,
pSmi->FBBase + pSmi->videoRAMBytes - 1);
/* Set up offset to hwcursor memory area. It's a 1K chunk at the end of
@@ -307,7 +307,7 @@ static BOOL SMI_MapMem (_THIS)
*/
pSmi->FBCursorOffset = pSmi->videoRAMBytes - 1024;
_MG_PRINTF ("NEWGAL>FBCON>SMI: Cursor Offset: %08lX\n",
_DBG_PRINTF ("NEWGAL>FBCON>SMI: Cursor Offset: %08lX\n",
(unsigned long)pSmi->FBCursorOffset);
/* set up the fifo reserved space */
@@ -323,7 +323,7 @@ static BOOL SMI_MapMem (_THIS)
pSmi->FBReserved = pSmi->videoRAMBytes - 2048;
}
_MG_PRINTF ("NEWGAL>FBCON>SMI: Reserved: %08lX\n",
_DBG_PRINTF ("NEWGAL>FBCON>SMI: Reserved: %08lX\n",
(unsigned long)pSmi->FBReserved);
}
@@ -382,7 +382,7 @@ static void SMI_GEReset (int from_timeout, int line, char *file)
if (from_timeout) {
if (pSmi->GEResetCnt++ < 10) {
_MG_PRINTF ("\tSMI_GEReset called from %s line %d\n", file, line);
_DBG_PRINTF ("\tSMI_GEReset called from %s line %d\n", file, line);
}
}
else {
@@ -478,7 +478,7 @@ static void SMI_SetClippingRectangle (int left, int top, int right, int bottom)
SMIPtr pSmi = &smi_rec;
ENTER_PROC("SMI_SetClippingRectangle");
_MG_PRINTF ("left=%d top=%d right=%d bottom=%d\n", left, top, right, bottom);
_DBG_PRINTF ("left=%d top=%d right=%d bottom=%d\n", left, top, right, bottom);
/* CZ 26.10.2001: this code prevents offscreen pixmaps being drawn ???
left = max(left, 0);
@@ -642,7 +642,7 @@ static void SMI_SetupForScreenToScreenCopy (int xdir, int ydir, int rop,
{
SMIPtr pSmi = &smi_rec;
_MG_PRINTF ("xdir=%d ydir=%d rop=%02X trans=%08X\n", xdir, ydir, rop, trans);
_DBG_PRINTF ("xdir=%d ydir=%d rop=%02X trans=%08X\n", xdir, ydir, rop, trans);
pSmi->AccelCmd = SMI_BltRop [rop]
| SMI_BITBLT
@@ -670,7 +670,7 @@ static void SMI_SubsequentScreenToScreenCopy (int x1, int y1, int x2,
{
SMIPtr pSmi = &smi_rec;
_MG_PRINTF ("x1=%d y1=%d x2=%d y2=%d w=%d h=%d\n", x1, y1, x2, y2, w, h);
_DBG_PRINTF ("x1=%d y1=%d x2=%d y2=%d w=%d h=%d\n", x1, y1, x2, y2, w, h);
if (pSmi->AccelCmd & SMI_RIGHT_TO_LEFT) {
x1 += w - 1;
@@ -913,7 +913,7 @@ int SMI_Probe (_THIS, const struct fb_fix_screeninfo* fb_finfo, PCI_VIDEO_DRIVER
iter = pci_id_match_iterator_create (&id_match);
while ((dev = pci_device_next (iter)) != NULL) {
_MG_PRINTF ("NEWGAL>FBCON>SMI: found PCI video device by SMI: 0x%x (0x%x, 0x%x)\n",
_DBG_PRINTF ("NEWGAL>FBCON>SMI: found PCI video device by SMI: 0x%x (0x%x, 0x%x)\n",
dev->device_id, dev->subvendor_id, dev->subdevice_id);
int i = 0;
@@ -932,7 +932,7 @@ found:
if (dev) {
SMIPtr pSmi = &smi_rec;
_MG_PRINTF ("NEWGAL>FBCON>SMI: found SMI chipset: %d, %s (id of fb is %s)\n",
_DBG_PRINTF ("NEWGAL>FBCON>SMI: found SMI chipset: %d, %s (id of fb is %s)\n",
SMIChipsets [num_chipset].token,
SMIChipsets [num_chipset].name,
fb_finfo->id);
@@ -947,7 +947,7 @@ found:
pci_device_probe (dev);
}
else {
_MG_PRINTF ("NEWGAL>FBCON>SMI: not found any SMI chipset.\n");
_DBG_PRINTF ("NEWGAL>FBCON>SMI: not found any SMI chipset.\n");
}
pci_iterator_destroy (iter);
+3 -3
View File
@@ -44,11 +44,11 @@
/******************************************************************************/
#ifdef _DEBUG
# define ENTER_PROC(PROCNAME) _MG_PRINTF ("ENTER\t" PROCNAME \
# define ENTER_PROC(PROCNAME) _WRN_PRINTF ("ENTER\t" PROCNAME \
"(%d)\n", __LINE__)
# define DEBUG_PROC(PROCNAME) _MG_PRINTF ("DEBUG\t" PROCNAME \
# define DEBUG_PROC(PROCNAME) _WRN_PRINTF ("DEBUG\t" PROCNAME \
"(%d)\n", __LINE__)
# define LEAVE_PROC(PROCNAME) _MG_PRINTF ("LEAVE\t" PROCNAME \
# define LEAVE_PROC(PROCNAME) _WRN_PRINTF ("LEAVE\t" PROCNAME \
"(%d)\n", __LINE__)
#else
# define ENTER_PROC(PROCNAME)
+1 -1
View File
@@ -63,7 +63,7 @@ int FB_ProbePCIAccelDriver (_THIS, const struct fb_fix_screeninfo* fb_finfo)
int ret;
if (pci_system_init ()) {
_MG_PRINTF ("NEWGAL>FBCON: Couldn't initialize PCI system\n");
_WRN_PRINTF ("NEWGAL>FBCON: Couldn't initialize PCI system\n");
return -1;
}
+2 -2
View File
@@ -425,11 +425,11 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
//shm_init_lock(getpid());
if ((pid = fork()) < 0) {
_MG_PRINTF ("NEWGAL>PCXVFB: fork() error.\n");
_WRN_PRINTF ("NEWGAL>PCXVFB: fork() error.\n");
}
else if (pid == 0) {
if (execl_pcxvfb() == ERR_CONFIG_FILE)
_MG_PRINTF ("NEWGAL>PCXVFB: failed to read configuration failure.\n");
_WRN_PRINTF ("NEWGAL>PCXVFB: failed to read configuration failure.\n");
perror ("execl");
_exit (1);
+1 -1
View File
@@ -236,7 +236,7 @@ int DrawTextEx2 (HDC hdc, const char* pText, int nCount,
/* If output rect is too small, we shouldn't output any text.*/
if (RECTW(rcDraw) < pdc->pLogFont->size
&& RECTH(rcDraw) < pdc->pLogFont->size) {
_MG_PRINTF ("NEWGDI: "
_WRN_PRINTF ("NEWGDI: "
"Output rect is too small, we won't output any text. \n");
return -1;
}
+8 -8
View File
@@ -221,7 +221,7 @@ void mg_TerminateScreenDC (void)
#define INIT_SPECIFICAL_FONTS(etc_section) \
{ \
if (!font_InitSpecificalFonts (etc_section)) { \
_MG_PRINTF ("NEWGDI>InitGDI: Can not initialize fonts defined in section %s!\n", etc_section); \
_WRN_PRINTF ("NEWGDI>InitGDI: Can not initialize fonts defined in section %s!\n", etc_section); \
goto error; \
} \
}
@@ -230,7 +230,7 @@ void mg_TerminateScreenDC (void)
BOOL mg_InitGDI (void)
{
if (!InitTextBitmapBuffer ()) {
_MG_PRINTF ("NEWGDI>InitGDI: Can not initialize text bitmap buffer!\n");
_WRN_PRINTF ("NEWGDI>InitGDI: Can not initialize text bitmap buffer!\n");
goto error;
}
@@ -252,7 +252,7 @@ BOOL mg_InitGDI (void)
#if (defined (_MGFONT_TTF) || defined (_MGFONT_FT2)) && defined(_MGRM_THREADS)
if (!font_InitFreetypeLibrary ()) {
_MG_PRINTF ("NEWGDI>InitGDI: Can not initialize freetype fonts!\n");
_WRN_PRINTF ("NEWGDI>InitGDI: Can not initialize freetype fonts!\n");
goto error;
}
INIT_SPECIFICAL_FONTS (FONT_ETC_SECTION_NAME_TTF);
@@ -261,13 +261,13 @@ BOOL mg_InitGDI (void)
/* TODO: add other font support here */
#if defined (_MGFONT_SEF) && !defined(_LITE_VERSION)
if(!initialize_scripteasy()) {
_MG_PRINTF ("NEWGDI>InitGDI: Can not initialize ScriptEasy fonts!\n");
_WRN_PRINTF ("NEWGDI>InitGDI: Can not initialize ScriptEasy fonts!\n");
goto error;
}
#endif
if (!font_InitIncoreFonts ()) {
_MG_PRINTF ("NEWGDI>InitGDI: Can not initialize incore fonts!\n");
_WRN_PRINTF ("NEWGDI>InitGDI: Can not initialize incore fonts!\n");
goto error;
}
@@ -276,7 +276,7 @@ BOOL mg_InitGDI (void)
#endif
if (!mg_InitSysFont ()) {
_MG_PRINTF ("NEWGDI>InitGDI: Can not create system fonts!\n");
_WRN_PRINTF ("NEWGDI>InitGDI: Can not create system fonts!\n");
goto error;
}
@@ -2647,7 +2647,7 @@ HDC GetSecondarySubDC (HDC secondary_dc, HWND hwnd_child, BOOL client)
UNLOCK(&dcslot);
if (i >= DCSLOTNUMBER) {
_MG_PRINTF ("NEWGDI>GetSecondarySubDC: no DC slot.\n");
_WRN_PRINTF ("NEWGDI>GetSecondarySubDC: no DC slot.\n");
return HDC_SCREEN;
}
@@ -3392,7 +3392,7 @@ HDC GUIAPI InitSlaveScreenEx (const char* name, const char* mode, int dpi)
}
else {
free (pmem_dc);
_MG_PRINTF ("NEWGDI>InitSlaveScreen: Can not init the slave screen: %s (%s)\n",
_WRN_PRINTF ("NEWGDI>InitSlaveScreen: Can not init the slave screen: %s (%s)\n",
name, mode);
return HDC_INVALID;
}

Some files were not shown because too many files have changed in this diff Show More