コード例 #1
0
ファイル: gtkmarshal.c プロジェクト: zjx632/tinygtk
/* BOOL:NONE (gtkmarshal.list:1) */
void
gtk_marshal_BOOLEAN__VOID (GClosure     *closure,
                           GValue       *return_value,
                           guint         n_param_values,
                           const GValue *param_values,
                           gpointer      invocation_hint,
                           gpointer      marshal_data)
{
  typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer     data1,
                                                  gpointer     data2);
  register GMarshalFunc_BOOLEAN__VOID callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;
  gboolean v_return;

  g_return_if_fail (return_value != NULL);
  g_return_if_fail (n_param_values == 1);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data ? marshal_data : cc->callback);

  v_return = callback (data1,
                       data2);

  g_value_set_boolean (return_value, v_return);
}
コード例 #2
0
static void
gst_rdt_manager_marshal_VOID__UINT_UINT (GClosure * closure,
    GValue * return_value,
    guint n_param_values,
    const GValue * param_values,
    gpointer invocation_hint, gpointer marshal_data)
{
  typedef void (*GMarshalFunc_VOID__UINT_UINT) (gpointer data1,
      guint arg_1, guint arg_2, gpointer data2);
  register GMarshalFunc_VOID__UINT_UINT callback;
  register GCClosure *cc = (GCClosure *) closure;
  register gpointer data1, data2;

  g_return_if_fail (n_param_values == 3);

  if (G_CCLOSURE_SWAP_DATA (closure)) {
    data1 = closure->data;
    data2 = g_value_peek_pointer (param_values + 0);
  } else {
    data1 = g_value_peek_pointer (param_values + 0);
    data2 = closure->data;
  }
  callback =
      (GMarshalFunc_VOID__UINT_UINT) (marshal_data ? marshal_data :
      cc->callback);

  callback (data1,
      g_marshal_value_peek_uint (param_values + 1),
      g_marshal_value_peek_uint (param_values + 2), data2);
}
コード例 #3
0
ファイル: cong-marshal.c プロジェクト: GNOME/conglomerate
/* VOID:POINTER,STRING (cong.marshal:15) */
void
cong_cclosure_marshal_VOID__POINTER_STRING (GClosure     *closure,
                                            GValue       *return_value,
                                            guint         n_param_values,
                                            const GValue *param_values,
                                            gpointer      invocation_hint,
                                            gpointer      marshal_data)
{
  typedef void (*GMarshalFunc_VOID__POINTER_STRING) (gpointer     data1,
                                                     gpointer     arg_1,
                                                     gpointer     arg_2,
                                                     gpointer     data2);
  register GMarshalFunc_VOID__POINTER_STRING callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;

  g_return_if_fail (n_param_values == 3);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_VOID__POINTER_STRING) (marshal_data ? marshal_data : cc->callback);

  callback (data1,
            g_marshal_value_peek_pointer (param_values + 1),
            g_marshal_value_peek_string (param_values + 2),
            data2);
}
コード例 #4
0
ファイル: gstbus.c プロジェクト: WangCrystal/gstreamer
/* fixme: do something about this */
static void
marshal_VOID__MINIOBJECT (GClosure * closure, GValue * return_value,
    guint n_param_values, const GValue * param_values, gpointer invocation_hint,
    gpointer marshal_data)
{
  typedef void (*marshalfunc_VOID__MINIOBJECT) (gpointer obj, gpointer arg1,
      gpointer data2);
  register marshalfunc_VOID__MINIOBJECT callback;
  register GCClosure *cc = (GCClosure *) closure;
  register gpointer data1, data2;

  g_return_if_fail (n_param_values == 2);

  if (G_CCLOSURE_SWAP_DATA (closure)) {
    data1 = closure->data;
    data2 = g_value_peek_pointer (param_values + 0);
  } else {
    data1 = g_value_peek_pointer (param_values + 0);
    data2 = closure->data;
  }
  callback =
      (marshalfunc_VOID__MINIOBJECT) (marshal_data ? marshal_data :
      cc->callback);

  callback (data1, gst_value_get_mini_object (param_values + 1), data2);
}
コード例 #5
0
static void
marshal_VOID__USER_DATA_STRING (GClosure     *closure,
				GValue       *return_value,
				guint         n_param_values,
				const GValue *param_values,
				gpointer      invocation_hint,
				gpointer      marshal_data)
{
  typedef void (*marshal_func_VOID__USER_DATA_STRING_t) (gpointer     data1,
							 gpointer     data2,
							 gpointer     arg_1);
  register marshal_func_VOID__USER_DATA_STRING_t callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;

  g_return_if_fail (n_param_values == 2);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (marshal_func_VOID__USER_DATA_STRING_t) (
	  marshal_data ? marshal_data : cc->callback);

  callback (data1, data2, (char*) g_value_get_string (param_values + 1));
}
コード例 #6
0
ファイル: gstrtpdec.c プロジェクト: PeterXu/gst-mobile
static void
gst_rtp_dec_marshal_BOXED__UINT_UINT (GClosure * closure,
    GValue * return_value,
    guint n_param_values,
    const GValue * param_values,
    gpointer invocation_hint, gpointer marshal_data)
{
  typedef gpointer (*GMarshalFunc_BOXED__UINT_UINT) (gpointer data1,
      guint arg_1, guint arg_2, gpointer data2);
  register GMarshalFunc_BOXED__UINT_UINT callback;
  register GCClosure *cc = (GCClosure *) closure;
  register gpointer data1, data2;
  gpointer v_return;

  g_return_if_fail (return_value != NULL);
  g_return_if_fail (n_param_values == 3);

  if (G_CCLOSURE_SWAP_DATA (closure)) {
    data1 = closure->data;
    data2 = g_value_peek_pointer (param_values + 0);
  } else {
    data1 = g_value_peek_pointer (param_values + 0);
    data2 = closure->data;
  }
  callback =
      (GMarshalFunc_BOXED__UINT_UINT) (marshal_data ? marshal_data :
      cc->callback);

  v_return = callback (data1,
      g_marshal_value_peek_uint (param_values + 1),
      g_marshal_value_peek_uint (param_values + 2), data2);

  g_value_take_boxed (return_value, v_return);
}
コード例 #7
0
/* Can't use glib-genmarshal for this, as it doesn't know how to handle
 * GstMiniObject-based types, which are a new fundamental type */
static void
gst_app_marshal_BUFFER__VOID (GClosure * closure,
    GValue * return_value,
    guint n_param_values,
    const GValue * param_values,
    gpointer invocation_hint, gpointer marshal_data)
{
  typedef GstBuffer *(*GMarshalFunc_BUFFER__VOID) (gpointer data1,
      gpointer data2);
  register GMarshalFunc_BUFFER__VOID callback;
  register GCClosure *cc = (GCClosure *) closure;
  register gpointer data1, data2;
  GstBuffer *v_return;

  g_return_if_fail (return_value != NULL);
  g_return_if_fail (n_param_values == 1);

  if (G_CCLOSURE_SWAP_DATA (closure)) {
    data1 = closure->data;
    data2 = g_value_peek_pointer (param_values + 0);
  } else {
    data1 = g_value_peek_pointer (param_values + 0);
    data2 = closure->data;
  }
  callback =
      (GMarshalFunc_BUFFER__VOID) (marshal_data ? marshal_data : cc->callback);

  v_return = callback (data1, data2);

  gst_value_take_buffer (return_value, v_return);
}
コード例 #8
0
ファイル: win_gtk.cpp プロジェクト: chromylei/third_party
static void
g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure     *closure,
                                             GValue       * /*return_value*/,
                                             guint         n_param_values,
                                             const GValue *param_values,
                                             gpointer      /*invocation_hint*/,
                                             gpointer      marshal_data)
{
  typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer     data1,
                                                    gpointer     arg_1,
                                                    gpointer     arg_2,
                                                    gpointer     data2);
  GMarshalFunc_VOID__OBJECT_OBJECT callback;
  GCClosure *cc = (GCClosure*) closure;
  gpointer data1, data2;

  g_return_if_fail (n_param_values == 3);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);

  callback (data1,
            g_marshal_value_peek_object (param_values + 1),
            g_marshal_value_peek_object (param_values + 2),
            data2);
}
コード例 #9
0
static gfloat
gtkam_list_get_zoom_factor (GtkamList *list)
{
	GValue v = {0};
	GdkPixbuf *p;
	GtkTreeIter iter;
	gfloat w, w_orig;

	g_return_val_if_fail (GTKAM_IS_LIST (list), 1.);

	if (!gtk_tree_model_get_iter_first (
				GTK_TREE_MODEL (list->priv->store), &iter))
		return (1.);

	gtk_tree_model_get_value (GTK_TREE_MODEL (list->priv->store), &iter,
				  PREVIEW_ORIG_COLUMN, &v);
	p = g_value_peek_pointer (&v);
	w_orig = (p ? gdk_pixbuf_get_width (p) : 80);
	g_value_unset (&v);
	gtk_tree_model_get_value (GTK_TREE_MODEL (list->priv->store), &iter,
				  PREVIEW_COLUMN, &v);
	p = g_value_peek_pointer (&v);
	w = (p ? gdk_pixbuf_get_width (p) : 80);
	g_value_unset (&v);

	return (w / w_orig);
}
コード例 #10
0
ファイル: gtkhtml-embedded.c プロジェクト: Distrotech/gtkhtml
static void
draw_gdk_signal_marshaller (GClosure *closure,
                            GValue *return_value,
                            guint n_param_values,
                            const GValue *param_values,
                            gpointer invocation_hint,
                            gpointer marshal_data)
{
	register draw_gdk_signal ff;
	register GCClosure *cc = (GCClosure *) closure;
	register gpointer data1, data2;

	g_return_if_fail (n_param_values == 5);

	if (G_CCLOSURE_SWAP_DATA (closure))
		{
			data1 = closure->data;
			data2 = g_value_peek_pointer (param_values + 0);
		}
	else
		{
			data1 = g_value_peek_pointer (param_values + 0);
			data2 = closure->data;
		}
	ff = (draw_gdk_signal) (marshal_data ? marshal_data : cc->callback);

	ff (data1,
	    g_value_get_pointer (param_values + 1),
	    g_value_get_int (param_values + 2),
	    g_value_get_int (param_values + 3),
	    data2);
}
コード例 #11
0
ファイル: glib-util.c プロジェクト: TonyChiang/amanda
gboolean g_value_compare(GValue * a, GValue * b) {
    if (a == NULL && b == NULL)
        return TRUE;
    if (a == NULL || b == NULL)
        return FALSE;
    if (G_VALUE_TYPE(a) != G_VALUE_TYPE(b))
        return FALSE;
    if (g_value_fits_pointer(a) && g_value_fits_pointer(b)) {
        return g_value_peek_pointer(a) == g_value_peek_pointer(b);
    } else {
        /* Since there is no builtin comparison function, we resort to
           comparing serialized strings. Yuck. */
        char * a_str;
        char * b_str;
        gboolean rval;
        a_str = g_strdup_value_contents(a);
        b_str = g_strdup_value_contents(b);
        rval = (0 == strcmp(a_str, b_str));
        amfree(a_str);
        amfree(b_str);
        return rval;
    }
    
    g_assert_not_reached();
}
コード例 #12
0
static GstPadProbeReturn
buffer_probe_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
{
  GstBuffer *buffer = GST_PAD_PROBE_INFO_BUFFER (info);
  GstMapInfo map;

  gst_buffer_map (buffer, &map, GST_MAP_READ);

  if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_HEADER)) {
    GstCaps *caps;
    GstStructure *s;
    const GValue *sh;
    GArray *buffers;
    GstBuffer *buf;
    int i;
    gboolean found = FALSE;

    n_in_caps++;

    caps = gst_pad_get_current_caps (pad);
    s = gst_caps_get_structure (caps, 0);
    fail_unless (gst_structure_has_field (s, "streamheader"));
    sh = gst_structure_get_value (s, "streamheader");
    buffers = g_value_peek_pointer (sh);
    assert_equals_int (buffers->len, 3);

    for (i = 0; i < 3; ++i) {
      GValue *val;
      GstMapInfo map2;

      val = &g_array_index (buffers, GValue, i);
      buf = g_value_peek_pointer (val);
      fail_unless (GST_IS_BUFFER (buf));

      gst_buffer_map (buf, &map2, GST_MAP_READ);
      if (map2.size == map.size) {
        if (memcmp (map2.data, map.data, map.size) == 0) {
          found = TRUE;
        }
      }
      gst_buffer_unmap (buf, &map2);
    }
    fail_unless (found, "Did not find incoming HEADER buffer %p on caps",
        buffer);

    gst_caps_unref (caps);
  }
  gst_buffer_unmap (buffer, &map);

  return TRUE;
}
コード例 #13
0
ファイル: object.c プロジェクト: batman52/dingux-code
static gpointer
value_as_pointer (GValue *value)
{
  if (g_value_fits_pointer (value))
    return g_value_peek_pointer (value);
  if (G_VALUE_HOLDS_BOOLEAN (value))
    return (void*) g_value_get_boolean (value);
  if (G_VALUE_HOLDS_CHAR (value))
    return (void*) (gssize) g_value_get_char (value);
  if (G_VALUE_HOLDS_UCHAR (value))
    return (void*) (gsize) g_value_get_uchar (value);
  if (G_VALUE_HOLDS_INT (value))
    return (void*) g_value_get_int (value);
  if (G_VALUE_HOLDS_UINT (value))
    return (void*) g_value_get_uint (value);
  if (G_VALUE_HOLDS_LONG (value))
    return (void*) g_value_get_long (value);
  if (G_VALUE_HOLDS_ULONG (value))
    return (void*) g_value_get_ulong (value);
  if (G_VALUE_HOLDS_FLOAT (value))
    return (void*) (gssize) g_value_get_float (value);
  if (G_VALUE_HOLDS_DOUBLE (value))
    return (void*) (gssize) g_value_get_double (value);
  if (G_VALUE_HOLDS_ENUM (value))
    return (void*) (gssize) g_value_get_enum (value);
  if (G_VALUE_HOLDS_FLAGS (value))
    return (void*) (gsize) g_value_get_flags (value);
  return (void*) 0x1373babe;
}
コード例 #14
0
ファイル: glcanvas.cpp プロジェクト: AaronDP/wxWidgets
static gboolean
parent_set_hook(GSignalInvocationHint*, guint, const GValue* param_values, void* data)
{
    wxGLCanvas* win = (wxGLCanvas*)data;
    if (g_value_peek_pointer(&param_values[0]) == win->m_wxwindow)
    {
        const XVisualInfo* xvi = win->GetXVisualInfo();
        GdkVisual* visual = gtk_widget_get_visual(win->m_wxwindow);
        if (GDK_VISUAL_XVISUAL(visual)->visualid != xvi->visualid)
        {
            GdkScreen* screen = gtk_widget_get_screen(win->m_wxwindow);
            visual = gdk_x11_screen_lookup_visual(screen, xvi->visualid);
#ifdef __WXGTK3__
            gtk_widget_set_visual(win->m_wxwindow, visual);
#else
            GdkColormap* colormap = gdk_colormap_new(visual, false);
            gtk_widget_set_colormap(win->m_wxwindow, colormap);
            g_object_unref(colormap);
#endif
        }
        // remove hook
        return false;
    }
    return true;
}
コード例 #15
0
ファイル: moto-object-node.c プロジェクト: qewerty/moto.old
void moto_object_node_slide(MotoObjectNode *self,
        gfloat dx, gfloat dy, gfloat dz)
{
    gfloat ax[] = {1, 0, 0};
    gfloat ay[] = {0, 1, 0};
    gfloat az[] = {0, 0, 1};
    gfloat tax[3], tay[3], taz[3];
    gfloat *matrix = moto_object_node_get_matrix(self, FALSE);

    vector3_transform(tax, matrix, ax);
    vector3_transform(tay, matrix, ay);
    vector3_transform(taz, matrix, az);

    // FIXME: Rewrite with moto_value_[g|s]et_[boolean|int|float]_[2|3|4] when them will be implemented!
    gfloat *t = (gfloat *)g_value_peek_pointer(moto_node_get_param_value((MotoNode *)self, "t"));

    gfloat pos[3] = {t[0], t[1], t[2]};
    point3_move(pos, tax, dx);
    point3_move(pos, tay, dy);
    point3_move(pos, taz, dz);
    point3_move(self->priv->target, tax, dx);
    point3_move(self->priv->target, tay, dy);
    point3_move(self->priv->target, taz, dz);

    moto_object_node_set_translate_array(self, pos);
}
コード例 #16
0
ファイル: glcanvas.cpp プロジェクト: SCP-682/Cities3D
static gboolean
parent_set_hook(GSignalInvocationHint*, guint, const GValue* param_values, void* data)
{
    wxGLCanvas* win = (wxGLCanvas*)data;
    if (g_value_peek_pointer(&param_values[0]) == win->m_wxwindow)
    {
        const XVisualInfo* xvi = (XVisualInfo*)win->m_vi;
        GdkVisual* visual = gtk_widget_get_visual(win->m_wxwindow);
        if (GDK_VISUAL_XVISUAL(visual)->visualid != xvi->visualid)
        {
#if GTK_CHECK_VERSION(2, 2, 0)
            if (gtk_check_version(2, 2, 0) == NULL)
            {
                GdkScreen* screen = gtk_widget_get_screen(win->m_wxwindow);
                visual = gdk_x11_screen_lookup_visual(screen, xvi->visualid);
            }
            else
#endif
            {
                visual = gdkx_visual_get(xvi->visualid);
            }
            GdkColormap* colormap = gdk_colormap_new(visual, false);
            gtk_widget_set_colormap(win->m_wxwindow, colormap);
            g_object_unref(colormap);
        }
        // remove hook
        return false;
    }
    return true;
}
コード例 #17
0
/* BOOL:INT,INT,POINTER,POINTER (gtkextra-marshal.list:1) */
void
gtkextra_BOOLEAN__INT_INT_POINTER_POINTER (GClosure     *closure,
                                           GValue       *return_value,
                                           guint         n_param_values,
                                           const GValue *param_values,
                                           gpointer      invocation_hint,
                                           gpointer      marshal_data)
{
  typedef gboolean (*GMarshalFunc_BOOLEAN__INT_INT_POINTER_POINTER) (gpointer     data1,
                                                                     gint         arg_1,
                                                                     gint         arg_2,
                                                                     gpointer     arg_3,
                                                                     gpointer     arg_4,
                                                                     gpointer     data2);
  register GMarshalFunc_BOOLEAN__INT_INT_POINTER_POINTER callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;
  gboolean v_return;

  g_return_if_fail (return_value != NULL);
  g_return_if_fail (n_param_values == 5);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_BOOLEAN__INT_INT_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);

  v_return = callback (data1,
                       g_marshal_value_peek_int (param_values + 1),
                       g_marshal_value_peek_int (param_values + 2),
                       g_marshal_value_peek_pointer (param_values + 3),
                       g_marshal_value_peek_pointer (param_values + 4),
                       data2);

  g_value_set_boolean (return_value, v_return);
}
コード例 #18
0
ファイル: gtkmarshal.c プロジェクト: zjx632/tinygtk
/* NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER (gtkmarshal.list:34) */
void
gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER (GClosure     *closure,
                                                       GValue       *return_value,
                                                       guint         n_param_values,
                                                       const GValue *param_values,
                                                       gpointer      invocation_hint,
                                                       gpointer      marshal_data)
{
  typedef void (*GMarshalFunc_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER) (gpointer     data1,
                                                                          guint        arg_1,
                                                                          gpointer     arg_2,
                                                                          guint        arg_3,
                                                                          gint         arg_4,
                                                                          gint         arg_5,
                                                                          gpointer     arg_6,
                                                                          gpointer     data2);
  register GMarshalFunc_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;

  g_return_if_fail (n_param_values == 7);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER) (marshal_data ? marshal_data : cc->callback);

  callback (data1,
            g_marshal_value_peek_uint (param_values + 1),
            g_marshal_value_peek_pointer (param_values + 2),
            g_marshal_value_peek_uint (param_values + 3),
            g_marshal_value_peek_enum (param_values + 4),
            g_marshal_value_peek_enum (param_values + 5),
            g_marshal_value_peek_pointer (param_values + 6),
            data2);
}
コード例 #19
0
static void webkitVideoSinkMarshalVoidAndMiniObject(GClosure* closure, GValue*, guint parametersNumber, const GValue* parameterValues, gpointer, gpointer marshalData)
{
    typedef void (*marshalfunc_VOID__MINIOBJECT) (gpointer obj, gpointer arg1, gpointer data2);
    marshalfunc_VOID__MINIOBJECT callback;
    GCClosure* cclosure = reinterpret_cast<GCClosure*>(closure);
    gpointer data1, data2;

    g_return_if_fail(parametersNumber == 2);

    if (G_CCLOSURE_SWAP_DATA(closure)) {
        data1 = closure->data;
        data2 = g_value_peek_pointer(parameterValues + 0);
    } else {
        data1 = g_value_peek_pointer(parameterValues + 0);
        data2 = closure->data;
    }

    callback = (marshalfunc_VOID__MINIOBJECT) (marshalData ? marshalData : cclosure->callback);
    callback(data1, gst_value_get_mini_object(parameterValues + 1), data2);
}
コード例 #20
0
ファイル: moto-object-node.c プロジェクト: qewerty/moto.old
void moto_object_node_set_scale_array(MotoObjectNode *self,
        gfloat xyz[3])
{
    MotoNode *node = (MotoNode *)self;

    // FIXME: Rewrite with moto_value_[g|s]et_[boolean|int|float]_[2|3|4] when them will be implemented!
    gfloat *s = (gfloat *)g_value_peek_pointer(moto_node_get_param_value((MotoNode *)self, "s"));
    vector3_set(s, xyz[0], xyz[1], xyz[2]);

    self->priv->scale_calculated = FALSE;
    self->priv->transform_calculated = FALSE;
}
コード例 #21
0
ファイル: moto-object-node.c プロジェクト: qewerty/moto.old
void moto_object_node_set_rotate(MotoObjectNode *self,
        gfloat x, gfloat y, gfloat z)
{
    MotoNode *node = (MotoNode *)self;

    // FIXME: Rewrite with moto_value_[g|s]et_[boolean|int|float]_[2|3|4] when them will be implemented!
    gfloat *r = (gfloat *)g_value_peek_pointer(moto_node_get_param_value((MotoNode *)self, "r"));
    vector3_set(r, x, y, z);

    self->priv->rotate_calculated = FALSE;
    self->priv->transform_calculated = FALSE;
}
コード例 #22
0
ファイル: moto-object-node.c プロジェクト: qewerty/moto.old
static void moto_object_node_calc_translate(MotoObjectNode *self)
{
    if(self->priv->translate_calculated)
        return;

    // FIXME: Rewrite with moto_value_[g|s]et_[boolean|int|float]_[2|3|4] when them will be implemented!
    gfloat *t = (gfloat *)g_value_peek_pointer(moto_node_get_param_value((MotoNode *)self, "t"));

    matrix44_translate(self->priv->translate_matrix, t[0], t[1], t[2]);

    self->priv->translate_calculated = TRUE;
}
コード例 #23
0
ファイル: eggcellrendererkeys.c プロジェクト: GNOME/libegg
/* VOID:STRING,UINT,FLAGS,UINT */
static void
marshal_VOID__STRING_UINT_FLAGS_UINT (GClosure     *closure,
                                      GValue       *return_value,
				      guint         n_param_values,
				      const GValue *param_values,
				      gpointer      invocation_hint,
				      gpointer      marshal_data)
{
  typedef void (*GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT) (gpointer     data1,
                                                             const char  *arg_1,
							     guint        arg_2,
							     int          arg_3,
							     guint        arg_4,
							     gpointer     data2);
  register GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;

  g_return_if_fail (n_param_values == 5);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }

  callback = (GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT) (marshal_data ? marshal_data : cc->callback);

  callback (data1,
            g_value_get_string (param_values + 1),
            g_value_get_uint (param_values + 2),
            g_value_get_flags (param_values + 3),
	    g_value_get_uint (param_values + 4),
            data2);
}
コード例 #24
0
/* VOID:DOUBLE,DOUBLE,DOUBLE,DOUBLE (gtkextra-marshal.list:25) */
void
gtkextra_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE (GClosure     *closure,
                                            GValue       *return_value,
                                            guint         n_param_values,
                                            const GValue *param_values,
                                            gpointer      invocation_hint,
                                            gpointer      marshal_data)
{
  typedef void (*GMarshalFunc_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE) (gpointer     data1,
                                                                  gdouble      arg_1,
                                                                  gdouble      arg_2,
                                                                  gdouble      arg_3,
                                                                  gdouble      arg_4,
                                                                  gpointer     data2);
  register GMarshalFunc_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;

  g_return_if_fail (n_param_values == 5);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE) (marshal_data ? marshal_data : cc->callback);

  callback (data1,
            g_marshal_value_peek_double (param_values + 1),
            g_marshal_value_peek_double (param_values + 2),
            g_marshal_value_peek_double (param_values + 3),
            g_marshal_value_peek_double (param_values + 4),
            data2);
}
コード例 #25
0
ファイル: sexy-marshal.c プロジェクト: XcomReborn/hexchat
/* OBJECT:OBJECT,OBJECT (./marshal.list:2) */
void
sexy_marshal_OBJECT__OBJECT_OBJECT (GClosure     *closure,
                                    GValue       *return_value,
                                    guint         n_param_values,
                                    const GValue *param_values,
                                    gpointer      invocation_hint,
                                    gpointer      marshal_data)
{
  typedef GObject* (*GMarshalFunc_OBJECT__OBJECT_OBJECT) (gpointer     data1,
                                                          gpointer     arg_1,
                                                          gpointer     arg_2,
                                                          gpointer     data2);
  register GMarshalFunc_OBJECT__OBJECT_OBJECT callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;
  GObject* v_return;

  g_return_if_fail (return_value != NULL);
  g_return_if_fail (n_param_values == 3);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_OBJECT__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);

  v_return = callback (data1,
                       g_marshal_value_peek_object (param_values + 1),
                       g_marshal_value_peek_object (param_values + 2),
                       data2);

  g_value_take_object (return_value, v_return);
}
コード例 #26
0
ファイル: gvs-serializer.c プロジェクト: kingdedede/gvs
static gsize
push_entity(GvsSerializer *self, const GValue *value)
{
    GvsSerializerPrivate *priv = self->priv;

    EntityRef *ref = make_entity_ref(priv->num_entities++, value);
    
    g_hash_table_insert(priv->entity_map, g_value_peek_pointer(value), ref);

    g_queue_push_head(&priv->queue, ref);

    return ref->id;
}
コード例 #27
0
ファイル: gtkmarshal.c プロジェクト: zjx632/tinygtk
/* ENUM:ENUM (gtkmarshal.list:7) */
void
gtk_marshal_ENUM__ENUM (GClosure     *closure,
                        GValue       *return_value,
                        guint         n_param_values,
                        const GValue *param_values,
                        gpointer      invocation_hint,
                        gpointer      marshal_data)
{
  typedef gint (*GMarshalFunc_ENUM__ENUM) (gpointer     data1,
                                           gint         arg_1,
                                           gpointer     data2);
  register GMarshalFunc_ENUM__ENUM callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;
  gint v_return;

  g_return_if_fail (return_value != NULL);
  g_return_if_fail (n_param_values == 2);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_ENUM__ENUM) (marshal_data ? marshal_data : cc->callback);

  v_return = callback (data1,
                       g_marshal_value_peek_enum (param_values + 1),
                       data2);

  g_value_set_enum (return_value, v_return);
}
コード例 #28
0
ファイル: gtkmarshal.c プロジェクト: zjx632/tinygtk
/* NONE:ENUM,FLOAT,BOOL (gtkmarshal.list:14) */
void
gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN (GClosure     *closure,
                                      GValue       *return_value,
                                      guint         n_param_values,
                                      const GValue *param_values,
                                      gpointer      invocation_hint,
                                      gpointer      marshal_data)
{
  typedef void (*GMarshalFunc_VOID__ENUM_FLOAT_BOOLEAN) (gpointer     data1,
                                                         gint         arg_1,
                                                         gfloat       arg_2,
                                                         gboolean     arg_3,
                                                         gpointer     data2);
  register GMarshalFunc_VOID__ENUM_FLOAT_BOOLEAN callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;

  g_return_if_fail (n_param_values == 4);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_VOID__ENUM_FLOAT_BOOLEAN) (marshal_data ? marshal_data : cc->callback);

  callback (data1,
            g_marshal_value_peek_enum (param_values + 1),
            g_marshal_value_peek_float (param_values + 2),
            g_marshal_value_peek_boolean (param_values + 3),
            data2);
}
コード例 #29
0
/* VOID:OBJECT,INT64,INT64 (gstselector-marshal.list:2) */
void
gst_selector_marshal_VOID__OBJECT_INT64_INT64 (GClosure     *closure,
                                               GValue       *return_value,
                                               guint         n_param_values,
                                               const GValue *param_values,
                                               gpointer      invocation_hint,
                                               gpointer      marshal_data)
{
  typedef void (*GMarshalFunc_VOID__OBJECT_INT64_INT64) (gpointer     data1,
                                                         gpointer     arg_1,
                                                         gint64       arg_2,
                                                         gint64       arg_3,
                                                         gpointer     data2);
  register GMarshalFunc_VOID__OBJECT_INT64_INT64 callback;
  register GCClosure *cc = (GCClosure*) closure;
  register gpointer data1, data2;

  g_return_if_fail (n_param_values == 4);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }
  callback = (GMarshalFunc_VOID__OBJECT_INT64_INT64) (marshal_data ? marshal_data : cc->callback);

  callback (data1,
            g_marshal_value_peek_object (param_values + 1),
            g_marshal_value_peek_int64 (param_values + 2),
            g_marshal_value_peek_int64 (param_values + 3),
            data2);
}
コード例 #30
0
ファイル: gvs-serializer.c プロジェクト: kingdedede/gvs
static GVariant *
serialize_boxed_default(GvsSerializer *self, EntityRef *ref)
{
    GVariant *variant = NULL;
    const BuiltinTransform *transform;

    transform = lookup_builtin_transform(G_VALUE_TYPE(&ref->value));

    if (g_value_peek_pointer(&ref->value) && transform)
    {
        variant = transform->serialize(self, &ref->value, NULL);
    }

    return variant;
}