mirror of https://github.com/GNOME/gimp.git
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:
parent
10510384d8
commit
2010d3a822
12
ChangeLog
12
ChangeLog
|
@ -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>
|
||||
|
||||
* tools/gimp-remote.c: new file
|
||||
|
||||
This is a first implementation of a remote control for gimp.
|
||||
It synthesizes a drag'n'drop event on the toolbox to make
|
||||
Gimp load a file or an URL. Not yet built automatically since
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,6 @@
|
|||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
||||
kernelgen
|
||||
gimp-remote
|
||||
|
|
|
@ -4,6 +4,19 @@ else
|
|||
D_pdbgen=
|
||||
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
|
||||
#D_gcg=gcg
|
||||
#else
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* 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.
|
||||
* version 1.1.3, for Netscape Navigator 1.1 and newer.
|
||||
|
@ -55,8 +55,6 @@
|
|||
* Simon
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <unistd.h>
|
||||
|
@ -123,9 +121,11 @@ gimp_remote_find_window (Display *display)
|
|||
False, WM_STRING,
|
||||
&type, &format, &nitems, &bytesafter,
|
||||
&version);
|
||||
if (status == Success && type != None && nitems > 0) {
|
||||
if (!strcmp (version, "toolbox"))
|
||||
if (!strcmp (version+8, "Gimp")) {
|
||||
|
||||
if (status == Success && type != None && nitems > 0)
|
||||
{
|
||||
if (!strcmp (version, "toolbox") && !strcmp (version+8, "Gimp"))
|
||||
{
|
||||
result = window;
|
||||
break;
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ source_selection_get (GtkWidget *widget,
|
|||
int
|
||||
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");
|
||||
gtk_main_quit ();
|
||||
return 0;
|
||||
|
@ -194,7 +194,8 @@ toolbox_hidden (gpointer data)
|
|||
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkWidget *source;
|
||||
GdkWindow *gimp_window;
|
||||
|
@ -248,37 +249,40 @@ main (int argc, char **argv)
|
|||
g_free (file_uri);
|
||||
|
||||
file_list = tmp;
|
||||
|
||||
}
|
||||
|
||||
if (strlen (file_list) == 0) {
|
||||
g_print (
|
||||
"Usage: gimp-remote [FILE|URI]...\n"
|
||||
if (strlen (file_list) == 0)
|
||||
{
|
||||
g_print ("Usage: gimp-remote [FILE|URI]...\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"
|
||||
" or: gimp-remote localfile.png\n"
|
||||
);
|
||||
" or: gimp-remote localfile.png\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* locate Gimp window and make it comfortable for us */
|
||||
gimp_x_window = gimp_remote_find_window (gdk_display);
|
||||
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);
|
||||
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);
|
||||
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)
|
||||
* it does not accept DnD-Operations and gtk_main() will not be
|
||||
|
@ -326,3 +330,4 @@ main (int argc, char **argv)
|
|||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue