-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: a0d75d018eb5ab320525745ca72f8e87688ec20b:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit a0d75d018eb5ab320525745ca72f8e87688ec20b
Author: Marc Lehmann <schmorp@schmorp.de>
Date:   Sat Dec 11 23:01:36 2004 +0000

    *** empty log message ***

diff --git a/src/init.C b/src/init.C

index a2705c10214cd0e349f13f4ef382b947fc85b5cf..

index ..0fa56df62dacccc35885be14221dd7d2cd68e95a 100644

--- a/src/init.C
+++ b/src/init.C
@@ -592,14 +592,15 @@ rxvt_term::set_locale (const char *locale)
   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
 }
@@ -612,12 +613,7 @@ rxvt_term::init_xlocale ()
     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 ())
         {
@@ -641,19 +637,6 @@ rxvt_term::init_command (const char *const *argv)
    * 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);
@@ -915,6 +898,14 @@ rxvt_term::create_windows (int argc, const char *const *argv)
   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);
@@ -992,6 +983,10 @@ rxvt_term::create_windows (int argc, const char *const *argv)
   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 ();

diff --git a/src/rxvt.h b/src/rxvt.h

index b992f624e1341adeadfdef17061d4214b11563a8..

index ..cd539607eddaa3fa658a8282c386a7f9dd0e7bf1 100644

--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -88,7 +88,10 @@ void             rxvt_clean_exit                  ();
 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);
@@ -134,8 +137,8 @@ struct grwin_t;

 #ifdef XPM_BACKGROUND
 typedef struct {
-  short           w, h, x, y;
-  Pixmap          pixmap;
+  short w, h, x, y;
+  Pixmap pixmap;
 } bgPixmap_t;
 #endif

@@ -144,10 +147,10 @@ typedef struct {
  * 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)
@@ -1005,7 +1008,7 @@ struct rxvt_term : zero_initialized, rxvt_vars {
 #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;
@@ -1169,9 +1172,6 @@ struct rxvt_term : zero_initialized, rxvt_vars {
   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 */
@@ -1354,6 +1354,8 @@ struct rxvt_term : zero_initialized, rxvt_vars {
   // 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);
diff --git a/src/rxvttoolkit.h b/src/rxvttoolkit.h

index 7937bd3268ac279883e1fcb8d3a9517cc2f38667..

index ..5a113049acbee75a65e3ca1f4713a24b35faae11 100644

--- a/src/rxvttoolkit.h
+++ b/src/rxvttoolkit.h
@@ -86,6 +86,8 @@ struct rxvt_display : refcounted {
   bool init ();
   ~rxvt_display ();

+  operator Display *() const { return display; }
+
   void flush ();

   void set_selection_owner (rxvt_term *owner);

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 14:06:18 2024