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


C++ PRIVATE函数代码示例

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


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

示例1: g_signal_new

	 */
	signals[NEED_LOCATIONS] = g_signal_new ("need-locations",
						G_TYPE_FROM_CLASS (g_obj_class),
						G_SIGNAL_RUN_LAST,
						G_STRUCT_OFFSET (ClockMapClass, need_locations),
						NULL,
						NULL,
						_clock_marshal_POINTER__VOID,
						G_TYPE_POINTER, 0);
}

static void
clock_map_init (ClockMap *this)
{
        int i;
        ClockMapPrivate *priv = PRIVATE (this);

        gtk_widget_set_has_window (GTK_WIDGET (this), FALSE);

	priv->last_refresh = 0;
	priv->width = 0;
	priv->height = 0;
	priv->highlight_timeout_id = 0;
        priv->stock_map_pixbuf = NULL;

        g_assert (sizeof (marker_files)/sizeof (char *) == MARKER_NB);

        for (i = 0; i < MARKER_NB; i++) {
                priv->location_marker_pixbuf[i] = gdk_pixbuf_new_from_file
                                                  (marker_files[i], NULL);
        }
开发者ID:wiliwe,项目名称:gnome-panel,代码行数:31,代码来源:clock-map.c

示例2: network_client_win

void network_client_win(NetworkClient * client) {
	PRIVATE(client)->score++;
}
开发者ID:sudheesh001,项目名称:monkey-bubble,代码行数:3,代码来源:client.c

示例3: network_client_get_state

gboolean network_client_get_state(NetworkClient * client) {
	return PRIVATE(client)->state;
}
开发者ID:sudheesh001,项目名称:monkey-bubble,代码行数:3,代码来源:client.c

示例4:

EcInt *EcArgcp( void )
{
	return &PRIVATE(argc);
}
开发者ID:BackupTheBerlios,项目名称:elastic-svn,代码行数:4,代码来源:elastic.c

示例5: network_client_get_handler

NetworkMessageHandler * network_client_get_handler(NetworkClient * client) 
{
	g_assert(NETWORK_IS_CLIENT(client));

	return PRIVATE(client)->handler;
}
开发者ID:sudheesh001,项目名称:monkey-bubble,代码行数:6,代码来源:client.c

示例6: cr_prop_list_unlink

/**
 * cr_prop_list_unlink:
 *@a_this: the current list of prop/decl pairs
 *@a_pair: the prop/decl pair to unlink.
 *
 *Unlinks a prop/decl pair from the list
 *
 *Returns the new list or NULL in case of an error.
 */
CRPropList *
cr_prop_list_unlink (CRPropList * a_this, CRPropList * a_pair)
{
        CRPropList *prev = NULL,
                *next = NULL;

        g_return_val_if_fail (a_this && PRIVATE (a_this) && a_pair, NULL);

        /*some sanity checks */
        if (PRIVATE (a_pair)->next) {
                next = PRIVATE (a_pair)->next;
                g_return_val_if_fail (PRIVATE (next), NULL);
                g_return_val_if_fail (PRIVATE (next)->prev == a_pair, NULL);
        }
        if (PRIVATE (a_pair)->prev) {
                prev = PRIVATE (a_pair)->prev;
                g_return_val_if_fail (PRIVATE (prev), NULL);
                g_return_val_if_fail (PRIVATE (prev)->next == a_pair, NULL);
        }
        if (prev) {
                PRIVATE (prev)->next = next;
        }
        if (next) {
                PRIVATE (next)->prev = prev;
        }
        PRIVATE (a_pair)->prev = PRIVATE (a_pair)->next = NULL;
        if (a_this == a_pair) {
                if (next)
                        return next;
                return NULL;
        }
        return a_this;
}
开发者ID:GNOME,项目名称:libcroco,代码行数:42,代码来源:cr-prop-list.c

示例7: EcCleanup

EC_API void EcCleanup( void )
{
	void _ec_releaseOT( void );
	EcInt i;

	PRIVATE(in_cleanup) = TRUE;

#if MEM_STATS
	fprintf( stderr, "\nTYPE                   ALLOCATED    MARKINGS\n" );
	fprintf( stderr, "============================================\n" );
	for (i = 0; i <= PRIVATE(usertypes); i++)
		fprintf( stderr, "%-20s    %8ld    %8ld\n", EcTypeName( i ), _ec_make_stats[i], _ec_mark_stats[i] );
#endif

	_ec_packageio_cleanup();

	if (PRIVATE(builtin_name))
		ec_hash_destroy( PRIVATE(builtin_name) );
	PRIVATE(builtin_name) = NULL;

	ec_free( PRIVATE(cpointer) );
	PRIVATE(ncpointers) = 0;
	PRIVATE(cpointer)   = NULL;

	EcGCUnprotectAll();

	PRIVATE(patchmap) = NULL;

	/* BREAK THE LINKS between toplevel and objects ! */
	PRIVATE(rt.activeFrame) = EC_NIL;
	PRIVATE(globalFrame)    = EC_NIL;
	PRIVATE(mainTarget)     = EC_NIL;
	for (i = 0; i < PRIVATE(nglobals); i++)
		PRIVATE(global[i]) = EC_NIL;
	for (i = 0; i < PRIVATE(npackages); i++)
		PRIVATE(package[i].obj) = EC_NIL;
#if EC_STACK_RECYCLE
	{
		EcInt j;

#if EC_STACK_RECYCLE_STATS
		fprintf( stderr, "\n== Stack statistics =================\n" );
		fprintf( stderr, "Calls to EcMakeStack()   : %ld\n", (long)PRIVATE(n_makestack) );
		fprintf( stderr, "# stores in recycle bin  : %ld\n", (long)PRIVATE(n_recycle_put) );
		fprintf( stderr, "# failed stores          : %ld\n", (long)(PRIVATE(n_recycle_put_attempts) - PRIVATE(n_recycle_put)) );
		fprintf( stderr, "# fetched from rec. bin  : %ld\n", (long)PRIVATE(n_recycle_get) );
		fprintf( stderr, "# failed fetches         : %ld\n", (long)(PRIVATE(n_recycle_get_attempts) - PRIVATE(n_recycle_get)) );
		fprintf( stderr, "# times the bin was empty: %ld\n", (long)PRIVATE(n_pool_empty) );
		fprintf( stderr, "# times the bin was full : %ld\n", (long)PRIVATE(n_pool_full) );
		/* fprintf( stderr, "bin max fill             : %ld\n", (long)PRIVATE(pool_max_fill) ); */
		fprintf( stderr, "# refcount increments    : %ld\n", (long)PRIVATE(n_ref_inc) );
		fprintf( stderr, "# refcount decrements    : %ld\n", (long)PRIVATE(n_ref_dec) );
		fprintf( stderr, "\n" );
#endif

		for (j = 0; j < EC_STACK_POOL_SIZE; j++)
			PRIVATE(stack_pool)[j] = EC_NIL;
		ec_bit_nclear(PRIVATE(stack_pool_bmap), 0, EC_STACK_POOL_SIZE-1);
	}
#endif
	for (i = 0; i < GC_FINAL_PASSES; i++) EcGC();

	/* Release all objects in a linear fashion */
	_ec_releaseOT();

	for (i = 0; i < PRIVATE(npackages); i++)
	{
		if (PRIVATE(package)[i].dlhandle)
		{
			if (PRIVATE(package)[i].dlcleanup_fcn)
				(*(PRIVATE(package)[i].dlcleanup_fcn))();
			EcDLClose( PRIVATE(package)[i].dlhandle );
		}
		ec_string_destroy( PRIVATE(package)[i].name );
		PRIVATE(package)[i].name          = NULL;
		PRIVATE(package)[i].dlhandle      = NULL;
		PRIVATE(package)[i].dlinit_fcn    = NULL;
		PRIVATE(package)[i].dlcleanup_fcn = NULL;
	}
	ec_free( PRIVATE(package) );
	PRIVATE(package)   = NULL;
	PRIVATE(npackages) = 0;

	for (i = tc_userbase; i <= PRIVATE(usertypes); i++)
	{
		ec_free( USERTYPE(i).name );
		USERTYPE(i).name = NULL;

		ec_free( USERTYPE(i).sequence_cb );
		ec_free( USERTYPE(i).numeric_cb );
	}
	ec_free( PRIVATE(typespec) );
	PRIVATE(typespec)  = NULL;
	PRIVATE(usertypes) = 0;

	EcTrueObject        = EC_NIL;
	EcFalseObject       = EC_NIL;
	Ec_ERROR            = EC_NIL;
	EcUndefinedObject   = EC_NIL;
	EcMemoryErrorObject = EC_NIL;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:elastic-svn,代码行数:101,代码来源:elastic.c

示例8: PRIVATE

/*!
  Returns rendering color of the highlighted boxes.
*/
const SbColor &
SoBoxHighlightRenderAction::getColor(void)
{
  return PRIVATE(this)->basecolor->rgb[0];
}
开发者ID:Alexpux,项目名称:Coin3D,代码行数:8,代码来源:SoBoxHighlightRenderAction.cpp

示例9: EcInternSymbol

EC_API EcUInt EcInternSymbol( const char *string )
{
	EcUInt id;

	id = EcSymbolId( string );
	if (id) return id;

	ec_strtable_set( PRIVATE(symTable), string, ++PRIVATE(currentId) );

	if (PRIVATE(currentId) >= PRIVATE(symNameSize))
	{
		EcUInt newsize;

		newsize = PRIVATE(symNameSize) + SYMNAMEQUANTUM;
		newsize /= SYMNAMEQUANTUM;
		newsize *= SYMNAMEQUANTUM;

		if (ec_resizeblock( &PRIVATE(symName), newsize, sizeof(char *) ))
		{
			PRIVATE(symNameSize) = newsize;
		}
	}

	ASSERT( PRIVATE(symNameSize) > PRIVATE(currentId) );

	PRIVATE(symName)[PRIVATE(currentId)] = (char *)ec_stringdup( string );
	ASSERT( PRIVATE(symName)[PRIVATE(currentId)] );
	if (! PRIVATE(symName)[PRIVATE(currentId)])
		return 0;

	/*fprintf( stderr, "EcInternSymbol %3d <- %s\n", PRIVATE(currentId), string );*/
	return PRIVATE(currentId);
}
开发者ID:BackupTheBerlios,项目名称:elastic-svn,代码行数:33,代码来源:symbol.c

示例10: return

EC_API const char *EcSymbolAt( EcUInt symbolid )
{
	return (const char *) PRIVATE(symName)[symbolid];
}
开发者ID:BackupTheBerlios,项目名称:elastic-svn,代码行数:4,代码来源:symbol.c

示例11: cr_input_read_char

/**
 * cr_input_read_char:
 *@a_this: the current instance of CRInput.
 *@a_char: out parameter. The read character.
 *
 *Reads an unicode character from the current instance of
 *#CRInput.
 *
 *Returns CR_OK upon successful completion, an error code
 *otherwise.
 */
enum CRStatus
cr_input_read_char (CRInput * a_this, guint32 * a_char)
{
        enum CRStatus status = CR_OK;
        gulong consumed = 0,
                nb_bytes_left = 0;

        g_return_val_if_fail (a_this && PRIVATE (a_this) && a_char,
                              CR_BAD_PARAM_ERROR);

        if (PRIVATE (a_this)->end_of_input == TRUE)
                return CR_END_OF_INPUT_ERROR;

        nb_bytes_left = cr_input_get_nb_bytes_left (a_this);

        if (nb_bytes_left < 1) {
                return CR_END_OF_INPUT_ERROR;
        }

        status = cr_utils_read_char_from_utf8_buf
                (PRIVATE (a_this)->in_buf
                 +
                 PRIVATE (a_this)->next_byte_index,
                 nb_bytes_left, a_char, &consumed);

        if (status == CR_OK) {
                /*update next byte index */
                PRIVATE (a_this)->next_byte_index += consumed;

                /*update line and column number */
                if (PRIVATE (a_this)->end_of_line == TRUE) {
                        PRIVATE (a_this)->col = 1;
                        PRIVATE (a_this)->line++;
                        PRIVATE (a_this)->end_of_line = FALSE;
                } else if (*a_char != '\n') {
                        PRIVATE (a_this)->col++;
                }

                if (*a_char == '\n') {
                        PRIVATE (a_this)->end_of_line = TRUE;
                }

        }

        return status;
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:57,代码来源:cr-input.c

示例12: cr_input_new_from_buf

/**
 * cr_input_new_from_buf:
 *@a_buf: the memory buffer to create the input stream from.
 *The #CRInput keeps this pointer so user should not free it !.
 *@a_len: the size of the input buffer.
 *@a_enc: the buffer's encoding.
 *@a_free_buf: if set to TRUE, this a_buf will be freed
 *at the destruction of this instance. If set to false, it is up
 *to the caller to free it.
 *
 *Creates a new input stream from a memory buffer.
 *Returns the newly built instance of #CRInput.
 */
CRInput *
cr_input_new_from_buf (guchar * a_buf,
                       gulong a_len,
                       enum CREncoding a_enc,
                       gboolean a_free_buf)
{
        CRInput *result = NULL;
        enum CRStatus status = CR_OK;
        CREncHandler *enc_handler = NULL;
        gulong len = a_len;

        g_return_val_if_fail (a_buf, NULL);

        result = cr_input_new_real ();
        g_return_val_if_fail (result, NULL);

        /*transform the encoding in utf8 */
        if (a_enc != CR_UTF_8) {
                enc_handler = cr_enc_handler_get_instance (a_enc);
                if (!enc_handler) {
                        goto error;
                }

                status = cr_enc_handler_convert_input
                        (enc_handler, a_buf, &len,
                         &PRIVATE (result)->in_buf,
                         &PRIVATE (result)->in_buf_size);
                if (status != CR_OK)
                        goto error;
                PRIVATE (result)->free_in_buf = TRUE;
                if (a_free_buf == TRUE && a_buf) {
                        g_free (a_buf) ;
                        a_buf = NULL ;
                }                
                PRIVATE (result)->nb_bytes = PRIVATE (result)->in_buf_size;
        } else {
                PRIVATE (result)->in_buf = (guchar *) a_buf;
                PRIVATE (result)->in_buf_size = a_len;
                PRIVATE (result)->nb_bytes = a_len;
                PRIVATE (result)->free_in_buf = a_free_buf;
        }
        PRIVATE (result)->line = 1;
        PRIVATE (result)->col =  0;
        return result;

 error:
        if (result) {
                cr_input_destroy (result);
                result = NULL;
        }

        return NULL;
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:66,代码来源:cr-input.c

示例13: PRIVATE

// Documented in superclass.
void
SoXtPlaneViewer::setCamera(SoCamera * camera)
{
  Pixmap pixmap, pixmap_ins;
  if (camera == NULL) {
    // find better pixmaps for this...
    pixmap = PRIVATE(this)->pixmaps.ortho;
    pixmap_ins = PRIVATE(this)->pixmaps.ortho_ins;
  } else if (camera->isOfType(SoPerspectiveCamera::getClassTypeId())) {
    pixmap = PRIVATE(this)->pixmaps.perspective;
    pixmap_ins = PRIVATE(this)->pixmaps.perspective_ins;
    SoXtResource rsc(this->getRightWheelLabelWidget());
    char * dollyString = NULL;
    char * zoomString = NULL;
    if (
        (rsc.getResource("dollyString", XmRString, dollyString) && dollyString != NULL)
        &&
        (rsc.getResource("zoomString", XmRString, zoomString) && zoomString != NULL)
        && strcmp(zoomString,this->getRightWheelString())== 0
        )
      this->setRightWheelString(dollyString);
  } else if (camera->isOfType(SoOrthographicCamera::getClassTypeId())) {
    pixmap = PRIVATE(this)->pixmaps.ortho;
    pixmap_ins = PRIVATE(this)->pixmaps.ortho_ins;
    SoXtResource rsc(this->getRightWheelLabelWidget());
    char * dollyString = NULL;
    char * zoomString = NULL;
    if (
        (rsc.getResource("dollyString", XmRString, dollyString) && dollyString != NULL)
        &&
        (rsc.getResource("zoomString", XmRString, zoomString) && zoomString != NULL)
        && strcmp(dollyString,this->getRightWheelString())== 0
        )
      this->setRightWheelString(zoomString);
  } else {
    SoDebugError::postWarning("SoXtExaminerViewer::setCamera",
      "unknown camera type - got no pixmap");
    // find better pixmaps for this...
    pixmap = PRIVATE(this)->pixmaps.ortho;
    pixmap_ins = PRIVATE(this)->pixmaps.ortho_ins;
  }

#if HAVE_LIBXPM
  XtUnmanageChild(PRIVATE(this)->buttons[3].bwidget);
  XtVaSetValues(PRIVATE(this)->buttons[3].bwidget,
    XmNlabelType, XmPIXMAP,
    XmNlabelPixmap, pixmap,
    XmNselectPixmap, pixmap,
    XmNlabelInsensitivePixmap, pixmap_ins,
    XmNselectInsensitivePixmap, pixmap_ins,
    NULL);
  XtVaSetValues(PRIVATE(this)->buttons[3].bwidget,
    XmNwidth, 30, XmNheight, 30, NULL);
  XtManageChild(PRIVATE(this)->buttons[3].bwidget);
#endif // HAVE_LIBXPM

  inherited::setCamera(camera);
}
开发者ID:ALLPix,项目名称:SoXt,代码行数:59,代码来源:PlaneViewer.cpp

示例14: sizeof

// Documented in superclass. Overridden to add the x, y, z, and
// camera-toggle buttons to the list of viewer buttons.
void
SoXtPlaneViewer::createViewerButtons(Widget parent,
                                     SbPList * buttonlist)
{
  inherited::createViewerButtons(parent, buttonlist);

  const int buttons =
    sizeof(SoXtPlaneViewerP::SoXtPlaneViewerButtons) / sizeof(SoXtViewerButton);

  for (int button = 0; button < buttons; button++) {
    Widget widget =
      XtVaCreateManagedWidget(PRIVATE(this)->buttons[button].keyword,
                              xmPushButtonWidgetClass, parent,
                              XmNshadowType, XmSHADOW_OUT,
                              XmNhighlightThickness, 0,
                              XmNshadowThickness, 2,
                              XmNtraversalOn, False,
                              XmNwidth, 30,
                              XmNheight, 30,
                              XtVaTypedArg,
                              XmNlabelString, XmRString,
                              PRIVATE(this)->buttons[button].label, strlen(PRIVATE(this)->buttons[button].label) + 1,
                              NULL);
    PRIVATE(this)->buttons[button].bwidget = widget;

#if HAVE_LIBXPM
    Pixmap pixmap = SoXtInternal::createPixmapFromXpm(widget, PRIVATE(this)->buttons[button].xpm_data);
    if (pixmap) {
      XtVaSetValues(widget,
                    XmNlabelType, XmPIXMAP,
                    XmNlabelPixmap, pixmap,
                    NULL);
    }
#endif

    buttonlist->append(widget);

    XtAddCallback(widget, XmNactivateCallback,
                  SoXtPlaneViewerP::buttonCB, (XtPointer) this);
  } // for (button < buttons)

#if HAVE_LIBXPM
  PRIVATE(this)->pixmaps.ortho =
    SoXtInternal::createPixmapFromXpm(PRIVATE(this)->buttons[3].bwidget, ortho_xpm);
  PRIVATE(this)->pixmaps.ortho_ins =
    SoXtInternal::createPixmapFromXpm(PRIVATE(this)->buttons[3].bwidget, ortho_xpm, TRUE);
  PRIVATE(this)->pixmaps.perspective =
    SoXtInternal::createPixmapFromXpm(PRIVATE(this)->buttons[3].bwidget, perspective_xpm);
  PRIVATE(this)->pixmaps.perspective_ins =
    SoXtInternal::createPixmapFromXpm(PRIVATE(this)->buttons[3].bwidget, perspective_xpm, TRUE);
#endif // HAVE_LIBXPM
}
开发者ID:ALLPix,项目名称:SoXt,代码行数:54,代码来源:PlaneViewer.cpp

示例15: pixels

/*!
  Sets the line \a width used when drawing boxes, in screen pixels (as
  for all OpenGL rendering). Defaults to 3.
*/
void
SoBoxHighlightRenderAction::setLineWidth(const float width)
{
  PRIVATE(this)->drawstyle->lineWidth = width;
}
开发者ID:Alexpux,项目名称:Coin3D,代码行数:9,代码来源:SoBoxHighlightRenderAction.cpp


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