Ejemplo n.º 1
0
static gint handler_scroll_child_signal (GtkScrolledWindow *swin, GtkScrollType type, gboolean arg2, C_signal *cs)
{
    PREPARECV(cs,cv);
    _clip_mputn(cs->cw->cmachine, &cv, HASH_SCROLLTYPE, type);
    _clip_mputl(cs->cw->cmachine, &cv, HASH_ARG2, arg2);
    INVOKESIGHANDLER(GTK_WIDGET(swin),cs,cv);
}
Ejemplo n.º 2
0
static int
cycle_handle_focus_signal_handler(GtkPaned *paned, gboolean arg1, C_signal *cs)
{
	PREPARECV(cs,cv);
	_clip_mputl(cs->cw->cmachine, &cv, HASH_ARG1, arg1);
	INVOKESIGHANDLER(GTK_WIDGET(paned), cs,cv);
}
Ejemplo n.º 3
0
/* Signal handlers */
static gint handle_extend_selection_signal (GtkWidget *widget, GtkScrollType scroll_type, gfloat position, gboolean auto_start_selection, C_signal *cs)
{
	PREPARECV(cs,cv);
  	_clip_mputn(cs->cw->cmachine, &cv, HASH_SCROLLTYPE, scroll_type);
  	_clip_mputn(cs->cw->cmachine, &cv, HASH_POSITION, position);
  	_clip_mputl(cs->cw->cmachine, &cv, HASH_AUTOSTARTSELECTION, auto_start_selection);
        INVOKESIGHANDLER(widget,cs,cv);
}
Ejemplo n.º 4
0
/* Get information corresponding to a node. Any of the return parameters can be null. */
int
clip_GTK_CTREENODEGETNODEINFO(ClipMachine * cm)
{
	C_widget   *cctree = _fetch_cw_arg(cm);
	C_object    *cnode = _fetch_cobject(cm,_clip_spar(cm,2));
	ClipVar    *minfo = RETPTR(cm);
	guint8     spacing;
	C_widget  *cclosed;
	C_widget  *copened;
	gboolean   is_leaf;
	gboolean  expanded;
	GdkPixmap *pxm_closed=NULL, *pxm_opened=NULL;
	GdkBitmap *mask_closed=NULL, *mask_opened=NULL;
	long i;
	gchar * * text;
	long ncolumns;

	CHECKCWID(cctree,GTK_IS_CTREE);
	CHECKOPT2(2,MAP_t,NUMERIC_t); CHECKCOBJOPT(cnode,cnode->type==GTK_TYPE_CTREE_NODE);

	ncolumns = GTK_CLIST(cctree->widget)->columns;
	text = calloc(ncolumns, sizeof(gchar*));
	if (gtk_ctree_get_node_info(GTK_CTREE(cctree->widget),
		GTK_CTREE_NODE(cnode->object),text,&spacing,&pxm_closed,&mask_closed,
		&pxm_opened,&mask_opened,&is_leaf,&expanded))
	{
		ClipVar *a = NEW(ClipVar);
		ClipVar cv;
		cv.t.type = CHARACTER_t;

		_clip_array(cm, a, 1, &ncolumns);

		for (i=0; i<ncolumns; i++)
		{
			gtk_ctree_node_get_text(GTK_CTREE(cctree->widget),
				GTK_CTREE_NODE(cnode->object), i, text);
#ifdef OS_CYGWIN
			cv.s.str.buf = _clip_locale_from_utf8(text[0]);
			cv.s.str.len = strlen(cv.s.str.buf);
#else
			cv.s.str.len = strlen(text[0]);
			cv.s.str.buf = (gchar*)calloc(1, cv.s.str.len+1);
			strcpy(cv.s.str.buf, text[0]);
#endif
			_clip_aset(cm, a, &cv, 1, &i);
			_clip_destroy(cm,&cv);
		}

		memset(minfo,0,sizeof(*minfo)); _clip_map(cm,minfo);

		if (pxm_closed)
		{
			cclosed = _list_get_cwidget_by_data(cm,pxm_closed);
			if (!cclosed) cclosed = _register_widget(cm,gtk_pixmap_new(pxm_closed,mask_closed),NULL);
			if (cclosed) _clip_madd(cm, minfo, HASH_PIXMAPCLOSED,&cclosed->obj);
		}

		if (pxm_opened)
		{
			copened = _list_get_cwidget_by_data(cm,pxm_opened);
			if (!copened) copened = _register_widget(cm,gtk_pixmap_new(pxm_opened,mask_opened),NULL);
			if (copened) _clip_madd(cm, minfo, HASH_PIXMAPOPENED,&copened->obj);
		}

		_clip_madd(cm, minfo, HASH_TEXT, a);

		_clip_mputn(cm, minfo, HASH_SPACING, spacing);
		_clip_mputl(cm, minfo, HASH_ISLEAF, is_leaf);
		_clip_mputl(cm, minfo, HASH_EXPANDED, expanded);
		free(a);
	}
	if (text) free(text);

	return 0;
err:
	return 1;
}
Ejemplo n.º 5
0
gint handle_select_page_signal (GtkNotebook *notebook, gboolean select,C_signal *cs)
{
	PREPARECV(cs,cv);
	_clip_mputl(cs->cw->cmachine, &cv, HASH_SELECT, select);
	INVOKESIGHANDLER(GTK_WIDGET(notebook),cs,cv);
}
Ejemplo n.º 6
0
static gint handle_activate_current_signal (GtkWidget *widget, gboolean force_hide, C_signal *cs)
{
	PREPARECV(cs,cv);
        _clip_mputl(cs->cw->cmachine, &cv, HASH_FORCEHIDE, force_hide);
        INVOKESIGHANDLER(widget,cs,cv);
}