Commit 4517b874 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

removed layers_dialog_idle_set_layer_focus() because Wolfgang pointed out

2000-05-03  Michael Natterer  <mitch@gimp.org>

	* app/layers_dialog.c: removed layers_dialog_idle_set_layer_focus()
	because Wolfgang pointed out that it caused bad segfaults. This
	fixes #10139 and #9844. OTOH this brings back the bug that the
	active layers is sometimes not the selected one in the layers
	dialog, grmpf.

	* plug-ins/script-fu/script-fu-scripts.c: small cleanups.

	* plug-ins/gap/README
	* plug-ins/gap/gap_exchange_image.c
	* plug-ins/gap/gap_lib.[ch]
	* plug-ins/gap/gap_main.c
	* plug-ins/gap/gap_mov_dialog.[ch]
	* plug-ins/gap/gap_mov_exec.[ch]
	* plug-ins/gap/gap_navigator_dialog.c: applied a patch from
	Wolfgang Hofer <hof@hotbot.com>.
parent 1b6211c0
2000-05-03 Michael Natterer <mitch@gimp.org>
* app/layers_dialog.c: removed layers_dialog_idle_set_layer_focus()
because Wolfgang pointed out that it caused bad segfaults. This
fixes #10139 and #9844. OTOH this brings back the bug that the
active layers is sometimes not the selected one in the layers
dialog, grmpf.
* plug-ins/script-fu/script-fu-scripts.c: small cleanups.
* plug-ins/gap/README
* plug-ins/gap/gap_exchange_image.c
* plug-ins/gap/gap_lib.[ch]
* plug-ins/gap/gap_main.c
* plug-ins/gap/gap_mov_dialog.[ch]
* plug-ins/gap/gap_mov_exec.[ch]
* plug-ins/gap/gap_navigator_dialog.c: applied a patch from
Wolfgang Hofer <hof@hotbot.com>.
2000-05-03 Pablo Saratxaga <pablo@mandrakesoft.com>
 
* configure.in,po/ca.po: added Catalan file
* configure.in
* po/ca.po: added Catalan file
 
2000-05-03 Sven Neumann <sven@gimp.org>
 
