/*! \todo Finish function documentation!!! * \brief * \par Function Description * */ void o_edit(GSCHEM_TOPLEVEL *w_current, GList *list) { OBJECT *o_current; const gchar *str = NULL; if (list == NULL) { w_current->inside_action = 0; i_set_state(w_current, SELECT); return; } o_current = (OBJECT *) list->data; if (o_current == NULL) { fprintf(stderr, _("Got an unexpected NULL in o_edit\n")); exit(-1); } /* for now deal with only the first item */ switch(o_current->type) { /* also add the ability to multi attrib edit: nets, busses, pins */ case(OBJ_COMPLEX): case(OBJ_PLACEHOLDER): case(OBJ_NET): case(OBJ_PIN): case(OBJ_BUS): x_multiattrib_open (w_current); break; case(OBJ_PICTURE): picture_change_filename_dialog(w_current); break; case(OBJ_ARC): arc_angle_dialog(w_current, o_current); break; case(OBJ_TEXT): str = o_text_get_string (w_current->toplevel, o_current); if (o_attrib_get_name_value (o_current, NULL, NULL) && /* attribute editor only accept 1-line values for attribute */ o_text_num_lines (str) == 1) { attrib_edit_dialog(w_current,o_current, FROM_MENU); } else { o_text_edit(w_current, o_current); } break; } /* has to be more extensive in the future */ /* some sort of redrawing? */ }
/*! \brief End the input of an arc. * \par Function Description * This function ends the input of the radius of the arc. * The (<B>w_x</B>,<B>w_y</B>) point is taken as the other end of the radius segment. * The distance between this point and the center is the radius of the arc. * <B>w_x</B> and <B>w_y</B> are in world coords. * * At the end of this function, the center of the arc is at * (<B>w_current->first_wx</B>,<B>w_current->first_wy</B>) and its radius is * <B>w_current->distance</B>. * * The two angles needs to be input to fully define the arc. * * \param [in] w_current The GschemToplevel object. * \param [in] w_x (unused) * \param [in] w_y (unused) */ void o_arc_end1(GschemToplevel *w_current, int w_x, int w_y) { g_assert( w_current->inside_action != 0 ); /* erases the previous temporary radius segment */ /* o_arc_invalidate_rubber (w_current); */ w_current->rubber_visible = 0; /* ack! zero length radius */ if (w_current->distance != 0) { #if DEBUG printf("DIST: %d\n", w_current->distance); #endif /* open a dialog to input the start and end angle */ arc_angle_dialog(w_current, NULL); } i_action_stop (w_current); }