Load cursors same way as other theme files.
SVN revision: 42802
This commit is contained in:
parent
cbd075f178
commit
a1d1cc3e01
|
@ -27,6 +27,7 @@
|
|||
#include "borders.h"
|
||||
#include "buttons.h"
|
||||
#include "conf.h"
|
||||
#include "cursors.h"
|
||||
#include "file.h"
|
||||
#include "iclass.h"
|
||||
#include "menus.h"
|
||||
|
@ -337,6 +338,11 @@ ConfigFileRead(FILE * fs)
|
|||
case CONFIG_CLOSE:
|
||||
goto done;
|
||||
|
||||
case CONFIG_CURSOR:
|
||||
err = ECursorConfigLoad(fs);
|
||||
if (err)
|
||||
ConfigAlertLoad("Cursor");
|
||||
break;
|
||||
case CONFIG_IMAGECLASS:
|
||||
err = ImageclassConfigLoad(fs);
|
||||
if (err)
|
||||
|
@ -545,6 +551,7 @@ ThemeConfigLoad(void)
|
|||
{
|
||||
static const char *const config_files[] = {
|
||||
"init.cfg",
|
||||
"cursors.cfg",
|
||||
"textclasses.cfg",
|
||||
"imageclasses.cfg",
|
||||
"desktops.cfg",
|
||||
|
|
|
@ -244,7 +244,7 @@ ECursorFree(ECursor * ec)
|
|||
ec->ref_count--;
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
ECursorConfigLoad(FILE * fs)
|
||||
{
|
||||
int err = 0;
|
||||
|
@ -362,7 +362,9 @@ static const ECDataRec ECData[ECSR_COUNT] = {
|
|||
{"RESIZE_BR", "RESIZE_TL", XC_bottom_right_corner},
|
||||
};
|
||||
|
||||
static Cursor ECsrs[ECSR_COUNT];
|
||||
static Cursor ECsrs[ECSR_COUNT] = {
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
||||
};
|
||||
|
||||
Cursor
|
||||
ECsrGet(int which)
|
||||
|
@ -382,34 +384,6 @@ ECsrApply(int which, Window win)
|
|||
XDefineCursor(disp, win, ECsrGet(which));
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up some basic cursors
|
||||
*/
|
||||
static void
|
||||
CursorsInit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ECSR_COUNT; i++)
|
||||
ECsrs[i] = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Cursor module
|
||||
*/
|
||||
|
||||
static void
|
||||
CursorSighan(int sig, void *prm __UNUSED__)
|
||||
{
|
||||
switch (sig)
|
||||
{
|
||||
case ESIGNAL_INIT:
|
||||
ConfigFileLoad("cursors.cfg", Mode.theme.path, ECursorConfigLoad, 1);
|
||||
CursorsInit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
CursorsIpc(const char *params)
|
||||
{
|
||||
|
@ -448,7 +422,7 @@ static const IpcItem CursorIpcArray[] = {
|
|||
extern const EModule ModCursors;
|
||||
const EModule ModCursors = {
|
||||
"cursor", "csr",
|
||||
CursorSighan,
|
||||
NULL,
|
||||
{N_IPC_FUNCS, CursorIpcArray}
|
||||
,
|
||||
{0, NULL}
|
||||
|
|
|
@ -46,4 +46,6 @@ void ECursorApply(ECursor * ec, Win win);
|
|||
Cursor ECsrGet(int which);
|
||||
void ECsrApply(int which, Window win);
|
||||
|
||||
int ECursorConfigLoad(FILE * fs);
|
||||
|
||||
#endif /* _CURSORS_H_ */
|
||||
|
|
Loading…
Reference in New Issue