Пример #1
0
/*********************** SIGNALS **************************/
gint
handle_switch_page_signal(GtkNotebook * notebook, GtkNotebookPage * page, gint page_num, C_signal * cs)
{
   ClipVar   cv, mpage, mreq, mallc;

   int       ret;

   C_widget *cwid;

   memset(&cv, 0, sizeof(ClipVar));
   _clip_map(cs->cw->cmachine, &cv);
   memset(&mpage, 0, sizeof(ClipVar));
   _clip_map(cs->cw->cmachine, &mpage);
   memset(&mreq, 0, sizeof(ClipVar));
   _clip_map(cs->cw->cmachine, &mreq);
   memset(&mallc, 0, sizeof(ClipVar));
   _clip_map(cs->cw->cmachine, &mallc);
   cwid = _list_get_cwidget(cs->cw->cmachine, page->child);
   if (!cwid)
      cwid = _register_widget(cs->cw->cmachine, page->child, NULL);
   if (cwid)
      _clip_madd(cs->cw->cmachine, &mpage, HASH_CHILD, &cwid->obj);
   cwid = _list_get_cwidget(cs->cw->cmachine, page->tab_label);
   if (!cwid)
      cwid = _register_widget(cs->cw->cmachine, page->tab_label, NULL);
   if (cwid)
      _clip_madd(cs->cw->cmachine, &mpage, HASH_TABLABEL, &cwid->obj);
   cwid = _list_get_cwidget(cs->cw->cmachine, page->menu_label);
   if (!cwid)
      cwid = _register_widget(cs->cw->cmachine, page->menu_label, NULL);
   if (cwid)
      _clip_madd(cs->cw->cmachine, &mpage, HASH_MENULABEL, &cwid->obj);
   _clip_mputn(cs->cw->cmachine, &mreq, HASH_WIDTH, page->requisition.width);
   _clip_mputn(cs->cw->cmachine, &mreq, HASH_HEIGHT, page->requisition.height);
   _clip_madd(cs->cw->cmachine, &mpage, HASH_REQUISITION, &mreq);
   _clip_mputn(cs->cw->cmachine, &mallc, HASH_X, page->allocation.x);
   _clip_mputn(cs->cw->cmachine, &mallc, HASH_Y, page->allocation.y);
   _clip_mputn(cs->cw->cmachine, &mallc, HASH_WIDTH, page->allocation.width);
   _clip_mputn(cs->cw->cmachine, &mallc, HASH_HEIGHT, page->allocation.height);
   _clip_madd(cs->cw->cmachine, &mpage, HASH_ALLOCATION, &mallc);
   _clip_mputn(cs->cw->cmachine, &mpage, HASH_DEFAULTMENU, page->default_menu);
   _clip_mputn(cs->cw->cmachine, &mpage, HASH_DEFAULTTAB, page->default_tab);
   _clip_mputn(cs->cw->cmachine, &mpage, HASH_EXPAND, page->expand);
   _clip_mputn(cs->cw->cmachine, &mpage, HASH_PACK, page->pack);
   _clip_mputn(cs->cw->cmachine, &mpage, HASH_FILL, page->fill);
   _clip_madd(cs->cw->cmachine, &cv, HASH_PAGE, &mpage);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_PAGENUM, page_num + 1);
   ret = handle_signals(GTK_WIDGET(notebook), cs, &cv);
   _clip_destroy(cs->cw->cmachine, &cv);
   _clip_destroy(cs->cw->cmachine, &mpage);
   _clip_destroy(cs->cw->cmachine, &mreq);
   _clip_destroy(cs->cw->cmachine, &mallc);
   return ret;
}
Пример #2
0
static gint
handler_set_scroll_adjustments (GtkViewport *viewport, GtkAdjustment *hadj, GtkAdjustment *vadj, C_signal *cs)
  {
	C_widget *cwid;
	PREPARECV(cs,cv);
	cwid = _list_get_cwidget(cs->cw->cmachine,GTK_WIDGET(hadj));
	if (!cwid) cwid = _register_widget(cs->cw->cmachine,GTK_WIDGET(hadj),NULL);
	if (cwid) _clip_madd(cs->cw->cmachine, &cv, HASH_HADJ, &cwid->obj);
	cwid = _list_get_cwidget(cs->cw->cmachine,GTK_WIDGET(vadj));
	if (!cwid) cwid = _register_widget(cs->cw->cmachine,GTK_WIDGET(vadj),NULL);
	if (cwid) _clip_madd(cs->cw->cmachine, &cv, HASH_VADJ, &cwid->obj);
	INVOKESIGHANDLER(GTK_WIDGET(viewport),cs,cv);
  }
