当前位置: 首页>>代码示例>>C++>>正文


C++ GDK_IS_WINDOW函数代码示例

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


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

示例1: row_expanded

/**
 * Callback after expanding a row
 * @param view A GtkTreeView
 * @param iter A GtkTreeIter
 * @param path A GtkTreePath
 * @param user_data A gpointer
 */
static void
row_expanded(GtkTreeView *view, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data)
{
	GtkTreeModel *model;
	GtkTreeIter empty;
	gchar *filepath;
	gchar *file;
	GDir *dir;
	GString *gs = NULL;

	/* Set busy cursor */	
	if (GDK_IS_WINDOW(GTK_WIDGET(view)->window))
	{
		GdkCursor* cursor = gdk_cursor_new(GDK_WATCH);
		gdk_window_set_cursor(gtk_widget_get_toplevel(GTK_WIDGET(view))->window, cursor);
		gdk_cursor_unref(cursor);
		gdk_flush();
	}

	model = gtk_tree_view_get_model(view);
	gtk_tree_model_iter_children(GTK_TREE_MODEL(model),
								 &empty, iter);
	gtk_tree_model_get(GTK_TREE_MODEL(model), iter,
					   COL_PATH, &filepath,
					   -1);

	dir = g_dir_open(filepath, 0, NULL);

	if (dir)
	{
		while ((file = (gchar *) g_dir_read_name(dir)))
		{
			gs = g_string_new(filepath);
			g_string_append(gs, file);
			g_string_append(gs, "/");
			if (g_file_test(gs->str, G_FILE_TEST_IS_DIR)) 
			{
				if (file[0] == '.') 
				{
					/* Fixme: If hidden files should be shown too */
				} 
				else
				{
					dir_selector_add_element(GTK_TREE_STORE(model), iter, file, gs->str);
				}
			}
			g_string_free(gs, TRUE);	
		}
		g_dir_close(dir);
		g_free(filepath);
	}
	if (GDK_IS_WINDOW(GTK_WIDGET(view)->window))
		gdk_window_set_cursor(gtk_widget_get_toplevel(GTK_WIDGET(view))->window, NULL);
	gtk_tree_store_remove(GTK_TREE_STORE(model), &empty);
}
开发者ID:bgromov,项目名称:rawstudio,代码行数:62,代码来源:rs-dir-selector.c

示例2: gdk_device_get_history

gboolean
gdk_device_get_history  (GdkDevice         *device,
			 GdkWindow         *window,
			 guint32            start,
			 guint32            stop,
			 GdkTimeCoord    ***events,
			 gint              *n_events)
{
  g_return_val_if_fail (window != NULL, FALSE);
  g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
  g_return_val_if_fail (events != NULL, FALSE);
  g_return_val_if_fail (n_events != NULL, FALSE);

  if (n_events)
    *n_events = 0;
  if (events)
    *events = NULL;

  if (GDK_WINDOW_DESTROYED (window))
    return FALSE;
    
  if (GDK_IS_CORE (device))
    return FALSE;
  else
    return _gdk_device_get_history (device, window, start, stop, events, n_events);
}
开发者ID:Aridna,项目名称:gtk2,代码行数:26,代码来源:gdkinput.c

示例3: gdk_gl_window_new

/**
 * gdk_gl_window_new:
 * @glconfig: a #GdkGLConfig.
 * @window: the #GdkWindow to be used as the rendering area.
 * @attrib_list: (array) (allow-none): this must be set to NULL or empty (first attribute of None).
 *
 * Creates an on-screen rendering area.
 * attrib_list is currently unused. This must be set to NULL or empty
 * (first attribute of None). See GLX 1.3 spec.
 *
 * Return value: the new #GdkGLWindow.
 **/
GdkGLWindow *
gdk_gl_window_new (GdkGLConfig *glconfig, GdkWindow *window, const int *attrib_list)
{
  GDK_GL_NOTE_FUNC ();

  g_return_val_if_fail (GDK_IS_GL_CONFIG (glconfig), NULL);
  g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);

  /*
   * Get X Window.
   */

  Window glxwindow = GDK_DRAWABLE_XID (GDK_DRAWABLE (window));

  /*
   * Instantiate the GdkGLWindowImplX11 object.
   */

  GdkGLWindow *glwindow = g_object_new (GDK_TYPE_GL_WINDOW, NULL);

  glwindow->drawable = GDK_DRAWABLE (window);
  g_object_add_weak_pointer (G_OBJECT (glwindow->drawable), (gpointer *) &(glwindow->drawable));

  glwindow->glxwindow = glxwindow;

  glwindow->glconfig = glconfig;
  g_object_ref (G_OBJECT (glwindow->glconfig));

  glwindow->is_destroyed = FALSE;

  return glwindow;
}
开发者ID:ayyi,项目名称:libwaveform,代码行数:44,代码来源:gdkglwindow.c

