Permalink
Browse files

add more rip border textures.

  • Loading branch information...
1 parent 9d8461a commit cbe0ebacabd811158a4ee021880aa706b5c14c6e @hejiann committed Jun 8, 2012
Showing with 73 additions and 32 deletions.
  1. +6 −1 README
  2. +2 −1 install.sh
  3. +65 −30 rip-border.c
  4. BIN textures/art/14757.jpg
  5. BIN textures/art/14963.jpg
  6. BIN textures/{ → art}/15614.jpg
  7. BIN textures/art/15616.jpg
  8. BIN textures/{ → art}/200442.jpg
  9. BIN textures/{ → art}/200549.jpg
  10. BIN textures/{ → art}/200623.jpg
  11. BIN textures/{ → art}/200836.jpg
  12. BIN textures/border/12053.jpg
  13. BIN textures/border/12054.jpg
  14. BIN textures/border/12093.jpg
  15. BIN textures/border/12403.jpg
  16. BIN textures/border/12782.jpg
  17. BIN textures/border/15364.jpg
  18. BIN textures/border/15365.jpg
  19. BIN textures/border/15366.jpg
  20. BIN textures/border/15599.jpg
  21. BIN textures/border/15605.jpg
  22. BIN textures/border/15606.jpg
  23. BIN textures/border/15608.jpg
  24. BIN textures/border/15609.jpg
  25. BIN textures/border/15610.jpg
  26. BIN textures/border/15611.jpg
  27. BIN textures/flowers/12094.jpg
  28. BIN textures/flowers/12406.jpg
  29. BIN textures/flowers/12817.jpg
  30. BIN textures/flowers/12840.jpg
  31. BIN textures/flowers/14754.jpg
  32. BIN textures/flowers/14755.jpg
  33. BIN textures/flowers/14761.jpg
  34. BIN textures/flowers/14765.jpg
  35. BIN textures/flowers/14766.jpg
  36. BIN textures/flowers/14779.jpg
  37. BIN textures/flowers/14964.jpg
  38. BIN textures/flowers/15621.jpg
  39. BIN textures/{ → flowers}/15622.jpg
  40. BIN textures/{ → flowers}/15624.jpg
  41. BIN textures/{ → flowers}/15625.jpg
  42. BIN textures/lights/14776.jpg
  43. BIN textures/lights/14777.jpg
  44. BIN textures/lights/14778.jpg
  45. BIN textures/others/12356.jpg
  46. BIN textures/others/12357.jpg
  47. BIN textures/others/12402.jpg
  48. BIN textures/others/12811.jpg
  49. BIN textures/others/12813.jpg
  50. BIN textures/others/12815.jpg
  51. BIN textures/others/12859.jpg
  52. BIN textures/others/14772.jpg
  53. BIN textures/others/14774.jpg
  54. BIN textures/others/14775.jpg
  55. BIN textures/others/14911.jpg
  56. BIN textures/others/15612.jpg
  57. BIN textures/{ → others}/15613.jpg
  58. BIN textures/{ → others}/15623.jpg
  59. BIN textures/{ → others}/200287.jpg
  60. BIN textures/stars/12792.jpg
  61. BIN textures/stars/12799.jpg
  62. BIN textures/stars/12842.jpg
  63. BIN textures/stars/12843.jpg
  64. BIN textures/stars/12845.jpg
  65. BIN textures/stars/12847.jpg
  66. BIN textures/stars/12849.jpg
  67. BIN textures/stars/12851.jpg
  68. BIN textures/stars/12857.jpg
  69. BIN textures/{ → stars}/12858.jpg
  70. BIN textures/stars/14965.jpg
  71. BIN textures/stars/15617.jpg
  72. BIN textures/{ → stars}/15618.jpg
  73. BIN textures/{ → stars}/15619.jpg
  74. BIN textures/stars/15620.jpg
View
@@ -16,7 +16,12 @@ USING
GIMP menu: Tools -> Beautify -> Rip Border
-UPDATES
+UPDATE
+===================
+
+just running the install.sh to update.
+
+CHANGELOG
===================
2012-06-07
View
@@ -1,9 +1,10 @@
#!/bin/bash
TEXTURES="$HOME/textures"
+[ -d "$TEXTURES" ] && rm -rf $TEXTURES/*
[ -d "$TEXTURES" ] || mkdir -p "$TEXTURES"
-cp textures/* $TEXTURES/ -rf
+cp -rf textures/* $TEXTURES/
gimptool --install rip-border.c
View
@@ -22,6 +22,8 @@
#define PLUG_IN_BINARY "rip-border"
#define PLUG_IN_ROLE "gimp-rip-border"
+#define TEXTURE_PATH "textures"
+
#define PREVIEW_SIZE 480
#define THUMBNAIL_SIZE 80
@@ -253,6 +255,61 @@ opacity_update (GtkRange *range, gpointer data) {
preview_update (preview);
}
+void
+create_texture_page (GtkNotebook *notebook, const gchar* category, const gchar* path) {
+ GtkWidget *label = gtk_label_new (category);
+
+ GtkWidget *thispage = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (thispage), 12);
+ gtk_widget_show (thispage);
+
+ gint rows = 5;
+ gint cols = 3;
+ GtkWidget *table = gtk_table_new (rows, cols, FALSE);
+ gtk_table_set_col_spacings (GTK_TABLE (table), 6);
+ gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+ gtk_box_pack_start (GTK_BOX (thispage), table, FALSE, FALSE, 0);
+ gtk_widget_show (table);
+
+ gint row = 1;
+ gint col = 1;
+
+ GDir *dir = g_dir_open(path, 0, NULL);
+ if (dir)
+ {
+ const gchar *dir_ent;
+ while (dir_ent = g_dir_read_name(dir))
+ {
+ if (is_hidden (dir_ent))
+ continue;
+
+ gchar *filename = g_build_filename (path, dir_ent, NULL);
+ GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
+ pixbuf = gdk_pixbuf_scale_simple (pixbuf, THUMBNAIL_SIZE, THUMBNAIL_SIZE, GDK_INTERP_BILINEAR);
+ GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf);
+ GtkWidget *event_box = gtk_event_box_new ();
+ gtk_container_add (GTK_CONTAINER (event_box), image);
+ gtk_widget_show (image);
+ gtk_table_attach_defaults (GTK_TABLE (table), event_box, col - 1, col, row - 1, row);
+ gtk_widget_show (event_box);
+
+ col++;
+ if (col > cols)
+ {
+ row++;
+ col = 1;
+ }
+
+ g_signal_connect (event_box, "button_press_event", G_CALLBACK (select_texture), filename);
+
+ //g_free(filename);
+ }
+ g_dir_close (dir);
+ }
+
+ gtk_notebook_append_page_menu (notebook, thispage, label, NULL);
+}
+
static gboolean
rip_border_dialog ()
{
@@ -366,49 +423,27 @@ rip_border_dialog ()
gtk_box_pack_start (GTK_BOX (right_vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
- gint rows = 5;
- gint cols = 3;
- GtkWidget *table = gtk_table_new (rows, cols, FALSE);
- gtk_table_set_col_spacings (GTK_TABLE (table), 6);
- gtk_table_set_row_spacings (GTK_TABLE (table), 6);
- gtk_box_pack_start (GTK_BOX (right_vbox), table, FALSE, FALSE, 0);
- gtk_widget_show (table);
+ GtkWidget *notebook = gtk_notebook_new ();
+ gtk_box_pack_start (GTK_BOX (right_vbox), notebook, FALSE, FALSE, 0);
+ gtk_widget_show (notebook);
- gint row = 1;
- gint col = 1;
const gchar *home = g_get_home_dir();
- gchar *dirname = g_strconcat(home, "/textures", NULL);
+ //gchar *dirname = g_strconcat(home, TEXTURE_PATH, NULL);
+ gchar *dirname = g_build_filename(home, TEXTURE_PATH, NULL);
GDir *dir = g_dir_open(dirname, 0, NULL);
if (dir)
{
const gchar *dir_ent;
while (dir_ent = g_dir_read_name(dir))
{
- gchar *filename;
-
if (is_hidden (dir_ent))
continue;
- filename = g_build_filename (dirname, dir_ent, NULL);
-
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
- pixbuf = gdk_pixbuf_scale_simple (pixbuf, THUMBNAIL_SIZE, THUMBNAIL_SIZE, GDK_INTERP_BILINEAR);
- GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf);
- GtkWidget *event_box = gtk_event_box_new ();
- gtk_container_add (GTK_CONTAINER (event_box), image);
- gtk_widget_show (image);
- gtk_table_attach_defaults (GTK_TABLE (table), event_box, col - 1, col, row - 1, row);
- gtk_widget_show (event_box);
-
- col++;
- if (col > cols)
- {
- row++;
- col = 1;
+ gchar *filename = g_build_filename (dirname, dir_ent, NULL);
+ if (g_file_test(filename, G_FILE_TEST_IS_DIR)) {
+ create_texture_page (GTK_NOTEBOOK (notebook), dir_ent, filename);
}
- g_signal_connect (event_box, "button_press_event", G_CALLBACK (select_texture), filename);
-
//g_free(filename);
}
g_dir_close (dir);
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit cbe0eba

Please sign in to comment.