Пример #3
0
int
clip_GTK_IMAGEMENUITEMNEWFROMSTOCK(ClipMachine * cm)
{
	ClipVar        *cv = _clip_spar(cm, 1);
        gchar    *stock_id = _clip_parc(cm, 2);
        C_widget  *accelgr = _fetch_cwidget(cm, _clip_spar(cm, 3));
        C_widget   *cimage ;
        GtkWidget   *image ;

	CHECKOPT(1,MAP_t);
        CHECKARG(2, CHARACTER_t);
        CHECKOPT2(3, MAP_t, NUMERIC_t); CHECKCWIDOPT(accelgr, GTK_IS_ACCEL_GROUP);

	image = gtk_image_menu_item_new_from_stock(stock_id,
		(accelgr != NULL)?GTK_ACCEL_GROUP(accelgr->widget):NULL);

	if (image)
        {
        	cimage = _list_get_cwidget(cm, image);
                if (!cimage) cimage = _register_widget(cm, image, cv);
                if (cimage) _clip_mclone(cm, RETPTR(cm), &cimage->obj);
        }
	return 0;
err:
	return 1;
}
Пример #4
0
int
clip_GTK_IMAGEMENUITEMNEWWITHMNEMONIC(ClipMachine * cm)
{
	ClipVar        *cv = _clip_spar(cm, 1);
        gchar       *label = _clip_parc(cm, 2);
        C_widget   *cimage ;
        GtkWidget   *image ;

	CHECKOPT(1,MAP_t);
        CHECKARG(2, CHARACTER_t);

	LOCALE_TO_UTF(label);
	image = gtk_image_menu_item_new_with_mnemonic(label);

	if (image)
        {
        	cimage = _list_get_cwidget(cm, image);
                if (!cimage) cimage = _register_widget(cm, image, cv);
                if (cimage) _clip_mclone(cm, RETPTR(cm), &cimage->obj);
        }
        FREE_TEXT(label);
	return 0;
err:
	return 1;
}
Пример #5
0
int
clip_GTK_FILECHOOSERWIDGETNEWWITHBACKEND(ClipMachine * ClipMachineMemory)
{
   ClipVar  *cv = _clip_spar(ClipMachineMemory, 1);

   GtkFileChooserAction action = _clip_parni(ClipMachineMemory, 2);

   gchar    *backend = _clip_parc(ClipMachineMemory, 2);

   GtkWidget *wid;

   C_widget *cwid;

   CHECKOPT2(1, NUMERIC_type_of_ClipVarType, MAP_type_of_ClipVarType);
   CHECKARG(2, NUMERIC_type_of_ClipVarType);
   CHECKARG(3, CHARACTER_type_of_ClipVarType);

   wid = gtk_file_chooser_widget_new_with_backend(action, backend);
   if (wid)
    {
       cwid = _list_get_cwidget(ClipMachineMemory, wid);
       if (!cwid)
	  cwid = _register_widget(ClipMachineMemory, wid, cv);
       if (cwid)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
    }
   return 0;
 err:
   return 1;
}
Пример #6
0
int
clip_GTK_MENUGETACCELGROUP(ClipMachine * ClipMachineMemory)
{
   C_widget *cmnu = _fetch_cw_arg(ClipMachineMemory);

   C_widget *caccelgroup;

   GtkAccelGroup *accelgroup;

   CHECKCWID(cmnu, GTK_IS_MENU);

   accelgroup = gtk_menu_get_accel_group(GTK_MENU(cmnu->widget));

   if (accelgroup)
    {
       caccelgroup = _list_get_cwidget(ClipMachineMemory, accelgroup);
       if (!caccelgroup)
	  _register_widget(ClipMachineMemory, GTK_WIDGET(accelgroup), NULL);
       if (accelgroup)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &caccelgroup->obj);
    }
   return 0;
 err:
   return 1;
}
Пример #7
0
static    gint
handle_widget_selected_signal(GtkWidget * widget, GtkWidget * wid,
			      gchar * tip_text, gchar * tip_private, GdkEventButton * event, C_signal * cs)
{
   C_widget *cwid = _list_get_cwidget(cs->cw->cmachine, wid);

   PREPARECV(cs, cv);
   if (!cwid)
      cwid = _register_widget(cs->cw->cmachine, wid, NULL);
   if (cwid)
      _clip_madd(cs->cw->cmachine, &cv, HASH_WIDGET, &cwid->obj);
   LOCALE_FROM_UTF(tip_text);
   LOCALE_FROM_UTF(tip_private);
   _clip_mputc(cs->cw->cmachine, &cv, HASH_TIPTEXT, tip_text, strlen(tip_text));
   _clip_mputc(cs->cw->cmachine, &cv, HASH_TIPPRIVATE, tip_private, strlen(tip_private));
   _clip_mputn(cs->cw->cmachine, &cv, HASH_BUTTON, event->button);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_X, event->x);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_Y, event->y);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_XROOT, event->x_root);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_YROOT, event->y_root);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_STATE, event->state);
   FREE_TEXT(tip_text);
   FREE_TEXT(tip_private);
   INVOKESIGHANDLER(widget, cs, cv);
}
Пример #8
0
int
clip_GTK_MENUITEMGETSUBMENU(ClipMachine * ClipMachineMemory)
{
   C_widget *citm = _fetch_cw_arg(ClipMachineMemory);

   GtkWidget *wid;

   C_widget *cwid;

   CHECKCWID(citm, GTK_IS_ITEM);

   wid = gtk_menu_item_get_submenu(GTK_MENU_ITEM(citm->widget));

   if (wid)
    {
       cwid = _list_get_cwidget(ClipMachineMemory, wid);
       if (!cwid)
	  cwid = _register_widget(ClipMachineMemory, wid, NULL);
       if (cwid)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
    }
   return 0;
 err:
   return 1;
}
Пример #9
0
/* Returns the content of the page number page_num, or
 * NULL if page_num is out of bounds. */
