build gimp-remote

2000-07-15  Sven Neumann  <neo@wintermute.ochsenblut.de>

        * tools/Makefile.am: build gimp-remote

        * tools/gimp-remote.c: g_error() should only be used
        for fatal errors that can never happen.

        * plug-ins/script-fu/po/pt_BR.po
        * plug-ins/script-fu/po: removed. I guess this was
        accidentally added.
This commit is contained in:
Sven Neumann 2000-07-14 22:08:37 +00:00 committed by Sven Neumann
parent 10510384d8
commit 2010d3a822
5 changed files with 92 additions and 1406 deletions

View File

@ -1,6 +1,18 @@
2000-07-15 Sven Neumann <neo@wintermute.ochsenblut.de>
* tools/Makefile.am: build gimp-remote
* tools/gimp-remote.c: g_error() should only be used
for fatal errors that can never happen.
* plug-ins/script-fu/po/pt_BR.po
* plug-ins/script-fu/po: removed. I guess this was
accidentally added.
2000-07-13 Simon Budig <simon@gimp.org> 2000-07-13 Simon Budig <simon@gimp.org>
* tools/gimp-remote.c: new file * tools/gimp-remote.c: new file
This is a first implementation of a remote control for gimp. This is a first implementation of a remote control for gimp.
It synthesizes a drag'n'drop event on the toolbox to make It synthesizes a drag'n'drop event on the toolbox to make
Gimp load a file or an URL. Not yet built automatically since Gimp load a file or an URL. Not yet built automatically since

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,6 @@
Makefile Makefile
Makefile.in Makefile.in
.deps
.libs
kernelgen kernelgen
gimp-remote

View File

@ -4,6 +4,19 @@ else
D_pdbgen= D_pdbgen=
endif endif
bin_PROGRAMS = gimp-remote
gimp_remote_SOURCES = gimp-remote.c
gimp_remote_LDADD = \
$(GTK_LIBS) \
-lXmu
INCLUDES = \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
-I$(includedir)
#if WITH_GCG #if WITH_GCG
#D_gcg=gcg #D_gcg=gcg
#else #else

View File

@ -25,7 +25,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
/* this file contains code derived from: /* This file contains code derived from:
* *
* remote.c --- remote control of Netscape Navigator for Unix. * remote.c --- remote control of Netscape Navigator for Unix.
* version 1.1.3, for Netscape Navigator 1.1 and newer. * version 1.1.3, for Netscape Navigator 1.1 and newer.
@ -55,8 +55,6 @@
* Simon * Simon
*/ */
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#include <unistd.h> #include <unistd.h>
@ -123,9 +121,11 @@ gimp_remote_find_window (Display *display)
False, WM_STRING, False, WM_STRING,
&type, &format, &nitems, &bytesafter, &type, &format, &nitems, &bytesafter,
&version); &version);
if (status == Success && type != None && nitems > 0) {
if (!strcmp (version, "toolbox")) if (status == Success && type != None && nitems > 0)
if (!strcmp (version+8, "Gimp")) { {
if (!strcmp (version, "toolbox") && !strcmp (version+8, "Gimp"))
{
result = window; result = window;
break; break;
} }
@ -185,7 +185,7 @@ source_selection_get (GtkWidget *widget,
int int
toolbox_hidden (gpointer data) toolbox_hidden (gpointer data)
{ {
g_printerr ("Could not connect to the Gimp. " g_printerr ("Could not connect to the Gimp.\n"
"Make sure that the Toolbox is visible!\n"); "Make sure that the Toolbox is visible!\n");
gtk_main_quit (); gtk_main_quit ();
return 0; return 0;
@ -194,7 +194,8 @@ toolbox_hidden (gpointer data)
int int
main (int argc, char **argv) main (int argc,
char **argv)
{ {
GtkWidget *source; GtkWidget *source;
GdkWindow *gimp_window; GdkWindow *gimp_window;
@ -248,37 +249,40 @@ main (int argc, char **argv)
g_free (file_uri); g_free (file_uri);
file_list = tmp; file_list = tmp;
} }
if (strlen (file_list) == 0) { if (strlen (file_list) == 0)
g_print ( {
"Usage: gimp-remote [FILE|URI]...\n" g_print ("Usage: gimp-remote [FILE|URI]...\n"
"Tell a running Gimp to open a (local or remote) image file\n" "Tell a running Gimp to open a (local or remote) image file\n"
"Example: gimp-remote http://www.gimp.org/icons/frontpage-small.gif\n" "Example: gimp-remote http://www.gimp.org/icons/frontpage-small.gif\n"
" or: gimp-remote localfile.png\n" " or: gimp-remote localfile.png\n");
);
exit(0); exit(0);
} }
gtk_init (&argc, &argv); gtk_init (&argc, &argv);
/* locate Gimp window and make it comfortable for us */ /* locate Gimp window and make it comfortable for us */
gimp_x_window = gimp_remote_find_window (gdk_display); gimp_x_window = gimp_remote_find_window (gdk_display);
if (gimp_x_window == None) if (gimp_x_window == None)
g_error ("no gimp window found on display %s\n", gdk_get_display ()); {
g_printerr ("No gimp window found on display %s\n", gdk_get_display ());
exit (-1);
}
gdk_drag_get_protocol (gimp_x_window, &protocol); gdk_drag_get_protocol (gimp_x_window, &protocol);
if (protocol != GDK_DRAG_PROTO_XDND) if (protocol != GDK_DRAG_PROTO_XDND)
g_error ("Gimp-Window doesnt use Xdnd-Protocol - huh?\n"); {
g_printerr ("Gimp-Window doesnt use Xdnd-Protocol - huh?\n");
exit (-1);
}
gimp_window = gdk_window_foreign_new (gimp_x_window); gimp_window = gdk_window_foreign_new (gimp_x_window);
if (!gimp_window) if (!gimp_window)
g_error ("Couldn't create gdk_window for gimp_x_window\n"); {
g_printerr ("Couldn't create gdk_window for gimp_x_window\n");
exit (-1);
}
/* Problem: If the Toolbox is hidden via Tab (gtk_widget_hide) /* Problem: If the Toolbox is hidden via Tab (gtk_widget_hide)
* it does not accept DnD-Operations and gtk_main() will not be * it does not accept DnD-Operations and gtk_main() will not be
@ -326,3 +330,4 @@ main (int argc, char **argv)
return 0; return 0;
} }