Michael Natterer <mitschel@cs.tu-berlin.de>
1999-06-28 Sven Neumann <sven@gimp.org> Michael Natterer <mitschel@cs.tu-berlin.de> * help/Makefile.am * help/eek.png * plug-ins/helpbrowser/helpbroswer.c: to see what this change does, you'll have to compile it :)
This commit is contained in:

committed by
Michael Natterer

parent
df1088074e
commit
4cc52e24b0
@ -1,3 +1,11 @@
|
|||||||
|
1999-06-28 Sven Neumann <sven@gimp.org>
|
||||||
|
Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||||
|
|
||||||
|
* help/Makefile.am
|
||||||
|
* help/eek.png
|
||||||
|
* plug-ins/helpbrowser/helpbroswer.c: to see what this change
|
||||||
|
does, you'll have to compile it :)
|
||||||
|
|
||||||
1999-06-28 Sven Neumann <sven@gimp.org>
|
1999-06-28 Sven Neumann <sven@gimp.org>
|
||||||
Michael Natterer <mitschel@cs.tu-berlin.de>
|
Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ helpdata_DATA = \
|
|||||||
welcome.html \
|
welcome.html \
|
||||||
contents.html \
|
contents.html \
|
||||||
index.html \
|
index.html \
|
||||||
|
eek.png \
|
||||||
wilber.png
|
wilber.png
|
||||||
|
|
||||||
EXTRA_DIST = $(helpdata_DATA)
|
EXTRA_DIST = $(helpdata_DATA)
|
||||||
|
BIN
help/eek.png
Normal file
BIN
help/eek.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
@ -81,22 +81,22 @@ typedef struct
|
|||||||
|
|
||||||
/* constant strings */
|
/* constant strings */
|
||||||
|
|
||||||
static char *doc_not_found_string =
|
static char *doc_not_found_format_string =
|
||||||
"<html><head><title>Document not found</title></head>"
|
"<html><head><title>Document not found</title></head>"
|
||||||
"<body bgcolor=\"#ffffff\">"
|
"<body bgcolor=\"#ffffff\">"
|
||||||
"<center>"
|
"<center>"
|
||||||
"<h1>Error</h1>"
|
"%s"
|
||||||
"<h2>Couldn't find document</h2>"
|
"<h2>Couldn't find document</h2>"
|
||||||
"%s"
|
"%s"
|
||||||
"</center>"
|
"</center>"
|
||||||
"</body>"
|
"</body>"
|
||||||
"</html>";
|
"</html>";
|
||||||
|
|
||||||
static char *dir_not_found_string =
|
static char *dir_not_found_format_string =
|
||||||
"<html><head><title>Directory not found</title></head>"
|
"<html><head><title>Directory not found</title></head>"
|
||||||
"<body bgcolor=\"#ffffff\">"
|
"<body bgcolor=\"#ffffff\">"
|
||||||
"<center>"
|
"<center>"
|
||||||
"<h1>Error</h1>"
|
"%s"
|
||||||
"<h2>Couldn't change to directory</h2>"
|
"<h2>Couldn't change to directory</h2>"
|
||||||
"%s"
|
"%s"
|
||||||
"</center>"
|
"</center>"
|
||||||
@ -136,10 +136,14 @@ static HelpPage pages[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
static HelpPage *current_page = &pages[HELP];
|
static HelpPage *current_page = &pages[HELP];
|
||||||
static GtkWidget *back_button, *forward_button;
|
static GList *history = NULL;
|
||||||
|
|
||||||
|
static GtkWidget *back_button;
|
||||||
|
static GtkWidget *forward_button;
|
||||||
static GtkWidget *notebook;
|
static GtkWidget *notebook;
|
||||||
static GtkWidget *combo;
|
static GtkWidget *combo;
|
||||||
static GList *history = NULL;
|
|
||||||
|
static gchar *eek_png_tag = "<h1>Eeek!</h1>\n";
|
||||||
|
|
||||||
/* GIMP plugin stuff */
|
/* GIMP plugin stuff */
|
||||||
|
|
||||||
@ -163,7 +167,6 @@ static void load_page (HelpPage *source_page, HelpPage *dest_page,
|
|||||||
gchar *ref, gint pos,
|
gchar *ref, gint pos,
|
||||||
gboolean add_to_queue, gboolean add_to_history);
|
gboolean add_to_queue, gboolean add_to_history);
|
||||||
|
|
||||||
|
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -188,7 +191,7 @@ jump_to_anchor (HelpPage *page,
|
|||||||
{
|
{
|
||||||
gint pos;
|
gint pos;
|
||||||
|
|
||||||
g_return_if_fail ( page != NULL && anchor != NULL );
|
g_return_if_fail (page != NULL && anchor != NULL);
|
||||||
|
|
||||||
if (*anchor != '#')
|
if (*anchor != '#')
|
||||||
{
|
{
|
||||||
@ -242,6 +245,7 @@ entry_changed_callback (GtkWidget *widget,
|
|||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GList *list;
|
GList *list;
|
||||||
|
HistoryItem *item;
|
||||||
gchar *entry_text;
|
gchar *entry_text;
|
||||||
gchar *compare_text;
|
gchar *compare_text;
|
||||||
gboolean found = FALSE;
|
gboolean found = FALSE;
|
||||||
@ -250,21 +254,22 @@ entry_changed_callback (GtkWidget *widget,
|
|||||||
|
|
||||||
for (list = history; list && !found; list = list->next)
|
for (list = history; list && !found; list = list->next)
|
||||||
{
|
{
|
||||||
if (((HistoryItem *) list->data)->count)
|
item = (HistoryItem *) list->data;
|
||||||
|
|
||||||
|
if (item->count)
|
||||||
compare_text = g_strdup_printf ("%s <%i>",
|
compare_text = g_strdup_printf ("%s <%i>",
|
||||||
((HistoryItem *) list->data)->title,
|
item->title,
|
||||||
((HistoryItem *) list->data)->count + 1);
|
item->count + 1);
|
||||||
else
|
else
|
||||||
compare_text = ((HistoryItem *) list->data)->title;
|
compare_text = item->title;
|
||||||
|
|
||||||
if (strcmp (compare_text, entry_text) == 0)
|
if (strcmp (compare_text, entry_text) == 0)
|
||||||
{
|
{
|
||||||
load_page (&pages[HELP], &pages[HELP],
|
load_page (&pages[HELP], &pages[HELP], item->ref, 0, TRUE, FALSE);
|
||||||
((HistoryItem *) list->data)->ref, 0, TRUE, FALSE);
|
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((HistoryItem *) list->data)->count)
|
if (item->count)
|
||||||
g_free (compare_text);
|
g_free (compare_text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -275,15 +280,17 @@ history_add (gchar *ref,
|
|||||||
{
|
{
|
||||||
GList *list;
|
GList *list;
|
||||||
GList *found = NULL;
|
GList *found = NULL;
|
||||||
HistoryItem *item = NULL;
|
HistoryItem *item;
|
||||||
GList *combo_list = NULL;
|
GList *combo_list = NULL;
|
||||||
gint title_found_count = 0;
|
gint title_found_count = 0;
|
||||||
|
|
||||||
for (list = history; list && !found; list = list->next)
|
for (list = history; list && !found; list = list->next)
|
||||||
{
|
{
|
||||||
if (strcmp (((HistoryItem *) list->data)->title, title) == 0)
|
item = (HistoryItem *) list->data;
|
||||||
|
|
||||||
|
if (strcmp (item->title, title) == 0)
|
||||||
{
|
{
|
||||||
if (strcmp (((HistoryItem *) list->data)->ref, ref) != 0)
|
if (strcmp (item->ref, ref) != 0)
|
||||||
{
|
{
|
||||||
title_found_count++;
|
title_found_count++;
|
||||||
continue;
|
continue;
|
||||||
@ -312,12 +319,14 @@ history_add (gchar *ref,
|
|||||||
{
|
{
|
||||||
gchar* combo_title;
|
gchar* combo_title;
|
||||||
|
|
||||||
if (((HistoryItem *) list->data)->count)
|
item = (HistoryItem *) list->data;
|
||||||
|
|
||||||
|
if (item->count)
|
||||||
combo_title = g_strdup_printf ("%s <%i>",
|
combo_title = g_strdup_printf ("%s <%i>",
|
||||||
((HistoryItem *) list->data)->title,
|
item->title,
|
||||||
((HistoryItem *) list->data)->count + 1);
|
item->count + 1);
|
||||||
else
|
else
|
||||||
combo_title = g_strdup (((HistoryItem *) list->data)->title);
|
combo_title = g_strdup (item->title);
|
||||||
|
|
||||||
combo_list = g_list_prepend (combo_list, combo_title);
|
combo_list = g_list_prepend (combo_list, combo_title);
|
||||||
}
|
}
|
||||||
@ -405,7 +414,8 @@ load_page (HelpPage *source_page,
|
|||||||
|
|
||||||
if (chdir (new_dir) == -1)
|
if (chdir (new_dir) == -1)
|
||||||
{
|
{
|
||||||
g_string_sprintf (file_contents, dir_not_found_string, new_dir);
|
g_string_sprintf (file_contents, dir_not_found_format_string,
|
||||||
|
eek_png_tag, new_dir);
|
||||||
if (g_path_is_absolute (ref))
|
if (g_path_is_absolute (ref))
|
||||||
new_ref = g_strdup (ref);
|
new_ref = g_strdup (ref);
|
||||||
else
|
else
|
||||||
@ -442,7 +452,8 @@ load_page (HelpPage *source_page,
|
|||||||
if (strlen (file_contents->str) <= 0)
|
if (strlen (file_contents->str) <= 0)
|
||||||
{
|
{
|
||||||
chdir (old_dir);
|
chdir (old_dir);
|
||||||
g_string_sprintf (file_contents, doc_not_found_string, ref);
|
g_string_sprintf (file_contents, doc_not_found_format_string,
|
||||||
|
eek_png_tag, ref);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
page_valid = TRUE;
|
page_valid = TRUE;
|
||||||
@ -517,6 +528,7 @@ pixmap_button_new (gchar **xpm,
|
|||||||
|
|
||||||
button = gtk_button_new ();
|
button = gtk_button_new ();
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (button), 0);
|
gtk_container_set_border_width (GTK_CONTAINER (button), 0);
|
||||||
|
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
||||||
gtk_container_add (GTK_CONTAINER (button), box);
|
gtk_container_add (GTK_CONTAINER (button), box);
|
||||||
|
|
||||||
return (button);
|
return (button);
|
||||||
@ -633,6 +645,7 @@ open_browser_dialog (gchar *path)
|
|||||||
gchar *initial_dir;
|
gchar *initial_dir;
|
||||||
gchar *initial_ref;
|
gchar *initial_ref;
|
||||||
gchar *root_dir;
|
gchar *root_dir;
|
||||||
|
gchar *eek_png_path;
|
||||||
gint i;
|
gint i;
|
||||||
gint argc;
|
gint argc;
|
||||||
gchar **argv;
|
gchar **argv;
|
||||||
@ -653,6 +666,12 @@ open_browser_dialog (gchar *path)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eek_png_path = g_strconcat (root_dir, G_DIR_SEPARATOR_S,
|
||||||
|
"eek.png", NULL);
|
||||||
|
if (access (eek_png_path, R_OK) == 0)
|
||||||
|
eek_png_tag = g_strdup_printf ("<img src=\"%s\">\n", eek_png_path);
|
||||||
|
|
||||||
|
g_free (eek_png_path);
|
||||||
g_free (root_dir);
|
g_free (root_dir);
|
||||||
initial_dir = g_get_current_dir ();
|
initial_dir = g_get_current_dir ();
|
||||||
|
|
||||||
@ -694,6 +713,7 @@ open_browser_dialog (gchar *path)
|
|||||||
gtk_box_pack_end (GTK_BOX (hbox), bbox, FALSE, FALSE, 0);
|
gtk_box_pack_end (GTK_BOX (hbox), bbox, FALSE, FALSE, 0);
|
||||||
|
|
||||||
button = gtk_button_new_with_label ("Close");
|
button = gtk_button_new_with_label ("Close");
|
||||||
|
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
||||||
gtk_container_add (GTK_CONTAINER (bbox), button);
|
gtk_container_add (GTK_CONTAINER (bbox), button);
|
||||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||||
GTK_SIGNAL_FUNC (close_callback), NULL);
|
GTK_SIGNAL_FUNC (close_callback), NULL);
|
||||||
@ -832,7 +852,7 @@ run_temp_proc (char *name,
|
|||||||
GStatusType status = STATUS_SUCCESS;
|
GStatusType status = STATUS_SUCCESS;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
g_print ("starting idle page loader\n");
|
g_print ("starting idle page loader (%i)\n", getpid());
|
||||||
|
|
||||||
/* Make sure all the arguments are there! */
|
/* Make sure all the arguments are there! */
|
||||||
if (nparams != 1)
|
if (nparams != 1)
|
||||||
@ -849,7 +869,7 @@ run_temp_proc (char *name,
|
|||||||
|
|
||||||
gtk_idle_add (idle_load_page, path);
|
gtk_idle_add (idle_load_page, path);
|
||||||
|
|
||||||
g_print ("idle page loader started\n");
|
g_print ("idle page loader started (%i)\n", getpid());
|
||||||
|
|
||||||
*nreturn_vals = 1;
|
*nreturn_vals = 1;
|
||||||
*return_vals = values;
|
*return_vals = values;
|
||||||
@ -869,11 +889,11 @@ input_callback (GIOChannel *channel,
|
|||||||
{
|
{
|
||||||
/* We have some data in the wire - read it */
|
/* We have some data in the wire - read it */
|
||||||
/* The below will only ever run a single proc */
|
/* The below will only ever run a single proc */
|
||||||
g_print ("before gimp_run_temp ()\n");
|
g_print ("before gimp_run_temp (%i)\n", getpid());
|
||||||
|
|
||||||
gimp_run_temp ();
|
gimp_run_temp ();
|
||||||
|
|
||||||
g_print ("after gimp_run_temp ()\n");
|
g_print ("after gimp_run_temp (%i)\n", getpid());
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -927,7 +947,7 @@ open_url (gchar *path)
|
|||||||
PARAM_STRING, path,
|
PARAM_STRING, path,
|
||||||
PARAM_END);
|
PARAM_END);
|
||||||
|
|
||||||
g_print ("after run_procedure()\n");
|
g_print ("after run_procedure(%i)\n", getpid());
|
||||||
|
|
||||||
if (return_params[0].data.d_status == STATUS_SUCCESS)
|
if (return_params[0].data.d_status == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user