]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/e17/e-wm/add-menu-autoscroll-options.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / e17 / e-wm / add-menu-autoscroll-options.patch
1 diff -Nur e~/src/bin/e_config.c e/src/bin/e_config.c
2 --- e~/src/bin/e_config.c       2005-08-05 21:12:17.000000000 -0700
3 +++ e/src/bin/e_config.c        2005-08-16 13:55:06.000000000 -0700
4 @@ -298,6 +298,8 @@
5     E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
6     E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT); /**/
7     E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT); /**/
8 +   E_CONFIG_VAL(D, T, menu_autoscroll_margin, INT); /**/
9 +   E_CONFIG_VAL(D, T, menu_autoscroll_cursor_margin, INT); /**/
10     
11     e_config = e_config_domain_load("e", _e_config_edd);
12     if (e_config)
13 @@ -403,6 +405,8 @@
14         e_config->resize_info_follows = 1;
15         e_config->focus_last_focused_per_desktop = 1;
16         e_config->focus_revert_on_hide_or_close = 1;
17 +       e_config->menu_autoscroll_margin = 10;
18 +       e_config->menu_autoscroll_cursor_margin = 15;
19         
20           {
21              E_Config_Module *em;
22 @@ -959,6 +963,8 @@
23     E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1);
24     E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1);
25     E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1);
26 +   E_CONFIG_LIMIT(e_config->menu_autoscroll_margin, 0, 50);
27 +   E_CONFIG_LIMIT(e_config->menu_autoscroll_cursor_margin, 0, 50);
28  
29     /* apply lang config - exception because config is loaded after intl setup */
30     
31 diff -Nur e~/src/bin/e_config.h e/src/bin/e_config.h
32 --- e~/src/bin/e_config.h       2005-08-05 21:12:18.000000000 -0700
33 +++ e/src/bin/e_config.h        2005-08-16 13:55:06.000000000 -0700
34 @@ -142,6 +142,8 @@
35     int         resize_info_follows;
36     int         focus_last_focused_per_desktop;
37     int         focus_revert_on_hide_or_close;
38 +   int         menu_autoscroll_margin;
39 +   int         menu_autoscroll_cursor_margin;
40  };
41  
42  struct _E_Config_Module
43 diff -Nur e~/src/bin/e_ipc_handlers.h e/src/bin/e_ipc_handlers.h
44 --- e~/src/bin/e_ipc_handlers.h 2005-08-09 21:52:07.000000000 -0700
45 +++ e/src/bin/e_ipc_handlers.h  2005-08-16 14:01:38.000000000 -0700
46 @@ -4592,3 +4592,84 @@
47  #if 0
48  }
49  #endif
50 +
51 +/****************************************************************************/
52 +#define HDL E_IPC_OP_MENU_AUTOSCROLL_MARGIN_SET
53 +#if (TYPE == E_REMOTE_OPTIONS)
54 +   OP("-menu-autoscroll-margin-set", 1, "Set the distance from the edge of the screen the menu will autoscroll to", 0, HDL)
55 +#elif (TYPE == E_REMOTE_OUT)
56 +   REQ_INT(atoi(params[0]), HDL);
57 +#elif (TYPE == E_WM_IN)
58 +   START_INT(value, HDL);
59 +   e_config->menu_autoscroll_margin = value;
60 +   E_CONFIG_LIMIT(e_config->menu_autoscroll_margin, 0, 50);
61 +   SAVE;
62 +   END_INT;
63 +#elif (TYPE == E_REMOTE_IN)
64 +#endif
65 +#undef HDL
66 +
67 +/****************************************************************************/
68 +#define HDL E_IPC_OP_MENU_AUTOSCROLL_MARGIN_GET
69 +#if (TYPE == E_REMOTE_OPTIONS)
70 +   OP("-menu-autoscroll-margin-get", 0, "Get the distance from the edge of the screen the menu will autoscroll to", 1, HDL)
71 +#elif (TYPE == E_REMOTE_OUT)
72 +   REQ_NULL(HDL)
73 +#elif (TYPE == E_WM_IN)
74 +   SEND_INT(e_config->menu_autoscroll_margin, E_IPC_OP_MENU_AUTOSCROLL_MARGIN_GET_REPLY, HDL);
75 +#elif (TYPE == E_REMOTE_IN)
76 +#endif
77 +#undef HDL
78 +
79 +/****************************************************************************/
80 +#define HDL E_IPC_OP_MENU_AUTOSCROLL_MARGIN_GET_REPLY
81 +#if (TYPE == E_REMOTE_OPTIONS)
82 +#elif (TYPE == E_REMOTE_OUT)
83 +#elif (TYPE == E_WM_IN)
84 +#elif (TYPE == E_REMOTE_IN)
85 +   START_INT(val, HDL)
86 +                printf("REPLY: %i\n", val);
87 +                END_INT;
88 +#endif
89 +#undef HDL
90 +
91 +/****************************************************************************/
92 +#define HDL E_IPC_OP_MENU_AUTOSCROLL_CURSOR_MARGIN_SET
93 +#if (TYPE == E_REMOTE_OPTIONS)
94 +   OP("-menu-autoscroll-cursor-margin-set", 1, "Set the distance from the edge of the screen the cursor needs to be to start menu autoscrolling", 0, HDL)
95 +#elif (TYPE == E_REMOTE_OUT)
96 +   REQ_INT(atoi(params[0]), HDL);
97 +#elif (TYPE == E_WM_IN)
98 +   START_INT(value, HDL);
99 +   e_config->menu_autoscroll_cursor_margin = value;
100 +   E_CONFIG_LIMIT(e_config->menu_autoscroll_cursor_margin, 0, 50);
101 +        //   e_zone_update_flip_all();
102 +   SAVE;
103 +   END_INT;
104 +#elif (TYPE == E_REMOTE_IN)
105 +#endif
106 +#undef HDL
107 +
108 +/****************************************************************************/
109 +#define HDL E_IPC_OP_MENU_AUTOSCROLL_CURSOR_MARGIN_GET
110 +#if (TYPE == E_REMOTE_OPTIONS)
111 +   OP("-menu-autoscroll-cursor-margin-get", 0, "Get the distance from the edge of the screen the cursor needs to be to start menu autoscrolling", 1, HDL)
112 +#elif (TYPE == E_REMOTE_OUT)
113 +   REQ_NULL(HDL)
114 +#elif (TYPE == E_WM_IN)
115 +   SEND_INT(e_config->menu_autoscroll_cursor_margin, E_IPC_OP_MENU_AUTOSCROLL_CURSOR_MARGIN_GET_REPLY, HDL);
116 +#elif (TYPE == E_REMOTE_IN)
117 +#endif
118 +#undef HDL
119 +
120 +/****************************************************************************/
121 +#define HDL E_IPC_OP_MENU_AUTOSCROLL_CURSOR_MARGIN_GET_REPLY
122 +#if (TYPE == E_REMOTE_OPTIONS)
123 +#elif (TYPE == E_REMOTE_OUT)
124 +#elif (TYPE == E_WM_IN)
125 +#elif (TYPE == E_REMOTE_IN)
126 +   START_INT(val, HDL)
127 +                printf("REPLY: %i\n", val);
128 +                END_INT;
129 +#endif
130 +#undef HDL
131 diff -Nur e~/src/bin/e_ipc_handlers_list.h e/src/bin/e_ipc_handlers_list.h
132 --- e~/src/bin/e_ipc_handlers_list.h    2005-08-05 21:00:03.000000000 -0700
133 +++ e/src/bin/e_ipc_handlers_list.h     2005-08-16 13:55:06.000000000 -0700
134 @@ -222,3 +222,9 @@
135  #define E_IPC_OP_DESKTOP_NAME_DEL 222
136  #define E_IPC_OP_DESKTOP_NAME_LIST 223
137  #define E_IPC_OP_DESKTOP_NAME_LIST_REPLY 224
138 +#define E_IPC_OP_MENU_AUTOSCROLL_MARGIN_SET 225
139 +#define E_IPC_OP_MENU_AUTOSCROLL_MARGIN_GET 226
140 +#define E_IPC_OP_MENU_AUTOSCROLL_MARGIN_GET_REPLY 227
141 +#define E_IPC_OP_MENU_AUTOSCROLL_CURSOR_MARGIN_SET 228
142 +#define E_IPC_OP_MENU_AUTOSCROLL_CURSOR_MARGIN_GET 229
143 +#define E_IPC_OP_MENU_AUTOSCROLL_CURSOR_MARGIN_GET_REPLY 230
144 diff -Nur e~/src/bin/e_menu.c e/src/bin/e_menu.c
145 --- e~/src/bin/e_menu.c 2005-07-25 02:55:44.000000000 -0700
146 +++ e/src/bin/e_menu.c  2005-08-16 13:55:06.000000000 -0700
147 @@ -1968,24 +1968,24 @@
148         E_Menu *m;
149  
150         m = l->data;
151 -       if (m->cur.x < m->zone->x)
152 +       if (m->cur.x < m->zone->x + e_config->menu_autoscroll_margin)
153           {
154 -            i = m->zone->x - m->cur.x;
155 +            i = m->zone->x - m->cur.x + e_config->menu_autoscroll_margin;
156              if (i > outl) outl = i;
157           }
158 -       if (m->cur.y < m->zone->y)
159 +       if (m->cur.y < m->zone->y + e_config->menu_autoscroll_margin)
160           {
161 -            i = m->zone->y - m->cur.y;
162 +            i = m->zone->y - m->cur.y + e_config->menu_autoscroll_margin;
163              if (i > outt) outt = i;
164           }
165 -       if ((m->cur.x + m->cur.w) > (m->zone->w))
166 +       if ((m->cur.x + m->cur.w) > (m->zone->w - e_config->menu_autoscroll_margin))
167           {
168 -            i = m->cur.x + m->cur.w - (m->zone->x + m->zone->w);
169 +            i = m->cur.x + m->cur.w - (m->zone->x + m->zone->w - e_config->menu_autoscroll_margin);
170              if (i > outr) outr = i;
171           }
172 -       if ((m->cur.y + m->cur.h) > (m->zone->h))
173 +       if ((m->cur.y + m->cur.h) > (m->zone->h - e_config->menu_autoscroll_margin))
174           {
175 -            i = m->cur.y + m->cur.h - (m->zone->y + m->zone->h);
176 +            i = m->cur.y + m->cur.h - (m->zone->y + m->zone->h - e_config->menu_autoscroll_margin);
177              if (i > outb) outb = i;
178           }
179       }
180 @@ -2029,11 +2029,11 @@
181     int autoscroll_x = 0;
182     int autoscroll_y = 0;
183     
184 -   if (_e_menu_x == 0)
185 +   if (_e_menu_x - e_config->menu_autoscroll_cursor_margin <= 0)
186       {
187         if (_e_menu_outside_bounds_get(-1, 0)) autoscroll_x = -1;
188       }
189 -   if (_e_menu_y == 0)
190 +   if (_e_menu_y - e_config->menu_autoscroll_cursor_margin <= 0)
191       {
192         if (_e_menu_outside_bounds_get(0, -1)) autoscroll_y = -1;
193       }
194 @@ -2044,11 +2044,11 @@
195              E_Menu *m;
196              
197              m = _e_active_menus->data;
198 -            if (_e_menu_x == (m->zone->w - 1))
199 +            if (_e_menu_x + e_config->menu_autoscroll_cursor_margin >= (m->zone->w - 1))
200                {
201                   if (_e_menu_outside_bounds_get(1, 0)) autoscroll_x = 1;
202                }
203 -            if (_e_menu_y == (m->zone->h - 1))
204 +            if (_e_menu_y + e_config->menu_autoscroll_cursor_margin >= (m->zone->h - 1))
205                {
206                   if (_e_menu_outside_bounds_get(0, 1)) autoscroll_y = 1;
207                }