Exemplo n.º 1
0
static void
dialog_response (GtkDialog *dialog,
                 gint       response,
                 gpointer   data)
{
  if (response == GTK_RESPONSE_CANCEL)
    gtk_widget_hide (GTK_WIDGET (dialog));
  else if (response == GTK_RESPONSE_OK)
    {
      GtkColorButton *button = GTK_COLOR_BUTTON (data);

      gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog),
                                  &button->priv->rgba);

      gtk_widget_hide (GTK_WIDGET (dialog));

      gtk_widget_queue_draw (button->priv->draw_area);

      g_signal_emit (button, color_button_signals[COLOR_SET], 0);

      g_object_freeze_notify (G_OBJECT (button));
      g_object_notify (G_OBJECT (button), "color");
      g_object_notify (G_OBJECT (button), "alpha");
      g_object_notify (G_OBJECT (button), "rgba");
      g_object_thaw_notify (G_OBJECT (button));
    }
}
/**
 * clutter_behaviour_rotate_set_center:
 * @rotate: a #ClutterBehaviourRotate
 * @x: X axis center of rotation
 * @y: Y axis center of rotation
 * @z: Z axis center of rotation
 *
 * Sets the center of rotation. The coordinates are relative to the plane
 * normal to the rotation axis set with clutter_behaviour_rotate_set_axis().
 *
 * Since: 0.4
 */
void
clutter_behaviour_rotate_set_center (ClutterBehaviourRotate *rotate,
				     gint                    x,
				     gint                    y,
				     gint                    z)
{
  ClutterBehaviourRotatePrivate *priv;

  g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate));

  priv = rotate->priv;

  g_object_freeze_notify (G_OBJECT (rotate));

  if (priv->center_x != x)
    {
      priv->center_x = x;
      g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_CENTER_X]);
    }

  if (priv->center_y != y)
    {
      priv->center_y = y;
      g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_CENTER_Y]);
    }

  if (priv->center_z != z)
    {
      priv->center_z = z;
      g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_CENTER_Z]);
    }

  g_object_thaw_notify (G_OBJECT (rotate));
}
Exemplo n.º 3
0
/**
 * clutter_drag_action_set_drag_threshold:
 * @action: a #ClutterDragAction
 * @x_threshold: a distance on the horizontal axis, in pixels
 * @y_threshold: a distance on the vertical axis, in pixels
 *
 * Sets the horizontal and vertical drag thresholds that must be
 * cleared by the pointer before @action can begin the dragging
 *
 * Since: 1.4
 */
void
clutter_drag_action_set_drag_threshold (ClutterDragAction *action,
                                        guint              x_threshold,
					guint              y_threshold)
{
  ClutterDragActionPrivate *priv;
  GObject *self;

  g_return_if_fail (CLUTTER_IS_DRAG_ACTION (action));

  self = G_OBJECT (action);
  priv = action->priv;

  g_object_freeze_notify (self);

  if (priv->x_drag_threshold != x_threshold)
    {
      priv->x_drag_threshold = x_threshold;

      _clutter_notify_by_pspec (self, drag_props[PROP_X_DRAG_THRESHOLD]);
    }

  if (priv->y_drag_threshold != y_threshold)
    {
      priv->y_drag_threshold = y_threshold;

      _clutter_notify_by_pspec (self, drag_props[PROP_Y_DRAG_THRESHOLD]);
    }

  g_object_thaw_notify (self);
}
Exemplo n.º 4
0
/**
 * st_scroll_view_set_policy:
 * @scroll: A #StScrollView
 * @hscroll: Whether to enable horizontal scrolling
 * @vscroll: Whether to enable vertical scrolling
 *
 * Set the scroll policy.
 */
