本文整理汇总了C++中G_OBJECT_CLASS_NAME函数的典型用法代码示例。如果您正苦于以下问题:C++ G_OBJECT_CLASS_NAME函数的具体用法?C++ G_OBJECT_CLASS_NAME怎么用?C++ G_OBJECT_CLASS_NAME使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_OBJECT_CLASS_NAME函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __initialize_statement_delete_query_parameters
static void
__initialize_statement_delete_query_parameters (MidgardDBObjectClass *klass, const gchar *query_string, gboolean add_workspace)
{
GdaSqlParser *parser = gda_sql_parser_new ();
GdaStatement *stmt;
GError *error = NULL;
stmt = gda_sql_parser_parse_string (parser, query_string, NULL, &error);
if (!stmt) {
g_error ("Couldn't create %s class DELETE(UPDATE) prepared statement. %s",
G_OBJECT_CLASS_NAME (klass), error && error->message ? error->message : "Unknown reason");
return;
}
GdaSet *params;
if (!gda_statement_get_parameters (stmt, ¶ms, &error)) {
g_error ("Failed to create DELETE(UPDATE) GdaSet for %s class. %s",
G_OBJECT_CLASS_NAME (klass), error && error->message ? error->message : "Unknown reason");
}
if (add_workspace) {
klass->dbpriv->_workspace_statement_delete = stmt;
klass->dbpriv->_workspace_statement_delete_params = params;
return;
}
klass->dbpriv->_statement_delete = stmt;
klass->dbpriv->_statement_delete_params = params;
return;
}
示例2: midgard_test_object_tree_basic
void midgard_test_object_tree_basic(MidgardObjectTest *mot, gconstpointer data)
{
g_assert(mot != NULL);
MidgardObject *object = MIDGARD_OBJECT(mot->object);
MidgardObjectClass *klass = MIDGARD_OBJECT_GET_CLASS(object);
/* Get parent (in tree) class and check if parent has the same child declared */
const gchar *pname = midgard_schema_object_tree_get_parent_name (object);
if (!pname)
return;
MidgardObjectClass *pklass = MIDGARD_OBJECT_GET_CLASS_BY_NAME(pname);
g_assert(pklass != NULL);
/* There is tree parent declared so parent property can not be NULL */
const gchar *parent_property = midgard_reflector_object_get_property_parent (G_OBJECT_CLASS_NAME (klass));
g_assert(parent_property != NULL);
guint n_child;
gchar **children = midgard_reflector_object_list_children (G_OBJECT_CLASS_NAME (pklass), &n_child);
g_assert(children != NULL);
guint i = 0;
gboolean has_child_class = FALSE;
for (i = 0; i < n_child; i++) {
if (g_type_from_name (children[i]) == G_OBJECT_CLASS_TYPE(klass))
has_child_class = TRUE;
}
g_free(children);
g_assert(has_child_class != FALSE);
}
示例3: xfdashboard_actor_install_stylable_property
/* Register stylable property of a class */
void xfdashboard_actor_install_stylable_property(XfdashboardActorClass *klass, GParamSpec *inParamSpec)
{
GParamSpec *stylableParamSpec;
g_return_if_fail(XFDASHBOARD_IS_ACTOR_CLASS(klass));
g_return_if_fail(G_IS_PARAM_SPEC(inParamSpec));
g_return_if_fail(inParamSpec->flags & G_PARAM_WRITABLE);
g_return_if_fail(!(inParamSpec->flags & G_PARAM_CONSTRUCT_ONLY));
/* Check if param-spec is already registered */
if(g_param_spec_pool_lookup(_xfdashboard_actor_stylable_properties_pool, g_param_spec_get_name(inParamSpec), G_OBJECT_CLASS_TYPE(klass), FALSE))
{
g_warning("Class '%s' already contains a stylable property '%s'",
G_OBJECT_CLASS_NAME(klass),
g_param_spec_get_name(inParamSpec));
return;
}
/* Add param-spec to pool of themable properties */
stylableParamSpec=g_param_spec_internal(G_PARAM_SPEC_TYPE(inParamSpec),
g_param_spec_get_name(inParamSpec),
NULL,
NULL,
0);
g_param_spec_set_qdata_full(stylableParamSpec,
XFDASHBOARD_ACTOR_PARAM_SPEC_REF,
g_param_spec_ref(inParamSpec),
(GDestroyNotify)g_param_spec_unref);
g_param_spec_pool_insert(_xfdashboard_actor_stylable_properties_pool, stylableParamSpec, G_OBJECT_CLASS_TYPE(klass));
XFDASHBOARD_DEBUG(NULL, STYLE,
"Registered stylable property '%s' for class '%s'",
g_param_spec_get_name(inParamSpec), G_OBJECT_CLASS_NAME(klass));
}
示例4: draw_image
/*!
* \brief Draw image
*
* Not optional on the PyDia side. If not implemented a runtime warning
* will be generated when called.
*
* \memberof _DiaPyRenderer
*/
static void
draw_image(DiaRenderer *renderer,
Point *point,
real width, real height,
DiaImage *image)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
func = PyObject_GetAttrString (self, "draw_image");
if (func && PyCallable_Check(func)) {
PyObject *opoint = PyDiaPoint_New (point);
PyObject *oimage = PyDiaImage_New (image);
Py_INCREF(self);
Py_INCREF(func);
arg = Py_BuildValue ("(OddO)", opoint, width, height, oimage);
if (arg) {
res = PyEval_CallObject (func, arg);
ON_RES(res, FALSE);
}
Py_XDECREF (arg);
Py_XDECREF (opoint);
Py_XDECREF (oimage);
Py_DECREF(func);
Py_DECREF(self);
} else { /* member not optional */
gchar *msg = g_strdup_printf ("%s.draw_image() implmentation missing.",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
PyErr_Clear();
PyErr_Warn (PyExc_RuntimeWarning, msg);
g_free (msg);
}
}
示例5: attach
static void
attach (GeglOperation *self)
{
g_warning ("kilroy was at What The Hack (%p, %s)\n", (void *) self,
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (self)));
return;
}
示例6: draw_line
/*!
* \brief Draw line
*
* Not optional on the PyDia side. If not implemented a runtime warning
* will be generated when called.
*
* \memberof _DiaPyRenderer
*/
static void
draw_line(DiaRenderer *renderer,
Point *start, Point *end,
Color *line_colour)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
func = PyObject_GetAttrString (self, "draw_line");
if (func && PyCallable_Check(func)) {
PyObject *ostart = PyDiaPoint_New (start);
PyObject *oend = PyDiaPoint_New (end);
PyObject *ocolor = PyDiaColor_New (line_colour);
Py_INCREF(self);
Py_INCREF(func);
arg = Py_BuildValue ("(OOO)", ostart, oend, ocolor);
if (arg) {
res = PyEval_CallObject (func, arg);
ON_RES(res, FALSE);
}
Py_XDECREF (arg);
Py_XDECREF (ostart);
Py_XDECREF (oend);
Py_XDECREF (ocolor);
Py_DECREF(func);
Py_DECREF(self);
}
else { /* member not optional */
gchar *msg = g_strdup_printf ("%s.draw_line() implmentation missing.",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
PyErr_Clear();
PyErr_Warn (PyExc_RuntimeWarning, msg);
g_free (msg);
}
}
示例7: browser_perspective_uncustomize
/**
* browser_perspective_uncustomize:
* @perspective: an object implementing the #BrowserPerspective interface
*
* Remove any optional custom UI elements which have been added
* when browser_perspective_customize() was called.
*/
void
browser_perspective_uncustomize (BrowserPerspective *perspective)
{
g_return_if_fail (IS_BROWSER_PERSPECTIVE (perspective));
/* Current BrowserPage */
GtkNotebook *nb;
nb = (GtkNotebook*) browser_perspective_get_notebook (perspective);
if (nb) {
gint current_index;
current_index = gtk_notebook_get_current_page (nb);
if (current_index >= 0) {
GtkWidget *current_page;
current_page = gtk_notebook_get_nth_page (nb, current_index);
if (current_page && IS_BROWSER_PAGE (current_page))
browser_page_uncustomize (BROWSER_PAGE (current_page));
}
}
if (BROWSER_PERSPECTIVE_GET_CLASS (perspective)->i_uncustomize)
(BROWSER_PERSPECTIVE_GET_CLASS (perspective)->i_uncustomize) (perspective);
else {
g_print ("Default browser_perspective_uncustomize for %s\n",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (perspective)));
if (customization_data_exists (G_OBJECT (perspective)))
customization_data_release (G_OBJECT (perspective));
}
}
示例8: ges_timeline_element_set_inpoint
/**
* ges_timeline_element_set_inpoint:
* @self: a #GESTimelineElement
* @inpoint: the in-point in #GstClockTime
*
* Set the in-point, that is the moment at which the @self will start
* outputting data from its contents.
*/
void
ges_timeline_element_set_inpoint (GESTimelineElement * self,
GstClockTime inpoint)
{
GESTimelineElementClass *klass;
g_return_if_fail (GES_IS_TIMELINE_ELEMENT (self));
GST_DEBUG_OBJECT (self, "current inpoint: %" GST_TIME_FORMAT
" new inpoint: %" GST_TIME_FORMAT, GST_TIME_ARGS (inpoint),
GST_TIME_ARGS (GES_TIMELINE_ELEMENT_INPOINT (self)));
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
if (klass->set_inpoint) {
if (klass->set_inpoint (self, inpoint)) {
self->inpoint = inpoint;
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INPOINT]);
}
return;
}
GST_WARNING_OBJECT (self, "No set_inpoint virtual method implementation"
" on class %s. Can not set inpoint %" GST_TIME_FORMAT,
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (inpoint));
}
示例9: ges_timeline_element_set_duration
/**
* ges_timeline_element_set_duration:
* @self: a #GESTimelineElement
* @duration: the duration in #GstClockTime
*
* Set the duration of the object
*
* Note that if the timeline snap-distance property of the timeline containing
* @self is set, @self will properly snap to its neighboors.
*/
void
ges_timeline_element_set_duration (GESTimelineElement * self,
GstClockTime duration)
{
GESTimelineElementClass *klass;
g_return_if_fail (GES_IS_TIMELINE_ELEMENT (self));
klass = GES_TIMELINE_ELEMENT_GET_CLASS (self);
GST_DEBUG_OBJECT (self, "current duration: %" GST_TIME_FORMAT
" new duration: %" GST_TIME_FORMAT,
GST_TIME_ARGS (GES_TIMELINE_ELEMENT_DURATION (self)),
GST_TIME_ARGS (duration));
if (klass->set_duration) {
if (klass->set_duration (self, duration)) {
self->duration = duration;
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_DURATION]);
}
return;
}
GST_WARNING_OBJECT (self, "No set_duration virtual method implementation"
" on class %s. Can not set duration %" GST_TIME_FORMAT,
G_OBJECT_CLASS_NAME (klass), GST_TIME_ARGS (duration));
}
示例10: json_op_class_init
static void
json_op_class_init (gpointer klass, gpointer class_data)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
JsonOpClass *json_op_class = (JsonOpClass *) (klass);
const gchar *description;
gchar *name;
json_op_class->json_root = (JsonObject *) (class_data);
object_class->set_property = set_property;
object_class->get_property = get_property;
object_class->constructor = constructor;
object_class->finalize = finalize;
operation_class->attach = attach;
json_op_class->properties = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, (GDestroyNotify)property_target_free);
install_properties(json_op_class);
description = metadata_get_property(json_op_class->json_root, "description");
name = component2geglop(metadata_get_property(json_op_class->json_root, "name"));
gegl_operation_class_set_keys (operation_class,
"name", (name) ? name : g_strdup_printf("json:%s", G_OBJECT_CLASS_NAME(object_class)),
"categories", "meta:json",
"description", (description) ? description : "",
NULL);
g_free(name);
}
示例11: _expandable_is_expanded
static gboolean
_expandable_is_expanded(gconstpointer self)
{
g_error("Bad implementation of expandable->is_expanded() in '%s' class.",
G_OBJECT_CLASS_NAME(self));
return FALSE;
}
示例12: _expandable_build_string
static void
_expandable_build_string(gconstpointer self,
GString *buffer,
CoilStringFormat *format,
GError **error)
{
g_error("Bad implementation of expandable->build_string() in '%s' class.",
G_OBJECT_CLASS_NAME(self));
}
示例13: gst_tag_mux_init
static void
gst_tag_mux_init (GstTagMux * mux, GstTagMuxClass * mux_class)
{
GstElementClass *element_klass = GST_ELEMENT_CLASS (mux_class);
GstPadTemplate *tmpl;
mux->priv =
G_TYPE_INSTANCE_GET_PRIVATE (mux, GST_TYPE_TAG_MUX, GstTagMuxPrivate);
/* pad through which data comes in to the element */
tmpl = gst_element_class_get_pad_template (element_klass, "sink");
if (tmpl) {
mux->priv->sinkpad = gst_pad_new_from_template (tmpl, "sink");
} else {
g_warning ("GstTagMux subclass '%s' did not install a %s pad template!\n",
G_OBJECT_CLASS_NAME (element_klass), "sink");
mux->priv->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
}
gst_pad_set_chain_function (mux->priv->sinkpad,
GST_DEBUG_FUNCPTR (gst_tag_mux_chain));
gst_pad_set_event_function (mux->priv->sinkpad,
GST_DEBUG_FUNCPTR (gst_tag_mux_sink_event));
gst_element_add_pad (GST_ELEMENT (mux), mux->priv->sinkpad);
/* pad through which data goes out of the element */
tmpl = gst_element_class_get_pad_template (element_klass, "src");
if (tmpl) {
GstCaps *tmpl_caps = gst_pad_template_get_caps (tmpl);
mux->priv->srcpad = gst_pad_new_from_template (tmpl, "src");
gst_pad_use_fixed_caps (mux->priv->srcpad);
if (tmpl_caps != NULL && gst_caps_is_fixed (tmpl_caps)) {
gst_pad_set_caps (mux->priv->srcpad, tmpl_caps);
}
} else {
g_warning ("GstTagMux subclass '%s' did not install a %s pad template!\n",
G_OBJECT_CLASS_NAME (element_klass), "source");
mux->priv->srcpad = gst_pad_new ("src", GST_PAD_SRC);
}
gst_element_add_pad (GST_ELEMENT (mux), mux->priv->srcpad);
mux->priv->render_start_tag = TRUE;
mux->priv->render_end_tag = TRUE;
}
示例14: switch
bool ofxGstRTPServer::on_message(GstMessage * msg){
// read messages from the pipeline like dropped packages
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_ELEMENT:{
GstObject * messageSrc = GST_MESSAGE_SRC(msg);
ofLogVerbose(LOG_NAME) << "Got " << GST_MESSAGE_TYPE_NAME(msg) << " message from " << GST_MESSAGE_SRC_NAME(msg);
ofLogVerbose(LOG_NAME) << "Message source type: " << G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(messageSrc));
ofLogVerbose(LOG_NAME) << "With structure name: " << gst_structure_get_name(gst_message_get_structure(msg));
ofLogVerbose(LOG_NAME) << gst_structure_to_string(gst_message_get_structure(msg));
return true;
}
case GST_MESSAGE_QOS:{
GstObject * messageSrc = GST_MESSAGE_SRC(msg);
ofLogVerbose(LOG_NAME) << "Got " << GST_MESSAGE_TYPE_NAME(msg) << " message from " << GST_MESSAGE_SRC_NAME(msg);
ofLogVerbose(LOG_NAME) << "Message source type: " << G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(messageSrc));
GstFormat format;
guint64 processed;
guint64 dropped;
gst_message_parse_qos_stats(msg,&format,&processed,&dropped);
ofLogVerbose(LOG_NAME) << "format " << gst_format_get_name(format) << " processed " << processed << " dropped " << dropped;
gint64 jitter;
gdouble proportion;
gint quality;
gst_message_parse_qos_values(msg,&jitter,&proportion,&quality);
ofLogVerbose(LOG_NAME) << "jitter " << jitter << " proportion " << proportion << " quality " << quality;
gboolean live;
guint64 running_time;
guint64 stream_time;
guint64 timestamp;
guint64 duration;
gst_message_parse_qos(msg,&live,&running_time,&stream_time,×tamp,&duration);
ofLogVerbose(LOG_NAME) << "live stream " << live << " runninng_time " << running_time << " stream_time " << stream_time << " timestamp " << timestamp << " duration " << duration;
return true;
}
default:
//ofLogVerbose(LOG_NAME) << "Got " << GST_MESSAGE_TYPE_NAME(msg) << " message from " << GST_MESSAGE_SRC_NAME(msg);
return false;
}
}
示例15: _expandable_equals
static gint
_expandable_equals(gconstpointer self,
gconstpointer other,
GError **error)
{
g_error("Bad implementation of expandable->equals() in '%s' class.",
G_OBJECT_CLASS_NAME(self));
return 0;
}