Beispiel #1
0
void
gb_keybindings_set_mode (GbKeybindings *self,
                         const gchar   *mode)
{
  g_return_if_fail (GB_IS_KEYBINDINGS (self));

  if (mode != self->mode)
    {
      g_free (self->mode);
      self->mode = g_strdup (mode);
      if (self->constructed)
        gb_keybindings_reload (self);
      g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_MODE]);
    }
}
Beispiel #2
0
static void
update_identifier (PolariRoom *room)
{
  PolariRoomPrivate *priv = room->priv;
  const char *id = NULL;

  if (priv->channel)
    id = tp_channel_get_identifier (priv->channel);

  g_clear_pointer (&priv->display_name, g_free);
  if (id)
    priv->display_name = g_strdup (id + (id[0] == '#' ? 1 : 0));

  g_object_notify_by_pspec (G_OBJECT (room), props[PROP_DISPLAY_NAME]);
}
void
gb_project_tree_set_show_ignored_files (GbProjectTree *self,
                                        gboolean       show_ignored_files)
{
  g_return_if_fail (GB_IS_PROJECT_TREE (self));

  show_ignored_files = !!show_ignored_files;

  if (show_ignored_files != self->show_ignored_files)
    {
      self->show_ignored_files = show_ignored_files;
      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SHOW_IGNORED_FILES]);
      ide_tree_rebuild (IDE_TREE (self));
    }
}
void
gb_command_provider_set_priority (GbCommandProvider *provider,
                                  gint               priority)
{
  GbCommandProviderPrivate *priv = gb_command_provider_get_instance_private (provider);

  g_return_if_fail (GB_IS_COMMAND_PROVIDER (provider));

  if (priv->priority != priority)
    {
      priv->priority = priority;
      g_object_notify_by_pspec (G_OBJECT (provider),
                                gParamSpecs [PROP_PRIORITY]);
    }
}
void
gb_source_view_snippet_insert (GbSourceViewSnippet *snippet,
                               GtkTextBuffer       *buffer,
                               GtkTextIter         *location)
{
   GbSourceViewSnippetPrivate *priv;
   GbSourceViewSnippetChunk *chunk;
   guint i;

   g_return_if_fail(GB_IS_SOURCE_VIEW_SNIPPET(snippet));
   g_return_if_fail(location);

   priv = snippet->priv;

   if (priv->mark_begin || priv->mark_end) {
      g_warning("Cannot overwrite previous snippet position.");
      return;
   }

   priv->mark_begin = gtk_text_buffer_create_mark(buffer, NULL, location, TRUE);

   for (i = 0; i < priv->chunks->len; i++) {
      chunk = g_ptr_array_index(priv->chunks, i);
      gb_source_view_snippet_chunk_insert(chunk, buffer, location);
   }

   priv->mark_end = gtk_text_buffer_create_mark(buffer, NULL, location, FALSE);

   for (i = 0; i < priv->chunks->len; i++) {
      chunk = g_ptr_array_index(priv->chunks, i);
      gb_source_view_snippet_chunk_build_marks(chunk, buffer);
   }

   g_object_notify_by_pspec(G_OBJECT(snippet), gParamSpecs[PROP_MARK_BEGIN]);
   g_object_notify_by_pspec(G_OBJECT(snippet), gParamSpecs[PROP_MARK_END]);
}
void
gthree_basic_material_set_vertex_colors (GthreeBasicMaterial *basic,
                                         GthreeColorType color_type)
{
  GthreeBasicMaterialPrivate *priv = gthree_basic_material_get_instance_private (basic);

  if (priv->vertex_colors == color_type)
    return;

  priv->vertex_colors = color_type;

  gthree_material_set_needs_update (GTHREE_MATERIAL (basic), TRUE);

  g_object_notify_by_pspec (G_OBJECT (basic), obj_props[PROP_VERTEX_COLORS]);
}
Beispiel #7
0
void
aws_s3_client_set_host (AwsS3Client *client,
                        const gchar *host)
{
  AwsS3ClientPrivate *priv = aws_s3_client_get_instance_private (client);

  g_return_if_fail(AWS_IS_S3_CLIENT(client));

  if (g_strcmp0 (priv->host, host) != 0)
    {
      g_free (priv->host);
      priv->host = g_strdup (host);
      g_object_notify_by_pspec (G_OBJECT (client), properties [PROP_HOST]);
    }
}
Beispiel #8
0
/**
 * gtk_level_bar_set_mode:
 * @self: a #GtkLevelBar
 * @mode: a #GtkLevelBarMode
 *
 * Sets the value of the #GtkLevelBar:mode property.
 *
 * Since: 3.6
 */
void
gtk_level_bar_set_mode (GtkLevelBar     *self,
                        GtkLevelBarMode  mode)
{
  g_return_if_fail (GTK_IS_LEVEL_BAR (self));

  if (self->priv->bar_mode != mode)
    {
      self->priv->bar_mode = mode;
      g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_MODE]);

      gtk_level_bar_update_mode_style_classes (self);
      gtk_widget_queue_resize (GTK_WIDGET (self));
    }
}
static void
gb_search_context_set_search_text (GbSearchContext *context,
                                   const gchar     *search_text)
{
  g_return_if_fail (GB_IS_SEARCH_CONTEXT (context));
  g_return_if_fail (search_text);

  if (search_text != context->priv->search_text)
    {
      g_free (context->priv->search_text);
      context->priv->search_text = g_strdup (search_text);
      g_object_notify_by_pspec (G_OBJECT (context),
                                gParamSpecs [PROP_SEARCH_TEXT]);
    }
}
Beispiel #10
0
void
pnl_dock_overlay_edge_set_edge (PnlDockOverlayEdge *self,
                                GtkPositionType     edge)
{
  g_return_if_fail (PNL_IS_DOCK_OVERLAY_EDGE (self));
  g_return_if_fail (edge >= 0);
  g_return_if_fail (edge <= 3);

  if (edge != self->edge)
    {
      self->edge = edge;
      pnl_dock_overlay_edge_update_edge (self);
      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_EDGE]);
    }
}
static void
ide_project_file_set_path (IdeProjectFile *self,
                           const gchar    *path)
{
  IdeProjectFilePrivate *priv = ide_project_file_get_instance_private (self);

  g_return_if_fail (IDE_IS_PROJECT_FILE (self));

  if (priv->path != path)
    {
      g_free (priv->path);
      priv->path = g_strdup (path);
      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_PATH]);
    }
}
static void
ide_highlight_engine_set_highlighter (IdeHighlightEngine *self,
                                      IdeHighlighter     *highlighter)
{
    g_return_if_fail (IDE_IS_HIGHLIGHT_ENGINE (self));
    g_return_if_fail (!highlighter || IDE_IS_HIGHLIGHTER (highlighter));

    if (g_set_object (&self->highlighter, highlighter))
    {
        if (highlighter != NULL)
            IDE_HIGHLIGHTER_GET_IFACE (highlighter)->set_engine (highlighter, self);
        ide_highlight_engine_reload (self);
        g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_HIGHLIGHTER]);
    }
}
Beispiel #13
0
/**
 * gtk_revealer_set_transition_type:
 * @revealer: a #GtkRevealer
 * @transition: the new transition type
 *
 * Sets the type of animation that will be used for
 * transitions in @revealer. Available types include
 * various kinds of fades and slides.
 *
 * Since: 3.10
 */
void
gtk_revealer_set_transition_type (GtkRevealer               *revealer,
                                  GtkRevealerTransitionType  transition)
{
  GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);

  g_return_if_fail (GTK_IS_REVEALER (revealer));

  if (priv->transition_type == transition)
    return;

  priv->transition_type = transition;
  gtk_widget_queue_resize (GTK_WIDGET (revealer));
  g_object_notify_by_pspec (G_OBJECT (revealer), props[PROP_TRANSITION_TYPE]);
}
Beispiel #14
0
/**
 * clutter_zoom_action_set_zoom_axis:
 * @action: a #ClutterZoomAction
 * @axis: the axis to constraint the zooming to
 *
 * Restricts the zooming action to a specific axis
 *
 *
 */
void
clutter_zoom_action_set_zoom_axis (ClutterZoomAction *action,
                                   ClutterZoomAxis    axis)
{
  g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
  g_return_if_fail (axis >= CLUTTER_ZOOM_X_AXIS &&
                    axis <= CLUTTER_ZOOM_BOTH);

  if (action->priv->zoom_axis == axis)
    return;

  action->priv->zoom_axis = axis;

  g_object_notify_by_pspec (G_OBJECT (action), zoom_props[PROP_ZOOM_AXIS]);
}
void
gthree_basic_material_set_color (GthreeBasicMaterial *basic,
                                 const GdkRGBA *color)
{
  GthreeBasicMaterialPrivate *priv = gthree_basic_material_get_instance_private (basic);

  if (gdk_rgba_equal (color, &priv->color))
    return;

  priv->color = *color;

  gthree_material_set_needs_update (GTHREE_MATERIAL (basic), TRUE);

  g_object_notify_by_pspec (G_OBJECT (basic), obj_props[PROP_COLOR]);
}
void
ide_configuration_set_debug (IdeConfiguration *self,
                             gboolean          debug)
{
  g_return_if_fail (IDE_IS_CONFIGURATION (self));

  debug = !!debug;

  if (debug != self->debug)
    {
      self->debug = debug;
      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUG]);
      ide_configuration_set_dirty (self, TRUE);
    }
}
void
gthree_basic_material_set_shading_type (GthreeBasicMaterial *basic,
                                        GthreeShadingType    shading_type)
{
  GthreeBasicMaterialPrivate *priv = gthree_basic_material_get_instance_private (basic);

  if (priv->shading_type == shading_type)
    return;

  priv->shading_type = shading_type;

  gthree_material_set_needs_update (GTHREE_MATERIAL (basic), TRUE);

  g_object_notify_by_pspec (G_OBJECT (basic), obj_props[PROP_SHADING_TYPE]);
}
/**
 * egg_scrolled_window_set_max_content_height:
 * @max_content_height: the max allowed height request or -1 to ignore.
 *
 * This function will set the "max-content-height" property. This property is
 * used to determine the maximum height that the scrolled window will request.
 *
 * This is useful if you want to have a scrolled window grow with the child
 * allocation, but only up to a certain height.
 */
void
egg_scrolled_window_set_max_content_height (EggScrolledWindow *self,
                                            gint               max_content_height)
{
  EggScrolledWindowPrivate *priv = egg_scrolled_window_get_instance_private (self);

  g_return_if_fail (EGG_IS_SCROLLED_WINDOW (self));

  if (max_content_height != priv->max_content_height)
    {
      priv->max_content_height = max_content_height;
      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_MAX_CONTENT_HEIGHT]);
      gtk_widget_queue_resize (GTK_WIDGET (self));
    }
}
void
gthree_basic_material_set_combine (GthreeBasicMaterial *basic,
                                   GthreeOperation combine)
{
  GthreeBasicMaterialPrivate *priv = gthree_basic_material_get_instance_private (basic);

  if (priv->combine == combine)
    return;

  priv->combine = combine;

  gthree_material_set_needs_update (GTHREE_MATERIAL (basic), TRUE);

  g_object_notify_by_pspec (G_OBJECT (basic), obj_props[PROP_COMBINE]);
}
Beispiel #20
0
static void
mail_task_set_fraction (MailTask *task,
                        gdouble fraction)
{
	MailTaskPrivate *priv;

	g_return_if_fail(MAIL_IS_TASK(task));
	g_return_if_fail(fraction >= 0.0);
	g_return_if_fail(fraction <= 1.0);

	priv = task->priv;

	priv->fraction = fraction;
	g_object_notify_by_pspec(G_OBJECT(task), pspecs[PROP_FRACTION]);
}
Beispiel #21
0
/**
 * gedit_document_set_short_name_for_display:
 * @doc:
 * @short_name: (allow-none):
 *
 * Deprecated: 3.18: Unused function. The intent is to change the
 * #GeditDocument:shortname property to be read-only.
 */