void
st_scroll_view_set_policy (StScrollView   *scroll,
                           GtkPolicyType   hscroll,
                           GtkPolicyType   vscroll)
{
  StScrollViewPrivate *priv;

  g_return_if_fail (ST_IS_SCROLL_VIEW (scroll));

  priv = ST_SCROLL_VIEW (scroll)->priv;

  if (priv->hscrollbar_policy == hscroll && priv->vscrollbar_policy == vscroll)
    return;

  g_object_freeze_notify ((GObject *) scroll);

  if (priv->hscrollbar_policy != hscroll)
    {
      priv->hscrollbar_policy = hscroll;
      g_object_notify ((GObject *) scroll, "hscrollbar-policy");
    }

  if (priv->vscrollbar_policy != vscroll)
    {
      priv->vscrollbar_policy = vscroll;
      g_object_notify ((GObject *) scroll, "vscrollbar-policy");
    }

  clutter_actor_queue_relayout (CLUTTER_ACTOR (scroll));

  g_object_thaw_notify ((GObject *) scroll);
}
Exemplo n.º 5
0
static void
reload_tun_properties (NMDeviceTun *self)
{
	NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE (self);
	GObject *object = G_OBJECT (self);
	NMPlatformTunProperties props;

	if (!nm_platform_tun_get_properties (NM_PLATFORM_GET, nm_device_get_ifindex (NM_DEVICE (self)), &props)) {
		_LOGD (LOGD_HW, "could not read tun properties");
		return;
	}

	g_object_freeze_notify (object);

	if (priv->props.owner != props.owner)
		g_object_notify (object, NM_DEVICE_TUN_OWNER);
	if (priv->props.group != props.group)
		g_object_notify (object, NM_DEVICE_TUN_GROUP);
	if (priv->props.no_pi != props.no_pi)
		g_object_notify (object, NM_DEVICE_TUN_NO_PI);
	if (priv->props.vnet_hdr != props.vnet_hdr)
		g_object_notify (object, NM_DEVICE_TUN_VNET_HDR);
	if (priv->props.multi_queue != props.multi_queue)
		g_object_notify (object, NM_DEVICE_TUN_MULTI_QUEUE);

	memcpy (&priv->props, &props, sizeof (NMPlatformTunProperties));

	g_object_thaw_notify (object);
}
/**
 * clutter_behaviour_opacity_set_bounds:
 * @behaviour: a #ClutterBehaviourOpacity
 * @opacity_start: minimum level of opacity
 * @opacity_end: maximum level of opacity
 *
 * Sets the initial and final levels of the opacity applied by @behaviour
 * on each actor it controls.
 *
 * Since: 0.6
 *
 * Deprecated: 1.6
 */
void
clutter_behaviour_opacity_set_bounds (ClutterBehaviourOpacity *behaviour,
                                      guint8                   opacity_start,
                                      guint8                   opacity_end)
{
  ClutterBehaviourOpacityPrivate *priv;

  g_return_if_fail (CLUTTER_IS_BEHAVIOUR_OPACITY (behaviour));

  priv = behaviour->priv;

  g_object_freeze_notify (G_OBJECT (behaviour));

  if (priv->opacity_start != opacity_start)
    {
      priv->opacity_start = opacity_start;

      g_object_notify_by_pspec (G_OBJECT (behaviour), obj_props[PROP_OPACITY_START]);
    }

  if (priv->opacity_end != opacity_end)
    {
      priv->opacity_end = opacity_end;

      g_object_notify_by_pspec (G_OBJECT (behaviour), obj_props[PROP_OPACITY_END]);
    }

  g_object_thaw_notify (G_OBJECT (behaviour));
}
Exemplo n.º 7
0
/**
 * gimp_ruler_set_range:
 * @ruler: a #GimpRuler
 * @lower: the lower limit of the ruler
 * @upper: the upper limit of the ruler
 * @max_size: the maximum size of the ruler used when calculating the space to
 * leave for the text
 *
 * This sets the range of the ruler.
 *
 * Since: GIMP 2.8
 */
