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

C++ GDK_THREADS_ENTER函数代码示例

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

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



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

示例1: close_fftscope_window

static gboolean
close_fftscope_window(GtkWidget * widget, GdkEvent * event, gpointer data)
{
	GDK_THREADS_LEAVE();
	stop_fftscope();
	GDK_THREADS_ENTER();

	return TRUE;
}
开发者ID:RafaelRMachado,项目名称:alsaplayer,代码行数:9,代码来源:fftscope.c


示例2: nsp_app_feeds_search

static void 
nsp_app_feeds_search(void* user_data)
{
	NspApp *app = nsp_app_get();
	NspFeed *feed = nsp_feed_new();
	GtkTreeIter iter;
	GRegex *regex;
	char *new_feed_title = "Search results";
	char *search_exp;
	char *tmp;
	
	feed->title = malloc(sizeof(char)*(strlen(new_feed_title) + 1));
	memcpy(feed->title, new_feed_title, sizeof(char)*(strlen(new_feed_title)+1));
	
	/* Build search term and load results */
	regex = g_regex_new ("(%|_)", 0, 0, NULL);
	tmp = g_regex_replace(regex, (char*)user_data, -1, 0, "\\\\\\0", 0, NULL);
	g_regex_unref(regex);
	
	regex = g_regex_new ("[ \t]+", 0, 0, NULL);
	search_exp = g_regex_replace(regex, tmp, -1, 0, "%", 0, NULL);
	g_regex_unref(regex);
	g_free(tmp);
	
	feed->items = nsp_feed_items_search(search_exp);
	
	/* Update front-end */
	GDK_THREADS_ENTER();
	nsp_feed_update_model(feed);
	gtk_tree_view_set_model(GTK_TREE_VIEW(app->window->feed_item_list), nsp_feed_get_items_model(feed));
	GDK_THREADS_LEAVE();
	
	
	GDK_THREADS_ENTER();
	iter = nsp_feed_list_add(app->window->feed_list, feed, true);
	gtk_tree_store_set (GTK_TREE_STORE(app->window->feed_list->list_model), &iter,
					LIST_COL_ICON, app->window->feed_list->icon_search,
					-1);
	
	app->feeds = g_list_append(app->feeds, feed);
	
	gtk_tree_view_set_cursor(GTK_TREE_VIEW(app->window->feed_list->list_view), gtk_tree_model_get_path(app->window->feed_list->list_model, &iter), NULL, FALSE);
	GDK_THREADS_LEAVE();
}
开发者ID:Michael-Z,项目名称:Nowspide,代码行数:44,代码来源:nsp-app.c


示例3: on_stop_search

static void on_stop_search( GtkWidget* btn, FindFile* data )
{
    if( data->task && ! vfs_async_task_is_finished( data->task ) )
    {
        // see note in vfs-async-task.c: vfs_async_task_real_cancel()
        GDK_THREADS_LEAVE(); 
        vfs_async_task_cancel( data->task );
        GDK_THREADS_ENTER();
    }
}
开发者ID:alfbar0,项目名称:spacefm,代码行数:10,代码来源:find-files.c


示例4: brasero_gio_operation_wait_for_operation_end

static gboolean
brasero_gio_operation_wait_for_operation_end (BraseroGioOperation *operation,
					      GError **error)
{
	BRASERO_MEDIA_LOG ("Waiting for end of async operation");

	g_object_ref (operation->cancel);
	g_cancellable_reset (operation->cancel);
	g_signal_connect (operation->cancel,
			  "cancelled",
			  G_CALLBACK (brasero_gio_operation_cancelled),
			  operation);

	/* put a timeout (30 sec) */
	operation->timeout_id = g_timeout_add_seconds (20,
						       brasero_gio_operation_timeout,
						       operation);

	operation->loop = g_main_loop_new (NULL, FALSE);

	GDK_THREADS_LEAVE ();
	g_main_loop_run (operation->loop);
	GDK_THREADS_ENTER ();

	g_main_loop_unref (operation->loop);
	operation->loop = NULL;

	if (operation->timeout_id) {
		g_source_remove (operation->timeout_id);
		operation->timeout_id = 0;
	}

	if (operation->error) {
		BRASERO_MEDIA_LOG ("Medium operation finished with an error %s",
				   operation->error->message);

		if (operation->error->code == G_IO_ERROR_FAILED_HANDLED) {
			BRASERO_MEDIA_LOG ("Error already handled and displayed by GIO");

			/* means we shouldn't display any error message since 
			 * that was already done */
			g_error_free (operation->error);
			operation->error = NULL;
		}
		else if (error && (*error) == NULL)
			g_propagate_error (error, operation->error);
		else
			g_error_free (operation->error);

		operation->error = NULL;
	}

	g_object_unref (operation->cancel);
	return operation->result;
}
开发者ID:Fedosiy,项目名称:brasero,代码行数:55,代码来源:brasero-gio-operation.c


示例5: process_found_files

static void process_found_files( FindFile* data, GQueue* queue, const char* path )
{
    char *name;
    gsize len, term;
    GtkTreeIter it;
    VFSFileInfo* fi;
    GdkPixbuf* icon;
    FoundFile* ff;

    if( path )
    {
        name = g_filename_display_basename( path );
        fi = vfs_file_info_new();
        if( vfs_file_info_get( fi, path, name ) )
        {
            ff = g_slice_new0( FoundFile );
            ff->fi = fi;
            ff->dir_path = g_path_get_dirname( path );
            g_queue_push_tail( queue, ff );
        }
        else
        {
            vfs_file_info_unref( fi );
        }
        g_free( name );

        /* we queue the found files, and not add them to the tree view direclty.
         * when we queued more than 10 files, we add them at once. I think
         * this can prevent locking gtk+ too frequently and improve responsiveness.
         * FIXME: This could blocked the last queued files and delay their display
         * to the end of the whole search. A better method is needed.
         */
//MOD disabled this - causes last queued files to not display
//        if( g_queue_get_length( queue ) < 10 )
//            return;
    }

    while( ff = (FoundFile*)g_queue_pop_head(queue) )
    {
        GDK_THREADS_ENTER();
        gtk_list_store_append( data->result_list, &it );
        icon = vfs_file_info_get_small_icon( ff->fi );
        gtk_list_store_set( data->result_list, &it,
                                    COL_ICON, icon,
                                    COL_NAME, vfs_file_info_get_disp_name(ff->fi),
                                    COL_DIR, ff->dir_path, /* FIXME: non-UTF8? */
                                    COL_TYPE, vfs_file_info_get_mime_type_desc( ff->fi ),
                                    COL_SIZE, vfs_file_info_get_disp_size( ff->fi ),
                                    COL_MTIME, vfs_file_info_get_disp_mtime( ff->fi ),
                                    COL_INFO, ff->fi, -1 );
        g_object_unref( icon );
        GDK_THREADS_LEAVE();
        g_slice_free( FoundFile, ff );
    }
}
开发者ID:alfbar0,项目名称:spacefm,代码行数:55,代码来源:find-files.c


示例6: nsp_app_feed_add

static void
nsp_app_feed_add (void* user_data)
{
	NspApp *app = nsp_app_get();
	char *url = g_strdup((const char*) user_data);
	NspFeed *feed;
	GtkTreeIter iter;
	char *new_feed_title = "New Subscription";
	
	/* Create the new feed, populate it and add it to the list */
	feed = nsp_feed_new();
	feed->url = url;
	feed->title = malloc(sizeof(char)*(strlen(new_feed_title) + 1));
	memcpy(feed->title, new_feed_title, sizeof(char)*(strlen(new_feed_title)+1));
	
	GDK_THREADS_ENTER();
	iter = nsp_feed_list_add(app->window->feed_list, feed, false);
	gtk_tree_store_set (GTK_TREE_STORE(app->window->feed_list->list_model), &iter,
					LIST_COL_ICON, app->window->feed_list->icon_load,
					-1);
	GDK_THREADS_LEAVE();
	
	/* Fetch and save the items */
	if ( nsp_feed_update_items(feed) || nsp_feed_save_to_db(feed) ) {
		nsp_feed_list_remove(app->window->feed_list, feed);
		nsp_feed_free(feed);
		return;
	}
	
	app->feeds = g_list_append(app->feeds, feed);
	GDK_THREADS_ENTER();
	nsp_feed_update_model(feed);
	nsp_feed_update_unread_count(feed);
	nsp_feed_list_update_entry(app->window->feed_list, feed);
	GDK_THREADS_LEAVE();
	
	if ( !nsp_feed_update_icon(feed) ) {
		GDK_THREADS_ENTER();
		nsp_feed_list_update_entry(app->window->feed_list, feed);
		GDK_THREADS_LEAVE();
	}
}
开发者ID:Michael-Z,项目名称:Nowspide,代码行数:42,代码来源:nsp-app.c


示例7: scroll_row_timeout

/* Scroll function taken/adapted from gtktreeview.c */
static gint
scroll_row_timeout (gpointer data)
{
	GtkTreeView *tree_view = data;
	GdkRectangle visible_rect;
	gint y, x;
	gint offset;
	gfloat value;
	GtkAdjustment* vadj;
	RbTreeDndData *priv_data;

	GDK_THREADS_ENTER ();

	priv_data = g_object_get_data (G_OBJECT (tree_view), RB_TREE_DND_STRING);
	g_return_val_if_fail(priv_data != NULL, TRUE);

	gdk_window_get_pointer (gtk_tree_view_get_bin_window (tree_view), &x, &y, NULL);
	gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, &x, &y);
	gtk_tree_view_convert_bin_window_to_tree_coords (tree_view, x, y, &x, &y);

	gtk_tree_view_get_visible_rect (tree_view, &visible_rect);

	/* see if we are near the edge. */
	if (x < visible_rect.x && x > visible_rect.x + visible_rect.width)
	{
		GDK_THREADS_LEAVE ();
		priv_data->scroll_timeout = 0;
		return FALSE;
	}

	offset = y - (visible_rect.y + 2 * SCROLL_EDGE_SIZE);
	if (offset > 0)
	{
		offset = y - (visible_rect.y + visible_rect.height - 2 * SCROLL_EDGE_SIZE);
		if (offset < 0) 
		{
			GDK_THREADS_LEAVE ();
			priv_data->scroll_timeout = 0;
			return FALSE;
		}
	}

	vadj = gtk_tree_view_get_vadjustment (tree_view);
	value = CLAMP (vadj->value + offset, vadj->lower, vadj->upper - vadj->page_size);
	gtk_adjustment_set_value (vadj, value);

	/* don't remove it if we're on the edge and not scrolling */
	if (ABS (vadj->value - value) > 0.0001)
		remove_select_on_drag_timeout(tree_view);

	GDK_THREADS_LEAVE ();

	return TRUE;
}
开发者ID:paulbellamy,项目名称:Rhythmbox-iPod-Plugin,代码行数:55,代码来源:rb-tree-dnd.c


示例8: gtk_combo_focus_idle

static gint
gtk_combo_focus_idle (GtkCombo * combo)
{
  if (combo)
    {
      GDK_THREADS_ENTER ();
      gtk_widget_grab_focus (combo->entry);
      GDK_THREADS_LEAVE ();
    }
  return FALSE;
}
开发者ID:Onjrew,项目名称:OpenEV,代码行数:11,代码来源:gtkcombo.c


示例9: button_activate_timeout

static gboolean
button_activate_timeout (gpointer data)
{
  GDK_THREADS_ENTER ();
  
  gtk_button_finish_activate (data, TRUE);

  GDK_THREADS_LEAVE ();

  return FALSE;
}
开发者ID:zjx632,项目名称:tinygtk,代码行数:11,代码来源:gtkbutton.c


示例10: interface_gtk_stop

int interface_gtk_stop()
{
	global_update = -1;

	GDK_THREADS_ENTER();

	gdk_flush();
	gtk_exit(0); // This is *NOT* clean :-(
	GDK_THREADS_LEAVE();
	return 1;
}
开发者ID:RafaelRMachado,项目名称:alsaplayer,代码行数:11,代码来源:gtk.cpp


示例11: ensure_dlg

static void ensure_dlg(FmProgressDisplay* data)
{
    if(data->delay_timeout)
    {
        g_source_remove(data->delay_timeout);
        data->delay_timeout = 0;
    }
    GDK_THREADS_ENTER();
    if(!data->dlg)
        _on_show_dlg(data);
    GDK_THREADS_LEAVE();
}
开发者ID:lxde,项目名称:libfm,代码行数:12,代码来源:fm-progress-dlg.c


示例12: xt_event_prepare