int
clip_GTK_NOTEBOOKGETNTHPAGE(ClipMachine * ClipMachineMemory)
{
   C_widget *cntb = _fetch_cw_arg(ClipMachineMemory);

   gint      page_num = _clip_parni(ClipMachineMemory, 2);

   C_widget *cwid;

   GtkWidget *wid;

   CHECKCWID(cntb, GTK_IS_NOTEBOOK);
   CHECKOPT(2, NUMERIC_type_of_ClipVarType);
   if (_clip_parinfo(ClipMachineMemory, 2) == UNDEF_type_of_ClipVarType)
      page_num = 1;
   wid = gtk_notebook_get_nth_page(GTK_NOTEBOOK(cntb->widget), page_num - 1);
   cwid = _list_get_cwidget(ClipMachineMemory, wid);
   if (!cwid)
      cwid = _register_widget(ClipMachineMemory, wid, NULL);
   if (cwid)
      _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
   return 0;
 err:
   return 1;
}
Пример #10
0
int
clip_GTK_BUTTONBOXGETCHILDSECONDARY(ClipMachine * ClipMachineMemory)
{
   C_widget *cbbox = _fetch_cw_arg(ClipMachineMemory);

   ClipVar  *cv = _clip_spar(ClipMachineMemory, 2);

   C_widget *cwid;

   GtkWidget *wid = 0;

   CHECKCWID(cbbox, GTK_IS_BUTTON_BOX);

   _clip_retl(ClipMachineMemory, gtk_button_box_get_child_secondary(GTK_BUTTON_BOX(cbbox->widget), wid));
   if (wid)
    {
       cwid = _list_get_cwidget(ClipMachineMemory, wid);
       if (!cwid)
	  cwid = _register_widget(ClipMachineMemory, wid, NULL);
       if (cwid)
	  _clip_mclone(ClipMachineMemory, cv, &cwid->obj);
    }
   return 0;
 err:
   return 1;
}
Пример #11
0
int
clip_GTK_UIMANAGERGETACCELGROUP(ClipMachine * ClipMachineMemory)
{
   C_object *cmanager = _fetch_co_arg(ClipMachineMemory);

   GtkAccelGroup *agroup;

   C_widget *cagroup;

   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCOBJ(cmanager, GTK_IS_UI_MANAGER(cmanager->object));

   agroup = gtk_ui_manager_get_accel_group(GTK_UI_MANAGER(cmanager->object));

   if (agroup)
    {
       cagroup = _list_get_cwidget(ClipMachineMemory, agroup);
       if (!cagroup)
	  cagroup = _register_widget(ClipMachineMemory, GTK_WIDGET(agroup), NULL);
       if (cagroup)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cagroup->obj);
    }
   return 0;
 err:
   return 1;
}
Пример #12
0
int
clip_GTK_UIMANAGERGETWIDGET(ClipMachine * ClipMachineMemory)
{
   C_object *cmanager = _fetch_co_arg(ClipMachineMemory);

   gchar    *path = _clip_parc(ClipMachineMemory, 2);

   GtkWidget *wid;

   C_widget *cwid;

   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCOBJ(cmanager, GTK_IS_UI_MANAGER(cmanager->object));
   CHECKARG(2, CHARACTER_type_of_ClipVarType);

   wid = gtk_ui_manager_get_widget(GTK_UI_MANAGER(cmanager->object), path);

   if (wid)
    {
       cwid = _list_get_cwidget(ClipMachineMemory, wid);
       if (!cwid)
	  cwid = _register_widget(ClipMachineMemory, wid, NULL);
       if (cwid)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
    }
   return 0;
 err:
   return 1;
}
Пример #13
0
int
clip_GTK_ENTRYCOMPLETIONGETENTRY(ClipMachine * ClipMachineMemory)
{
   C_object *ccompletion = _fetch_co_arg(ClipMachineMemory);

   C_widget *cwid;

   GtkWidget *wid;

   CHECKCOBJ(ccompletion, GTK_IS_ENTRY_COMPLETION(ccompletion->object));

   wid = gtk_entry_completion_get_entry(GTK_ENTRY_COMPLETION(ccompletion->object));

   if (wid)
    {
       cwid = _list_get_cwidget(ClipMachineMemory, wid);
       if (!cwid)
	  cwid = _register_widget(ClipMachineMemory, wid, NULL);
       if (cwid)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
    }

   return 0;
 err:
   return 1;
}
Пример #14
0
/* Try to find registered widget. If fail, register it. */
CLIP_DLLEXPORT C_widget *
_get_cwidget(ClipMachine *cm, GtkWidget *wid)
{
	C_widget *cwid = _list_get_cwidget(cm,wid);
	if (wid && !cwid) cwid = _register_widget(cm,wid,NULL);
	return cwid;
}
Пример #15
0
/*********************** SIGNALS **************************/
static gint container_handle_signal (GtkContainer *container,GtkWidget *widget, C_signal *cs)
{
	C_widget *cwid;
	PREPARECV(cs,cv);
	cwid = _list_get_cwidget(cs->cw->cmachine,widget);
	if (!cwid) cwid = _register_widget(cs->cw->cmachine,widget,NULL);
	if (cwid) _clip_madd(cs->cw->cmachine, &cv, HASH_WIDGET, &cwid->obj);
	INVOKESIGHANDLER(GTK_WIDGET(container),cs,cv);
}
Пример #16
0
/*********************** SIGNALS **************************/
static gint handle_set_focus_signal (GtkWindow *window, GtkWidget *widget, C_signal *cs)
  {
	C_widget *cwid;
	PREPARECV(cs,cv);
	cwid = _list_get_cwidget(cs->cw->cmachine,widget);
	if (!cwid) cwid = _register_widget(cs->cw->cmachine,widget,NULL);
	if (cwid) _clip_madd(cs->cw->cmachine, &cv, HASH_WIDGET, &cwid->obj);
	INVOKESIGHANDLER(widget,cs,cv);
  }