void
gimp_ruler_set_range (GimpRuler *ruler,
                      gdouble    lower,
                      gdouble    upper,
                      gdouble    max_size)
{
  GimpRulerPrivate *priv;

  g_return_if_fail (GIMP_IS_RULER (ruler));

  priv = GIMP_RULER_GET_PRIVATE (ruler);

  g_object_freeze_notify (G_OBJECT (ruler));
  if (priv->lower != lower)
    {
      priv->lower = lower;
      g_object_notify (G_OBJECT (ruler), "lower");
    }
  if (priv->upper != upper)
    {
      priv->upper = upper;
      g_object_notify (G_OBJECT (ruler), "upper");
    }
  if (priv->max_size != max_size)
    {
      priv->max_size = max_size;
      g_object_notify (G_OBJECT (ruler), "max-size");
    }
  g_object_thaw_notify (G_OBJECT (ruler));

  gtk_widget_queue_draw (GTK_WIDGET (ruler));
}
Exemplo n.º 8
0
/* Set monitor index this object belongs to and to monitor */
static void _xfdashboard_window_tracker_monitor_set_index(XfdashboardWindowTrackerMonitor *self, gint inIndex)
{
	XfdashboardWindowTrackerMonitorPrivate		*priv;

	g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_MONITOR(self));
	g_return_if_fail(inIndex>=0);
	g_return_if_fail(inIndex<gdk_screen_get_n_monitors(self->priv->screen));

	priv=self->priv;

	/* Freeze notification */
	g_object_freeze_notify(G_OBJECT(self));

	/* Set value if changed */
	if(priv->monitorIndex!=inIndex)
	{
		/* Set value */
		priv->monitorIndex=inIndex;

		/* Update primary monitor flag */
		_xfdashboard_window_tracker_monitor_update_primary(self);

		/* Update geometry of monitor */
		_xfdashboard_window_tracker_monitor_update_geometry(self);
	}

	/* Thaw notification */
	g_object_thaw_notify(G_OBJECT(self));
}
Exemplo n.º 9
0
static void
gimp_thumbnail_set_info_from_pixbuf (GimpThumbnail *thumbnail,
                                     GdkPixbuf     *pixbuf)
{
  const gchar  *option;
  gint          num;

  g_object_freeze_notify (G_OBJECT (thumbnail));

  gimp_thumbnail_reset_info (thumbnail);

  g_free (thumbnail->image_mimetype);
  thumbnail->image_mimetype =
    g_strdup (gdk_pixbuf_get_option (pixbuf, TAG_THUMB_MIMETYPE));

  option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_IMAGE_WIDTH);
  if (option && sscanf (option, "%d", &num) == 1)
    thumbnail->image_width = num;

  option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_IMAGE_HEIGHT);
  if (option && sscanf (option, "%d", &num) == 1)
    thumbnail->image_height = num;

  thumbnail->image_type =
    g_strdup (gdk_pixbuf_get_option (pixbuf, TAG_THUMB_GIMP_TYPE));

  option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_GIMP_LAYERS);
  if (option && sscanf (option, "%d", &num) == 1)
    thumbnail->image_num_layers = num;

  g_object_thaw_notify (G_OBJECT (thumbnail));
}
Exemplo n.º 10
0
static void
gucharmap_charmap_set_font_desc_internal (GucharmapCharmap *charmap, 
                                          PangoFontDescription *font_desc /* adopting */,
                                          gboolean in_notification)
{
  GucharmapCharmapPrivate *priv = charmap->priv;
  GObject *object = G_OBJECT (charmap);
  gboolean equal;

  g_object_freeze_notify (object);

  equal = priv->font_desc != NULL &&
          pango_font_description_equal (priv->font_desc, font_desc);

  if (priv->font_desc)
    pango_font_description_free (priv->font_desc);

  priv->font_desc = font_desc; /* adopted */

  if (!in_notification)
    gucharmap_chartable_set_font_desc (priv->chartable, font_desc);

  if (gtk_widget_get_style (GTK_WIDGET (priv->details_view)))
    gucharmap_charmap_update_text_tags (charmap);

  if (!equal)
    g_object_notify (G_OBJECT (charmap), "font-desc");

  g_object_thaw_notify (object);
}
Exemplo n.º 11
0
/**
 * gtk_menu_button_set_use_popover:
 * @menu_button: a #GtkMenuButton
 * @use_popover: %TRUE to construct a popover from the menu model
 *
 * Sets whether to construct a #GtkPopover instead of #GtkMenu
 * when gtk_menu_button_set_menu_model() is called. Note that
 * this property is only consulted when a new menu model is set.
 *
 * Since: 3.12
 */
void
gtk_menu_button_set_use_popover (GtkMenuButton *menu_button,
                                 gboolean       use_popover)
{
  GtkMenuButtonPrivate *priv;

  g_return_if_fail (GTK_IS_MENU_BUTTON (menu_button));

  priv = menu_button->priv;

  use_popover = use_popover != FALSE;

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

  priv->use_popover = use_popover;

  g_object_freeze_notify (G_OBJECT (menu_button));

  if (priv->model)
    gtk_menu_button_set_menu_model (menu_button, priv->model);

  g_object_notify_by_pspec (G_OBJECT (menu_button), menu_button_props[PROP_USE_POPOVER]);

  g_object_thaw_notify (G_OBJECT (menu_button));
}
Exemplo n.º 12
0
/**
 * egg_find_bar_set_case_sensitive:
 *
 * Sets whether the search is case sensitive
 *
 * Since: 2.6
 */
void
egg_find_bar_set_case_sensitive (EggFindBar *find_bar,
                                 gboolean    case_sensitive)
{
  EggFindBarPrivate *priv;

  g_return_if_fail (EGG_IS_FIND_BAR (find_bar));

  priv = (EggFindBarPrivate *)find_bar->priv;

  g_object_freeze_notify (G_OBJECT (find_bar));

  case_sensitive = case_sensitive != FALSE;

  if (priv->case_sensitive != case_sensitive)
    {
      priv->case_sensitive = case_sensitive;

      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->case_button),
                                    priv->case_sensitive);

      g_object_notify (G_OBJECT (find_bar),
                       "case_sensitive");
    }

  g_object_thaw_notify (G_OBJECT (find_bar));
}
Exemplo n.º 13
0
/*!
 \brief sets the current points to empty array
 \param curve (MtxCurve *) pointer to curve
 \param num_points (gint) size of array to create
 */
gboolean mtx_curve_set_empty_array (MtxCurve *curve, gint num_points)
{
	gint i = 0;
	MtxCurvePrivate *priv = MTX_CURVE_GET_PRIVATE(curve);
	g_return_val_if_fail (MTX_IS_CURVE (curve),FALSE);
	g_object_freeze_notify (G_OBJECT (curve));
	if (priv->coords)
		g_free(priv->coords);
	priv->coords = g_new0(MtxCurveCoord,num_points);
	priv->num_points = num_points;
	priv->highest_x = 0;
	priv->highest_y = 0;
	priv->lowest_x = 0;
	priv->lowest_y = 0;
	for (i=0;i<num_points;i++)
	{
		priv->coords[i].x = 0;
		priv->coords[i].y = 0;
	}
	g_object_thaw_notify (G_OBJECT (curve));
#if GTK_MINOR_VERSION >= 18
	if (!gtk_widget_is_sensitive(GTK_WIDGET(curve)))
		return TRUE;
#else
	if (!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(curve)))
		return TRUE;
#endif
	if (priv->auto_rescale_id == 0)
		priv->auto_rescale_id = g_timeout_add(1000,(GSourceFunc)auto_rescale,priv);
	return TRUE;
}
Exemplo n.º 14
0
/*!
 \brief sets the current points 
 \param curve (MtxCurve *) pointer to curve
 \param num_points (gint) new value
 \param array (MtxCurveCoord*) Array of points
 */
gboolean mtx_curve_set_coords (MtxCurve *curve, gint num_points, MtxCurveCoord *array)
{
/*	gint i = 0; */
	MtxCurvePrivate *priv = MTX_CURVE_GET_PRIVATE(curve);
	g_return_val_if_fail (MTX_IS_CURVE (curve),FALSE);
	g_object_freeze_notify (G_OBJECT (curve));
	if (priv->coords)
		g_free(priv->coords);
	priv->coords = g_memdup(array,(num_points*sizeof(MtxCurveCoord)));
	priv->num_points = num_points;
	recalc_extremes(priv);
	/*
 	for (i=0;i<num_points;i++)
		printf("new coord %f,%f\n",priv->coords[i].x,priv->coords[i].y);
	*/
	g_object_thaw_notify (G_OBJECT (curve));
#if GTK_MINOR_VERSION >= 18
	if (!gtk_widget_is_sensitive(GTK_WIDGET(curve)))
		return TRUE;
#else
	if (!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(curve)))
		return TRUE;
#endif
	if (priv->auto_rescale_id == 0)
		priv->auto_rescale_id = g_timeout_add(1000,(GSourceFunc)auto_rescale,priv);
	return TRUE;
}
Exemplo n.º 15
0
/**
 * thunarx_property_page_set_label_widget:
 * @property_page : a #ThunarxPropertyPage.
 * @label_widget  : the new label widget.
 *
 * Sets the label widget for the @property_page. This is the widget
 * that will appear in the notebook header for the @property_page.
 **/
