r5383 - trunk/eda/fped
werner at docs.openmoko.org
werner at docs.openmoko.org
Tue Aug 4 09:24:13 CEST 2009
Author: werner
Date: 2009-08-04 09:24:13 +0200 (Tue, 04 Aug 2009)
New Revision: 5383
Added:
trunk/eda/fped/gui_tools.c
trunk/eda/fped/gui_tools.h
Removed:
trunk/eda/fped/gui_icons.c
trunk/eda/fped/gui_icons.h
Modified:
trunk/eda/fped/Makefile
trunk/eda/fped/gui.c
Log:
- renamed gui_icons to gui_tools
Modified: trunk/eda/fped/Makefile
===================================================================
--- trunk/eda/fped/Makefile 2009-08-04 07:04:36 UTC (rev 5382)
+++ trunk/eda/fped/Makefile 2009-08-04 07:24:13 UTC (rev 5383)
@@ -14,7 +14,7 @@
unparse.o \
cpp.o lex.yy.o y.tab.o \
gui.o gui_util.o gui_style.o gui_inst.o gui_status.o gui_canvas.o \
- gui_icons.o
+ gui_tools.o
XPMS = point.xpm vec.xpm frame.xpm \
line.xpm rect.xpm pad.xpm circ.xpm arc.xpm meas.xpm
@@ -95,7 +95,7 @@
y.tab.o: y.tab.c
$(CC) -c $(CFLAGS) $(SLOPPY) y.tab.c
-gui_icons.o: $(XPMS:%=icons/%)
+gui_tools.o: $(XPMS:%=icons/%)
# ----- Dependencies ----------------------------------------------------------
Modified: trunk/eda/fped/gui.c
===================================================================
--- trunk/eda/fped/gui.c 2009-08-04 07:04:36 UTC (rev 5382)
+++ trunk/eda/fped/gui.c 2009-08-04 07:24:13 UTC (rev 5383)
@@ -24,7 +24,7 @@
#include "gui_style.h"
#include "gui_status.h"
#include "gui_canvas.h"
-#include "gui_icons.h"
+#include "gui_tools.h"
#include "gui.h"
@@ -610,7 +610,7 @@
static void make_center_area(GtkWidget *vbox)
{
GtkWidget *hbox, *frames_area, *paned;
- GtkWidget *icons;
+ GtkWidget *tools;
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
@@ -638,8 +638,8 @@
/* Icon bar */
- icons = gui_setup_icons(root->window);
- gtk_box_pack_end(GTK_BOX(hbox), icons, FALSE, FALSE, 0);
+ tools = gui_setup_tools(root->window);
+ gtk_box_pack_end(GTK_BOX(hbox), tools, FALSE, FALSE, 0);
}
Deleted: trunk/eda/fped/gui_icons.c
===================================================================
--- trunk/eda/fped/gui_icons.c 2009-08-04 07:04:36 UTC (rev 5382)
+++ trunk/eda/fped/gui_icons.c 2009-08-04 07:24:13 UTC (rev 5383)
@@ -1,87 +0,0 @@
-/*
- * gui_icons.c - GUI, icon bar
- *
- * Written 2009 by Werner Almesberger
- * Copyright 2009 by Werner Almesberger
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-
-#include <gtk/gtk.h>
-
-#include "gui_util.h"
-#include "gui_icons.h"
-
-
-#include "icons/arc.xpm"
-#include "icons/circ.xpm"
-#include "icons/frame.xpm"
-#include "icons/line.xpm"
-#include "icons/meas.xpm"
-#include "icons/pad.xpm"
-#include "icons/point.xpm"
-#include "icons/rect.xpm"
-#include "icons/vec.xpm"
-
-
-static GtkToolItem *icon_button(GtkWidget *bar, GdkDrawable *drawable,
- char **xpm, GtkToolItem *last)
-{
- GdkPixmap *pixmap;
- GtkWidget *image;
- GtkToolItem *item;
-
- pixmap = gdk_pixmap_create_from_xpm_d(drawable, NULL, NULL, xpm);
- image = gtk_image_new_from_pixmap(pixmap, NULL);
-
-/*
- * gtk_radio_tool_button_new_from_widget is *huge*. we try to do things in a
- * more compact way.
- */
-#if 0
- if (last)
- item = gtk_radio_tool_button_new_from_widget(
- GTK_RADIO_TOOL_BUTTON(last));
- else
- item = gtk_radio_tool_button_new(NULL);
- gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(item), image);
-#else
- item = gtk_tool_item_new();
- gtk_container_add(GTK_CONTAINER(item), image);
-
- gtk_container_set_border_width(GTK_CONTAINER(item), 1);
-#endif
-
- gtk_toolbar_insert(GTK_TOOLBAR(bar), item, -1);
-
- return item;
-}
-
-
-GtkWidget *gui_setup_icons(GdkDrawable *drawable)
-{
- GtkWidget *bar;
- GtkToolItem *last;
-
- bar = gtk_toolbar_new();
- gtk_toolbar_set_style(GTK_TOOLBAR(bar), GTK_TOOLBAR_ICONS);
- gtk_toolbar_set_orientation(GTK_TOOLBAR(bar),
- GTK_ORIENTATION_VERTICAL);
-//gtk_container_set_border_width(GTK_CONTAINER(bar), 5);
-
- last = icon_button(bar, drawable, xpm_point, NULL);
- last = icon_button(bar, drawable, xpm_vec, last);
- last = icon_button(bar, drawable, xpm_frame, last);
- last = icon_button(bar, drawable, xpm_pad, last);
- last = icon_button(bar, drawable, xpm_line, last);
- last = icon_button(bar, drawable, xpm_rect, last);
- last = icon_button(bar, drawable, xpm_circ, last);
- last = icon_button(bar, drawable, xpm_arc, last);
- last = icon_button(bar, drawable, xpm_meas, last);
-
- return bar;
-}
Deleted: trunk/eda/fped/gui_icons.h
===================================================================
--- trunk/eda/fped/gui_icons.h 2009-08-04 07:04:36 UTC (rev 5382)
+++ trunk/eda/fped/gui_icons.h 2009-08-04 07:24:13 UTC (rev 5383)
@@ -1,22 +0,0 @@
-/*
- * gui_icons.h - GUI, icon bar
- *
- * Written 2009 by Werner Almesberger
- * Copyright 2009 by Werner Almesberger
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-
-#ifndef GUI_ICONS_H
-#define GUI_ICONS_H
-
-#include <gtk/gtk.h>
-
-
-GtkWidget *gui_setup_icons(GdkDrawable *drawable);
-
-#endif /* !GUI_ICONS_H */
Copied: trunk/eda/fped/gui_tools.c (from rev 5379, trunk/eda/fped/gui_icons.c)
===================================================================
--- trunk/eda/fped/gui_tools.c (rev 0)
+++ trunk/eda/fped/gui_tools.c 2009-08-04 07:24:13 UTC (rev 5383)
@@ -0,0 +1,87 @@
+/*
+ * gui_tools.c - GUI, tool bar
+ *
+ * Written 2009 by Werner Almesberger
+ * Copyright 2009 by Werner Almesberger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+
+#include <gtk/gtk.h>
+
+#include "gui_util.h"
+#include "gui_tools.h"
+
+
+#include "icons/arc.xpm"
+#include "icons/circ.xpm"
+#include "icons/frame.xpm"
+#include "icons/line.xpm"
+#include "icons/meas.xpm"
+#include "icons/pad.xpm"
+#include "icons/point.xpm"
+#include "icons/rect.xpm"
+#include "icons/vec.xpm"
+
+
+static GtkToolItem *tool_button(GtkWidget *bar, GdkDrawable *drawable,
+ char **xpm, GtkToolItem *last)
+{
+ GdkPixmap *pixmap;
+ GtkWidget *image;
+ GtkToolItem *item;
+
+ pixmap = gdk_pixmap_create_from_xpm_d(drawable, NULL, NULL, xpm);
+ image = gtk_image_new_from_pixmap(pixmap, NULL);
+
+/*
+ * gtk_radio_tool_button_new_from_widget is *huge*. we try to do things in a
+ * more compact way.
+ */
+#if 0
+ if (last)
+ item = gtk_radio_tool_button_new_from_widget(
+ GTK_RADIO_TOOL_BUTTON(last));
+ else
+ item = gtk_radio_tool_button_new(NULL);
+ gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(item), image);
+#else
+ item = gtk_tool_item_new();
+ gtk_container_add(GTK_CONTAINER(item), image);
+
+ gtk_container_set_border_width(GTK_CONTAINER(item), 1);
+#endif
+
+ gtk_toolbar_insert(GTK_TOOLBAR(bar), item, -1);
+
+ return item;
+}
+
+
+GtkWidget *gui_setup_tools(GdkDrawable *drawable)
+{
+ GtkWidget *bar;
+ GtkToolItem *last;
+
+ bar = gtk_toolbar_new();
+ gtk_toolbar_set_style(GTK_TOOLBAR(bar), GTK_TOOLBAR_ICONS);
+ gtk_toolbar_set_orientation(GTK_TOOLBAR(bar),
+ GTK_ORIENTATION_VERTICAL);
+//gtk_container_set_border_width(GTK_CONTAINER(bar), 5);
+
+ last = tool_button(bar, drawable, xpm_point, NULL);
+ last = tool_button(bar, drawable, xpm_vec, last);
+ last = tool_button(bar, drawable, xpm_frame, last);
+ last = tool_button(bar, drawable, xpm_pad, last);
+ last = tool_button(bar, drawable, xpm_line, last);
+ last = tool_button(bar, drawable, xpm_rect, last);
+ last = tool_button(bar, drawable, xpm_circ, last);
+ last = tool_button(bar, drawable, xpm_arc, last);
+ last = tool_button(bar, drawable, xpm_meas, last);
+
+ return bar;
+}
Copied: trunk/eda/fped/gui_tools.h (from rev 5379, trunk/eda/fped/gui_icons.h)
===================================================================
--- trunk/eda/fped/gui_tools.h (rev 0)
+++ trunk/eda/fped/gui_tools.h 2009-08-04 07:24:13 UTC (rev 5383)
@@ -0,0 +1,22 @@
+/*
+ * gui_tools.h - GUI, tool bar
+ *
+ * Written 2009 by Werner Almesberger
+ * Copyright 2009 by Werner Almesberger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+
+#ifndef GUI_TOOLS_H
+#define GUI_TOOLS_H
+
+#include <gtk/gtk.h>
+
+
+GtkWidget *gui_setup_tools(GdkDrawable *drawable);
+
+#endif /* !GUI_TOOLS_H */
More information about the commitlog
mailing list