Пример #17
0
static void
_container_children_func(GtkWidget *wid, gpointer data)
{
	C_var *c = (C_var*)data;
	C_widget *c_wid = _list_get_cwidget(c->cm, wid);
	if (!c_wid)
		c_wid = _register_widget(c->cm,wid,NULL);
	if (c_wid)
		_clip_aadd(c->cm, c->cv, &c_wid->obj);
}
Пример #18
0
static    gint
handle_add_widget_signal(GtkUIManager * manager, GtkWidget * wid, C_signal * cs)
{
   C_widget *cwid;

   OBJECTPREPARECV(cs, cv);
   cwid = _list_get_cwidget(cs->co->cmachine, wid);
   if (!cwid)
      cwid = _register_widget(cs->co->cmachine, wid, NULL);
   if (cwid)
      _clip_madd(cs->co->cmachine, &cv, HASH_WIDGET, &cwid->obj);
   OBJECTINVOKESIGHANDLER(cs, cv);
}
Пример #19
0
static    gint
handle_unselect_child_signal(GtkWidget * widget, GtkWidget * wid, C_signal * cs)
{
   C_widget *cwid;

   PREPARECV(cs, cv);
   cwid = _list_get_cwidget(cs->cw->cmachine, wid);
   if (!cwid)
      cwid = _register_widget(cs->cw->cmachine, wid, NULL);
   if (cwid)
      _clip_madd(cs->cw->cmachine, &cv, HASH_CHILD, &cwid->obj);
   INVOKESIGHANDLER(widget, cs, cv);
}
Пример #20
0
/* Returns : The widget which currently has the grab or NIL if no grab is active. */
int
clip_GTK_GRABGETCURRENT(ClipMachine * cm)
{
	GtkWidget *wid = gtk_grab_get_current();
	if (wid)
	{
		C_widget *cwid = _list_get_cwidget(cm,wid);
		if (!cwid)
			cwid = _register_widget(cm,wid,NULL);
		if (cwid)
			_clip_mclone(cm,RETPTR(cm),&cwid->obj);
	}
	return 0;
}
Пример #21
0
/* Signal handlers */
static gint
handle_widget_entered_signal (GtkWidget *widget, GtkWidget *wid, gchar *tip_text, gchar *tip_private, C_signal *cs)
{
	C_widget *cwid = _list_get_cwidget(cs->cw->cmachine,wid);
	PREPARECV(cs,cv);
        if (!cwid) cwid = _register_widget(cs->cw->cmachine,wid,NULL);
	if (cwid) _clip_madd(cs->cw->cmachine, &cv, HASH_WIDGET, &cwid->obj);
	LOCALE_FROM_UTF(tip_text);
	LOCALE_FROM_UTF(tip_private);
	_clip_mputc(cs->cw->cmachine, &cv, HASH_TIPTEXT, tip_text, strlen(tip_text));
	_clip_mputc(cs->cw->cmachine, &cv, HASH_TIPPRIVATE, tip_private, strlen(tip_private));
       	FREE_TEXT(tip_text);
       	FREE_TEXT(tip_private);
        INVOKESIGHANDLER(widget,cs,cv);
}
Пример #22
0
int
clip_GTK_TREEITEMGETSUBTREE(ClipMachine * cm)
{
	C_widget *citm = _fetch_cw_arg(cm);
	C_widget *csubtree = NULL;
	GtkWidget *subtree;
	CHECKCWID(citm,GTK_IS_TREE_ITEM);
	subtree = GTK_TREE_ITEM_SUBTREE(citm->widget);
	csubtree = _list_get_cwidget(cm, subtree);
	if (!csubtree) csubtree = _register_widget(cm, subtree, NULL);
	if (csubtree) _clip_mclone(cm,RETPTR(cm),&csubtree->obj);
	return 0;
err:
	return 1;
}
Пример #23
0
/* Retrieves any GtkTooltipsData previously associated with the given widget. */
int
clip_GTK_TOOLTIPSDATAGET(ClipMachine * ClipMachineMemory)
{
   C_widget *cwid = _fetch_cw_arg(ClipMachineMemory);

   GtkTooltipsData *data;

   CHECKCWID(cwid, GTK_IS_WIDGET);
   data = gtk_tooltips_data_get(cwid->widget);
   if (data)
    {
       C_widget *ctt = _list_get_cwidget(ClipMachineMemory, data->tooltips);

       C_object *cfont = _list_get_cobject(ClipMachineMemory, data->font);

       ClipVar  *ret = RETPTR(ClipMachineMemory);

       char     *tip_text = data->tip_text ? data->tip_text : "";

       char     *tip_private = data->tip_private ? data->tip_private : "";

       memset(ret, 0, sizeof(*ret));
       _clip_map(ClipMachineMemory, ret);
       if (!ctt)
	  ctt = _register_widget(ClipMachineMemory, (GtkWidget *) (data->tooltips), NULL);
       if (ctt)
	  _clip_madd(ClipMachineMemory, ret, HASH_TOOLTIPS, &ctt->obj);
       if (!cfont)
	  cfont =
	   _register_object(ClipMachineMemory, data->font, GDK_OBJECT_FONT, NULL, (coDestructor) gdk_object_font_destructor);
       if (cfont)
	{
	   cfont->ref_count = 1;
	   _clip_madd(ClipMachineMemory, ret, HASH_FONT, &cfont->obj);
	}
       _clip_madd(ClipMachineMemory, ret, HASH_WIDGET, &cwid->obj);
       LOCALE_FROM_UTF(tip_text);
       LOCALE_FROM_UTF(tip_private);
       _clip_mputc(ClipMachineMemory, ret, HASH_TIPTEXT, tip_text, strlen(tip_text));
       _clip_mputc(ClipMachineMemory, ret, HASH_TIPPRIVATE, tip_private, strlen(tip_private));
       _clip_mputn(ClipMachineMemory, ret, HASH_WIDTH, data->width);
       FREE_TEXT(tip_text);
       FREE_TEXT(tip_private);
    }
   return 0;
 err:
   return 1;
}
Пример #24
0
int
clip_GTK_TIPSQUERYGETCALLER(ClipMachine * cm)
{
	C_widget  *ctq = _fetch_cw_arg(cm);
        C_widget *cwid = NULL;
        CHECKCWID(ctq,GTK_IS_TIPS_QUERY);
        if (GTK_TIPS_QUERY(ctq->widget)->caller)
        {
        	cwid = _list_get_cwidget(cm,GTK_TIPS_QUERY(ctq->widget)->caller);
                if (!cwid) cwid = _register_widget(cm,GTK_TIPS_QUERY(ctq->widget)->caller,NULL);
        	if (cwid) _clip_mclone(cm,RETPTR(cm),&cwid->obj);
	}
	return 0;
err:
	return 1;
}
Пример #25
0
/* Returns the vertical scrollbar's adjustment, used to
 * connect the vertical scrollbar to the child widget's
 * vertical scroll functionality. */
