[dia/zbrown/gresource-icons: 4/12] First set of icons from app as resources
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia/zbrown/gresource-icons: 4/12] First set of icons from app as resources
- Date: Fri, 1 Mar 2019 23:37:18 +0000 (UTC)
commit 090ad4d2f44c15cfa2334daafb48137d2fb4b298
Author: Zander Brown <zbrown gnome org>
Date: Sun Feb 10 22:31:30 2019 +0000
First set of icons from app as resources
app/app_procs.c | 3 +-
app/dia.gresource.xml | 9 ++
app/diagram_tree_view.c | 26 ++--
.../off-grid.png => icons/dia-grid-off.png} | Bin
app/{pixmaps/on-grid.png => icons/dia-grid-on.png} | Bin
app/{pixmaps/group.png => icons/dia-group.png} | Bin
app/icons/org.gnome.Dia.png | Bin 0 -> 3344 bytes
app/interface.c | 102 +++++++-------
app/menus.c | 154 ++++++++++-----------
app/meson.build | 6 +-
app/pixmaps/dia-app.png | Bin 2565 -> 0 bytes
app/pixmaps/meson.build | 6 +-
12 files changed, 157 insertions(+), 149 deletions(-)
---
diff --git a/app/app_procs.c b/app/app_procs.c
index ba75fa6f..7604482c 100644
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -768,9 +768,8 @@ app_init (int argc, char **argv)
*/
/* Set the icon for Dia windows & dialogs */
- /* MESON: Use GResource */
/* GTK3: Use icon-name with GResource fallback */
- pixbuf = gdk_pixbuf_new_from_inline (-1, dia_app_icon, FALSE, NULL);
+ pixbuf = pixbuf_from_resource ("/org/gnome/Dia/icons/org.gnome.Dia.png");
if (pixbuf) {
gtk_window_set_default_icon (pixbuf);
g_object_unref (pixbuf);
diff --git a/app/dia.gresource.xml b/app/dia.gresource.xml
new file mode 100644
index 00000000..ef5464c0
--- /dev/null
+++ b/app/dia.gresource.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/Dia">
+ <file>icons/org.gnome.Dia.png</file>
+ <file>icons/dia-group.png</file>
+ <file>icons/dia-grid-on.png</file>
+ <file>icons/dia-grid-off.png</file>
+ </gresource>
+</gresources>
\ No newline at end of file
diff --git a/app/diagram_tree_view.c b/app/diagram_tree_view.c
index cd42a91a..83cc3685 100644
--- a/app/diagram_tree_view.c
+++ b/app/diagram_tree_view.c
@@ -6,7 +6,7 @@
*
* diagram_tree_view.c : complete rewrite to get rid of deprecated widgets
* Copyright (C) 2009 Hans Breuer
- *
+ *
* 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
@@ -34,18 +34,18 @@
#include "diagram_tree_model.h"
#include "diagram_tree.h"
-#include "dia-app-icons.h" /* for dia_group_icon */
#include <lib/group.h> /* IS_GROUP */
#include "display.h"
#include "properties-dialog.h" /* object_list_properties_show */
#include "dia-props.h" /* diagram_properties_show */
#include "persistence.h"
#include "intl.h"
+#include "widgets.h"
typedef struct _DiagramTreeView DiagramTreeView;
struct _DiagramTreeView {
GtkTreeView parent_instance;
-
+
GtkUIManager *ui_manager;
GtkMenu *popup;
};
@@ -83,7 +83,7 @@ _dtv_button_press (GtkWidget *widget,
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
- if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
+ if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
event->x, event->y,
&path, NULL, NULL, NULL)) {
return TRUE;
@@ -104,7 +104,7 @@ _dtv_button_press (GtkWidget *widget,
} else {
GTK_WIDGET_CLASS (_dtv_parent_class)->button_press_event (widget, event);
- if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
+ if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
event->x, event->y,
&path, NULL, NULL, NULL)) {
model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
@@ -182,9 +182,9 @@ _dtv_query_tooltip (GtkWidget *widget,
gchar *em = g_markup_printf_escaped ("<b>%s</b>: %s\n", _("Type"), object->type->name);
g_string_append (markup, em);
g_free (em);
- g_string_append_printf (markup, "<b>%s</b>: %g,%g\n", Q_("object|Position"),
+ g_string_append_printf (markup, "<b>%s</b>: %g,%g\n", Q_("object|Position"),
object->position.x, object->position.y);
- g_string_append_printf (markup, "%d %s",
+ g_string_append_printf (markup, "%d %s",
g_list_length (object->children), _("Children"));
/* and some dia_object_get_meta ? */
} else if (layer) {
@@ -215,7 +215,7 @@ _dtv_query_tooltip (GtkWidget *widget,
return TRUE;
}
- return GTK_WIDGET_CLASS (_dtv_parent_class)->query_tooltip
+ return GTK_WIDGET_CLASS (_dtv_parent_class)->query_tooltip
(widget, x, y, keyboard_mode, tooltip);
}
@@ -287,7 +287,7 @@ _dtv_cell_pixbuf_func (GtkCellLayout *layout,
g_error_free (error);
}
} else if (IS_GROUP(object)) {
- pixbuf = gdk_pixbuf_new_from_inline(-1, dia_group_icon, TRUE, NULL);
+ pixbuf = pixbuf_from_resource ("/org/gnome/Dia/icons/dia-group.png");
}
} else {
#if 0 /* these icons are not that useful */
@@ -378,7 +378,7 @@ _dtv_locate_item (GtkAction *action,
*/
GSList *displays;
- for (displays = diagram->displays;
+ for (displays = diagram->displays;
displays != NULL; displays = g_slist_next (displays)) {
DDisplay *ddisp = (DDisplay *)displays->data;
@@ -426,7 +426,7 @@ _dtv_showprops_item (GtkAction *action,
else {
g_object_unref (current_diagram);
break; /* can only handle one diagram's objects */
- }
+ }
}
r = g_list_next (r);
}
@@ -505,7 +505,7 @@ _dtv_init (DiagramTreeView *dtv)
gtk_tree_view_column_set_min_width (column, font_size * 10);
gtk_tree_view_column_set_expand (column, TRUE);
gtk_tree_view_column_set_resizable (column, TRUE);
-
+
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (column), cell, TRUE);
gtk_tree_view_column_add_attribute (column, cell, "text", NAME_COLUMN);
gtk_tree_view_insert_column (GTK_TREE_VIEW (dtv), column, -1);
@@ -550,7 +550,7 @@ diagram_tree_view_new (void)
return g_object_new (DIAGRAM_TREE_VIEW_TYPE, NULL);
}
-/* should eventually go to it's own file, just for testing
+/* should eventually go to it's own file, just for testing
* The DiagramTreeView should remain integrateable with the integrated UI.
*/
void
diff --git a/app/pixmaps/off-grid.png b/app/icons/dia-grid-off.png
similarity index 100%
rename from app/pixmaps/off-grid.png
rename to app/icons/dia-grid-off.png
diff --git a/app/pixmaps/on-grid.png b/app/icons/dia-grid-on.png
similarity index 100%
rename from app/pixmaps/on-grid.png
rename to app/icons/dia-grid-on.png
diff --git a/app/pixmaps/group.png b/app/icons/dia-group.png
similarity index 100%
rename from app/pixmaps/group.png
rename to app/icons/dia-group.png
diff --git a/app/icons/org.gnome.Dia.png b/app/icons/org.gnome.Dia.png
new file mode 100644
index 00000000..f5d16fcb
Binary files /dev/null and b/app/icons/org.gnome.Dia.png differ
diff --git a/app/interface.c b/app/interface.c
index 3bb12fde..886fda61 100644
--- a/app/interface.c
+++ b/app/interface.c
@@ -72,7 +72,7 @@ dia_dnd_file_drag_data_received (GtkWidget *widget,
default:
{
Diagram *diagram = NULL;
- gchar *sPath = NULL, *pFrom, *pTo;
+ gchar *sPath = NULL, *pFrom, *pTo;
pFrom = strstr((gchar *) gtk_selection_data_get_data(data), "file:");
while (pFrom) {
@@ -101,7 +101,7 @@ dia_dnd_file_drag_data_received (GtkWidget *widget,
if (diagram != NULL) {
diagram_update_extents(diagram);
layer_dialog_set_diagram(diagram);
-
+
if (diagram->displays == NULL) {
new_display(diagram);
}
@@ -118,7 +118,7 @@ dia_dnd_file_drag_data_received (GtkWidget *widget,
static GtkWidget *toolbox_shell = NULL;
-static struct
+static struct
{
GtkWindow * main_window;
GtkToolbar * toolbar;
@@ -127,8 +127,8 @@ static struct
GtkWidget * layer_view;
} ui;
-/**
- * Used to determine if the current user interface is the integrated interface or
+/**
+ * Used to determine if the current user interface is the integrated interface or
* the distributed interface. This cannot presently be determined by the preferences
* setting because changing that setting at run time does not change the interface.
* @return Non-zero if the integrated interface is present, else zero.
@@ -142,7 +142,7 @@ static void
grid_toggle_snap(GtkWidget *widget, gpointer data)
{
DDisplay *ddisp = (DDisplay *)data;
- ddisplay_set_snap_to_grid(ddisp,
+ ddisplay_set_snap_to_grid(ddisp,
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
}
@@ -186,7 +186,7 @@ view_zoom_set (float factor)
}
static void
-zoom_activate_callback(GtkWidget *item, gpointer user_data)
+zoom_activate_callback(GtkWidget *item, gpointer user_data)
{
DDisplay *ddisp = (DDisplay *)user_data;
const gchar *zoom_text =
@@ -215,11 +215,11 @@ zoom_activate_callback(GtkWidget *item, gpointer user_data)
}
static void
-zoom_add_zoom_amount(GtkWidget *menu, gchar *text, DDisplay *ddisp)
+zoom_add_zoom_amount(GtkWidget *menu, gchar *text, DDisplay *ddisp)
{
GtkWidget *menuitem = gtk_menu_item_new_with_label(text);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
- g_signal_connect(G_OBJECT(menuitem),
+ g_signal_connect(G_OBJECT(menuitem),
"activate", G_CALLBACK(zoom_activate_callback),
ddisp);
g_object_set_data(G_OBJECT(menuitem), "zoomamount", text);
@@ -232,7 +232,7 @@ zoom_popup_menu(GtkWidget *button, GdkEventButton *event, gpointer user_data) {
GtkMenu *menu = GTK_MENU(user_data);
- gtk_menu_popup(menu, NULL, NULL, NULL, NULL,
+ gtk_menu_popup(menu, NULL, NULL, NULL, NULL,
event->button, event->time);
/* stop the signal emission so the button doesn't grab the
* pointer from us */
@@ -240,7 +240,7 @@ zoom_popup_menu(GtkWidget *button, GdkEventButton *event, gpointer user_data) {
}
static GtkWidget*
-create_zoom_widget(DDisplay *ddisp) {
+create_zoom_widget(DDisplay *ddisp) {
GtkWidget *combo;
GtkWidget *entry;
GtkWidget *menu;
@@ -301,13 +301,13 @@ display_drop_callback(GtkWidget *widget, GdkDragContext *context,
}
static void
-display_data_received_callback (GtkWidget *widget,
+display_data_received_callback (GtkWidget *widget,
GdkDragContext *context,
- gint x,
- gint y,
+ gint x,
+ gint y,
GtkSelectionData *data,
- guint info,
- guint time,
+ guint info,
+ guint time,
DDisplay *ddisp)
{
if (gtk_selection_data_get_format(data) == 8 &&
@@ -412,9 +412,9 @@ create_canvas (DDisplay *ddisp)
gtk_widget_set_double_buffered (canvas, FALSE);
gtk_widget_set_events (canvas,
- GDK_EXPOSURE_MASK |
+ GDK_EXPOSURE_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_STRUCTURE_MASK | GDK_ENTER_NOTIFY_MASK |
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
g_signal_connect (G_OBJECT (canvas), "configure-event",
@@ -547,7 +547,7 @@ use_integrated_ui_for_display_shell(DDisplay *ddisp, char *title)
ddisp->shell = GTK_WIDGET (ui.main_window);
ddisp->modified_status = GTK_WIDGET (ui.statusbar);
-
+
tab_label_container = gtk_hbox_new(FALSE,3);
label = gtk_label_new( title );
gtk_box_pack_start( GTK_BOX(tab_label_container), label, FALSE, FALSE, 0 );
@@ -571,7 +571,7 @@ use_integrated_ui_for_display_shell(DDisplay *ddisp, char *title)
GTK_ICON_SIZE_MENU);
gtk_container_add (GTK_CONTAINER(close_button), image);
- g_signal_connect (G_OBJECT (close_button), "clicked",
+ g_signal_connect (G_OBJECT (close_button), "clicked",
G_CALLBACK (close_notebook_page_callback), ddisp->container);
/* </from GEdit> */
@@ -666,7 +666,7 @@ create_display_shell(DDisplay *ddisp,
use_integrated_ui_for_display_shell(ddisp, title);
return;
}
-
+
ddisp->is_standalone_window = TRUE;
ddisp->container = NULL;
@@ -699,7 +699,7 @@ create_display_shell(DDisplay *ddisp,
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 1);
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
- if (use_mbar)
+ if (use_mbar)
{
root_vbox = gtk_vbox_new (FALSE, 1);
gtk_container_add (GTK_CONTAINER (ddisp->shell), root_vbox);
@@ -709,7 +709,7 @@ create_display_shell(DDisplay *ddisp,
{
gtk_container_add (GTK_CONTAINER (ddisp->shell), table);
}
-
+
/* scrollbars, rulers, canvas, menu popup button */
if (!use_mbar) {
@@ -730,7 +730,7 @@ create_display_shell(DDisplay *ddisp,
ddisp->origin = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (ddisp->origin), GTK_SHADOW_OUT);
}
-
+
_ddisplay_setup_rulers (ddisp, ddisp->shell, table);
_ddisplay_setup_scrollbars (ddisp, table, width, height);
_ddisplay_setup_navigation (ddisp, table, FALSE);
@@ -769,9 +769,9 @@ create_display_shell(DDisplay *ddisp,
gtk_box_pack_start (GTK_BOX (status_hbox), zoom_hbox, FALSE, FALSE, 0);
/* Grid on/off button */
- ddisp->grid_status = dia_toggle_button_new_with_icons(dia_on_grid_icon,
- dia_off_grid_icon);
-
+ ddisp->grid_status = dia_toggle_button_new_with_icon_names ("dia-grid-on",
+ "dia-grid-off");
+
g_signal_connect(G_OBJECT(ddisp->grid_status), "toggled",
G_CALLBACK (grid_toggle_snap), ddisp);
gtk_widget_set_tooltip_text(ddisp->grid_status,
@@ -782,7 +782,7 @@ create_display_shell(DDisplay *ddisp,
ddisp->mainpoint_status = dia_toggle_button_new_with_icons(dia_mainpoints_on_icon,
dia_mainpoints_off_icon);
-
+
g_signal_connect(G_OBJECT(ddisp->mainpoint_status), "toggled",
G_CALLBACK (interface_toggle_mainpoint_magnetism), ddisp);
gtk_widget_set_tooltip_text(ddisp->mainpoint_status,
@@ -809,7 +809,7 @@ create_display_shell(DDisplay *ddisp,
gtk_widget_show (ddisp->modified_status);
gtk_widget_show (status_hbox);
gtk_widget_show (table);
- if (use_mbar)
+ if (use_mbar)
{
gtk_widget_show (ddisp->menu_bar);
gtk_widget_show (root_vbox);
@@ -817,7 +817,7 @@ create_display_shell(DDisplay *ddisp,
gtk_widget_show (ddisp->shell);
/* before showing up, checking canvas's REAL size */
- if (use_mbar && ddisp->hrule->allocation.width > width)
+ if (use_mbar && ddisp->hrule->allocation.width > width)
{
/* The menubar is not shrinkable, so the shell will have at least
* the menubar's width. If the diagram's requested width is smaller,
@@ -845,7 +845,7 @@ create_display_shell(DDisplay *ddisp,
*
* @param ddisp The display to hide the rulers on.
*/
-void
+void
ddisplay_update_rulers (DDisplay *ddisp,
const Rectangle *extents,
const Rectangle *visible)
@@ -943,7 +943,7 @@ _create_mac_integration (GtkWidget *menubar)
/**
* Create integrated user interface
*/
-void
+void
create_integrated_ui (void)
{
GtkWidget *window;
@@ -957,17 +957,17 @@ create_integrated_ui (void)
GtkAccelGroup *accel_group;
GtkWidget *layer_view;
-
+
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_object_ref (window);
gtk_window_set_title (GTK_WINDOW (window), "Dia v" VERSION);
- /* hint to window manager on X so the wm can put the window in the same
- as it was when the application shut down */
+ /* hint to window manager on X so the wm can put the window in the same
+ as it was when the application shut down */
gtk_window_set_role (GTK_WINDOW (window), DIA_MAIN_WINDOW);
-
+
gtk_window_set_default_size (GTK_WINDOW (window), 146, 349);
-
+
g_signal_connect (G_OBJECT (window), "delete_event",
G_CALLBACK (toolbox_delete),
window);
@@ -988,15 +988,15 @@ create_integrated_ui (void)
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end (GTK_BOX (main_vbox), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
-
+
/* Layer View */
layer_view = create_layer_view_widget ();
gtk_box_pack_end (GTK_BOX (hbox), layer_view, FALSE, FALSE, 0);
-
+
/* Diagram Notebook */
notebook = gtk_notebook_new ();
gtk_box_pack_end (GTK_BOX (hbox), notebook, TRUE, TRUE, 0);
- gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
+ gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
gtk_widget_show (notebook);
/* Toolbox widget */
@@ -1050,7 +1050,7 @@ create_integrated_ui (void)
}
/**
- * Create toolbox component for distributed user interface
+ * Create toolbox component for distributed user interface
*/
void
create_toolbox ()
@@ -1119,9 +1119,9 @@ interface_get_toolbox_shell(void)
}
/* Indicate if the integrated UI toolbar is showing.
- * @return TRUE if showing, FALSE if not showing or doesn't exist
- */
-gboolean
+ * @return TRUE if showing, FALSE if not showing or doesn't exist
+ */
+gboolean
integrated_ui_toolbar_is_showing (void)
{
if (ui.toolbar)
@@ -1136,7 +1136,7 @@ integrated_ui_toolbar_is_showing (void)
}
/* show integrated UI main toolbar and set pulldown menu action. */
-void
+void
integrated_ui_toolbar_show (gboolean show)
{
if (ui.toolbar) {
@@ -1152,9 +1152,9 @@ integrated_ui_toolbar_show (gboolean show)
}
/* Indicate if the integrated UI Layer View is showing.
- * @return TRUE if showing, FALSE if not showing or doesn't exist
- */
-gboolean
+ * @return TRUE if showing, FALSE if not showing or doesn't exist
+ */
+gboolean
integrated_ui_layer_view_is_showing (void)
{
if (ui.layer_view)
@@ -1168,7 +1168,7 @@ integrated_ui_layer_view_is_showing (void)
return FALSE;
}
-void
+void
integrated_ui_layer_view_show (gboolean show)
{
if (ui.layer_view) {
@@ -1178,13 +1178,13 @@ integrated_ui_layer_view_show (gboolean show)
else
gtk_widget_hide (ui.layer_view);
action = menus_get_action (VIEW_LAYERS_ACTION);
- if (action)
+ if (action)
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), show);
}
}
/* show() integrated UI main statusbar and set pulldown menu action. */
-void
+void
integrated_ui_statusbar_show (gboolean show)
{
if (ui.statusbar)
diff --git a/app/menus.c b/app/menus.c
index 53f4fc33..36da1ef7 100644
--- a/app/menus.c
+++ b/app/menus.c
@@ -65,7 +65,7 @@
static void plugin_callback (GtkWidget *widget, gpointer data);
-static GtkWidget *
+static GtkWidget *
create_integrated_ui_toolbar (void);
static void add_plugin_actions (GtkUIManager *ui_manager, const char *base_path);
@@ -91,14 +91,14 @@ static const GtkActionEntry common_entries[] =
{ "File", NULL, N_("_File"), NULL, NULL, NULL },
{ "FileNew", GTK_STOCK_NEW, NULL, FIRST_MODIFIER "N", N_("Create a new diagram"), G_CALLBACK
(file_new_callback) },
{ "FileOpen", GTK_STOCK_OPEN, N_("_Open\342\200\246"),FIRST_MODIFIER "O", N_("Open a diagram file"),
G_CALLBACK (file_open_callback) },
- { "FileQuit", GTK_STOCK_QUIT, NULL, FIRST_MODIFIER "Q", N_("Quit Dia"), G_CALLBACK (file_quit_callback)
},
+ { "FileQuit", GTK_STOCK_QUIT, NULL, FIRST_MODIFIER "Q", N_("Quit Dia"), G_CALLBACK (file_quit_callback)
},
{ "Help", NULL, N_("_Help"), NULL, NULL, NULL },
{ "HelpContents", GTK_STOCK_HELP, NULL, "F1", N_("Dia help"), G_CALLBACK (help_manual_callback) },
{ "HelpAbout", GTK_STOCK_ABOUT, NULL, NULL, N_("Dia version, authors, license"), G_CALLBACK
(help_about_callback) }
};
/* Actions for toolbox menu */
-static const GtkActionEntry toolbox_entries[] =
+static const GtkActionEntry toolbox_entries[] =
{
{ "FileSheets", NULL, N_("Sheets and Objects\342\200\246"), "F9", N_("Manage sheets and their objects"),
G_CALLBACK (sheets_dialog_show_callback) },
{ "FilePrefs", GTK_STOCK_PREFERENCES, NULL, NULL, N_("Dia preferences"), G_CALLBACK
(file_preferences_callback) },
@@ -106,7 +106,7 @@ static const GtkActionEntry toolbox_entries[] =
{ "FileTree", NULL, N_("_Diagram Tree"), "F8", N_("Tree representation of diagrams"), G_CALLBACK
(diagram_tree_show) }
};
-static const GtkToggleActionEntry integrated_ui_view_toggle_entries[] =
+static const GtkToggleActionEntry integrated_ui_view_toggle_entries[] =
{
{ VIEW_MAIN_TOOLBAR_ACTION, NULL, N_("Show Toolbar"), NULL, N_("Show or hide the toolbar"),
G_CALLBACK (view_main_toolbar_callback) },
{ VIEW_MAIN_STATUSBAR_ACTION, NULL, N_("Show Statusbar"), NULL, N_("Show or hide the statusbar"),
G_CALLBACK (view_main_statusbar_callback) },
@@ -137,7 +137,7 @@ static const GtkActionEntry display_entries[] =
{ "EditFind", GTK_STOCK_FIND, N_("_Find\342\200\246"), FIRST_MODIFIER "F", N_("Search for text"),
G_CALLBACK (edit_find_callback) },
{ "EditReplace", GTK_STOCK_FIND_AND_REPLACE, N_("_Replace\342\200\246"), FIRST_MODIFIER "H", N_("Search
and replace text"), G_CALLBACK (edit_replace_callback) },
- /* the following used to bind to <control><shift>C which collides with Unicode input.
+ /* the following used to bind to <control><shift>C which collides with Unicode input.
* <control><alt> doesn't work either */
{ "EditCopytext", NULL, N_("Copy Text"), NULL, N_("Copy object's text to clipboard"), G_CALLBACK
(edit_copy_text_callback) },
{ "EditCuttext", NULL, N_("Cut Text"), FIRST_MODIFIER "<shift>X", N_("Cut object's text to clipboard"),
G_CALLBACK (edit_cut_text_callback) },
@@ -145,7 +145,7 @@ static const GtkActionEntry display_entries[] =
{ "EditPasteImage", NULL, N_("Paste _Image"), FIRST_MODIFIER "<alt>V", N_("Insert image from
clipboard"), G_CALLBACK (edit_paste_image_callback) },
- { "Layers", NULL, N_("_Layers"), NULL, NULL, NULL },
+ { "Layers", NULL, N_("_Layers"), NULL, NULL, NULL },
{ "LayerAdd", DIA_STOCK_LAYER_ADD, N_("Add Layer\342\200\246"), NULL, NULL, G_CALLBACK
(layers_add_layer_callback) },
{ "LayerRename", DIA_STOCK_LAYER_RENAME, N_("Rename Layer\342\200\246"), NULL, NULL, G_CALLBACK
(layers_rename_layer_callback) },
{ "ObjectsLayerAbove", DIA_STOCK_OBJECTS_LAYER_ABOVE, N_("Move Selection to Layer above"), NULL, NULL,
G_CALLBACK (objects_move_up_layer) },
@@ -184,7 +184,7 @@ static const GtkActionEntry display_entries[] =
{ "ObjectsGroup", DIA_STOCK_GROUP, N_("_Group"), FIRST_MODIFIER "G", N_("Group selected objects"),
G_CALLBACK (objects_group_callback) },
/* deliberately not using Ctrl+U for Ungroup */
- { "ObjectsUngroup", DIA_STOCK_UNGROUP, N_("_Ungroup"), FIRST_MODIFIER "<shift>G", N_("Ungroup selected
groups"), G_CALLBACK (objects_ungroup_callback) },
+ { "ObjectsUngroup", DIA_STOCK_UNGROUP, N_("_Ungroup"), FIRST_MODIFIER "<shift>G", N_("Ungroup selected
groups"), G_CALLBACK (objects_ungroup_callback) },
{ "ObjectsParent", NULL, N_("_Parent"), FIRST_MODIFIER "K", NULL, G_CALLBACK (objects_parent_callback) },
{ "ObjectsUnparent", NULL, N_("_Unparent"), FIRST_MODIFIER "<shift>K", NULL, G_CALLBACK
(objects_unparent_callback) },
@@ -229,7 +229,7 @@ static const GtkActionEntry display_entries[] =
};
/* Standard-Tool entries */
-static const GtkActionEntry tool_entries[] =
+static const GtkActionEntry tool_entries[] =
{
{ "Tools", NULL, N_("_Tools"), NULL, NULL, NULL },
{ "ToolsModify", NULL, N_("Modify"), TOOL_MODIFIER "N", NULL, NULL },
@@ -253,7 +253,7 @@ static const GtkActionEntry tool_entries[] =
};
/* Toggle-Actions for diagram window */
-static const GtkToggleActionEntry display_toggle_entries[] =
+static const GtkToggleActionEntry display_toggle_entries[] =
{
{ "ViewFullscreen", GTK_STOCK_FULLSCREEN, NULL, "F11", NULL, G_CALLBACK (view_fullscreen_callback) },
{ "ViewAntialiased", NULL, N_("_Antialiased"), NULL, NULL, G_CALLBACK (view_aa_callback) },
@@ -305,7 +305,7 @@ static gchar*
_dia_translate (const gchar* term, gpointer data)
{
gchar* trans = (gchar*) term;
-
+
if (term && *term) {
/* first try our own ... */
trans = dgettext (GETTEXT_PACKAGE, term);
@@ -377,7 +377,7 @@ integrated_ui_toolbar_object_snap_synchronize_to_display(gpointer param)
DDisplay *ddisp = param;
if (ddisp && ddisp->common_toolbar)
{
- GtkToggleButton *b = g_object_get_data (G_OBJECT (ddisp->common_toolbar),
+ GtkToggleButton *b = g_object_get_data (G_OBJECT (ddisp->common_toolbar),
DIA_INTEGRATED_TOOLBAR_OBJECT_SNAP);
gboolean active = ddisp->mainpoint_magnetism? TRUE : FALSE;
gtk_toggle_button_set_active (b, active);
@@ -409,7 +409,7 @@ integrated_ui_toolbar_grid_snap_synchronize_to_display(gpointer param)
DDisplay *ddisp = param;
if (ddisp && ddisp->common_toolbar)
{
- GtkToggleButton *b = g_object_get_data (G_OBJECT (ddisp->common_toolbar),
+ GtkToggleButton *b = g_object_get_data (G_OBJECT (ddisp->common_toolbar),
DIA_INTEGRATED_TOOLBAR_SNAP_GRID);
gboolean active = ddisp->grid.snap? TRUE : FALSE;
gtk_toggle_button_set_active (b, active);
@@ -434,15 +434,15 @@ integrated_ui_toolbar_grid_snap_toggle(GtkToggleButton *b, gpointer *not_used)
/**
* Sets the zoom text for the toolbar
* @param toolbar Integrated UI toolbar.
- * @param text Current zoom percentage for the active window
+ * @param text Current zoom percentage for the active window
*/
void integrated_ui_toolbar_set_zoom_text (GtkToolbar *toolbar, const gchar * text)
{
if (toolbar)
{
- GtkComboBox *combo_entry = g_object_get_data (G_OBJECT (toolbar),
+ GtkComboBox *combo_entry = g_object_get_data (G_OBJECT (toolbar),
DIA_INTEGRATED_TOOLBAR_ZOOM_COMBO);
-
+
if (combo_entry)
{
GtkWidget * entry = gtk_bin_get_child (GTK_BIN (combo_entry));
@@ -452,7 +452,7 @@ void integrated_ui_toolbar_set_zoom_text (GtkToolbar *toolbar, const gchar * tex
}
}
-/**
+/**
* Adds a widget to the toolbar making sure that it doesn't take any excess space, and
* vertically centers it.
* @param toolbar The toolbar to add the widget to.
@@ -460,7 +460,7 @@ void integrated_ui_toolbar_set_zoom_text (GtkToolbar *toolbar, const gchar * tex
*/
static void integrated_ui_toolbar_add_custom_item (GtkToolbar *toolbar, GtkWidget *w)
{
- GtkToolItem *tool_item;
+ GtkToolItem *tool_item;
GtkWidget *c; /* container */
tool_item = gtk_tool_item_new ();
@@ -475,7 +475,7 @@ static void integrated_ui_toolbar_add_custom_item (GtkToolbar *toolbar, GtkWidge
}
static void
-integrated_ui_toolbar_zoom_activate (GtkWidget *item,
+integrated_ui_toolbar_zoom_activate (GtkWidget *item,
gpointer user_data)
{
const gchar *text = gtk_entry_get_text (GTK_ENTRY (item));
@@ -492,9 +492,9 @@ static void
integrated_ui_toolbar_zoom_combo_selection_changed (GtkComboBox *combo,
gpointer user_data)
{
- /*
+ /*
* We call gtk_combo_get_get_active() so that typing in the combo entry
- * doesn't get handled as a selection change
+ * doesn't get handled as a selection change
*/
if (gtk_combo_box_get_active (combo) != -1)
{
@@ -513,7 +513,7 @@ integrated_ui_toolbar_zoom_combo_selection_changed (GtkComboBox *combo,
{
view_show_all_callback (NULL);
}
-
+
g_free (text);
}
}
@@ -535,7 +535,7 @@ ensure_menu_path (GtkUIManager *ui_manager, GtkActionGroup *actions, const gchar
sep = strrchr (subpath, '/');
*sep = '\0'; /* cut subpath */
action_name = sep + 1;
-
+
ensure_menu_path (ui_manager, actions, subpath, FALSE);
action = gtk_action_new (action_name, sep + 1, NULL, NULL);
@@ -543,7 +543,7 @@ ensure_menu_path (GtkUIManager *ui_manager, GtkActionGroup *actions, const gchar
gtk_action_group_add_action (actions, action);
g_object_unref (G_OBJECT (action));
- gtk_ui_manager_add_ui (ui_manager, id, subpath,
+ gtk_ui_manager_add_ui (ui_manager, id, subpath,
action_name, action_name,
end ? GTK_UI_MANAGER_SEPARATOR : GTK_UI_MANAGER_MENU,
FALSE); /* FALSE=add-to-end */
@@ -559,7 +559,7 @@ ensure_menu_path (GtkUIManager *ui_manager, GtkActionGroup *actions, const gchar
* Create the toolbar for the integrated UI
* @return Main toolbar (GtkToolbar*) for the integrated UI main window
*/
-static GtkWidget *
+static GtkWidget *
create_integrated_ui_toolbar (void)
{
GtkToolbar *toolbar;
@@ -578,7 +578,7 @@ create_integrated_ui_toolbar (void)
else {
toolbar = GTK_TOOLBAR(gtk_ui_manager_get_widget (_ui_manager, "/Toolbar"));
}
- g_free (uifile);
+ g_free (uifile);
/* Zoom Combo Box Entry */
#if GTK_CHECK_VERSION(2,24,0)
@@ -587,11 +587,11 @@ create_integrated_ui_toolbar (void)
w = gtk_combo_box_entry_new_text ();
#endif
- g_object_set_data (G_OBJECT (toolbar),
+ g_object_set_data (G_OBJECT (toolbar),
DIA_INTEGRATED_TOOLBAR_ZOOM_COMBO,
w);
integrated_ui_toolbar_add_custom_item (toolbar, w);
-
+
#if GTK_CHECK_VERSION(2,24,0)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (w), ZOOM_FIT);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (w), _("800%"));
@@ -618,42 +618,43 @@ create_integrated_ui_toolbar (void)
gtk_combo_box_append_text (GTK_COMBO_BOX (w), _("10%"));
#endif
- g_signal_connect (G_OBJECT (w),
+ g_signal_connect (G_OBJECT (w),
"changed",
- G_CALLBACK (integrated_ui_toolbar_zoom_combo_selection_changed),
+ G_CALLBACK (integrated_ui_toolbar_zoom_combo_selection_changed),
NULL);
-
+
/* Get the combo's GtkEntry child to set the width for the widget */
w = gtk_bin_get_child (GTK_BIN (w));
gtk_entry_set_width_chars (GTK_ENTRY (w), 6);
-
+
g_signal_connect (G_OBJECT (w), "activate",
G_CALLBACK(integrated_ui_toolbar_zoom_activate),
NULL);
-
+
/* Seperator */
sep = gtk_separator_tool_item_new ();
gtk_toolbar_insert (toolbar, sep, -1);
gtk_widget_show (GTK_WIDGET (sep));
/* Snap to grid */
- w = dia_toggle_button_new_with_icons (dia_on_grid_icon,
- dia_off_grid_icon);
+ w = dia_toggle_button_new_with_icon_names ("dia-grid-on",
+ "dia-grid-off");
+
g_signal_connect (G_OBJECT (w), "toggled",
G_CALLBACK (integrated_ui_toolbar_grid_snap_toggle), toolbar);
gtk_widget_set_tooltip_text (w, _("Toggles snap-to-grid."));
- g_object_set_data (G_OBJECT (toolbar),
+ g_object_set_data (G_OBJECT (toolbar),
DIA_INTEGRATED_TOOLBAR_SNAP_GRID,
w);
integrated_ui_toolbar_add_custom_item (toolbar, w);
-
+
/* Object Snapping */
w = dia_toggle_button_new_with_icons (dia_mainpoints_on_icon,
dia_mainpoints_off_icon);
g_signal_connect (G_OBJECT (w), "toggled",
G_CALLBACK (integrated_ui_toolbar_object_snap_toggle), toolbar);
gtk_widget_set_tooltip_text (w, _("Toggles object snapping."));
- g_object_set_data (G_OBJECT (toolbar),
+ g_object_set_data (G_OBJECT (toolbar),
DIA_INTEGRATED_TOOLBAR_OBJECT_SNAP,
w);
integrated_ui_toolbar_add_custom_item (toolbar, w);
@@ -665,7 +666,7 @@ create_integrated_ui_toolbar (void)
return GTK_WIDGET (toolbar);
}
-/*
+/*
* Initialise tool actions.
* The caller owns the return value.
*/
@@ -684,7 +685,7 @@ create_or_ref_tool_actions (void)
gtk_action_group_set_translation_domain (actions, NULL);
gtk_action_group_set_translate_func (actions, _dia_translate, NULL, NULL);
- gtk_action_group_add_actions (actions, tool_entries,
+ gtk_action_group_add_actions (actions, tool_entries,
G_N_ELEMENTS (tool_entries), NULL);
icon_factory = gtk_icon_factory_new ();
@@ -751,12 +752,12 @@ add_plugin_actions (GtkUIManager *ui_manager, const gchar *base_path)
}
if (cbf->action == NULL) {
- g_warning ("Plugin '%s': doesn't specify action. Loading failed.",
+ g_warning ("Plugin '%s': doesn't specify action. Loading failed.",
cbf->description);
continue;
}
- if ( base_path != NULL
+ if ( base_path != NULL
&& strncmp (cbf->menupath, base_path, strlen (base_path)) != 0) {
/* hook for wrong base path, skip */
continue;
@@ -769,18 +770,18 @@ add_plugin_actions (GtkUIManager *ui_manager, const gchar *base_path)
}
action = gtk_action_new (cbf->action, cbf->description, NULL, NULL);
- g_signal_connect (G_OBJECT (action), "activate",
+ g_signal_connect (G_OBJECT (action), "activate",
G_CALLBACK (plugin_callback), (gpointer) cbf);
gtk_action_group_add_action (actions, action);
g_object_unref (G_OBJECT (action));
id = ensure_menu_path (ui_manager, actions, menu_path ? menu_path : cbf->menupath, TRUE);
- gtk_ui_manager_add_ui (ui_manager, id,
- menu_path ? menu_path : cbf->menupath,
- cbf->description,
- cbf->action,
- GTK_UI_MANAGER_AUTO,
+ gtk_ui_manager_add_ui (ui_manager, id,
+ menu_path ? menu_path : cbf->menupath,
+ cbf->description,
+ cbf->action,
+ GTK_UI_MANAGER_AUTO,
FALSE);
g_free (menu_path);
}
@@ -812,7 +813,6 @@ register_stock_icons (void)
factory = gtk_icon_factory_new ();
- _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_icon, sizeof(dia_layer_add_icon));
@@ -840,7 +840,7 @@ build_ui_filename (const gchar* name)
}
/*!
- * Not sure why this service is not provided by GTK+.
+ * Not sure why this service is not provided by GTK+.
* We are passing tooltips into the actions (especially recent file menu).
* But they were not shown without explicit setting on connect.
*/
@@ -880,10 +880,10 @@ create_or_ref_display_actions (gboolean include_common)
if (include_common)
gtk_action_group_add_actions (display_actions, common_entries,
G_N_ELEMENTS (common_entries), NULL);
- gtk_action_group_add_actions (display_actions, display_entries,
+ gtk_action_group_add_actions (display_actions, display_entries,
G_N_ELEMENTS (display_entries), NULL);
gtk_action_group_add_toggle_actions (display_actions, display_toggle_entries,
- G_N_ELEMENTS (display_toggle_entries),
+ G_N_ELEMENTS (display_toggle_entries),
NULL);
gtk_action_group_add_radio_actions (display_actions,
display_select_radio_entries,
@@ -895,7 +895,7 @@ create_or_ref_display_actions (gboolean include_common)
return display_actions;
}
-/* Very minimal fallback menu info for ui-files missing
+/* Very minimal fallback menu info for ui-files missing
* as well as to register the InvisibleMenu */
static const gchar *ui_info =
"<ui>\n"
@@ -936,21 +936,21 @@ _setup_global_actions (void)
toolbox_actions = gtk_action_group_new ("toolbox-actions");
gtk_action_group_set_translation_domain (toolbox_actions, NULL);
gtk_action_group_set_translate_func (toolbox_actions, _dia_translate, NULL, NULL);
- gtk_action_group_add_actions (toolbox_actions, common_entries,
+ gtk_action_group_add_actions (toolbox_actions, common_entries,
G_N_ELEMENTS (common_entries), NULL);
- gtk_action_group_add_actions (toolbox_actions, toolbox_entries,
+ gtk_action_group_add_actions (toolbox_actions, toolbox_entries,
G_N_ELEMENTS (toolbox_entries), NULL);
_ui_manager = gtk_ui_manager_new ();
- g_signal_connect (G_OBJECT (_ui_manager),
+ g_signal_connect (G_OBJECT (_ui_manager),
"connect_proxy",
G_CALLBACK (_ui_manager_connect_proxy),
NULL);
- g_signal_connect (G_OBJECT (_ui_manager),
+ g_signal_connect (G_OBJECT (_ui_manager),
"pre-activate",
G_CALLBACK (_action_start),
NULL);
- g_signal_connect (G_OBJECT (_ui_manager),
+ g_signal_connect (G_OBJECT (_ui_manager),
"post-activate",
G_CALLBACK (_action_done),
NULL);
@@ -969,7 +969,7 @@ menus_init(void)
if (!initialise)
return;
-
+
initialise = FALSE;
_setup_global_actions ();
@@ -985,7 +985,7 @@ menus_init(void)
display_actions = create_or_ref_display_actions (TRUE);
display_ui_manager = gtk_ui_manager_new ();
- g_signal_connect (G_OBJECT (display_ui_manager),
+ g_signal_connect (G_OBJECT (display_ui_manager),
"connect_proxy",
G_CALLBACK (_ui_manager_connect_proxy),
NULL);
@@ -999,7 +999,7 @@ menus_init(void)
}
uifile = build_ui_filename ("ui/popup-ui.xml");
- /* TODO it would be more elegant if we had only one definition of the
+ /* TODO it would be more elegant if we had only one definition of the
* menu hierarchy and merge it into a popup somehow. */
if (!gtk_ui_manager_add_ui_from_file (display_ui_manager, uifile, &error)) {
g_warning ("building menus failed: %s", error->message);
@@ -1041,7 +1041,7 @@ menus_get_integrated_ui_menubar (GtkWidget **menubar,
g_return_if_fail (tool_actions != NULL);
/* maybe better to put this into toolbox_actions? */
- gtk_action_group_add_toggle_actions (display_actions, integrated_ui_view_toggle_entries,
+ gtk_action_group_add_toggle_actions (display_actions, integrated_ui_view_toggle_entries,
G_N_ELEMENTS (integrated_ui_view_toggle_entries), NULL);
/* for stand-alone they are per display */
@@ -1087,7 +1087,7 @@ menus_get_toolbox_menubar (GtkWidget **menubar,
*accel_group = gtk_ui_manager_get_accel_group (_ui_manager);
}
-GtkWidget *
+GtkWidget *
menus_get_display_popup (void)
{
if (initialise)
@@ -1096,7 +1096,7 @@ menus_get_display_popup (void)
return display_menubar;
}
-GtkAccelGroup *
+GtkAccelGroup *
menus_get_display_accels (void)
{
/* for integrated-ui the accels are delivered by menus_get_integrated_ui_menubar() */
@@ -1109,23 +1109,23 @@ menus_get_display_accels (void)
}
GtkWidget *
-menus_create_display_menubar (GtkUIManager **ui_manager,
+menus_create_display_menubar (GtkUIManager **ui_manager,
GtkActionGroup **actions)
{
GtkWidget *menu_bar;
GError *error = NULL;
gchar *uifile;
-
+
*actions = create_or_ref_display_actions (TRUE);
- tool_actions = create_or_ref_tool_actions ();
+ tool_actions = create_or_ref_tool_actions ();
*ui_manager = gtk_ui_manager_new ();
gtk_ui_manager_set_add_tearoffs (*ui_manager, DIA_SHOW_TEAROFFS);
gtk_ui_manager_insert_action_group (*ui_manager, *actions, 0);
gtk_ui_manager_insert_action_group (*ui_manager, tool_actions, 0);
g_object_unref (G_OBJECT (tool_actions));
-
+
uifile = build_ui_filename ("ui/display-ui.xml");
if (!gtk_ui_manager_add_ui_from_file (*ui_manager, uifile, &error)) {
g_warning ("building menus failed: %s", error->message);
@@ -1218,8 +1218,8 @@ menus_set_recent (GtkActionGroup *actions)
recent_actions = actions;
g_object_ref (G_OBJECT (recent_actions));
- gtk_ui_manager_insert_action_group (_ui_manager,
- recent_actions,
+ gtk_ui_manager_insert_action_group (_ui_manager,
+ recent_actions,
10 /* insert at back */ );
do {
@@ -1228,11 +1228,11 @@ menus_set_recent (GtkActionGroup *actions)
id = gtk_ui_manager_new_merge_id (_ui_manager);
recent_merge_ids = g_slist_prepend (recent_merge_ids, (gpointer) id);
- gtk_ui_manager_add_ui (_ui_manager, id,
- recent_path,
- aname,
- aname,
- GTK_UI_MANAGER_AUTO,
+ gtk_ui_manager_add_ui (_ui_manager, id,
+ recent_path,
+ aname,
+ aname,
+ GTK_UI_MANAGER_AUTO,
TRUE);
} while (NULL != (list = list->next));
@@ -1247,9 +1247,9 @@ menus_clear_recent (void)
id = recent_merge_ids;
do {
gtk_ui_manager_remove_ui (_ui_manager, (guint) id->data);
-
+
} while (NULL != (id = id->next));
-
+
g_slist_free (recent_merge_ids);
recent_merge_ids = NULL;
}
@@ -1298,7 +1298,7 @@ plugin_callback (GtkWidget *widget, gpointer data)
if (change->free)
change->free(change);
g_free(change);
- }
+ }
}
}
}
diff --git a/app/meson.build b/app/meson.build
index a4449fcc..0bc75c7b 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -76,8 +76,12 @@ endif
diaapp_inc = include_directories('.')
+resources = gnome.compile_resources('dia-resources', 'dia.gresource.xml',
+ source_dir : '.',
+ c_name : 'dia')
+
diaapp = executable('dia',
- dia_sources + [dia_app_icons_h, diamarshal_h, config_h],
+ dia_sources + [resources, dia_app_icons_h, diamarshal_h, config_h],
dependencies: [libgtk_dep, libxml_dep, libm_dep],
link_with: [libdia],
link_args: dia_link_args,
diff --git a/app/pixmaps/meson.build b/app/pixmaps/meson.build
index ecfbb46d..ff9f4f5a 100644
--- a/app/pixmaps/meson.build
+++ b/app/pixmaps/meson.build
@@ -3,11 +3,8 @@ icons = [
'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',
@@ -38,8 +35,7 @@ icon_pairs += [
'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_diagram_icon', files('dia-diagram.png')
]
dia_app_icons_h = custom_target(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]