Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
darcs-hash:20070824050107-7ae4f-ca1811ec96f839715b18fcce6a9facfd4af0b1ce.gz
  • Loading branch information
Ricardo Markiewicz committed Aug 24, 2007
1 parent 1c821be commit 546484c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 86 deletions.
33 changes: 8 additions & 25 deletions src/sheet/part-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ static void part_item_destroy(GtkObject *object);
static void part_item_moved(SheetItem *sheet_item);

static void edit_properties (SheetItem *object);
static void properties_cmd (GtkWidget *widget, SchematicView *sv);

static void selection_changed (PartItem *item, gboolean select,
gpointer user_data);
Expand Down Expand Up @@ -122,6 +121,7 @@ struct _PartItemPriv {
typedef struct {
GtkDialog *dialog;
PartItem *part_item;

/* List of GtkEntry's */
GList *widgets;
} PartPropDialog;
Expand Down Expand Up @@ -183,6 +183,8 @@ GtkAnchorType part_item_get_anchor_from_part (Part *part)
return GTK_ANCHOR_SOUTH_WEST;
if ((anchor_v == ANCHOR_EAST) && (anchor_h == ANCHOR_SOUTH))
return GTK_ANCHOR_SOUTH_EAST;

return GTK_ANCHOR_SOUTH_EAST;
}

GType
Expand Down Expand Up @@ -212,7 +214,6 @@ part_item_get_type ()
static void
part_item_class_init (PartItemClass *part_item_class)
{
GError *error = NULL;
GObjectClass *object_class;
GtkObjectClass *gtk_object_class;
SheetItemClass *sheet_item_class;
Expand Down Expand Up @@ -498,7 +499,7 @@ part_item_update_node_label (PartItem *item)
{
PartItemPriv *priv;
Part *part;
GSList *labels, *label_items;
GSList *labels;
GnomeCanvasItem *canvas_item;
Pin *pins;
gint num_pins, i;
Expand Down Expand Up @@ -578,10 +579,9 @@ static void
edit_properties_punta (PartItem *item)
{
GSList *properties;
Sheet *sheet;
PartItemPriv *priv;
Part *part;
char *msg, *value, *name;
char *msg;
GladeXML *gui;
GtkRadioButton *radio_v, *radio_c;
GtkRadioButton *ac_r, *ac_m, *ac_i, *ac_p;
Expand Down Expand Up @@ -708,16 +708,15 @@ static void
edit_properties (SheetItem *object)
{
GSList *properties;
Sheet *sheet;
PartItem *item;
PartItemPriv *priv;
Part *part;
char *internal, *msg, *value, *name;
char *internal, *msg;
GladeXML *gui;
GtkTable *prop_table;
GtkNotebook *notebook;
gint response, y = 0;
gboolean got_iter, has_model;
gboolean has_model;
gchar *model_name = NULL;

g_return_if_fail (object != NULL);
Expand Down Expand Up @@ -853,29 +852,15 @@ edit_properties (SheetItem *object)
gtk_widget_destroy (GTK_WIDGET (prop_dialog->dialog));
}

static void
properties_cmd (GtkWidget *widget, SchematicView *sv)
{
GList *list;

list = schematic_view_get_selection (sv);
if ((list != NULL) && IS_PART_ITEM (list->data))
edit_properties (list->data);
}

static void
part_rotated_callback (ItemData *data, int angle, SheetItem *sheet_item)
{
double affine[6];
double x1, y1, x2, y2, x0, y0;
double left, top, right, bottom, dx, dy;
GList *list;
GSList *label_items;
GtkAnchorType anchor;
ArtPoint src, dst;
GnomeCanvasGroup *group;
GnomeCanvasItem *canvas_item;
ArtPoint *old = NULL;
PartItem *item;
PartItemPriv *priv;
Part *part;
Expand Down Expand Up @@ -957,9 +942,7 @@ part_flipped_callback (ItemData *data, gboolean horizontal,
PartItemPriv *priv;
Part *part;
IDFlip flip;
double affine[6], x1, y1, x2, y2, left, top, right, bottom;
ArtPoint src, dst;
gdouble text_heigth, text_width;
double affine[6];

g_return_if_fail (sheet_item != NULL);
g_return_if_fail (IS_PART_ITEM (sheet_item));
Expand Down
64 changes: 3 additions & 61 deletions src/sheet/sheet-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ sheet_item_set_property (GObject *object, guint prop_id, const GValue *value,
{
SheetItem *sheet_item;
SheetPos pos;
GError *error = NULL;

sheet_item = SHEET_ITEM (object);

Expand Down Expand Up @@ -303,60 +302,6 @@ sheet_item_destroy (GtkObject *object)
}
}

static void
copy_cmd (GtkWidget *widget, SchematicView *sv)
{
g_return_if_fail (sv != NULL);
g_return_if_fail (IS_SCHEMATIC_VIEW (sv));

schematic_view_copy_selection (sv);
}

static void
cut_cmd (GtkWidget *widget, SchematicView *sv)
{
g_return_if_fail (sv != NULL);
g_return_if_fail (IS_SCHEMATIC_VIEW (sv));

schematic_view_cut_selection (sv);
}

static void
delete_cmd (GtkWidget *widget, SchematicView *sv)
{
g_return_if_fail (sv != NULL);
g_return_if_fail (IS_SCHEMATIC_VIEW (sv));

schematic_view_delete_selection (sv);
}

static void
rotate_cmd (GtkWidget *widget, SchematicView *sv)
{
g_return_if_fail (sv != NULL);
g_return_if_fail (IS_SCHEMATIC_VIEW (sv));

schematic_view_rotate_selection (sv);
}

static void
flip_horizontal_cmd (GtkWidget *widget, SchematicView *sv)
{
g_return_if_fail (sv != NULL);
g_return_if_fail (IS_SCHEMATIC_VIEW (sv));

schematic_view_flip_selection (sv, TRUE);
}

static void
flip_vertical_cmd (GtkWidget *widget, SchematicView *sv)
{
g_return_if_fail (sv != NULL);
g_return_if_fail (IS_SCHEMATIC_VIEW (sv));

schematic_view_flip_selection (sv, FALSE);
}

static void
sheet_item_run_menu (SheetItem *item, SchematicView *sv, GdkEventButton *event)
{
Expand Down Expand Up @@ -422,7 +367,7 @@ sheet_item_event (SheetItem *sheet_item, const GdkEvent *event, SchematicView *s
static double bb_x1, bb_y1, bb_x2, bb_y2;
int cx1, cy1, cx2, cy2;
/* The sheet's width and the its viewport's width. */
int sheet_width, sheet_height;
guint sheet_width, sheet_height;

g_return_val_if_fail (sheet_item != NULL, FALSE);
g_return_val_if_fail (IS_SHEET_ITEM (sheet_item), FALSE);
Expand Down Expand Up @@ -798,7 +743,7 @@ sheet_item_floating_event (Sheet *sheet, const GdkEvent *event, SchematicView *s
int cx1, cy1, cx2, cy2;

/* The sheet's width and the its viewport's width. */
int sheet_width, sheet_height;
guint sheet_width, sheet_height;

g_return_val_if_fail (sheet != NULL, FALSE);
g_return_val_if_fail (IS_SHEET (sheet), FALSE);
Expand Down Expand Up @@ -1109,10 +1054,7 @@ sheet_item_reparent (SheetItem *object, GnomeCanvasGroup *group)

gnome_canvas_item_reparent (GNOME_CANVAS_ITEM (object), group);

g_object_get (G_OBJECT (object),
"x", &x2,
"y", &y2,
NULL);
g_object_get (G_OBJECT (object), "x", &x2, "y", &y2, NULL);

gnome_canvas_item_i2w (GNOME_CANVAS_ITEM (object), &x2, &y2);

Expand Down

0 comments on commit 546484c

Please sign in to comment.