[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: i_callbacks.c
User: pcjc2
Date: 06/12/27 14:56:42
Modified: . Tag: noscreen i_callbacks.c o_complex.c o_misc.c
x_event.c
Log:
* include/prototype.h, src/i_callbacks.c, src/o_complex.c,
src/o_misc.c, src/x_event.c: Made o_complex_rotate().
into o_complex_rotate_world(), made o_rotate_90() into
o_rotate_90_world(), and converted usage as appropriate.
Revision Changes Path
No revision
No revision
1.70.2.3 +4 -2 eda/geda/gaf/gschem/src/i_callbacks.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: i_callbacks.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/i_callbacks.c,v
retrieving revision 1.70.2.2
retrieving revision 1.70.2.3
diff -u -b -r1.70.2.2 -r1.70.2.3
--- i_callbacks.c 27 Dec 2006 19:21:36 -0000 1.70.2.2
+++ i_callbacks.c 27 Dec 2006 19:56:42 -0000 1.70.2.3
@@ -885,6 +885,7 @@
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
GList *object_list;
+ int w_x, w_y;
exit_if_null(w_current);
o_redraw_cleanstates(w_current);
@@ -894,9 +895,10 @@
if (object_list) {
i_update_middle_button(w_current,
i_callback_edit_rotate_90_hotkey, _("Rotate"));
- /* Allow o_rotate_90 to redraw the objects */
+ /* Allow o_rotate_90_world to redraw the objects */
w_current->DONT_REDRAW = 0;
- o_rotate_90(w_current, object_list, mouse_x, mouse_y);
+ SCREENtoWORLD( w_current, mouse_x, mouse_y, &w_x, &w_y );
+ o_rotate_90_world(w_current, object_list, w_x, w_y);
}
w_current->event_state = SELECT;
1.28.6.4 +18 -25 eda/geda/gaf/gschem/src/o_complex.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_complex.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_complex.c,v
retrieving revision 1.28.6.3
retrieving revision 1.28.6.4
diff -u -b -r1.28.6.3 -r1.28.6.4
--- o_complex.c 27 Dec 2006 19:34:28 -0000 1.28.6.3
+++ o_complex.c 27 Dec 2006 19:56:42 -0000 1.28.6.4
@@ -188,8 +188,8 @@
{
OBJECT *o_current;
GList *ptr;
- int screen_x_local = -1;
- int screen_y_local = -1;
+ int x_local = -1;
+ int y_local = -1;
int new_angle;
ptr = w_current->page_current->complex_place_list;
@@ -197,14 +197,14 @@
o_current = (OBJECT *) ptr->data;
switch(o_current->type) {
case(OBJ_COMPLEX):
- screen_x_local = o_current->complex->screen_x;
- screen_y_local = o_current->complex->screen_y;
+ x_local = o_current->complex->x;
+ y_local = o_current->complex->y;
break;
}
ptr = ptr->next;
}
- if (screen_x_local == -1) {
+ if (x_local == -1) {
printf(_("Could not find complex in new componet placement!\n"));
return;
}
@@ -216,13 +216,13 @@
case(OBJ_TEXT):
new_angle = (o_current->text->angle + 90) % 360;
- o_text_rotate(w_current, screen_x_local, screen_y_local,
+ o_text_rotate_world(w_current, x_local, y_local,
new_angle, 90, o_current);
break;
case(OBJ_COMPLEX):
new_angle = (o_current->complex->angle + 90) % 360;
- o_complex_rotate(w_current, screen_x_local, screen_y_local,
+ o_complex_rotate_world(w_current, x_local, y_local,
new_angle, 90, o_current);
break;
@@ -353,8 +353,8 @@
for (i = 0; i < temp; i++) {
new_angle = (o_temp->
text->angle + 90) % 360;
- o_text_rotate(w_current,
- screen_x, screen_y,
+ o_text_rotate_world(w_current,
+ x, y,
new_angle, 90, o_temp);
}
break;
@@ -706,26 +706,19 @@
* \par Function Description
*
*/
-void o_complex_rotate(TOPLEVEL *w_current, int centerx, int centery,
+void o_complex_rotate_world(TOPLEVEL *w_current, int centerx, int centery,
int angle, int angle_change, OBJECT *object)
{
int x, y;
int newx, newy;
- int world_centerx, world_centery;
- SCREENtoWORLD(w_current,
- centerx,
- centery,
- &world_centerx,
- &world_centery);
-
- x = object->complex->x + (-world_centerx);
- y = object->complex->y + (-world_centery);
+ x = object->complex->x + (-centerx);
+ y = object->complex->y + (-centery);
rotate_point_90(x, y, 90, &newx, &newy);
- x = newx + (world_centerx);
- y = newy + (world_centery);
+ x = newx + (centerx);
+ y = newy + (centery);
o_complex_world_translate_toplevel(w_current,
-object->complex->x,
1.36.2.3 +12 -18 eda/geda/gaf/gschem/src/o_misc.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_misc.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_misc.c,v
retrieving revision 1.36.2.2
retrieving revision 1.36.2.3
diff -u -b -r1.36.2.2 -r1.36.2.3
--- o_misc.c 27 Dec 2006 19:21:37 -0000 1.36.2.2
+++ o_misc.c 27 Dec 2006 19:56:42 -0000 1.36.2.3
@@ -202,7 +202,7 @@
* \param [in] centerx Center x coordinate of rotation.
* \param [in] centery Center y coordinate of rotation.
*/
-void o_rotate_90(TOPLEVEL *w_current, GList *list,
+void o_rotate_90_world(TOPLEVEL *w_current, GList *list,
int centerx, int centery)
{
OBJECT *object;
@@ -248,7 +248,7 @@
other_objects = s_conn_return_others(other_objects, object);
s_conn_remove(w_current, object);
- o_net_rotate(w_current, centerx, centery, 90, object);
+ o_net_rotate_world(w_current, centerx, centery, 90, object);
s_conn_update_object(w_current, object);
if (!w_current->DONT_REDRAW) {
o_net_draw(w_current, object);
@@ -279,7 +279,7 @@
other_objects = s_conn_return_others(other_objects, object);
s_conn_remove(w_current, object);
- o_bus_rotate(w_current, centerx, centery, 90, object);
+ o_bus_rotate_world(w_current, centerx, centery, 90, object);
s_conn_update_object(w_current, object);
if (!w_current->DONT_REDRAW) {
o_bus_draw(w_current, object);
@@ -310,7 +310,7 @@
other_objects = s_conn_return_others(other_objects, object);
s_conn_remove(w_current, object);
- o_pin_rotate(w_current, centerx, centery,
+ o_pin_rotate_world(w_current, centerx, centery,
90, object);
s_conn_update_object(w_current, object);
if (!w_current->DONT_REDRAW) {
@@ -351,7 +351,7 @@
/* do the rotate */
/*w_current->ADDING_SEL=1; NEWSEL: needed? */
new_angle = (object->complex->angle + 90) % 360;
- o_complex_rotate(w_current, centerx, centery,
+ o_complex_rotate_world(w_current, centerx, centery,
new_angle, 90, object);
/*w_current->ADDING_SEL = 0; NEWSEL: needed? */
s_conn_update_complex(w_current, object->complex->prim_objs);
@@ -377,7 +377,7 @@
o_line_erase(w_current, object);
}
- o_line_rotate(w_current, centerx, centery,
+ o_line_rotate_world(w_current, centerx, centery,
90, object);
if (!w_current->DONT_REDRAW) {
@@ -392,7 +392,7 @@
o_box_erase(w_current, object);
}
- o_box_rotate(w_current, centerx, centery,
+ o_box_rotate_world(w_current, centerx, centery,
90, object);
if (!w_current->DONT_REDRAW) {
@@ -408,7 +408,7 @@
o_picture_erase(w_current, object);
}
- o_picture_rotate(w_current, centerx, centery,
+ o_picture_rotate_world(w_current, centerx, centery,
90, object);
if (!w_current->DONT_REDRAW) {
@@ -422,7 +422,7 @@
o_circle_erase(w_current, object);
}
- o_circle_rotate(w_current, centerx, centery,
+ o_circle_rotate_world(w_current, centerx, centery,
90, object);
if (!w_current->DONT_REDRAW) {
@@ -435,13 +435,7 @@
o_arc_erase(w_current, object);
}
-#if 0 /* not needed anymore */
- SCREENtoWORLD(w_current, centerx, centery,
- &world_centerx, &world_centery);
- o_arc_rotate_world(w_current, world_centerx, world_centery, 90, object);
-#endif
-
- o_arc_rotate(w_current, centerx, centery, 90, object);
+ o_arc_rotate_world(w_current, centerx, centery, 90, object);
if (!w_current->DONT_REDRAW) {
o_arc_draw(w_current, object);
}
@@ -454,7 +448,7 @@
}
new_angle = (object->text->angle + 90) % 360;
- o_text_rotate(w_current, centerx, centery,
+ o_text_rotate_world(w_current, centerx, centery,
new_angle, 90, object);
if (!w_current->DONT_REDRAW) {
1.41.6.3 +14 -6 eda/geda/gaf/gschem/src/x_event.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_event.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_event.c,v
retrieving revision 1.41.6.2
retrieving revision 1.41.6.3
diff -u -b -r1.41.6.2 -r1.41.6.3
--- x_event.c 27 Dec 2006 19:21:37 -0000 1.41.6.2
+++ x_event.c 27 Dec 2006 19:56:42 -0000 1.41.6.3
@@ -431,10 +431,16 @@
case(ENDROTATEP):
prev_state = w_current->DONT_REDRAW;
w_current->DONT_REDRAW = 0;
- o_rotate_90(
+
+ SCREENtoWORLD( w_current,
+ (int) event->x,
+ (int) event->y,
+ &w_x, &w_y );
+
+ o_rotate_90_world(
w_current,
w_current->page_current->selection_list,
- (int) event->x, (int) event->y);
+ w_x, w_y);
w_current->DONT_REDRAW = prev_state;
w_current->inside_action = 0;
@@ -670,6 +676,7 @@
{
int prev_state;
int redraw_state;
+ int w_x, w_y;
exit_if_null(w_current);
global_window_current = w_current;
@@ -833,10 +840,11 @@
/* skip over head node */
redraw_state = w_current->DONT_REDRAW;
w_current->DONT_REDRAW = 1;
-
- o_rotate_90(w_current, w_current->page_current->complex_place_list,
+ SCREENtoWORLD( w_current,
fix_x(w_current, w_current->start_x),
- fix_y(w_current, w_current->start_y));
+ fix_y(w_current, w_current->start_y),
+ &w_x, &w_y );
+ o_rotate_90_world(w_current, w_current->page_current->complex_place_list, w_x, w_y );
w_current->DONT_REDRAW = redraw_state;
w_current->rotated_inside ++;
w_current->event_state = prev_state;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs