mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
added GIMP_MODULE_ERROR domain.
2008-11-12 Sven Neumann <sven@gimp.org> * libgimpmodule/gimpmodule.[ch]: added GIMP_MODULE_ERROR domain. * modules/gimpinputdevicestore-hal.c * modules/gimpinputdevicestore-dx.c * modules/controller-dx-dinput.c: use GIMP_MODULE_ERROR as error domain instead of 0. svn path=/trunk/; revision=27629
This commit is contained in:
parent
b37c8bcf0a
commit
7fa22ebf17
6 changed files with 61 additions and 15 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2008-11-12 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpmodule/gimpmodule.[ch]: added GIMP_MODULE_ERROR domain.
|
||||||
|
|
||||||
|
* modules/gimpinputdevicestore-hal.c
|
||||||
|
* modules/gimpinputdevicestore-dx.c
|
||||||
|
* modules/controller-dx-dinput.c: use GIMP_MODULE_ERROR as error
|
||||||
|
domain instead of 0.
|
||||||
|
|
||||||
2008-11-12 Sven Neumann <sven@gimp.org>
|
2008-11-12 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/core/Makefile.am
|
* app/core/Makefile.am
|
||||||
|
|
|
@ -402,6 +402,21 @@ gimp_module_register_enum (GTypeModule *module,
|
||||||
return g_type_module_register_enum (module, name, const_static_values);
|
return g_type_module_register_enum (module, name, const_static_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_module_error_quark:
|
||||||
|
*
|
||||||
|
* This function is never called directly. Use GIMP_MODULE_ERROR() instead.
|
||||||
|
*
|
||||||
|
* Return value: the #GQuark that defines the GIMP module error domain.
|
||||||
|
*
|
||||||
|
* Since: GIMP 2.8
|
||||||
|
**/
|
||||||
|
GQuark
|
||||||
|
gimp_module_error_quark (void)
|
||||||
|
{
|
||||||
|
return g_quark_from_static_string ("gimp-module-error-quark");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* private functions */
|
/* private functions */
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,16 @@ typedef enum
|
||||||
} GimpModuleState;
|
} GimpModuleState;
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_MODULE_ERROR (gimp_module_error_quark ())
|
||||||
|
|
||||||
|
GQuark gimp_module_error_quark (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GIMP_MODULE_FAILED /* generic error condition */
|
||||||
|
} GimpModuleError;
|
||||||
|
|
||||||
|
|
||||||
struct _GimpModuleInfo
|
struct _GimpModuleInfo
|
||||||
{
|
{
|
||||||
guint32 abi_version;
|
guint32 abi_version;
|
||||||
|
|
|
@ -550,7 +550,7 @@ dx_dinput_get_device_info (ControllerDXDInput *controller,
|
||||||
DIDFT_RELAXIS|
|
DIDFT_RELAXIS|
|
||||||
DIDFT_TGLBUTTON))))
|
DIDFT_TGLBUTTON))))
|
||||||
{
|
{
|
||||||
g_set_error (error, 0, 0,
|
g_set_error (error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
"IDirectInputDevice8::EnumObjects failed: %s",
|
"IDirectInputDevice8::EnumObjects failed: %s",
|
||||||
g_win32_error_message (hresult));
|
g_win32_error_message (hresult));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -590,7 +590,7 @@ dx_dinput_get_device_info (ControllerDXDInput *controller,
|
||||||
g_free (controller->event_names);
|
g_free (controller->event_names);
|
||||||
g_free (controller->event_blurbs);
|
g_free (controller->event_blurbs);
|
||||||
|
|
||||||
g_set_error (error, 0, 0,
|
g_set_error (error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
"IDirectInputDevice8::EnumObjects failed: %s",
|
"IDirectInputDevice8::EnumObjects failed: %s",
|
||||||
g_win32_error_message (hresult));
|
g_win32_error_message (hresult));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -916,7 +916,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
|
||||||
|
|
||||||
if ((controller->event = CreateEvent (NULL, TRUE, FALSE, NULL)) == NULL)
|
if ((controller->event = CreateEvent (NULL, TRUE, FALSE, NULL)) == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (error, 0, 0,
|
g_set_error (error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
"CreateEvent failed: %s",
|
"CreateEvent failed: %s",
|
||||||
g_win32_error_message (GetLastError ()));
|
g_win32_error_message (GetLastError ()));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -936,7 +936,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
|
||||||
DIPROP_AXISMODE,
|
DIPROP_AXISMODE,
|
||||||
&dword.diph))))
|
&dword.diph))))
|
||||||
{
|
{
|
||||||
g_set_error (error, 0, 0,
|
g_set_error (error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
"IDirectInputDevice8::GetParameters failed: %s",
|
"IDirectInputDevice8::GetParameters failed: %s",
|
||||||
g_win32_error_message (hresult));
|
g_win32_error_message (hresult));
|
||||||
goto fail0;
|
goto fail0;
|
||||||
|
@ -1007,7 +1007,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
|
||||||
if (FAILED ((hresult = IDirectInputDevice8_SetDataFormat (controller->didevice8,
|
if (FAILED ((hresult = IDirectInputDevice8_SetDataFormat (controller->didevice8,
|
||||||
controller->format))))
|
controller->format))))
|
||||||
{
|
{
|
||||||
g_set_error (error, 0, 0,
|
g_set_error (error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
"IDirectInputDevice8::SetDataFormat failed: %s",
|
"IDirectInputDevice8::SetDataFormat failed: %s",
|
||||||
g_win32_error_message (hresult));
|
g_win32_error_message (hresult));
|
||||||
goto fail1;
|
goto fail1;
|
||||||
|
@ -1016,7 +1016,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
|
||||||
if (FAILED ((hresult = IDirectInputDevice8_SetEventNotification (controller->didevice8,
|
if (FAILED ((hresult = IDirectInputDevice8_SetEventNotification (controller->didevice8,
|
||||||
controller->event))))
|
controller->event))))
|
||||||
{
|
{
|
||||||
g_set_error (error, 0, 0,
|
g_set_error (error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
"IDirectInputDevice8::SetEventNotification failed: %s",
|
"IDirectInputDevice8::SetEventNotification failed: %s",
|
||||||
g_win32_error_message (hresult));
|
g_win32_error_message (hresult));
|
||||||
goto fail2;
|
goto fail2;
|
||||||
|
@ -1024,7 +1024,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
|
||||||
|
|
||||||
if (FAILED ((hresult = IDirectInputDevice8_Acquire (controller->didevice8))))
|
if (FAILED ((hresult = IDirectInputDevice8_Acquire (controller->didevice8))))
|
||||||
{
|
{
|
||||||
g_set_error (error, 0, 0,
|
g_set_error (error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
"IDirectInputDevice8::Acquire failed: %s",
|
"IDirectInputDevice8::Acquire failed: %s",
|
||||||
g_win32_error_message (hresult));
|
g_win32_error_message (hresult));
|
||||||
goto fail2;
|
goto fail2;
|
||||||
|
@ -1034,7 +1034,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
|
||||||
controller->format->dwDataSize,
|
controller->format->dwDataSize,
|
||||||
controller->prevdata))))
|
controller->prevdata))))
|
||||||
{
|
{
|
||||||
g_set_error (error, 0, 0,
|
g_set_error (error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
"IDirectInputDevice8::GetDeviceState failed: %s",
|
"IDirectInputDevice8::GetDeviceState failed: %s",
|
||||||
g_win32_error_message (hresult));
|
g_win32_error_message (hresult));
|
||||||
goto fail2;
|
goto fail2;
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
|
|
||||||
#include <gdk/gdkwin32.h>
|
#include <gdk/gdkwin32.h>
|
||||||
|
|
||||||
|
#include "libgimpmodule/gimpmodule.h"
|
||||||
|
|
||||||
#include "gimpinputdevicestore.h"
|
#include "gimpinputdevicestore.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -210,19 +212,22 @@ gimp_input_device_store_init (GimpInputDeviceStore *store)
|
||||||
|
|
||||||
if ((store->window = create_aux_window (store)) == NULL)
|
if ((store->window = create_aux_window (store)) == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (&store->error, 0, 0, "Could not create aux window");
|
g_set_error_literal (&store->error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
|
"Could not create aux window");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dinput8 = LoadLibrary ("dinput8.dll")) == NULL)
|
if ((dinput8 = LoadLibrary ("dinput8.dll")) == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (&store->error, 0, 0, "Could not load dinput8.dll");
|
g_set_error_literal (&store->error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
|
"Could not load dinput8.dll");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((p_DirectInput8Create = (t_DirectInput8Create) GetProcAddress (dinput8, "DirectInput8Create")) == NULL)
|
if ((p_DirectInput8Create = (t_DirectInput8Create) GetProcAddress (dinput8, "DirectInput8Create")) == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (&store->error, 0, 0, "Could not find DirectInput8Create in dinput8.dll");
|
g_set_error_literal (&store->error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
|
"Could not find DirectInput8Create in dinput8.dll");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +237,9 @@ gimp_input_device_store_init (GimpInputDeviceStore *store)
|
||||||
(LPVOID *) &store->directinput8,
|
(LPVOID *) &store->directinput8,
|
||||||
NULL))))
|
NULL))))
|
||||||
{
|
{
|
||||||
g_set_error (&store->error, 0, 0, "DirectInput8Create failed: %s", g_win32_error_message (hresult));
|
g_set_error (&store->error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
|
"DirectInput8Create failed: %s",
|
||||||
|
g_win32_error_message (hresult));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +249,9 @@ gimp_input_device_store_init (GimpInputDeviceStore *store)
|
||||||
store,
|
store,
|
||||||
DIEDFL_ATTACHEDONLY))))
|
DIEDFL_ATTACHEDONLY))))
|
||||||
{
|
{
|
||||||
g_set_error (&store->error, 0, 0, "IDirectInput8::EnumDevices failed: %s", g_win32_error_message (hresult));
|
g_set_error (&store->error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
|
"IDirectInput8::EnumDevices failed: %s",
|
||||||
|
g_win32_error_message (hresult));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#include "gimpinputdevicestore.h"
|
#include "gimpinputdevicestore.h"
|
||||||
|
|
||||||
|
#include "libgimpmodule/gimpmodule.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBHAL
|
#ifdef HAVE_LIBHAL
|
||||||
|
|
||||||
|
@ -35,7 +37,6 @@
|
||||||
#include <dbus/dbus-glib-lowlevel.h>
|
#include <dbus/dbus-glib-lowlevel.h>
|
||||||
#include <hal/libhal.h>
|
#include <hal/libhal.h>
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
COLUMN_UDI,
|
COLUMN_UDI,
|
||||||
|
@ -189,7 +190,9 @@ gimp_input_device_store_init (GimpInputDeviceStore *store)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_set_error (&store->error, 0, 0, "Unable to connect to hald");
|
g_set_error_literal (&store->error,
|
||||||
|
GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
|
||||||
|
"Unable to connect to hald");
|
||||||
}
|
}
|
||||||
|
|
||||||
libhal_ctx_free (store->context);
|
libhal_ctx_free (store->context);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue