summaryrefslogtreecommitdiffstats
path: root/graphics/gcolor2
diff options
context:
space:
mode:
authorjylefort <jylefort@FreeBSD.org>2005-04-19 13:14:10 +0000
committerjylefort <jylefort@FreeBSD.org>2005-04-19 13:14:10 +0000
commit3e7c7389082b3c0688a37aa97aab533dfd75b277 (patch)
tree32fb919e92b9552c172073b2ec676b6dfca136d6 /graphics/gcolor2
parent5f2152bfb8a9b79d6b295d5b82b4f0399572e3f3 (diff)
downloadFreeBSD-ports-3e7c7389082b3c0688a37aa97aab533dfd75b277.zip
FreeBSD-ports-3e7c7389082b3c0688a37aa97aab533dfd75b277.tar.gz
Gcolor2 is a simple, standalone GTK+ 2.0 color selector.
PR: ports/80062 Submitted by: Piotr Smyrak <piotr.smyrak@heron.pl> Approved by: adamw (mentor)
Diffstat (limited to 'graphics/gcolor2')
-rw-r--r--graphics/gcolor2/Makefile28
-rw-r--r--graphics/gcolor2/distinfo2
-rw-r--r--graphics/gcolor2/files/gcolor2.desktop.in14
-rw-r--r--graphics/gcolor2/files/patch-src_callbacks.c98
-rw-r--r--graphics/gcolor2/files/patch-src_main.c26
-rw-r--r--graphics/gcolor2/pkg-descr3
-rw-r--r--graphics/gcolor2/pkg-plist5
7 files changed, 176 insertions, 0 deletions
diff --git a/graphics/gcolor2/Makefile b/graphics/gcolor2/Makefile
new file mode 100644
index 0000000..8121ba8
--- /dev/null
+++ b/graphics/gcolor2/Makefile
@@ -0,0 +1,28 @@
+# New ports collection makefile for: gcolor2
+# Date created: 18 April 2005
+# Whom: Piotr Smyrak, piotr.smyrak@heron.pl
+#
+# $FreeBSD$
+#
+
+PORTNAME= gcolor2
+PORTVERSION= 0.3
+CATEGORIES= graphics gnome
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+
+MAINTAINER= smyru@heron.pl
+COMMENT= A simple GTK+ 2.0 color selector
+
+USE_X_PREFIX= yes
+USE_GNOME= gtk20 gnomeprefix
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib"
+
+SUB_FILES= gcolor2.desktop
+
+post-install:
+ ${INSTALL_DATA} ${WRKDIR}/gcolor2.desktop ${PREFIX}/share/gnome/applications
+
+.include <bsd.port.mk>
diff --git a/graphics/gcolor2/distinfo b/graphics/gcolor2/distinfo
new file mode 100644
index 0000000..d42d9c6
--- /dev/null
+++ b/graphics/gcolor2/distinfo
@@ -0,0 +1,2 @@
+MD5 (gcolor2-0.3.tar.gz) = c247333e134b1e93132ab7568b9c0986
+SIZE (gcolor2-0.3.tar.gz) = 356892
diff --git a/graphics/gcolor2/files/gcolor2.desktop.in b/graphics/gcolor2/files/gcolor2.desktop.in
new file mode 100644
index 0000000..6713fbe
--- /dev/null
+++ b/graphics/gcolor2/files/gcolor2.desktop.in
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Color Selector
+Name[es]=Probador de colores
+Name[pl]=Próbnik kolorów
+Comment=Choose colors from palette or screen
+Comment[es]=Elige y proba colores de la gama de colores o la pantalla
+Comment[pl]=Wybiera kolory z palety lub ekranu
+Exec=gcolor2
+Icon=%%PREFIX%%/share/gnome/pixmaps/gcolor2/icon.png
+Terminal=false
+Type=Application
+Categories=GNOME;Application;Graphics;
+StartupNotify=true
diff --git a/graphics/gcolor2/files/patch-src_callbacks.c b/graphics/gcolor2/files/patch-src_callbacks.c
new file mode 100644
index 0000000..b6d75e4
--- /dev/null
+++ b/graphics/gcolor2/files/patch-src_callbacks.c
@@ -0,0 +1,98 @@
+--- src/callbacks.c.orig Tue Apr 19 00:37:37 2005
++++ src/callbacks.c Tue Apr 19 00:39:22 2005
+@@ -126,8 +126,9 @@
+
+ if (gtk_tree_selection_get_selected (selection, &model, &selection_iter))
+ {
++ GtkColorSelection *colorsel;
+ gtk_tree_model_get (model, &selection_iter, COLOR_VALUE, &color, COLOR_TYPE, &type, -1);
+- GtkColorSelection *colorsel = GTK_COLOR_SELECTION (lookup_widget (gcolor2, "colorselection1"));
++ colorsel = GTK_COLOR_SELECTION (lookup_widget (gcolor2, "colorselection1"));
+ gdk_color_parse (color, &new_color);
+
+ /* save the old color */
+@@ -249,9 +250,10 @@
+ on_save_button_clicked (GtkButton *button,
+ gpointer user_data)
+ {
++ gint result;
+ savedialog = create_save_dialog ();
+ gtk_window_set_transient_for (GTK_WINDOW (savedialog), GTK_WINDOW (gcolor2));
+- gint result = gtk_dialog_run (GTK_DIALOG (savedialog));
++ result = gtk_dialog_run (GTK_DIALOG (savedialog));
+ switch (result)
+ {
+ case GTK_RESPONSE_OK:
+@@ -269,18 +271,19 @@
+ save_selected_color ()
+ {
+ GtkWidget *entry = lookup_widget (savedialog, "entry1");
++ GtkTreeView *list;
++ FILE *fp;
++ gint r, g, b;
++ gchar old[512] = "";
+ colorname = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+ add_list_color (colorvalue, colorname, "user", TRUE);
+
+- GtkTreeView *list = GTK_TREE_VIEW (lookup_widget (gcolor2, "treeview1"));
++ list = GTK_TREE_VIEW (lookup_widget (gcolor2, "treeview1"));
+ gtk_tree_view_scroll_to_cell (list, gtk_tree_path_new_first (), NULL, FALSE, 0, 0);
+ gtk_tree_selection_select_path (gtk_tree_view_get_selection (list), gtk_tree_path_new_first ());
+
+
+ /* save color in user file - write at top of the file */
+- FILE *fp;
+- gint r, g, b;
+- gchar old[512] = "";
+
+ sscanf (colorvalue, "#%2x%2x%2x", &r, &g, &b);
+ fp = fopen (get_filename (), "r");
+@@ -307,8 +310,9 @@
+ gpointer user_data)
+ {
+ GtkWidget *deletedialog = create_delete_dialog ();
++ gint result;
+ gtk_window_set_transient_for (GTK_WINDOW (deletedialog), GTK_WINDOW (gcolor2));
+- gint result = gtk_dialog_run (GTK_DIALOG (deletedialog));
++ result = gtk_dialog_run (GTK_DIALOG (deletedialog));
+ switch (result)
+ {
+ case GTK_RESPONSE_OK:
+@@ -330,15 +334,22 @@
+
+ gchar *selection_color_name;
+ gchar *selection_color_value;
+- gtk_tree_model_get (model, &selection_iter, COLOR_VALUE, &selection_color_value, COLOR_NAME, &selection_color_name, -1);
+-
+-
+- /* remove from file */
++
+ FILE *fp;
+ gchar *p;
+ gchar buffer[512] = "";
+ gchar newstuff[512] = "";
+
++ gint r, g, b;
++ gchar *file_color_name;
++ gchar file_color_value[8];
++ gboolean found = FALSE;
++
++ gtk_tree_model_get (model, &selection_iter, COLOR_VALUE, &selection_color_value, COLOR_NAME, &selection_color_name, -1);
++
++
++ /* remove from file */
++
+ fp = fopen (get_filename (), "r");
+ if (fp == NULL)
+ {
+@@ -346,10 +357,6 @@
+ return;
+ }
+
+- gint r, g, b;
+- gchar *file_color_name;
+- gchar file_color_value[8];
+- gboolean found = FALSE;
+ while ((p = fgets (buffer, sizeof buffer, fp)) != NULL)
+ {
+ if (buffer[0] == '!')
diff --git a/graphics/gcolor2/files/patch-src_main.c b/graphics/gcolor2/files/patch-src_main.c
new file mode 100644
index 0000000..fd5bef1
--- /dev/null
+++ b/graphics/gcolor2/files/patch-src_main.c
@@ -0,0 +1,26 @@
+--- src/main.c.orig Tue Oct 19 07:37:18 2004
++++ src/main.c Tue Apr 19 00:37:09 2005
+@@ -17,8 +17,9 @@
+ get_filename()
+ {
+ gchar buf[50];
++ gchar* file;
+ g_sprintf (buf, "%s/.rgb.txt", getenv ("HOME"));
+- gchar* file = g_strdup (buf);
++ file = g_strdup (buf);
+ return file;
+ }
+
+@@ -48,10 +49,11 @@
+ "................"
+ };
+ gchar colorline[] = ". c #FFFFFF";
++ GdkPixbuf *buf;
+
+ g_sprintf (colorline, ". c %s", g_ascii_strup (spec, -1));
+ swatchxpm[1] = colorline;
+- GdkPixbuf *buf = gdk_pixbuf_new_from_xpm_data ((gchar const **)swatchxpm);
++ buf = gdk_pixbuf_new_from_xpm_data ((gchar const **)swatchxpm);
+
+ if (is_top)
+ gtk_list_store_prepend (liststore, &iter);
diff --git a/graphics/gcolor2/pkg-descr b/graphics/gcolor2/pkg-descr
new file mode 100644
index 0000000..a7a9fd9
--- /dev/null
+++ b/graphics/gcolor2/pkg-descr
@@ -0,0 +1,3 @@
+Gcolor2 is a simple, standalone GTK+ 2.0 color selector.
+
+WWW: http://gcolor2.sourceforge.net/
diff --git a/graphics/gcolor2/pkg-plist b/graphics/gcolor2/pkg-plist
new file mode 100644
index 0000000..e565e47
--- /dev/null
+++ b/graphics/gcolor2/pkg-plist
@@ -0,0 +1,5 @@
+bin/gcolor2
+share/gnome/applications/gcolor2.desktop
+share/gnome/pixmaps/gcolor2/about_icon.png
+share/gnome/pixmaps/gcolor2/icon.png
+@dirrm share/gnome/pixmaps/gcolor2
OpenPOWER on IntegriCloud