Commit d940918b authored by Zander's avatar Zander 💥

First set of icons from app as resources

parent c83cf0ec
......@@ -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);
......
<?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
......@@ -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
......
......@@ -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)
......
This diff is collapsed.
......@@ -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 + [diamarshal_h, config_h],
dependencies: [libgtk_dep, libxml_dep, libm_dep, libdia_dep],
link_args: dia_link_args,
export_dynamic: true, # some plugins require this.
......
......@@ -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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment