本文整理汇总了C++中NewObject函数的典型用法代码示例。如果您正苦于以下问题:C++ NewObject函数的具体用法?C++ NewObject怎么用?C++ NewObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
{
示例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);
}
示例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();
}
示例4: PushDict
Object* PushDict(VM* vm)
{
Object* obj = NewObject(vm, OBJ_DICT);
InitDict(&obj->dict);
PushObject(vm, obj);
return obj;
}
示例5: IntervalList_new
IntervalList * IntervalList_new ()
{
IntervalList * temp=NewObject(IntervalList);
temp->head=NULL;
temp->length=0;
}
示例6: ArrayListIter_new
ArrayListIter * ArrayListIter_new (ArrayList * list)
{
ArrayListIter * _this=NewObject(ArrayListIter);
_this->list=list;
return _this;
}
示例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));
}
示例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;
}
示例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);
}
示例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);
}
}
}
示例11: DefineGlobal
Value Interpreter::MakeGlobal(const char * name)
{
int index = DefineGlobal(String(name));
Value global = NewObject(mObject, name);
SetGlobal(index, global);
return global;
}
示例12: quote
Object* quote(){
Object* r;
r = NewObject(Object);
r->fProc = NULL;
r->fOne.uObject = NULL;
r->fName = "quote";
return r;
}
示例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;
}
示例14: identity
Object* identity(void){
Object* r;
r = NewObject(Object);
r->fProc = &_identity;
r->fOne.uObject = NULL;
r->fName = "identity";
return r;
}
示例15: print
Object* print(char x){
Object* r;
r = NewObject(Object);
r->fProc = &_print;
r->fOne.uChar = x;
r->fName = "print";
return r;
}