Exemple #1
0
Shape::Shape(int size)
{
   _size = size;
   _col = new OSL_COLOR[size];

   setClass("Shape");
}
/// advance to the next instance in the stream. Return true iff successful. @param inst the instance record to receive the new instance. 
bool InstanceStreamClassFilter::advance(instance &inst) {
  if (!source_->advance(inst)) return false;

  setClass(inst, inst.getClass() == posClass_);

  return true;
}
Exemple #3
0
void c_Closure::init(int numArgs, ActRec* ar, TypedValue* sp) {
  auto const invokeFunc = getVMClass()->lookupMethod(s_uuinvoke.get());

  m_ctx = ar->m_this;
  if (ar->hasThis()) {
    if (invokeFunc->isStatic()) {
      // Only set the class for static closures.
      setClass(ar->getThis()->getVMClass());
    } else {
      ar->getThis()->incRefCount();
    }
  }

  /*
   * Copy the use vars to instance variables, and initialize any
   * instance properties that are for static locals to KindOfUninit.
   */
  auto const numDeclProperties = getVMClass()->numDeclProperties();
  assert(numDeclProperties - numArgs == getInvokeFunc()->numStaticLocals());
  TypedValue* beforeCurUseVar = sp + numArgs;
  TypedValue* curProperty = propVec();
  int i = 0;
  assert(numArgs <= numDeclProperties);
  for (; i < numArgs; i++) {
    // teleport the references in here so we don't incref
    tvCopy(*--beforeCurUseVar, *curProperty++);
  }
  for (; i < numDeclProperties; ++i) {
    tvWriteUninit(curProperty++);
  }
}
Exemple #4
0
Buffer::Buffer(Sprite &obj): shouldDelete(true) {
   setClass("Buffer");

   img = oslCreateImageCopy(obj.getImage(), OSL_IN_VRAM);
   if (!img)
      throw RubyException(rb_eRuntimeError, "Buffer could not be created");
}
Exemple #5
0
	void ToolConfig::switchClass(const QString & cls)
	{
		if(m_map["class"] != cls) {
			setClass(cls);
			emit(changed());
		}
	}
Exemple #6
0
Buffer::Buffer(const Buffer &obj): shouldDelete(true) {
   setClass("Buffer");

   img = oslCreateImageCopy(obj.img, OSL_IN_VRAM);
   if (!img)
      throw RubyException(rb_eRuntimeError, "Buffer could not be copied.");
}
Exemple #7
0
void c_Closure::init(int numArgs, ActRec* ar, TypedValue* sp) {
  auto const cls = getVMClass();
  auto const invokeFunc = getInvokeFunc();

  if (invokeFunc->cls()) {
    setThisOrClass(ar->getThisOrClass());
    if (invokeFunc->isStatic()) {
      if (!hasClass()) {
        setClass(getThisUnchecked()->getVMClass());
      }
    } else if (!hasClass()) {
      getThisUnchecked()->incRefCount();
    }
  } else {
    hdr()->ctx = nullptr;
  }

  /*
   * Copy the use vars to instance variables, and initialize any
   * instance properties that are for static locals to KindOfUninit.
   */
  auto const numDeclProperties = cls->numDeclProperties();
  assertx(numDeclProperties - numArgs == getInvokeFunc()->numStaticLocals());
  auto beforeCurUseVar = sp + numArgs;
  auto curProperty = getUseVars();
  int i = 0;
  assertx(numArgs <= numDeclProperties);
  for (; i < numArgs; i++) {
    // teleport the references in here so we don't incref
    tvCopy(*--beforeCurUseVar, *curProperty++);
  }
  for (; i < numDeclProperties; ++i) {
    tvWriteUninit(*curProperty++);
  }
}
Exemple #8
0
CCoordFrame::CCoordFrame(const char* name)
	: IDataGraph(name, true, true)
    , _pTextFormat(0)
    , _pTextLayout(0)
{
    _glyph_type = IGlyph::GLYPH_TYPE_BKG;
    setClass();
}
Exemple #9
0
Shape::Shape(const Shape &obj)
{
   _col = new OSL_COLOR[obj._size];
   _size = obj._size;
   for (int i = 0; i < _size; ++i)
      _col[i] = obj._col[i];

   setClass("Shape");
}
Exemple #10
0
CTickDataAtelier::CTickDataAtelier(const char* name)
    :   _canvasImgbkg(0)
    ,      _pvicanvas(0)
	,        _toolbar(0)
    ,_tickdata_canvas(0)
{
    strcpy_s(_name, MAX_WARMGUI_NAME_LEN, name);
    setClass();
}
Exemple #11
0
Drawable::Drawable()
{
   _x = 0;
   _y = 0;
   _w = 0;
   _h = 0;

   setClass("Drawable");
}
Exemple #12
0
void TotemSummon::Load(CreatureProto* proto, Unit* owner, LocationVector & position, uint32 spellid, int32 summonslot)
{
	Summon::Load(proto, owner, position, spellid, summonslot);

	TotemDisplayIdEntry* totemdisplay = TotemDisplayIdStorage.LookupEntry(creature_info->Male_DisplayID);
	uint32 displayID = 0;

	if(totemdisplay != NULL)
	{
		switch(owner->getRace())
		{
			case RACE_DRAENEI:
				displayID = totemdisplay->DraeneiId;
				break;

			case RACE_TROLL:
				displayID = totemdisplay->TrollId;
				break;

			case RACE_ORC:
				displayID = totemdisplay->OrcId;
				break;
		}
	}

	if(displayID == 0)
		displayID = creature_info->Male_DisplayID;

	// Set up the creature.
	SetMaxPower(POWER_TYPE_FOCUS, owner->getLevel() * 30);
	SetPower(POWER_TYPE_FOCUS, owner->getLevel() * 30);
	setLevel(owner->getLevel());
	setRace(0);
	setClass(1);
	setGender(2);
	SetPowerType(1);
	SetBaseAttackTime(MELEE, 2000);
	SetBaseAttackTime(OFFHAND, 2000);
	SetBoundingRadius(1.0f);
	SetCombatReach(1.0f);
	SetDisplayId(displayID);
	SetNativeDisplayId(creature_info->Male_DisplayID);
	SetCastSpeedMod(1.0f);
	SetUInt32Value(OBJECT_FIELD_DYNAMIC_FLAGS, 0);

	InheritSMMods(owner);

	for(uint8 school = 0; school < SCHOOL_COUNT; school++)
	{
		ModDamageDone[ school ] = owner->GetDamageDoneMod(school);
		HealDoneMod[ school ] = owner->HealDoneMod[ school ];
	}

	m_aiInterface->Init(this, AITYPE_TOTEM, MOVEMENTTYPE_NONE, owner);
	DisableAI();
}
Exemple #13
0
Buffer::Buffer(int w, int h, int format): shouldDelete(true) {
   setClass("Buffer");

   if (w > 512 || h > 512)
      throw RubyException(rb_eRuntimeError, 
			  "Either width or height is greter than 512.");

   img = oslCreateImage(w, h, OSL_IN_VRAM, format);
   if (!img)
      throw RubyException(rb_eRuntimeError, "Buffer could not be created.");
}
Exemple #14
0
CPVI_Canvas::CPVI_Canvas(const char* name)
    :  IDataCanvas(name)
    , _prc_chart(0)
    , _vol_chart(0)
    , _itr_chart(0)
    , _prc_graph_changed(GLYPH_CHANGED_TYPE_NONE)
    , _vol_graph_changed(GLYPH_CHANGED_TYPE_NONE)
    , _itr_graph_changed(GLYPH_CHANGED_TYPE_NONE)
    , _data_cont(0)
{
    setClass();
}
void JavaClassUtilsTest::initialize(JNIEnv *env) {
  setClass(env);
  addNativeMethod("findObjectClass", (void*)&findObjectClass, kTypeJavaClass(Class), NULL);
  addNativeMethod("findInvalidClass", (void*)&findInvalidClass, kTypeVoid, NULL);
  addNativeMethod("nativeFindClassWithLoader", (void*)&nativeFindClassWithLoader, kTypeJavaClass(Class), NULL);
  addNativeMethod("findInvalidClassWithLoader", (void*)&findInvalidClass, kTypeVoid, NULL);
  addNativeMethod("makeNameForSignatureWithNull", (void*)&makeNameForSignatureWithNull, kTypeVoid, NULL);
  addNativeMethod("makeNameForSignatureWithPrimitive", (void*)&makeNameForSignatureWithPrimitive, kTypeVoid, NULL);
  addNativeMethod("makeNameForSignatureWithArray", (void*)&makeNameForSignatureWithArray, kTypeVoid, NULL);
  addNativeMethod("makeNameForSignatureWithObject", (void*)&makeNameForSignatureWithObject, kTypeVoid, NULL);
  addNativeMethod("makeNameForSignatureWithJniSignature", (void*)&makeNameForSignatureWithJniSignature, kTypeVoid, NULL);
  addNativeMethod("makeNameForSignatureWithArrayOfObjects", (void*)&makeNameForSignatureWithArrayOfObjects, kTypeVoid, NULL);
  registerNativeMethods(env);
}
Exemple #16
0
void CRole::setSet(const unsigned char* charSet)
{
	setClass(charSet[CS_CLASS]);
	// ----
	setSkeleton();
	// ----
	setEquip(ET_HELM,	GET_CHAR_H(charSet[3]));
	setEquip(ET_ARMOR,	GET_CHAR_L(charSet[3]));
	setEquip(ET_GLOVE,	GET_CHAR_H(charSet[4]));
	setEquip(ET_PANT,	GET_CHAR_L(charSet[4]));
	setEquip(ET_BOOT,	GET_CHAR_H(charSet[5]));
	setEquip(ET_BACK,	GET_CHAR_L(charSet[5]));
	setEquip(ET_RIGHT,	charSet[1]);
	setEquip(ET_LEFT,	charSet[2]);
}
Exemple #17
0
Particles::Particles(const Particles &obj)
{
   setClass("Particles");

   _time = obj._time;
   _speed = obj._speed;
   _gravity = obj._gravity;
   _mspeed = obj._mspeed;
   setParam(_time, _speed, _gravity, _mspeed);

   char txt[256];
   strcpy(txt, obj.filename.c_str());

   setFile(txt);
}
Exemple #18
0
ViewerWindow::ViewerWindow(WindowsApplication *application,
	ConnectionData *conData,
	ConnectionConfig *conConf,
	Logger *logger)
	: m_ccsm(RegistryPaths::VIEWER_PATH,
	conData->getHost().getString()),
	m_application(application),
	m_logWriter(logger),
	m_conConf(conConf),
	m_scale(100),
	m_isFullScr(false),
	m_ftDialog(0),
	m_viewerCore(0),
	m_fileTransfer(0),
	m_remoteProcess(0),
	m_conData(conData),
	m_dsktWnd(&m_logWriter, conConf),
	m_isConnected(false),
	m_sizeIsChanged(false),
	m_hooksEnabledFirstTime(true),
	m_requiresReconnect(false),
	m_stopped(false)
{
	m_standardScale.push_back(10);
	m_standardScale.push_back(15);
	m_standardScale.push_back(25);
	m_standardScale.push_back(50);
	m_standardScale.push_back(75);
	m_standardScale.push_back(90);
	m_standardScale.push_back(100);
	m_standardScale.push_back(150);
	m_standardScale.push_back(200);
	m_standardScale.push_back(400);

	StringStorage windowClass = WindowNames::TVN_WINDOW_CLASS_NAME;
	StringStorage titleName = WindowNames::TVN_WINDOW_TITLE_NAME;
	StringStorage subTitleName = WindowNames::TVN_SUB_WINDOW_TITLE_NAME;

	setClass(&windowClass);
	createWindow(&titleName, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);

	m_dsktWnd.setClass(&windowClass);
	m_dsktWnd.createWindow(&subTitleName,
		WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CHILD,
		getHWnd());

	SetTimer(m_hWnd, TIMER_DESKTOP_STATE, TIMER_DESKTOP_STATE_DELAY, (TIMERPROC)NULL);
}
Exemple #19
0
void BBSDelegate<T>::receiveSegment(vector<T> arr, size_t onset){
    vector<T> seg;
    if(mockClassification()){
        seg = arr;
    } else {
        _segment->findSegment(&arr, onset, &seg);

    }
    
    if(_runSynchronized){
        // Single-threaded
        setClass(_lastOnsetIndex, _classification->query(&seg));
    } else {
        //TODO: multithreading
    }
}
Exemple #20
0
// Internal set type method
SubsystemType
SubsystemInfo::setType( const SubsystemInfoLookup *info,
                        const char *type_name )
{
    m_Type = info->getType();
    setClass( info );
    m_Info = info;
    if ( type_name != NULL ) {
        m_TypeName = type_name;
    }
    else {
        m_TypeName = info->getTypeName();
    }

    return m_Type;
}
void JavaStringArrayTest::initialize(JNIEnv *env) {
  setClass(env);

  addNativeMethod("createNewJavaStringArray", (void*)createNewJavaStringArray, kTypeVoid, NULL);
  addNativeMethod("createNewJavaStringArrayWithData", (void*)createNewJavaStringArrayWithData, kTypeVoid, NULL);
  addNativeMethod("createNewJavaStringArrayWithDataCopy", (void*)createNewJavaStringArrayWithData, kTypeVoid, NULL);
  addNativeMethod("nativeCreateNewJavaStringArrayWithJavaData", (void*)nativeCreateNewJavaStringArrayWithJavaData, kTypeVoid, kTypeObjectArray(kTypeString), NULL);
  addNativeMethod("createNewJavaStringArrayWithNull", (void*)createNewJavaStringArrayWithNull, kTypeVoid, NULL);
  addNativeMethod("createNewJavaStringArrayWithNullAndNonZeroLength", (void*)createNewJavaStringArrayWithNullAndNonZeroLength, kTypeVoid, NULL);
  addNativeMethod("nativeGetTestJavaStringArray", (void*)nativeGetTestJavaStringArray, kTypeObjectArray(kTypeString), NULL);
  addNativeMethod("setData", (void*)setData, kTypeVoid, NULL);
  addNativeMethod("setDataWithCopy", (void*)setData, kTypeVoid, NULL);
  addNativeMethod("nativeSetJavaStringArray", (void*)nativeSetJavaStringArray, kTypeVoid, kTypeObjectArray(kTypeString), kTypeInt, NULL);

  registerNativeMethods(env);
}
Exemple #22
0
CEuclidCanvas::CEuclidCanvas(const char* name)
    : IDataCanvas(name)
    , _bHasBackground(true)
    , _blind(0)
    , _prc_chart    (0)
    , _approx_short_lo (0)
    , _approx_short_he (0)
    , _approx_long_lo  (0)
    , _approx_long_he  (0)
    , _predict_short_lo(0)
    , _predict_short_he(0)
    , _predict_long_lo (0)
    , _predict_long_he (0)
    , _data_cont(0)
{
    setClass();
}
void NativeObjectTest::initialize(JNIEnv *env) {
  setClass(env);

  PersistedObject persistedObject;
  const char* persistedObjectName = persistedObject.getCanonicalName();

  addNativeMethod("createPersistedObject", (void*)&createPersistedObject, persistedObjectName, NULL);
  addNativeMethod("getPersistedInstance", (void*)&getPersistedInstance, persistedObjectName, persistedObjectName, NULL);
  addNativeMethod("nativeIsPersistenceEnabled", (void*)nativeIsPersistenceEnabled, kTypeVoid, NULL);
  addNativeMethod("isPersistenceEnabledWithoutInit", (void*)isPersistenceEnabledWithoutInit, kTypeVoid, NULL);
  addNativeMethod("destroyPersistedObject", (void*)&destroyPersistedObject, kTypeVoid, persistedObjectName, NULL);
  addNativeMethod("persistInvalidClass", (void*)&persistInvalidClass, kTypeVoid, NULL);
  addNativeMethod("persistNullObject", (void*)&persistNullObject, kTypeVoid, NULL);
  addNativeMethod("destroyInvalidClass", (void*)&destroyInvalidClass, kTypeVoid, NULL);
  addNativeMethod("destroyNullObject", (void*)&destroyNullObject, kTypeVoid, NULL);

  registerNativeMethods(env);
}
Exemple #24
0
Buffer::Buffer(OSL_IMAGE *arg, bool copy): img(arg) {
   shouldDelete = copy;
  
   if (copy) {
      img = oslCreateImageCopy(arg, OSL_IN_VRAM);
      if (!img) {
	 img = oslCreateImageCopy(arg, OSL_IN_RAM);
	 if (!img)
	    throw RubyException(rb_eRuntimeError, "Buffer could not be copied.");
      }
      else {
	 Buffer::registerInVram(img);
      }
   }
   else
      img = arg;

   setClass("Buffer"); 
}
void JavaStringTest::initialize(JNIEnv *env) {
  setClass(env);

  addNativeMethod("supportsRawStringLiterals", (void*)supportsRawStringLiterals, kTypeBool, NULL);

  addNativeMethod("createJavaString", (void*)createJavaString, kTypeVoid, NULL);
  addNativeMethod("createJavaStringFromStdString", (void*)createJavaStringFromStdString, kTypeVoid, NULL);
  addNativeMethod("nativeCreateJavaStringFromJavaString", (void*)nativeCreateJavaStringFromJavaString, kTypeVoid, kTypeString, NULL);

  addNativeMethod("nativeGetJavaString", (void*)nativeGetJavaString, kTypeString, NULL);
  addNativeMethod("nativeGetJavaStringWithNullChar", (void*)nativeGetJavaStringWithNullChar, kTypeString, NULL);
  addNativeMethod("nativeGetJavaStringUtf16", (void*)nativeGetJavaStringUtf16, kTypeString, NULL);
  addNativeMethod("nativeGetJavaStringUtf8", (void*)nativeGetJavaStringUtf8, kTypeString, NULL);

  addNativeMethod("nativeSetValue", (void*)nativeSetValue, kTypeVoid, kTypeString, NULL);
  addNativeMethod("nativeSetValueWithOperator", (void*)nativeSetValueWithOperator, kTypeVoid, NULL);
  addNativeMethod("nativeSetAndReturnValue", (void*)nativeSetAndReturnValue, kTypeString, kTypeString, NULL);

  registerNativeMethods(env);
}
Exemple #26
0
Buffer::Buffer(Drawable &obj): shouldDelete(true) {
   setClass("Buffer");

   if (obj.getW() > 512 || obj.getH() > 512)
      throw RubyException(rb_eRuntimeError, "Drawable too big for a buffer.");
   
   img = oslCreateImage(obj.getW(), obj.getH(), OSL_IN_VRAM, OSL_PF_8888);
   if (!img)
      throw RubyException(rb_eRuntimeError, "Buffer could not be created");
   
   OSL_IMAGE *old = oslGetDrawBuffer();
   setActual();

   obj.clearMove();
   obj.setPos(0, 0);
   obj.draw();
   obj.cancelMove();

   oslSetDrawBuffer(old);
}
Exemple #27
0
 FillableShape(int size = 1):
    Shape(size), filled(true)
 { setClass("FillableShape"); }
Exemple #28
0
Buffer::Buffer(const Buffer &obj): shouldDelete(true) {
   setClass("Buffer");
   createFromBuffer(obj);
}
Exemple #29
0
Buffer::Buffer(Drawable &obj): shouldDelete(true) {
   setClass("Buffer");
   createFromDrawable(obj);
}
Exemple #30
0
 Scrolling() {
     setClass("Scrolling");
 }