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

version» Context lines:

pike.git/src/post_modules/GTK2/source/gtkdatabox.pre:130:   //! Set the zoom limit. Default is 0.01, which is 100 times.      float get_zoom_limit();   //! Get the zoom limit.      %{   static GtkDataboxCoord get_coord(int offset, int args) {    GtkDataboxCoord c;    if (args<offset+2)    Pike_error("too few arguments\n"); -  if (Pike_sp[-args+offset].type!=PIKE_T_INT) +  if (TYPEOF(Pike_sp[-args+offset]) != PIKE_T_INT)    Pike_error("Bad argument %d\n",offset);    else    c.x=Pike_sp[-args+offset].u.integer; -  if (Pike_sp[-args+offset+1].type!=PIKE_T_INT) +  if (TYPEOF(Pike_sp[-args+offset+1]) != PIKE_T_INT)    Pike_error("Bad argument %d\n",offset);    else    c.y=Pike_sp[-args+offset+1].u.integer;    return c;   }      static GtkDataboxValue get_value(int offset, int args) {    GtkDataboxValue c;    if (args<offset+2)    Pike_error("too few arguments\n"); -  if (Pike_sp[-args+offset].type!=PIKE_T_FLOAT) +  if (TYPEOF(Pike_sp[-args+offset]) != PIKE_T_FLOAT)    Pike_error("Bad argument %d\n",offset);    else    c.x=Pike_sp[-args+offset].u.float_number; -  if (Pike_sp[-args+offset+1].type!=PIKE_T_FLOAT) +  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;