pike.git / src / post_modules / GTK2 / source / gtkdatabox.pre

version» Context lines:

pike.git/src/post_modules/GTK2/source/gtkdatabox.pre:54:   {    pgtk2_verify_inited();    {    struct array *a1,*a2;    struct object *o1;    INT_TYPE type,dot_size;    GdkColor *color;    struct data_wrapper *dw;    int i,len;    int ind; -  get_all_args("data_add",args,"%A%A%o%i%i",&a1,&a2,&o1,&type,&dot_size); +  get_all_args(NULL,args,"%A%A%o%i%i",&a1,&a2,&o1,&type,&dot_size);    if (a1==NULL || a2==NULL || a1->size<1 || a2->size<1)    Pike_error("Not arrays!\n");    color=(GdkColor *)get_gdkobject(o1,color);    dw=(struct data_wrapper *)g_malloc(sizeof(struct data_wrapper));    if (dw==NULL)    SIMPLE_OUT_OF_MEMORY_ERROR("data_add",sizeof(struct data_wrapper));    len=MAX(a1->size,a2->size);    dw->X=(gfloat *)g_malloc(sizeof(gfloat)*len);    dw->Y=(gfloat *)g_malloc(sizeof(gfloat)*len);    if (dw->X==NULL || dw->Y==NULL) {
pike.git/src/post_modules/GTK2/source/gtkdatabox.pre:157:    else    c.x=Pike_sp[-args+offset].u.float_number;    if (TYPEOF(Pike_sp[-args+offset+1]) != PIKE_T_FLOAT)    Pike_error("Bad argument %d\n",offset);    else    c.y=Pike_sp[-args+offset+1].u.float_number;    return c;   }      static void push_value(GtkDataboxValue v) { -  push_constant_text("x"); push_float(v.x); -  push_constant_text("y"); push_float(v.y); +  push_static_text("x"); push_float(v.x); +  push_static_text("y"); push_float(v.y);    f_aggregate_mapping(4);   }   %}      mapping(string:float) data_get_value(int x, int y) -  + //! Get the value at the given coordinates.   {    GtkDataboxValue v;    gtk_databox_data_get_value(GTK_DATABOX(THIS->obj),get_coord(0,args),&v);    pgtk2_pop_n_elems(args);    push_value(v);   }      array(mapping(string:float)) data_get_visible_extrema() -  + //! Get the positions of the edges of the display.   {    GtkDataboxValue v1,v2;    pgtk2_pop_n_elems(args);    gtk_databox_data_get_visible_extrema(GTK_DATABOX(THIS->obj), &v1, &v2 );    push_value( v1 );    push_value( v2 );    f_aggregate(2);   }      array(mapping(string:float)) data_get_extrema() -  + //! Get the bounds of the data set (?)   {    GtkDataboxValue v1,v2;    pgtk2_pop_n_elems(args);    gtk_databox_data_get_extrema(GTK_DATABOX(THIS->obj),&v1,&v2);    push_value(v1);    push_value(v2);    f_aggregate(2);   }      void rescale(); -  + //! Rescale with automatically-calculated extrema.      void rescale_with_values(float minx, float miny, float maxx, float maxy) -  + //! Rescale with specific data extrema.   {    gtk_databox_rescale_with_values(GTK_DATABOX(THIS->obj),    get_value(0,args),    get_value(2,args));    RETURN_THIS();   }      void rescale_inverted(int invertX, int invertY);   //! Rescale with an inverted x and/or y direction.      int data_set_color(int index, *GDK2.Color color); -  + //! Set the color at index.      void set_background_color(*GDK2.Color color);   //! Set the background color.      GDK2.Color data_get_color(int index)   //! Get the color at index.   {    pgtk2_verify_inited();    {    INT_TYPE index;    GdkColor *col; -  get_all_args("get_color",args,"%i",&index); +  get_all_args(NULL,args,"%i",&index);    col=(GdkColor *)g_malloc(sizeof(GdkColor));    if (col==NULL)    SIMPLE_OUT_OF_MEMORY_ERROR("get_color",sizeof(GdkColor));    gtk_databox_data_get_color(GTK_DATABOX(THIS->obj),index,col);    pgtk2_pop_n_elems(args);    push_gdkobject(col,color,1);    }   }      int data_set_type(int index, int type, int dot_size);   //! Type is one of CONST(GTK_DATABOX_)      array(int) data_get_type(int index)   //! Return type and dot size at index.   {    pgtk2_verify_inited();    {    INT_TYPE index;    guint dot_size;    GtkDataboxDataType type; -  get_all_args("data_get_type",args,"%i",&index); +  get_all_args(NULL,args,"%i",&index);    pgtk2_pop_n_elems(args);    gtk_databox_data_get_type(GTK_DATABOX(THIS->obj),index,&type,&dot_size);    push_int(type);    push_int(dot_size);    f_aggregate(2);    }   }   int data_add(int nelems, array(float,nofree) x, array(float,nofree) y,    *GDK2.Color color, int type, int dot_size);   //! Type is one of CONST(GTK_DATABOX_)
pike.git/src/post_modules/GTK2/source/gtkdatabox.pre:282:   int data_set_grid_config(int index, int hlines, int vlines);   //! Not useful unless the data type is GTK2.DATABOX_GRID.      int data_get_grid_config(int index)   //! See data_set_grid_config().   {    pgtk2_verify_inited();    {    INT_TYPE index;    unsigned int hlines,vlines; -  get_all_args("data_get_grid_config",args,"%i",&index); +  get_all_args(NULL,args,"%i",&index);    pgtk2_pop_n_elems(args);    gtk_databox_data_get_grid_config(GTK_DATABOX(THIS->obj),index,    &hlines,&vlines);    push_int(hlines);    push_int(vlines);    f_aggregate(2);    }   }