int clip_GDK_WINDOWGETSIZE(ClipMachine * cm) { C_widget *cwin = _fetch_cw_arg(cm); gint width = _clip_parni(cm,2); gint height = _clip_parni(cm,3); gint * px, * py; GdkWindow *win = NULL; CHECKCWID(cwin,GTK_IS_WIDGET); CHECKOPT(2,NUMERIC_t); CHECKOPT(3,NUMERIC_t); px = _clip_parinfo(cm,2) == UNDEF_t ? NULL : &width; py = _clip_parinfo(cm,3) == UNDEF_t ? NULL : &height; if (cwin && cwin->widget) win = cwin->widget->window; gdk_window_get_size(win, px, py); _clip_storni(cm,*px,2,0); _clip_storni(cm,*py,3,0); return 0; err: return 1; }
/* Adds a widget to a table. The number of 'cells' that a widget * will occupy is specified by left_attach, right_attach, top_attach * and bottom_attach. These each represent the leftmost, rightmost, * uppermost and lowest column and row numbers of the table. * (Columns and rows are indexed from 1). */ int clip_GTK_TABLEATTACH(ClipMachine *cm) { C_widget *ctbl = _fetch_cw_arg(cm); C_widget *cwid = _fetch_cwidget(cm,_clip_spar(cm,2)); guint left_attach = INT_OPTION(cm,3,1); guint right_attach = INT_OPTION(cm,4,1); guint top_attach = INT_OPTION(cm,5,1); guint bottom_attach = INT_OPTION(cm,6,1); GtkAttachOptions xoptions = _clip_parni(cm,7); GtkAttachOptions yoptions = _clip_parni(cm,8); guint xpadding = _clip_parni(cm,9); guint ypadding = _clip_parni(cm,10); CHECKCWID(ctbl,GTK_IS_TABLE); CHECKARG2(2,MAP_t,NUMERIC_t); CHECKCWID(cwid,GTK_IS_WIDGET); CHECKOPT(3,NUMERIC_t); CHECKOPT(4,NUMERIC_t); CHECKOPT(5,NUMERIC_t); CHECKOPT(6,NUMERIC_t); CHECKOPT(7,NUMERIC_t); CHECKOPT(8,NUMERIC_t); CHECKOPT(9,NUMERIC_t); CHECKOPT(10,NUMERIC_t); gtk_table_attach(GTK_TABLE(ctbl->widget), cwid->widget, left_attach-1, right_attach-1, top_attach-1, bottom_attach-1, xoptions,yoptions, xpadding,ypadding); return 0; err: return 1; }
int clip_GTK_MENUSETMONITOR(ClipMachine * ClipMachineMemory) { C_widget *cmnu = _fetch_cw_arg(ClipMachineMemory); guint monitor_num = _clip_parni(ClipMachineMemory, 2); CHECKCWID(cmnu, GTK_IS_MENU); CHECKARG(2, NUMERIC_type_of_ClipVarType); gtk_menu_set_monitor(GTK_MENU(cmnu->widget), monitor_num); return 0; err: return 1; }
int clip_GTK_COLORSELECTIONSETPREVIOUSALPHA(ClipMachine * ClipMachineMemory) { C_widget *ccsel = _fetch_cw_arg(ClipMachineMemory); guint16 alpha = _clip_parni(ClipMachineMemory, 2); CHECKCWID(ccsel, GTK_IS_COLOR_SELECTION); CHECKARG(2, NUMERIC_type_of_ClipVarType); gtk_color_selection_set_previous_alpha(GTK_COLOR_SELECTION(ccsel->widget), alpha); return 0; err: return 1; }
/* Sets the 'viewmode' for the GtkTree in tree. The 'viewmode' defines how the tree looks when an item is selected. mode can be one of: GTK_TREE_VIEW_LINE : When an item is selected the entire GtkTreeItem is highlighted. GTK_TREE_VIEW_ITEM : When an item is selected only the selected item's child widget is highlighted. The default mode is GTK_TREE_VIEW_LINE. */ int clip_GTK_TREESETVIEWMODE(ClipMachine * ClipMachineMemory) { C_widget *ctree = _fetch_cw_arg(ClipMachineMemory); GtkTreeViewMode mode = _clip_parni(ClipMachineMemory, 2); CHECKCWID(ctree, GTK_IS_TREE); CHECKOPT(2, NUMERIC_type_of_ClipVarType); gtk_tree_set_view_mode(GTK_TREE(ctree->widget), mode); return 0; err: return 1; }
int clip_GDK_WINDOWGETPOSITION(ClipMachine * cm) { C_widget *cwin = _fetch_cw_arg(cm); gint x = _clip_parni(cm,2); gint y = _clip_parni(cm,3); gint * px, * py; GdkWindow *win = NULL; CHECKCWID(cwin,GTK_IS_WIDGET); CHECKOPT(2,NUMERIC_t); CHECKOPT(3,NUMERIC_t); px = _clip_parinfo(cm,2) == UNDEF_t ? NULL : &x; py = _clip_parinfo(cm,3) == UNDEF_t ? NULL : &y; if (cwin && cwin->widget) win = cwin->widget->window; gdk_window_get_position(win, px, py); _clip_storni(cm,*px,2,0); _clip_storni(cm,*py,3,0); return 0; err: return 1; }
int clip_PG_IN_DOUBLE(ClipMachine* mp){ PG_ROWSET* rowset = (PG_ROWSET*)_clip_fetch_c_item( mp,_clip_parni(mp,1),_C_ITEM_TYPE_SQL); int dec = _clip_parni(mp,3); char* str; int len; if(!rowset){ _clip_trap_err(mp,0,0,0,subsys,ER_NOROWSET,er_norowset); return 1; } if(rowset->binary){ str = _clip_parcl(mp,2,&len); if(str){ _clip_retndp(mp,*((double*)str),0,dec); } } else { str = _clip_parc(mp,2); if(str){ _clip_retndp(mp,_clip_strtod(str,&len),0,dec); } } return 0; }
int clip_M6_NEWFILTER(ClipMachine * ClipMachineMemory) { const char *__PROC__ = "M6_NEWFILTER"; int type = _clip_parinfo(ClipMachineMemory, 1); DBWorkArea *wa = cur_area(ClipMachineMemory); RDD_FILTER *fp; int er; ClipMachineMemory->m6_error = 0; CHECKOPT2(1, NUMERIC_type_of_ClipVarType, CHARACTER_type_of_ClipVarType); if (!wa) { _clip_retni(ClipMachineMemory, -1); return 0; } if ((er = rdd_flushbuffer(ClipMachineMemory, wa->rd, __PROC__))) goto err; READLOCK; if (type == NUMERIC_type_of_ClipVarType || type == UNDEF_type_of_ClipVarType) { unsigned int len = _clip_parni(ClipMachineMemory, 1); if ((er = rdd_createuserfilter(ClipMachineMemory, wa->rd, &fp, len, __PROC__))) goto err_unlock; } else if (type == CHARACTER_type_of_ClipVarType) { char *str = _clip_parc(ClipMachineMemory, 1); if ((er = rdd_createfilter(ClipMachineMemory, wa->rd, &fp, NULL, str, NULL, 0, __PROC__))) goto err_unlock; } UNLOCK; _clip_retni(ClipMachineMemory, fp->handle); return 0; err_unlock: wa->rd->vtbl->_ulock(ClipMachineMemory, wa->rd, __PROC__); err: return er; }
int clip_GTK_COMBOBOXSETWRAPWIDTH(ClipMachine * ClipMachineMemory) { C_widget *ccmb = _fetch_cw_arg(ClipMachineMemory); gint width = _clip_parni(ClipMachineMemory, 2); CHECKCWID(ccmb, GTK_IS_COMBO_BOX); CHECKOPT(2, NUMERIC_type_of_ClipVarType); gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(ccmb->widget), width); return 0; err: return 1; }
int clip_FV(ClipMachine * mp) { int len, dec, i; double ret; double sum = _clip_parnd(mp, 1); double prec = 1.00 + _clip_parnd(mp, 2); int per = _clip_parni(mp, 3); _clip_parp(mp, 1, &len, &dec); dec = mp->decimals; for (ret = sum, i = 0; i < per; i++) ret *= prec; _clip_retndp(mp, ret, len, dec); return 0; }
int clip_II_EOF(ClipMachine * ClipMachineMemory) { const char *__PROC__ = "II_EOF"; int h = _clip_parni(ClipMachineMemory, 1); int er; CHECKARG1(1, NUMERIC_type_of_ClipVarType); if ((er = rdd_ii_eof(ClipMachineMemory, h, __PROC__))) goto err; return 0; err: return er; }
int clip_GTK_COMBOBOXREMOVETEXT(ClipMachine * cm) { C_widget *ccmb = _fetch_cw_arg(cm); gint pos = _clip_parni(cm, 2); CHECKCWID(ccmb,GTK_IS_COMBO_BOX); CHECKARG(2, NUMERIC_t); pos --; gtk_combo_box_remove_text(GTK_COMBO_BOX(ccmb->widget), pos); return 0; err: return 1; }
int clip_SQLFETCHED(ClipMachine * ClipMachineMemory) { int rowset_item = _clip_parni(ClipMachineMemory, 1); SQLROWSET *rowset = (SQLROWSET *) _clip_fetch_c_item(ClipMachineMemory, rowset_item, _C_ITEM_TYPE_SQL); if (!rowset) { _clip_trap_err(ClipMachineMemory, 0, 0, 0, subsys, ER_NOROWSET, er_norowset); return 1; } _clip_retni(ClipMachineMemory, rowset->loaded); return 0; }
/* Determines the total height of a given string. This value is not generally useful, because you cannot determine how this total height will be drawn in relation to the baseline. See gdk_text_extents(). */ int clip_GDK_TEXTHEIGHT(ClipMachine * cm) { C_object *cfont = _fetch_co_opt(cm); gchar * string = _clip_parc(cm,2); gint text_length = _clip_parni(cm,3); CHECKCOBJOPT(cfont,GDK_IS_FONT(cfont)); CHECKARG(2,CHARACTER_t); CHECKOPT(3,NUMERIC_t); if (_clip_parinfo(cm,3)==UNDEF_t) text_length = strlen(string); LOCALE_TO_UTF(string); _clip_retni(cm,gdk_text_height(GDK_FONT(cfont->object), string, text_length)); FREE_TEXT(string); return 0; err: return 1; }
int clip_GTK_COLORBUTTONSETALPHA(ClipMachine * cm) { C_widget *cbtn = _fetch_cw_arg(cm); guint16 alpha = _clip_parni(cm, 2); CHECKCWID(cbtn,GTK_IS_COLOR_BUTTON); CHECKARG(2, NUMERIC_t); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(cbtn->widget), alpha); return 0; err: return 1; }
int clip_GTK_ENTRYCOMPLETIONSETMINIMUMKEYLENGTH(ClipMachine * ClipMachineMemory) { C_object *ccompletion = _fetch_co_arg(ClipMachineMemory); gint length = _clip_parni(ClipMachineMemory, 2); CHECKCOBJ(ccompletion, GTK_IS_ENTRY_COMPLETION(ccompletion->object)); CHECKARG(2, NUMERIC_type_of_ClipVarType); gtk_entry_completion_set_minimum_key_length(GTK_ENTRY_COMPLETION(ccompletion->object), length); return 0; err: return 1; }
/* Returns : The type of the given cell. */ int clip_GTK_CTREENODEGETCELLTYPE(ClipMachine * cm) { C_widget *cctree = _fetch_cw_arg(cm); C_object *cnode = _fetch_cobject(cm,_clip_spar(cm,2)); gint column = _clip_parni(cm,3); CHECKCWID(cctree,GTK_IS_CTREE); CHECKOPT2(2,MAP_t,NUMERIC_t); CHECKCOBJOPT(cnode,cnode->type==GTK_TYPE_CTREE_NODE); CHECKOPT(3,NUMERIC_t); if (_clip_parinfo(cm,3)==UNDEF_t) column = 1; _clip_retni(cm,gtk_ctree_node_get_cell_type(GTK_CTREE(cctree->widget), GTK_CTREE_NODE(cnode->object),column-1)); return 0; err: return 1; }
int clip_GTK_FILECHOOSERSETACTION(ClipMachine * ClipMachineMemory) { C_object *cchooser = _fetch_co_arg(ClipMachineMemory); GtkFileChooserAction action = _clip_parni(ClipMachineMemory, 2); CHECKCOBJ(cchooser, GTK_IS_FILE_CHOOSER(cchooser->object)); CHECKARG(2, NUMERIC_type_of_ClipVarType); gtk_file_chooser_set_action(GTK_FILE_CHOOSER(cchooser->object), action); return 0; err: return 1; }
int clip_GTK_COMBOBOXSETCOLUMNSPANCOLUMN(ClipMachine * ClipMachineMemory) { C_widget *ccmb = _fetch_cw_arg(ClipMachineMemory); gint column_span = _clip_parni(ClipMachineMemory, 2); CHECKCWID(ccmb, GTK_IS_COMBO_BOX); CHECKOPT(2, NUMERIC_type_of_ClipVarType); gtk_combo_box_set_column_span_column(GTK_COMBO_BOX(ccmb->widget), column_span); return 0; err: return 1; }
int clip_SPACE(ClipMachine * ClipMachineMemory) { int kol = _clip_parni(ClipMachineMemory, 1); char *ret; if (kol <= 0) kol = 0; ret = malloc(kol + 1); if (!_clip_parl(ClipMachineMemory, 2)) memset(ret, ' ', kol); ret[kol] = 0; _clip_retcn_m(ClipMachineMemory, ret, kol); return 0; }
static gint emit_scroll_signal(C_widget * cwid, const gchar * signal_name) { ClipMachine *ClipMachineMemory = cwid->cmachine; GtkScrollType scroll_type = _clip_parni(ClipMachineMemory, 3); gfloat position = _clip_parnd(ClipMachineMemory, 4); CHECKOPT(3, NUMERIC_type_of_ClipVarType); CHECKOPT(4, NUMERIC_type_of_ClipVarType); gtk_signal_emit_by_name(GTK_OBJECT(cwid->widget), signal_name, scroll_type, position, cwid); return 0; err: return 1; }
/* Sets the relief style of the edges of the given Button widget. * Three styles exist, GTK_RELIEF_NORMAL,GTK_RELIEF_HALF, GTK_RELIEF_NONE. * The default style is, as one can guess, GTK_RELIEF_NORMAL. */ int clip_GTK_BUTTONSETRELIEF(ClipMachine * ClipMachineMemory) { C_widget *cbtn = _fetch_cw_arg(ClipMachineMemory); int relief = _clip_parni(ClipMachineMemory, 2); CHECKOPT(2, NUMERIC_type_of_ClipVarType); if (_clip_parinfo(ClipMachineMemory, 2) == UNDEF_type_of_ClipVarType) relief = GTK_RELIEF_NORMAL; CHECKCWID(cbtn, GTK_IS_BUTTON); gtk_button_set_relief(GTK_BUTTON(cbtn->widget), relief); return 0; err: return 1; }
int clip_GTK_FONTCOMBOSELECTNTH(ClipMachine * cm) { C_widget *cfnc = _fetch_cw_arg(cm); gint n = INT_OPTION(cm,2,1); gboolean bold = BOOL_OPTION(cm,3,FALSE); gboolean italic = BOOL_OPTION(cm,4,FALSE); gint height = _clip_parni(cm,5); CHECKCWID(cfnc,GTK_IS_FONT_COMBO); CHECKOPT(2,NUMERIC_t); CHECKOPT(3,LOGICAL_t); CHECKOPT(4,LOGICAL_t); CHECKOPT(5,NUMERIC_t); gtk_font_combo_select_nth(GTK_FONT_COMBO(cfnc->widget),n,bold,italic,height); return 0; err: return 1; }
int clip_GDK_DRAGDROP(ClipMachine * cm) { C_object *ccontext = _fetch_co_arg(cm); guint32 time = _clip_parni(cm, 2); if (!ccontext || ccontext->type != GDK_TYPE_DRAG_CONTEXT) goto err; CHECKARG(2, NUMERIC_t); gdk_drag_drop((GdkDragContext*)ccontext->object, time); return 0; err: return 1; }
int clip_GTK_FONTCOMBOSELECT(ClipMachine * cm) { C_widget *cfnc = _fetch_cw_arg(cm); const gchar *family = CHAR_OPTION(cm,2,""); gboolean bold = BOOL_OPTION(cm,3,FALSE); gboolean italic = BOOL_OPTION(cm,4,FALSE); gint height = _clip_parni(cm,5); CHECKCWID(cfnc,GTK_IS_FONT_COMBO); CHECKARG(2,CHARACTER_t); CHECKOPT(3,LOGICAL_t); CHECKOPT(4,LOGICAL_t); CHECKOPT(5,NUMERIC_t); gtk_font_combo_select(GTK_FONT_COMBO(cfnc->widget),family,bold,italic,height); return 0; err: return 1; }
/* Switches to the page number page_num. Negative values stand for the * last page; too large values are ignored. */ int clip_GTK_NOTEBOOKSETPAGE(ClipMachine * ClipMachineMemory) { C_widget *cntb = _fetch_cw_arg(ClipMachineMemory); gint page_num = _clip_parni(ClipMachineMemory, 2); CHECKCWID(cntb, GTK_IS_NOTEBOOK); CHECKOPT(2, NUMERIC_type_of_ClipVarType); if (_clip_parinfo(ClipMachineMemory, 2) == UNDEF_type_of_ClipVarType) page_num = 1; gtk_notebook_set_page(GTK_NOTEBOOK(cntb->widget), (page_num > 0 ? page_num - 1 : page_num)); return 0; err: return 1; }
int clip_SETCLEARB(ClipMachine * ClipMachineMemory) { int ch = _clip_parni(ClipMachineMemory, 1); char *s = _clip_parc(ClipMachineMemory, 1); int *set = _clip_fetch_item(ClipMachineMemory, HASH_setclearb); if (s != NULL) ch = (*s); ch = (ch % 0xff); *((char *) set) = (char) ch; _clip_retc(ClipMachineMemory, ""); return 0; }
int clip_STRFTIME(ClipMachine * ClipMachineMemory) { char *frm = _clip_parc(ClipMachineMemory, 1); int offset = _clip_parni(ClipMachineMemory, 2); time_t t = time(NULL) + offset; struct tm *tt = gmtime(&t); char s[81]; strftime(s, sizeof(s), frm, tt); _clip_retc(ClipMachineMemory, s); return 0; }
int clip_GTK_TREESELECTIONSETMODE(ClipMachine * ClipMachineMemory) { C_object *ctreesel = _fetch_co_arg(ClipMachineMemory); GtkSelectionMode mode = _clip_parni(ClipMachineMemory, 2); CHECKOPT2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType); CHECKCOBJ(ctreesel, GTK_IS_TREE_SELECTION(ctreesel->object)); CHECKARG(2, NUMERIC_type_of_ClipVarType); gtk_tree_selection_set_mode(GTK_TREE_SELECTION(ctreesel->object), mode); return 0; err: return 1; }
int clip_GTK_UIMANAGERREMOVEUI(ClipMachine * ClipMachineMemory) { C_object *cmanager = _fetch_co_arg(ClipMachineMemory); guint merge_id = _clip_parni(ClipMachineMemory, 2); CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType); CHECKCOBJ(cmanager, GTK_IS_UI_MANAGER(cmanager->object)); CHECKARG(2, NUMERIC_type_of_ClipVarType); gtk_ui_manager_remove_ui(GTK_UI_MANAGER(cmanager->object), merge_id); return 0; err: return 1; }