本文整理汇总了C++中TDBPRINTF函数的典型用法代码示例。如果您正苦于以下问题:C++ TDBPRINTF函数的具体用法?C++ TDBPRINTF怎么用?C++ TDBPRINTF使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TDBPRINTF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fb_dowindow
static void fb_dowindow(TAPTR task)
{
struct TExecBase *TExecBase = TGetExecBase(task);
WINWINDOW *win = TGetTaskData(task);
WINDISPLAY *mod = win->fbv_Display;
MSG msg;
TUINT sig;
TDBPRINTF(TDB_INFO,("DoWindow...\n"));
do
{
WaitMessage();
while (PeekMessage(&msg, win->fbv_HWnd, 0,0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
// PostMessage(win->fbv_HWnd, WM_USER, 0, 0);
sig = TSetSignal(0, TTASK_SIG_ABORT);
} while (!(sig & TTASK_SIG_ABORT));
TDBPRINTF(TDB_INFO,("Window Done\n"));
TLock(mod->fbd_Lock);
TRemove(&win->fbv_Node);
TUnlock(mod->fbd_Lock);
fb_closeall(mod, win, TTRUE);
}
示例2: dfb_hostopenfont
LOCAL TAPTR
dfb_hostopenfont(DFBDISPLAY *mod, TTAGITEM *tags)
{
struct fnt_attr fattr;
struct FontNode *fn;
TAPTR font = TNULL;
TAPTR exec = TGetExecBase(mod);
/* fetch user specified attributes */
fattr.fname = (TSTRPTR) TGetTag(tags, TVisual_FontName, (TTAG) FNT_DEFNAME);
fattr.fpxsize = (TINT) TGetTag(tags, TVisual_FontPxSize, (TTAG) FNT_DEFPXSIZE);
/* not yet
fattr.fitalic = (TBOOL) TGetTag(tags, TVisual_FontItalic, (TTAG) TFALSE);
fattr.fbold = (TBOOL) TGetTag(tags, TVisual_FontBold, (TTAG) TFALSE);
fattr.fscale = (TBOOL) TGetTag(tags, TVisual_FontScaleable, (TTAG) TFALSE);
*/
if (fattr.fname)
{
fn = TExecAlloc0(exec, mod->dfb_MemMgr, sizeof(struct FontNode));
if (fn)
{
fn->handle.thn_Owner = mod;
if (hostopenfont(mod, fn, &fattr))
{
/* load succeeded, save font attributes */
fn->pxsize = fattr.fpxsize;
fn->font->GetHeight(fn->font, &fn->height);
fn->font->GetAscender(fn->font, &fn->ascent);
fn->font->GetDescender(fn->font, &fn->descent);
/* not yet
if (fattr.fitalic)
fn->attr = FNT_ITALIC;
if (fattr.fbold)
fn->attr |= FNT_BOLD;
*/
/* append to the list of open fonts */
TDBPRINTF(TDB_INFO, ("O '%s' %dpx\n", fattr.fname, fattr.fpxsize));
TAddTail(&mod->dfb_fm.openfonts, &fn->handle.thn_Node);
font = (TAPTR)fn;
}
else
{
/* load failed, free fontnode */
TDBPRINTF(TDB_INFO,("X unable to load '%s'\n", fattr.fname));
TExecFree(exec, fn);
}
}
else
TDBPRINTF(TDB_FAIL,("out of memory :(\n"));
}
else
TDBPRINTF(TDB_ERROR,("X invalid fontname '%s' specified\n", fattr.fname));
return font;
}
示例3: hal_scanmodules
EXPORT TBOOL
hal_scanmodules(struct THALBase *hal, TSTRPTR path, struct THook *hook)
{
TSTRPTR p;
struct HALSpecific *hws = hal->hmb_Specific;
TBOOL success = TFALSE;
p = getmodpath(hws->hsp_ProgDir, "mod\\*.dll");
if (p)
{
TDBPRINTF(TDB_TRACE,("scanning %s\n", p));
success = scanpathtolist(hook, p, path);
free(p);
}
if (success)
{
p = getmodpath(hws->hsp_ModDir, "*.dll");
if (p)
{
TDBPRINTF(TDB_TRACE,("scanning %s\n", p));
success = scanpathtolist(hook, p, path);
free(p);
}
}
return success;
}
示例4: hostopenfont
static TBOOL
hostopenfont(DFBDISPLAY *mod, struct FontNode *fn, struct fnt_attr *fattr)
{
TBOOL succ = TFALSE;
TAPTR exec = TGetExecBase(mod);
DFBFontDescription fdsc;
TSTRPTR fontfile = TExecAlloc0(exec, mod->dfb_MemMgr,
strlen(fattr->fname) + strlen(FNT_DEFDIR) + 5);
if (fontfile)
{
fdsc.flags = DFDESC_HEIGHT;
fdsc.height = fattr->fpxsize;
sprintf(fontfile, "%s%s.ttf", FNT_DEFDIR, fattr->fname);
TDBPRINTF(TDB_INFO,("? %s:%d\n", fontfile, fattr->fpxsize));
if (mod->dfb_DFB->CreateFont(mod->dfb_DFB, fontfile,
&fdsc, &fn->font) == DFB_OK)
succ = TTRUE;
TExecFree(exec, fontfile);
}
else
TDBPRINTF(TDB_FAIL,("out of memory :(\n"));
return succ;
}
示例5: TGetExecBase
static struct rfb_FontQueryNode *fnt_getfqnode(struct rfb_Display *mod,
TSTRPTR filename, TINT pxsize)
{
struct rfb_FontQueryNode *fqnode = TNULL;
TAPTR TExecBase = TGetExecBase(mod);
/* allocate fquery node */
fqnode = TAlloc0(mod->rfb_MemMgr, sizeof(struct rfb_FontQueryNode));
if (fqnode)
{
/* fquerynode ready - fill in attributes */
TSTRPTR myfname = TNULL;
TINT flen = strlen(filename) - 4; /* discard '.ttf' */
if (flen > 0)
myfname = TAlloc0(mod->rfb_MemMgr, flen + 1);
else
TDBPRINTF(20, ("found invalid font: '%s'\n", filename));
if (myfname)
{
memcpy(myfname, filename, flen);
fqnode->tags[0].tti_Tag = TVisual_FontName;
fqnode->tags[0].tti_Value = (TTAG) myfname;
}
else
{
if (flen > 0)
TDBPRINTF(20, ("out of memory :(\n"));
}
if (fqnode->tags[0].tti_Value)
{
TINT i = 1;
fqnode->tags[i].tti_Tag = TVisual_FontPxSize;
fqnode->tags[i++].tti_Value = (TTAG) pxsize;
/* always true */
fqnode->tags[i].tti_Tag = TVisual_FontScaleable;
fqnode->tags[i++].tti_Value = (TTAG) TTRUE;
fqnode->tags[i].tti_Tag = TTAG_DONE;
}
else
{
TFree(fqnode);
fqnode = TNULL;
}
} /* endif fqnode */
else
TDBPRINTF(20, ("out of memory :(\n"));
return fqnode;
}
示例6: fnt_getfqnode
/* allocate a fontquerynode and fill in properties
*/
static struct FontQueryNode *
fnt_getfqnode(DFBDISPLAY *mod, TSTRPTR filename, TINT pxsize)
{
TAPTR exec = TGetExecBase(mod);
struct FontQueryNode *fqnode = TNULL;
/* allocate fquery node */
fqnode = TExecAlloc0(exec, mod->dfb_MemMgr, sizeof(struct FontQueryNode));
if (fqnode)
{
/* fquerynode ready - fill in attributes */
TSTRPTR myfname = TNULL;
TINT flen = strlen(filename)-4; /* discard '.ttf' */
if (flen > 0)
myfname = TExecAlloc0(exec, mod->dfb_MemMgr, flen + 1);
else
TDBPRINTF(TDB_ERROR,("found invalid font: '%s'\n", filename));
if (myfname)
{
TExecCopyMem(exec, filename, myfname, flen);
fqnode->tags[0].tti_Tag = TVisual_FontName;
fqnode->tags[0].tti_Value = (TTAG) myfname;
}
else
{
if (flen > 0)
TDBPRINTF(TDB_FAIL,("out of memory :(\n"));
}
if (fqnode->tags[0].tti_Value)
{
TINT i = 1;
fqnode->tags[i].tti_Tag = TVisual_FontPxSize;
fqnode->tags[i++].tti_Value = (TTAG) pxsize;
/* always true */
fqnode->tags[i].tti_Tag = TVisual_FontScaleable;
fqnode->tags[i++].tti_Value = (TTAG) TTRUE;
fqnode->tags[i].tti_Tag = TTAG_DONE;
}
else
{
TExecFree(exec, fqnode);
fqnode = TNULL;
}
} /* endif fqnode */
else
TDBPRINTF(TDB_FAIL,("out of memory :(\n"));
return fqnode;
}
示例7: dfb_hostqueryfonts
LOCAL TAPTR
dfb_hostqueryfonts(TMOD_DFB *mod, TTAGITEM *tags)
{
TSTRPTR fname = TNULL;
struct fnt_attr fattr;
struct TNode *node, *next;
struct FontQueryHandle *fqh = TNULL;
TAPTR exec = TGetExecBase(mod);
TDBPRINTF(10, ("***********************************************\n"));
/* init fontname list */
TInitList(&fattr.fnlist);
/* fetch and parse fname */
fname = (TSTRPTR) TGetTag(tags, TVisual_FontName, (TTAG) FNT_WILDCARD);
if (fname) fnt_getfnnodes(mod, &fattr.fnlist, fname);
/* fetch user specified attributes */
fattr.fpxsize = (TINT) TGetTag(tags, TVisual_FontPxSize, (TTAG) FNT_DEFPXSIZE);
fattr.fnum = (TINT) TGetTag(tags, TVisual_FontNumResults, (TTAG) INT_MAX);
/* not yet
fattr.fitalic = (TBOOL) TGetTag(tags, TVisual_FontItalic, (TTAG) FNTQUERY_UNDEFINED);
fattr.fbold = (TBOOL) TGetTag(tags, TVisual_FontBold, (TTAG) FNTQUERY_UNDEFINED);
*/
/* init result list */
fqh = TExecAlloc0(exec, mod->dfb_MemMgr, sizeof(struct FontQueryHandle));
if (fqh)
{
fqh->handle.thn_Owner = mod;
/* connect destructor */
TInitHook(&fqh->handle.thn_Hook, fqhdestroy, fqh);
TInitList(&fqh->reslist);
/* init list iterator */
fqh->nptr = &fqh->reslist.tlh_Head;
hostqueryfonts(mod, fqh, &fattr);
TDB(10,(fnt_dumplist(&fqh->reslist)));
TDBPRINTF(10, ("***********************************************\n"));
}
else
TDBPRINTF(20, ("out of memory :(\n"));
/* free memory of fnt_nodes */
for (node = fattr.fnlist.tlh_Head; (next = node->tln_Succ); node = next)
{
struct fnt_node *fnn = (struct fnt_node *)node;
TExecFree(exec, fnn->fname);
TRemove(&fnn->node);
TExecFree(exec, fnn);
}
return fqh;
}
示例8: fnt_dumpnode
/* dump properties of a fontquerynode
*/
static void
fnt_dumpnode(struct FontQueryNode *fqn)
{
TDBPRINTF(10, ("-----------------------------------------------\n"));
TDBPRINTF(10, ("dumping fontquerynode @ %p\n", fqn));
TDBPRINTF(10, (" * FontName: %s\n", (TSTRPTR)fqn->tags[0].tti_Value));
TDBPRINTF(10, (" * PxSize: %d\n", (TINT)fqn->tags[1].tti_Value));
//TDBPRINTF(10, (" * Italic: %s\n", (TBOOL)fqn->tags[2].tti_Value ? "on" : "off"));
//TDBPRINTF(10, (" * Bold: %s\n", (TBOOL)fqn->tags[3].tti_Value ? "on" : "off"));
TDBPRINTF(10, ("-----------------------------------------------\n"));
}
示例9: fb_getselection
LOCAL void
fb_getselection(WINDISPLAY *mod, struct TVRequest *req)
{
struct TExecBase *TExecBase = TGetExecBase(mod);
LPSTR utf8 = NULL;
int utf8Bytes = 0;
HANDLE clipData;
LPCWSTR utf16;
req->tvr_Op.GetSelection.Data = TNULL;
req->tvr_Op.GetSelection.Length = 0;
if (!IsClipboardFormatAvailable(CF_UNICODETEXT))
{
TDBPRINTF(TDB_WARN,(
"no 'CF_UNICODETEXT' Windows clipboard data available\n"));
return;
}
if (!OpenClipboard(mod->fbd_DeviceHWnd))
{
TDBPRINTF(TDB_WARN, ("cannot open Windows clipboard\n"));
return;
}
clipData = GetClipboardData(CF_UNICODETEXT);
if (clipData != NULL)
{
utf16 = GlobalLock(clipData);
utf8Bytes = WideCharToMultiByte(CP_UTF8, 0, utf16, -1,
NULL, 0, NULL, 0);
if (utf8Bytes != 0)
{
utf8 = (LPSTR) TAlloc(TNULL, utf8Bytes);
utf8Bytes = WideCharToMultiByte(CP_UTF8, 0, utf16, -1,
utf8, utf8Bytes, NULL, 0);
}
GlobalUnlock(clipData);
}
else
TDBPRINTF(TDB_WARN, ("no Windows clipboard data\n"));
CloseClipboard();
if (!utf8Bytes)
{
TFree(utf8);
TDBPRINTF(TDB_WARN, (
"failed encoding UTF-8 from Windows clipboard\n"));
return;
}
--utf8Bytes;
TDBPRINTF(TDB_TRACE,("get selection: N = %d S = '%s'\n", utf8Bytes, utf8));
req->tvr_Op.GetSelection.Data = utf8;
req->tvr_Op.GetSelection.Length = utf8Bytes;
}
示例10: tek_lib_display_dfb_close
static TCALLBACK TINT
tek_lib_display_dfb_close(lua_State *L)
{
TEKDisplay *display = luaL_checkudata(L, 1, TEK_LIB_DISPLAY_DFB_CLASSNAME);
TDBPRINTF(TDB_TRACE,("display %08x closing\n", display));
if (display->IsBase)
{
/* collected base; remove TEKlib module: */
TExecRemModules(display->ExecBase, &display->InitModules, 0);
TDBPRINTF(TDB_TRACE,("display module removed\n"));
}
return 0;
}
示例11: rfb_sendevent
LOCAL TINT rfb_sendevent(struct rfb_Display *mod, TUINT type, TUINT code,
TINT x, TINT y)
{
TIMSG *msg;
if (!rfb_getimsg(mod, TNULL, &msg, type))
return 0;
msg->timsg_Code = code;
msg->timsg_MouseX = x;
msg->timsg_MouseY = y;
TINT res = 1;
switch (type)
{
case TITYPE_MOUSEMOVE:
rfb_passevent_mousemove(mod, msg);
break;
case TITYPE_MOUSEBUTTON:
rfb_passevent_mousebutton(mod, msg);
break;
case TITYPE_KEYUP:
case TITYPE_KEYDOWN:
rfb_passevent_keyboard(mod, msg);
break;
default:
TDBPRINTF(TDB_ERROR, ("illegal message type\n"));
res = 0;
}
/* put back prototype message */
TAddTail(&mod->rfb_IMsgPool, &msg->timsg_Node);
return res;
}
示例12: dfb_closevisual
LOCAL void
dfb_closevisual(DFBDISPLAY *mod, struct TVRequest *req)
{
struct DFBPen *pen;
TAPTR exec = TGetExecBase(mod);
DFBWINDOW *v = req->tvr_Op.CloseWindow.Window;
if (v == TNULL) return;
TDBPRINTF(TDB_INFO,("Visual close\n"));
TRemove(&v->node);
if (mod->dfb_Focused == (TAPTR) v)
{
/* pass focus on to the next window */
DFBWINDOW *vt = (DFBWINDOW *)TFIRSTNODE(&mod->dfb_vlist);
if (vt) genimsg(mod, TNULL, vt, TITYPE_FOCUS);
mod->dfb_Focused = (TAPTR) vt;
}
if (mod->dfb_Active == (TAPTR) v)
mod->dfb_Active = TNULL;
while ((pen = (struct DFBPen *) TRemHead(&v->penlist)))
{
/* free pens */
TRemove(&pen->node);
TExecFree(mod->dfb_ExecBase, pen);
}
v->winsurface->Release(v->winsurface);
v->window->Release(v->window);
mod->dfb_fm.defref--;
TExecFree(exec, v);
}
示例13: fb_openfont
LOCAL void
fb_openfont(WINDISPLAY *mod, struct TVRequest *req)
{
req->tvr_Op.OpenFont.Font =
fb_hostopenfont(mod, req->tvr_Op.OpenFont.Tags);
TDBPRINTF(TDB_INFO,("font opened: %p\n", req->tvr_Op.OpenFont.Font));
}
示例14: exec_returnmsg
LOCAL void
exec_returnmsg(TEXECBASE *exec, TAPTR mem, TUINT status)
{
struct TMessage *msg = TGETMSGPTR(mem);
struct TMsgPort *replyport = msg->tmsg_RPort;
if (replyport)
{
TAPTR hal = exec->texb_HALBase;
THALLock(hal, &replyport->tmp_Lock);
TAddTail(&replyport->tmp_MsgList, (struct TNode *) msg);
msg->tmsg_Flags = status;
if (replyport->tmp_Hook)
TCALLHOOKPKT(replyport->tmp_Hook, replyport, (TTAG) msg);
THALUnlock(hal, &replyport->tmp_Lock);
THALSignal(hal, &replyport->tmp_SigTask->tsk_Thread,
replyport->tmp_Signal);
}
else
{
exec_Free(exec, mem); /* free one-way msg transparently */
TDBPRINTF(TDB_TRACE,("message returned to memory manager\n"));
}
}
示例15: exec_dispatch
static THOOKENTRY TTAG
exec_dispatch(struct THook *hook, TAPTR obj, TTAG msg)
{
struct TExecBase *TExecBase = hook->thk_Data;
switch (msg)
{
case TMSG_DESTROY:
THALDestroyLock(TExecBase->texb_HALBase, &TExecBase->texb_Lock);
TDESTROY(&TExecBase->texb_BaseMemManager);
TDESTROY(&TExecBase->texb_MsgMemManager);
break;
#if defined(ENABLE_EXEC_IFACE)
case TMSG_QUERYIFACE:
{
struct TInterfaceQuery *ifq = obj;
if (TStrEqual(ifq->tifq_Name, "exec") &&
ifq->tifq_Version >= 1)
return (TTAG) &TExecBase->texb_Exec1IFace;
return TNULL;
}
case TMSG_DROPIFACE:
TDBPRINTF(TDB_WARN,("drop interface: %p\n", obj));
break;
#endif
}
return 0;
}