示例4: clip_GDK_DRAGMOTION

int
clip_GDK_DRAGMOTION(ClipMachine * cm)
{
        C_object             *ccontext = _fetch_co_arg(cm);
        C_object             *cgdk_win = _fetch_cobject(cm, _clip_spar(cm, 2));
        GdkDragProtocol       protocol = _clip_parni(cm, 3);
        gint                    x_root = _clip_parni(cm, 4);
        gint                    y_root = _clip_parni(cm, 5);
        GdkDragAction suggested_action = _clip_parni(cm, 6);
        GdkDragAction possible_actions = _clip_parni(cm, 7);
        guint32                   time = _clip_parni(cm, 8);

	if (!ccontext || ccontext->type != GDK_TYPE_DRAG_CONTEXT)
        	goto err;
	CHECKCOBJ(cgdk_win, GDK_IS_WINDOW(cgdk_win->object));
	CHECKARG(3, NUMERIC_t); CHECKARG(4, NUMERIC_t);
	CHECKARG(5, NUMERIC_t); CHECKARG(6, NUMERIC_t);
	CHECKARG(7, NUMERIC_t); CHECKARG(8, NUMERIC_t);

        gdk_drag_motion((GdkDragContext*)ccontext->object,
        	GDK_WINDOW(cgdk_win->object),
        	protocol,
        	x_root, y_root,
        	suggested_action,
                possible_actions,
                time);

	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:31,代码来源:draganddrop.c

示例5: gsb_status_wait

/**
 * Change current cursor to a animated watch (if animation supported
 * by environment).
 *
 * \param force_update		Call a gtk iteration to ensure cursor
 *				is updated.  May cause trouble if
 *				called from some signal handlers.
 */
void gsb_status_wait ( gboolean force_update )
{
    GdkWindow * current_window;

    gdk_window_set_cursor ( run.window -> window,
			    gdk_cursor_new_for_display ( gdk_display_get_default ( ),
							 GDK_WATCH ) );

    current_window = gdk_display_get_window_at_pointer ( gdk_display_get_default ( ),
							 NULL, NULL );

    if ( current_window && GDK_IS_WINDOW ( current_window )
     &&
	 current_window != run.window -> window )
    {
	GdkWindow * parent = gdk_window_get_toplevel ( current_window );

	if ( parent && parent != current_window )
	{
	    current_window = parent;
	}

	gdk_window_set_cursor ( current_window,
				gdk_cursor_new_for_display ( gdk_display_get_default ( ),
							     GDK_WATCH ) );

	tracked_window = current_window;
    }

    if ( force_update )
	update_gui ( );
}
开发者ID:wazari972,项目名称:Grisbi,代码行数:40,代码来源:gsb_status.c

示例6: setFrameGeometry

void FrameGdk::setFrameGeometry(const IntRect &r)
{
    if (!m_drawable || !GDK_IS_WINDOW(m_drawable))
        return;
    GdkWindow* window = GDK_WINDOW(m_drawable);
    gdk_window_move_resize(window, r.x(), r.y(), r.width(), r.height());
}
开发者ID:oroisec,项目名称:ios,代码行数:7,代码来源:FrameGdk.cpp

示例7: gdk_selection_property_get

gint
gdk_selection_property_get(GdkWindow * requestor,
                           guchar ** data,
                           GdkAtom * ret_type, gint * ret_format)
{
   GdkSelProp *prop;

   g_return_val_if_fail(requestor != NULL, 0);
   g_return_val_if_fail(GDK_IS_WINDOW(requestor), 0);

   if (GDK_DRAWABLE_DESTROYED(requestor))
      return 0;

   GDK_NOTE(DND, g_print("gdk_selection_property_get: %#x",
                         GDK_DRAWABLE_XID(requestor)));

   prop =
       g_hash_table_lookup(sel_prop_table, &GDK_DRAWABLE_XID(requestor));

   if (prop == NULL) {
      GDK_NOTE(DND, g_print(": NULL\n"));
      *data = NULL;
      return 0;
   }
   GDK_NOTE(DND, g_print(": %d bytes\n", prop->length));
   *data = g_malloc(prop->length);
   if (prop->length > 0)
      memmove(*data, prop->data, prop->length);
   if (ret_type)
      *ret_type = prop->type;
   if (ret_format)
      *ret_format = prop->format;

   return prop->length;
}
开发者ID:My-Source,项目名称:root,代码行数:35,代码来源:gdkselection-win32.c

示例8: gdk_window_get_gl_window

/**
 * gdk_window_get_gl_window:
 * @window: a #GdkWindow.
 *
 * Returns the #GdkGLWindow held by the @window.
 *
 * Return value: the #GdkGLWindow.
 **/
GdkGLWindow *
gdk_window_get_gl_window (GdkWindow *window)
{
  g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);

  return g_object_get_qdata (G_OBJECT (window), quark_gl_window);
}
开发者ID:alexmurray,项目名称:gtkglext,代码行数:15,代码来源:gdkglwindow.c

