Back to index

unity  6.0.0
Classes | Functions
test_glib_object_utils.cpp File Reference
#include "test_glib_object_utils.h"

Go to the source code of this file.

Classes

struct  _TestGObjectPrivate

Functions

 G_DEFINE_TYPE (TestGObject, test_gobject, G_TYPE_OBJECT)
static void test_gobject_class_init (TestGObjectClass *klass)
static void test_gobject_init (TestGObject *self)
TestGObject * test_gobject_new ()
void test_gobject_set_private_value (TestGObject *self, gint value)
gint test_gobject_get_private_value (TestGObject *self)
void test_gobject_set_public_value (TestGObject *self, gint value)
gint test_gobject_get_public_value (TestGObject *self)

Class Documentation

struct _TestGObjectPrivate

Definition at line 3 of file test_glib_object_utils.cpp.

Class Members
int private_value

Function Documentation

G_DEFINE_TYPE ( TestGObject  ,
test_gobject  ,
G_TYPE_OBJECT   
)
static void test_gobject_class_init ( TestGObjectClass *  klass) [static]

Definition at line 11 of file test_glib_object_utils.cpp.

{
  g_type_class_add_private (klass, sizeof (TestGObjectPrivate));
}
gint test_gobject_get_private_value ( TestGObject *  self)

Definition at line 41 of file test_glib_object_utils.cpp.

{
  TestGObjectPrivate *priv;
  g_return_val_if_fail(TEST_IS_GOBJECT(self), 0);

  priv = TEST_GOBJECT_GET_PRIVATE(self);
  return priv->private_value;
}
gint test_gobject_get_public_value ( TestGObject *  self)

Definition at line 57 of file test_glib_object_utils.cpp.

{
  g_return_val_if_fail(TEST_IS_GOBJECT(self), 0);

  return self->public_value;
}
static void test_gobject_init ( TestGObject *  self) [static]

Definition at line 17 of file test_glib_object_utils.cpp.

{
  TestGObjectPrivate *priv;
  self->priv = TEST_GOBJECT_GET_PRIVATE(self);
  priv = self->priv;

  priv->private_value = 55;
}
TestGObject* test_gobject_new ( )

Definition at line 27 of file test_glib_object_utils.cpp.

{
  return TEST_GOBJECT(g_object_new(TEST_TYPE_GOBJECT, NULL));
}
void test_gobject_set_private_value ( TestGObject *  self,
gint  value 
)

Definition at line 32 of file test_glib_object_utils.cpp.

{
  TestGObjectPrivate *priv;
  g_return_if_fail(TEST_IS_GOBJECT(self));

  priv = TEST_GOBJECT_GET_PRIVATE(self);
  priv->private_value = value;
}
void test_gobject_set_public_value ( TestGObject *  self,
gint  value 
)

Definition at line 50 of file test_glib_object_utils.cpp.

{
  g_return_if_fail(TEST_IS_GOBJECT(self));

  self->public_value = value;
}