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

C++ gtk_widget_queue_draw_area函数代码示例

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

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



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

示例1: dnd_highlight_queue_redraw

/* Queue a redraw of the dnd highlight rect */
static void
dnd_highlight_queue_redraw (GtkWidget *widget)
{
	NemoIconDndInfo *dnd_info;
	int width, height;
	GtkAllocation allocation;
	
	dnd_info = NEMO_ICON_CONTAINER (widget)->details->dnd_info;
	
	if (!dnd_info->highlighted) {
		return;
	}

	gtk_widget_get_allocation (widget, &allocation);
	width = allocation.width;
	height = allocation.height;

	/* we don't know how wide the shadow is exactly,
	 * so we expose a 10-pixel wide border
	 */
	gtk_widget_queue_draw_area (widget,
				    0, 0,
				    width, 10);
	gtk_widget_queue_draw_area (widget,
				    0, 0,
				    10, height);
	gtk_widget_queue_draw_area (widget,
				    0, height - 10,
				    width, 10);
	gtk_widget_queue_draw_area (widget,
				    width - 10, 0,
				    10, height);
}
开发者ID:Ahmed-Developer,项目名称:nemo,代码行数:34,代码来源:nemo-icon-dnd.c


示例2: gtk_image_tool_selector_set_selection

/**
 * gtk_image_tool_selector_set_selection:
 * @selector: a #GtkImageToolSelector
 * @rect: Selection rectangle in image space coordinates.
 *
 * Sets the selection rectangle for the tool. Setting this attribute
 * will cause the widget to immediately repaint itself if its view is
 * realized.
 *
 * This method does nothing under the following circumstances:
 *
 * <itemizedlist>
 *   <listitem>If the views pixbuf is %NULL.</listitem>
 *   <listitem>If @rect is wider or taller than the size of the
 *   pixbuf</listitem>
 *   <listitem>If @rect equals the current selection
 *   rectangle.</listitem>
 * </itemizedlist>
 *
 * If the selection falls outside the pixbufs area, its position is
 * moved so that it is within the pixbuf.
 *
 * Calling this method causes the ::selection-changed signal to be
 * emitted.
 *
 * The default selection is (0,0) - [0,0].
 **/
void
gtk_image_tool_selector_set_selection (GtkImageToolSelector *selector,
                                       GdkRectangle         *rect)
{
    GtkImageView *view = selector->view;
    GdkPixbuf *pixbuf = gtk_image_view_get_pixbuf (view);
    if (!pixbuf)
        return;

    int width = gdk_pixbuf_get_width (pixbuf);
    int height = gdk_pixbuf_get_height (pixbuf);
    if (rect->width > width || rect->height > height)
        return;

    rect->x = CLAMP (rect->x, 0, width - rect->width);
    rect->y = CLAMP (rect->y, 0, height - rect->height);
    if (gdk_rectangle_eq (*rect, selector->sel_rect))
        return;

    GdkRectangle wid_old = {0}, wid_new = {0};
    gtk_image_view_image_to_widget_rect (view, &selector->sel_rect, &wid_old);
    gtk_image_view_image_to_widget_rect (view, rect, &wid_new);

    selector->sel_rect = *rect;

    gtk_widget_queue_draw_area (GTK_WIDGET (view),
                                wid_old.x, wid_old.y,
                                wid_old.width, wid_old.height);
    gtk_widget_queue_draw_area (GTK_WIDGET (view),
                                wid_new.x, wid_new.y,
                                wid_new.width, wid_new.height);

    g_signal_emit (G_OBJECT (selector),
                   gtk_image_tool_selector_signals[0], 0);
}
开发者ID:GNOME,项目名称:gtkimageview,代码行数:62,代码来源:gtkimagetoolselector.c


示例3: gimp_ruler_queue_pos_redraw