示例9: gdk_window_is_gl_capable

/**
 * gdk_window_is_gl_capable:
 * @window: a #GdkWindow.
 *
 * Returns whether the @window is OpenGL-capable.
 *
 * Return value: TRUE if the @window is OpenGL-capable, FALSE otherwise.
 **/
gboolean
gdk_window_is_gl_capable (GdkWindow *window)
{
  g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);

  return g_object_get_qdata (G_OBJECT (window), quark_gl_window) != NULL ? TRUE : FALSE;
}
开发者ID:alexmurray,项目名称:gtkglext,代码行数:15,代码来源:gdkglwindow.c

示例10: gdk_directfb_keyboard_grab

GdkGrabStatus
gdk_directfb_keyboard_grab (GdkDisplay *display,
                            GdkWindow  *window,
                            gint        owner_events,
                            guint32     time)
{
  GdkWindow             *toplevel;
  GdkWindowImplDirectFB *impl;

  g_return_val_if_fail (GDK_IS_WINDOW (window), 0);

  if (_gdk_directfb_keyboard_grab_window)
    gdk_keyboard_ungrab (time);

  toplevel = gdk_directfb_window_find_toplevel (window);
  impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (toplevel)->impl);

  if (impl->window)
    {
      if (impl->window->GrabKeyboard (impl->window) == DFB_LOCKED)
        return GDK_GRAB_ALREADY_GRABBED;
    }

  _gdk_directfb_keyboard_grab_window = g_object_ref (window);
  _gdk_directfb_keyboard_grab_owner_events = owner_events;
  return GDK_GRAB_SUCCESS;
}
开发者ID:Aridna,项目名称:gtk2,代码行数:27,代码来源:gdkdisplay-directfb.c

示例11: gtk_im_context_set_client_window

void gtk_im_context_set_client_window (GtkIMContext *context,
          GdkWindow    *window)
{
    GtkIMContextClass *klass;
    g_return_if_fail (GTK_IS_IM_CONTEXT (context));
    klass = GTK_IM_CONTEXT_GET_CLASS (context);
    if (klass->set_client_window)
        klass->set_client_window (context, window);

    //below is our interposed codes to save the context to local_context.
    if(!GDK_IS_WINDOW (window))
        return;
    g_object_set_data(G_OBJECT(context),"window",window);
    int width = gdk_window_get_width(window);
    int height = gdk_window_get_height(window);
    if(width != 0 && height !=0) {
        gtk_im_context_focus_in(context);
        local_context = context;
    }
    //only add this event_filter when using 'fcitx' immodule.
    //for xim immodule, this function is as same as original from gtk2.
    const gchar * immodule = g_getenv("GTK_IM_MODULE");
    if(immodule && !strcmp(immodule, "fcitx")) {
        gdk_window_add_filter (window, event_filter, context);
    }
}
开发者ID:dyarlagadda948,项目名称:BGFREPO,代码行数:26,代码来源:sublime_text_3_imfix.c

示例12: gtk_drag_dest_set_proxy

/**
 * gtk_drag_dest_set_proxy: (method)
 * @widget: a #GtkWidget
 * @proxy_window: the window to which to forward drag events
 * @protocol: the drag protocol which the @proxy_window accepts
 *   (You can use gdk_drag_get_protocol() to determine this)
 * @use_coordinates: If %TRUE, send the same coordinates to the
 *   destination, because it is an embedded
 *   subwindow.
 *
 * Sets this widget as a proxy for drops to another window.
 *
 * Deprecated: 3.22
 */
void
gtk_drag_dest_set_proxy (GtkWidget       *widget,
                         GdkWindow       *proxy_window,
                         GdkDragProtocol  protocol,
                         gboolean         use_coordinates)
{
  GtkDragDestSite *site;

  g_return_if_fail (GTK_IS_WIDGET (widget));
  g_return_if_fail (!proxy_window || GDK_IS_WINDOW (proxy_window));

  site = g_slice_new (GtkDragDestSite);

  site->flags = 0;
  site->have_drag = FALSE;
  site->target_list = NULL;
  site->actions = 0;
  site->proxy_window = proxy_window;
  if (proxy_window)
    g_object_ref (proxy_window);
  site->do_proxy = TRUE;
  site->proxy_protocol = protocol;
  site->proxy_coords = use_coordinates;
  site->track_motion = FALSE;

  gtk_drag_dest_set_internal (widget, site);
}
开发者ID:endlessm,项目名称:gtk,代码行数:41,代码来源:gtkdragdest.c

示例13: _gtk_xembed_send_focus_message

/**
 * _gtk_xembed_send_focus_message:
 * @recipient: (allow-none): window to which to send the window, or %NULL
 *             in which case nothing will be sent
 * @message_type:   type of message
 * @detail:    detail field of message
 * 
 * Sends a XEMBED message for moving the focus along the focus
 * chain to a window. The flags field that these messages share
 * will be correctly filled in.
 **/
void
_gtk_xembed_send_focus_message (GdkWindow        *recipient,
				XEmbedMessageType message_type,
				glong             detail)
{
  gulong flags = 0;

  if (!recipient)
    return;

  g_return_if_fail (GDK_IS_WINDOW (recipient));
  g_return_if_fail (message_type == XEMBED_FOCUS_IN ||
                    message_type == XEMBED_FOCUS_NEXT ||
                    message_type == XEMBED_FOCUS_PREV);

  if (current_messages)
    {
      GtkXEmbedMessage *message = current_messages->data;
      switch (message->message)
	{
	case XEMBED_FOCUS_IN:
	case XEMBED_FOCUS_NEXT:
	case XEMBED_FOCUS_PREV:
	  flags = message->data1 & XEMBED_FOCUS_WRAPAROUND;
	  break;
	default:
	  break;
	}
    }

  _gtk_xembed_send_message (recipient, message_type, detail, flags, 0);
}
开发者ID:endlessm,项目名称:gtk,代码行数:43,代码来源:gtkxembed.c

示例14: clip_GDK_DRAGFINDWINDOW

int
clip_GDK_DRAGFINDWINDOW(ClipMachine * cm)
{
        C_object *ccontext = _fetch_co_arg(cm);
        C_object *cgdk_win = _fetch_cobject(cm, _clip_spar(cm, 2));
        gint        x_root = _clip_parni(cm, 3);
        gint        y_root = _clip_parni(cm, 4);
        ClipVar        *cv = _clip_spar(cm, 5);
        GdkWindow     *win ;
        C_object     *cwin ;
        GdkDragProtocol protocol ;

	if (!ccontext || ccontext->type != GDK_TYPE_DRAG_CONTEXT)
        	goto err;
	CHECKCOBJ(cgdk_win, GDK_IS_WINDOW(cgdk_win->object));
	CHECKARG(3, NUMERIC_t);
	CHECKARG(4, NUMERIC_t);

        gdk_drag_find_window((GdkDragContext*)ccontext->object,
        	GDK_WINDOW(cgdk_win->object),
        	x_root, y_root,
        	&win, &protocol);

	if (win)
        {
        	cwin = _list_get_cobject(cm, win);
        	if (!cwin) cwin = _register_object(cm, win, GDK_TYPE_WINDOW, NULL, NULL);
                if (cwin) _clip_mclone(cm, cv, &cwin->obj);
                _clip_storni(cm, protocol, 6, 0);
        }
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:34,代码来源:draganddrop.c

示例15: _gdk_win32_window_tmp_unset_bg

void
_gdk_win32_window_tmp_unset_bg (GdkWindow *window,
				gboolean recurse)
{
  g_return_if_fail (GDK_IS_WINDOW (window));

  if (window->input_only || window->destroyed ||
      (window->window_type != GDK_WINDOW_ROOT &&
       !GDK_WINDOW_IS_MAPPED (window)))
    return;

  if (_gdk_window_has_impl (window) &&
      GDK_WINDOW_IS_WIN32 (window) &&
      window->window_type != GDK_WINDOW_ROOT &&
      window->window_type != GDK_WINDOW_FOREIGN)
    tmp_unset_bg (window);

  if (recurse)
    {
      GList *l;

      for (l = window->children; l != NULL; l = l->next)
	_gdk_win32_window_tmp_unset_bg (l->data, TRUE);
    }
}
开发者ID:3v1n0,项目名称:gtk,代码行数:25,代码来源:gdkgeometry-win32.c


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