static gboolean
xt_event_prepare (GSource*  source_data,
                   gint     *timeout)
{   
  int mask;

  GDK_THREADS_ENTER();
  mask = XPending(xtdisplay);
  GDK_THREADS_LEAVE();

  return (gboolean)mask;
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:12,代码来源:gtk2xtbin.c


示例13: populate_files

gboolean populate_files (gpointer data)     //TODO:: show an spinner while loading
{
  FilebrowserBackend *filebackend= FILEBROWSER_BACKEND(data);
  FilebrowserBackendDetails *directory = FILEBROWSER_BACKEND_GET_PRIVATE(filebackend);
  GDK_THREADS_ENTER();
  if (g_cancellable_is_cancelled (directory->cancellable)){
  GDK_THREADS_LEAVE();
  return FALSE; /* remove source */
  }
  GError *error=NULL;
  GFileInfo *info = g_file_enumerator_next_file (directory->enumerator, directory->cancellable, &error);
  if (info){
	  const gchar *mime= g_file_info_get_content_type (info);
	  if (!g_file_info_get_is_hidden (info)  && !g_file_info_get_is_backup (info)){
	    if (MIME_ISDIR(mime)){
		//if has dot in name pos 0 don't process
		const gchar *folder=g_file_info_get_display_name(info);
		if(folder[0]!='.'){
		  FOLDERFILE *current;
		  current=new_folderfile();
		  current->mime=g_strdup(mime);
      GIcon *icon =g_file_info_get_icon(info); 
      current->icon= g_icon_to_string (icon);
		  current->display_name=g_strdup(folder);
		  /* add to list */
		 directory->filesinfolder = g_slist_append(directory->filesinfolder, current);
		  }
	  } else {
	    if (IS_TEXT(mime) && !IS_APPLICATION(mime)){
	      //files
	      FOLDERFILE *current;
	      current=new_folderfile();
	      current->mime=g_strdup(mime);
	      GIcon *icon =g_file_info_get_icon(info); 
	      current->icon= g_icon_to_string (icon);
	      current->display_name=g_strdup(g_file_info_get_display_name(info));
	      /* add to list */
	      directory->filesinfolder = g_slist_append(directory->filesinfolder, current);
	      }
	    }
	  }	
	g_object_unref(info);
   } else {
   	if (error){
   		g_print(_("Error::%s"),error->message);
   		g_error_free (error);
   	}
	GDK_THREADS_LEAVE();
	return FALSE; /* remove source */
   }
    GDK_THREADS_LEAVE();
    return TRUE;
}
开发者ID:anoopjohn,项目名称:gphpedit,代码行数:53,代码来源:filebrowser_backend.c


示例14: remove_message_timeout

static gint
remove_message_timeout (MessageInfo * mi)
{
  GDK_THREADS_ENTER ();

  mate_appbar_refresh(MATE_APPBAR(mi->app->statusbar));
  g_signal_handler_disconnect(mi->app, mi->handlerid);
  g_free ( mi );

  GDK_THREADS_LEAVE ();

  return FALSE; /* removes the timeout */
}
开发者ID:fatman2021,项目名称:libmateui,代码行数:13,代码来源:mate-app-util.c


示例15: animation_timeout

static gboolean
animation_timeout (gpointer data)
{
    gboolean retval;

    GDK_THREADS_ENTER ();

    retval = do_animation (data);

    GDK_THREADS_LEAVE ();

    return retval;
}
开发者ID:ammonkey,项目名称:marlin,代码行数:13,代码来源:gossip-cell-renderer-expander.c


示例16: progress_timeout_cb

/* Works for statusbar and dialog both. */
static gint progress_timeout_cb (ProgressKeyReal * key)
{
  gdouble percent;

  GDK_THREADS_ENTER ();

  percent = (* key->percentage_cb)(key->data);
  mate_app_set_progress (key, percent);

  GDK_THREADS_LEAVE ();

  return TRUE;
}
开发者ID:fatman2021,项目名称:libmateui,代码行数:14,代码来源:mate-app-util.c


示例17: gimp_dialog_run

/**
 * gimp_dialog_run:
 * @dialog: a #GimpDialog
 *
 * This function does exactly the same as gtk_dialog_run() except it
 * does not make the dialog modal while the #GMainLoop is running.
 *
 * Return value: response ID
 **/
gint
gimp_dialog_run (GimpDialog *dialog)
{
  RunInfo ri = { NULL, GTK_RESPONSE_NONE, NULL };
  gulong  response_handler;
  gulong  unmap_handler;
  gulong  destroy_handler;
  gulong  delete_handler;

  g_return_val_if_fail (GIMP_IS_DIALOG (dialog), -1);

  g_object_ref (dialog);

  gtk_window_present (GTK_WINDOW (dialog));

  response_handler = g_signal_connect (dialog, "response",
                                       G_CALLBACK (run_response_handler),
                                       &ri);
  unmap_handler    = g_signal_connect (dialog, "unmap",
                                       G_CALLBACK (run_unmap_handler),
                                       &ri);
  delete_handler   = g_signal_connect (dialog, "delete-event",
                                       G_CALLBACK (run_delete_handler),
                                       &ri);
  destroy_handler  = g_signal_connect (dialog, "destroy",
                                       G_CALLBACK (run_destroy_handler),
                                       &ri);

  ri.loop = g_main_loop_new (NULL, FALSE);

  GDK_THREADS_LEAVE ();
  g_main_loop_run (ri.loop);
  GDK_THREADS_ENTER ();

  g_main_loop_unref (ri.loop);

  ri.loop      = NULL;
  ri.destroyed = FALSE;

  if (!ri.destroyed)
    {
      g_signal_handler_disconnect (dialog, response_handler);
      g_signal_handler_disconnect (dialog, unmap_handler);
      g_signal_handler_disconnect (dialog, delete_handler);
      g_signal_handler_disconnect (dialog, destroy_handler);
    }

  g_object_unref (dialog);

  return ri.response_id;
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:60,代码来源:gimpdialog.c


示例18: update_visibility_idle

static gboolean
update_visibility_idle (RBSource *source)
{
	gint count;

	GDK_THREADS_ENTER ();

	count = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (source->priv->query_model), NULL);
	g_object_set (source, "visibility", (count > 0), NULL);

	source->priv->update_visibility_id = 0;
	GDK_THREADS_LEAVE ();
	return FALSE;
}
开发者ID:bilboed,项目名称:rhythmbox,代码行数:14,代码来源:rb-source.c


示例19: the_fftscope

/* The actual FFTscope renderer function. */
static void the_fftscope()
{
	guint8 *loc;
	guint8 bits[256 * 129];
	int i, h;

	running = 1;

	while (running) {
		int w;
		guint val;

		memset(bits, 128, 256 * SCOPE_HEIGHT);

		for (i = 0; i < 256; i++) {
			val = (act_fft[i] + act_fft[i + 256]) / (64 * (128 / SCOPE_HEIGHT));
			if (val > (SCOPE_HEIGHT-1)) {
				val = (SCOPE_HEIGHT-1);
			}
			loc = bits + i + 256 * (SCOPE_HEIGHT-1);
			for (h = val; h > 0; h--) {
				*loc = h;
				loc -= 256;
			}
		}
		GDK_THREADS_ENTER();
		gdk_draw_indexed_image(area->window, area->style->white_gc,
				       0, 0, 256, SCOPE_HEIGHT, GDK_RGB_DITHER_NONE,
				       bits, 256, color_map);
		gdk_flush();
		GDK_THREADS_LEAVE();
		dosleep(SCOPE_SLEEP);
	}
	GDK_THREADS_ENTER();
	fftscope_hide();
	GDK_THREADS_LEAVE();
}
开发者ID:RafaelRMachado,项目名称:alsaplayer,代码行数:38,代码来源:fftscope.c


示例20: thunar_text_renderer_entry_menu_popdown_timer

static gboolean
thunar_text_renderer_entry_menu_popdown_timer (gpointer user_data)
{
  ThunarTextRenderer *text_renderer = THUNAR_TEXT_RENDERER (user_data);

  GDK_THREADS_ENTER ();

  /* check if we still have the keyboard focus */
  if (G_UNLIKELY (!GTK_WIDGET_HAS_FOCUS (text_renderer->entry)))
    thunar_text_renderer_editing_done (GTK_CELL_EDITABLE (text_renderer->entry), text_renderer);

  GDK_THREADS_LEAVE ();

  return FALSE;
}
开发者ID:EchelonTeam,项目名称:sca3_main,代码行数:15,代码来源:thunar-text-renderer.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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