int
clip_GTK_SCROLLEDWINDOWGETVADJUSTMENT (ClipMachine *cm)
{
    C_widget *csw = _fetch_cw_arg(cm);
    ClipVar * cv  = RETPTR(cm);
    GtkAdjustment* adj;
    C_widget *cadj;
    CHECKCWID(csw,GTK_IS_SCROLLED_WINDOW);
    adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(csw->widget));
    cadj = _list_get_cwidget(cm, adj);
    if (!cadj) cadj = _register_widget(cm, (GtkWidget*)adj, NULL);
    if (cadj) _clip_mclone(cm, cv, &cadj->obj);
    return 0;
err:
    return 1;
}
Пример #26
0
/* Returns the vertical scrollbar's adjustment, used to
 * connect the vertical scrollbar to the child widget's
 * vertical scroll functionality. */
int
clip_GTK_VIEWPORTGETVADJUSTMENT (ClipMachine *cm)
{
    C_widget *cvp = _fetch_cw_arg(cm);
    ClipVar * cv  = RETPTR(cm);
    GtkAdjustment* adj;
    C_widget *cadj;
    CHECKCWID(cvp,GTK_IS_VIEWPORT);
    adj = gtk_viewport_get_vadjustment (GTK_VIEWPORT(cvp->widget));
    cadj = _list_get_cwidget(cm, adj);
    if (!cadj) cadj = _register_widget(cm, (GtkWidget*)adj, NULL);
    if (cadj) _clip_mclone(cm, cv, &cadj->obj);
    return 0;
err:
    return 1;
}
Пример #27
0
/* Returns the menu tab of the page child. NULL is returned if child is
 * not in notebook or NULL if it has the default tab label. */
