Commit 6b01e792 authored by Sven Neumann's avatar Sven Neumann
Browse files

Display the selection-mode in the statusbar.

Restoring saved sessions works again.


--Sven
parent 7934b3e0
Thu Jul 23 01:53:09 MEST 1998 Sven Neumann <sven@gimp.org>
* app/rect_select.c: Display the selection-mode in the statusbar.
* app/session.c: Restoring saved sessions works again.
Wed Jul 22 23:32:50 MEST 1998 Sven Neumann <sven@gimp.org>
* docs/quick_reference.ps
......
......@@ -54,8 +54,8 @@
#include "session.h"
static void sessionrc_write_info (SessionInfo *, FILE *);
static void session_open_dialog (gpointer unused, gpointer pinfo);
static void session_reset_open_state (SessionInfo *info);
static void session_open_dialog (SessionInfo *);
static void session_reset_open_state (SessionInfo *);
GList *session_info_updates = NULL;
......@@ -198,10 +198,8 @@ sessionrc_write_info (SessionInfo *info, FILE *fp)
}
static void
session_open_dialog (gpointer unused, gpointer pinfo)
session_open_dialog (SessionInfo *info)
{
SessionInfo *info = (SessionInfo*) pinfo;
if (info == NULL || info->open == FALSE)
return;
......
......@@ -315,7 +315,7 @@ rect_select_button_press (Tool *tool,
{
GDisplay * gdisp;
RectSelect * rect_sel;
gchar *size;
gchar *select_mode;
int x, y;
gdisp = (GDisplay *) gdisp_ptr;
......@@ -380,11 +380,27 @@ rect_select_button_press (Tool *tool,
}
rect_sel->context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR(gdisp->statusbar),
"selection");
size = g_new (gchar, 24); /* strlen("Selection: x ") + 2*5 */
sprintf (size, "Selection: %d x %d", abs(rect_sel->w), abs(rect_sel->h));
gtk_statusbar_push(GTK_STATUSBAR (gdisp->statusbar),
rect_sel->context_id, size);
g_free (size);
select_mode = g_new (gchar, 21); /* strlen("Selection: INTERSECT") */
switch (rect_sel->op)
{
case ADD:
sprintf (select_mode, "Selection: ADD");
break;
case SUB:
sprintf (select_mode, "Selection: SUBTRACT");
break;
case INTERSECT:
sprintf (select_mode, "Selection: INTERSECT");
break;
case REPLACE:
sprintf (select_mode, "Selection: REPLACE");
break;
default:
break;
}
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar),
rect_sel->context_id, select_mode);
g_free (select_mode);
draw_core_start (rect_sel->core, gdisp->canvas->window, tool);
}
......@@ -576,7 +592,7 @@ rect_select_motion (Tool *tool,
}
gtk_statusbar_pop (GTK_STATUSBAR(gdisp->statusbar),
rect_sel->context_id);
size = g_new (gchar, 24); /* strlen("Selection: x ") + 2*5 */
size = g_new (gchar, 25); /* strlen("Selection: x ") + 2*5 */
sprintf (size, "Selection: %d x %d", abs(rect_sel->w), abs(rect_sel->h));
gtk_statusbar_push (GTK_STATUSBAR(gdisp->statusbar),
rect_sel->context_id, size);
......
......@@ -54,8 +54,8 @@
#include "session.h"
static void sessionrc_write_info (SessionInfo *, FILE *);
static void session_open_dialog (gpointer unused, gpointer pinfo);
static void session_reset_open_state (SessionInfo *info);
static void session_open_dialog (SessionInfo *);
static void session_reset_open_state (SessionInfo *);
GList *session_info_updates = NULL;
......@@ -198,10 +198,8 @@ sessionrc_write_info (SessionInfo *info, FILE *fp)
}
static void
session_open_dialog (gpointer unused, gpointer pinfo)
session_open_dialog (SessionInfo *info)
{
SessionInfo *info = (SessionInfo*) pinfo;
if (info == NULL || info->open == FALSE)
return;
......
......@@ -315,7 +315,7 @@ rect_select_button_press (Tool *tool,
{
GDisplay * gdisp;
RectSelect * rect_sel;
gchar *size;
gchar *select_mode;
int x, y;
gdisp = (GDisplay *) gdisp_ptr;
......@@ -380,11 +380,27 @@ rect_select_button_press (Tool *tool,
}
rect_sel->context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR(gdisp->statusbar),
"selection");
size = g_new (gchar, 24); /* strlen("Selection: x ") + 2*5 */
sprintf (size, "Selection: %d x %d", abs(rect_sel->w), abs(rect_sel->h));
gtk_statusbar_push(GTK_STATUSBAR (gdisp->statusbar),
rect_sel->context_id, size);
g_free (size);
select_mode = g_new (gchar, 21); /* strlen("Selection: INTERSECT") */
switch (rect_sel->op)
{
case ADD:
sprintf (select_mode, "Selection: ADD");
break;
case SUB:
sprintf (select_mode, "Selection: SUBTRACT");
break;
case INTERSECT:
sprintf (select_mode, "Selection: INTERSECT");
break;
case REPLACE:
sprintf (select_mode, "Selection: REPLACE");
break;
default:
break;
}
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar),
rect_sel->context_id, select_mode);
g_free (select_mode);
draw_core_start (rect_sel->core, gdisp->canvas->window, tool);
}
......@@ -576,7 +592,7 @@ rect_select_motion (Tool *tool,
}
gtk_statusbar_pop (GTK_STATUSBAR(gdisp->statusbar),
rect_sel->context_id);
size = g_new (gchar, 24); /* strlen("Selection: x ") + 2*5 */
size = g_new (gchar, 25); /* strlen("Selection: x ") + 2*5 */
sprintf (size, "Selection: %d x %d", abs(rect_sel->w), abs(rect_sel->h));
gtk_statusbar_push (GTK_STATUSBAR(gdisp->statusbar),
rect_sel->context_id, size);
......
......@@ -315,7 +315,7 @@ rect_select_button_press (Tool *tool,
{
GDisplay * gdisp;
RectSelect * rect_sel;
gchar *size;
gchar *select_mode;
int x, y;
gdisp = (GDisplay *) gdisp_ptr;
......@@ -380,11 +380,27 @@ rect_select_button_press (Tool *tool,
}
rect_sel->context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR(gdisp->statusbar),
"selection");
size = g_new (gchar, 24); /* strlen("Selection: x ") + 2*5 */
sprintf (size, "Selection: %d x %d", abs(rect_sel->w), abs(rect_sel->h));
gtk_statusbar_push(GTK_STATUSBAR (gdisp->statusbar),
rect_sel->context_id, size);
g_free (size);
select_mode = g_new (gchar, 21); /* strlen("Selection: INTERSECT") */
switch (rect_sel->op)
{
case ADD:
sprintf (select_mode, "Selection: ADD");
break;
case SUB:
sprintf (select_mode, "Selection: SUBTRACT");
break;
case INTERSECT:
sprintf (select_mode, "Selection: INTERSECT");
break;
case REPLACE:
sprintf (select_mode, "Selection: REPLACE");
break;
default:
break;
}
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar),
rect_sel->context_id, select_mode);
g_free (select_mode);
draw_core_start (rect_sel->core, gdisp->canvas->window, tool);
}
......@@ -576,7 +592,7 @@ rect_select_motion (Tool *tool,
}
gtk_statusbar_pop (GTK_STATUSBAR(gdisp->statusbar),
rect_sel->context_id);
size = g_new (gchar, 24); /* strlen("Selection: x ") + 2*5 */
size = g_new (gchar, 25); /* strlen("Selection: x ") + 2*5 */
sprintf (size, "Selection: %d x %d", abs(rect_sel->w), abs(rect_sel->h));
gtk_statusbar_push (GTK_STATUSBAR(gdisp->statusbar),
rect_sel->context_id, size);
......
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