void
gedit_document_set_short_name_for_display (GeditDocument *doc,
                                           const gchar   *short_name)
{
	GeditDocumentPrivate *priv;

	g_return_if_fail (GEDIT_IS_DOCUMENT (doc));

	priv = gedit_document_get_instance_private (doc);

	g_free (priv->short_name);
	priv->short_name = g_strdup (short_name);

	g_object_notify_by_pspec (G_OBJECT (doc), properties[PROP_SHORTNAME]);
}
Beispiel #22
0
void
gb_source_view_set_search_text (GbSourceView *view,
                                const gchar  *search_text)
{
   GbSourceViewPrivate *priv;

   g_return_if_fail(GB_IS_SOURCE_VIEW(view));

   priv = view->priv;

   g_clear_pointer(&priv->search_text, g_free);
   g_clear_pointer(&priv->search_regex, g_regex_unref);

   priv->search_text = g_strdup(search_text);

   gb_source_view_update_search(view);

   if (priv->has_matches) {
      gb_source_view_move_next_match(view);
   }

   g_object_notify_by_pspec(G_OBJECT(view), gParamSpecs[PROP_SEARCH_REGEX]);
   g_object_notify_by_pspec(G_OBJECT(view), gParamSpecs[PROP_SEARCH_TEXT]);
}
Beispiel #23
0
static void
meta_background_actor_set_dim_factor (MetaBackgroundActor *self,
                                      gfloat               dim_factor)
{
  MetaBackgroundActorPrivate *priv = self->priv;

  if (priv->dim_factor == dim_factor)
    return;

  priv->dim_factor = dim_factor;

  clutter_actor_queue_redraw (CLUTTER_ACTOR (self));

  g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_DIM_FACTOR]);
}
/**
 * gb_scrolled_window_set_max_content_height:
 * @max_content_height: the max allowed height request or -1 to ignore.
 *
 * This function will set the "max-content-height" property. This property is
 * used to determine the maximum height that the scrolled window will request.
 *
 * This is useful if you want to have a scrolled window grow with the child
 * allocation, but only up to a certain height.
 */
static void
gb_scrolled_window_set_max_content_height (GbScrolledWindow *self,
                                           gint              max_content_height)
{
  GbScrolledWindowPrivate *priv = gb_scrolled_window_get_instance_private (self);

  g_return_if_fail (GB_IS_SCROLLED_WINDOW (self));

  if (max_content_height != priv->max_content_height)
    {
      priv->max_content_height = max_content_height;
      g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_MAX_CONTENT_HEIGHT]);
      gtk_widget_queue_resize (GTK_WIDGET (self));
    }
}
void
gb_source_view_snippet_finish (GbSourceViewSnippet *snippet)
{
   GbSourceViewSnippetPrivate *priv;
   GbSourceViewSnippetChunk *chunk;
   GtkTextBuffer *buffer;
   guint i;

   g_return_if_fail(GB_IS_SOURCE_VIEW_SNIPPET(snippet));

   priv = snippet->priv;

   if (!priv->mark_begin || !priv->mark_end) {
      g_warning("Cannot finish snippet as it has not been inserted.");
      return;
   }

   buffer = gtk_text_mark_get_buffer(priv->mark_begin);

   /*
    * TODO: Remove all our GtkTextTag in the range.
    */

   for (i = 0; i < priv->chunks->len; i++) {
      chunk = g_ptr_array_index(priv->chunks, i);
      gb_source_view_snippet_chunk_finish(chunk);
   }

   gtk_text_buffer_delete_mark(buffer, priv->mark_begin);
   gtk_text_buffer_delete_mark(buffer, priv->mark_end);
   g_clear_object(&priv->mark_begin);
   g_clear_object(&priv->mark_end);

   g_object_notify_by_pspec(G_OBJECT(snippet), gParamSpecs[PROP_MARK_BEGIN]);
   g_object_notify_by_pspec(G_OBJECT(snippet), gParamSpecs[PROP_MARK_END]);
}
Beispiel #26
0
/**
 * clutter_actor_meta_set_enabled:
 * @meta: a #ClutterActorMeta
 * @is_enabled: whether @meta is enabled
 *
 * Sets whether @meta should be enabled or not
 *
 * Since: 1.4
 */
void
clutter_actor_meta_set_enabled (ClutterActorMeta *meta,
                                gboolean          is_enabled)
{
  g_return_if_fail (CLUTTER_IS_ACTOR_META (meta));

  is_enabled = !!is_enabled;

  if (meta->priv->is_enabled == is_enabled)
    return;

  meta->priv->is_enabled = is_enabled;

  g_object_notify_by_pspec (G_OBJECT (meta), obj_props[PROP_ENABLED]);
}
Beispiel #27
0
/**
 * clutter_canvas_set_scale_factor:
 * @canvas: a #ClutterCanvas
 * @scale: the scale factor, or -1 for the default
 *
 * Sets the scaling factor for the Cairo surface used by @canvas.
 *
 * This function should rarely be used.
 *
 * The default scaling factor of a #ClutterCanvas content uses the
 * #ClutterSettings:window-scaling-factor property, which is set by
 * the windowing system. By using this function it is possible to
 * override that setting.
 *
 * Changing the scale factor will invalidate the @canvas.
 *
 * Since: 1.18
 */
void
clutter_canvas_set_scale_factor (ClutterCanvas *canvas,
                                 int            scale)
{
  ClutterCanvasPrivate *priv;
  GObject *obj;

  g_return_if_fail (CLUTTER_IS_CANVAS (canvas));
  g_return_if_fail (scale != 0);

  priv = canvas->priv;

  if (scale < 0)
    {
      if (!priv->scale_factor_set)
        return;

      priv->scale_factor_set = FALSE;
      priv->scale_factor = -1;
    }
  else
    {
      if (priv->scale_factor_set && priv->scale_factor == scale)
        return;

      priv->scale_factor_set = TRUE;
      priv->scale_factor = scale;
    }

  clutter_content_invalidate (CLUTTER_CONTENT (canvas));

  obj = G_OBJECT (canvas);

  g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_FACTOR]);
  g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_FACTOR_SET]);
}
void
pnl_dock_revealer_set_reveal_child (PnlDockRevealer *self,
                                    gboolean         reveal_child)
{
  PnlDockRevealerPrivate *priv = pnl_dock_revealer_get_instance_private (self);

  g_return_if_fail (PNL_IS_DOCK_REVEALER (self));

  reveal_child = !!reveal_child;

  if (reveal_child != priv->reveal_child)
    {
      PnlAnimation *animation;
      GtkWidget *child;

      priv->reveal_child = reveal_child;

      child = gtk_bin_get_child (GTK_BIN (self));

      if (child != NULL)
        {
          guint duration;

          if (priv->animation != NULL)
            {
              pnl_animation_stop (priv->animation);
              pnl_clear_weak_pointer (&priv->animation);
            }

          gtk_widget_set_child_visible (child, TRUE);

          duration = pnl_dock_revealer_calculate_duration (self);

          animation = pnl_object_animate_full (priv->adjustment,
                                               PNL_ANIMATION_EASE_IN_OUT_CUBIC,
                                               duration,
                                               gtk_widget_get_frame_clock (GTK_WIDGET (self)),
                                               pnl_dock_revealer_animation_done,
                                               g_object_ref (self),
                                               "value", reveal_child ? 1.0 : 0.0,
                                               NULL);

          pnl_set_weak_pointer (&priv->animation, animation);
        }

      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_REVEAL_CHILD]);
    }
}
/**
 * clutter_bind_constraint_set_offset:
 * @constraint: a #ClutterBindConstraint
 * @offset: the offset to apply, in pixels
 *
 * Sets the offset to be applied to the constraint
 *
 * Since: 1.4
 */
void
clutter_bind_constraint_set_offset (ClutterBindConstraint *constraint,
                                    gfloat                 offset)
{
  g_return_if_fail (CLUTTER_IS_BIND_CONSTRAINT (constraint));

  if (fabs (constraint->offset - offset) < 0.00001f)
    return;

  constraint->offset = offset;

  if (constraint->actor != NULL)
    clutter_actor_queue_relayout (constraint->actor);

  g_object_notify_by_pspec (G_OBJECT (constraint), obj_props[PROP_OFFSET]);
}
/**
 * clutter_bind_constraint_set_coordinate:
 * @constraint: a #ClutterBindConstraint
 * @coordinate: the coordinate to bind
 *
 * Sets the coordinate to bind in the constraint
 *
 * Since: 1.4
 */
void
clutter_bind_constraint_set_coordinate (ClutterBindConstraint *constraint,
                                        ClutterBindCoordinate  coordinate)
{
  g_return_if_fail (CLUTTER_IS_BIND_CONSTRAINT (constraint));

  if (constraint->coordinate == coordinate)
    return;

  constraint->coordinate = coordinate;

  if (constraint->actor != NULL)
    clutter_actor_queue_relayout (constraint->actor);

  g_object_notify_by_pspec (G_OBJECT (constraint), obj_props[PROP_COORDINATE]);
}