static void
gimp_ruler_queue_pos_redraw (GimpRuler *ruler)
{
  GimpRulerPrivate  *priv = GIMP_RULER_GET_PRIVATE (ruler);
  const GdkRectangle rect = gimp_ruler_get_pos_rect (ruler, priv->position);

  gtk_widget_queue_draw_area (GTK_WIDGET(ruler),
                              rect.x,
                              rect.y,
                              rect.width,
                              rect.height);

  if (priv->last_pos_rect.width != 0 || priv->last_pos_rect.height != 0)
    {
      gtk_widget_queue_draw_area (GTK_WIDGET(ruler),
                                  priv->last_pos_rect.x,
                                  priv->last_pos_rect.y,
                                  priv->last_pos_rect.width,
                                  priv->last_pos_rect.height);

      priv->last_pos_rect.x      = 0;
      priv->last_pos_rect.y      = 0;
      priv->last_pos_rect.width  = 0;
      priv->last_pos_rect.height = 0;
    }
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:26,代码来源:gimpruler.c


示例4: gtk_widget_queue_draw_area

void Widget::invalidateRect(const IntRect& rect)
{
    if (data->suppressInvalidation)
        return;

    if (!parent()) {
        gtk_widget_queue_draw_area(GTK_WIDGET(containingWindow()), rect.x(), rect.y(),
                                   rect.width(), rect.height());
        if (isFrameView())
            static_cast<FrameView*>(this)->addToDirtyRegion(rect);
        return;
    }

    // Get the root widget.
    ScrollView* outermostView = parent();
    while (outermostView && outermostView->parent())
        outermostView = outermostView->parent();
    if (!outermostView)
        return;

    IntRect windowRect = convertToContainingWindow(rect);
    gtk_widget_queue_draw_area(GTK_WIDGET(containingWindow()), windowRect.x(), windowRect.y(),
                               windowRect.width(), windowRect.height());
    outermostView->addToDirtyRegion(windowRect);
}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:25,代码来源:WidgetGtk.cpp


示例5: move_item

void move_item(struct gropes_state *gs, struct map_state *ms,
	       struct item_on_screen *item, const struct gps_coord *pos,
	       struct gps_speed *speed)
{
	GdkRectangle *area;

	area = &item->area;

	if (pos == NULL) {
		/* If the position was already invalid, we don't have to
		 * do anything */
		item->pos_valid = item->on_screen = 0;
		if (item->update_info)
			item->update_info(ms, item);
	} else {
		GdkRectangle old_area;
		int was_valid;

		/* If the coordinates didn't change, we don't have to
		 * do anything */
		if (pos->la == item->pos.la &&
		    pos->lo == item->pos.lo &&
		    speed->speed == item->speed.speed &&
		    speed->track == item->speed.track &&
		    item->pos_valid)
			return;

		was_valid = item->pos_valid;
		item->pos_valid = 1;
		item->pos = *pos;
		item->speed = *speed;
		old_area = *area;
		if (item->update_info)
			item->update_info(ms, item);
		pthread_mutex_lock(&ms->mutex);
		calc_item_pos(gs, ms, item);
		item_save_track(item);
		pthread_mutex_unlock(&ms->mutex);
		/* Change map center if item is not on screen */
		if (gs->opt_follow_gps)
			change_map_center(gs, ms, &item->mpos, ms->scale);
		/* Now area contains the new item area */
		if (area->x == old_area.x && area->y == old_area.y &&
		    area->height == old_area.height &&
		    area->width == old_area.width)
			return;

		if (was_valid) {
			/* Invalidate old area */
			gtk_widget_queue_draw_area(ms->darea, old_area.x, old_area.y,
						   old_area.width, old_area.height);
		}
	}
	gtk_widget_queue_draw_area(ms->darea, area->x, area->y,
				   area->width, area->height);
}
开发者ID:vtervo,项目名称:gropes,代码行数:56,代码来源:item.c


示例6: screen_saver_update_state

static void
screen_saver_update_state (ScreenSaver *screen_saver,
                           gdouble      time)
{
    GList *tmp;

    tmp = screen_saver->floaters;
    while (tmp != NULL)
    {
        ScreenSaverFloater *floater;
        floater = (ScreenSaverFloater *) tmp->data;

        screen_saver_floater_update_state (screen_saver, floater, time);

        if (GTK_WIDGET_REALIZED (screen_saver->drawing_area)
                && (floater->bounds.width > 0) && (floater->bounds.height > 0))
        {
            gint size;
            size = CLAMP ((int) (FLOATER_MAX_SIZE * floater->scale),
                          FLOATER_MIN_SIZE, FLOATER_MAX_SIZE);

            gtk_widget_queue_draw_area (screen_saver->drawing_area,
                                        floater->bounds.x,
                                        floater->bounds.y,
                                        floater->bounds.width,
                                        floater->bounds.height);

            /* the edges could concievably be spread across two
             * pixels so we add +2 to invalidated region
             */
            if (screen_saver->should_do_rotations)
                gtk_widget_queue_draw_area (screen_saver->drawing_area,
                                            (int) (floater->position.x -
                                                   .5 * G_SQRT2 * size),
                                            (int) (floater->position.y -
                                                   .5 * G_SQRT2 * size),
                                            G_SQRT2 * size + 2,
                                            G_SQRT2 * size + 2);
            else
                gtk_widget_queue_draw_area (screen_saver->drawing_area,
                                            (int) (floater->position.x -
                                                   .5 * size),
                                            (int) (floater->position.y -
                                                   .5 * size),
                                            size + 2, size + 2);

            if  (screen_saver->should_show_paths)
                gtk_widget_queue_draw (screen_saver->drawing_area);
        }

        tmp = tmp->next;
    }
}
开发者ID:samupl,项目名称:mate-screensaver,代码行数:53,代码来源:floaters.c


示例7: drawCar

/* drawCar
 * Draws a car
 *
 * @return void
 */
void drawCar (int colorCarro, gint xant, gint yant, gint x, gint y, gint width, gint height) {
	GdkRectangle car;
	GdkColor color;
	switch(colorCarro){
		case 1: 
			gdk_color_parse("#FF0000", &color);
			break;
		case 2: 
			gdk_color_parse("#0000FF", &color);
			break;
		case 3: 
			gdk_color_parse("#00FF00", &color);
			break;
		case 4: 
			gdk_color_parse("#000000", &color);
			break;
		case 5:
			gdk_color_parse("#FFFFFF", &color);
			break;
		case 6: 
			gdk_color_parse("#FFFF00", &color);
			break;
		case 7: 
			gdk_color_parse("#FF6600", &color);
			break;
		case 8: 
			gdk_color_parse("#FF33CC", &color);
			break;
		case 9: 
			gdk_color_parse("#6699FF", &color);
			break;
		case 10: 
			gdk_color_parse("#777777", &color);
			break;
	}
	GdkGC* gcont;
	gcont = gdk_gc_new(this.pixMap); 
	gdk_gc_set_rgb_fg_color (gcont, &color);
	gtk_widget_queue_draw_area(this.drawingArea, xant, yant, width, height);
	car.x = x;
	car.y = y;
	car.width = width;
	car.height = height;
	gdk_draw_rectangle(this.pixMap, gcont, TRUE, car.x, car.y, car.width, car.height);
	if (colorCarro==4)
		gdk_draw_string(this.pixMap, gdk_font_load("-*-*-bold-r-normal--*-50-*-*-*-*-iso8859-1"), this.drawingArea->style->white_gc, (car.x+2), (car.y+10), "A1/5");
	else
		gdk_draw_string(this.pixMap, gdk_font_load("-*-*-bold-r-normal--*-50-*-*-*-*-iso8859-1"), this.drawingArea->style->black_gc, (car.x+2), (car.y+10), "A1/5");

	gtk_widget_queue_draw_area(this.drawingArea, car.x, car.y, car.width, car.height);
}
开发者ID:gl0gl0,项目名称:threadvilleSOA,代码行数:56,代码来源:ui.c


示例8: nsgtk_tree_redraw_request

static void nsgtk_tree_redraw_request(int x, int y, int width, int height, void *data)
{
	struct nsgtk_treeview *tw = data;
	
	gtk_widget_queue_draw_area(GTK_WIDGET(tw->drawing_area),
			x, y, width, height);
}
开发者ID:ysei,项目名称:NetSurf,代码行数:7,代码来源:treeview.c


示例9: gtk_xournal_repaint_area

void gtk_xournal_repaint_area(GtkWidget* widget, int x1, int y1, int x2,
                              int y2)
{
	g_return_if_fail(widget != NULL);
	g_return_if_fail(GTK_IS_XOURNAL(widget));

	GtkXournal* xournal = GTK_XOURNAL(widget);

	x1 -= xournal->x;
	x2 -= xournal->x;
	y1 -= xournal->y;
	y2 -= xournal->y;

	if (x2 < 0 || y2 < 0)
	{
		return; // outside visible area
	}

	GtkAllocation alloc = { 0 };
	gtk_widget_get_allocation(widget, &alloc);

	if (x1 > alloc.width || y1 > alloc.height)
	{
		return; // outside visible area
	}

	gtk_widget_queue_draw_area(widget, x1, y1, x2 - x1, y2 - y1);
}
开发者ID:scottt,项目名称:xournalpp,代码行数:28,代码来源:XournalWidget.cpp


示例10: tile_fetched

static void tile_fetched(const char *url, const char *filename,
			 gpointer data)
{
  char *nfname=g_strdup(filename);
  char *dot;
  GList *l=g_list_find_custom(tile_fetch_queue,url,mystrequal);
  struct mapwin *mw=(struct mapwin *)data;
  dot=strrchr(nfname,'.');
  if (dot) {
    dot[0]=0;
  }
  free_image_cache(nfname);
  g_free(nfname);
  if (mw) {
    gtk_widget_queue_draw_area(mw->map,0,0,
			       mw->page_width,
			       mw->page_height);
    mapwin_draw(mw,mw->map->style->fg_gc[mw->map->state],globalmap.first,
		mw->page_x,mw->page_y,0,0,mw->page_width,mw->page_height);
  }
  if (l) {
    free(l->data);
    tile_fetch_queue=g_list_remove_link(tile_fetch_queue,l);
    g_list_free(l);
  }
}
开发者ID:akemnade,项目名称:mumpot,代码行数:26,代码来源:mapdrawing.c


示例11: draw_brush

/* Draw a rectangle on the screen */
static void draw_brush( GtkWidget *widget,
                        gdouble    x,
                        gdouble    y)
{
	if( clear == 1 )
	{
   		a=breadth;b=height;p.x=0;p.y=0;
   		gtk_widget_queue_draw_area(widget,0,0,breadth,height);
 	}
 	else
 	{
 		p.x=x;a=rec1;b=rec2;
 		p.y=y;
  		gtk_widget_queue_draw_area(widget,x,y,rec1,rec2);
  	}
}
开发者ID:mdilip,项目名称:Programming-lab-assignment,代码行数:17,代码来源:pro_circle.c


示例12: inf_text_gtk_viewport_user_invalidate_user_area

static void
inf_text_gtk_viewport_user_invalidate_user_area(InfTextGtkViewportUser* user)
{
  InfTextGtkViewportPrivate* priv;
  GtkWidget* scrollbar;

  priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(user->viewport);

  if(priv->show_user_markers &&
     user->rectangle.width > 0 && user->rectangle.height > 0)
  {
    scrollbar = gtk_scrolled_window_get_vscrollbar(priv->scroll);

    /* During destruction of the widget it can happen that there is no
     * vertical scrollbar anymore, so check for it here. */
    if(scrollbar != NULL)
    {
      gtk_widget_queue_draw_area(
        scrollbar,
        user->rectangle.x,
        user->rectangle.y,
        user->rectangle.width,
        user->rectangle.height
      );
    }
  }
}
开发者ID:FluffyStuff,项目名称:libinfinity,代码行数:27,代码来源:inf-text-gtk-viewport.c


示例13: qtcTreeViewLeave

static gboolean
qtcTreeViewLeave(GtkWidget *widget, GdkEventMotion *event, void *data)
{
    QTC_UNUSED(event);
    QTC_UNUSED(data);
    if (GTK_IS_TREE_VIEW(widget)) {
        QtCTreeView *tv = qtcTreeViewLookupHash(widget, false);
        if (tv) {
            GtkTreeView *treeView = GTK_TREE_VIEW(widget);
            QtcRect rect = {0, 0, -1, -1 };
            QtcRect alloc = qtcWidgetGetAllocation(widget);

            if (tv->path && tv->column) {
                gtk_tree_view_get_background_area(
                    treeView, tv->path, tv->column, (GdkRectangle*)&rect);
            }
            if (tv->fullWidth) {
                rect.x = 0;
                rect.width = alloc.width;
            }
            if (tv->path) {
                gtk_tree_path_free(tv->path);
            }
            tv->path = NULL;
            tv->column = NULL;

            gtk_tree_view_convert_bin_window_to_widget_coords(
                treeView, rect.x, rect.y, &rect.x, &rect.y);
            gtk_widget_queue_draw_area(
                widget, rect.x, rect.y, rect.width, rect.height);
        }
    }
    return false;
}
开发者ID:Kermit,项目名称:qtcurve,代码行数:34,代码来源:treeview.c


示例14: init_rs_cb

static void init_rs_cb(GtkWidget *widget,
                       gpointer   data)
{
    InitializeGame();
    int x = 0;
    int y = 0;
    NodeType t;
    for (int i = 0; i <= 2; ++i) {
        t = (i == 1) ? Black : White;
        x = (BoardSize - 9) / 2 + rand() % 9;
        y = (BoardSize - 9) / 2 + rand() % 9;
        if (game.board[x][y] == Empty) {
            game.board[x][y] = t;
            DrawPiece(x, y, t);
        }
    }

    if (game.blackAI.id != 10) {
        Point p;
        p = game.blackAI.func(game.board, Black);
        game.Move(p);
        DrawPiece(p.x, p.y, Black);
    }
    GtkWidget* draw_area = (GtkWidget*) data;
    gtk_widget_queue_draw_area(draw_area, 0, 0, CanvasWidth, CanvasWidth);

}
开发者ID:RoomArchitect,项目名称:fir,代码行数:27,代码来源:gfir.c


示例15: rg_queue_draw_area

static VALUE
rg_queue_draw_area(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
{
    gtk_widget_queue_draw_area(_SELF(self), NUM2INT(x), NUM2INT(y),
                               NUM2INT(width), NUM2INT(height));
    return self;
}
开发者ID:adamhooper,项目名称:ruby-gnome2,代码行数:7,代码来源:rbgtkwidget.c


示例16: gui_theme_changed

static void gui_theme_changed(void)
{
	g_assert(legend_page != NULL);
	gtk_widget_queue_draw(legend_page);
	gtk_widget_queue_draw_area(gmap->area, 0, 0, gmap->width,
				   gmap->height);
}
开发者ID:Alex-Sjoberg,项目名称:Pioneers,代码行数:7,代码来源:gui.c


示例17: timer_anime

gboolean 
timer_anime ( gpointer user_data )
{

    static gboolean first_execution = TRUE;
	 GtkWidget  * widget = (GtkWidget * ) user_data;

    //use a safe function to get the value of currently_drawing so
    //we don't run into the usual multithreading issues
    int drawing_status = g_atomic_int_get(&currently_drawing);

    //if we are not currently drawing anything, launch a thread to 
    //update our pixmap
    if(drawing_status == 0){
        static pthread_t thread_info;
        int  iret;
        if(first_execution != TRUE){
            pthread_join(thread_info, NULL);
        }
        iret = pthread_create( &thread_info, NULL, do_draw, user_data);
    }

    //tell our window it is time to draw our animation.
    int width, height;
    gdk_drawable_get_size(pixmap, &width, &height);
    gtk_widget_queue_draw_area(widget, 0, 0, width, height);

    first_execution = FALSE;

    return TRUE;
}
开发者ID:Varhoo,项目名称:Fingerpaint,代码行数:31,代码来源:gui.cpp


示例18: on_motion_notify_event

static gboolean
on_motion_notify_event (GtkWidget *window, GdkEventMotion *ev, gpointer user_data)
{
	AbiTable* table = static_cast<AbiTable*>(user_data);
	gboolean changed = FALSE;
	guint selected_cols;
	guint selected_rows;

	if (ev->x < 0 || ev->y < 0)
		return TRUE;
	
	pixels_to_cells(static_cast<guint>(ev->x), static_cast<guint>(ev->y), &selected_cols, &selected_rows);

	if ((selected_cols != table->selected_cols) || (selected_rows != table->selected_rows))
	{
		/* grow or shrink the table widget as necessary */
		table->selected_cols = selected_cols;
		table->selected_rows = selected_rows;

		if (table->selected_rows <= 0 || table->selected_cols <= 0)
			table->selected_rows = table->selected_cols = 0;

		table->total_rows = my_max(table->selected_rows + 1, 3);
		table->total_cols = my_max(table->selected_cols + 1, 3);

		abi_table_resize(table);
		gtk_widget_queue_draw_area (window, 0, 0, 
					    window->allocation.width, window->allocation.height);

		changed = TRUE;
	}

	return TRUE;
}
开发者ID:Distrotech,项目名称:abiword,代码行数:34,代码来源:xap_UnixTableWidget.cpp


示例19: timer_exe

gboolean timer_exe(GtkWidget * window){
    static int first_time = 1;
    //use a safe function to get the value of currently_drawing so
    //we don't run into the usual multithreading issues
    int drawing_status = g_atomic_int_get(&currently_drawing);

    //if this is the first time, create the drawing thread
    static pthread_t thread_info;
    if(first_time == 1){
        int  iret;
        iret = pthread_create( &thread_info, NULL, do_draw, NULL);
    }

    //if we are not currently drawing anything, send a SIGALRM signal
    //to our thread and tell it to update our pixmap
    if(drawing_status == 0){
        pthread_kill(thread_info, SIGALRM);
    }

    //tell our window it is time to draw our animation.
    int width, height;
    gdk_drawable_get_size(pixmap, &width, &height);
    gtk_widget_queue_draw_area(window, 0, 0, width, height);


    first_time = 0;
    return TRUE;

}
开发者ID:AlexKordic,项目名称:sandbox,代码行数:29,代码来源:cairoanimatesignal.c


示例20: splash_update

void
splash_update (const gchar *text1,
               const gchar *text2,
               gdouble      percentage)
{
  GdkRectangle expose = { 0, 0, 0, 0 };

  g_return_if_fail (percentage >= 0.0 && percentage <= 1.0);

  if (! splash)
    return;

#ifdef STARTUP_TIMER
  splash_timer_elapsed (text1, text2, percentage);
#endif

  splash_position_layouts (splash, text1, text2, &expose);

  if (expose.width > 0 && expose.height > 0)
    gtk_widget_queue_draw_area (splash->area,
                                expose.x, expose.y,
                                expose.width, expose.height);

  gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (splash->progress),
                                 percentage);

  if (gtk_events_pending ())
    gtk_main_iteration ();
}
开发者ID:MichaelMure,项目名称:Gimp-Cage-Tool,代码行数:29,代码来源:splash.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ gtk_widget_queue_resize函数代码示例发布时间:2022-05-28
下一篇:
C++ gtk_widget_queue_draw函数代码示例发布时间: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