[dia: 6/105] #19: Standardize icon names & add pixmaps/meson.build.
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia: 6/105] #19: Standardize icon names & add pixmaps/meson.build.
- Date: Mon, 28 Jan 2019 19:19:49 +0000 (UTC)
commit 942857405262775d2c4792b9447c006898148b03
Author: Eduard Nicodei <eddnicodei gmail com>
Date: Mon Dec 17 00:35:33 2018 +0000
#19: Standardize icon names & add pixmaps/meson.build.
- This will help with porting icon csource generation to meson.
app/Makefile.am | 20 ++++++++++----------
app/cursor.c | 10 +++++-----
app/menus.c | 10 +++++-----
app/pixmaps/meson.build | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
lib/Makefile.am | 2 +-
lib/meson.build | 21 +--------------------
lib/pixmaps/meson.build | 15 +++++++++++++++
lib/standard-path.c | 2 +-
meson.build | 5 +++--
9 files changed, 91 insertions(+), 44 deletions(-)
---
diff --git a/app/Makefile.am b/app/Makefile.am
index e924a263..6f208eb2 100644
--- a/app/Makefile.am
+++ b/app/Makefile.am
@@ -46,17 +46,17 @@ ICON_PNG_PAIRS= \
dia_diagram_icon $(srcdir)/pixmaps/dia-diagram.png \
dia_app_icon $(srcdir)/pixmaps/dia-app.png \
\
- dia_objects_layer_above $(srcdir)/pixmaps/objects-layer-above.png \
- dia_objects_layer_below $(srcdir)/pixmaps/objects-layer-below.png \
- dia_layers $(srcdir)/pixmaps/layers.png \
- dia_layer_add $(srcdir)/pixmaps/layer-add.png \
- dia_layer_rename $(srcdir)/pixmaps/layer-rename.png \
+ dia_objects_layer_above_icon $(srcdir)/pixmaps/objects-layer-above.png \
+ dia_objects_layer_below_icon $(srcdir)/pixmaps/objects-layer-below.png \
+ dia_layers_icon $(srcdir)/pixmaps/layers.png \
+ dia_layer_add_icon $(srcdir)/pixmaps/layer-add.png \
+ dia_layer_rename_icon $(srcdir)/pixmaps/layer-rename.png \
\
- dia_cursor_create $(srcdir)/pixmaps/cursor-create.png \
- dia_cursor_hand_open $(srcdir)/pixmaps/cursor-hand-open.png \
- dia_cursor_hand_closed $(srcdir)/pixmaps/cursor-hand-closed.png \
- dia_cursor_magnify_minus $(srcdir)/pixmaps/cursor-magnify-minus.png \
- dia_cursor_magnify_plus $(srcdir)/pixmaps/cursor-magnify-plus.png
+ dia_cursor_create_icon $(srcdir)/pixmaps/cursor-create.png \
+ dia_cursor_hand_open_icon $(srcdir)/pixmaps/cursor-hand-open.png \
+ dia_cursor_hand_closed_icon $(srcdir)/pixmaps/cursor-hand-closed.png \
+ dia_cursor_magnify_minus_icon $(srcdir)/pixmaps/cursor-magnify-minus.png \
+ dia_cursor_magnify_plus_icon $(srcdir)/pixmaps/cursor-magnify-plus.png
ICON_PNGS= \
diff --git a/app/cursor.c b/app/cursor.c
index 54f0549e..4dd45ade 100644
--- a/app/cursor.c
+++ b/app/cursor.c
@@ -38,20 +38,20 @@ static struct {
} cursors[MAX_CURSORS] = {
{ GDK_LEFT_PTR }, /* CURSOR_POINT */
{ DIA_CURSOR, /* CURSOR_CREATE */
- dia_cursor_create,
+ dia_cursor_create_icon,
0, 0},
{ GDK_FLEUR }, /* CURSOR_SCROLL */
{ DIA_CURSOR, /* CURSOR_GRAB */
- dia_cursor_hand_open,
+ dia_cursor_hand_open_icon,
10, 10 },
{ DIA_CURSOR, /* CURSOR_GRABBING */
- dia_cursor_hand_closed,
+ dia_cursor_hand_closed_icon,
10, 10 },
{ DIA_CURSOR, /* CURSOR_ZOOM_OUT */
- dia_cursor_magnify_minus,
+ dia_cursor_magnify_minus_icon,
8, 8 },
{ DIA_CURSOR, /* CURSOR_ZOOM_IN */
- dia_cursor_magnify_plus,
+ dia_cursor_magnify_plus_icon,
8, 8 },
{ GDK_CROSS_REVERSE }, /* CURSOR_CONNECT */
{ GDK_XTERM }, /* CURSOR_XTERM */
diff --git a/app/menus.c b/app/menus.c
index b39bb73d..a12bb51d 100644
--- a/app/menus.c
+++ b/app/menus.c
@@ -815,11 +815,11 @@ register_stock_icons (void)
_add_stock_icon (factory, DIA_STOCK_GROUP, dia_group_icon, sizeof(dia_group_icon));
_add_stock_icon (factory, DIA_STOCK_UNGROUP, dia_ungroup_icon, sizeof(dia_ungroup_icon));
- _add_stock_icon (factory, DIA_STOCK_LAYER_ADD, dia_layer_add, sizeof(dia_layer_add));
- _add_stock_icon (factory, DIA_STOCK_LAYER_RENAME, dia_layer_rename, sizeof(dia_layer_rename));
- _add_stock_icon (factory, DIA_STOCK_OBJECTS_LAYER_ABOVE, dia_objects_layer_above,
sizeof(dia_objects_layer_above));
- _add_stock_icon (factory, DIA_STOCK_OBJECTS_LAYER_BELOW, dia_objects_layer_below,
sizeof(dia_objects_layer_below));
- _add_stock_icon (factory, DIA_STOCK_LAYERS, dia_layers, sizeof(dia_layers));
+ _add_stock_icon (factory, DIA_STOCK_LAYER_ADD, dia_layer_add_icon, sizeof(dia_layer_add_icon));
+ _add_stock_icon (factory, DIA_STOCK_LAYER_RENAME, dia_layer_rename_icon, sizeof(dia_layer_rename_icon));
+ _add_stock_icon (factory, DIA_STOCK_OBJECTS_LAYER_ABOVE, dia_objects_layer_above_icon,
sizeof(dia_objects_layer_above_icon));
+ _add_stock_icon (factory, DIA_STOCK_OBJECTS_LAYER_BELOW, dia_objects_layer_below_icon,
sizeof(dia_objects_layer_below_icon));
+ _add_stock_icon (factory, DIA_STOCK_LAYERS, dia_layers_icon, sizeof(dia_layers_icon));
gtk_icon_factory_add_default (factory);
g_object_unref (factory);
diff --git a/app/pixmaps/meson.build b/app/pixmaps/meson.build
new file mode 100644
index 00000000..ef8319ba
--- /dev/null
+++ b/app/pixmaps/meson.build
@@ -0,0 +1,50 @@
+icons = [ 'connectable.png',
+ 'connectable-empty.png',
+ 'selectable.png',
+ 'selectable-empty.png',
+ 'on-grid.png',
+ 'off-grid.png',
+ 'visible.png',
+ 'visible-empty.png',
+ 'group.png',
+ 'ungroup.png',
+ 'mainpoints-on.png',
+ 'mainpoints-off.png',
+
+
+ 'objects-layer-above.png',
+ 'objects-layer-below.png',
+ 'layers.png',
+ 'layer-add.png',
+ 'layer-rename.png',
+
+ 'cursor-create.png',
+ 'cursor-hand-open.png',
+ 'cursor-hand-closed.png',
+ 'cursor-magnify-minus.png',
+ 'cursor-magnify-plus.png' ]
+
+#FIXME: this is duplicated from lib/pixmaps. Any way to remove this duplication?
+icon_pairs = []
+foreach icon_file : icons
+ icon_pairs += ['dia_' + icon_file.split('.')[0].underscorify() + '_icon', files(icon_file)]
+endforeach
+
+# Add a few custom ones.
+icon_pairs += [
+ 'dia_modify_tool_icon', files('arrow-22.png'),
+ 'dia_scroll_tool_icon', files('scroll-22.png'),
+ 'dia_textedit_tool_icon', files('textedit-22.png'),
+ 'dia_zoom_tool_icon', files('zoom-22.png'),
+ 'dia_diagram_icon', files('dia-diagram.png'),
+ 'dia_app_icon', files('dia-app.png')
+]
+
+dia_app_icons_h = custom_target(
+ 'dia-app-icons.h',
+ output : 'dia-app-icons.h',
+ capture : true,
+ command : [ gdk_pixbuf_csource,
+ '--raw',
+ '--build-list',
+ icon_pairs ])
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 48bfccc7..9e8a2cd9 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -47,7 +47,7 @@ ICON_PNG_PAIRS= \
dia_broken_icon $(srcdir)/pixmaps/broken.png \
dia_broken_chain_icon $(srcdir)/pixmaps/broken-chain.png \
dia_unbroken_chain_icon $(srcdir)/pixmaps/unbroken-chain.png \
- stdpath_icon $(srcdir)/pixmaps/standard-path.png
+ dia_standard_path_icon $(srcdir)/pixmaps/standard-path.png
# there is probably some smarter way than duplicating this
# but having the right dependecy for dia-lib-icons.h was
diff --git a/lib/meson.build b/lib/meson.build
index f012bda5..6f960d1e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -214,26 +214,7 @@ diamarshal_h = custom_target(
'--header',
'@INPUT@'])
-# Generate csource for the icons.
-#TODO: the left-hand names should be extracted from the filenames.
-# (something like 'dia_BASEFILENAME_icon')
-icon_png_pairs = [ ['dia_broken_icon' , files('pixmaps/broken.png')],
- ['dia_broken_chain_icon' , files('pixmaps/broken-chain.png')],
- ['dia_unbroken_chain_icon', files('pixmaps/unbroken-chain.png')],
- ['stdpath_icon' , files('pixmaps/standard-path.png')] ]
-
-icon_pngs = []
-foreach name_source_pair : icon_png_pairs
- icon_pngs += name_source_pair[1]
-endforeach
-
-dia_lib_icons_h = custom_target(
- 'dia-lib-icons.h',
- output : 'dia-lib-icons.h',
- capture : true,
- command : [ find_program('gdk-pixbuf-csource'),
- '--build-list',
- icon_png_pairs])
+subdir('pixmaps')
libdia_deps = [
libgtk_dep,
diff --git a/lib/pixmaps/meson.build b/lib/pixmaps/meson.build
new file mode 100644
index 00000000..567ce4a8
--- /dev/null
+++ b/lib/pixmaps/meson.build
@@ -0,0 +1,15 @@
+# Generate csource for the icons.
+icons = [ 'broken.png', 'broken-chain.png', 'unbroken-chain.png', 'standard-path.png' ]
+
+icon_pairs = []
+foreach icon_file : icons
+ icon_pairs += ['dia_' + icon_file.split('.')[0].underscorify() + '_icon', files(icon_file)]
+endforeach
+
+dia_lib_icons_h = custom_target(
+ 'dia-lib-icons.h',
+ output : 'dia-lib-icons.h',
+ capture : true,
+ command : [ gdk_pixbuf_csource,
+ '--build-list',
+ icon_pairs])
diff --git a/lib/standard-path.c b/lib/standard-path.c
index 23224fc2..f44a7528 100644
--- a/lib/standard-path.c
+++ b/lib/standard-path.c
@@ -161,7 +161,7 @@ DiaObjectType stdpath_type =
{
"Standard - Path", /* name */
0, /* version */
- (const char **) stdpath_icon, /* pixmap */
+ (const char **) dia_standard_path_icon, /* pixmap */
&stdpath_type_ops, /* ops */
NULL, /* pixmap_file */
diff --git a/meson.build b/meson.build
index df91b81d..f9b0c702 100644
--- a/meson.build
+++ b/meson.build
@@ -17,6 +17,8 @@ libglib_dep = dependency('glib-2.0', version : '>= 2.20.0')
libxml_dep = dependency('libxml-2.0')
gmodule_dep = dependency('gmodule-2.0')
+# Used in pixmap csource generation.
+gdk_pixbuf_csource = find_program('gdk-pixbuf-csource')
# TODO
#AC_PROG_INSTALL
#AC_PROG_LN_S
@@ -57,6 +59,5 @@ configure_file(output : 'config.h',
configuration : conf)
configuration_inc = include_directories('.')
-subdir('lib')
-
+subdir('lib')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]