void
thunarx_property_page_set_label_widget (ThunarxPropertyPage *property_page,
                                        GtkWidget           *label_widget)
{
  g_return_if_fail (THUNARX_IS_PROPERTY_PAGE (property_page));
  g_return_if_fail (label_widget == NULL || (GTK_IS_WIDGET (label_widget) && label_widget->parent == NULL));

  if (G_UNLIKELY (label_widget == property_page->priv->label_widget))
    return;

  /* disconnect from the previous label widget */
  if (G_LIKELY (property_page->priv->label_widget != NULL))
    g_object_unref (G_OBJECT (property_page->priv->label_widget));

  /* activate the new label widget */
  property_page->priv->label_widget = label_widget;

  /* connect to the new label widget */
  if (G_LIKELY (label_widget != NULL))
    {
      g_object_ref (G_OBJECT (label_widget));
      gtk_object_sink (GTK_OBJECT (label_widget));
    }

  /* notify listeners */
  g_object_freeze_notify (G_OBJECT (property_page));
  g_object_notify (G_OBJECT (property_page), "label");
  g_object_notify (G_OBJECT (property_page), "label-widget");
  g_object_thaw_notify (G_OBJECT (property_page));
}
Exemplo n.º 16
0
/**
 * up_device_coldplug:
 *
 * Return %TRUE on success, %FALSE if we failed to get data and should be removed
 **/
gboolean
up_device_coldplug (UpDevice *device, UpDaemon *daemon, GObject *native)
{
	gboolean ret;
	const gchar *native_path;
	UpDeviceClass *klass = UP_DEVICE_GET_CLASS (device);
	gchar *id = NULL;

	g_return_val_if_fail (UP_IS_DEVICE (device), FALSE);

	/* save */
	device->priv->native = g_object_ref (native);
	device->priv->daemon = g_object_ref (daemon);

	native_path = up_native_get_native_path (native);
	device->priv->native_path = g_strdup (native_path);

	/* stop signals and callbacks */
	g_object_freeze_notify (G_OBJECT(device));
	device->priv->during_coldplug = TRUE;

	/* coldplug source */
	if (klass->coldplug != NULL) {
		ret = klass->coldplug (device);
		if (!ret) {
			g_debug ("failed to coldplug %s", device->priv->native_path);
			goto out;
		}
	}

	/* only put on the bus if we succeeded */
	ret = up_device_register_device (device);
	if (!ret) {
		g_warning ("failed to register device %s", device->priv->native_path);
		goto out;
	}

	/* force a refresh, although failure isn't fatal */
	ret = up_device_refresh_internal (device);
	if (!ret) {
		g_debug ("failed to refresh %s", device->priv->native_path);

		/* TODO: refresh should really have seporate
		 *       success _and_ changed parameters */
		ret = TRUE;
		goto out;
	}

	/* get the id so we can load the old history */
	id = up_device_get_id (device);
	if (id != NULL)
		up_history_set_id (device->priv->history, id);

out:
	/* start signals and callbacks */
	g_object_thaw_notify (G_OBJECT(device));
	device->priv->during_coldplug = FALSE;
	g_free (id);
	return ret;
}
Exemplo n.º 17
0
static void
gimp_curves_tool_reset (GimpImageMapTool *image_map_tool)
{
  GimpCurvesTool       *tool = GIMP_CURVES_TOOL (image_map_tool);
  GimpCurvesConfig     *default_config;
  GimpHistogramChannel  channel;

  default_config = GIMP_CURVES_CONFIG (image_map_tool->default_config);

  for (channel = GIMP_HISTOGRAM_VALUE;
       channel <= GIMP_HISTOGRAM_ALPHA;
       channel++)
    {
      if (default_config)
        {
          GimpCurveType curve_type = tool->config->curve[channel]->curve_type;

          g_object_freeze_notify (G_OBJECT (tool->config->curve[channel]));

          gimp_config_copy (GIMP_CONFIG (default_config->curve[channel]),
                            GIMP_CONFIG (tool->config->curve[channel]),
                            0);

          g_object_set (tool->config->curve[channel],
                        "curve-type", curve_type,
                        NULL);

          g_object_thaw_notify (G_OBJECT (tool->config->curve[channel]));
        }
      else
        {
          gimp_curve_reset (tool->config->curve[channel], FALSE);
        }
    }
}
Exemplo n.º 18
0
static void
gimp_color_balance_tool_reset (GimpImageMapTool *im_tool)
{
  GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (im_tool);
  GimpTransferMode      range   = cb_tool->config->range;

  g_object_freeze_notify (im_tool->config);

  if (im_tool->default_config)
    {
      gimp_config_copy (GIMP_CONFIG (im_tool->default_config),
                        GIMP_CONFIG (im_tool->config),
                        0);
    }
  else
    {
      gimp_config_reset (GIMP_CONFIG (im_tool->config));
    }

  g_object_set (cb_tool->config,
                "range", range,
                NULL);

  g_object_thaw_notify (im_tool->config);
}
Exemplo n.º 19
0
/**
 * clutter_snap_constraint_set_edges:
 * @constraint: a #ClutterSnapConstraint
 * @from_edge: the edge on the actor
 * @to_edge: the edge on the source
 *
 * Sets the edges to be used by the @constraint
 *
 * The @from_edge is the edge on the #ClutterActor to which @constraint
 * has been added. The @to_edge is the edge of the #ClutterActor inside
 * the #ClutterSnapConstraint:source property.
 *
 *
 */
