void toolbar_new(char *widget) { this = syminst(TYPE_TOOLBAR, widget, widget); putdef("GtkWidget *", widget, "gtk_toolbar_new", 0); }
void statusbar_new(char *widget) { this = syminst(TYPE_STATUSBAR, widget, widget); putdef("GtkWidget *", widget, "gtk_statusbar_new", 0); }
void box_vertical_new(char *widget) { this = syminst(TYPE_VBOX, widget, widget); char *orientation = "GTK_ORIENTATION_VERTICAL"; char *spacing = "0"; putdef("GtkWidget *", widget, "gtk_box_new", 2, orientation, spacing); }
void box_horizontal_new(char *widget) { this = syminst(TYPE_HBOX, widget, widget); char *orientation = "GTK_ORIENTATION_HORIZONTAL"; char *spacing = "0"; putdef("GtkWidget *", widget, "gtk_box_new", 2, orientation, spacing); }
/* * Creates a new GtkCheckButton containing a label. The label will be created * using gtk_label_new_with_mnemonic(), so underscores in label indicate the * mnemonic for the check button. */ void check_button_new_with_mnemonic(char *widget, char *setting) { this = syminst(TYPE_CHECK_BUTTON, widget, widget); putdef("GtkWidget *" , widget , "gtk_check_button_new_with_mnemonic" , 1 , setting); }
void tool_button_new(char *widget) { this = syminst(TYPE_TOOL_BUTTON, widget, widget); putdef("GtkToolItem *" , widget , "gtk_tool_button_new" , 2 , "NULL" , "NULL"); }
void toggle_button_new_with_mnemonic(char *widget, char *setting) { this = syminst(TYPE_TOGGLE_BUTTON, widget, widget); putdef("GtkWidget *" , widget , "gtk_toggle_button_new_with_mnemonic" , 1 , setting); free(setting); }
void list_store_new(char *widget) { int n = 0; char *column, *columns, *tmp, *n_columns; symrec *sym; if (getsymval("iter") == NULL) { syminst(TYPE_ITER, "iter", "&iter"); prtstr(2, "GtkTreeIter ", "iter;\n"); } if ((sym = get_symbol_by_type(TYPE_COLUMN)) != NULL) { column = strdup(sym->value); delete_symbol(sym); columns = concat("", column); free(column); n++; while ((sym = get_symbol_by_type(TYPE_COLUMN)) != NULL) { column = strdup(sym->value); delete_symbol(sym); tmp = concatv(3, columns, ", ", column); free(column); free(columns); columns = tmp; n++; } } else { columns = ""; } n_columns = itoa(n); this = syminst(TYPE_LIST_STORE, widget, widget); putdef("GtkListStore *" , widget , "gtk_list_store_new" , 2 , n_columns , columns); free(n_columns); }
/* * Creates a new GtkCheckButton. */ void check_button_new(char *widget) { this = syminst(TYPE_CHECK_BUTTON, widget, widget); putdef("GtkWidget *", widget, "gtk_check_button_new", 0); }
void text_buffer_new(char *widget) { this = syminst(TYPE_TEXT_BUFFER, widget, widget); putdef("GtkTextBuffer *", widget, "gtk_text_buffer_new", 1, "NULL"); }
void action_bar_new(char *widget) { this = syminst(TYPE_ACTION_BAR, widget, widget); putdef("GtkWidget *", widget, "gtk_action_bar_new", 0); }
char * MakeCPPArgs(char *path) { int i; char buffer[MAXLINE], *buf, *line; Visual *visual; char *tmp; line = wmalloc(MAXLINE); *line = 0; i=1; if ((buf=getenv("HOSTNAME"))!=NULL) { if (buf[0]=='(') { wwarning(_("your machine is misconfigured. HOSTNAME is set to %s"), buf); } else putdef(line, " -DHOST=", buf); } else if ((buf=getenv("HOST"))!=NULL) { if (buf[0]=='(') { wwarning(_("your machine is misconfigured. HOST is set to %s"), buf); } else putdef(line, " -DHOST=", buf); } buf = username(); if (buf) putdef(line, " -DUSER="******" -DUID=", getuid()); buf = XDisplayName(DisplayString(dpy)); putdef(line, " -DDISPLAY=", buf); putdef(line, " -DWM_VERSION=", VERSION); visual = DefaultVisual(dpy, DefaultScreen(dpy)); putidef(line, " -DVISUAL=", visual->class); putidef(line, " -DDEPTH=", DefaultDepth(dpy, DefaultScreen(dpy))); putidef(line, " -DSCR_WIDTH=", WidthOfScreen(DefaultScreenOfDisplay(dpy))); putidef(line, " -DSCR_HEIGHT=", HeightOfScreen(DefaultScreenOfDisplay(dpy))); /* put the dir where the menu is being read from to the * search path */ if (path) { tmp = wstrdup(path); buf = strchr(tmp+1, ' '); if (buf) { *buf = 0; } buf = strrchr(tmp, '/'); if (buf) { *buf = 0; /* trunc filename */ putdef(line, " -I", tmp); } wfree(tmp); } /* this should be done just once, but it works this way */ strcpy(buffer, DEF_CONFIG_PATHS); buf = strtok(buffer, ":"); do { char fullpath[MAXLINE]; if (buf[0]!='~') { strcpy(fullpath, buf); } else { char * wgethomedir(); /* home is statically allocated. Don't free it! */ char *home = wgethomedir(); strcpy(fullpath, home); strcat(fullpath, &(buf[1])); } putdef(line, " -I", fullpath); } while ((buf = strtok(NULL, ":"))!=NULL); #undef arg #ifdef DEBUG puts("CPP ARGS"); puts(line); #endif return line; }
void tree_view_new(char *widget) { this = syminst(TYPE_TREE_VIEW, widget, widget); putdef("GtkWidget *", widget, "gtk_tree_view_new", 0); }
void toggle_button_new(char *widget) { this = syminst(TYPE_TOGGLE_BUTTON, widget, widget); putdef("GtkWidget *", widget, "gtk_toggle_button_new", 0); }