1 /* MouseSettings.c- mouse options (some are equivalent to xset)
3 * WPrefs - WindowMaker Preferences Program
5 * Copyright (c) 1998 Alfredo K. Kojima
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
26 #include <X11/Xutil.h>
30 /* double-click tester */
39 typedef struct _Panel
{
44 CallbackRec callbacks
;
77 WMButton
*lastClickedSpeed
;
83 #define ICON_FILE "mousesettings"
85 #define SPEED_ICON_FILE "mousespeed"
86 #define SPEED_IMAGE "speed%i"
87 #define SPEED_IMAGE_S "speed%is"
89 #define DELAY_ICON "timer%i"
90 #define DELAY_ICON_S "timer%is"
92 #define MOUSEB_L "minimouseleft"
93 #define MOUSEB_M "minimousemiddle"
94 #define MOUSEB_R "minimouseright"
96 /* need access to the double click variables */
101 static char *modifierNames
[] = {
113 #define DELAY(i) ((i)*75+170)
116 int ModifierFromKey(Display
*dpy
, char *key
);
120 setMouseAccel(WMScreen
*scr
, float accel
, int threshold
)
127 XChangePointerControl(WMScreenDisplay(scr
), True
, True
, n
, d
, threshold
);
132 speedClick(WMWidget
*w
, void *data
)
134 _Panel
*panel
= (_Panel
*)data
;
140 for (i
=0; i
<5; i
++) {
141 if (panel
->speedB
[i
]==w
)
145 panel
->lastClickedSpeed
= panel
->speedB
[i
];
146 panel
->acceleration
= 0.5+(i
*0.5);
148 sprintf(buffer
, "Accel.: %.2f", 0.5+(i
*0.5));
149 WMSetLabelText(panel
->acceL
, buffer
);
151 tmp
= WMGetTextFieldText(panel
->threT
);
152 if (sscanf(tmp
, "%i", &threshold
)!=1 || threshold
< 0
153 || threshold
> panel
->maxThreshold
) {
154 WMRunAlertPanel(WMWidgetScreen(w
), GetWindow(panel
), _("Error"),
155 _("Invalid mouse acceleration threshold value. Must be the number of pixels to travel before accelerating."),
156 _("OK"), NULL
, NULL
);
158 setMouseAccel(WMWidgetScreen(w
), 0.5+(i
*0.5), threshold
);
165 returnPressed(void *observerData
, WMNotification
*notification
)
167 _Panel
*panel
= (_Panel
*)observerData
;
169 speedClick(panel
->lastClickedSpeed
, panel
);
174 doubleClick(WMWidget
*w
, void *data
)
176 _Panel
*panel
= (_Panel
*)data
;
178 extern _WINGsConfiguration WINGsConfiguration
;
180 for (i
=0; i
<5; i
++) {
181 if (panel
->ddelaB
[i
]==w
)
184 WINGsConfiguration
.doubleClickDelay
= DELAY(i
);
195 if (strcasecmp(str
, "left")==0)
197 else if (strcasecmp(str
, "middle")==0)
199 else if (strcasecmp(str
, "right")==0)
201 else if (strcasecmp(str
, "button1")==0)
203 else if (strcasecmp(str
, "button2")==0)
205 else if (strcasecmp(str
, "button3")==0)
207 else if (strcasecmp(str
, "button4")==0
208 || strcasecmp(str
, "button5")==0) {
209 wwarning(_("mouse button %s not supported by WPrefs."), str
);
218 getMouseParameters(Display
*dpy
, float *accel
, int *thre
)
222 XGetPointerControl(dpy
, &n
, &d
, thre
);
224 *accel
= (float)n
/(float)d
;
230 showData(_Panel
*panel
)
234 int a
=-1, b
=-1, c
=-1;
237 Display
*dpy
= WMScreenDisplay(WMWidgetScreen(panel
->win
));
239 str
= GetStringForKey("SelectWindowsMouseButton");
243 wwarning(_("bad value %s for option %s"),str
, "SelectWindowsMouseButton");
244 WMPerformButtonClick(panel
->smb
[0]);
247 WMPerformButtonClick(panel
->smb
[i
]);
250 str
= GetStringForKey("WindowListMouseButton");
254 wwarning(_("bad value %s for option %s"), str
, "WindowListMouseButton");
255 WMPerformButtonClick(panel
->lmb
[1]);
258 WMPerformButtonClick(panel
->lmb
[i
]);
261 str
= GetStringForKey("ApplicationMenuMouseButton");
265 wwarning(_("bad value %s for option %s"), str
, "ApplicationMenuMouseButton");
266 WMPerformButtonClick(panel
->amb
[2]);
269 WMPerformButtonClick(panel
->amb
[i
]);
273 WMSetButtonSelected(panel
->disaB
, GetBoolForKey("DisableWSMouseActions"));
276 getMouseParameters(dpy
, &accel
, &a
);
277 panel
->maxThreshold
= WidthOfScreen(DefaultScreenOfDisplay(dpy
));
278 if (a
> panel
->maxThreshold
) {
279 panel
->maxThreshold
= a
;
281 sprintf(buffer
, "%i", a
);
282 WMSetTextFieldText(panel
->threT
, buffer
);
283 /* find best match */
285 for (i
=0; i
<5; i
++) {
286 if (fabs((0.5+((float)i
*0.5))-accel
) < fabs((0.5+((float)a
*0.5))-accel
))
289 WMPerformButtonClick(panel
->speedB
[a
]);
290 panel
->lastClickedSpeed
= panel
->speedB
[a
];
291 panel
->acceleration
= accel
;
293 speedClick(panel
->lastClickedSpeed
, panel
);
295 b
= GetIntegerForKey("DoubleClickTime");
296 /* find best match */
298 for (i
=0; i
<5; i
++) {
299 if (abs(b
- DELAY(i
)) < abs(b
- DELAY(a
)))
302 WMPerformButtonClick(panel
->ddelaB
[a
]);
305 str
= GetStringForKey("ModifierKey");
307 a
= ModifierFromKey(dpy
, str
);
310 str
= modifierNames
[a
];
313 for (i
=0; i
<WMGetPopUpButtonNumberOfItems(panel
->grabP
); i
++) {
314 if (strstr(WMGetPopUpButtonItem(panel
->grabP
, i
), str
)) {
315 WMSetPopUpButtonSelectedItem(panel
->grabP
, i
);
323 sscanf(WMGetPopUpButtonItem(panel
->grabP
, 0), "%s", buffer
);
324 WMSetPopUpButtonSelectedItem(panel
->grabP
, 0);
325 wwarning(_("modifier key %s for option ModifierKey was not recognized. Using %s as default"),
333 fillModifierPopUp(WMPopUpButton
*pop
)
335 XModifierKeymap
*mapping
;
336 Display
*dpy
= WMScreenDisplay(WMWidgetScreen(pop
));
342 mapping
= XGetModifierMapping(dpy
);
344 if (!mapping
|| mapping
->max_keypermod
==0) {
345 WMAddPopUpButtonItem(pop
, "Mod1");
346 WMAddPopUpButtonItem(pop
, "Mod2");
347 WMAddPopUpButtonItem(pop
, "Mod3");
348 WMAddPopUpButtonItem(pop
, "Mod4");
349 WMAddPopUpButtonItem(pop
, "Mod5");
350 wwarning(_("could not retrieve keyboard modifier mapping"));
355 for (j
=0; j
<8; j
++) {
365 memset(array
, 0, sizeof(char*)*8);
366 for (i
=0; i
< mapping
->max_keypermod
; i
++) {
367 idx
= i
+j
*mapping
->max_keypermod
;
368 if (mapping
->modifiermap
[idx
]!=0) {
370 for (l
=0; l
<4; l
++) {
371 ksym
= XKeycodeToKeysym(dpy
, mapping
->modifiermap
[idx
], l
);
376 str
= XKeysymToString(ksym
);
379 if (str
&& !strstr(str
, "_Lock") && !strstr(str
, "Shift")
380 && !strstr(str
, "Control")) {
381 array
[a
++] = wstrdup(str
);
386 for (k
=0; k
<a
; k
++) {
389 tmp
= wstrdup(array
[k
]);
390 ptr
= strstr(tmp
, "_L");
393 ptr
= strstr(tmp
, "_R");
396 sprintf(buffer
, "%s (%s)", modifierNames
[j
], tmp
);
397 WMAddPopUpButtonItem(pop
, buffer
);
398 for (i
=k
+1; i
<a
; i
++) {
399 if (strstr(array
[i
], tmp
)) {
415 XFreeModifiermap(mapping
);
421 mouseButtonClickA(WMWidget
*w
, void *data
)
423 _Panel
*panel
= (_Panel
*)data
;
426 for (i
=0; i
<3; i
++) {
427 if (panel
->amb
[i
]==w
)
432 if (WMGetButtonSelected(panel
->lmb
[i
]))
433 WMSetButtonSelected(panel
->lmb
[i
], False
);
434 if (WMGetButtonSelected(panel
->smb
[i
]))
435 WMSetButtonSelected(panel
->smb
[i
], False
);
439 mouseButtonClickL(WMWidget
*w
, void *data
)
441 _Panel
*panel
= (_Panel
*)data
;
444 for (i
=0; i
<3; i
++) {
445 if (panel
->lmb
[i
]==w
)
450 if (WMGetButtonSelected(panel
->smb
[i
]))
451 WMSetButtonSelected(panel
->smb
[i
], False
);
452 if (WMGetButtonSelected(panel
->amb
[i
]))
453 WMSetButtonSelected(panel
->amb
[i
], False
);
457 mouseButtonClickS(WMWidget
*w
, void *data
)
459 _Panel
*panel
= (_Panel
*)data
;
462 for (i
=0; i
<3; i
++) {
463 if (panel
->smb
[i
]==w
)
468 if (WMGetButtonSelected(panel
->lmb
[i
]))
469 WMSetButtonSelected(panel
->lmb
[i
], False
);
470 if (WMGetButtonSelected(panel
->amb
[i
]))
471 WMSetButtonSelected(panel
->amb
[i
], False
);
475 createPanel(Panel
*p
)
477 _Panel
*panel
= (_Panel
*)p
;
478 WMScreen
*scr
= WMWidgetScreen(panel
->win
);
489 panel
->frame
= WMCreateFrame(panel
->win
);
490 WMResizeWidget(panel
->frame
, FRAME_WIDTH
, FRAME_HEIGHT
);
491 WMMoveWidget(panel
->frame
, FRAME_LEFT
, FRAME_TOP
);
493 /**************** Mouse Speed ****************/
494 panel
->speedF
= WMCreateFrame(panel
->frame
);
495 WMResizeWidget(panel
->speedF
, 245, 100);
496 WMMoveWidget(panel
->speedF
, 15, 15);
497 WMSetFrameTitle(panel
->speedF
, _("Mouse Speed"));
499 panel
->speedL
= WMCreateLabel(panel
->speedF
);
500 WMResizeWidget(panel
->speedL
, 40, 46);
501 WMMoveWidget(panel
->speedL
, 15, 14);
502 WMSetLabelImagePosition(panel
->speedL
, WIPImageOnly
);
503 path
= LocateImage(SPEED_ICON_FILE
);
505 icon
= WMCreateBlendedPixmapFromFile(scr
, path
, &color
);
507 WMSetLabelImage(panel
->speedL
, icon
);
508 WMReleasePixmap(icon
);
510 wwarning(_("could not load icon %s"), path
);
515 buf1
= wmalloc(strlen(SPEED_IMAGE
)+1);
516 buf2
= wmalloc(strlen(SPEED_IMAGE_S
)+1);
518 for (i
= 0; i
< 5; i
++) {
519 panel
->speedB
[i
] = WMCreateCustomButton(panel
->speedF
,
521 WMResizeWidget(panel
->speedB
[i
], 26, 26);
522 WMMoveWidget(panel
->speedB
[i
], 60+(35*i
), 25);
523 WMSetButtonBordered(panel
->speedB
[i
], False
);
524 WMSetButtonImagePosition(panel
->speedB
[i
], WIPImageOnly
);
525 WMSetButtonAction(panel
->speedB
[i
], speedClick
, panel
);
527 WMGroupButtons(panel
->speedB
[0], panel
->speedB
[i
]);
529 sprintf(buf1
, SPEED_IMAGE
, i
);
530 sprintf(buf2
, SPEED_IMAGE_S
, i
);
531 path
= LocateImage(buf1
);
533 icon
= WMCreatePixmapFromFile(scr
, path
);
535 WMSetButtonImage(panel
->speedB
[i
], icon
);
536 WMReleasePixmap(icon
);
538 wwarning(_("could not load icon file %s"), path
);
542 path
= LocateImage(buf2
);
544 icon
= WMCreatePixmapFromFile(scr
, path
);
546 WMSetButtonAltImage(panel
->speedB
[i
], icon
);
547 WMReleasePixmap(icon
);
549 wwarning(_("could not load icon file %s"), path
);
556 panel
->acceL
= WMCreateLabel(panel
->speedF
);
557 WMResizeWidget(panel
->acceL
, 100, 16);
558 WMMoveWidget(panel
->acceL
, 10, 67);
561 panel
->threL
= WMCreateLabel(panel
->speedF
);
562 WMResizeWidget(panel
->threL
, 80, 16);
563 WMMoveWidget(panel
->threL
, 120, 67);
564 WMSetLabelText(panel
->threL
, _("Threshold:"));
566 panel
->threT
= WMCreateTextField(panel
->speedF
);
567 WMResizeWidget(panel
->threT
, 40, 20);
568 WMMoveWidget(panel
->threT
, 190, 65);
569 WMAddNotificationObserver(returnPressed
, panel
,
570 WMTextDidEndEditingNotification
, panel
->threT
);
572 WMMapSubwidgets(panel
->speedF
);
574 /***************** Doubleclick Delay ****************/
576 panel
->ddelaF
= WMCreateFrame(panel
->frame
);
577 WMResizeWidget(panel
->ddelaF
, 245, 95);
578 WMMoveWidget(panel
->ddelaF
, 15, 125);
579 WMSetFrameTitle(panel
->ddelaF
, _("Double-Click Delay"));
581 buf1
= wmalloc(strlen(DELAY_ICON
)+1);
582 buf2
= wmalloc(strlen(DELAY_ICON_S
)+1);
584 for (i
= 0; i
< 5; i
++) {
585 panel
->ddelaB
[i
] = WMCreateCustomButton(panel
->ddelaF
,
587 WMResizeWidget(panel
->ddelaB
[i
], 25, 25);
588 WMMoveWidget(panel
->ddelaB
[i
], 30+(40*i
), 20);
589 WMSetButtonBordered(panel
->ddelaB
[i
], False
);
590 WMSetButtonImagePosition(panel
->ddelaB
[i
], WIPImageOnly
);
591 WMSetButtonAction(panel
->ddelaB
[i
], doubleClick
, panel
);
593 WMGroupButtons(panel
->ddelaB
[0], panel
->ddelaB
[i
]);
595 sprintf(buf1
, DELAY_ICON
, i
+1);
596 sprintf(buf2
, DELAY_ICON_S
, i
+1);
597 path
= LocateImage(buf1
);
599 icon
= WMCreatePixmapFromFile(scr
, path
);
601 WMSetButtonImage(panel
->ddelaB
[i
], icon
);
602 WMReleasePixmap(icon
);
604 wwarning(_("could not load icon file %s"), path
);
608 path
= LocateImage(buf2
);
610 icon
= WMCreatePixmapFromFile(scr
, path
);
612 WMSetButtonAltImage(panel
->ddelaB
[i
], icon
);
613 WMReleasePixmap(icon
);
615 wwarning(_("could not load icon file %s"), path
);
623 panel
->tester
= CreateDoubleTest(panel
->ddelaF
, _("Test"));
624 WMResizeWidget(panel
->tester
, 84, 29);
625 WMMoveWidget(panel
->tester
, 85, 55);
627 WMMapSubwidgets(panel
->ddelaF
);
629 /* ************** Workspace Action Buttons **************** */
630 panel
->menuF
= WMCreateFrame(panel
->frame
);
631 WMResizeWidget(panel
->menuF
, 240, 145);
632 WMMoveWidget(panel
->menuF
, 270, 15);
633 WMSetFrameTitle(panel
->menuF
, _("Workspace Mouse Actions"));
635 panel
->disaB
= WMCreateSwitchButton(panel
->menuF
);
636 WMResizeWidget(panel
->disaB
, 185, 19);
637 WMMoveWidget(panel
->disaB
, 20, 20);
638 WMSetButtonText(panel
->disaB
, _("Disable mouse actions"));
640 panel
->mblL
= WMCreateLabel(panel
->menuF
);
641 WMResizeWidget(panel
->mblL
, 16, 22);
642 WMMoveWidget(panel
->mblL
, 135, 40);
643 WMSetLabelImagePosition(panel
->mblL
, WIPImageOnly
);
644 path
= LocateImage(MOUSEB_L
);
646 icon
= WMCreatePixmapFromFile(scr
, path
);
648 WMSetLabelImage(panel
->mblL
, icon
);
649 WMReleasePixmap(icon
);
651 wwarning(_("could not load icon file %s"), path
);
655 panel
->mbmL
= WMCreateLabel(panel
->menuF
);
656 WMResizeWidget(panel
->mbmL
, 16, 22);
657 WMMoveWidget(panel
->mbmL
, 170, 40);
658 WMSetLabelImagePosition(panel
->mbmL
, WIPImageOnly
);
659 path
= LocateImage(MOUSEB_M
);
661 icon
= WMCreatePixmapFromFile(scr
, path
);
663 WMSetLabelImage(panel
->mbmL
, icon
);
664 WMReleasePixmap(icon
);
666 wwarning(_("could not load icon file %s"), path
);
671 panel
->mbrL
= WMCreateLabel(panel
->menuF
);
672 WMResizeWidget(panel
->mbrL
, 16, 22);
673 WMMoveWidget(panel
->mbrL
, 205, 40);
674 WMSetLabelImagePosition(panel
->mbrL
, WIPImageOnly
);
675 path
= LocateImage(MOUSEB_R
);
677 icon
= WMCreatePixmapFromFile(scr
, path
);
679 WMSetLabelImage(panel
->mbrL
, icon
);
680 WMReleasePixmap(icon
);
682 wwarning(_("could not load icon file %s"), path
);
687 panel
->appL
= WMCreateLabel(panel
->menuF
);
688 WMResizeWidget(panel
->appL
, 125, 16);
689 WMMoveWidget(panel
->appL
, 5, 65);
690 WMSetLabelTextAlignment(panel
->appL
, WARight
);
691 WMSetLabelText(panel
->appL
, _("Applications menu"));
693 panel
->listL
= WMCreateLabel(panel
->menuF
);
694 WMResizeWidget(panel
->listL
, 125, 16);
695 WMMoveWidget(panel
->listL
, 5, 90);
696 WMSetLabelTextAlignment(panel
->listL
, WARight
);
697 WMSetLabelText(panel
->listL
, _("Window list menu"));
699 panel
->selL
= WMCreateLabel(panel
->menuF
);
700 WMResizeWidget(panel
->selL
, 125, 16);
701 WMMoveWidget(panel
->selL
, 5, 115);
702 WMSetLabelTextAlignment(panel
->selL
, WARight
);
703 WMSetLabelText(panel
->selL
, _("Select windows"));
706 for (i
=0; i
<3; i
++) {
707 panel
->amb
[i
] = WMCreateRadioButton(panel
->menuF
);
708 WMResizeWidget(panel
->amb
[i
], 24, 24);
709 WMMoveWidget(panel
->amb
[i
], 135+35*i
, 65);
710 WMSetButtonText(panel
->amb
[i
], NULL
);
711 WMSetButtonAction(panel
->amb
[i
], mouseButtonClickA
, panel
);
713 panel
->lmb
[i
] = WMCreateRadioButton(panel
->menuF
);
714 WMResizeWidget(panel
->lmb
[i
], 24, 24);
715 WMMoveWidget(panel
->lmb
[i
], 135+35*i
, 90);
716 WMSetButtonText(panel
->lmb
[i
], NULL
);
717 WMSetButtonAction(panel
->lmb
[i
], mouseButtonClickL
, panel
);
719 panel
->smb
[i
] = WMCreateRadioButton(panel
->menuF
);
720 WMResizeWidget(panel
->smb
[i
], 24, 24);
721 WMMoveWidget(panel
->smb
[i
], 135+35*i
, 115);
722 WMSetButtonText(panel
->smb
[i
], NULL
);
723 WMSetButtonAction(panel
->smb
[i
], mouseButtonClickS
, panel
);
726 WMGroupButtons(panel
->lmb
[0], panel
->lmb
[i
]);
727 WMGroupButtons(panel
->amb
[0], panel
->amb
[i
]);
728 WMGroupButtons(panel
->smb
[0], panel
->smb
[i
]);
732 WMMapSubwidgets(panel
->menuF
);
734 /* ************** Grab Modifier **************** */
735 panel
->grabF
= WMCreateFrame(panel
->frame
);
736 WMResizeWidget(panel
->grabF
, 240, 55);
737 WMMoveWidget(panel
->grabF
, 270, 165);
738 WMSetFrameTitle(panel
->grabF
, _("Mouse Grab Modifier"));
740 panel
->grabP
= WMCreatePopUpButton(panel
->grabF
);
741 WMResizeWidget(panel
->grabP
, 120, 20);
742 WMMoveWidget(panel
->grabP
, 60, 25);
744 fillModifierPopUp(panel
->grabP
);
746 WMMapSubwidgets(panel
->grabF
);
748 WMRealizeWidget(panel
->frame
);
749 WMMapSubwidgets(panel
->frame
);
757 storeCommandInScript(char *cmd
, char *line
)
764 p
= wusergnusteppath();
765 path
= wmalloc(strlen(p
)+64);
766 sprintf(path
, "%s/Library/WindowMaker/autostart", p
);
768 f
= fopen(path
, "r");
770 f
= fopen(path
, "w");
772 wsyserror(_("could not create %s"), path
);
775 fprintf(f
, "#!/bin/sh\n");
779 int len
= strlen(cmd
);
784 tmppath
= wmalloc(strlen(p
)+64);
785 sprintf(tmppath
, "%s/Library/WindowMaker/autostart.tmp", p
);
786 fo
= fopen(tmppath
, "w");
788 wsyserror(_("could not create temporary file %s"), tmppath
);
793 if (!fgets(buffer
, 127, f
)) {
796 if (strncmp(buffer
, cmd
, len
)==0) {
812 if (rename(tmppath
, path
)!=0) {
813 wsyserror(_("could not rename file %s to %s\n"), tmppath
, path
);
817 sprintf(buffer
, "chmod u+x %s", path
);
829 storeData(_Panel
*panel
)
834 static char *button
[3] = {"left", "middle", "right"};
836 tmp
= WMGetTextFieldText(panel
->threT
);
837 if (strlen(tmp
)==0) {
842 sprintf(buffer
, XSET
" m %i/%i %s\n", (int)(panel
->acceleration
*10),10, tmp
);
843 storeCommandInScript(XSET
" m", buffer
);
847 for (i
=0; i
<5; i
++) {
848 if (WMGetButtonSelected(panel
->ddelaB
[i
]))
851 SetIntegerForKey(DELAY(i
), "DoubleClickTime");
853 SetBoolForKey(WMGetButtonSelected(panel
->disaB
), "DisableWSMouseActions");
855 for (i
=0; i
<3; i
++) {
856 if (WMGetButtonSelected(panel
->amb
[i
]))
860 SetStringForKey(button
[i
], "ApplicationMenuMouseButton");
862 for (i
=0; i
<3; i
++) {
863 if (WMGetButtonSelected(panel
->lmb
[i
]))
867 SetStringForKey(button
[i
], "WindowListMouseButton");
869 for (i
=0; i
<3; i
++) {
870 if (WMGetButtonSelected(panel
->smb
[i
]))
874 SetStringForKey(button
[i
], "SelectWindowsMouseButton");
876 tmp
= WMGetPopUpButtonItem(panel
->grabP
,
877 WMGetPopUpButtonSelectedItem(panel
->grabP
));
879 p
= strchr(tmp
, ' ');
882 SetStringForKey(tmp
, "ModifierKey");
889 InitMouseSettings(WMScreen
*scr
, WMWindow
*win
)
893 panel
= wmalloc(sizeof(_Panel
));
894 memset(panel
, 0, sizeof(_Panel
));
896 panel
->sectionName
= _("Mouse Preferences");
900 panel
->callbacks
.createWidgets
= createPanel
;
901 panel
->callbacks
.updateDomain
= storeData
;
903 AddSection(panel
, ICON_FILE
);