当前位置: 首页>>代码示例>>C++>>正文


C++ THIS函数代码示例

本文整理汇总了C++中THIS函数的典型用法代码示例。如果您正苦于以下问题:C++ THIS函数的具体用法?C++ THIS怎么用?C++ THIS使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了THIS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Java_org_jsfml_graphics_Text_nativeSetExPtr

/*
 * Class:     org_jsfml_graphics_Text
 * Method:    nativeSetExPtr
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_org_jsfml_graphics_Text_nativeSetExPtr (JNIEnv *env, jobject obj) {
    JSFML::NativeObject::SetExPointer(env, obj, org_jsfml_internal_ExPtr_DRAWABLE,
        dynamic_cast<sf::Drawable*>(THIS(sf::Text)));

    JSFML::NativeObject::SetExPointer(env, obj, org_jsfml_internal_ExPtr_TRANSFORMABLE,
        dynamic_cast<sf::Transformable*>(THIS(sf::Text)));
}
开发者ID:GyrosOfWar,项目名称:JSFML,代码行数:12,代码来源:org_jsfml_graphics_Text.cpp

示例2: Java_sfml_graphics_RectangleShape_nativeSetExPtr

/*
 * Class:     sfml_graphics_RectangleShape
 * Method:    nativeSetExPtr
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_sfml_graphics_RectangleShape_nativeSetExPtr (JNIEnv *env, jobject obj) {
    JSFML::NativeObject::SetExPointer(env, obj, sfml_internal_ExPtr_DRAWABLE,
        dynamic_cast<sf::Drawable*>(THIS(sf::RectangleShape)));

    JSFML::NativeObject::SetExPointer(env, obj, sfml_internal_ExPtr_TRANSFORMABLE,
        dynamic_cast<sf::Transformable*>(THIS(sf::RectangleShape)));

    JSFML::NativeObject::SetExPointer(env, obj, sfml_internal_ExPtr_SHAPE,
        dynamic_cast<sf::Shape*>(THIS(sf::RectangleShape)));
}
开发者ID:Sonkun,项目名称:JSFML,代码行数:15,代码来源:sfml_graphics_RectangleShape.cpp

示例3:

/*
 * Class:     org_jsfml_graphics_RenderTexture
 * Method:    nativeMapCoordsToPixel
 * Signature: (JLorg/jsfml/graphics/ConstView;)J
 */
JNIEXPORT jlong JNICALL Java_org_jsfml_graphics_RenderTexture_nativeMapCoordsToPixel
    (JNIEnv *env, jobject obj, jlong point, jobject view) {

    return JSFML::Intercom::encodeVector2i(THIS(sf::RenderTexture)->mapCoordsToPixel(
            JSFML::Intercom::decodeVector2f(point),
            *JSFML::NativeObject::GetPointer<sf::View>(env, view)));
}
开发者ID:GyrosOfWar,项目名称:JSFML,代码行数:12,代码来源:org_jsfml_graphics_RenderTexture.cpp

示例4: ustrenum_next

/**
 * Wrapper API to make StringEnumeration look like UEnumeration.
 */
static const char* U_CALLCONV
ustrenum_next(UEnumeration* en,
              int32_t* resultLength,
              UErrorCode* ec)
{
    return THIS(en)->next(resultLength, *ec);
}
开发者ID:00zhengfu00,项目名称:third_party,代码行数:10,代码来源:ustrenum.cpp

示例5: rdpsnd_ios_monitor_cb

static OSStatus rdpsnd_ios_monitor_cb(
				      void *inRefCon,
				      AudioUnitRenderActionFlags *ioActionFlags,
				      const AudioTimeStamp *inTimeStamp,
				      UInt32 inBusNumber,
				      UInt32 inNumberFrames,
				      AudioBufferList *ioData
				      )
{
	
	rdpsndIOSPlugin *p = THIS(inRefCon);
	
	//if ( *ioActionFlags == kAudioUnitRenderAction_PostRender )
	if ( *ioActionFlags == kAudioUnitRenderAction_PostRender )
	{
		
		
		/*
		 printf("postRender Bus: %d inTimeStamp: %llu flags(%d) Frames: %d Buffers: %d\n",
		 (unsigned int)inBusNumber,
		 inTimeStamp->mHostTime,
		 (unsigned int)inTimeStamp->mFlags,
		 (unsigned int)inNumberFrames,
		 (unsigned int)ioData->mNumberBuffers);
		 */
		
		//printf("Played %d frames ", p->frameCnt);
		
		rdpsnd_count_frames(p);
		
	}
	
	return noErr;
}
开发者ID:C-o-r-E,项目名称:FreeRDP,代码行数:34,代码来源:rdpsnd_ios.c

示例6: setCgsFont

void
setCgsFont(XtermWidget xw, VTwin *cgsWin, CgsEnum cgsId, XTermFonts * font)
{
    CgsCache *me;

    if ((me = myCache(xw, cgsWin, cgsId)) != 0) {
        if (!HaveFont(font)) {
            if (cgsId != gcNorm)
                (void) getCgsGC(xw, cgsWin, gcNorm);
#ifndef NO_ACTIVE_ICON
            if (cgsWin == &(TScreenOf(xw)->iconVwin))
                font = &(TScreenOf(xw)->fnt_icon);
            else
#endif
                font = &(TScreenOf(xw)->fnts[fNorm]);
        }
        if (HaveFont(font) && okFont(font->fs)) {
            TRACE2(("setCgsFont next: %s for %s slot %p, gc %#x\n",
                    traceFont(font), traceCgsEnum(cgsId),
                    me, (unsigned) THIS(gc)));
            TRACE2(("...next font was %s\n", traceFont(NEXT(font))));
            NEXT(font) = font;
            me->mask |= GCFont;
        } else {
            /* EMPTY */
            TRACE2(("...NOT updated font for %s\n",
                    traceCgsEnum(cgsId)));
        }
    }
}
开发者ID:jcvernaleo,项目名称:bitrig-xenocara,代码行数:30,代码来源:cachedGCs.c

示例7: THIS

/*
 * Class:     sfml_audio_SoundBuffer
 * Method:    nativeGetSamples
 * Signature: (ILjava/nio/Buffer;)V
 */
JNIEXPORT void JNICALL Java_sfml_audio_SoundBuffer_nativeGetSamples
    (JNIEnv *env, jobject obj, jint num, jobject buffer) {

    const sf::Int16 *samples = THIS(sf::SoundBuffer)->getSamples();
    jshort *jsamples = (jshort*)env->GetDirectBufferAddress(buffer);

    memcpy(jsamples, samples, 2 * num);
}
开发者ID:Sonkun,项目名称:JSFML,代码行数:13,代码来源:sfml_audio_SoundBuffer.cpp

示例8: Java_sfml_audio_SoundBuffer_nativeSaveToFile

/*
 * Class:     sfml_audio_SoundBuffer
 * Method:    nativeSaveToFile
 * Signature: (Ljava/lang/String;)Z
 */
JNIEXPORT jboolean JNICALL Java_sfml_audio_SoundBuffer_nativeSaveToFile (JNIEnv *env, jobject obj, jstring fileName) {
	const char *utf8 = env->GetStringUTFChars(fileName, NULL);

    jboolean result = THIS(sf::SoundBuffer)->saveToFile(std::string(utf8));
	env->ReleaseStringUTFChars(fileName, utf8);

    return result;
}
开发者ID:Sonkun,项目名称:JSFML,代码行数:13,代码来源:sfml_audio_SoundBuffer.cpp

示例9: copyCgs

/*
 * Copy the parameters (except GC of course) from one cache record to another.
 */
void
copyCgs(XtermWidget xw, VTwin *cgsWin, CgsEnum dstCgsId, CgsEnum srcCgsId)
{
    if (dstCgsId != srcCgsId) {
        CgsCache *me;

        if ((me = myCache(xw, cgsWin, srcCgsId)) != 0) {
            TRACE(("copyCgs from %s to %s\n",
                   traceCgsEnum(srcCgsId),
                   traceCgsEnum(dstCgsId)));
            TRACE2(("copyCgs from %s (me %p, fg %s, bg %s, cset %s) to %s {{\n",
                    traceCgsEnum(srcCgsId),
                    me,
                    tracePixel(xw, THIS(fg)),
                    tracePixel(xw, THIS(bg)),
                    traceCSet(THIS(cset)),
                    traceCgsEnum(dstCgsId)));
            setCgsCSet(xw, cgsWin, dstCgsId, THIS(cset));
            setCgsFore(xw, cgsWin, dstCgsId, THIS(fg));
            setCgsBack(xw, cgsWin, dstCgsId, THIS(bg));
            setCgsFont(xw, cgsWin, dstCgsId, THIS(font));
            TRACE2(("...copyCgs }}\n"));
        }
    }
}
开发者ID:jcvernaleo,项目名称:bitrig-xenocara,代码行数:28,代码来源:cachedGCs.c

示例10: getCgsFont

/*
 * Return the font for the given GC.
 */
XTermFonts *
getCgsFont(XtermWidget xw, VTwin *cgsWin, GC gc)
{
    int n;
    XTermFonts *result = 0;

    for_each_gc(n) {
        CgsCache *me;

        if ((me = myCache(xw, cgsWin, (CgsEnum) n)) != 0) {
            if (THIS(gc) == gc) {
                result = THIS(font);
                break;
            }
        }
    }
    return result;
}
开发者ID:jcvernaleo,项目名称:bitrig-xenocara,代码行数:21,代码来源:cachedGCs.c

示例11: getCgsBack

/*
 * Return the background color for the given GC.
 */
Pixel
getCgsBack(XtermWidget xw, VTwin *cgsWin, GC gc)
{
    int n;
    Pixel result = 0;

    for_each_gc(n) {
        CgsCache *me;

        if ((me = myCache(xw, cgsWin, (CgsEnum) n)) != 0) {
            if (THIS(gc) == gc) {
                result = THIS(bg);
                break;
            }
        }
    }
    return result;
}
开发者ID:jcvernaleo,项目名称:bitrig-xenocara,代码行数:21,代码来源:cachedGCs.c

示例12: THIS

/*
 * Class:     sfml_audio_SoundSource
 * Method:    nativeGetData
 * Signature: (Ljava/nio/Buffer;)V
 */
JNIEXPORT void JNICALL Java_sfml_audio_Sound_nativeGetData
    (JNIEnv *env, jobject obj, jobject buffer) {

    sf::Sound *sound = THIS(sf::Sound);
    void *data = env->GetDirectBufferAddress(buffer);

    ((jbyte*)data)[0] = sound->getLoop() ? 1 : 0;
    ((jlong*)data)[1] = (jlong)sound->getPlayingOffset().asMicroseconds();
}
开发者ID:Sonkun,项目名称:JSFML,代码行数:14,代码来源:sfml_audio_Sound.cpp

示例13: Java_sfml_audio_SoundBuffer_nativeLoadFromMemory

/*
 * Class:     sfml_audio_SoundBuffer
 * Method:    nativeLoadFromMemory
 * Signature: ([B)Z
 */
JNIEXPORT jboolean JNICALL Java_sfml_audio_SoundBuffer_nativeLoadFromMemory (JNIEnv *env, jobject obj, jbyteArray arr) {
    std::size_t n = (std::size_t)env->GetArrayLength(arr);
    jbyte* mem = env->GetByteArrayElements(arr, 0);

    jboolean result = THIS(sf::SoundBuffer)->loadFromMemory(mem, n);

    env->ReleaseByteArrayElements(arr, mem, JNI_ABORT);
    return result;
}
开发者ID:Sonkun,项目名称:JSFML,代码行数:14,代码来源:sfml_audio_SoundBuffer.cpp

示例14: QComboBox

QWidget *ItemTableDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                                         const QModelIndex &index) const{
    if(index.column()==0){
        QComboBox* combo=new QComboBox(parent);
        int j=0;
        for(int i=0;i<256;i++){
            QString name(res->itemDictionary.entries[i].speciesName);
            if(name.length()){
                combo->addItem(QString("%1(%2)").
                               arg(i).
                               arg(name),
                               QVariant(i));
                combo->setItemData(j,res->itemBackground[KfMap::itemCatagory[i]],Qt::BackgroundRole);
                combo->setItemData(j,res->itemImages.images[i].small,Qt::DecorationRole);
                j++;
            }

        }
        //issue#22, bad imp, TODO
        ItemTableDelegate* THIS(const_cast<ItemTableDelegate*>(this));
        connect(combo,&QComboBox::currentTextChanged,[THIS,combo](){
            emit THIS->commitData(combo);
            emit THIS->closeEditor(combo);
        });
        return combo;
    }else if(index.column()==1){
        QComboBox* combo=new QComboBox(parent);
        int species=pMainWindow->map.itemAt(index.row()).basic.species();
        for(int p:res->itemDictionary.entries[species].behaviorName.keys()){
            combo->addItem(QString("%1(%2)").
                           arg(p).
                           arg(res->itemDictionary.entries[species].behaviorName[p]),
                  QVariant(p));
        }
        //issue#22, bad imp, TODO
        ItemTableDelegate* THIS(const_cast<ItemTableDelegate*>(this));
        connect(combo,&QComboBox::currentTextChanged,[THIS,combo](){
            emit THIS->commitData(combo);
            emit THIS->closeEditor(combo);
        });
        return combo;
    }
    else return QStyledItemDelegate::createEditor(parent,option,index);
}
开发者ID:wwylele,项目名称:MApRX,代码行数:44,代码来源:mainwindow.cpp

示例15: THIS

U_NAMESPACE_END

// C wrapper --------------------------------------------------------------- ***

#define THIS(en) ((icu::StringEnumeration*)(en->context))

U_CDECL_BEGIN

/**
 * Wrapper API to make StringEnumeration look like UEnumeration.
 */
static void U_CALLCONV
ustrenum_close(UEnumeration* en) {
    delete THIS(en);
    uprv_free(en);
}
开发者ID:00zhengfu00,项目名称:third_party,代码行数:16,代码来源:ustrenum.cpp


注:本文中的THIS函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。