void
clutter_snap_constraint_set_edges (ClutterSnapConstraint *constraint,
                                   ClutterSnapEdge        from_edge,
                                   ClutterSnapEdge        to_edge)
{
  gboolean from_changed = FALSE, to_changed = FALSE;

  g_return_if_fail (CLUTTER_IS_SNAP_CONSTRAINT (constraint));

  g_object_freeze_notify (G_OBJECT (constraint));

  if (constraint->from_edge != from_edge)
    {
      constraint->from_edge = from_edge;
      g_object_notify_by_pspec (G_OBJECT (constraint),
                                obj_props[PROP_FROM_EDGE]);
      from_changed = TRUE;
    }

  if (constraint->to_edge != to_edge)
    {
      constraint->to_edge = to_edge;
      g_object_notify_by_pspec (G_OBJECT (constraint),
                                obj_props[PROP_TO_EDGE]);
      to_changed = TRUE;
    }

  if ((from_changed || to_changed) &&
      constraint->actor != NULL)
    {
      clutter_actor_queue_relayout (constraint->actor);
    }

  g_object_thaw_notify (G_OBJECT (constraint));
}
Exemplo n.º 20
0
void
_cinnamon_app_add_window (CinnamonApp        *app,
                       MetaWindow      *window)
{
  guint32 user_time;

  if (app->running_state && g_slist_find (app->running_state->windows, window))
    return;

  g_object_freeze_notify (G_OBJECT (app));

  if (!app->running_state)
      create_running_state (app);

  app->running_state->window_sort_stale = TRUE;
  app->running_state->windows = g_slist_prepend (app->running_state->windows, g_object_ref (window));
  g_signal_connect (window, "unmanaged", G_CALLBACK(cinnamon_app_on_unmanaged), app);
  g_signal_connect (window, "notify::user-time", G_CALLBACK(cinnamon_app_on_user_time_changed), app);

  user_time = meta_window_get_user_time (window);
  if (user_time > app->running_state->last_user_time)
    app->running_state->last_user_time = user_time;

  if (app->state != CINNAMON_APP_STATE_STARTING)
    cinnamon_app_state_transition (app, CINNAMON_APP_STATE_RUNNING);

  g_object_thaw_notify (G_OBJECT (app));

  g_signal_emit (app, cinnamon_app_signals[WINDOWS_CHANGED], 0);
}
Exemplo n.º 21
0
static gboolean
purple_circular_buffer_real_mark_read(PurpleCircularBuffer *buffer,
                                      gsize len)
{
	PurpleCircularBufferPrivate *priv = NULL;
	GObject *obj;

	g_return_val_if_fail(purple_circular_buffer_get_max_read(buffer) >= len, FALSE);

	priv = PURPLE_CIRCULAR_BUFFER_GET_PRIVATE(buffer);

	priv->output += len;
	priv->bufused -= len;

	/* wrap to the start if we're at the end */
	if ((gsize)(priv->output - priv->buffer) == priv->buflen)
		priv->output = priv->buffer;

	obj = G_OBJECT(buffer);
	g_object_freeze_notify(obj);
	g_object_notify_by_pspec(obj, properties[PROP_BUFFER_USED]);
	g_object_notify_by_pspec(obj, properties[PROP_OUTPUT]);
	g_object_thaw_notify(obj);

	return TRUE;
}
Exemplo n.º 22
0
static void
update_properties (NMDevice *device)
{
	NMDeviceMacvlan *self = NM_DEVICE_MACVLAN (device);
	NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE (device);
	GObject *object = G_OBJECT (device);
	NMPlatformMacvlanProperties props;

	if (!nm_platform_macvlan_get_properties (nm_device_get_ifindex (device), &props)) {
		_LOGW (LOGD_HW, "could not read macvlan properties");
		return;
	}

	g_object_freeze_notify (object);

	if (priv->props.parent_ifindex != props.parent_ifindex)
		g_object_notify (object, NM_DEVICE_MACVLAN_PARENT);
	if (g_strcmp0 (priv->props.mode, props.mode) != 0)
		g_object_notify (object, NM_DEVICE_MACVLAN_MODE);
	if (priv->props.no_promisc != props.no_promisc)
		g_object_notify (object, NM_DEVICE_MACVLAN_NO_PROMISC);

	memcpy (&priv->props, &props, sizeof (NMPlatformMacvlanProperties));

	g_object_thaw_notify (object);
}
Exemplo n.º 23
0
/**
 * g_permission_impl_update:
 * @permission: a #GPermission instance
 * @allowed: the new value for the 'allowed' property
 * @can_acquire: the new value for the 'can-acquire' property
 * @can_release: the new value for the 'can-release' property
 *
 * This function is called by the #GPermission implementation to update
 * the properties of the permission.  You should never call this
 * function except from a #GPermission implementation.
 *
 * GObject notify signals are generated, as appropriate.
 *
 * Since: 2.26
 **/
void
g_permission_impl_update (GPermission *permission,
                          gboolean     allowed,
                          gboolean     can_acquire,
                          gboolean     can_release)
{
  GObject *object = G_OBJECT (permission);

  g_object_freeze_notify (object);

  if (allowed != permission->priv->allowed)
    {
      permission->priv->allowed = !!allowed;
      g_object_notify (object, "allowed");
    }

  if (can_acquire != permission->priv->can_acquire)
    {
      permission->priv->can_acquire = !!can_acquire;
      g_object_notify (object, "can-acquire");
    }

  if (can_release != permission->priv->can_release)
    {
      permission->priv->can_release = !!can_release;
      g_object_notify (object, "can-release");
    }

  g_object_thaw_notify (object);
}
Exemplo n.º 24
0
static void
nmt_newt_entry_set_text_internal (NmtNewtEntry  *entry,
                                  const char    *text,
                                  newtComponent  co)
{
    NmtNewtEntryPrivate *priv = NMT_NEWT_ENTRY_GET_PRIVATE (entry);

    if (!text)
        text = "";

    if (!strcmp (priv->text, text))
        return;

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

    if (co) {
        char *text_lc;

        text_lc = priv->text ? nmt_newt_locale_from_utf8 (priv->text) : NULL;
        newtEntrySet (co, text_lc, TRUE);
        g_free (text_lc);
        priv->last_cursor_pos = -1;
    }

    g_object_freeze_notify (G_OBJECT (entry));
    nmt_newt_entry_check_valid (entry);
    g_object_notify (G_OBJECT (entry), "text");
    g_object_thaw_notify (G_OBJECT (entry));
}
/**
 * clutter_behaviour_rotate_set_bounds:
 * @rotate: a #ClutterBehaviourRotate
 * @angle_start: initial angle in degrees, between 0 and 360.
 * @angle_end: final angle in degrees, between 0 and 360.
 *
 * Sets the initial and final angles of a rotation behaviour; angles >= 360
 * degrees get clamped to the canonical interval <0, 360).
 *
 * Since: 0.4
 */
void
clutter_behaviour_rotate_set_bounds (ClutterBehaviourRotate *rotate,
                                     gdouble                 angle_start,
                                     gdouble                 angle_end)
{
  ClutterBehaviourRotatePrivate *priv;

  g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate));

  priv = rotate->priv;

  g_object_freeze_notify (G_OBJECT (rotate));

  if (priv->angle_start != angle_start)
    {
      priv->angle_start = clamp_angle (angle_start);

      g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_ANGLE_START]);
    }

  if (priv->angle_end != angle_end)
    {
      priv->angle_end = clamp_angle (angle_end);

      g_object_notify_by_pspec (G_OBJECT (rotate), obj_props[PROP_ANGLE_END]);
    }

  g_object_thaw_notify (G_OBJECT (rotate));
}
Exemplo n.º 26
0
Arquivo: mx-bin.c Projeto: ebassi/mx
/**
 * mx_bin_set_fill:
 * @bin: a #MxBin
 * @x_fill: %TRUE if the child should fill horizontally the @bin
 * @y_fill: %TRUE if the child should fill vertically the @bin
 *
 * Sets whether the child of @bin should fill out the horizontal
 * and/or vertical allocation of the parent
 */
