forked from enlightenment/efl
extra ecore_x and ecore_evas features for e17.. :)
SVN revision: 12241
This commit is contained in:
parent
b65b062598
commit
edab59238a
|
@ -1,5 +1,7 @@
|
||||||
#include "ecore_private.h"
|
#include "ecore_private.h"
|
||||||
#include "Ecore.h"
|
#include "Ecore.h"
|
||||||
|
#include <locale.h>
|
||||||
|
#include <langinfo.h>
|
||||||
|
|
||||||
static const char *_ecore_magic_string_get(Ecore_Magic m);
|
static const char *_ecore_magic_string_get(Ecore_Magic m);
|
||||||
static int _ecore_init_count = 0;
|
static int _ecore_init_count = 0;
|
||||||
|
@ -35,6 +37,11 @@ ecore_init(void)
|
||||||
{
|
{
|
||||||
if (++_ecore_init_count == 1)
|
if (++_ecore_init_count == 1)
|
||||||
{
|
{
|
||||||
|
setlocale(LC_CTYPE, "");
|
||||||
|
if (strcmp(nl_langinfo(CODESET), "UTF-8"))
|
||||||
|
{
|
||||||
|
printf("WARNING: not a utf8 locale!\n");
|
||||||
|
}
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
|
if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
|
||||||
if (_ecore_fps_debug) _ecore_fps_debug_init();
|
if (_ecore_fps_debug) _ecore_fps_debug_init();
|
||||||
|
|
|
@ -58,9 +58,15 @@ int ecore_evas_shutdown(void);
|
||||||
/* engine/target specific init calls */
|
/* engine/target specific init calls */
|
||||||
Ecore_Evas *ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
|
Ecore_Evas *ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
|
||||||
Ecore_X_Window ecore_evas_software_x11_window_get(Ecore_Evas *ee);
|
Ecore_X_Window ecore_evas_software_x11_window_get(Ecore_Evas *ee);
|
||||||
|
Ecore_X_Window ecore_evas_software_x11_subwindow_get(Ecore_Evas *ee);
|
||||||
|
void ecore_evas_software_x11_direct_resize_set(Ecore_Evas *ee, int on);
|
||||||
|
int ecore_evas_software_x11_direct_resize_get(Ecore_Evas *ee);
|
||||||
|
|
||||||
Ecore_Evas *ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
|
Ecore_Evas *ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
|
||||||
Ecore_X_Window ecore_evas_gl_x11_window_get(Ecore_Evas *ee);
|
Ecore_X_Window ecore_evas_gl_x11_window_get(Ecore_Evas *ee);
|
||||||
|
Ecore_X_Window ecore_evas_gl_x11_subwindow_get(Ecore_Evas *ee);
|
||||||
|
void ecore_evas_gl_x11_direct_resize_set(Ecore_Evas *ee, int on);
|
||||||
|
int ecore_evas_gl_x11_direct_resize_get(Ecore_Evas *ee);
|
||||||
|
|
||||||
Ecore_Evas *ecore_evas_fb_new(char *disp_name, int rotation, int w, int h);
|
Ecore_Evas *ecore_evas_fb_new(char *disp_name, int rotation, int w, int h);
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ struct _Ecore_Evas_Engine
|
||||||
Ecore_X_Pixmap mask;
|
Ecore_X_Pixmap mask;
|
||||||
Ecore_X_GC gc;
|
Ecore_X_GC gc;
|
||||||
Region damages;
|
Region damages;
|
||||||
|
unsigned char direct_resize : 1;
|
||||||
} x;
|
} x;
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUILD_ECORE_EVAS_FB
|
#ifdef BUILD_ECORE_EVAS_FB
|
||||||
|
|
|
@ -356,7 +356,7 @@ _ecore_evas_event_window_configure(void *data, int type, void *event)
|
||||||
ee->w = e->w;
|
ee->w = e->w;
|
||||||
ee->h = e->h;
|
ee->h = e->h;
|
||||||
if (e->win == ee->engine.x.win_container)
|
if (e->win == ee->engine.x.win_container)
|
||||||
ecore_x_window_resize(ee->engine.x.win, ee->w, ee->h);
|
ecore_x_window_move_resize(ee->engine.x.win, 0, 0, ee->w, ee->h);
|
||||||
if ((ee->rotation == 90) || (ee->rotation == 270))
|
if ((ee->rotation == 90) || (ee->rotation == 270))
|
||||||
{
|
{
|
||||||
evas_output_size_set(ee->evas, ee->h, ee->w);
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
||||||
|
@ -618,12 +618,70 @@ static void
|
||||||
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
ecore_x_window_resize(ee->engine.x.win_container, w, h);
|
ecore_x_window_resize(ee->engine.x.win_container, w, h);
|
||||||
|
if (ee->engine.x.direct_resize)
|
||||||
|
{
|
||||||
|
ecore_x_window_move_resize(ee->engine.x.win, 0, 0, w, h);
|
||||||
|
if ((ee->w != w) || (ee->h != h))
|
||||||
|
{
|
||||||
|
ee->w = w;
|
||||||
|
ee->h = h;
|
||||||
|
if ((ee->rotation == 90) || (ee->rotation == 270))
|
||||||
|
{
|
||||||
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
||||||
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||||
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
|
}
|
||||||
|
if (ee->prop.avoid_damage)
|
||||||
|
{
|
||||||
|
ecore_evas_avoid_damage_set(ee, 0);
|
||||||
|
ecore_evas_avoid_damage_set(ee, 1);
|
||||||
|
}
|
||||||
|
if (ee->shaped)
|
||||||
|
{
|
||||||
|
ecore_evas_shaped_set(ee, 0);
|
||||||
|
ecore_evas_shaped_set(ee, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
|
_ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
ecore_x_window_move_resize(ee->engine.x.win_container, x, y, w, h);
|
ecore_x_window_move_resize(ee->engine.x.win_container, x, y, w, h);
|
||||||
|
if (ee->engine.x.direct_resize)
|
||||||
|
{
|
||||||
|
ecore_x_window_move_resize(ee->engine.x.win, 0, 0, w, h);
|
||||||
|
if ((ee->w != w) || (ee->h != h))
|
||||||
|
{
|
||||||
|
ee->w = w;
|
||||||
|
ee->h = h;
|
||||||
|
if ((ee->rotation == 90) || (ee->rotation == 270))
|
||||||
|
{
|
||||||
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
||||||
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||||
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
|
}
|
||||||
|
if (ee->prop.avoid_damage)
|
||||||
|
{
|
||||||
|
ecore_evas_avoid_damage_set(ee, 0);
|
||||||
|
ecore_evas_avoid_damage_set(ee, 1);
|
||||||
|
}
|
||||||
|
if (ee->shaped)
|
||||||
|
{
|
||||||
|
ecore_evas_shaped_set(ee, 0);
|
||||||
|
ecore_evas_shaped_set(ee, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -965,7 +1023,7 @@ _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
int rw, rh;
|
int rw, rh;
|
||||||
|
|
||||||
ecore_x_window_size_get(0, &rw, &rh);
|
ecore_x_window_size_get(0, &rw, &rh);
|
||||||
ecore_x_window_resize(ee->engine.x.win, rw, rh);
|
ecore_x_window_move_resize(ee->engine.x.win, 0, 0, rw, rh);
|
||||||
ecore_x_window_reparent(ee->engine.x.win, 0, 0, 0);
|
ecore_x_window_reparent(ee->engine.x.win, 0, 0, 0);
|
||||||
ecore_x_window_raise(ee->engine.x.win);
|
ecore_x_window_raise(ee->engine.x.win);
|
||||||
ecore_x_window_show(ee->engine.x.win);
|
ecore_x_window_show(ee->engine.x.win);
|
||||||
|
@ -988,13 +1046,13 @@ _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
|
|
||||||
ecore_x_window_size_get(ee->engine.x.win_container, &pw, &ph);
|
ecore_x_window_size_get(ee->engine.x.win_container, &pw, &ph);
|
||||||
ecore_x_window_reparent(ee->engine.x.win, ee->engine.x.win_container, 0, 0);
|
ecore_x_window_reparent(ee->engine.x.win, ee->engine.x.win_container, 0, 0);
|
||||||
ecore_x_window_resize(ee->engine.x.win, pw, ph);
|
ecore_x_window_move_resize(ee->engine.x.win, 0, 0, pw, ph);
|
||||||
ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
|
ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
|
||||||
if (ee->should_be_visible) ecore_x_window_show(ee->engine.x.win_container);
|
if (ee->should_be_visible) ecore_x_window_show(ee->engine.x.win_container);
|
||||||
ee->w = pw;
|
ee->w = pw;
|
||||||
ee->h = ph;
|
ee->h = ph;
|
||||||
}
|
}
|
||||||
ecore_x_window_resize(ee->engine.x.win, ee->w, ee->h);
|
ecore_x_window_move_resize(ee->engine.x.win, 0, 0, ee->w, ee->h);
|
||||||
if ((ee->rotation == 90) || (ee->rotation == 270))
|
if ((ee->rotation == 90) || (ee->rotation == 270))
|
||||||
{
|
{
|
||||||
evas_output_size_set(ee->evas, ee->h, ee->w);
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
||||||
|
@ -1250,6 +1308,56 @@ ecore_evas_software_x11_window_get(Ecore_Evas *ee)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be documented.
|
||||||
|
*
|
||||||
|
* FIXME: To be fixed.
|
||||||
|
*/
|
||||||
|
Ecore_X_Window
|
||||||
|
ecore_evas_software_x11_subwindow_get(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
#ifdef BUILD_ECORE_X
|
||||||
|
return ee->engine.x.win;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be documented.
|
||||||
|
*
|
||||||
|
* FIXME: To be fixed.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
ecore_evas_software_x11_direct_resize_set(Ecore_Evas *ee, int on)
|
||||||
|
{
|
||||||
|
#ifdef BUILD_ECORE_X
|
||||||
|
ee->engine.x.direct_resize = on;
|
||||||
|
#else
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be documented.
|
||||||
|
*
|
||||||
|
* FIXME: To be fixed.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
ecore_evas_software_x11_direct_resize_get(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
#ifdef BUILD_ECORE_X
|
||||||
|
return ee->engine.x.direct_resize;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be documented.
|
||||||
|
*
|
||||||
|
* FIXME: To be fixed.
|
||||||
|
*/
|
||||||
Ecore_Evas *
|
Ecore_Evas *
|
||||||
ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent,
|
ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
|
@ -1390,3 +1498,49 @@ ecore_evas_gl_x11_window_get(Ecore_Evas *ee)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be documented.
|
||||||
|
*
|
||||||
|
* FIXME: To be fixed.
|
||||||
|
*/
|
||||||
|
Ecore_X_Window
|
||||||
|
ecore_evas_gl_x11_subwindow_get(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
#ifdef BUILD_ECORE_X
|
||||||
|
return ee->engine.x.win;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be documented.
|
||||||
|
*
|
||||||
|
* FIXME: To be fixed.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
ecore_evas_gl_x11_direct_resize_set(Ecore_Evas *ee, int on)
|
||||||
|
{
|
||||||
|
#ifdef BUILD_ECORE_X
|
||||||
|
ee->engine.x.direct_resize = on;
|
||||||
|
#else
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be documented.
|
||||||
|
*
|
||||||
|
* FIXME: To be fixed.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
ecore_evas_gl_x11_direct_resize_get(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
#ifdef BUILD_ECORE_X
|
||||||
|
return ee->engine.x.direct_resize;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,12 @@ ecore_txt_convert(char *enc_from, char *enc_to, char *text)
|
||||||
new_txt = NULL;
|
new_txt = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (new_txt) free(new_txt);
|
||||||
|
new_txt = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (inb == 0)
|
if (inb == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -105,7 +105,22 @@ typedef enum _Ecore_X_Event_Mask
|
||||||
ECORE_X_EVENT_MASK_WINDOW_FOCUS_IN = (1L << 30),
|
ECORE_X_EVENT_MASK_WINDOW_FOCUS_IN = (1L << 30),
|
||||||
ECORE_X_EVENT_MASK_WINDOW_FOCUS_OUT = (1L << 31)
|
ECORE_X_EVENT_MASK_WINDOW_FOCUS_OUT = (1L << 31)
|
||||||
} Ecore_X_Event_Mask;
|
} Ecore_X_Event_Mask;
|
||||||
|
|
||||||
|
typedef enum _Ecore_X_Gravity {
|
||||||
|
ECORE_X_GRAVITY_FORGET = 0,
|
||||||
|
ECORE_X_GRAVITY_UNMAP = 0,
|
||||||
|
ECORE_X_GRAVITY_NW = 1,
|
||||||
|
ECORE_X_GRAVITY_N = 2,
|
||||||
|
ECORE_X_GRAVITY_NE = 3,
|
||||||
|
ECORE_X_GRAVITY_W = 4,
|
||||||
|
ECORE_X_GRAVITY_CENTER = 5,
|
||||||
|
ECORE_X_GRAVITY_E = 6,
|
||||||
|
ECORE_X_GRAVITY_SW = 7,
|
||||||
|
ECORE_X_GRAVITY_S = 8,
|
||||||
|
ECORE_X_GRAVITY_SE = 9,
|
||||||
|
ECORE_X_GRAVITY_STATIC = 10
|
||||||
|
} Ecore_X_Gravity;
|
||||||
|
|
||||||
typedef struct _Ecore_X_Event_Key_Down Ecore_X_Event_Key_Down;
|
typedef struct _Ecore_X_Event_Key_Down Ecore_X_Event_Key_Down;
|
||||||
typedef struct _Ecore_X_Event_Key_Up Ecore_X_Event_Key_Up;
|
typedef struct _Ecore_X_Event_Key_Up Ecore_X_Event_Key_Up;
|
||||||
typedef struct _Ecore_X_Event_Mouse_Button_Down Ecore_X_Event_Mouse_Button_Down;
|
typedef struct _Ecore_X_Event_Mouse_Button_Down Ecore_X_Event_Mouse_Button_Down;
|
||||||
|
@ -806,7 +821,11 @@ Ecore_X_Window ecore_x_window_parent_get(Ecore_X_Window win);
|
||||||
|
|
||||||
void ecore_x_window_background_color_set(Ecore_X_Window win,
|
void ecore_x_window_background_color_set(Ecore_X_Window win,
|
||||||
unsigned long color);
|
unsigned long color);
|
||||||
|
void ecore_x_window_gravity_set(Ecore_X_Window win,
|
||||||
|
Ecore_X_Gravity grav);
|
||||||
|
void ecore_x_window_pixel_gravity_set(Ecore_X_Window win,
|
||||||
|
Ecore_X_Gravity grav);
|
||||||
|
|
||||||
Ecore_X_Atom ecore_x_window_prop_any_type(void);
|
Ecore_X_Atom ecore_x_window_prop_any_type(void);
|
||||||
void ecore_x_window_prop_property_set(Ecore_X_Window win, Ecore_X_Atom type, Ecore_X_Atom format, int size, void *data, int number);
|
void ecore_x_window_prop_property_set(Ecore_X_Window win, Ecore_X_Atom type, Ecore_X_Atom format, int size, void *data, int number);
|
||||||
int ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecore_X_Atom type, int size, unsigned char **data, int *num);
|
int ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecore_X_Atom type, int size, unsigned char **data, int *num);
|
||||||
|
@ -905,20 +924,6 @@ int ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom t
|
||||||
void ecore_x_window_client_sniff(Ecore_X_Window win);
|
void ecore_x_window_client_sniff(Ecore_X_Window win);
|
||||||
Ecore_X_Atom ecore_x_atom_get(char *name);
|
Ecore_X_Atom ecore_x_atom_get(char *name);
|
||||||
|
|
||||||
typedef enum _Ecore_X_Gravity {
|
|
||||||
ECORE_X_GRAVITY_FORGET = 0,
|
|
||||||
ECORE_X_GRAVITY_UNMAP = 0,
|
|
||||||
ECORE_X_GRAVITY_NW = 1,
|
|
||||||
ECORE_X_GRAVITY_N = 2,
|
|
||||||
ECORE_X_GRAVITY_NE = 3,
|
|
||||||
ECORE_X_GRAVITY_W = 4,
|
|
||||||
ECORE_X_GRAVITY_CENTER = 5,
|
|
||||||
ECORE_X_GRAVITY_E = 6,
|
|
||||||
ECORE_X_GRAVITY_SW = 7,
|
|
||||||
ECORE_X_GRAVITY_S = 8,
|
|
||||||
ECORE_X_GRAVITY_SE = 9,
|
|
||||||
ECORE_X_GRAVITY_STATIC = 10
|
|
||||||
} Ecore_X_Gravity;
|
|
||||||
void
|
void
|
||||||
ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state);
|
ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state);
|
||||||
void
|
void
|
||||||
|
@ -969,6 +974,10 @@ int ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom t
|
||||||
int *step_x, int *step_y,
|
int *step_x, int *step_y,
|
||||||
double *min_aspect,
|
double *min_aspect,
|
||||||
double *max_aspect);
|
double *max_aspect);
|
||||||
|
void
|
||||||
|
ecore_x_icccm_title_set(Ecore_X_Window win, const char *t);
|
||||||
|
char *
|
||||||
|
ecore_x_icccm_title_get(Ecore_X_Window win);
|
||||||
|
|
||||||
void ecore_x_netwm_init(void);
|
void ecore_x_netwm_init(void);
|
||||||
void ecore_x_netwm_wm_identify(Ecore_X_Window root, Ecore_X_Window check, const char *wm_name);
|
void ecore_x_netwm_wm_identify(Ecore_X_Window root, Ecore_X_Window check, const char *wm_name);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Ecore.h>
|
#include "Ecore.h"
|
||||||
#include "ecore_x_private.h"
|
#include "ecore_x_private.h"
|
||||||
#include <Ecore_X.h>
|
#include "Ecore_X.h"
|
||||||
|
|
||||||
static Ecore_X_Selection_Data _xdnd_selection;
|
static Ecore_X_Selection_Data _xdnd_selection;
|
||||||
static Ecore_X_DND_Protocol *_xdnd;
|
static Ecore_X_DND_Protocol *_xdnd;
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include "Ecore.h"
|
#include "Ecore.h"
|
||||||
#include "ecore_x_private.h"
|
#include "ecore_x_private.h"
|
||||||
#include "Ecore_X.h"
|
#include "Ecore_X.h"
|
||||||
#include "Ecore_Txt.h"
|
|
||||||
|
|
||||||
static void _ecore_x_event_free_window_prop_name_class_change(void *data, void *ev);
|
static void _ecore_x_event_free_window_prop_name_class_change(void *data, void *ev);
|
||||||
static void _ecore_x_event_free_window_prop_title_change(void *data, void *ev);
|
static void _ecore_x_event_free_window_prop_title_change(void *data, void *ev);
|
||||||
|
|
|
@ -324,9 +324,93 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_icccm_title_set(Ecore_X_Window win, const char *t)
|
||||||
|
{
|
||||||
|
char *list[1];
|
||||||
|
XTextProperty xprop;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
#ifdef X_HAVE_UTF8_STRING
|
||||||
|
list[0] = strdup(t);
|
||||||
|
ret = Xutf8TextListToTextProperty(_ecore_x_disp, list, 1, XUTF8StringStyle, &xprop);
|
||||||
|
#else
|
||||||
|
list[0] = strdup(t);
|
||||||
|
ret = XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle, &xprop);
|
||||||
|
#endif
|
||||||
|
if (ret >= Success)
|
||||||
|
{
|
||||||
|
XSetWMName(_ecore_x_disp, win, &xprop);
|
||||||
|
XFree(xprop.value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (XStringListToTextProperty(list, 1, &xprop) >= Success)
|
||||||
|
{
|
||||||
|
XSetWMName(_ecore_x_disp, win, &xprop);
|
||||||
|
XFree(xprop.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(list[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
ecore_x_icccm_title_get(Ecore_X_Window win)
|
||||||
|
{
|
||||||
|
XTextProperty xprop;
|
||||||
|
|
||||||
|
if (XGetWMName(_ecore_x_disp, win, &xprop))
|
||||||
|
{
|
||||||
|
if (xprop.value)
|
||||||
|
{
|
||||||
|
char **list = NULL;
|
||||||
|
char *t = NULL;
|
||||||
|
int num = 0;
|
||||||
|
|
||||||
|
if (xprop.encoding == _ecore_x_atom_string)
|
||||||
|
{
|
||||||
|
t = strdup(xprop.value);
|
||||||
|
}
|
||||||
|
else if (xprop.encoding == _ecore_x_atom_utf8_string)
|
||||||
|
{
|
||||||
|
t = strdup(xprop.value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
#ifdef X_HAVE_UTF8_STRING
|
||||||
|
ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
|
||||||
|
&list, &num);
|
||||||
|
#else
|
||||||
|
ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
|
||||||
|
&list, &num);
|
||||||
|
#endif
|
||||||
|
if ((ret == XLocaleNotSupported) ||
|
||||||
|
(ret == XNoMemory) ||
|
||||||
|
(ret == XConverterNotFound))
|
||||||
|
{
|
||||||
|
t = strdup(xprop.value);
|
||||||
|
}
|
||||||
|
else if (ret >= Success)
|
||||||
|
{
|
||||||
|
if ((num >= 1) && (list))
|
||||||
|
{
|
||||||
|
/* FIXME: convert to utf8 */
|
||||||
|
t = strdup(list[0]);
|
||||||
|
}
|
||||||
|
if (list) XFreeStringList(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
XFree(xprop.value);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: move these things in here as they are icccm related */
|
/* FIXME: move these things in here as they are icccm related */
|
||||||
/* get/set wm protocols */
|
/* get/set wm protocols */
|
||||||
/* get/set title */
|
|
||||||
/* get/set name/class */
|
/* get/set name/class */
|
||||||
/* get/set machine */
|
/* get/set machine */
|
||||||
/* get/set command */
|
/* get/set command */
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
/* FIXME: this is for simulation only */
|
/* FIXME: this is for simulation only */
|
||||||
#include "Ecore_Job.h"
|
#include "Ecore_Job.h"
|
||||||
|
#include "Ecore_Txt.h"
|
||||||
|
|
||||||
typedef struct _Ecore_X_Reply Ecore_X_Reply;
|
typedef struct _Ecore_X_Reply Ecore_X_Reply;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#include <Ecore.h>
|
#include "Ecore.h"
|
||||||
#include "ecore_x_private.h"
|
#include "ecore_x_private.h"
|
||||||
#include <Ecore_X.h>
|
#include "Ecore_X.h"
|
||||||
#include <Ecore_Txt.h>
|
|
||||||
|
|
||||||
static Ecore_X_Selection_Data selections[3] = {{0}};
|
static Ecore_X_Selection_Data selections[3] = {{0}};
|
||||||
static Ecore_X_Selection_Data request_data[3] = {{0}};
|
static Ecore_X_Selection_Data request_data[3] = {{0}};
|
||||||
|
|
|
@ -719,3 +719,21 @@ ecore_x_window_background_color_set(Ecore_X_Window win, unsigned long color)
|
||||||
attr.background_pixel = color;
|
attr.background_pixel = color;
|
||||||
XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr);
|
XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav)
|
||||||
|
{
|
||||||
|
XSetWindowAttributes att;
|
||||||
|
|
||||||
|
att.win_gravity = grav;
|
||||||
|
XChangeWindowAttributes(_ecore_x_disp, win, CWWinGravity, &att);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_pixel_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav)
|
||||||
|
{
|
||||||
|
XSetWindowAttributes att;
|
||||||
|
|
||||||
|
att.bit_gravity = grav;
|
||||||
|
XChangeWindowAttributes(_ecore_x_disp, win, CWBitGravity, &att);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue