Esempio n. 1
0
static void owr_media_renderer_set_property(GObject *object, guint property_id,
        const GValue *value, GParamSpec *pspec)
{
    OwrMediaRendererPrivate *priv;

    g_return_if_fail(object);
    priv = OWR_MEDIA_RENDERER_GET_PRIVATE(object);

    switch (property_id) {
    case PROP_MEDIA_TYPE:
        priv->media_type = g_value_get_enum(value);
        break;

    case PROP_DISABLED:
        priv->disabled = g_value_get_boolean(value);
        break;

    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
        break;
    }
}
static void
task_shell_content_set_property (GObject *object,
				 guint property_id,
				 const GValue *value,
				 GParamSpec *pspec)
{
	switch (property_id) {
		case PROP_ORIENTATION:
			task_shell_content_set_orientation (
				E_TASK_SHELL_CONTENT (object),
				g_value_get_enum (value));
			return;

		case PROP_PREVIEW_VISIBLE:
			e_task_shell_content_set_preview_visible (
				E_TASK_SHELL_CONTENT (object),
				g_value_get_boolean (value));
			return;
	}

	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
Esempio n. 3
0
static void
set_property(GObject *obj,
	     guint prop_id,
	     const GValue *value,
	     GParamSpec *pspec)
{
	GstDspVEnc *self = GST_DSP_VENC(obj);

	switch (prop_id) {
	case ARG_BITRATE: {
		guint bitrate;
		bitrate = g_value_get_uint(value);
		if (self->max_bitrate && bitrate > (unsigned) self->max_bitrate)
			bitrate = self->max_bitrate;
		g_atomic_int_set(&self->bitrate, bitrate);
		break;
	}
	case ARG_MODE:
		self->mode = g_value_get_enum(value);
		/* guess intra-refresh, if not manually set */
		if (self->intra_refresh_set)
			break;
		self->intra_refresh = (self->mode == 1);
		break;
	case ARG_KEYFRAME_INTERVAL:
		g_atomic_int_set(&self->keyframe_interval, g_value_get_int(value));
		break;
	case ARG_MAX_BITRATE:
		self->user_max_bitrate = g_value_get_uint(value);
		break;
	case ARG_INTRA_REFRESH:
		self->intra_refresh = g_value_get_boolean(value);
		self->intra_refresh_set = true;
		break;
	default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop_id, pspec);
		break;
	}
}
static void
gimp_cage_options_set_property (GObject      *object,
                                guint         property_id,
                                const GValue *value,
                                GParamSpec   *pspec)
{
  GimpCageOptions *options = GIMP_CAGE_OPTIONS (object);

  switch (property_id)
    {
    case PROP_CAGE_MODE:
      options->cage_mode = g_value_get_enum (value);
      break;
    case PROP_FILL_PLAIN_COLOR:
      options->fill_plain_color = g_value_get_boolean (value);
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
      break;
    }
}
Esempio n. 5
0
static GimpValueArray *
image_select_polygon_invoker (GimpProcedure         *procedure,
                              Gimp                  *gimp,
                              GimpContext           *context,
                              GimpProgress          *progress,
                              const GimpValueArray  *args,
                              GError               **error)
{
  gboolean success = TRUE;
  GimpImage *image;
  gint32 operation;
  gint32 num_segs;
  const gdouble *segs;

  image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
  operation = g_value_get_enum (gimp_value_array_index (args, 1));
  num_segs = g_value_get_int (gimp_value_array_index (args, 2));
  segs = gimp_value_get_floatarray (gimp_value_array_index (args, 3));

  if (success)
    {
      GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);

      gimp_channel_select_polygon (gimp_image_get_mask (image),
                                   _("Free Select"),
                                   num_segs / 2,
                                   (GimpVector2 *) segs,
                                   operation,
                                   pdb_context->antialias,
                                   pdb_context->feather,
                                   pdb_context->feather_radius_x,
                                   pdb_context->feather_radius_y,
                                   TRUE);
    }

  return gimp_procedure_get_return_values (procedure, success,
                                           error ? *error : NULL);
}
Esempio n. 6
0
static void
gimp_hue_saturation_config_set_property (GObject      *object,
                                         guint         property_id,
                                         const GValue *value,
                                         GParamSpec   *pspec)
{
  GimpHueSaturationConfig *self = GIMP_HUE_SATURATION_CONFIG (object);

  switch (property_id)
    {
    case PROP_RANGE:
      self->range = g_value_get_enum (value);
      g_object_notify (object, "hue");
      g_object_notify (object, "saturation");
      g_object_notify (object, "lightness");
      break;

    case PROP_HUE:
      self->hue[self->range] = g_value_get_double (value);
      break;

    case PROP_SATURATION:
      self->saturation[self->range] = g_value_get_double (value);
      break;

    case PROP_LIGHTNESS:
      self->lightness[self->range] = g_value_get_double (value);
      break;

    case PROP_OVERLAP:
      self->overlap = g_value_get_double (value);
      break;

   default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
      break;
    }
}
static void
gst_tee_set_property (GObject * object, guint prop_id, const GValue * value,
    GParamSpec * pspec)
{
  GstTee *tee = GST_TEE (object);

  GST_OBJECT_LOCK (tee);
  switch (prop_id) {
    case PROP_HAS_CHAIN:
      tee->has_chain = g_value_get_boolean (value);
      break;
    case PROP_SILENT:
      tee->silent = g_value_get_boolean (value);
      break;
    case PROP_PULL_MODE:
      tee->pull_mode = (GstTeePullMode) g_value_get_enum (value);
      break;
    case PROP_ALLOC_PAD:
    {
      GstPad *pad = g_value_get_object (value);
      GST_OBJECT_LOCK (pad);
      if (GST_OBJECT_PARENT (pad) == GST_OBJECT_CAST (object))
        tee->allocpad = pad;
      else
        GST_WARNING_OBJECT (object, "Tried to set alloc pad %s which"
            " is not my pad", GST_OBJECT_NAME (pad));
      GST_OBJECT_UNLOCK (pad);
      break;
    }
    case PROP_ALLOW_NOT_LINKED:
      tee->allow_not_linked = g_value_get_boolean (value);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
  GST_OBJECT_UNLOCK (tee);
}
static void
gimp_color_balance_config_set_property (GObject      *object,
                                        guint         property_id,
                                        const GValue *value,
                                        GParamSpec   *pspec)
{
    GimpColorBalanceConfig *self = GIMP_COLOR_BALANCE_CONFIG (object);

    switch (property_id)
    {
    case PROP_RANGE:
        self->range = g_value_get_enum (value);
        g_object_notify (object, "cyan-red");
        g_object_notify (object, "magenta-green");
        g_object_notify (object, "yellow-blue");
        break;

    case PROP_CYAN_RED:
        self->cyan_red[self->range] = g_value_get_double (value);
        break;

    case PROP_MAGENTA_GREEN:
        self->magenta_green[self->range] = g_value_get_double (value);
        break;

    case PROP_YELLOW_BLUE:
        self->yellow_blue[self->range] = g_value_get_double (value);
        break;

    case PROP_PRESERVE_LUMINOSITY:
        self->preserve_luminosity = g_value_get_boolean (value);
        break;

    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
        break;
    }
}
Esempio n. 9
0
static void
dict_set_property(GObject *object, guint prop_id, const GValue *value,
		  GParamSpec *pspec)
{
  WordListWindow *window = WORD_LIST_WINDOW(object);
  uim_dict *dict = NULL;
  gchar message[128];

  switch (prop_id) {
  case PROP_DICTIONARY_TYPE:
    window->dictionary_type = g_value_get_enum(value);

    ACTIVATE_ACTION(window, dictionary_entries[window->dictionary_type].name);

    switch (window->dictionary_type) {
    case DICT_ENUM_DICTIONARY_TYPE_ANTHY:
      dict = uim_dict_open(N_("Anthy private dictionary"));
      break;
    case DICT_ENUM_DICTIONARY_TYPE_CANNA:
      word_list_view_set_visible_freq_column(WORD_LIST_VIEW(window->word_list), FALSE);
      dict = uim_dict_open(N_("Canna private dictionary"));
      break;
    default:
      break;
    }
    if (!dict) {
      warn_dict_open();
      break;
    }
    word_list_view_set_dict(WORD_LIST_VIEW(window->word_list), dict);

    g_snprintf(message, sizeof(message), _("%s"), _(dict->identifier));
    gtk_statusbar_push(GTK_STATUSBAR(window->statusbar), 0, _(dict->identifier));
    break;
  default:
    break;
  }
}
Esempio n. 10
0
static void
hos_cursor_set_property (GObject         *object,
			 guint            prop_id,
			 const GValue    *value,
			 GParamSpec      *pspec)
{
  switch (prop_id)
    {
    case PROP_POSITION:
      gtk_adjustment_set_value(HOS_CURSOR(object)->adjustment,
			       g_value_get_double(value));
      break;
    case PROP_ADJUSTMENT:
      cursor_set_adjustment(HOS_CURSOR(object), GTK_ADJUSTMENT(g_value_get_object(value)));
      break;
    case PROP_ORIENTATION:
      cursor_set_orientation(HOS_CURSOR(object), g_value_get_enum(value));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
    }
}
Esempio n. 11
0
static GimpValueArray *
image_flip_invoker (GimpProcedure         *procedure,
                    Gimp                  *gimp,
                    GimpContext           *context,
                    GimpProgress          *progress,
                    const GimpValueArray  *args,
                    GError               **error)
{
  gboolean success = TRUE;
  GimpImage *image;
  gint32 flip_type;

  image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
  flip_type = g_value_get_enum (gimp_value_array_index (args, 1));

  if (success)
    {
      gimp_image_flip (image, context, flip_type, NULL);
    }

  return gimp_procedure_get_return_values (procedure, success,
                                           error ? *error : NULL);
}
static void
set_property (GObject      *object,
              guint         prop_id,
              const GValue *value,
              GParamSpec   *pspec)
{
    CutConsoleUIFactory *console = CUT_CONSOLE_UI_FACTORY(object);

    switch (prop_id) {
    case PROP_USE_COLOR:
        console->use_color = g_value_get_boolean(value);
        break;
    case PROP_VERBOSE_LEVEL:
        console->verbose_level = g_value_get_enum(value);
        break;
    case PROP_SHOW_DETAIL_IMMEDIATELY:
        console->show_detail_immediately = g_value_get_boolean(value);
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
        break;
    }
}
static void
ges_track_video_transition_set_property (GObject * object,
    guint property_id, const GValue * value, GParamSpec * pspec)
{
  GESTrackVideoTransition *tr = GES_TRACK_VIDEO_TRANSITION (object);

  switch (property_id) {
    case PROP_BORDER:
      ges_track_video_transition_set_border_internal (tr,
          g_value_get_uint (value));
      break;
    case PROP_TRANSITION_TYPE:
      ges_track_video_transition_set_transition_type_internal (tr,
          g_value_get_enum (value));
      break;
    case PROP_INVERT:
      ges_track_video_transition_set_inverted_internal (tr,
          g_value_get_boolean (value));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
  }
}
Esempio n. 14
0
static void
file_powerbox_set_property (GObject      *object,
			    guint         prop_id,
			    const GValue *value,
			    GParamSpec   *pspec)
{
  FilePowerbox *pb = FILE_POWERBOX(object);
  switch(prop_id) {
    case PROP_ACTION:
      pb->action = g_value_get_enum(value);
      break;
    case PROP_LOCAL_ONLY:
      pb->local_only = g_value_get_boolean(value);
      break;
    case PROP_SELECT_MULTIPLE:
      pb->select_multiple = g_value_get_boolean(value);
      break;
      
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}
Esempio n. 15
0
static void
ges_test_clip_set_property (GObject * object, guint property_id,
    const GValue * value, GParamSpec * pspec)
{
  GESTestClip *uriclip = GES_TEST_CLIP (object);

  switch (property_id) {
    case PROP_MUTE:
      ges_test_clip_set_mute (uriclip, g_value_get_boolean (value));
      break;
    case PROP_VPATTERN:
      ges_test_clip_set_vpattern (uriclip, g_value_get_enum (value));
      break;
    case PROP_FREQ:
      ges_test_clip_set_frequency (uriclip, g_value_get_double (value));
      break;
    case PROP_VOLUME:
      ges_test_clip_set_volume (uriclip, g_value_get_double (value));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
  }
}
Esempio n. 16
0
static void
gst_base_camera_src_set_property (GObject * object,
    guint prop_id, const GValue * value, GParamSpec * pspec)
{
  GstBaseCameraSrc *self = GST_BASE_CAMERA_SRC (object);

  switch (prop_id) {
    case PROP_MODE:
      gst_base_camera_src_set_mode (GST_BASE_CAMERA_SRC (self),
          g_value_get_enum (value));
      break;
    case PROP_ZOOM:{
      g_atomic_int_set (&self->zoom, g_value_get_int (value));
      /* does not set it if in NULL, the src is not created yet */
      if (GST_STATE (self) != GST_STATE_NULL)
        gst_base_camera_src_setup_zoom (self);
      break;
    }
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec);
      break;
  }
}
Esempio n. 17
0
/**
 * gst_query_parse_buffering_range:
 * @query: a GST_QUERY_SEEKING type query #GstQuery
 * @format: the format to set for the @segment_start and @segment_end values
 * @start: the start to set
 * @stop: the stop to set
 * @estimated_total: estimated total amount of download time
 *
 * Parse an available query, writing the format into @format, and 
 * other results into the passed parameters, if the respective parameters
 * are non-NULL
 *
 * Since: 0.10.20
 */
void
gst_query_parse_buffering_range (GstQuery * query, GstFormat * format,
    gint64 * start, gint64 * stop, gint64 * estimated_total)
{
  GstStructure *structure;

  g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_BUFFERING);

  structure = gst_query_get_structure (query);
  if (format)
    *format = g_value_get_enum (gst_structure_id_get_value (structure,
            GST_QUARK (FORMAT)));
  if (start)
    *start = g_value_get_int64 (gst_structure_id_get_value (structure,
            GST_QUARK (START_VALUE)));
  if (stop)
    *stop = g_value_get_int64 (gst_structure_id_get_value (structure,
            GST_QUARK (STOP_VALUE)));
  if (estimated_total)
    *estimated_total =
        g_value_get_int64 (gst_structure_id_get_value (structure,
            GST_QUARK (ESTIMATED_TOTAL)));
}
Esempio n. 18
0
static void
xedit_document_input_stream_set_property (GObject      *object,
					  guint         prop_id,
					  const GValue *value,
					  GParamSpec   *pspec)
{
	XeditDocumentInputStream *stream = XEDIT_DOCUMENT_INPUT_STREAM (object);

	switch (prop_id)
	{
		case PROP_BUFFER:
			stream->priv->buffer = GTK_TEXT_BUFFER (g_value_get_object (value));
			break;

		case PROP_NEWLINE_TYPE:
			stream->priv->newline_type = g_value_get_enum (value);
			break;

		default:
			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
			break;
	}
}
Esempio n. 19
0
static void
gst_video_scale_set_property (GObject * object, guint prop_id,
    const GValue * value, GParamSpec * pspec)
{
  GstVideoScale *vscale = GST_VIDEO_SCALE (object);

  switch (prop_id) {
    case PROP_METHOD:
      GST_OBJECT_LOCK (vscale);
      vscale->method = g_value_get_enum (value);
      GST_OBJECT_UNLOCK (vscale);
      break;
    case PROP_ADD_BORDERS:
      GST_OBJECT_LOCK (vscale);
      vscale->add_borders = g_value_get_boolean (value);
      GST_OBJECT_UNLOCK (vscale);
      gst_base_transform_reconfigure (GST_BASE_TRANSFORM_CAST (vscale));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}
Esempio n. 20
0
static void
gdk_cursor_set_property (GObject      *object,
                         guint         prop_id,
                         const GValue *value,
                         GParamSpec   *pspec)
{
  GdkCursor *cursor = GDK_CURSOR (object);

  switch (prop_id)
    {
    case PROP_CURSOR_TYPE:
      cursor->type = g_value_get_enum (value);
      break;
    case PROP_DISPLAY:
      cursor->display = g_value_get_object (value);
      /* check that implementations actually provide the display when constructing */
      g_assert (cursor->display != NULL);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
    }
}
Esempio n. 21
0
static void xmi_msim_compound_dialog_set_property(GObject *object, guint prop_id, const GValue *value,  GParamSpec *pspec) {

  XmiMsimGuiCompoundDialog *dialog = XMI_MSIM_GUI_COMPOUND_DIALOG(object);

  switch (prop_id) {
    case PROP_COMPOUND_DIALOG_TYPE:
      dialog->compound_dialog_type = g_value_get_enum(value);
      if (dialog->compound_dialog_type == XMI_MSIM_GUI_COMPOUND_DIALOG_ADD) {
        gtk_window_set_title(GTK_WINDOW(dialog), "Enter a compound");
        gtk_widget_set_sensitive(gtk_dialog_get_widget_for_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT), FALSE);
	gtk_editable_set_editable(GTK_EDITABLE(dialog->compoundEntry), TRUE);
      }
      else if (dialog->compound_dialog_type == XMI_MSIM_GUI_COMPOUND_DIALOG_EDIT) {
        gtk_window_set_title(GTK_WINDOW(dialog), "Modify a compound");
	gtk_editable_set_editable(GTK_EDITABLE(dialog->compoundEntry), FALSE);
	gtk_widget_set_sensitive(dialog->compoundEntry, FALSE);
      }
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
  }

}
static void
mx_scroll_bar_set_property (GObject      *gobject,
                            guint         prop_id,
                            const GValue *value,
                            GParamSpec   *pspec)
{
  MxScrollBar *bar = MX_SCROLL_BAR (gobject);

  switch (prop_id)
    {
    case PROP_ADJUSTMENT:
      mx_scroll_bar_set_adjustment (bar, g_value_get_object (value));
      break;

    case PROP_ORIENTATION:
      mx_scroll_bar_set_orientation (bar, g_value_get_enum (value));
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
      break;
    }
}
Esempio n. 23
0
static GValueArray *
channel_new_from_component_invoker (GimpProcedure     *procedure,
                                    Gimp              *gimp,
                                    GimpContext       *context,
                                    GimpProgress      *progress,
                                    const GValueArray *args)
{
  gboolean success = TRUE;
  GValueArray *return_vals;
  GimpImage *image;
  gint32 component;
  const gchar *name;
  GimpChannel *channel = NULL;

  image = gimp_value_get_image (&args->values[0], gimp);
  component = g_value_get_enum (&args->values[1]);
  name = g_value_get_string (&args->values[2]);

  if (success)
    {
      if (gimp_image_get_component_index (image, component) != -1)
        channel = gimp_channel_new_from_component (image,
                                                   component, name, NULL);

      if (channel)
        gimp_item_set_visible (GIMP_ITEM (channel), FALSE, FALSE);
      else
        success = FALSE;
    }

  return_vals = gimp_procedure_get_return_values (procedure, success);

  if (success)
    gimp_value_set_channel (&return_vals->values[1], channel);

  return return_vals;
}
Esempio n. 24
0
static void
gst_openjpeg_enc_set_property (GObject * object, guint prop_id,
    const GValue * value, GParamSpec * pspec)
{
  GstOpenJPEGEnc *self = GST_OPENJPEG_ENC (object);

  switch (prop_id) {
    case PROP_NUM_LAYERS:
      self->params.tcp_numlayers = g_value_get_int (value);
      break;
    case PROP_NUM_RESOLUTIONS:
      self->params.numresolution = g_value_get_int (value);
      break;
    case PROP_PROGRESSION_ORDER:
      self->params.prog_order = g_value_get_enum (value);
      break;
    case PROP_TILE_OFFSET_X:
      self->params.cp_tx0 = g_value_get_int (value);
      break;
    case PROP_TILE_OFFSET_Y:
      self->params.cp_ty0 = g_value_get_int (value);
      break;
    case PROP_TILE_WIDTH:
      self->params.cp_tdx = g_value_get_int (value);
      self->params.tile_size_on = (self->params.cp_tdx != 0
          && self->params.cp_tdy != 0);
      break;
    case PROP_TILE_HEIGHT:
      self->params.cp_tdy = g_value_get_int (value);
      self->params.tile_size_on = (self->params.cp_tdx != 0
          && self->params.cp_tdy != 0);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}
Esempio n. 25
0
static void
gst_vaapi_decode_bin_set_property (GObject * object,
    guint prop_id, const GValue * value, GParamSpec * pspec)
{
  GstVaapiDecodeBin *vaapidecbin = GST_VAAPI_DECODE_BIN (object);

  switch (prop_id) {
    case PROP_MAX_SIZE_BYTES:
      vaapidecbin->max_size_bytes = g_value_get_uint (value);
      g_object_set (G_OBJECT (vaapidecbin->queue), "max-size-bytes",
          vaapidecbin->max_size_bytes, NULL);
      break;
    case PROP_MAX_SIZE_BUFFERS:
      vaapidecbin->max_size_buffers = g_value_get_uint (value);
      g_object_set (G_OBJECT (vaapidecbin->queue), "max-size-buffers",
          vaapidecbin->max_size_buffers, NULL);
      break;
    case PROP_MAX_SIZE_TIME:
      vaapidecbin->max_size_time = g_value_get_uint64 (value);
      g_object_set (G_OBJECT (vaapidecbin->queue), "max-size-time",
          vaapidecbin->max_size_time, NULL);
      break;
    case PROP_DEINTERLACE_METHOD:
      vaapidecbin->deinterlace_method = g_value_get_enum (value);
      if (vaapidecbin->postproc)
        g_object_set (G_OBJECT (vaapidecbin->postproc), "deinterlace-method",
            vaapidecbin->deinterlace_method, NULL);
      break;
    case PROP_DISABLE_VPP:
      /* @TODO: Add run-time disabling support */
      vaapidecbin->disable_vpp = g_value_get_boolean (value);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}
Esempio n. 26
0
static void
_adg_set_property(GObject *object, guint prop_id,
                  const GValue *value, GParamSpec *pspec)
{
    AdgStrokePrivate *data = ((AdgStroke *) object)->data;
    AdgTrail *old_trail;

    switch (prop_id) {
    case PROP_LINE_DRESS:
        data->line_dress = g_value_get_enum(value);
        break;
    case PROP_TRAIL:
        old_trail = data->trail;
        data->trail = g_value_get_object(value);

        if (data->trail != old_trail) {
            if (data->trail != NULL) {
                g_object_ref(data->trail);
                g_object_weak_ref((GObject *) data->trail,
                                  (GWeakNotify) _adg_unset_trail, object);
                adg_model_add_dependency((AdgModel *) data->trail,
                                         (AdgEntity *) object);
            }
            if (old_trail != NULL) {
                g_object_unref(data->trail);
                g_object_weak_unref((GObject *) old_trail,
                                    (GWeakNotify) _adg_unset_trail, object);
                adg_model_remove_dependency((AdgModel *) old_trail,
                                            (AdgEntity *) object);
            }
        }
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
        break;
    }
}
Esempio n. 27
0
static void
_adg_set_property(GObject *object, guint prop_id,
                  const GValue *value, GParamSpec *pspec)
{
    AdgLineStyle *line_style;
    AdgLineStylePrivate *data;

    line_style = (AdgLineStyle *) object;
    data = line_style->data;

    switch (prop_id) {
    case PROP_COLOR_DRESS:
        data->color_dress = g_value_get_enum(value);
        break;
    case PROP_WIDTH:
        data->width = g_value_get_double(value);
        break;
    case PROP_CAP:
        data->cap = g_value_get_int(value);
        break;
    case PROP_JOIN:
        data->join = g_value_get_int(value);
        break;
    case PROP_MITER_LIMIT:
        data->miter_limit = g_value_get_double(value);
        break;
    case PROP_ANTIALIAS:
        data->antialias = g_value_get_int(value);
        break;
    case PROP_DASH:
        _adg_change_dash(line_style, g_value_get_boxed(value));
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
        break;
    }
}
Esempio n. 28
0
static void
gst_ffmpegenc_set_property (GObject * object,
    guint prop_id, const GValue * value, GParamSpec * pspec)
{
  GstFFMpegEnc *ffmpegenc;

  /* Get a pointer of the right type. */
  ffmpegenc = (GstFFMpegEnc *) (object);

  if (ffmpegenc->opened) {
    GST_WARNING_OBJECT (ffmpegenc,
        "Can't change properties once decoder is setup !");
    return;
  }

  /* Check the argument id to see which argument we're setting. */
  switch (prop_id) {
    case ARG_BIT_RATE:
      ffmpegenc->bitrate = g_value_get_ulong (value);
      break;
    case ARG_GOP_SIZE:
      ffmpegenc->gop_size = g_value_get_int (value);
      break;
    case ARG_ME_METHOD:
      ffmpegenc->me_method = g_value_get_enum (value);
      break;
    case ARG_BUFSIZE:
      break;
    case ARG_RTP_PAYLOAD_SIZE:
      ffmpegenc->rtp_payload_size = g_value_get_ulong (value);
      break;
    default:
      if (!gst_ffmpeg_cfg_set_property (object, value, pspec))
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}
Esempio n. 29
0
static void
fr_command_set_property (GObject      *object,
                         guint         prop_id,
                         const GValue *value,
                         GParamSpec   *pspec)
{
    FrCommand *comm;

    comm = FR_COMMAND (object);

    switch (prop_id) {
    case PROP_PROCESS:
        fr_command_set_process (comm, g_value_get_object (value));
        break;
    case PROP_FILE:
        fr_command_set_file (comm, g_value_get_object (value));
        break;
    case PROP_MIME_TYPE:
        fr_command_set_mime_type (comm, g_value_get_string (value));
        break;
    case PROP_PASSWORD:
        g_free (comm->password);
        comm->password = g_strdup (g_value_get_string (value));
        break;
    case PROP_ENCRYPT_HEADER:
        comm->encrypt_header = g_value_get_boolean (value);
        break;
    case PROP_COMPRESSION:
        comm->compression = g_value_get_enum (value);
        break;
    case PROP_VOLUME_SIZE:
        comm->volume_size = g_value_get_uint (value);
        break;
    default:
        break;
    }
}
static void
fs_msn_session_set_property (GObject *object,
                             guint prop_id,
                             const GValue *value,
                             GParamSpec *pspec)
{
  FsMsnSession *self = FS_MSN_SESSION (object);

  switch (prop_id)
    {
      case PROP_MEDIA_TYPE:
        self->priv->media_type = g_value_get_enum (value);
        break;
      case PROP_ID:
        self->id = g_value_get_uint (value);
        break;
      case PROP_CONFERENCE:
        self->priv->conference = FS_MSN_CONFERENCE (g_value_dup_object (value));
        break;
      default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
        break;
    }
}