void
mx_bin_set_fill (MxBin   *bin,
                 gboolean x_fill,
                 gboolean y_fill)
{
  MxBinPrivate *priv;
  gboolean changed = FALSE;

  g_return_if_fail (MX_IS_BIN (bin));

  priv = bin->priv;

  g_object_freeze_notify (G_OBJECT (bin));

  if (priv->x_fill != x_fill)
    {
      priv->x_fill = x_fill;
      changed = TRUE;

      g_object_notify (G_OBJECT (bin), "x-fill");
    }

  if (priv->y_fill != y_fill)
    {
      priv->y_fill = y_fill;
      changed = TRUE;

      g_object_notify (G_OBJECT (bin), "y-fill");
    }

  if (changed)
    clutter_actor_queue_relayout (CLUTTER_ACTOR (bin));

  g_object_thaw_notify (G_OBJECT (bin));
}
Exemplo n.º 27
0
static void
gimp_levels_tool_reset (GimpImageMapTool *image_map_tool)
{
  GimpLevelsTool       *tool    = GIMP_LEVELS_TOOL (image_map_tool);
  GimpHistogramChannel  channel = tool->config->channel;

  g_object_freeze_notify (image_map_tool->config);

  if (image_map_tool->default_config)
    {
      gimp_config_copy (GIMP_CONFIG (image_map_tool->default_config),
                        GIMP_CONFIG (image_map_tool->config),
                        0);
    }
  else
    {
      gimp_config_reset (GIMP_CONFIG (image_map_tool->config));
    }

  g_object_set (tool->config,
                "channel", channel,
                NULL);

  g_object_thaw_notify (image_map_tool->config);
}
Exemplo n.º 28
0
void
st_icon_set_icon_name (StIcon      *icon,
                       const gchar *icon_name)
{
  StIconPrivate *priv = icon->priv;
  GIcon *gicon = NULL;

  g_return_if_fail (ST_IS_ICON (icon));

  if (icon_name)
    gicon = g_themed_icon_new_with_default_fallbacks (icon_name);

  if (g_icon_equal (priv->gicon, gicon)) /* do nothing */
    {
      g_object_unref (gicon);
      return;
    }

  if (priv->gicon)
    g_object_unref (priv->gicon);

  g_object_freeze_notify (G_OBJECT (icon));

  priv->gicon = gicon;

  g_object_notify (G_OBJECT (icon), "gicon");
  g_object_notify (G_OBJECT (icon), "icon-name");

  g_object_thaw_notify (G_OBJECT (icon));

  st_icon_update (icon);
}
Exemplo n.º 29
0
/**
 * st_bin_set_alignment:
 * @bin: a #StBin
 * @x_align: horizontal alignment
 * @y_align: vertical alignment
 *
 * Sets the horizontal and vertical alignment of the child
 * inside a #StBin.
 */
void
st_bin_set_alignment (StBin  *bin,
                      StAlign x_align,
                      StAlign y_align)
{
  StBinPrivate *priv;
  gboolean changed = FALSE;

  g_return_if_fail (ST_IS_BIN (bin));

  priv = bin->priv;

  g_object_freeze_notify (G_OBJECT (bin));

  if (priv->x_align != x_align)
    {
      priv->x_align = x_align;
      g_object_notify (G_OBJECT (bin), "x-align");
      changed = TRUE;
    }

  if (priv->y_align != y_align)
    {
      priv->y_align = y_align;
      g_object_notify (G_OBJECT (bin), "y-align");
      changed = TRUE;
    }

  if (changed)
    clutter_actor_queue_relayout (CLUTTER_ACTOR (bin));

  g_object_thaw_notify (G_OBJECT (bin));
}
Exemplo n.º 30
0
NMAccessPoint *
nm_ap_new_from_properties (GHashTable *properties)
{
	NMAccessPoint *ap;
	GTimeVal cur_time;
	const struct ether_addr * addr;
	const char bad_bssid1[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
	const char bad_bssid2[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };

	g_return_val_if_fail (properties != NULL, NULL);

	ap = nm_ap_new ();

	g_object_freeze_notify (G_OBJECT (ap));
	g_hash_table_foreach (properties, foreach_property_cb, ap);

	/* ignore APs with invalid BSSIDs */
	addr = nm_ap_get_address (ap);
	if (   !(memcmp (addr->ether_addr_octet, bad_bssid1, ETH_ALEN))
	    || !(memcmp (addr->ether_addr_octet, bad_bssid2, ETH_ALEN))) {
		g_object_unref (ap);
		return NULL;
	}

	g_get_current_time (&cur_time);
	nm_ap_set_last_seen (ap, cur_time.tv_sec);

	if (!nm_ap_get_ssid (ap))
		nm_ap_set_broadcast (ap, FALSE);

	g_object_thaw_notify (G_OBJECT (ap));

	return ap;
}