• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ gtk_widget_is_drawable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中gtk_widget_is_drawable函数的典型用法代码示例。如果您正苦于以下问题:C++ gtk_widget_is_drawable函数的具体用法?C++ gtk_widget_is_drawable怎么用?C++ gtk_widget_is_drawable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了gtk_widget_is_drawable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gimp_histogram_editor_frozen_update

static void
gimp_histogram_editor_frozen_update (GimpHistogramEditor *editor,
                                     const GParamSpec    *pspec)
{
  GimpHistogramView *view = GIMP_HISTOGRAM_BOX (editor->box)->view;

  if (gimp_viewable_preview_is_frozen (GIMP_VIEWABLE (editor->drawable)))
    {
      /* Only do the background histogram if the histogram is visible.
       * This is a workaround for the fact that recalculating the
       * histogram is expensive and that it is only validated when it
       * is shown. So don't slow down painting by doing something that
       * is not even seen by the user.
       */
      if (! editor->bg_histogram &&
          gtk_widget_is_drawable (GTK_WIDGET (editor)))
        {
          if (gimp_histogram_editor_validate (editor))
            editor->bg_histogram = gimp_histogram_duplicate (editor->histogram);

          gimp_histogram_view_set_background (view, editor->bg_histogram);
        }
    }
  else if (editor->bg_histogram)
    {
      g_object_unref (editor->bg_histogram);
      editor->bg_histogram = NULL;

      gimp_histogram_view_set_background (view, NULL);
    }
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:31,代码来源:gimphistogrameditor.c


示例2: ppg_ruler_size_allocate

/**
 * ppg_ruler_size_allocate:
 * @ruler: (in): A #PpgRuler.
 *
 * Handle the "size-allocate" for the #GtkWidget. The pixmap for the
 * background is created and drawn if necessary.
 *
 * Returns: None.
 * Side effects: None.
 */
static void
ppg_ruler_size_allocate (GtkWidget     *widget,
                         GtkAllocation *alloc)
{
	PpgRuler *ruler = (PpgRuler *)widget;
	PpgRulerPrivate *priv;
	GdkWindow *window;

	g_return_if_fail(PPG_IS_RULER(ruler));

	priv = ruler->priv;

	GTK_WIDGET_CLASS(ppg_ruler_parent_class)->size_allocate(widget, alloc);

	if (priv->ruler) {
		cairo_surface_destroy(priv->ruler);
	}

	if (gtk_widget_is_drawable(widget)) {
		window = gtk_widget_get_window(widget);
		priv->ruler = gdk_window_create_similar_surface(window,
														CAIRO_CONTENT_COLOR_ALPHA,
														alloc->width,
														alloc->height);
		ppg_ruler_draw_ruler(ruler);
	}
}
开发者ID:chergert,项目名称:perfkit,代码行数:37,代码来源:ppg-ruler.c


示例3: sp_gradient_image_update

static void
sp_gradient_image_update (SPGradientImage *image)
{
        if (gtk_widget_is_drawable (GTK_WIDGET(image))) {
                gtk_widget_queue_draw (GTK_WIDGET (image));
        }
}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:7,代码来源:gradient-image.cpp


示例4: gimp_ruler_expose

static gboolean
gimp_ruler_expose (GtkWidget      *widget,
                   GdkEventExpose *event)
{
  if (gtk_widget_is_drawable (widget))
    {
      GimpRuler        *ruler = GIMP_RULER (widget);
      GimpRulerPrivate *priv  = GIMP_RULER_GET_PRIVATE (ruler);
      GtkAllocation     allocation;
      cairo_t          *cr;

      gimp_ruler_draw_ticks (ruler);

      cr = gdk_cairo_create (gtk_widget_get_window (widget));
      gdk_cairo_region (cr, event->region);
      cairo_clip (cr);

      gtk_widget_get_allocation (widget, &allocation);
      cairo_translate (cr, allocation.x, allocation.y);

      cairo_set_source_surface (cr, priv->backing_store, 0, 0);
      cairo_paint (cr);

      gimp_ruler_draw_pos (ruler);

      cairo_destroy (cr);
    }

  return FALSE;
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:30,代码来源:gimpruler.c


示例5: cdisplay_lcms_get_screen

static GdkScreen *
cdisplay_lcms_get_screen (CdisplayLcms *lcms,
                          gint         *monitor)
{
  GimpColorManaged *managed;
  GdkScreen        *screen;

  managed = gimp_color_display_get_managed (GIMP_COLOR_DISPLAY (lcms));

  if (GTK_IS_WIDGET (managed))
    screen = gtk_widget_get_screen (GTK_WIDGET (managed));
  else
    screen = gdk_screen_get_default ();

  g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);

  if (GTK_IS_WIDGET (managed) && gtk_widget_is_drawable (GTK_WIDGET (managed)))
    {
      GtkWidget *widget = GTK_WIDGET (managed);

      *monitor = gdk_screen_get_monitor_at_window (screen,
                                                   gtk_widget_get_window (widget));
    }
  else
    {
      *monitor = 0;
    }

  return screen;
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:30,代码来源:display-filter-lcms.c


示例6: check_buttonbox_child_position

static void
check_buttonbox_child_position (GtkWidget      *child,
                                ThemeMatchData *match_data)
{
  GList *children = NULL;
  GList *l;
  GtkWidget *bbox;
  gboolean secondary;

  g_assert (GTK_IS_BUTTON_BOX (child->parent));
  bbox = child->parent;

  secondary = gtk_button_box_get_child_secondary (GTK_BUTTON_BOX (bbox), child);

  for (l = GTK_BOX (bbox)->children; l != NULL; l = l->next)
    {
      GtkBoxChild *child_info = l->data;
      GtkWidget *widget = child_info->widget;

      if (child_info->is_secondary == secondary && gtk_widget_is_drawable (widget))
	children = g_list_prepend (children, widget);
    }

  check_child_position (child, children, match_data);
  g_list_free (children);
}
开发者ID:GNOME,项目名称:sapwood,代码行数:26,代码来源:sapwood-style.c


示例7: gimp_view_expose_event

static gboolean
gimp_view_expose_event (GtkWidget      *widget,
                        GdkEventExpose *event)
{
    if (gtk_widget_is_drawable (widget))
    {
        GtkAllocation  allocation;
        cairo_t       *cr;

        gtk_widget_get_allocation (widget, &allocation);

        cr = gdk_cairo_create (event->window);
        gdk_cairo_region (cr, event->region);
        cairo_clip (cr);

        cairo_translate (cr, allocation.x, allocation.y);

        gimp_view_renderer_draw (GIMP_VIEW (widget)->renderer,
                                 widget, cr,
                                 allocation.width,
                                 allocation.height);

        cairo_destroy (cr);
    }

    return FALSE;
}
开发者ID:Hboybowen,项目名称:gimp,代码行数:27,代码来源:gimpview.c


示例8: panel_frame_expose

static gboolean panel_frame_expose(GtkWidget* widget, GdkEventExpose* event)
#endif
{
	PanelFrame *frame = (PanelFrame *) widget;
	gboolean    retval = FALSE;

	if (!gtk_widget_is_drawable (widget))
		return retval;

#if GTK_CHECK_VERSION (3, 0, 0)
	if (GTK_WIDGET_CLASS (panel_frame_parent_class)->draw)
		retval = GTK_WIDGET_CLASS (panel_frame_parent_class)->draw (widget, cr);
#else
	if (GTK_WIDGET_CLASS (panel_frame_parent_class)->expose_event)
		retval = GTK_WIDGET_CLASS (panel_frame_parent_class)->expose_event (widget, event);
#endif

#if GTK_CHECK_VERSION (3, 0, 0)
	panel_frame_draw (widget, cr, frame->edges);
#else
	panel_frame_draw (widget, frame->edges);
#endif

	return retval;
}
开发者ID:digideskio,项目名称:mate-panel,代码行数:25,代码来源:panel-frame.c


示例9: panel_icon_grid_expose

static gboolean panel_icon_grid_expose(GtkWidget *widget, GdkEventExpose *event)
#endif
{
    if (gtk_widget_is_drawable(widget))
    {
        if (gtk_widget_get_has_window(widget) &&
            !gtk_widget_get_app_paintable(widget))
#if GTK_CHECK_VERSION(3, 0, 0)
            gtk_render_background(gtk_widget_get_style_context(widget), cr, 0, 0,
                                  gtk_widget_get_allocated_width(widget),
                                  gtk_widget_get_allocated_height(widget));
#else
            gtk_paint_flat_box(gtk_widget_get_style(widget),
                               gtk_widget_get_window(widget),
                               gtk_widget_get_state(widget), GTK_SHADOW_NONE,
                               &event->area, widget, "panelicongrid",
                               0, 0, -1, -1);
#endif

#if GTK_CHECK_VERSION(3, 0, 0)
        GTK_WIDGET_CLASS(panel_icon_grid_parent_class)->draw(widget, cr);
#else
        GTK_WIDGET_CLASS(panel_icon_grid_parent_class)->expose_event(widget, event);
#endif
    }
    return FALSE;
}
开发者ID:setzer22,项目名称:lxpanel,代码行数:27,代码来源:icon-grid.c


示例10: update_animation_info

/* update the animation information for each widget. This will also queue a redraw
 * and stop the animation if it is done. */
static gboolean
update_animation_info (gpointer key, gpointer value, gpointer user_data)
{
	AnimationInfo *animation_info = value;
	GtkWidget *widget = key;
	
	g_assert ((widget != NULL) && (animation_info != NULL));
	
	/* remove the widget from the hash table if it is not drawable */
	if (!gtk_widget_is_drawable (widget))
	{
		return TRUE;
	}
	
	if (GE_IS_PROGRESS_BAR (widget))
	{
		gfloat fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (widget));
		
		/* stop animation for filled/not filled progress bars */
		if (fraction <= 0.0 || fraction >= 1.0)
			return TRUE;
	}
	
	force_widget_redraw (widget);
	
	/* stop at stop_time */
	if (animation_info->stop_time != 0 &&
	    g_timer_elapsed (animation_info->timer, NULL) > animation_info->stop_time)
		return TRUE;
	
	return FALSE;
}
开发者ID:Distrotech,项目名称:gtk-engines,代码行数:34,代码来源:animation.c


示例11: gb_progress_bar_draw

static gboolean
gb_progress_bar_draw (GtkWidget *widget,
                      cairo_t   *cr)
{
   GbProgressBarPrivate *priv;
   GtkStyleContext *context;
   GbProgressBar *bar = (GbProgressBar *)widget;
   GtkAllocation allocation;
   GtkStateType state;
   GdkRGBA color = { 0 };

   g_return_val_if_fail(GB_IS_PROGRESS_BAR(bar), FALSE);

   priv = bar->priv;

   if (gtk_widget_is_drawable(widget)) {
      gtk_widget_get_allocation(widget, &allocation);

      state = gtk_widget_get_state(widget);
      context = gtk_widget_get_style_context(widget);
      gtk_style_context_get_color(context, state, &color);

      cairo_save(cr);
      cairo_rectangle(cr,
                      0,
                      0,
                      priv->fraction * allocation.width,
                      allocation.height);
      gdk_cairo_set_source_rgba(cr, &color);
      cairo_fill(cr);
      cairo_restore(cr);
   }

   return FALSE;
}
开发者ID:chergert,项目名称:gnome-builder-legacy,代码行数:35,代码来源:gb-progress-bar.c


示例12: xfce_arrow_button_draw

static gboolean
xfce_arrow_button_draw (GtkWidget      *widget,
                        cairo_t        *cr)
{
    gint x, y, w;
    GtkStyleContext *context;
    xfce_arrow_button_thickness thickness;
    GtkAllocation allocation;

    if (G_LIKELY (gtk_widget_is_drawable (widget)))
    {
        context = gtk_widget_get_style_context (widget);
        xfce_arrow_button_get_thickness (context, &thickness);
        gtk_widget_get_allocation (widget, &allocation);

        w = MIN (allocation.height - 2 * thickness.y,
                 allocation.width  - 2 * thickness.x);
        w = MIN (w, ARROW_WIDTH);

        x = (allocation.width - w) / 2;
        y = (allocation.height - w) / 2;

        GTK_WIDGET_CLASS (parent_class)->draw (widget, cr);

        gtk_style_context_save (context);
        gtk_style_context_set_state (context, gtk_widget_get_state_flags (widget));

        gtk_render_arrow (context, cr, G_PI, x, y, w);

        gtk_style_context_restore (context);
    }

    return TRUE;
}
开发者ID:xfce-mirror,项目名称:xfmpc,代码行数:34,代码来源:xfce-arrow-button.c


示例13: nruler_make_pixmap

static void
nruler_make_pixmap(Nruler *ruler, GtkWidget *widget, GtkWidget *parent)
{
  gint width;
  gint height;
  GtkAllocation allocation, parent_allocation;

  if (! gtk_widget_is_drawable(widget)) {
    return;
  }

  gtk_widget_get_allocation(widget, &allocation);
  gtk_widget_get_allocation(parent, &parent_allocation);

  if (ruler->orientation == GTK_ORIENTATION_HORIZONTAL) {
    ruler->length = parent_allocation.width;
    ruler->size = allocation.height;
    ruler->ofst = (parent_allocation.width - allocation.width) / 2;
  } else {
    ruler->length = parent_allocation.height;
    ruler->size = allocation.width;
    ruler->ofst = (parent_allocation.height - allocation.height) / 2;
  }

  if (ruler->backing_store) {
#if GTK_CHECK_VERSION(3, 0, 0)
    width = cairo_image_surface_get_width(ruler->backing_store);
    height = cairo_image_surface_get_height(ruler->backing_store);
#elif GTK_CHECK_VERSION(2, 24, 0)
    gdk_pixmap_get_size(ruler->backing_store, &width, &height);
#else
    gdk_drawable_get_size(ruler->backing_store, &width, &height);
#endif
    if ((width == allocation.width) &&
	(height == allocation.height)) {
      return;
    }

#if GTK_CHECK_VERSION(3, 0, 0)
    cairo_surface_destroy(ruler->backing_store);
#else
    g_object_unref(ruler->backing_store);
#endif
  }

#if GTK_CHECK_VERSION(3, 0, 0)
  ruler->backing_store = cairo_image_surface_create(CAIRO_FORMAT_RGB24,
						    allocation.width,
						    allocation.height);
#else
  ruler->backing_store = gdk_pixmap_new(gtk_widget_get_window(widget),
					allocation.width,
					allocation.height,
					-1);
#endif

  ruler->save_l = 0;
  ruler->save_u = 0;
}
开发者ID:htrb,项目名称:ngraph-gtk,代码行数:59,代码来源:gtk_ruler.c


示例14: nsgtk_widget_is_drawable

gboolean nsgtk_widget_is_drawable(GtkWidget *widget)
{
  #if GTK_CHECK_VERSION(2,18,0)
	return gtk_widget_is_drawable(widget);
  #else
	return GTK_WIDGET_DRAWABLE(widget);
  #endif
}
开发者ID:pcwalton,项目名称:NetSurf,代码行数:8,代码来源:compat.c


示例15: selectcolor_set_circle

void selectcolor_set_circle(GtkWidget * sc, gboolean circle) {
	g_return_if_fail(sc != NULL);
	g_return_if_fail(IS_SELECT_COLOR(sc));

	SELECT_COLOR(sc)->circle = circle;

	if (gtk_widget_is_drawable(GTK_WIDGET(sc))) {
		selectcolor_paint(sc);
	}
}
开发者ID:wbrenna,项目名称:xournalpp,代码行数:10,代码来源:SelectColor.cpp


示例16: scope_setdata

void scope_setdata(Scope *scope, short *samples)
{
	g_return_if_fail(scope != NULL);
	g_return_if_fail(IS_SCOPE(scope));
        memcpy(scope->y, samples, sizeof(scope->y));
	if (gtk_widget_is_drawable(GTK_WIDGET(scope))) {
		if (!scope->idlefunc)
			scope->idlefunc = g_idle_add_full(PRIO, idle_callback, scope, NULL);
	}
}
开发者ID:coreyreichle,项目名称:soundmodem,代码行数:10,代码来源:scope.c


示例17: selectcolor_set_color

void selectcolor_set_color(GtkWidget * sc, gint color) {
	g_return_if_fail(sc != NULL);
	g_return_if_fail(IS_SELECT_COLOR(sc));

	SELECT_COLOR(sc)->color = color;

	if (gtk_widget_is_drawable(GTK_WIDGET(sc))) {
		selectcolor_paint(sc);
	}
}
开发者ID:wbrenna,项目名称:xournalpp,代码行数:10,代码来源:SelectColor.cpp


示例18: idle_callback

static gint idle_callback(gpointer data)
{
	g_return_val_if_fail(data != NULL, FALSE);
	g_return_val_if_fail(IS_SCOPE(data), FALSE);
	SCOPE(data)->idlefunc = 0;
	if (!gtk_widget_is_drawable(GTK_WIDGET(data)))
		return FALSE;
	draw(SCOPE(data));
	return FALSE;  /* don't call this callback again */
}
开发者ID:coreyreichle,项目名称:soundmodem,代码行数:10,代码来源:scope.c


示例19: gimp_palette_view_expose

static gboolean
gimp_palette_view_expose (GtkWidget      *widget,
                          GdkEventExpose *eevent)
{
  GimpPaletteView *pal_view = GIMP_PALETTE_VIEW (widget);
  GimpView        *view     = GIMP_VIEW (widget);

  if (! gtk_widget_is_drawable (widget))
    return FALSE;

  GTK_WIDGET_CLASS (parent_class)->expose_event (widget, eevent);

  if (view->renderer->viewable && pal_view->selected)
    {
      GimpViewRendererPalette *renderer;
      GtkStyle                *style = gtk_widget_get_style (widget);
      GtkAllocation            allocation;
      cairo_t                 *cr;
      gint                     row, col;

      renderer = GIMP_VIEW_RENDERER_PALETTE (view->renderer);

      gtk_widget_get_allocation (widget, &allocation);

      row = pal_view->selected->position / renderer->columns;
      col = pal_view->selected->position % renderer->columns;

      cr = gdk_cairo_create (gtk_widget_get_window (widget));
      gdk_cairo_region (cr, eevent->region);
      cairo_clip (cr);

      cairo_translate (cr, allocation.x, allocation.y);

      cairo_rectangle (cr,
                       col * renderer->cell_width  + 0.5,
                       row * renderer->cell_height + 0.5,
                       renderer->cell_width,
                       renderer->cell_height);

      cairo_set_line_width (cr, 1.0);
      gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_SELECTED]);
      cairo_stroke_preserve (cr);

      if (gimp_cairo_set_focus_line_pattern (cr, widget))
        {
          gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
          cairo_stroke (cr);
        }

      cairo_destroy (cr);
    }

  return FALSE;
}
开发者ID:Amerekanets,项目名称:gimp-1,代码行数:54,代码来源:gimppaletteview.c


示例20: gimp_widget_flush_expose

void
gimp_widget_flush_expose (GtkWidget *widget)
{
  g_return_if_fail (GTK_IS_WIDGET (widget));

  if (! gtk_widget_is_drawable (widget))
    return;

  gdk_window_process_updates (gtk_widget_get_window (widget), FALSE);
  gdk_flush ();
}
开发者ID:WilfR,项目名称:Gimp-Matting,代码行数:11,代码来源:gimpwidgets-utils.c



注:本文中的gtk_widget_is_drawable函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ gtk_widget_is_toplevel函数代码示例发布时间:2022-05-28
下一篇:
C++ gtk_widget_init_template函数代码示例发布时间:2022-05-28
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap