Enlightenment CVS committal
Author : codewarrior
Project : e17
Module : proto
Dir : e17/proto/etk/src/lib
Modified Files:
etk_tooltips.c etk_window.c etk_window.h
Log Message:
- some modal / transient code (not done!!)
- no more ecore_x for tooltips
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_tooltips.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- etk_tooltips.c 16 Mar 2006 10:46:00 -0000 1.7
+++ etk_tooltips.c 3 Jul 2006 17:22:25 -0000 1.8
@@ -188,11 +188,14 @@
*/
void etk_tooltips_pop_up(Etk_Widget *widget)
{
-#if HAVE_ECORE_X
const char *text = NULL;
int x, y;
char *key;
-
+ Etk_Toplevel_Widget *toplevel;
+ Evas *evas;
+ int pt_x, pt_y;
+ int win_x, win_y;
+
if(!ETK_IS_OBJECT(widget))
return;
@@ -215,12 +218,19 @@
}
etk_label_set(ETK_LABEL(_etk_tooltips_label), text);
- ecore_x_pointer_xy_get(ecore_x_window_root_first_get(), &x, &y);
+
+ evas = etk_widget_toplevel_evas_get(widget);
+ evas_pointer_canvas_xy_get(evas, &pt_x, &pt_y);
+ toplevel = etk_widget_toplevel_parent_get(widget);
+ etk_window_geometry_get(ETK_WINDOW(toplevel), &win_x, &win_y, NULL, NULL);
+ x = pt_x + win_x;
+ y = pt_y + win_y;
+
/* TODO: if tooltip window is outside screen, fix its place */
etk_window_move(ETK_WINDOW(_etk_tooltips_window), x + 5, y + 5);
etk_widget_show_all(_etk_tooltips_window);
free(key);
-#endif
+
_etk_tooltips_timer = NULL;
}
@@ -240,13 +250,11 @@
/* Callback for when the mouse enters a widget */
static void _etk_tooltips_mouse_in_cb(Etk_Object *object,
Etk_Event_Mouse_In_Out *event, void *data)
{
-#if HAVE_ECORE_X
if(!_etk_tooltips_enabled || !ETK_IS_OBJECT(object))
return;
_etk_tooltips_cur_object = object;
_etk_tooltips_timer = ecore_timer_add(_etk_tooltips_delay,
_etk_tooltips_timer_cb, NULL);
-#endif
}
/* Timer callback, pops up the tooltip */
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_window.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- etk_window.c 25 Jun 2006 02:22:04 -0000 1.22
+++ etk_window.c 3 Jul 2006 17:22:25 -0000 1.23
@@ -291,6 +291,40 @@
}
/**
+ * @brief Makes a window modal for another window
+ * @param window_to_modal the window to make modal
+ * @param window the window on which @a window_to_model will modal'ed on
+ */
+void etk_window_modal_for_window(Etk_Window *window_to_modal, Etk_Window
*window)
+{
+ int x, y, w, h;
+ int cw, ch;
+
+ if (!window_to_modal)
+ return;
+
+ if (window_to_modal->wait_size_request)
+ {
+ window_to_modal->modal = ETK_TRUE;
+ window_to_modal->modal_for_window = window;
+ if (window)
+ etk_object_weak_pointer_add(ETK_OBJECT(window), (void
**)(&window_to_modal->modal_for_window));
+ }
+ else
+ {
+ if (window)
+ {
+ Ecore_X_Window_State states[] = {ECORE_X_WINDOW_STATE_MODAL};
+
+ ecore_x_icccm_transient_for_set(window_to_modal->x_window,
+ window->x_window);
+
+ ecore_x_netwm_window_state_set(window_to_modal->x_window, states, 1);
+ }
+ }
+}
+
+/**
* @brief Iconifies (i.e. minimize) the window
* @param window a window
*/
@@ -695,6 +729,8 @@
window->wait_size_request = ETK_TRUE;
window->center = ETK_FALSE;
window->center_on_window = NULL;
+ window->modal = ETK_FALSE;
+ window->modal_for_window = NULL;
ecore_x_dnd_aware_set(window->x_window, 1);
@@ -727,6 +763,8 @@
ecore_evas_free(window->ecore_evas);
if (window->center_on_window)
etk_object_weak_pointer_remove(ETK_OBJECT(window->center_on_window),
(void **)(&window->center_on_window));
+ if (window->modal_for_window)
+ etk_object_weak_pointer_remove(ETK_OBJECT(window->modal_for_window),
(void **)(&window->modal_for_window));
}
/* Sets the property whose id is "property_id" to the value "value" */
@@ -933,6 +971,12 @@
window->center = ETK_FALSE;
window->center_on_window = NULL;
}
+ if (window->modal)
+ {
+ etk_window_modal_for_window(window, window->modal_for_window);
+ window->modal = ETK_FALSE;
+ window->modal_for_window = NULL;
+ }
}
}
}
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_window.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- etk_window.h 7 Apr 2006 15:36:11 -0000 1.10
+++ etk_window.h 3 Jul 2006 17:22:25 -0000 1.11
@@ -40,6 +40,8 @@
Etk_Bool wait_size_request;
Etk_Bool center;
Etk_Window *center_on_window;
+ Etk_Bool modal;
+ Etk_Window *modal_for_window;
};
Etk_Type *etk_window_type_get();
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs