SET_LOCALE (this->locale);
mbstate.reset ();
#endif
+
#if 0
#if HAVE_NL_LANGINFO
- free (codeset);
- codeset = strdup (nl_langinfo (CODESET));
+ char *codeset = strdup (nl_langinfo (CODESET));
enc_utf8 = !strcasecmp (codeset, "UTF-8")
|| !strcasecmp (codeset, "UTF8");
+ free (codeset);
#else
- enc_utf8 = 1;
+ enc_utf8 = 0;
#endif
#endif
}
rxvt_warn ("setting locale failed, working without locale support.\n");
else
{
- Atom wmlocale;
-
- wmlocale = XInternAtom (display->display, "WM_LOCALE_NAME", False);
- XChangeProperty (display->display, TermWin.parent[0], wmlocale,
- XA_STRING, 8, PropModeReplace,
- (unsigned char *)locale, strlen (locale));
+ set_string_property (display->atom ("WM_LOCALE_NAME"), locale);
if (!XSupportsLocale ())
{
* Initialize the command connection.
* This should be called after the X server connection is established.
*/
- int i;
-
- for (i = 0; i < NUM_XA; i++)
- xa[i] = XInternAtom (display->display, xa_names[i], False);
-
- /* Enable delete window protocol */
- XSetWMProtocols (display->display, TermWin.parent[0],
- & (xa[XA_WMDELETEWINDOW]), 1);
-
-#ifdef USING_W11LIB
- /* enable W11 callbacks */
- W11AddEventHandler (display->display, rxvt_W11_process_x_event);
-#endif
#ifdef META8_OPTION
meta_char = (options & Opt_meta8 ? 0x80 : C0_ESC);
XSetWindowAttributes attributes;
XWindowAttributes gattr;
+ for (int i = 0; i < NUM_XA; i++)
+ xa[i] = XInternAtom (display->display, xa_names[i], False);
+
+#ifdef USING_W11LIB
+ /* enable W11 callbacks */
+ W11AddEventHandler (display->display, rxvt_W11_process_x_event);
+#endif
+
if (options & Opt_transparent)
{
XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr);
XSetWMProperties (display->display, TermWin.parent[0], NULL, NULL,
(char **)argv, argc, &szHint, &wmHint, &classHint);
+ /* Enable delete window protocol */
+ XSetWMProtocols (display->display, TermWin.parent[0],
+ &xa[XA_WMDELETEWINDOW], 1);
+
#if ENABLE_FRILLS
long pid = getpid ();
void * rxvt_malloc (size_t size);
void * rxvt_calloc (size_t number, size_t size);
void * rxvt_realloc (void *ptr, size_t size);
-char * rxvt_wcstombs (const wchar_t *str, int len);
+char * rxvt_wcstombs (const wchar_t *str, int len = -1);
+wchar_t * rxvt_mbstowcs (const char *str, int len = -1);
+char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1);
+wchar_t * rxvt_utf8towcs (const char *str, int len = -1);
char * rxvt_strdup (const char *str);
char * rxvt_r_basename (const char *str);
void rxvt_vlog (const char *fmt, va_list arg_ptr);
#ifdef XPM_BACKGROUND
typedef struct {
- short w, h, x, y;
- Pixmap pixmap;
+ short w, h, x, y;
+ Pixmap pixmap;
} bgPixmap_t;
#endif
* pared down from XButtonEvent
*/
struct mouse_event {
- int clicks;
- Time time; /* milliseconds */
- unsigned int state; /* key or button mask */
- unsigned int button; /* detail */
+ int clicks;
+ Time time; /* milliseconds */
+ unsigned int state; /* key or button mask */
+ unsigned int button; /* detail */
};
#define MAX_IT(current, other) if ((other) > (current)) (current) = (other)
#ifdef POINTER_BLANK
hidden_pointer:1,
#endif
-// enc_utf8:1, /* wether terminal reads/writes utf-8 */
+// enc_utf8:1, /* wether locale uses utf-8 */
seen_input:1, /* wether we have seen some program output yet */
seen_resize:1, /* wether we had a resize event */
parsed_geometry:1;
char *env_term; /* environmental variable TERM */
char *env_colorfgbg;
char *locale;
-#if 0
- char *codeset;
-#endif
char charsets[4];
unsigned char *v_buffer; /* pointer to physical buffer */
unsigned int v_buflen; /* size of area to write */
// main.C
void privileged_utmp (rxvt_privaction action);
bool set_fonts ();
+ void set_string_property (Atom prop, const char *str, int len = -1);
+ void set_utf8_property (Atom prop, const char *str, int len = -1);
void set_title (const char *str);
void set_icon_name (const char *str);
void set_window_color (int idx, const char *color);