......
......@@ -1114,6 +1114,7 @@ layers_dialog_scroll_index (gint index)
}
}
/* Commented out because this piece of code produced strange segfaults
static gint
layer_dialog_idle_set_active_layer_focus (gpointer data)
{
......@@ -1121,6 +1122,7 @@ layer_dialog_idle_set_active_layer_focus (gpointer data)
return FALSE;
}
*/
static void
layers_dialog_set_active_layer (Layer *layer)
......@@ -1143,8 +1145,10 @@ layers_dialog_set_active_layer (Layer *layer)
gtk_object_set_user_data (GTK_OBJECT (layer_widget->list_item), NULL);
gtk_list_select_item (GTK_LIST (layersD->layer_list), index);
/* let dnd finish it's work before setting the focus */
/* Commented out because this piece of code produced strange segfaults
gtk_idle_add ((GtkFunction) layer_dialog_idle_set_active_layer_focus,
layer_widget->list_item);
*/
gtk_object_set_user_data (GTK_OBJECT (layer_widget->list_item),
layer_widget);
......
......@@ -1114,6 +1114,7 @@ layers_dialog_scroll_index (gint index)
}
}
/* Commented out because this piece of code produced strange segfaults
static gint
layer_dialog_idle_set_active_layer_focus (gpointer data)
{
......@@ -1121,6 +1122,7 @@ layer_dialog_idle_set_active_layer_focus (gpointer data)
return FALSE;
}
*/
static void
layers_dialog_set_active_layer (Layer *layer)
......@@ -1143,8 +1145,10 @@ layers_dialog_set_active_layer (Layer *layer)
gtk_object_set_user_data (GTK_OBJECT (layer_widget->list_item), NULL);
gtk_list_select_item (GTK_LIST (layersD->layer_list), index);
/* let dnd finish it's work before setting the focus */
/* Commented out because this piece of code produced strange segfaults
gtk_idle_add ((GtkFunction) layer_dialog_idle_set_active_layer_focus,
layer_widget->list_item);
*/
gtk_object_set_user_data (GTK_OBJECT (layer_widget->list_item),
layer_widget);
......
Project gap "Gimp Animation Package" 17. Mar 1999 release 0.99.00
Project gap "Gimp Animation Package" 01. May 2000 release 1.1.20a
--------------------------------------------------------------------
Introduction
......@@ -130,6 +130,18 @@ Write (encode)
--------------------------------------------------------------------
Change Log
--------------------------------------------------------------------
- 1.1.20a - MovePath
- AnimPreview
- Keyframes
- Force visibility
- VCR Navigator
Popup menu
copy,
cut
paste before
paste after
paste replace
clear pastebuffer
- 0.99.00 - Move Path bugfix in the dialog
(update preview did'nt work with gimp 1.1.2 and gtk 1.1)
- Animated Filtercalls:
......@@ -327,12 +339,102 @@ WebTip: My GIMP-page http://pages.hotbot.com/arts/hof/index.html
walk through the frames.
Here are my settings (excerpt from my $HOME/.gimp/menurc )
(menu-path "<Image>/Video/Goto First" "<control><alt>1")
(menu-path "<Image>/Video/Goto Prev" "<alt>1")
(menu-path "<Image>/Video/Goto Next" "<alt>2")
(menu-path "<Image>/Video/Goto Any" "<alt>3")
(menu-path "<Image>/Video/Goto Last" "<control><alt>2")
(menu-path "<Image>/Video/Goto/First Frame" "<control><alt>1")
(menu-path "<Image>/Video/Goto/Prev Frame" "<alt>1")
(menu-path "<Image>/Video/Goto/Next Frame" "<alt>2")
(menu-path "<Image>/Video/Goto/Any Frame" "<alt>3")
(menu-path "<Image>/Video/Goto/Last Frame" "<control><alt>2")
Alternative you may open the GAP Video Navigator Dialog
(menu-path "<Image>/Video/VCR Navigator)
- GAP VCR Navigator:
The VCR Navigator Dialog shows icons frame_number and
time (mm:ss:msec) of the frames in a scrollable listbox.
framerate:
You can set the global framerate for all frames here.
timezoom:
with timezoom you tell theVCR Navigator Dialog Window
to display ever n-th frame only, to get an overview
on larger videos.
Framerate and timezoom values are stores in
a gap vide info file named:
<framebasename>_vin.gap
Double Click with Left Mousebutton on a frame in the listbox
performs a goto operation, which loads the clicked
frame as current frame.
Single Click with Left Mousebutton
selecets one frame (deselecting all others)
Ctrl Clickwith Left Mousebutton
selecets one frame (additional to the current selection)
Shift Click with Left Mousebutton
selects a range of frames.
Click with Right Mousebutton
brings up a PopUp Menu
Popup menu
copy,
cut
paste before
paste after
paste replace
clear pastebuffer
cut and copy
is sensitive if any frame is selected,
paste* and clear pastebuffer
is sensitive if video paste buffer contains
at least one frame.
This menu enables you to cut/copy and paste the selected
frames even between different videos.
Size and type of the handled frames are converted at pasting
if needed.
The Palette of the current frame is used for the
pasted frames when the destination type is INDEXED.
There are 3 types of paste:
before:
Insert Frames before the current frame.
Use this mode if you want to insert frames
before the first frame.
after:
Insert Frames after the current frame.
Use this mode if you want to insert frames
after the last frame.
replace:
Replace Frames beginning at the current frame
with the frames from the video paste buffer.
If there are selected frames in the VCR navigator
Dialog Window, the current frame is set to
the first selected frame and the paste opration
is releted to the first selected frame
The paste buffer is located in the filesystem
and can be configured in the gimprc file:
(video-paste-dir "/home/hof/gap_video_paste_dir")
(video-paste-basename "gap_video_paste_")
The Duplicate Button in the VCR Navigator Dialog
duplicates the selected frames immediate into
the current Video, without writing to the
video paste buffer.
The Delete Button in the VCR Navigator Dialog
deletes the selected frames without writing to the
video paste buffer.
IMPORTANT NOTE:
There is no undo for GAP operations,
so the deleted Frames cannot be restored.
- Playback
playbak of multilayered image is not available.
......@@ -340,7 +442,12 @@ WebTip: My GIMP-page http://pages.hotbot.com/arts/hof/index.html
But you can convert your frames to one Multilayer Image
(Video->Frames to Image)
And then playback the newly created Image
(Filters->Animation->Playback)
(Filters->Animation->Playback)
The GAP Video Navigator Dialog Playback Button
does as described above automatic for all selected
Frames.
- Move Path (Make Things Move)
For this Plugin you need a series of frames
......@@ -400,6 +507,49 @@ WebTip: My GIMP-page http://pages.hotbot.com/arts/hof/index.html
in the "Mov Path Preview".
You first have to Adjust the PreviewFrame
then press the "UpdPreview" Button.
Controlpoints:
The move path is defined by contolpoints.
Only the Current Cotrolpoint is displyed with all
its values.
If checkbutton "Show Path" is on, all the Controlpoints
are shown in the Preview window, connected with pathlines.
Furter it enables picking controlpoints
and draging controlpoint koordinates (X/Y).
in the Preview with the Left Mousebutton.
With the Right Mousebutton you always drag
the koordinates of the current controlpoint
(without picking other controlpoints)
There are Buttons to
"Add Point"
"Insert Point" "Delete Point"
With the Buttons
"Prev Point" "Next Point"
"First Point" "Last Point"
you can step from point to point,
and make other points to the curremt point.
"Clear Point"
does reset Witdh, Height and Opacity of the point to 100%
and Rotat to 0 degree.
"Reset Points"
removes all controlpoints.
"Save Points"
saves your controlpoints to file
"Load Points"
loads controlpoints from file
Tips:
- with the UpdPreview Button you can blend in the
......@@ -418,6 +568,7 @@ WebTip: My GIMP-page http://pages.hotbot.com/arts/hof/index.html
moves of your object, caused by resizing)
- Speed:
If no Keyframes are set,
Move path alternates the settings linear from
point to point, so things move (or happen) in constant speed
between 2 Points.
......@@ -435,8 +586,77 @@ WebTip: My GIMP-page http://pages.hotbot.com/arts/hof/index.html
That gives 5 frames (== equal time) for each part of the path,
but each part has another length. This results in different
(growing) speeds for each part of the path.
- Keyframes
Keyframes can be used optional, to fix a controlpoint
to the given frame number. The first and last controlpoints
are implicite keyframes, always fixed to start or end
frame number. (The Keyframe entry is set insensitive
on the first and last contolpoint)
With the Help of Keyframes you can control exactly
when things should happen.
Use a Value of 0 in the Keyframe entry if you dont want
to fix a controlpoint to a keyframe.
Keyframes are shown as Absolute Frame Number
in the Move Path Dialog Window, but they
are saved as relative values in the
pointfile.
(if StartFrame = 5
and a Keyframe is displayed as 7
the Keyframe is internally stored as 2 (7 - 5)
- Check Controlpoints
- The Check is done at "OK", and "Anim Preview"
button,
If Errors are detected, they are shown
in a Popup Window and the action is not performed.
- The number of cntrolpoints is now checked
against the number of affected frames.
(You can't have more controlpoints than frames)
- If Keyframes are used, they must be in
(ascending or descending) sequence
- AnimPreview
With this button You can generate an Animated Preview
to get an idea how the Inserted moving Object
will look like. The Animated Preview is generated
as Multilayer Image and the Filter/Animation/Playback
Plugin is started on that Multilayer Image.
The Button opens a Dialog Window, where you can
enter options for the animated preview.
- Object on empty frames
renders quick on empty frames (filled with BG color)
(scale down speeds up rendering time)
- Object on one frame
renders quick on one frame (preview frame)
(scale down speeds up rendering time)
- Exact Object on frames
renders slow, but exactly on the selected framerange.
(scale down increases rendering time)
- Scale Preview
Optional you can scale down the Animated Preview
Size (100% downto 5%)
- Framerate
The Framerate is used in the generated
Multilayer Image only.
- Copy to Video Buffer
Optional you can copy the preview frames
to the Video Buffer
(can be pasted in the GAP Video Navigator)
- Force visibility
If this checkbutton is set, all Source Layerobjects
are set visible when they are copied into frames.
- Convert frames to one multilayered Image.
This can be done with
......
......@@ -28,6 +28,8 @@
*/
/* revision history:
* 1.1.20a 2000/04/29 hof: bugfix in p_steal_content: we must copy cmap before removing layers
* from src_image to avoid crash on indexed frames.
* 1.1.16a 2000/02/05 hof: handle path lockedstaus and image unit
* 1.1.15b 2000/01/30 hof: handle image specific parasites
* 1.1.15a 2000/01/25 hof: stopped gimp 1.0.x support (removed p_copy_content)
......@@ -52,6 +54,7 @@
#include "gap_layer_copy.h"
#include "gap_pdb_calls.h"
#include "gap_exchange_image.h"
#include "gap_lib.h"
extern int gap_debug; /* ==0 ... dont print debug infos */
......@@ -115,6 +118,18 @@ p_steal_content(gint32 dst_image_id, gint32 src_image_id)
if(gap_debug) printf("GAP-DEBUG: START p_steal_content dst_id=%d src_id=%d\n", (int)dst_image_id, (int)src_image_id);
/* gimp_image_undo_disable (src_image_id); */ /* does not work !! if active we can not steal layers */
/* Copy the colormap if necessary */
if(gimp_image_base_type(src_image_id) == INDEXED)
{
l_cmap = gimp_image_get_cmap (src_image_id, &l_ncolors);
if(gap_debug) printf("GAP-DEBUG: copy colormap ncolors %d\n", (int)l_ncolors);
gimp_image_set_cmap(dst_image_id, l_cmap, l_ncolors);
}
/* check for floating selection */
l_src_fsel_attached_to_id = -1;
......@@ -135,7 +150,7 @@ p_steal_content(gint32 dst_image_id, gint32 src_image_id)
for(l_idx = l_nlayers -1; l_idx >= 0; l_idx--)
{
l_layer_id = l_layers_list[l_idx];
if(gap_debug) printf("GAP-DEBUG: START p_steal_content layer_id=%d\n", (int)l_layer_id);
if(gap_debug) printf("GAP-DEBUG: START p_steal_content layer_id[%d]=%d\n", (int)l_idx, (int)l_layer_id);
if(l_layer_id == gimp_image_get_active_layer(src_image_id))
......@@ -263,15 +278,6 @@ p_steal_content(gint32 dst_image_id, gint32 src_image_id)
gimp_image_set_active_layer(dst_image_id, l_active_layer_id);
}
/* Copy the colormap if necessary */
if(gimp_image_base_type(src_image_id) == INDEXED)
{
l_cmap = gimp_image_get_cmap (src_image_id, &l_ncolors);
if(gap_debug) printf("GAP-DEBUG: copy colormap ncolors %d\n", (int)l_ncolors);
gimp_image_set_cmap(dst_image_id, l_cmap, l_ncolors);
}
/* copy guides */
l_guide_id = p_gimp_image_findnext_guide(src_image_id, 0); /* get 1.st guide */
while(l_guide_id > 0)
......@@ -346,25 +352,21 @@ p_steal_content(gint32 dst_image_id, gint32 src_image_id)
l_rc = 0;
cleanup:
if(l_layers_list) g_free (l_layers_list);
if(l_channels_list) g_free (l_channels_list);
if(gap_debug) printf("GAP-DEBUG: END p_steal_content dst_id=%d src_id=%d rc=%d\n",
(int)dst_image_id, (int)src_image_id, l_rc);
return (l_rc); /* 0 .. OK, or -1 on error */
} /* end p_steal_content */
/* ============================================================================
* p_replace_img
*
* This procedure replaces the content of image_id
* with the content from src_image_id.
* By copying or stealing all its layers and channels.
* (stealing is faster, but requres extensions to the GIMP-core).
* By stealing all its layers and channels.
* ============================================================================
*/
......@@ -472,7 +474,6 @@ p_replace_img(gint32 image_id, gint32 src_image_id)
}
}
/* steal all layers, channels and guides from src_image */
l_rc = p_steal_content(image_id, src_image_id);
......
......@@ -28,6 +28,7 @@
*/
/* revision history:
* 1.1.20a; 2000/04/25 hof: new: p_get_video_paste_name p_vid_edit_clear
* 1.1.17b; 2000/02/27 hof: bug/style fixes
* 1.1.14a; 1999/12/18 hof: handle .xvpics on fileops (copy, rename and delete)
* new: p_get_frame_nr,
......@@ -89,6 +90,11 @@
# endif
#endif
#ifdef G_OS_WIN32
#include <direct.h> /* For _mkdir() */
#define mkdir(path,mode) _mkdir(path)
#endif
/* GAP includes */
#include "gap_layer_copy.h"
#include "gap_lib.h"
......@@ -1394,10 +1400,15 @@ int p_load_named_frame (gint32 image_id, char *lod_name)
}
/* delete the temporary image (old content of the original image) */
if(gap_debug) printf("p_load_named_frame: BEFORE gimp_image_delete %d\n", (int)l_tmp_image_id);
gimp_image_delete(l_tmp_image_id);
if(gap_debug) printf("p_load_named_frame: AFTER gimp_image_delete %d\n", (int)l_tmp_image_id);
/* use the original lod_name */
gimp_image_set_filename (image_id, lod_name);
/* dont consider image dirty after load */
gimp_image_clean_all(image_id);
return image_id;
} /* end p_load_named_frame */
......@@ -2363,3 +2374,472 @@ int gap_shift(GRunModeType run_mode, gint32 image_id, int nr,
} /* end gap_shift */
/* ============================================================================
* gap_video_paste Buffer procedures
* ============================================================================
*/
gchar *
p_get_video_paste_basename(void)
{
gchar *l_basename;
l_basename = p_gimp_gimprc_query("video-paste-basename");
if(l_basename == NULL)
{
l_basename = g_strdup("gap_video_pastebuffer_");
}
return(l_basename);
}
gchar *
p_get_video_paste_dir(void)
{
gchar *l_dir;
gint l_len;
l_dir = p_gimp_gimprc_query("video-paste-dir");
if(l_dir == NULL)
{
l_dir = g_strdup("/tmp");
}
/* if dir is configured with trailing dir seprator slash
* then cut it off
*/
l_len = strlen(l_dir);
if((l_dir[l_len -1] == G_DIR_SEPARATOR) && (l_len > 1))
{
l_dir[l_len -1] = '\0';
}
return(l_dir);
}
gchar *
p_get_video_paste_name(void)
{
gchar *l_dir;
gchar *l_basename;
gchar *l_video_name;
gchar *l_dir_thumb;
l_dir = p_get_video_paste_dir();
l_basename = p_get_video_paste_basename();
l_video_name = g_strdup_printf("%s%s%s", l_dir, G_DIR_SEPARATOR_S, l_basename);
l_dir_thumb = g_strdup_printf("%s%s%s", l_dir, G_DIR_SEPARATOR_S, ".xvpics");
mkdir (l_dir_thumb, 0755);
g_free(l_dir);
g_free(l_basename);
g_free(l_dir_thumb);
if(gap_debug) printf("p_get_video_paste_name: %s\n", l_video_name);
return(l_video_name);
}
static gint32
p_clear_or_count_video_paste(gint delete_flag)
{
gchar *l_dir;
gchar *l_basename;
gchar *l_filename;
gchar *l_fname_thumbnail;
gint l_len;
gint32 l_framecount;
DIR *l_dirp;
struct dirent *l_dp;
l_dir = p_get_video_paste_dir();
l_dirp = opendir(l_dir);
l_framecount = 0;
if(!l_dirp)
{
printf("ERROR p_vid_edit_clear: cant read directory %s\n", l_dir);
l_framecount = -1;
}
else
{
l_basename = p_get_video_paste_basename();
l_len = strlen(l_basename);
while ( (l_dp = readdir( l_dirp )) != NULL )
{
if(strncmp(l_basename, l_dp->d_name, l_len) == 0)
{
l_filename = g_strdup_printf("%s%s%s", l_dir, G_DIR_SEPARATOR_S, l_dp->d_name);
if(1 == p_file_exists(l_filename)) /* check for regular file */
{
/* delete all files in the video paste directory
* with names matching the basename part
*/
l_framecount++;
if(delete_flag)
{
if(gap_debug) printf("p_vid_edit_clear: remove file %s\n", l_filename);
remove(l_filename);
/* also delete thumbnail */
l_fname_thumbnail = p_alloc_fname_thumbnail(l_filename);
remove(l_fname_thumbnail);
g_free(l_fname_thumbnail);
}
}
g_free(l_filename);
}
}
closedir( l_dirp );
g_free(l_basename);
}
g_free(l_dir);
return(l_framecount);
}
gint32
p_vid_edit_clear(void)
{
return(p_clear_or_count_video_paste(TRUE)); /* delete frames */
}
gint32
p_vid_edit_framecount()
{
return (p_clear_or_count_video_paste(FALSE)); /* delete_flag is off, just count frames */
}
/* ============================================================================
* gap_vid_edit_copy
* ============================================================================
*/
gint
gap_vid_edit_copy(GRunModeType run_mode, gint32 image_id, long range_from, long range_to)
{
int rc;
t_anim_info *ainfo_ptr;
gchar *l_curr_name;
gchar *l_fname ;
gchar *l_fname_copy;
gchar *l_basename;