int
clip_GTK_NOTEBOOKGETTABLABEL(ClipMachine * cm)
{
	C_widget   *cntb = _fetch_cw_arg(cm);
	C_widget *cchild = _fetch_cwidget(cm,_clip_spar(cm,2));
	C_widget   *cwid;
	GtkWidget *wid;
	CHECKCWID(cntb,GTK_IS_NOTEBOOK);
	CHECKARG2(2,MAP_t,NUMERIC_t); CHECKCWID(cchild,GTK_IS_WIDGET);
	wid = gtk_notebook_get_tab_label(GTK_NOTEBOOK(cntb->widget), cchild->widget);
	cwid = _list_get_cwidget(cm,wid);
	if (!cwid) cwid = _register_widget(cm,wid,NULL);
	if (cwid) _clip_mclone(cm,RETPTR(cm),&cwid->obj);
	return 0;
err:
	return 1;
}
Пример #28
0
static void
_item_factory_callback2(GtkWidget *wid, gpointer data, guint callback_action)
{
	C_var *c = (C_var*)data;
	C_widget *c_wid = _list_get_cwidget(c->cm, wid);
	ClipVar stack[2];
	ClipVar res;
	if (!c_wid)
		c_wid = _register_widget(c->cm,wid, NULL);
	if (c_wid)
	{
		memset(&stack,0,sizeof(stack)); memset( &res, 0, sizeof(ClipVar) );
		_clip_mclone(c->co->cmachine, &stack[0], &c->co->obj);
		stack[1] = c_wid->obj;
		_clip_eval( c->cm, &(c->cfunc), 2, stack, &res );
		_clip_destroy(c->cm, &res);
	}
}
Пример #29
0
int
clip_GTK_WIDGETGETTOPLEVEL (ClipMachine *cm)
{
	C_widget *cwid = _fetch_cw_arg(cm);
	GtkWidget *toplevel; C_widget *ctoplevel;
	CHECKOPT(2,NUMERIC_t);
	CHECKCWID(cwid,GTK_IS_WIDGET);
	toplevel = gtk_widget_get_toplevel(cwid->widget);
	if (toplevel)
	{
		ctoplevel = _list_get_cwidget(cm,toplevel);
		if (!ctoplevel) ctoplevel = _register_widget(cm,toplevel,NULL);
		if (ctoplevel) _clip_mclone(cm,RETPTR(cm),&ctoplevel->obj);
	}
	return 0;
err:
	return 1;
}
Пример #30
0
static void
_container_for_each_func(GtkWidget *wid, gpointer data)
{
	C_var *c = (C_var*)data;
	C_widget *c_wid = _list_get_cwidget(c->cm, wid);
	ClipVar stack[2];
	ClipVar res;
	if (!c_wid)
		c_wid = _register_widget(c->cm,wid,NULL);
	if (c_wid)
	{
		memset(&stack,0,sizeof(stack)); memset( &res, 0, sizeof(ClipVar) );
		_clip_mclone(c->cw->cmachine, &stack[0], &c->cw->obj);
		//stack[0] = c->cw->obj;
		stack[1] = c_wid->obj;
		_clip_eval( c->cm, &(c->cfunc), 2, stack, &res );
		_clip_destroy(c->cm, &res);
	}
}