+++ /dev/null
-diff -Nru dia-0.92.2.orig/app/app_procs.c dia-0.92.2/app/app_procs.c
---- dia-0.92.2.orig/app/app_procs.c 2003-10-24 21:52:32.000000000 +0200
-+++ dia-0.92.2/app/app_procs.c 2003-11-19 11:18:08.000000000 +0100
-@@ -664,6 +664,7 @@
- static void create_user_dirs(void)
- {
- gchar *dir, *subdir;
-+ gchar *home_etc = getenv("HOME_ETC");
-
- #ifdef G_OS_WIN32
- /* not necessary to quit the program with g_error, everywhere else
-@@ -675,7 +676,7 @@
- return; /* ... and return. Probably removes my one and only FAQ. --HB */
- }
- #endif
-- dir = g_strconcat(g_get_home_dir(), G_DIR_SEPARATOR_S ".dia", NULL);
-+ dir = g_strconcat(home_etc ? home_etc : g_get_home_dir(), G_DIR_SEPARATOR_S ".dia", NULL);
- if (mkdir(dir, 0755) && errno != EEXIST)
- #ifndef G_OS_WIN32
- g_error(_("Could not create per-user Dia config directory"));
-diff -Nru dia-0.92.2.orig/app/preferences.c dia-0.92.2/app/preferences.c
---- dia-0.92.2.orig/app/preferences.c 2003-08-31 23:24:55.000000000 +0200
-+++ dia-0.92.2/app/preferences.c 2003-11-19 11:16:14.000000000 +0100
-@@ -446,8 +446,9 @@
- fd = open(filename, O_RDONLY);
-
- if (fd < 0) {
-- const gchar *homedir = g_get_home_dir();
-+ const gchar *homedir = getenv("HOME_ETC");
-
-+ if (!homedir) homedir = g_get_home_dir();
- g_free(filename);
- filename = g_strconcat(homedir, G_DIR_SEPARATOR_S ".diarc", NULL);
- fd = open(filename, O_RDONLY);
-diff -Nru dia-0.92.2.orig/lib/dia_dirs.c dia-0.92.2/lib/dia_dirs.c
---- dia-0.92.2.orig/lib/dia_dirs.c 2003-04-25 18:34:48.000000000 +0200
-+++ dia-0.92.2/lib/dia_dirs.c 2003-11-19 11:16:14.000000000 +0100
-@@ -86,9 +86,9 @@
- gchar *
- dia_config_filename(const gchar *subfile)
- {
-- const gchar *homedir;
-+ const gchar *homedir = getenv("HOME_ETC");
-
-- homedir = g_get_home_dir();
-+ if (!homedir) homedir = g_get_home_dir();
- if (!homedir) {
- homedir = g_get_tmp_dir(); /* put config stuff in /tmp -- not ideal, but
- * we should not reach this state */
-diff -Nru dia-0.92.2.orig/plug-ins/python/python-startup.py dia-0.92.2/plug-ins/python/python-startup.py
---- dia-0.92.2.orig/plug-ins/python/python-startup.py 2003-01-19 17:38:22.000000000 +0100
-+++ dia-0.92.2/plug-ins/python/python-startup.py 2003-11-19 11:24:16.000000000 +0100
-@@ -20,9 +20,12 @@
- sys.stderr.write('could not import %s\n' % file)
-
- # import any python plugins from the user ...
--if not os.environ.has_key('HOME'):
-- os.environ['HOME'] = os.pathsep + 'tmp'
--plugindir = os.path.join(os.environ['HOME'], '.dia', 'python')
-+if os.environ.has_key('HOME_ETC'):
-+ plugindir = os.path.join(os.environ['HOME_ETC'], '.dia', 'python')
-+else:
-+ if not os.environ.has_key('HOME'):
-+ os.environ['HOME'] = os.pathsep + 'tmp'
-+ plugindir = os.path.join(os.environ['HOME'], '.dia', 'python')
-
- if os.path.isdir(plugindir):
- # import all plugins found in user plugin dir
+++ /dev/null
-diff -Nur dia-0.91-pre3.orig/objects/UML/state.c dia-0.91-pre3/objects/UML/state.c
---- dia-0.91-pre3.orig/objects/UML/state.c Sun Jan 26 07:44:52 2003
-+++ dia-0.91-pre3/objects/UML/state.c Mon Feb 24 10:46:59 2003
-@@ -1,6 +1,9 @@
- /* Dia -- an diagram creation/manipulation program
- * Copyright (C) 1998 Alexander Larsson
- *
-+ * State type for UML diagrams
-+ * Copyright (C) 2003 Alejandro Sierra <asierra@servidor.unam.mx>
-+ *
- * 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
-@@ -51,9 +54,12 @@
- ConnectionPoint connections[8];
-
- Text *text;
-- int state_type;
-+ int state_type;
-
- TextAttributes attrs;
-+
-+ int show_internals;
-+ Text *internals;
- };
-
-
-@@ -126,13 +132,15 @@
- Warning: break this and you'll get angry UML users after you. */
- { "type", PROP_TYPE_INT, PROP_FLAG_NO_DEFAULTS|PROP_FLAG_LOAD_ONLY,
- "hack", NULL, NULL },
--
- PROP_STD_TEXT_FONT,
- PROP_STD_TEXT_HEIGHT,
- PROP_STD_TEXT_COLOUR,
-- { "text", PROP_TYPE_TEXT, 0, N_("Text"), NULL, NULL },
--
-- PROP_DESC_END
-+ { "text", PROP_TYPE_TEXT, 0, N_("Text"), NULL, NULL },
-+ { "show_internals", PROP_TYPE_BOOL, PROP_FLAG_VISIBLE,
-+ N_("Show internals"),NULL,NULL},
-+ { "internals", PROP_TYPE_TEXT, 0, N_("Internals"), NULL, NULL },
-+ { NULL, 0, 0, NULL, NULL, NULL, 0}
-+// PROP_DESC_END
- };
-
- static PropDescription *
-@@ -142,7 +150,7 @@
- }
-
- static PropOffset state_offsets[] = {
-- ELEMENT_COMMON_PROPERTIES_OFFSETS,
-+ ELEMENT_COMMON_PROPERTIES_OFFSETS,
- {"text",PROP_TYPE_TEXT,offsetof(State,text)},
- {"text_font",PROP_TYPE_FONT,offsetof(State,attrs.font)},
- {"text_height",PROP_TYPE_REAL,offsetof(State,attrs.height)},
-@@ -152,7 +160,8 @@
- if sizeof(enum) != sizeof(int), we're toast. -- CC
- */
- { "type", PROP_TYPE_INT, offsetof(State, state_type) },
--
-+ { "show_internals", PROP_TYPE_BOOL, offsetof(State, show_internals) },
-+ {"internals",PROP_TYPE_TEXT,offsetof(State,internals)},
- { NULL, 0, 0 },
- };
-
-@@ -167,9 +176,14 @@
- static void
- state_set_props(State *state, GPtrArray *props)
- {
-+ TextAttributes attrs;
-+
- object_set_props_from_offsets(&state->element.object,
- state_offsets,props);
- apply_textattr_properties(props,state->text,"text",&state->attrs);
-+ attrs = state->attrs;
-+ attrs.alignment = ALIGN_LEFT;
-+ apply_textattr_properties(props,state->internals,"internals",&attrs);
- state_update_data(state);
- }
-
-@@ -184,8 +198,12 @@
- state_select(State *state, Point *clicked_point,
- DiaRenderer *interactive_renderer)
- {
-- text_set_cursor(state->text, clicked_point, interactive_renderer);
-- text_grab_focus(state->text, &state->element.object);
-+ Text *text = (state->show_internals && clicked_point->y >=
-+ state->internals->position.y - state->internals->height) ?
-+ state->internals : state->text;
-+
-+ text_set_cursor(text, clicked_point, interactive_renderer);
-+ text_grab_focus(text, &state->element.object);
- element_update_handles(&state->element);
- }
-
-@@ -229,27 +247,7 @@
- renderer_ops->set_linewidth(renderer, STATE_LINEWIDTH);
- renderer_ops->set_linestyle(renderer, LINESTYLE_SOLID);
-
-- if (state->state_type!=STATE_NORMAL) {
-- p1.x = x + w/2;
-- p1.y = y + h/2;
-- if (state->state_type==STATE_END) {
-- r = STATE_ENDRATIO;
-- renderer_ops->fill_ellipse(renderer,
-- &p1,
-- r, r,
-- &color_white);
--
-- renderer_ops->draw_ellipse(renderer,
-- &p1,
-- r, r,
-- &color_black);
-- }
-- r = STATE_RATIO;
-- renderer_ops->fill_ellipse(renderer,
-- &p1,
-- r, r,
-- &color_black);
-- } else {
-+ if (state->state_type==STATE_NORMAL) {
- p1.x = x;
- p1.y = y;
- p2.x = x + w;
-@@ -257,14 +255,28 @@
- renderer_ops->fill_rounded_rect(renderer, &p1, &p2, &color_white, 0.5);
- renderer_ops->draw_rounded_rect(renderer, &p1, &p2, &color_black, 0.5);
- text_draw(state->text, renderer);
-- }
-+ if (state->show_internals) {
-+ p1.x = x; p2.x = x + w;
-+ p1.y = p2.y = state->internals->position.y - state->internals->ascent
-+ - 0.5*STATE_MARGIN_Y;
-+
-+ renderer_ops->set_linewidth(renderer, 0.1);
-+ renderer_ops->draw_line(renderer,
-+ &p1, &p2,
-+ &color_black);
-+
-+ text_draw(state->internals, renderer);
-+ }
-+ } else {
-+ message_warning(_("Please use initial/final state instead"));
-+ }
- }
-
-
- static void
- state_update_data(State *state)
- {
-- real w, h;
-+ real w=0, h=0, x=0;
-
- Element *elem = &state->element;
- Object *obj = &elem->object;
-@@ -274,13 +286,24 @@
- if (state->state_type==STATE_NORMAL) {
- w = state->text->max_width + 2*STATE_MARGIN_X;
- h = state->text->height*state->text->numlines +2*STATE_MARGIN_Y;
-- if (w < STATE_WIDTH)
-- w = STATE_WIDTH;
-+
-+ x = (state->show_internals) ?
-+ state->internals->max_width + 2*STATE_MARGIN_X:
-+ STATE_WIDTH;
-+
-+ if (w < x)
-+ w = x;
- p.x = elem->corner.x + w/2.0;
-- p.y = elem->corner.y + STATE_MARGIN_Y + state->text->ascent;
-+ p.y = elem->corner.y + state->text->ascent +
-+ ((state->show_internals) ? STATE_MARGIN_Y/2.0: STATE_MARGIN_Y);
-+
- text_set_position(state->text, &p);
-- } else {
-- w = h = (state->state_type==STATE_END) ? STATE_ENDRATIO: STATE_RATIO;
-+ if (state->show_internals) {
-+ p.x = elem->corner.x + STATE_MARGIN_X;
-+ p.y += STATE_MARGIN_Y + state->internals->height;
-+ h += state->internals->height*state->internals->numlines;
-+ text_set_position(state->internals, &p);
-+ }
- }
-
- elem->width = w;
-@@ -339,11 +362,14 @@
- p.y += STATE_HEIGHT/2.0;
-
- state->text = new_text("", font, 0.8, &p, &color_black, ALIGN_CENTER);
-- text_get_attributes(state->text,&state->attrs);
-+ text_get_attributes(state->text,&state->attrs);
-+ state->internals = new_text("", font, 0.8, &p, &color_black, ALIGN_LEFT);
-
- dia_font_unref(font);
-
- state->state_type = STATE_NORMAL;
-+ state->show_internals = 0;
-+
- element_init(elem, 8, 8);
-
- for (i=0;i<8;i++) {
-@@ -367,7 +393,7 @@
- state_destroy(State *state)
- {
- text_destroy(state->text);
--
-+ text_destroy(state->internals);
- element_destroy(&state->element);
- }
-