本文整理汇总了C++中NewObject函数的典型用法代码示例。如果您正苦于以下问题:C++ NewObject函数的具体用法?C++ NewObject怎么用?C++ NewObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewObject函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: piGetAttr
struct Gadget *CreateAllGadgets(piObject *o)
{
struct Gadget *g=NULL;
piObject *go;
struct Node_Window *nw;
piGetAttr(o,OBJ_Node,(ULONG *)&nw);
nw->nw_Gadgets=NULL;
if(nw->nw_PageGadget==0 && GUI.gui_Mode==MODE_TEST)
{
if(nw->nw_MyFlags&MYWA_BBottomSlider)
{
g=CreateContext(&nw->nw_Gadgets);
unless(nw->nw_Object[0]=NewObject(NULL, BUTTONGCLASS,
// ICA_TARGET, ICTARGET_IDCMP,
GA_RelVerify,TRUE,
GA_Image, gui_LeftImage,
GA_RelRight, 1-(IM_WIDTH(gui_LeftImage)+IM_WIDTH(gui_SizeImage)+IM_WIDTH(gui_RightImage)),
GA_RelBottom, 1-(IM_HEIGHT(gui_LeftImage)),
GA_BottomBorder,TRUE,
GA_Previous,(ULONG *)g,
(nw->nw_Flags&WFLG_GIMMEZEROZERO) ? GA_GZZGadget : TAG_IGNORE,TRUE,
GA_ID, GD_LEFTBUTTON,
TAG_DONE)) return NULL;
g=(struct Gadget *)nw->nw_Object[0];
unless(nw->nw_Object[1]=NewObject(NULL, BUTTONGCLASS,
// ICA_TARGET, ICTARGET_IDCMP,
GA_RelVerify,TRUE,
GA_Image, gui_RightImage,
GA_RelRight, 1-(IM_WIDTH(gui_RightImage)+IM_WIDTH(gui_SizeImage)),
GA_RelBottom, 1-(IM_HEIGHT(gui_RightImage)),
GA_BottomBorder,TRUE,
GA_Previous,(ULONG *)g,
(nw->nw_Flags&WFLG_GIMMEZEROZERO) ? GA_GZZGadget : TAG_IGNORE,TRUE,
GA_ID, GD_RIGHTBUTTON,
TAG_DONE)) return NULL;
g=(struct Gadget *)nw->nw_Object[1];
unless(nw->nw_Object[2]=NewObject(NULL, PROPGCLASS,
// ICA_TARGET, ICTARGET_IDCMP,
GA_RelVerify,TRUE,
PGA_Freedom, FREEHORIZ,
PGA_NewLook, TRUE,
PGA_Borderless, ((DrawInfo->dri_Flags & DRIF_NEWLOOK) && DrawInfo->dri_Depth != 1),
GA_Left, 3,
GA_RelBottom, -(IM_HEIGHT(gui_SizeImage)-3),
GA_RelWidth, -(4+IM_WIDTH(gui_LeftImage)+IM_WIDTH(gui_RightImage)+IM_WIDTH(gui_SizeImage)+1),
GA_Height, IM_HEIGHT(gui_SizeImage)-4,
GA_BottomBorder, TRUE,
GA_Previous,(ULONG *)g,
(nw->nw_Flags&WFLG_GIMMEZEROZERO) ? GA_GZZGadget : TAG_IGNORE,TRUE,
GA_ID, GD_HORIZBUTTON,
PGA_Total, 1,
PGA_Visible, 1,
TAG_DONE)) return NULL;
g=(struct Gadget *)nw->nw_Object[2];
}
else
{
开发者ID:thom-ek,项目名称:GadToolsBox,代码行数:59,代码来源:gadget.c
示例2: DispatchScrollerNew
BOOL PRIVATE DispatchScrollerNew(struct ClassBase *cb,struct ScrollerGData *sd,struct Gadget *gad,struct opSet *ops)
{
static struct TagItem upmap[] = {{GA_ID,SGA_Up},{TAG_END}};
static struct TagItem downmap[] = {{GA_ID,SGA_Down},{TAG_END}};
struct Gadget *previous;
long x,y,w,h;
if (!(previous = (struct Gadget *)GetTagData(GA_Previous,0,ops->ops_AttrList)))
return(FALSE);
sd->sd_ItemHeight = GetTagData(SGA_ItemHeight,13,ops->ops_AttrList);
if (!(sd->sd_DownImage = NewObject(cb->cb_ArrowClass,NULL,IA_Width, gad->Width,
IA_Height, sd->sd_ItemHeight,
SYSIA_Which, ADT_DOWN,
TAG_END)))
return(FALSE);
if (!(sd->sd_UpImage = NewObject(cb->cb_ArrowClass,NULL,IA_Width, gad->Width,
IA_Height, sd->sd_ItemHeight,
SYSIA_Which, ADT_UP,
TAG_END)))
return(FALSE);
if (!(sd->sd_Frame = NewObject(NULL,"frameiclass",IA_Left, gad->LeftEdge,
IA_Top, gad->TopEdge,
IA_Width, gad->Width,
IA_Height, gad->Height-(h = sd->sd_UpImage->Height)*2,
IA_FrameType, FRAME_BUTTON,
TAG_END)))
return(FALSE);
if (!(sd->sd_Up = NewObject(NULL,"buttongclass",GA_ID, 1,
GA_Left, x = gad->LeftEdge,
GA_Top, y = gad->TopEdge+gad->Height-h*2,
GA_Width, w = sd->sd_UpImage->Width,
GA_Height, h,
GA_Image, sd->sd_UpImage,
GA_Previous, previous,
ICA_TARGET, gad,
ICA_MAP, upmap,
TAG_END)))
return(FALSE);
if (!(sd->sd_Down = NewObject(NULL,"buttongclass",GA_ID, 1,
GA_Left, x,
GA_Top, y+h,
GA_Width, w,
GA_Height, h,
GA_Image, sd->sd_DownImage,
GA_Previous, sd->sd_Up,
ICA_TARGET, gad,
ICA_MAP, downmap,
TAG_END)))
return(FALSE);
sd->sd_Down->NextGadget = gad;
return(TRUE);
}
开发者ID:BackupTheBerlios,项目名称:ignition-svn,代码行数:53,代码来源:Scroller.c
示例3: SetupSelectPointer
///
/// SetupSelectPointer()
void SetupSelectPointer(struct InstData *data)
{
ENTER();
#if defined(__amigaos4__)
if(LIB_VERSION_IS_AT_LEAST(IntuitionBase, 53, 40))
data->PointerObj = (APTR)POINTERTYPE_TEXT;
#elif defined(__MORPHOS__)
if(IS_MORPHOS2)
data->PointerObj = (APTR)POINTERTYPE_SELECTTEXT;
#endif
if(data->PointerObj == NULL)
{
#if defined(__amigaos4__)
data->PointerObj = (Object *)NewObject(NULL, "pointerclass",
POINTERA_ImageData, selectPointer,
POINTERA_Width, selectPointerWidth,
POINTERA_Height, selectPointerHeight,
POINTERA_BitMap, &selectPointerBitmap,
POINTERA_WordWidth, (ULONG)1,
POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES,
POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT,
POINTERA_XOffset, (LONG)selectPointerXOffset,
POINTERA_YOffset, (LONG)selectPointerYOffset,
TAG_DONE);
#else
if(LIB_VERSION_IS_AT_LEAST(IntuitionBase, 39, 0))
{
data->PointerObj = (Object *)NewObject(NULL, (STRPTR)"pointerclass",
POINTERA_BitMap, (SIPTR)&selectPointerBitmap,
POINTERA_WordWidth, (ULONG)1,
POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES,
POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT,
POINTERA_XOffset, (LONG)selectPointerXOffset,
POINTERA_YOffset, (LONG)selectPointerYOffset,
TAG_DONE);
}
else
{
if((data->PointerObj = (Object *)AllocVec(sizeof(selectPointer), MEMF_CHIP|MEMF_PUBLIC)) != NULL)
memcpy(data->PointerObj, selectPointer, sizeof(selectPointer));
}
#endif
}
data->activeSelectPointer = FALSE;
LEAVE();
}
开发者ID:amiga-mui,项目名称:texteditor,代码行数:52,代码来源:Pointer.c
示例4: PushDict
Object* PushDict(VM* vm)
{
Object* obj = NewObject(vm, OBJ_DICT);
InitDict(&obj->dict);
PushObject(vm, obj);
return obj;
}
开发者ID:nexusj,项目名称:mint-lang,代码行数:7,代码来源:vm.c
示例5: IntervalList_new
IntervalList * IntervalList_new ()
{
IntervalList * temp=NewObject(IntervalList);
temp->head=NULL;
temp->length=0;
}
开发者ID:dudfoKim,项目名称:Algorithm,代码行数:7,代码来源:IntervalList.c
示例6: ArrayListIter_new
ArrayListIter * ArrayListIter_new (ArrayList * list)
{
ArrayListIter * _this=NewObject(ArrayListIter);
_this->list=list;
return _this;
}
开发者ID:dudfoKim,项目名称:Algorithm,代码行数:7,代码来源:ArrayListIter.c
示例7: TAPEDECK_CREATE_Gadget
ULONG TAPEDECK_CREATE_Gadget(piClass *cl,piObject *o,struct piWindow *msg)
{
struct TagItem *ti;
struct Node_Gadget *ng;
struct Node_Window *nw;
WORD x,y,w,h;
piGetAttr(o,GAOBJ_Tags,(ULONG *)&ti);
piGetAttr(o,OBJ_Node,(ULONG *)&ng);
piGetAttr(ng->ng_Window,OBJ_Node,(ULONG *)&nw);
if(ng->ng_RelX) x=-(nw->nw_Window->Width-nw->nw_Window->BorderLeft-ng->ng_X-1);
else x=piCX(o);
if(ng->ng_RelY) y=-(nw->nw_Window->Height-nw->nw_Window->BorderTop-ng->ng_Y-1);
else y=piCY(o);
if(ng->ng_RelWidth) w=-(nw->nw_Window->BorderLeft+nw->nw_Window->BorderRight+(nw->nw_Window->Width-nw->nw_Window->BorderLeft-nw->nw_Window->BorderRight-ng->ng_Width)-1);
else w=piCW(o)+1;
if(ng->ng_RelHeight) h=-(nw->nw_Window->BorderTop+nw->nw_Window->BorderBottom+(nw->nw_Window->Height-nw->nw_Window->BorderTop-nw->nw_Window->BorderBottom-ng->ng_Height)-1);
else h=piCH(o)+1;
return (ULONG) (ng->ng_Gadget=NewObject(NULL, "tapedeck.gadget",
ng->ng_RelX?GA_RelRight:GA_Left,x,
ng->ng_RelY?GA_RelBottom:GA_Top,y,
ng->ng_RelWidth?GA_RelWidth:GA_Width,w,
ng->ng_RelHeight?GA_RelHeight:GA_Height,h,
(msg->Window) ? GA_Previous : TAG_IGNORE, msg->Window,
GA_ID,0,
TAG_MORE,ti));
}
开发者ID:thom-ek,项目名称:GadToolsBox,代码行数:29,代码来源:tapedeck.c
示例8:
/**************************************************************************
*
* Called first to create an empty blob object with a given threshold.
* Elements are added by calling Ray_BlobAddSphere(),
* Ray_BlobAddCylinder() and Ray_BlobAddPlane() one or more times on this
* object. When the object is finished Ray_BlobFinish() is called to
* perform any needed post-processing and validation.
*
**************************************************************************/
Object *Ray_MakeBlob(double threshold)
{
Object *obj;
BlobData *blob;
if((obj = NewObject()) == NULL)
return NULL;
/* Allocate the main blob data structure... */
if((blob = (BlobData *)Malloc(sizeof(BlobData))) == NULL)
{
Ray_DeleteObject(obj);
return NULL;
}
blob->nrefs = 1;
blob->threshold = threshold;
blob->solver = 0;
blob->bound = NULL;
blob->elems = NULL;
obj->data.blob = blob;
obj->procs = &blob_procs;
return obj;
}
开发者ID:oleavitt,项目名称:gem,代码行数:34,代码来源:Blob.c
示例9: warn_user
void warn_user(const char *warning, const char *detail)
{
Object *req = NULL;
char *utf8warning = ami_utf8_easy(messages_get(warning));
STRPTR bodytext = NULL;
LOG(("%s %s", warning, detail));
bodytext = ASPrintf("\33b%s\33n\n%s",
utf8warning != NULL ? utf8warning : warning, detail);
req = NewObject(REQUESTER_GetClass(), NULL,
REQ_Type, REQTYPE_INFO,
REQ_TitleText, messages_get("NetSurf"),
REQ_BodyText, bodytext,
REQ_GadgetText, messages_get("OK"),
#ifdef __amigaos4__
REQ_VarArgs,
REQ_Image, (struct Image *)REQIMAGE_WARNING,
/* REQ_CharSet, 106, */
#endif
TAG_DONE);
if (req) {
LONG result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
DisposeObject(req);
}
if(bodytext) FreeVec(bodytext);
if(utf8warning) free(utf8warning);
}
开发者ID:Achal-Aggarwal,项目名称:netsurf,代码行数:31,代码来源:misc.c
示例10: while
void FolderSuggestionProvider::run()
{
while (true)
{
m_work.pass();
m_lock.await();
m_bReset = false;
UTF16 sPrefix = m_sPrefix;
int iSuggestionsRequired = m_iSuggestionsRequired;
m_lock.release();
HFolderSuggestionList hList = NewObject(FolderSuggestionList);
listPathCompletions(sPrefix, (*hList), iSuggestionsRequired);
Synchronizer sync(m_lock);
if (m_bShutdown)
break;
if (m_bReset)
continue;
TreeSet<Listener*>::Iterator it(m_pListeners);
Listener* pListener;
while (it(pListener))
{
TaskTracker::instance()->add(buildFunctionTask(notifySuggestions, pListener, hList), TaskTracker::eMainThread);
}
}
}
开发者ID:tomazos,项目名称:Folderscope,代码行数:32,代码来源:FolderSuggestionProvider.cpp
示例11: DefineGlobal
Value Interpreter::MakeGlobal(const char * name)
{
int index = DefineGlobal(String(name));
Value global = NewObject(mObject, name);
SetGlobal(index, global);
return global;
}
开发者ID:Bobhostern,项目名称:finch,代码行数:7,代码来源:Interpreter.cpp
示例12: quote
Object* quote(){
Object* r;
r = NewObject(Object);
r->fProc = NULL;
r->fOne.uObject = NULL;
r->fName = "quote";
return r;
}
开发者ID:bgnori,项目名称:unlambda,代码行数:8,代码来源:unlambda.c
示例13: _constant_function
Object* _constant_function(Object* self, Object* other){
Object* k1;
k1 = NewObject(Object);
k1->fProc = _k1;
k1->fName = "k1";
k1->fOne.uObject = other;
return k1;
}
开发者ID:bgnori,项目名称:unlambda,代码行数:8,代码来源:unlambda.c
示例14: identity
Object* identity(void){
Object* r;
r = NewObject(Object);
r->fProc = &_identity;
r->fOne.uObject = NULL;
r->fName = "identity";
return r;
}
开发者ID:bgnori,项目名称:unlambda,代码行数:8,代码来源:unlambda.c
示例15: print
Object* print(char x){
Object* r;
r = NewObject(Object);
r->fProc = &_print;
r->fOne.uChar = x;
r->fName = "print";
return r;
}
开发者ID:bgnori,项目名称:unlambda,代码行数:8,代码来源:unlambda.c
示例16: PushNative
void PushNative(VM* vm, void* value, void (*onFree)(void*), void (*onMark)())
{
Object* obj = NewObject(vm, OBJ_NATIVE);
obj->native.value = value;
obj->native.onFree = onFree;
obj->native.onMark = onMark;
PushObject(vm, obj);
}
开发者ID:nexusj,项目名称:mint-lang,代码行数:8,代码来源:vm.c
示例17: NewUnlambdaEval
UnlambdaEval* NewUnlambdaEval(World* world){
UnlambdaEval* ue;
ue = NewObject(UnlambdaEval);
ue->fBase.fOne.uObject = (Object*)World_getMemory(world);
ue->fBase.fTwo.uObject = (Object*)NewStack();
return ue;
}
开发者ID:bgnori,项目名称:unlambda,代码行数:8,代码来源:unlambda.c
示例18: PushString
void PushString(VM* vm, const char* string)
{
Object* obj = NewObject(vm, OBJ_STRING);
obj->string.raw = estrdup(string);
PushObject(vm, obj);
}
开发者ID:nexusj,项目名称:mint-lang,代码行数:8,代码来源:vm.c
示例19: buf
UTF8 JSON::generate(Error& error) const
{
Buffer buf(0);
HOutputStream out = NewObject(MemoryOutputStream, buf);
generate(error, out);
out->twrite(error,'\0');
return UTF8(Blob(buf));
}
开发者ID:tomazos,项目名称:Folderscope,代码行数:8,代码来源:JSON.cpp
示例20: RawDoFmt
Object *CreateGUI(struct IClass *cl, Object *obj, struct ObjStore *os, struct DnetcLibrary *LibBase)
{
UBYTE about[512];
ULONG array[] =
{
(ULONG) LibBase->Version,
LibBase->Library.lib_Version,
LibBase->Library.lib_Revision
};
//#define SysBase LibBase->MySysBase
RawDoFmt(
"\33cdistributed.net client - a product of distributed.net\n"
"%s\n"
"Copyright 1997-2011 distributed.net\n"
"\n"
"\n"
"MorphOS client maintained by\n"
"Harry Sintonen\n"
"<[email protected]>\n"
"\n"
"\n"
"MUI GUI module (v%ld.%ld) maintained by\n"
"Ilkka Lehtoranta\n"
"<[email protected]>",
array, NULL, about);
//#undef SysBase
return (Object*)DoSuperNew(cl, obj,
MUIA_Application_DiskObject, (IPTR)LibBase->dobj,
MUIA_Application_Commands, (IPTR)commands,
MUIA_Application_Version, (IPTR)&VerString[1],
MUIA_Application_Copyright, (IPTR)"distributed.net",
MUIA_Application_Author, (IPTR)"Ilkka Lehtoranta",
MUIA_Application_Base, (IPTR)"DNETC",
MUIA_Application_UsedClasses, (IPTR)ClassList,
MUIA_Application_Title, (IPTR)"dnetc",
MUIA_Application_Description, (IPTR)"GUI for distributed.net client",
MUIA_Application_Window, (IPTR)(os->wnd = MUI_NewObject(MUIC_Window,
MUIA_Window_Title, (IPTR)"distributed.net client",
MUIA_Window_ID, MAKE_ID('M','A','I','N'),
MUIA_Window_Width, MUIV_Window_Width_Visible(55),
MUIA_Window_Height, MUIV_Window_Height_Visible(45),
MUIA_Window_Menustrip, (IPTR)MUI_MakeObject(MUIO_MenustripNM, (IPTR)&Menus, 0),
MUIA_Window_RootObject, (IPTR)MUI_NewObject(MUIC_Group,
MUIA_Group_Child, (IPTR)(os->lst = NewObject(LibBase->ListMCC->mcc_Class, NULL,
MUIA_Background, MUII_ReadListBack,
MUIA_Frame, MUIV_Frame_ReadList,
MUIA_CycleChain, TRUE,
TAG_END)),
TAG_END),
TAG_END)),
MUIA_Application_Window, (IPTR)(os->req = MUI_NewObject(MUIC_Aboutbox,
MUIA_Aboutbox_Credits, (IPTR)about,
TAG_END)),
TAG_END);
}
开发者ID:bovine,项目名称:dnetc-client-base,代码行数:57,代码来源:CreateGUI.c
注:本文中的NewObject函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论