mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
Eliminate warning: ‘gimp_unique_dbus_open’ defined but not used [-Wunused-function]
This commit is contained in:
parent
23a87ce4e3
commit
691ec70c0e
1 changed files with 73 additions and 70 deletions
143
app/unique.c
143
app/unique.c
|
@ -32,15 +32,16 @@
|
||||||
|
|
||||||
#include "unique.h"
|
#include "unique.h"
|
||||||
|
|
||||||
|
#ifndef G_OS_WIN32
|
||||||
static gboolean gimp_unique_dbus_open (const gchar **filenames,
|
static gboolean gimp_unique_dbus_open (const gchar **filenames,
|
||||||
gboolean as_new);
|
gboolean as_new);
|
||||||
#ifdef G_OS_WIN32
|
static gboolean gimp_unique_dbus_batch_run (const gchar *batch_interpreter,
|
||||||
|
const gchar **batch_commands);
|
||||||
|
#else
|
||||||
static gboolean gimp_unique_win32_open (const gchar **filenames,
|
static gboolean gimp_unique_win32_open (const gchar **filenames,
|
||||||
gboolean as_new);
|
gboolean as_new);
|
||||||
#endif
|
#endif
|
||||||
static gboolean gimp_unique_dbus_batch_run (const gchar *batch_interpreter,
|
|
||||||
const gchar **batch_commands);
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gimp_unique_open (const gchar **filenames,
|
gimp_unique_open (const gchar **filenames,
|
||||||
|
@ -81,6 +82,73 @@ gimp_unique_batch_run (const gchar *batch_interpreter,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gimp_unique_win32_open (const gchar **filenames,
|
||||||
|
gboolean as_new)
|
||||||
|
{
|
||||||
|
#ifndef GIMP_CONSOLE_COMPILATION
|
||||||
|
|
||||||
|
/* for the proxy window names */
|
||||||
|
#include "gui/gui-unique.h"
|
||||||
|
|
||||||
|
HWND window_handle = FindWindowW (GIMP_UNIQUE_WIN32_WINDOW_CLASS,
|
||||||
|
GIMP_UNIQUE_WIN32_WINDOW_NAME);
|
||||||
|
|
||||||
|
if (window_handle)
|
||||||
|
{
|
||||||
|
COPYDATASTRUCT copydata = { 0, };
|
||||||
|
|
||||||
|
if (filenames)
|
||||||
|
{
|
||||||
|
gchar *cwd = g_get_current_dir ();
|
||||||
|
gint i;
|
||||||
|
|
||||||
|
for (i = 0; filenames[i]; i++)
|
||||||
|
{
|
||||||
|
GFile *file;
|
||||||
|
file = g_file_new_for_commandline_arg_and_cwd (filenames[i], cwd);
|
||||||
|
|
||||||
|
if (file)
|
||||||
|
{
|
||||||
|
gchar *uri = g_file_get_uri (file);
|
||||||
|
|
||||||
|
copydata.lpData = uri;
|
||||||
|
copydata.cbData = strlen (uri) + 1; /* size in bytes */
|
||||||
|
copydata.dwData = (long) as_new;
|
||||||
|
|
||||||
|
SendMessage (window_handle,
|
||||||
|
WM_COPYDATA, (WPARAM) window_handle, (LPARAM) ©data);
|
||||||
|
|
||||||
|
g_free (uri);
|
||||||
|
g_object_unref (file);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_printerr ("conversion to uri failed for '%s'\n",
|
||||||
|
filenames[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_free (cwd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendMessage (window_handle,
|
||||||
|
WM_COPYDATA, (WPARAM) window_handle, (LPARAM) ©data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_unique_dbus_open (const gchar **filenames,
|
gimp_unique_dbus_open (const gchar **filenames,
|
||||||
gboolean as_new)
|
gboolean as_new)
|
||||||
|
@ -177,72 +245,6 @@ gimp_unique_dbus_open (const gchar **filenames,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gimp_unique_win32_open (const gchar **filenames,
|
|
||||||
gboolean as_new)
|
|
||||||
{
|
|
||||||
#ifndef GIMP_CONSOLE_COMPILATION
|
|
||||||
|
|
||||||
/* for the proxy window names */
|
|
||||||
#include "gui/gui-unique.h"
|
|
||||||
|
|
||||||
HWND window_handle = FindWindowW (GIMP_UNIQUE_WIN32_WINDOW_CLASS,
|
|
||||||
GIMP_UNIQUE_WIN32_WINDOW_NAME);
|
|
||||||
|
|
||||||
if (window_handle)
|
|
||||||
{
|
|
||||||
COPYDATASTRUCT copydata = { 0, };
|
|
||||||
|
|
||||||
if (filenames)
|
|
||||||
{
|
|
||||||
gchar *cwd = g_get_current_dir ();
|
|
||||||
gint i;
|
|
||||||
|
|
||||||
for (i = 0; filenames[i]; i++)
|
|
||||||
{
|
|
||||||
GFile *file;
|
|
||||||
file = g_file_new_for_commandline_arg_and_cwd (filenames[i], cwd);
|
|
||||||
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
gchar *uri = g_file_get_uri (file);
|
|
||||||
|
|
||||||
copydata.lpData = uri;
|
|
||||||
copydata.cbData = strlen (uri) + 1; /* size in bytes */
|
|
||||||
copydata.dwData = (long) as_new;
|
|
||||||
|
|
||||||
SendMessage (window_handle,
|
|
||||||
WM_COPYDATA, (WPARAM) window_handle, (LPARAM) ©data);
|
|
||||||
|
|
||||||
g_free (uri);
|
|
||||||
g_object_unref (file);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_printerr ("conversion to uri failed for '%s'\n",
|
|
||||||
filenames[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (cwd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SendMessage (window_handle,
|
|
||||||
WM_COPYDATA, (WPARAM) window_handle, (LPARAM) ©data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* G_OS_WIN32 */
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_unique_dbus_batch_run (const gchar *batch_interpreter,
|
gimp_unique_dbus_batch_run (const gchar *batch_interpreter,
|
||||||
|
@ -302,3 +304,4 @@ gimp_unique_dbus_batch_run (const gchar *batch_interpreter,
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif /* G_OS_WIN32 */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue