commit/XEmacs: 2 new changesets
7 years
Bitbucket
2 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/46efc7173def/
Changeset: 46efc7173def
User: kehoea
Date: 2017-12-22 12:48:38+00:00
Summary: Remove the last of the X11-specific code, compose.el
2017-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
* compose.el:
[...]
(decide-on-bindings):
Remove the last of the X11-specific code, don't use the UABCD
keysyms for some exotic composed base characters.
Affected #: 2 files
diff -r 3de111a0da7b7880bb1473598b14a4cd84a97200 -r 46efc7173defd0f4f41bd8f3819970c4876c551a lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,9 @@
* compose.el: Rename from x-compose.el, it's not
platform-specific.
+ (decide-on-bindings):
+ Remove the last of the X11-specific code, don't use the UABCD
+ keysyms for some exotic composed base characters.
* gtk-compose.el (gtk-compose): Require the new feature.
* isearch-mode.el (isearch-pre-command-hook):
* keymap.el (for):
diff -r 3de111a0da7b7880bb1473598b14a4cd84a97200 -r 46efc7173defd0f4f41bd8f3819970c4876c551a lisp/compose.el
--- a/lisp/compose.el
+++ b/lisp/compose.el
@@ -406,9 +406,9 @@
(compose-caron-map [?A] #x01CD) ;; CAPITAL A WITH CARON
(compose-caron-map [?C] #x010C) ;; CAPITAL C WITH CARON
(compose-caron-map [?D] #x010E) ;; CAPITAL D WITH CARON
- (compose-caron-map [U01F1] #x01C4) ;; CAPITAL DZ WITH CARON
+ (compose-caron-map (decode-char 'ucs #x01f1) #x01C4) ;; CAPITAL DZ WITH CARON
(compose-caron-map [?E] #x011A) ;; CAPITAL E WITH CARON
- (compose-caron-map [U01B7] #x01EE) ;; CAPITAL EZH WITH CARON
+ (compose-caron-map (decode-char 'ucs #x01b7) #x01EE) ;; CAPITAL EZH WITH CARON
(compose-caron-map [?G] #x01E6) ;; CAPITAL G WITH CARON
(compose-caron-map [?H] #x021E) ;; CAPITAL H WITH CARON
(compose-caron-map [?I] #x01CF) ;; CAPITAL I WITH CARON
@@ -424,9 +424,9 @@
(compose-caron-map [?a] #x01CE) ;; SMALL A WITH CARON
(compose-caron-map [?c] #x010D) ;; SMALL C WITH CARON
(compose-caron-map [?d] #x010F) ;; SMALL D WITH CARON
- (compose-caron-map [U01F3] #x01C6) ;; SMALL DZ WITH CARON
+ (compose-caron-map (decode-char 'ucs #x01F3) #x01C6) ;; SMALL DZ WITH CARON
(compose-caron-map [?e] #x011B) ;; SMALL E WITH CARON
- (compose-caron-map [U0292] #x01EF) ;; SMALL EZH WITH CARON
+ (compose-caron-map (decode-char 'ucs #x0292) #x01EF) ;; SMALL EZH WITH CARON
(compose-caron-map [?g] #x01E7) ;; SMALL G WITH CARON
(compose-caron-map [?h] #x021F) ;; SMALL H WITH CARON
(compose-caron-map [?i] #x01D0) ;; SMALL I WITH CARON
@@ -515,7 +515,7 @@
(compose-dot-map [?f] #x1E1F) ;; SMALL F WITH DOT ABOVE
(compose-dot-map [?g] #x0121) ;; SMALL G WITH DOT ABOVE
(compose-dot-map [?h] #x1E23) ;; SMALL H WITH DOT ABOVE
- (compose-dot-map [U017F] #x1E9B) ;; SMALL LONG S WITH DOT ABOVE
+ (compose-dot-map (decode-char 'ucs #x017F) #x1E9B) ;; SMALL LONG S WITH DOT ABOVE
(compose-dot-map [?m] #x1E41) ;; SMALL M WITH DOT ABOVE
(compose-dot-map [?n] #x1E45) ;; SMALL N WITH DOT ABOVE
(compose-dot-map [?o] #x022F) ;; SMALL O WITH DOT ABOVE
@@ -543,23 +543,23 @@
(compose-hook-map [?V] #x01B2) ;; CAPITAL V WITH HOOK
(compose-hook-map [?Y] #x01B3) ;; CAPITAL Y WITH HOOK
(compose-hook-map [?Z] #x0224) ;; CAPITAL Z WITH HOOK
- (compose-hook-map [U0262] #x029B) ;; SMALL CAPITAL G WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x0262) #x029B) ;; SMALL CAPITAL G WITH HOOK
(compose-hook-map [?b] #x0253) ;; SMALL B WITH HOOK
(compose-hook-map [?c] #x0188) ;; SMALL C WITH HOOK
(compose-hook-map [?d] #x0257) ;; SMALL D WITH HOOK
(compose-hook-map [?f] #x0192) ;; SMALL F WITH HOOK
(compose-hook-map [?g] #x0260) ;; SMALL G WITH HOOK
(compose-hook-map [?h] #x0266) ;; SMALL H WITH HOOK
- (compose-hook-map [U0266] #x0267) ;; SMALL HENG WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x0266) #x0267) ;; SMALL HENG WITH HOOK
(compose-hook-map [?k] #x0199) ;; SMALL K WITH HOOK
(compose-hook-map [?m] #x0271) ;; SMALL M WITH HOOK
(compose-hook-map [?p] #x01A5) ;; SMALL P WITH HOOK
(compose-hook-map [?q] #x02A0) ;; SMALL Q WITH HOOK
- (compose-hook-map [U025C] #x025D) ;; SMALL REVERSED OPEN E WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x025C) #x025D) ;; SMALL REVERSED OPEN E WITH HOOK
(compose-hook-map [?s] #x0282) ;; SMALL S WITH HOOK
- (compose-hook-map [U0259] #x025A) ;; SMALL SCHWA WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x0259) #x025A) ;; SMALL SCHWA WITH HOOK
(compose-hook-map [?t] #x01AD) ;; SMALL T WITH HOOK
- (compose-hook-map [U0279] #x027B) ;; SMALL TURNED R WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x0279) #x027B) ;; SMALL TURNED R WITH HOOK
(compose-hook-map [?v] #x028B) ;; SMALL V WITH HOOK
(compose-hook-map [?y] #x01B4) ;; SMALL Y WITH HOOK
(compose-hook-map [?z] #x0225) ;; SMALL Z WITH HOOK
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: 2 new changesets
7 years
Bitbucket
2 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/268f55c89b5c/
Changeset: 268f55c89b5c
User: kehoea
Date: 2017-12-20 00:04:36+00:00
Summary: Correct the placement of some #ifdefs, redisplay-gtk.c
src/ChangeLog addition:
2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
* redisplay-gtk.c (XLIKE_bevel_area):
* redisplay-gtk.c (gtk_text_attributes):
Correct the placement of some #ifdefs here, get the code building
under GTK2 again.
Affected #: 2 files
diff -r a5b21ebab055b2b74f16e61d09c57d88d268a74c -r 268f55c89b5c4bd6e5fe72eef1be8a2d6856a844 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * redisplay-gtk.c (XLIKE_bevel_area):
+ * redisplay-gtk.c (gtk_text_attributes):
+ Correct the placement of some #ifdefs here, get the code building
+ under GTK2 again.
+
2017-12-18 Aidan Kehoe <kehoea(a)parhasard.net>
* event-Xt.c:
@@ -8,7 +15,7 @@
* event-Xt.c (x_keysym_to_character):
As above.
* event-xlike-inc.c:
- Move the Hangule, Armenian, Georgian, Azeri, Vietnamese support in
+ Move the Hangul, Armenian, Georgian, Azeri, Vietnamese support from
here.
* redisplay-gtk.c:
* redisplay-x.c:
diff -r a5b21ebab055b2b74f16e61d09c57d88d268a74c -r 268f55c89b5c4bd6e5fe72eef1be8a2d6856a844 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -182,6 +182,7 @@
#ifdef HAVE_GTK3
GtkStyleContext *gstyle = gtk_widget_get_style_context (widget);
GdkWindow *window = gtk_widget_get_window (widget);
+#endif
#if GTK_CHECK_VERSION(3, 22, 0)
cairo_region_t *region = gdk_window_get_visible_region (window);
/* We should be able to avoid the next call, but the GTK documentation
@@ -192,7 +193,6 @@
#else
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
#endif
-#endif
GtkShadowType stype;
if (shadow_thickness == 0)
@@ -604,7 +604,7 @@
bg->blue));
#endif
-#if HAVE_GTK3
+#ifdef HAVE_GTK3
GdkRGBA *fg = XCOLOR_INSTANCE_GTK_COLOR (cachel->foreground);
GdkRGBA *bg = XCOLOR_INSTANCE_GTK_COLOR (cachel->background);
https://bitbucket.org/xemacs/xemacs/commits/a69c6e871607/
Changeset: a69c6e871607
User: kehoea
Date: 2017-12-20 00:13:53+00:00
Summary: Use non-ASCII Lisp characters as keysyms under X11 too, thank you Ben
src/ChangeLog addition:
2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
Use Lisp characters as the keysym for event objects reflecting
keys with character mappings on X11, as we do on every other
platform, and as Ben suggests.
* event-Xt.c:
* event-Xt.c (USE_UNICODE_MAP):
Don't use the current buffer for the Unicode conversion precedence
list, use the language-specific default in
Vdefault_unicode_precedence_array.
* event-Xt.c (x_keysym_to_character):
Give useful values for ASCII values too.
* event-Xt.c (maybe_define_x_key_as_self_inserting_character):
Don't mess around with the character-of-keysym property here, now
we no longer use symbol keysyms for X11 keys with character
mappings.
* event-Xt.c (x_has_keysym):
Call m_d_x_k_a_s_i_c() with its new simpler calling convention.
* event-Xt.c (x_keysym_to_emacs_keysym):
Call x_keysym_to_character() early.
* event-Xt.c (x_to_emacs_keysym):
Drop the SIMPLE_P argument, not used.
* event-Xt.c (x_event_to_emacs_event):
Update calls to x_to_emacs_keysym() correspondingly in this function.
Affected #: 2 files
diff -r 268f55c89b5c4bd6e5fe72eef1be8a2d6856a844 -r a69c6e871607eee0c429c827c5e0be49ede0bb17 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,28 @@
+2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ Use Lisp characters as the keysym for event objects reflecting
+ keys with character mappings on X11, as we do on every other
+ platform, and as Ben suggests.
+ * event-Xt.c:
+ * event-Xt.c (USE_UNICODE_MAP):
+ Don't use the current buffer for the Unicode conversion precedence
+ list, use the language-specific default in
+ Vdefault_unicode_precedence_array.
+ * event-Xt.c (x_keysym_to_character):
+ Give useful values for ASCII values too.
+ * event-Xt.c (maybe_define_x_key_as_self_inserting_character):
+ Don't mess around with the character-of-keysym property here, now
+ we no longer use symbol keysyms for X11 keys with character
+ mappings.
+ * event-Xt.c (x_has_keysym):
+ Call m_d_x_k_a_s_i_c() with its new simpler calling convention.
+ * event-Xt.c (x_keysym_to_emacs_keysym):
+ Call x_keysym_to_character() early.
+ * event-Xt.c (x_to_emacs_keysym):
+ Drop the SIMPLE_P argument, not used.
+ * event-Xt.c (x_event_to_emacs_event):
+ Update calls to x_to_emacs_keysym() correspondingly in this function.
+
2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
* redisplay-gtk.c (XLIKE_bevel_area):
diff -r 268f55c89b5c4bd6e5fe72eef1be8a2d6856a844 -r a69c6e871607eee0c429c827c5e0be49ede0bb17 src/event-Xt.c
--- a/src/event-Xt.c
+++ b/src/event-Xt.c
@@ -125,7 +125,7 @@
0
};
-static Lisp_Object x_keysym_to_emacs_keysym (KeySym keysym, int simple_p);
+static Lisp_Object x_keysym_to_emacs_keysym (KeySym keysym);
void emacs_Xt_mapping_action (Widget w, XEvent *event);
void debug_process_finalization (Lisp_Process *p);
void emacs_Xt_event_handler (Widget wid, XtPointer closure, XEvent *event,
@@ -147,13 +147,12 @@
&& map[keysym - FIRST_KNOWN_##map ]) do \
{ \
keysym -= FIRST_KNOWN_##map ; \
- return make_char (buffer_unicode_to_ichar ((int) map[keysym], \
- /* @@#### need to get some sort \
- of buffer to compute this off; \
- only applies in the old-Mule \
- world */ \
- current_buffer, \
- CONVERR_SUCCEED)); \
+ /* Use the language-environment precedence list, not that of */ \
+ /* the current buffer. */ \
+ return make_char (filtered_unicode_to_ichar \
+ ((int) map[keysym], \
+ Vdefault_unicode_precedence_array, NULL, \
+ CONVERR_SUCCEED)); \
} while (0)
/* Maps to Unicode for X11 KeySyms, where we don't have a direct internal
@@ -1004,8 +1003,12 @@
int code = 0;
#endif /* MULE */
+ if (keysym < 0x100)
+ {
+ return make_char ((Ichar) keysym);
+ }
+
/* @@#### Add support for 0xFE?? and 0xFF?? keysyms
- Add support for KOI8-U extensions in the 0x06?? range
See http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt
*/
@@ -1021,11 +1024,12 @@
return make_char (keysym & 0xFFFFFF);
#else
if (keysym >= 0x01000000 && keysym <= 0x0110FFFF)
- return make_char (buffer_unicode_to_ichar
- ((int) (keysym & 0xFFFFFF),
- /* @@#### need to get some sort of buffer to compute
- this off; only applies in the old-Mule world */
- current_buffer, CONVERR_SUCCEED));
+ /* Use the language-environment precedence list, not that of
+ the current buffer. */
+ return make_char (filtered_unicode_to_ichar
+ ((int)(keysym & 0xFFFFFF),
+ Vdefault_unicode_precedence_array, NULL,
+ CONVERR_SUCCEED));
#endif /* not MULE */
if ((keysym & 0xff) < 0xa0)
@@ -1131,12 +1135,10 @@
case 32: /* Currency. The lower sixteen bits of these keysyms happily
correspond exactly to the Unicode code points of the
associated characters */
- return make_char (buffer_unicode_to_ichar
- ((int) (keysym & 0xffff),
- /* @@#### need to get some sort of buffer to
- compute this off; only applies in the old-Mule
- world */
- current_buffer, CONVERR_SUCCEED));
+ return make_char (filtered_unicode_to_ichar
+ ((int) (keysym & 0xffff),
+ Vdefault_unicode_precedence_array, NULL,
+ CONVERR_SUCCEED));
/* @@#### Support me!
@@ -1204,11 +1206,16 @@
break;
}
- if (code == 0)
- return Qnil;
-
- /* #### Is this check on !NILP (charset) needed? Maybe should be assert? */
- if (!NILP (charset))
+ assert (!NILP (charset));
+
+ if (code == 0 || EQ (charset, Qzero))
+ {
+ /* CHARSET being zero is unlikely, but we shouldn't crash, even with
+ error-checking turned on, if X11 gives us a keysym we don't
+ understand. Don't make it an assertion. */
+ return Qnil;
+ }
+ else
{
/* First try to generate a unified character by converting through
Unicode, then try converting directly to an Ichar (only matters
@@ -1216,16 +1223,21 @@
int ucs = charset_codepoint_to_unicode (charset, 0, code, CONVERR_FAIL);
if (ucs >= 0)
{
- /* @@#### current_buffer dependency */
- Ichar ich = buffer_unicode_to_ichar (ucs, current_buffer,
- CONVERR_FAIL);
+ Ichar ich
+ /* Use the language-environment precedence list, not that of the
+ current buffer. */
+ = filtered_unicode_to_ichar (ucs,
+ Vdefault_unicode_precedence_array,
+ NULL, CONVERR_SUCCEED);
if (ich >= 0)
- return make_char (ich);
+ {
+ return make_char (ich);
+ }
}
else
{
- Ichar ich =
- charset_codepoint_to_ichar (charset, 0, code, CONVERR_FAIL);
+ Ichar ich
+ = charset_codepoint_to_ichar (charset, 0, code, CONVERR_FAIL);
if (ich >= 0)
return make_char (ich);
}
@@ -1242,29 +1254,18 @@
/* keymap handling */
/************************************************************************/
-/* @@#### This is the wrong approach, I think. We should not be exposing the
- name of the keysym anywhere, or forcing the user to use this name.
- At the Lisp level, the user should simply see the character itself, and
- should be able to bind the actual character. Furthermore, introducing
- the symbol introduces an X-specific dependency; I can't expect to set
- a binding for a particular Unicode character and have it work on both
- Windows and X. --ben */
+extern Lisp_Object Vcurrent_global_map;
/* See comment near character_to_event(). */
static void
-maybe_define_x_key_as_self_inserting_character (KeySym keysym,
- Lisp_Object symbol)
+maybe_define_x_key_as_self_inserting_character (Lisp_Object emacs_keysym)
{
- Lisp_Object character = x_keysym_to_character (keysym);
-
- if (CHARP (character))
+ if (CHARP (emacs_keysym))
{
- extern Lisp_Object Vcurrent_global_map;
- extern Lisp_Object Qcharacter_of_keysym;
- if (NILP (Flookup_key (Vcurrent_global_map, symbol, Qnil)))
+ if (NILP (Flookup_key (Vcurrent_global_map, emacs_keysym, Qnil)))
{
- Fput (symbol, Qcharacter_of_keysym, character);
- Fdefine_key (Vcurrent_global_map, symbol, Qself_insert_command);
+ Fdefine_key (Vcurrent_global_map, emacs_keysym,
+ Qself_insert_command);
}
}
}
@@ -1275,7 +1276,7 @@
KeySym upper_lower[2];
int j;
- if (keysym < 0x80) /* Optimize for ASCII keysyms */
+ if (keysym < 0x80) /* ASCII keysyms have default bindings anyway. */
return;
/* If you execute:
@@ -1292,7 +1293,7 @@
for (j = 0; j < (upper_lower[0] == upper_lower[1] ? 1 : 2); j++)
{
KeySym ks = upper_lower[j];
- Lisp_Object sym = x_keysym_to_emacs_keysym (ks, 0);
+ Lisp_Object sym = x_keysym_to_emacs_keysym (ks);
Lisp_Object new_value = with_modifiers ? Qt : Qsans_modifiers;
Lisp_Object old_value = Fgethash (sym, hash_table, Qnil);
@@ -1300,7 +1301,7 @@
&& ! (EQ (old_value, Qsans_modifiers) &&
EQ (new_value, Qt)))
{
- maybe_define_x_key_as_self_inserting_character (ks, sym);
+ maybe_define_x_key_as_self_inserting_character (sym);
Fputhash (sym, new_value, hash_table);
}
}
@@ -1846,32 +1847,19 @@
/************************************************************************/
static Lisp_Object
-x_keysym_to_emacs_keysym (KeySym keysym, int simple_p)
+x_keysym_to_emacs_keysym (KeySym keysym)
{
Extbyte *name;
DECLARE_EISTRING(einame);
+ Lisp_Object character;
if (keysym >= XK_exclam && keysym <= XK_asciitilde)
/* We must assume that the X keysym numbers for the ASCII graphic
characters are the same as their ASCII codes. */
return make_char (keysym);
- if (keysym >= 0x01000000 && keysym <= 0x0110FFFF)
- {
- /* These keysyms malloc with XKeysymToString(), *every time the
- function is called.* Avoid leaking, construct the keysym string
- ourselves. */
- Ascbyte buf [10];
- qxesprintf ((Ibyte *) buf, keysym & 0xff0000 ? "U%06X" : "U%04X",
- (unsigned int) (keysym & 0xffffff));
- return KEYSYM (buf);
- }
-
switch (keysym)
{
- /* These would be handled correctly by the default case, but by
- special-casing them here we don't garbage a string or call
- intern(). */
case XK_BackSpace: return QKbackspace;
case XK_Tab: return QKtab;
case XK_Linefeed: return QKlinefeed;
@@ -1881,8 +1869,15 @@
case XK_Delete: return QKdelete;
case 0: return Qnil;
default:
- if (simple_p) return Qnil;
+ character = x_keysym_to_character (keysym);
+
+ if (CHARP (character))
+ {
+ return character;
+ }
+
name = XKeysymToString (keysym);
+
if (!name || !name[0])
/* This happens if there is a mismatch between the Xlib of
XEmacs and the Xlib of the X server...
@@ -1947,8 +1942,7 @@
}
static Lisp_Object
-x_to_emacs_keysym (XKeyPressedEvent *event, int simple_p, KeySym *x_keysym_out)
- /* simple_p means don't try too hard (ASCII only) */
+x_to_emacs_keysym (XKeyPressedEvent *event, KeySym *x_keysym_out)
{
KeySym keysym = NoSymbol;
@@ -1984,7 +1978,7 @@
XLookupString (event, dummy, 200, &keysym, 0);
*x_keysym_out = keysym;
return (IsModifierKey (keysym) || keysym == XK_Mode_switch )
- ? Qnil : x_keysym_to_emacs_keysym (keysym, simple_p);
+ ? Qnil : x_keysym_to_emacs_keysym (keysym);
}
#endif /* ! XIM_MOTIF */
@@ -2045,7 +2039,7 @@
case XLookupBoth:
*x_keysym_out = keysym;
return (IsModifierKey (keysym) || keysym == XK_Mode_switch )
- ? Qnil : x_keysym_to_emacs_keysym (keysym, simple_p);
+ ? Qnil : x_keysym_to_emacs_keysym (keysym);
case XLookupChars:
{
@@ -2229,7 +2223,7 @@
/* This used to compute the frame from the given X window and
store it here, but we really don't care about the frame. */
SET_EVENT_CHANNEL (emacs_event, DEVICE_CONSOLE (d));
- keysym = x_to_emacs_keysym (&x_event->xkey, 0, &x_keysym);
+ keysym = x_to_emacs_keysym (&x_event->xkey, &x_keysym);
/* If the emacs keysym is nil, then that means that the X
keysym was either a Modifier or NoSymbol, which
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fontify a CPP construct correctly when a comment
follows without spaces
7 years
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/d8e0dfbe0ba2/
Changeset: d8e0dfbe0ba2
User: acm
Date: 2017-12-19 18:47:58+00:00
Summary: Fontify a CPP construct correctly when a comment follows without spaces
Do this by removing a broken optimization in the state cache which put
category text properties on a character between the end of the CPP construct
and the beginning of the comment. This can't work when there's no such
character.
* cc-defs.el (c-cpp-delimiter, c-set-cpp-delimiters, c-clear-cpp-delimiters)
(c-comment-out-cpps, c-with-cpps-commented-out)
(c-with-all-but-one-cpps-commented-out): Remove.
* cc-engine.el (c-no-comment-end-of-macro): Return the comment start position
rather than one character before it.
(c-invalidate-state-cache, c-parse-state): Remove the invocations of
c-with-all-but-one-cpps-commented-out and c-with-cpps-commented-out.
* cc-mode.el (c-neutralize-syntax-in-and-mark-CPP): Rename to
c-neutralize-syntax-in-CPP and remove the bits which applied category
properties.
* cc-langs.el (c-before-font-lock-functions): Incorporate the new name of the
function c-neutralize-syntax-in-CPP.
Affected #: 4 files
diff -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 -r d8e0dfbe0ba20868860033443d02de5ddd248e33 cc-defs.el
--- a/cc-defs.el
+++ b/cc-defs.el
@@ -1416,59 +1416,6 @@
;;;;;;;;;;;;;;;
-(defconst c-cpp-delimiter '(14)) ; generic comment syntax
-;; This is the value of the `category' text property placed on every #
-;; which introduces a CPP construct and every EOL (or EOB, or character
-;; preceding //, etc.) which terminates it. We can instantly "comment
-;; out" all CPP constructs by giving `c-cpp-delimiter' a syntax-table
-;; property '(14) (generic comment delimiter).
-(defmacro c-set-cpp-delimiters (beg end)
- ;; This macro does a hidden buffer change.
- `(progn
- (c-put-char-property ,beg 'category 'c-cpp-delimiter)
- (if (< ,end (point-max))
- (c-put-char-property ,end 'category 'c-cpp-delimiter))))
-(defmacro c-clear-cpp-delimiters (beg end)
- ;; This macro does a hidden buffer change.
- `(progn
- (c-clear-char-property ,beg 'category)
- (if (< ,end (point-max))
- (c-clear-char-property ,end 'category))))
-
-(defsubst c-comment-out-cpps ()
- ;; Render all preprocessor constructs syntactically commented out.
- (put 'c-cpp-delimiter 'syntax-table c-cpp-delimiter))
-(defsubst c-uncomment-out-cpps ()
- ;; Restore the syntactic visibility of preprocessor constructs.
- (put 'c-cpp-delimiter 'syntax-table nil))
-
-(defmacro c-with-cpps-commented-out (&rest forms)
- ;; Execute FORMS... whilst the syntactic effect of all characters in
- ;; all CPP regions is suppressed. In particular, this is to suppress
- ;; the syntactic significance of parens/braces/brackets to functions
- ;; such as `scan-lists' and `parse-partial-sexp'.
- `(unwind-protect
- (c-save-buffer-state ()
- (c-comment-out-cpps)
- ,@forms)
- (c-save-buffer-state ()
- (c-uncomment-out-cpps))))
-
-(defmacro c-with-all-but-one-cpps-commented-out (beg end &rest forms)
- ;; Execute FORMS... whilst the syntactic effect of all characters in
- ;; every CPP region APART FROM THE ONE BETWEEN BEG and END is
- ;; suppressed.
- `(unwind-protect
- (c-save-buffer-state ()
- (save-restriction
- (widen)
- (c-clear-cpp-delimiters ,beg ,end))
- ,`(c-with-cpps-commented-out ,@forms))
- (c-save-buffer-state ()
- (save-restriction
- (widen)
- (c-set-cpp-delimiters ,beg ,end)))))
-
(defmacro c-self-bind-state-cache (&rest forms)
;; Bind the state cache to itself and execute the FORMS. Return the result
;; of the last FORM executed. It is assumed that no buffer changes will
diff -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 -r d8e0dfbe0ba20868860033443d02de5ddd248e33 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -243,8 +243,8 @@
;; `c-macro-cache'.
(defvar c-macro-cache-no-comment nil)
(make-variable-buffer-local 'c-macro-cache-no-comment)
-;; Either nil, or the last character of the macro currently represented by
-;; `c-macro-cache' which isn't in a comment. */
+;; Either nil, or the position of a comment which is open at the end of the
+;; macro represented by `c-macro-cache'.
(defun c-invalidate-macro-cache (beg end)
;; Called from a before-change function. If the change region is before or
@@ -387,8 +387,9 @@
(point)))
(defun c-no-comment-end-of-macro ()
- ;; Go to the end of a CPP directive, or a pos just before which isn't in a
- ;; comment. For this purpose, open strings are ignored.
+ ;; Go to the start of the comment which is open at the end of the current
+ ;; CPP directive, or to the end of that directive. For this purpose, open
+ ;; strings are ignored.
;;
;; This function must only be called from the beginning of a CPP construct.
;;
@@ -406,7 +407,7 @@
(setq s (parse-partial-sexp here there)))
(when (and (nth 4 s)
(not (eq (nth 7 s) 'syntax-table))) ; no pseudo comments.
- (goto-char (1- (nth 8 s))))
+ (goto-char (nth 8 s)))
(setq c-macro-cache-no-comment (point)))
(point)))
@@ -3864,14 +3865,7 @@
(if (memq 'category-properties c-emacs-features)
;; Emacs
(c-with-<->-as-parens-suppressed
- (if (and c-state-old-cpp-beg
- (< c-state-old-cpp-beg here))
- (c-with-all-but-one-cpps-commented-out
- c-state-old-cpp-beg
- c-state-old-cpp-end
- (c-invalidate-state-cache-1 here))
- (c-with-cpps-commented-out
- (c-invalidate-state-cache-1 here))))
+ (c-invalidate-state-cache-1 here))
;; XEmacs
(c-invalidate-state-cache-1 here)))
@@ -3905,12 +3899,7 @@
(if (memq 'category-properties c-emacs-features)
;; Emacs
(c-with-<->-as-parens-suppressed
- (if (and here-cpp-beg (> here-cpp-end here-cpp-beg))
- (c-with-all-but-one-cpps-commented-out
- here-cpp-beg here-cpp-end
- (c-parse-state-1))
- (c-with-cpps-commented-out
- (c-parse-state-1))))
+ (c-parse-state-1))
;; XEmacs
(c-parse-state-1))
(setq c-state-old-cpp-beg
diff -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 -r d8e0dfbe0ba20868860033443d02de5ddd248e33 cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -501,13 +501,13 @@
(c objc) '(c-depropertize-new-text
c-parse-quotes-after-change
c-extend-font-lock-region-for-macros
- c-neutralize-syntax-in-and-mark-CPP
+ c-neutralize-syntax-in-CPP
c-change-expand-fl-region)
c++ '(c-depropertize-new-text
c-parse-quotes-after-change
c-extend-font-lock-region-for-macros
c-after-change-re-mark-raw-strings
- c-neutralize-syntax-in-and-mark-CPP
+ c-neutralize-syntax-in-CPP
c-restore-<>-properties
c-change-expand-fl-region)
java '(c-depropertize-new-text
diff -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 -r d8e0dfbe0ba20868860033443d02de5ddd248e33 cc-mode.el
--- a/cc-mode.el
+++ b/cc-mode.el
@@ -1002,15 +1002,10 @@
t)
(t nil)))))))
-(defun c-neutralize-syntax-in-and-mark-CPP (begg endd old-len)
- ;; (i) "Neutralize" every preprocessor line wholly or partially in the
- ;; changed region. "Restore" lines which were CPP lines before the change
- ;; and are no longer so.
- ;;
- ;; (ii) Mark each CPP construct by placing a `category' property value
- ;; `c-cpp-delimiter' at its start and end. The marked characters are the
- ;; opening # and usually the terminating EOL, but sometimes the character
- ;; before a comment delimiter.
+(defun c-neutralize-syntax-in-CPP (begg endd old-len)
+ ;; "Neutralize" every preprocessor line wholly or partially in the changed
+ ;; region. "Restore" lines which were CPP lines before the change and are
+ ;; no longer so.
;;
;; That is, set syntax-table properties on characters that would otherwise
;; interact syntactically with those outside the CPP line(s).
@@ -1030,11 +1025,7 @@
(c-save-buffer-state (limits)
;; Clear 'syntax-table properties "punctuation":
;; (c-clear-char-property-with-value c-new-BEG c-new-END 'syntax-table '(1))
-
- ;; CPP "comment" markers:
- (if (memq 'category-properties c-emacs-features) ; GNU Emacs.
- (c-clear-char-property-with-value
- c-new-BEG c-new-END 'category 'c-cpp-delimiter))
+ ;; The above is now done in `c-depropertize-CPP'.
;; Add needed properties to each CPP construct in the region.
(goto-char c-new-BEG)
@@ -1061,10 +1052,7 @@
(goto-char (match-beginning 1))
(setq mbeg (point))
(if (> (c-no-comment-end-of-macro) mbeg)
- (progn
- (c-neutralize-CPP-line mbeg (point)) ; "punctuation" properties
- (if (memq 'category-properties c-emacs-features) ; GNU Emacs.
- (c-set-cpp-delimiters mbeg (point)))) ; "comment" markers
+ (c-neutralize-CPP-line mbeg (point)) ; "punctuation" properties
(forward-line)) ; no infinite loop with, e.g., "#//"
)))))
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fix loss of documentation face in certain CC
Mode doc comment situations
7 years
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/8cd5f9d0c1bd/
Changeset: 8cd5f9d0c1bd
User: acm
Date: 2017-12-19 17:57:25+00:00
Summary: Fix loss of documentation face in certain CC Mode doc comment situations
* cc-fonts.el (c-font-lock-doc-comments): Take into account the possibility of
font-lock-comment-delimiter-face. Test rigorously for "/**" (etc.) being
itself inside a literal, rather than just depending on the face of the
previous character.
Affected #: 1 file
diff -r 125218d347ca602b4f09318fb79c8ca6fb895fc9 -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 cc-fonts.el
--- a/cc-fonts.el
+++ b/cc-fonts.el
@@ -2666,8 +2666,8 @@
;; This function might do hidden buffer changes.
(let (comment-beg region-beg)
- (if (eq (get-text-property (point) 'face)
- 'font-lock-comment-face)
+ (if (memq (get-text-property (point) 'face)
+ '(font-lock-comment-face font-lock-comment-delimiter-face))
;; Handle the case when the fontified region starts inside a
;; comment.
(let ((start (c-literal-start)))
@@ -2687,8 +2687,15 @@
(or (not (c-got-face-at comment-beg
c-literal-faces))
(and (/= comment-beg (point-min))
+ ;; Cheap check which is unreliable (the previous
+ ;; character could be the end of a previous
+ ;; comment).
(c-got-face-at (1- comment-beg)
- c-literal-faces))))
+ c-literal-faces)
+ ;; Expensive reliable check.
+ (save-excursion
+ (goto-char comment-beg)
+ (c-in-literal)))))
(setq comment-beg nil))
(setq region-beg comment-beg))
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: 271 new changesets
7 years
Bitbucket
271 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/ffd8a687dc8e/
Changeset: ffd8a687dc8e
User: jsparkes
Date: 2010-04-19 10:17:18+00:00
Summary: Use pkg-config instead of gnome-config for gtk 2.0.
Affected #: 1 file
diff -r 77907bd57d25f39769b0d7d3726d94fc61b3372f -r ffd8a687dc8eaa79c4cf069b4cb84512b24f12a8 configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -2832,11 +2832,11 @@
if test "$with_gnome" != "no"; then
AC_MSG_CHECKING(for GNOME configuration script)
- for possible in gnome-config
+ for possible in libgnome-2.0
do
- possible_version=`${possible} --version 2> /dev/null`
- if test "x${possible_version}" != "x"; then
- GNOME_CONFIG="${possible}"
+ pkg-config --exists $possible
+ if test $?; then
+ GNOME_CONFIG="pkg-config"
with_gnome=yes
with_gtk=yes
break
@@ -2846,8 +2846,8 @@
fi
if test "${GNOME_CONFIG}" != "no"; then
- GNOME_LIBS=`${GNOME_CONFIG} --libs gnomeui`
- GNOME_CFLAGS=`${GNOME_CONFIG} --cflags gnomeui`
+ GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0`
+ GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0`
AC_DEFINE(HAVE_GNOME)
XE_APPEND(${GNOME_LIBS}, libs_gtk)
XE_APPEND(${GNOME_CFLAGS}, c_switch_gtk)
@@ -2855,11 +2855,11 @@
if test "$with_gtk" != "no";then
AC_MSG_CHECKING(for GTK configuration script)
- for possible in gtk12-config gtk14-config gtk-config
+ for possible in gtk+-2.0
do
- possible_version=`${possible} --version 2> /dev/null`
+ possible_version=`$GNOME_CONFIG {possible} --version 2> /dev/null`
if test "x${possible_version}" != "x"; then
- GTK_CONFIG="${possible}"
+ GTK_CONFIG="$GNOME_CONFIG ${possible}"
case "${possible_version}" in
1.0.*) AC_MSG_WARN([GTK 1.2 is required, please upgrade your version of GTK.]); with_gtk=no;;
1.3.*) AC_MSG_WARN([GTK 1.3 is not supported right now]); with_gtk=no;;
@@ -2867,6 +2867,10 @@
with_gtk=yes
break
;;
+ 0.22*)
+ with_gtk=yes
+ break
+ ;;
*) AC_MSG_WARN([Found unsupported version of GTK: $possible_version]);;
esac
fi
https://bitbucket.org/xemacs/xemacs/commits/70364a3b1951/
Changeset: 70364a3b1951
User: jsparkes
Date: 2010-04-21 12:23:03+00:00
Summary: Include gutter.h for macros.
Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
Affected #: 5 files
diff -r ffd8a687dc8eaa79c4cf069b4cb84512b24f12a8 -r 70364a3b1951db474cd3580a1619c6bb2a9cdcad configure
--- a/configure
+++ b/configure
@@ -11907,11 +11907,11 @@
if test "$with_gnome" != "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNOME configuration script" >&5
$as_echo_n "checking for GNOME configuration script... " >&6; }
- for possible in gnome-config
+ for possible in libgnome-2.0
do
- possible_version=`${possible} --version 2> /dev/null`
- if test "x${possible_version}" != "x"; then
- GNOME_CONFIG="${possible}"
+ pkg-config --exists $possible
+ if test $?; then
+ GNOME_CONFIG="pkg-config"
with_gnome=yes
with_gtk=yes
break
@@ -11922,8 +11922,8 @@
fi
if test "${GNOME_CONFIG}" != "no"; then
- GNOME_LIBS=`${GNOME_CONFIG} --libs gnomeui`
- GNOME_CFLAGS=`${GNOME_CONFIG} --cflags gnomeui`
+ GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0`
+ GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0`
$as_echo "#define HAVE_GNOME 1" >>confdefs.h
libs_gtk="$libs_gtk ${GNOME_LIBS}" && if test "$verbose" = "yes"; then echo " Appending \"${GNOME_LIBS}\" to \$libs_gtk"; fi
@@ -11933,11 +11933,11 @@
if test "$with_gtk" != "no";then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK configuration script" >&5
$as_echo_n "checking for GTK configuration script... " >&6; }
- for possible in gtk12-config gtk14-config gtk-config
+ for possible in gtk+-2.0
do
- possible_version=`${possible} --version 2> /dev/null`
+ possible_version=`$GNOME_CONFIG {possible} --version 2> /dev/null`
if test "x${possible_version}" != "x"; then
- GTK_CONFIG="${possible}"
+ GTK_CONFIG="$GNOME_CONFIG ${possible}"
case "${possible_version}" in
1.0.*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GTK 1.2 is required, please upgrade your version of GTK." >&5
$as_echo "$as_me: WARNING: GTK 1.2 is required, please upgrade your version of GTK." >&2;}; with_gtk=no;;
@@ -11947,6 +11947,10 @@
with_gtk=yes
break
;;
+ 0.22*)
+ with_gtk=yes
+ break
+ ;;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found unsupported version of GTK: $possible_version" >&5
$as_echo "$as_me: WARNING: Found unsupported version of GTK: $possible_version" >&2;};;
esac
diff -r ffd8a687dc8eaa79c4cf069b4cb84512b24f12a8 -r 70364a3b1951db474cd3580a1619c6bb2a9cdcad src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * frame-gtk.c (gtk_initialize_frame_size):
+ Use gtk geometry functions.
+ Include gutter.h for frame size calculations.
+
2010-04-06 Ben Wing <ben(a)xemacs.org>
* elhash.c (Feq_hash):
diff -r ffd8a687dc8eaa79c4cf069b4cb84512b24f12a8 -r 70364a3b1951db474cd3580a1619c6bb2a9cdcad src/console-gtk-impl.h
--- a/src/console-gtk-impl.h
+++ b/src/console-gtk-impl.h
@@ -41,9 +41,12 @@
#include "console-gtk.h"
#include <X11/Xlib.h>
-#define GDK_DRAWABLE(x) (GdkDrawable *) (x)
+#ifndef GDK_DRAWABLE
+//#define GDK_DRAWABLE(x) (GdkDrawable *) (x)
+#endif
#define GET_GTK_WIDGET_WINDOW(x) (GTK_WIDGET (x)->window)
#define GET_GTK_WIDGET_PARENT(x) (GTK_WIDGET (x)->parent)
+#define GCHAR(x) ((gchar *)x)
DECLARE_CONSOLE_TYPE (gtk);
diff -r ffd8a687dc8eaa79c4cf069b4cb84512b24f12a8 -r 70364a3b1951db474cd3580a1619c6bb2a9cdcad src/event-gtk.c
--- a/src/event-gtk.c
+++ b/src/event-gtk.c
@@ -107,6 +107,8 @@
#define THIS_IS_GTK
#include "event-xlike-inc.c"
+Time x_focus_timestamp_really_sucks_fix_me_better;
+
/************************************************************************/
/* magic-event handling */
@@ -123,6 +125,7 @@
select-frame stuff until after the sit-for.
*/
+ x_focus_timestamp_really_sucks_fix_me_better = time(0);
if (in_p)
{
GTK_WIDGET_SET_FLAGS (FRAME_GTK_TEXT_WIDGET (f), GTK_HAS_FOCUS);
diff -r ffd8a687dc8eaa79c4cf069b4cb84512b24f12a8 -r 70364a3b1951db474cd3580a1619c6bb2a9cdcad src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -33,6 +33,7 @@
#include "extents.h"
#include "faces.h"
#include "frame-impl.h"
+#include "gutter.h"
#include "window.h"
#ifdef HAVE_DRAGNDROP
@@ -515,7 +516,6 @@
extern Lisp_Object Vgtk_initial_geometry;
-#ifndef HAVE_GNOME
static int
get_number (const char **geometry)
{
@@ -533,9 +533,6 @@
return value * mult;
}
-/*
- */
-
/**
* gnome_parse_geometry
* @geometry: geometry string to be parsed
@@ -611,11 +608,15 @@
*ypos = subtract - *ypos;
return TRUE;
}
-#endif
+/* Note: use gtk_window_set_geometry_hints -- jsparkes(a)gmail.com */
static void
gtk_initialize_frame_size (struct frame *f)
{
+ GdkGeometry hint;
+ GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f);
+
+ /* Gtk also wants min and max width and height */
gint x = 10, y = 10, w = 80, h = 30;
if (STRINGP (Vgtk_initial_geometry))
@@ -627,22 +628,28 @@
h = 30;
}
}
-
+
+ hint.base_height = h;
+ hint.base_width = w;
+ gtk_window_set_geometry_hints (GTK_WINDOW (shell), shell, &hint, GDK_HINT_BASE_SIZE);
+ /* This may not work until the widget is realized. */
+ gtk_window_parse_geometry (GTK_WINDOW (shell), (gchar *) XSTRING_DATA (Vgtk_initial_geometry));
+
/* set the position of the frame's root window now. When the
frame was created, the position was initialized to (0,0). */
{
struct window *win = XWINDOW (f->root_window);
-
+
WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f);
WINDOW_TOP (win) = FRAME_PANED_TOP_EDGE (f);
-
+
if (!NILP (f->minibuffer_window))
{
win = XWINDOW (f->minibuffer_window);
WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f);
}
}
-
+
gtk_set_initial_frame_size (f, x, y, w, h);
}
@@ -898,8 +905,8 @@
gtk_signal_connect (GTK_OBJECT (shell), "delete-event", GTK_SIGNAL_FUNC (delete_event_cb), f);
{
- static char *events_to_frob[] = { "focus-in-event",
- "focus-out-event",
+ static char *events_to_frob[] = { (char *)"focus-in-event",
+ (char *)"focus-out-event",
"enter-notify-event",
"leave-notify-event",
"map-event",
https://bitbucket.org/xemacs/xemacs/commits/64e0ee68cf0c/
Changeset: 64e0ee68cf0c
User: jsparkes
Date: 2010-04-21 12:25:27+00:00
Summary: Add ChangeLog entry for removing ifndef HAVE_GNOME.
Affected #: 1 file
diff -r 70364a3b1951db474cd3580a1619c6bb2a9cdcad -r 64e0ee68cf0c7281791f2a69a871c581c6b85a96 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,7 @@
2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
* frame-gtk.c (gtk_initialize_frame_size):
+ Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
Use gtk geometry functions.
Include gutter.h for frame size calculations.
https://bitbucket.org/xemacs/xemacs/commits/a151b2edaa7d/
Changeset: a151b2edaa7d
User: jsparkes
Date: 2010-04-21 13:50:45+00:00
Summary: Change arg to const to avoid C++ warning.
Affected #: 1 file
diff -r 64e0ee68cf0c7281791f2a69a871c581c6b85a96 -r a151b2edaa7d12ecc7aac58a62b0176f92dc55fb src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -29,12 +29,12 @@
#include "fontcolor-gtk-impl.h"
static GtkType
-xemacs_type_register (gchar *name, GtkType parent)
+xemacs_type_register (const gchar *name, GtkType parent)
{
GtkType type_id;
GtkTypeInfo info;
- info.type_name = name;
+ info.type_name = (gchar *) name;
info.object_size = 0;
info.class_size = 0;
info.class_init_func = NULL;
https://bitbucket.org/xemacs/xemacs/commits/92a244cbfc35/
Changeset: 92a244cbfc35
User: jsparkes
Date: 2010-04-21 13:51:22+00:00
Summary: Cast to avoid C++ const warning.
Affected #: 1 file
diff -r a151b2edaa7d12ecc7aac58a62b0176f92dc55fb -r 92a244cbfc353ee36ba03eca2152fcf4b6cd8a79 src/gtk-xemacs.c
--- a/src/gtk-xemacs.c
+++ b/src/gtk-xemacs.c
@@ -62,7 +62,7 @@
{
static const GtkTypeInfo xemacs_info =
{
- "GtkXEmacs",
+ (gchar *) "GtkXEmacs",
sizeof (GtkXEmacs),
sizeof (GtkXEmacsClass),
(GtkClassInitFunc) gtk_xemacs_class_init,
https://bitbucket.org/xemacs/xemacs/commits/5e9001d96776/
Changeset: 5e9001d96776
User: jsparkes
Date: 2010-04-21 15:51:50+00:00
Summary: Forget to save src/ChangeLog before last commit.
Remove equalp arg from gtk_color_instance_hash to match other frames.
Affected #: 2 files
diff -r 92a244cbfc353ee36ba03eca2152fcf4b6cd8a79 -r 5e9001d96776495bf620f9896472ba2154ad4e15 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,14 @@
2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
+ * fontcolor-gtk.c (gtk_color_instance_hash):
+ Remove gtk_color_instance_hash equalp argument.
+
+ * gtk-glue.c (xemacs_type_register):
+ Change arg to const to avoid C++ warning.
+
+ * gtk-xemacs.c (gtk_xemacs_get_type):
+ Cast to avoid C++ const warning.
+
* frame-gtk.c (gtk_initialize_frame_size):
Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
Use gtk geometry functions.
diff -r 92a244cbfc353ee36ba03eca2152fcf4b6cd8a79 -r 5e9001d96776495bf620f9896472ba2154ad4e15 src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -188,10 +188,9 @@
}
static Hashcode
-gtk_color_instance_hash (struct Lisp_Color_Instance *c, int UNUSED (depth),
- Boolint UNUSED (equalp))
+gtk_color_instance_hash (struct Lisp_Color_Instance *c, int UNUSED (depth))
{
- return (gdk_color_hash (COLOR_INSTANCE_GTK_COLOR (c), NULL));
+ return (gdk_color_hash (COLOR_INSTANCE_GTK_COLOR (c)));
}
static Lisp_Object
https://bitbucket.org/xemacs/xemacs/commits/a85303fe8b83/
Changeset: a85303fe8b83
User: jsparkes
Date: 2010-04-21 18:02:17+00:00
Summary: Comment out gtk_widget_draw_focus for now.
Affected #: 1 file
diff -r 5e9001d96776495bf620f9896472ba2154ad4e15 -r a85303fe8b831ea813bb8c205214974a38d925d9 src/event-gtk.c
--- a/src/event-gtk.c
+++ b/src/event-gtk.c
@@ -135,7 +135,8 @@
GTK_WIDGET_UNSET_FLAGS (FRAME_GTK_TEXT_WIDGET (f), GTK_HAS_FOCUS);
}
gtk_widget_grab_focus (FRAME_GTK_TEXT_WIDGET (f));
- gtk_widget_draw_focus (FRAME_GTK_TEXT_WIDGET (f));
+ // Note: what is this replaced with?
+ // gtk_widget_draw_focus (FRAME_GTK_TEXT_WIDGET (f));
{
Lisp_Object frm;
https://bitbucket.org/xemacs/xemacs/commits/a496be29672f/
Changeset: a496be29672f
User: jsparkes
Date: 2010-04-22 16:45:52+00:00
Summary: Fix for NEW_GC.
Affected #: 1 file
diff -r a85303fe8b831ea813bb8c205214974a38d925d9 -r a496be29672f2aa8858f46e7d588ad031dd3c90d src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -354,7 +354,9 @@
static void
free_gtk_device_struct (struct device *d)
{
+ //xfree (DEVICE_GTK_DATA (d));
xfree (d->device_data);
+ d->device_data = 0;
}
#endif /* not NEW_GC */
@@ -384,7 +386,9 @@
#endif
}
+#ifndef NEW_GC
free_gtk_device_struct (d);
+#endif
}
https://bitbucket.org/xemacs/xemacs/commits/10705b67686b/
Changeset: 10705b67686b
User: jsparkes
Date: 2010-04-22 20:02:01+00:00
Summary: Slider width is now in GtkStyle instance, not class.
Affected #: 2 files
diff -r a496be29672f2aa8858f46e7d588ad031dd3c90d -r 10705b67686b3767c5515a609f8335e85af42497 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
+ Slider width is now in GtkStyle instance, not class.
+
+ * device-gtk.c (gtk_delete_device):
+ NEW_GC doesn't allow/require freeing device directly.
+
2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
* fontcolor-gtk.c (gtk_color_instance_hash):
@@ -9,7 +17,7 @@
* gtk-xemacs.c (gtk_xemacs_get_type):
Cast to avoid C++ const warning.
- * frame-gtk.c (gtk_initialize_frame_size):
+ * frame-gtk.c (gtk_initialize_frame_size):
Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
Use gtk geometry functions.
Include gutter.h for frame size calculations.
diff -r a496be29672f2aa8858f46e7d588ad031dd3c90d -r 10705b67686b3767c5515a609f8335e85af42497 src/gtk-xemacs.c
--- a/src/gtk-xemacs.c
+++ b/src/gtk-xemacs.c
@@ -204,14 +204,12 @@
Lisp_Object frame;
int slider_size = 0;
int hsize, vsize;
- GtkRangeClass *klass;
frame = wrap_frame (f);
- klass = (GtkRangeClass *) gtk_type_class (GTK_TYPE_SCROLLBAR);
- slider_size = klass->slider_width;
- hsize = slider_size + (style->klass->ythickness * 2);
- vsize = slider_size + (style->klass->xthickness * 2);
+ slider_size = style->slider_width;
+ hsize = slider_size + (style->ythickness * 2);
+ vsize = slider_size + (style->xthickness * 2);
style = gtk_style_attach (style,
GTK_WIDGET (DEVICE_GTK_APP_SHELL (XDEVICE (FRAME_DEVICE (f))))->window);
@@ -228,12 +226,12 @@
smash_toolbar_specifiers(struct frame *f, GtkStyle *style)
{
Lisp_Object frame;
- GtkStyleClass *klass = (GtkStyleClass *) style->klass;
frame = wrap_frame (f);
- Fadd_spec_to_specifier (Vtoolbar_shadow_thickness, make_int (klass->xthickness),
- Qnil, list2 (Qgtk, Qdefault), Qprepend);
+ Fadd_spec_to_specifier (Vtoolbar_shadow_thickness,
+ make_int (style->xthickness), Qnil,
+ list2 (Qgtk, Qdefault), Qprepend);
}
#endif /* HAVE_TOOLBARS */
https://bitbucket.org/xemacs/xemacs/commits/73114081bdf3/
Changeset: 73114081bdf3
User: jsparkes
Date: 2010-04-23 03:15:54+00:00
Summary: Add WORD_BIGENDIAN check back, it's used in gtk code.
Affected #: 1 file
diff -r ffd8a687dc8eaa79c4cf069b4cb84512b24f12a8 -r 73114081bdf303fb4b7707f7459dbce0505c6a27 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * config.h.in:
+ Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
+
2010-04-06 Ben Wing <ben(a)xemacs.org>
* elhash.c (Feq_hash):
@@ -6,7 +11,7 @@
* elhash.c (internal_hash):
* elhash.c (Feql_hash):
Fix spacing before parens.
-
+
* general-slots.h:
* xemacs.def.in.in:
Export Qfixnump to fix eldap.c link error.
https://bitbucket.org/xemacs/xemacs/commits/8c9ad209607e/
Changeset: 8c9ad209607e
User: jsparkes
Date: 2010-04-23 03:19:38+00:00
Summary: Ignore config.cache.
Affected #: 1 file
diff -r 73114081bdf303fb4b7707f7459dbce0505c6a27 -r 8c9ad209607ebaefad2b0c61b2f7ffaa6784ef9c .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -14,7 +14,7 @@
^Makefile$
^Makefile\.in$
^autom4te\.cache
-^config\.(log|status)$
+^config\.(log|status|cache)$
^lib-src/DOC$
^lib-src/(GNUmakefile|Makefile(\.in)?)$
^lib-src/config\.values$
https://bitbucket.org/xemacs/xemacs/commits/88576df0f4f8/
Changeset: 88576df0f4f8
User: jsparkes
Date: 2010-04-23 03:21:07+00:00
Summary: Kludge for x focus timestamp.
Affected #: 1 file
diff -r 8c9ad209607ebaefad2b0c61b2f7ffaa6784ef9c -r 88576df0f4f81021e09fd02ca96b9f3cb78e0795 src/event-gtk.c
--- a/src/event-gtk.c
+++ b/src/event-gtk.c
@@ -107,6 +107,8 @@
#define THIS_IS_GTK
#include "event-xlike-inc.c"
+Time x_focus_timestamp_really_sucks_fix_me_better;
+
/************************************************************************/
/* magic-event handling */
@@ -122,6 +124,7 @@
box cursor for redisplay, but we don't call any hooks or do any
select-frame stuff until after the sit-for.
*/
+ x_focus_timestamp_really_sucks_fix_me_better = time(0);
if (in_p)
{
https://bitbucket.org/xemacs/xemacs/commits/6f40af031e99/
Changeset: 6f40af031e99
User: jsparkes
Date: 2010-04-23 03:32:22+00:00
Summary: Enable local geometry parsing for now.
Declare array const gchar* to avoid C++ warning.
Affected #: 2 files
diff -r 7378c4af3f845179a210603d3aeae8bdce32d74a -r 6f40af031e99748962fdf70518774b51f71335ee src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
+ * frame-gtk.c (gtk_create_widgets):
+ Declare array const to avoid C++ warning.
+ (get_number, gnome_parse_geometry):
+ Re-enable local geometry parsing temporarily.
+
+ * config.h.in:
+ Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
* gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
Slider width is now in GtkStyle instance, not class.
diff -r 7378c4af3f845179a210603d3aeae8bdce32d74a -r 6f40af031e99748962fdf70518774b51f71335ee src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -32,8 +32,8 @@
#include "events.h"
#include "extents.h"
#include "faces.h"
+#include "gutter.h"
#include "frame-impl.h"
-#include "gutter.h"
#include "window.h"
#ifdef HAVE_DRAGNDROP
@@ -533,6 +533,9 @@
return value * mult;
}
+/*
+ */
+
/**
* gnome_parse_geometry
* @geometry: geometry string to be parsed
@@ -609,14 +612,9 @@
return TRUE;
}
-/* Note: use gtk_window_set_geometry_hints -- jsparkes(a)gmail.com */
static void
gtk_initialize_frame_size (struct frame *f)
{
- GdkGeometry hint;
- GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f);
-
- /* Gtk also wants min and max width and height */
gint x = 10, y = 10, w = 80, h = 30;
if (STRINGP (Vgtk_initial_geometry))
@@ -628,28 +626,22 @@
h = 30;
}
}
-
- hint.base_height = h;
- hint.base_width = w;
- gtk_window_set_geometry_hints (GTK_WINDOW (shell), shell, &hint, GDK_HINT_BASE_SIZE);
- /* This may not work until the widget is realized. */
- gtk_window_parse_geometry (GTK_WINDOW (shell), (gchar *) XSTRING_DATA (Vgtk_initial_geometry));
-
+
/* set the position of the frame's root window now. When the
frame was created, the position was initialized to (0,0). */
{
struct window *win = XWINDOW (f->root_window);
-
+
WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f);
WINDOW_TOP (win) = FRAME_PANED_TOP_EDGE (f);
-
+
if (!NILP (f->minibuffer_window))
{
win = XWINDOW (f->minibuffer_window);
WINDOW_LEFT (win) = FRAME_PANED_LEFT_EDGE (f);
}
}
-
+
gtk_set_initial_frame_size (f, x, y, w, h);
}
@@ -905,8 +897,8 @@
gtk_signal_connect (GTK_OBJECT (shell), "delete-event", GTK_SIGNAL_FUNC (delete_event_cb), f);
{
- static char *events_to_frob[] = { (char *)"focus-in-event",
- (char *)"focus-out-event",
+ static const gchar *events_to_frob[] = { "focus-in-event",
+ "focus-out-event",
"enter-notify-event",
"leave-notify-event",
"map-event",
https://bitbucket.org/xemacs/xemacs/commits/e9d78556acf8/
Changeset: e9d78556acf8
User: jsparkes
Date: 2010-04-23 03:34:00+00:00
Summary: Fix GET_XLIKE_DISPLAY for gtk.
Affected #: 2 files
diff -r 6f40af031e99748962fdf70518774b51f71335ee -r e9d78556acf8fa21a5e53307532390db9c2ff935 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
+ * console-xlike-inc.h:
+ Fix GET_XLIKE_DISPLAY for gtk.
+
* frame-gtk.c (gtk_create_widgets):
Declare array const to avoid C++ warning.
(get_number, gnome_parse_geometry):
@@ -7,6 +10,7 @@
* config.h.in:
Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
+
* gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
Slider width is now in GtkStyle instance, not class.
diff -r 6f40af031e99748962fdf70518774b51f71335ee -r e9d78556acf8fa21a5e53307532390db9c2ff935 src/console-xlike-inc.h
--- a/src/console-xlike-inc.h
+++ b/src/console-xlike-inc.h
@@ -274,7 +274,8 @@
/* functions */
/* Avoid unused-variable warning involving D */
-#define GET_XLIKE_DISPLAY(d) (USED (d), NULL)
+//#define GET_XLIKE_DISPLAY(d) (USED (d), NULL)
+#define GET_XLIKE_DISPLAY(d) (d)
#define GET_XLIKE_X_DISPLAY(d) (USED (d), GDK_DISPLAY ())
#define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w))
#define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
https://bitbucket.org/xemacs/xemacs/commits/ff3019d30529/
Changeset: ff3019d30529
User: jsparkes
Date: 2010-04-23 03:44:04+00:00
Summary: Implement X focus timestamp kludge.
Update hash function to match usage in fontcolor-x.c.
Affected #: 3 files
diff -r e9d78556acf8fa21a5e53307532390db9c2ff935 -r ff3019d3052945ccb628296f53ecfb3279be8be5 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
+ * fontcolor-gtk.c (gtk_color_instance_hash):
+ Update hash function to match usage in fontcolor-x.c
+
+ * event-gtk.c (handle_focus_event_1):
+ Extend X focus timestamp klduge to Gtk.
+
* console-xlike-inc.h:
Fix GET_XLIKE_DISPLAY for gtk.
diff -r e9d78556acf8fa21a5e53307532390db9c2ff935 -r ff3019d3052945ccb628296f53ecfb3279be8be5 src/event-gtk.c
--- a/src/event-gtk.c
+++ b/src/event-gtk.c
@@ -124,8 +124,8 @@
box cursor for redisplay, but we don't call any hooks or do any
select-frame stuff until after the sit-for.
*/
+ x_focus_timestamp_really_sucks_fix_me_better = time(0);
- x_focus_timestamp_really_sucks_fix_me_better = time(0);
if (in_p)
{
GTK_WIDGET_SET_FLAGS (FRAME_GTK_TEXT_WIDGET (f), GTK_HAS_FOCUS);
diff -r e9d78556acf8fa21a5e53307532390db9c2ff935 -r ff3019d3052945ccb628296f53ecfb3279be8be5 src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -190,7 +190,7 @@
static Hashcode
gtk_color_instance_hash (struct Lisp_Color_Instance *c, int UNUSED (depth))
{
- return (gdk_color_hash (COLOR_INSTANCE_GTK_COLOR (c)));
+ return (gdk_color_hash (COLOR_INSTANCE_GTK_COLOR (c)));
}
static Lisp_Object
https://bitbucket.org/xemacs/xemacs/commits/c306a1e8ee18/
Changeset: c306a1e8ee18
User: jsparkes
Date: 2010-04-23 03:46:10+00:00
Summary: Cast GtkShadowStyle to edge_style for C++ compile.
Implement using GDK, not XLib.
Affected #: 2 files
diff -r ff3019d3052945ccb628296f53ecfb3279be8be5 -r c306a1e8ee188a01e732026388d8f89e949e817a src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,12 @@
2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-gtk.c (XLIKE_bevel_area):
+ Cast GtkShadowStyle to edge_style for C++ compile.
+ (our_draw_bitmap):
+ Implement using GDK, not XLib.
+
* fontcolor-gtk.c (gtk_color_instance_hash):
- Update hash function to match usage in fontcolor-x.c
+ Update hash function to match usage in fontcolor-x.c.
* event-gtk.c (handle_focus_event_1):
Extend X focus timestamp klduge to Gtk.
diff -r ff3019d3052945ccb628296f53ecfb3279be8be5 -r c306a1e8ee188a01e732026388d8f89e949e817a src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -46,11 +46,11 @@
else
switch (style)
{
- case EDGE_BEVEL_IN: style = GTK_SHADOW_IN; break;
- case EDGE_BEVEL_OUT: style = GTK_SHADOW_OUT; break;
- case EDGE_ETCHED_IN: style = GTK_SHADOW_ETCHED_IN; break;
- case EDGE_ETCHED_OUT: style = GTK_SHADOW_ETCHED_OUT; break;
- default: ABORT (); style = GTK_SHADOW_OUT;
+ case EDGE_BEVEL_IN: style = (edge_style)GTK_SHADOW_IN; break;
+ case EDGE_BEVEL_OUT: style = (edge_style)GTK_SHADOW_OUT; break;
+ case EDGE_ETCHED_IN: style = (edge_style)GTK_SHADOW_ETCHED_IN; break;
+ case EDGE_ETCHED_OUT: style = (edge_style)GTK_SHADOW_ETCHED_OUT; break;
+ default: ABORT (); style = (edge_style)GTK_SHADOW_OUT;
}
/* Do we want to have some magic constants to set
@@ -79,7 +79,7 @@
/* This makes me feel incredibly dirty... but there is no other way to
get this done right other than calling clear_area before every
single $#!%@ing piece of text, which I do NOT want to do. */
-#define USE_X_SPECIFIC_DRAW_ROUTINES 1
+#define USE_X_SPECIFIC_DRAW_ROUTINES 0
#include "sysgdkx.h"
@@ -151,30 +151,19 @@
gint width,
gint height)
{
- GdkWindowPrivate *drawable_private;
- GdkWindowPrivate *src_private;
- GdkGCPrivate *gc_private;
-
g_return_if_fail (drawable != NULL);
g_return_if_fail (src != NULL);
g_return_if_fail (gc != NULL);
- drawable_private = (GdkWindowPrivate*) drawable;
- src_private = (GdkWindowPrivate*) src;
- if (drawable_private->destroyed || src_private->destroyed)
- return;
- gc_private = (GdkGCPrivate*) gc;
+ gint src_width, src_height;
+
+ gdk_drawable_get_size (src, &src_width, &src_height);
+
if (width == -1)
- width = src_private->width;
+ width = src_width;
if (height == -1)
- height = src_private->height;
+ height = src_height;
- XCopyPlane (drawable_private->xdisplay,
- src_private->xwindow,
- drawable_private->xwindow,
- gc_private->xgc,
- xsrc, ysrc,
- width, height,
- xdest, ydest, 1L);
+ gdk_draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height);
}
https://bitbucket.org/xemacs/xemacs/commits/3a61b6bfd70b/
Changeset: 3a61b6bfd70b
User: jsparkes
Date: 2010-04-24 00:13:16+00:00
Summary: Use G_BIG_ENDIAN instead of WORDS_BIGENDIAN.
Affected #: 2 files
diff -r c306a1e8ee188a01e732026388d8f89e949e817a -r 3a61b6bfd70ba5b008d3eaa2ea11c0e34431813b src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * glyphs-gtk.c (convert_EImage_to_GDKImage):
+ (convert_EImage_to_GDKImage):
+ Use G_BIG_ENDIAN instead of WORDS_BIGENDIAN.
+
2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (XLIKE_bevel_area):
diff -r c306a1e8ee188a01e732026388d8f89e949e817a -r 3a61b6bfd70ba5b008d3eaa2ea11c0e34431813b src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -255,7 +255,7 @@
gr = *ip++;
bl = *ip++;
conv.val = pixarray[QUANT_GET_COLOR(qtable,rd,gr,bl)];
-#if WORDS_BIGENDIAN
+#ifdef G_BIG_ENDIAN
if (outimg->byte_order == GDK_MSB_FIRST)
for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
else
@@ -330,7 +330,7 @@
bl = *ip++ >> (8 - bbits);
conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift);
-#if WORDS_BIGENDIAN
+#ifdef G_BIG_ENDIAN
if (outimg->byte_order == GDK_MSB_FIRST)
for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
else
https://bitbucket.org/xemacs/xemacs/commits/e21761df3a5f/
Changeset: e21761df3a5f
User: jsparkes
Date: 2010-04-24 00:36:52+00:00
Summary: Use GINT_TO_POINTER and GPOINTER_TO_INT for encoding user data.
Affected #: 4 files
diff -r 3a61b6bfd70ba5b008d3eaa2ea11c0e34431813b -r e21761df3a5fabaa10a9d38f6fdff1caec85488b src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,14 @@
2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
+ * glyphs-gtk.c (gtk_add_tab_item):
+ Use GINT_TO_POINTER.
+
+ * frame-gtk.c (gtk_init_frame_1):
+ Use GINT_TO_POINTER.
+
+ * event-gtk.c (emacs_gtk_add_timeout):
+ Use GPOINTER_TO_INT.
+
* glyphs-gtk.c (convert_EImage_to_GDKImage):
(convert_EImage_to_GDKImage):
Use G_BIG_ENDIAN instead of WORDS_BIGENDIAN.
diff -r 3a61b6bfd70ba5b008d3eaa2ea11c0e34431813b -r e21761df3a5fabaa10a9d38f6fdff1caec85488b src/event-gtk.c
--- a/src/event-gtk.c
+++ b/src/event-gtk.c
@@ -565,7 +565,7 @@
milliseconds = 1;
timeout->timeout_id = gtk_timeout_add (milliseconds,
gtk_timeout_callback,
- (gpointer) timeout);
+ GINT_TO_POINTER(timeout));
return timeout->id;
}
diff -r 3a61b6bfd70ba5b008d3eaa2ea11c0e34431813b -r e21761df3a5fabaa10a9d38f6fdff1caec85488b src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -1043,7 +1043,7 @@
if (!NILP (initially_unmapped))
{
gtk_object_set_data (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f)),
- UNMAPPED_DATA_IDENTIFIER, (gpointer) 1);
+ UNMAPPED_DATA_IDENTIFIER, GINT_TO_POINTER (1));
}
}
diff -r 3a61b6bfd70ba5b008d3eaa2ea11c0e34431813b -r e21761df3a5fabaa10a9d38f6fdff1caec85488b src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -2503,7 +2503,7 @@
Lisp_Object domain, int UNUSED (i))
{
Lisp_Object name;
- int hash_id = 0;
+ gint hash_id = 0;
char *c_name = NULL;
GtkWidget* box;
@@ -2542,7 +2542,7 @@
function.
*/
gtk_object_set_data(GTK_OBJECT(box), GTK_DATA_TAB_HASHCODE_IDENTIFIER,
- (gpointer) hash_id);
+ GINT_TO_POINTER (hash_id));
gtk_notebook_append_page (nb, box, gtk_label_new (c_name));
}
https://bitbucket.org/xemacs/xemacs/commits/0dda2485bbe7/
Changeset: 0dda2485bbe7
User: jsparkes
Date: 2010-04-23 12:07:29+00:00
Summary: Merge work from other side.
Affected #: 5 files
diff -r c306a1e8ee188a01e732026388d8f89e949e817a -r 0dda2485bbe7ac362da5b11fd39b4e15037c0f79 src/console-xlike-inc.h
--- a/src/console-xlike-inc.h
+++ b/src/console-xlike-inc.h
@@ -274,8 +274,7 @@
/* functions */
/* Avoid unused-variable warning involving D */
-//#define GET_XLIKE_DISPLAY(d) (USED (d), NULL)
-#define GET_XLIKE_DISPLAY(d) (d)
+#define GET_XLIKE_DISPLAY(d) (USED (d))
#define GET_XLIKE_X_DISPLAY(d) (USED (d), GDK_DISPLAY ())
#define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w))
#define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
diff -r c306a1e8ee188a01e732026388d8f89e949e817a -r 0dda2485bbe7ac362da5b11fd39b4e15037c0f79 src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -16,31 +16,37 @@
the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
Boston, MA 02111-1301, USA. */
-GtkType GTK_TYPE_ARRAY = 0;
-GtkType GTK_TYPE_STRING_ARRAY = 0;
-GtkType GTK_TYPE_FLOAT_ARRAY = 0;
-GtkType GTK_TYPE_INT_ARRAY = 0;
-GtkType GTK_TYPE_LISTOF = 0;
-GtkType GTK_TYPE_STRING_LIST = 0;
-GtkType GTK_TYPE_OBJECT_LIST = 0;
-GtkType GTK_TYPE_GDK_GC = 0;
+GType GTK_TYPE_ARRAY = 0;
+GType GTK_TYPE_STRING_ARRAY = 0;
+GType GTK_TYPE_FLOAT_ARRAY = 0;
+GType GTK_TYPE_INT_ARRAY = 0;
+GType GTK_TYPE_LISTOF = 0;
+GType GTK_TYPE_STRING_LIST = 0;
+GType GTK_TYPE_OBJECT_LIST = 0;
+GType GTK_TYPE_GDK_GC = 0;
#include "console-gtk.h"
#include "fontcolor-gtk-impl.h"
-static GtkType
-xemacs_type_register (const gchar *name, GtkType parent)
+static GType
+xemacs_type_register (const gchar *name, GType parent)
{
- GtkType type_id;
- GtkTypeInfo info;
+ GType type_id;
+ GTypeInfo info;
+
+ info.class_size = 0; //?
+ info.base_init = NULL;
+ into.base_finalize = NULL;
- info.type_name = (gchar *) name;
+ info.class_init = NULL;
+ info.class_finalize = NULL;
+ info.class_data = 0;
+
+ info.instance_size = 0;
+ info.n_preallocs = 0;
info.object_size = 0;
- info.class_size = 0;
- info.class_init_func = NULL;
- info.object_init_func = NULL;
- info.reserved_1 = NULL;
- info.reserved_2 = NULL;
+ info.instanace_init = 0;
+ info.value_table = 0;
type_id = gtk_type_unique (parent, &info);
@@ -64,7 +70,7 @@
}
static void
-xemacs_list_to_gtklist (Lisp_Object obj, GtkArg *arg)
+xemacs_list_to_gtklist (Lisp_Object obj, GType *arg)
{
CHECK_LIST (obj);
@@ -133,7 +139,7 @@
}
static Lisp_Object
-xemacs_gtklist_to_list (GtkArg *arg)
+xemacs_gtklist_to_list (GType *arg)
{
Lisp_Object rval = Qnil;
@@ -156,7 +162,7 @@
}
static void
-xemacs_list_to_array (Lisp_Object obj, GtkArg *arg)
+xemacs_list_to_array (Lisp_Object obj, GType *arg)
{
CHECK_LIST (obj);
diff -r c306a1e8ee188a01e732026388d8f89e949e817a -r 0dda2485bbe7ac362da5b11fd39b4e15037c0f79 src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -95,7 +95,7 @@
if (!xemacs_menubar_type)
{
- static const GtkTypeInfo xemacs_menubar_info =
+ static const GTypeInfo xemacs_menubar_info =
{
"GtkXEmacsMenubar",
sizeof (GtkXEmacsMenubar),
@@ -189,21 +189,22 @@
GtkAccelLabelClass parent_class;
};
-static GtkType gtk_xemacs_accel_label_get_type(void);
+static GType gtk_xemacs_accel_label_get_type(void);
static GtkWidget* gtk_xemacs_accel_label_new(const gchar *string);
static void gtk_xemacs_set_accel_keys(GtkXEmacsAccelLabel* l,
Lisp_Object keys);
static void gtk_xemacs_accel_label_class_init(GtkXEmacsAccelLabelClass *klass);
static void gtk_xemacs_accel_label_init(GtkXEmacsAccelLabel *xemacs);
-static GtkType
+static GType
gtk_xemacs_accel_label_get_type(void)
{
- static GtkType xemacs_accel_label_type = 0;
+ static
+GType xemacs_accel_label_type = 0;
if (!xemacs_accel_label_type)
{
- static const GtkTypeInfo xemacs_accel_label_info =
+ static const GTypeInfo xemacs_accel_label_info =
{
"GtkXEmacsAccelLabel",
sizeof (GtkXEmacsAccelLabel),
diff -r c306a1e8ee188a01e732026388d8f89e949e817a -r 0dda2485bbe7ac362da5b11fd39b4e15037c0f79 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -282,8 +282,8 @@
scrolls around in the XEmacs frame manually. So we
update the slider manually here.
*/
- if (!modified_p)
- gtk_range_slider_update (GTK_RANGE (wid));
+ if (!modified_p)
+ gtk_range_set_adjustment (GTK_RANGE (wid), adj);
instance->scrollbar_instance_changed = 0;
}
diff -r c306a1e8ee188a01e732026388d8f89e949e817a -r 0dda2485bbe7ac362da5b11fd39b4e15037c0f79 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -54,16 +54,16 @@
static GHashTable *dll_cache;
-Lisp_Object gtk_type_to_lisp (GtkArg *arg);
-int lisp_to_gtk_type (Lisp_Object obj, GtkArg *arg);
-int lisp_to_gtk_ret_type (Lisp_Object obj, GtkArg *arg);
+Lisp_Object gtk_type_to_lisp (GType *arg);
+int lisp_to_gtk_type (Lisp_Object obj, GType *arg);
+int lisp_to_gtk_ret_type (Lisp_Object obj, GType *arg);
#if 0
-void describe_gtk_arg (GtkArg *arg);
+void describe_gtk_arg (GType *arg);
#endif
guint symbol_to_enum (Lisp_Object obj, GtkType t);
-static guint lisp_to_flag (Lisp_Object obj, GtkType t);
-static Lisp_Object flags_to_list (guint value, GtkType t);
-static Lisp_Object enum_to_symbol (guint value, GtkType t);
+static guint lisp_to_flag (Lisp_Object obj, GType t);
+static Lisp_Object flags_to_list (guint value, GType t);
+static Lisp_Object enum_to_symbol (guint value, GType t);
#define NIL_OR_VOID_P(x) (NILP (x) || EQ (x, Qvoid))
@@ -123,7 +123,7 @@
static struct hash_table *internal_type_hash;
static int
-type_already_imported_p (GtkType t)
+type_already_imported_p (GType t)
{
void *retval = NULL;
@@ -164,7 +164,7 @@
}
static void
-mark_type_as_imported (GtkType t)
+mark_type_as_imported (GType t)
{
if (type_already_imported_p (t))
return;
@@ -172,12 +172,12 @@
puthash ((void *) t, (void *) 1, internal_type_hash);
}
-static void import_gtk_type (GtkType t);
+static void import_gtk_type (GType t);
static void
-import_gtk_object_internal (GtkType the_type)
+import_gtk_object_internal (GType the_type)
{
- GtkType original_type = the_type;
+ GType original_type = the_type;
int first_time = 1;
do
@@ -245,7 +245,7 @@
}
static void
-import_gtk_enumeration_internal (GtkType the_type)
+import_gtk_enumeration_internal (GType the_type)
{
GtkEnumValue *vals = gtk_type_enum_get_values (the_type);
Lisp_Object assoc = Qnil;
@@ -268,7 +268,7 @@
}
static void
-import_gtk_type (GtkType t)
+import_gtk_type (GType t)
{
if (type_already_imported_p (t))
{
@@ -388,7 +388,7 @@
if (freep) xfree (v); \
} while (0)
-static gpointer __allocate_object_storage (GtkType t)
+static gpointer __allocate_object_storage (GType t)
{
size_t s = 0;
void *rval = NULL;
@@ -458,7 +458,7 @@
return (rval);
}
-static Lisp_Object type_to_marshaller_type (GtkType t)
+static Lisp_Object type_to_marshaller_type (GType t)
{
switch (GTK_FUNDAMENTAL_TYPE (t))
{
@@ -618,7 +618,7 @@
EXTERNAL_LIST_LOOP_2 (elt, value)
{
- GtkType the_type;
+ GType the_type;
Lisp_Object marshaller_type = Qnil;
CHECK_SYMBOL (elt);
@@ -899,7 +899,7 @@
if (lisp_to_gtk_type (value, &args[0]))
{
- gui_error ("Error converting to GtkType", value);
+ gui_error ("Error converting to GType", value);
}
if (!(info->arg_flags & GTK_ARG_WRITABLE))
@@ -1158,7 +1158,7 @@
return (data);
}
-Lisp_Object build_gtk_boxed (void *obj, GtkType t)
+Lisp_Object build_gtk_boxed (void *obj, GType t)
{
Lisp_Object retval = Qnil;
emacs_gtk_boxed_data *data = NULL;
@@ -1193,7 +1193,7 @@
*/
(type))
{
- GtkType t;
+ GType t;
if (SYMBOLP (type))
type = Fsymbol_name (type);
@@ -1210,7 +1210,7 @@
}
DEFUN ("gtk-object-type", Fgtk_object_type, 1, 1, 0, /*
-Return the GtkType of OBJECT.
+Return the GType of OBJECT.
*/
(object))
{
@@ -1226,7 +1226,7 @@
(type))
{
Lisp_Object rval, signals, props;
- GtkType t;
+ GType t;
props = signals = rval = Qnil;
@@ -1460,38 +1460,39 @@
}
#endif
-Lisp_Object gtk_type_to_lisp (GtkArg *arg)
+Lisp_Object gtk_type_to_lisp (GType
+ *arg)
{
- switch (GTK_FUNDAMENTAL_TYPE (arg->type))
+ switch (GTK_FUNDAMENTAL_TYPE (G_TYPE_FROM_CLASS (arg)))
{
- case GTK_TYPE_NONE:
+ case G_TYPE_NONE:
return (Qnil);
- case GTK_TYPE_CHAR:
+ case G_TYPE_CHAR:
return (make_char (GTK_VALUE_CHAR (*arg)));
- case GTK_TYPE_UCHAR:
+ case G_TYPE_UCHAR:
return (make_char (GTK_VALUE_UCHAR (*arg)));
- case GTK_TYPE_BOOL:
+ case G_TYPE_BOOLEAN:
return (GTK_VALUE_BOOL (*arg) ? Qt : Qnil);
- case GTK_TYPE_INT:
+ case G_TYPE_INT:
return (make_int (GTK_VALUE_INT (*arg)));
- case GTK_TYPE_UINT:
+ case G_TYPE_UINT:
return (make_int (GTK_VALUE_INT (*arg)));
- case GTK_TYPE_LONG: /* I think these are wrong! */
+ case G_TYPE_LONG: /* I think these are wrong! */
return (make_int (GTK_VALUE_INT (*arg)));
- case GTK_TYPE_ULONG: /* I think these are wrong! */
+ case G_TYPE_ULONG: /* I think these are wrong! */
return (make_int (GTK_VALUE_INT (*arg)));
- case GTK_TYPE_FLOAT:
+ case G_TYPE_FLOAT:
return (make_float (GTK_VALUE_FLOAT (*arg)));
- case GTK_TYPE_DOUBLE:
+ case G_TYPE_DOUBLE:
return (make_float (GTK_VALUE_DOUBLE (*arg)));
- case GTK_TYPE_STRING:
+ case G_TYPE_STRING:
return (build_cistring (GTK_VALUE_STRING (*arg)));
- case GTK_TYPE_FLAGS:
+ case G_TYPE_FLAGS:
return (flags_to_list (GTK_VALUE_FLAGS (*arg), arg->type));
- case GTK_TYPE_ENUM:
+ case G_TYPE_ENUM:
return (enum_to_symbol (GTK_VALUE_ENUM (*arg), arg->type));
- case GTK_TYPE_BOXED:
- if (arg->type == GTK_TYPE_GDK_EVENT)
+ case G_TYPE_BOXED:
+ if (arg->type == G_TYPE_GDK_EVENT)
{
return (gdk_event_to_emacs_event((GdkEvent *) GTK_VALUE_BOXED (*arg)));
}
@@ -1500,7 +1501,7 @@
return (build_gtk_boxed (GTK_VALUE_BOXED (*arg), arg->type));
else
return (Qnil);
- case GTK_TYPE_POINTER:
+ case G_TYPE_POINTER:
if (GTK_VALUE_POINTER (*arg))
{
Lisp_Object rval;
@@ -1510,13 +1511,13 @@
}
else
return (Qnil);
- case GTK_TYPE_OBJECT:
+ case G_TYPE_OBJECT:
if (GTK_VALUE_OBJECT (*arg))
return (build_gtk_object (GTK_VALUE_OBJECT (*arg)));
else
return (Qnil);
- case GTK_TYPE_CALLBACK:
+ case G_TYPE_CALLBACK:
{
Lisp_Object rval;
@@ -1526,7 +1527,7 @@
}
default:
- if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, GTK_TYPE_LISTOF))
+ if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, G_TYPE_LISTOF))
{
if (!GTK_VALUE_POINTER (*arg))
return (Qnil);
@@ -1547,9 +1548,9 @@
switch (GTK_FUNDAMENTAL_TYPE (arg->type))
{
/* flag types */
- case GTK_TYPE_NONE:
+ case G_TYPE_NONE:
return (0);
- case GTK_TYPE_CHAR:
+ case G_TYPE_CHAR:
{
Ichar c;
@@ -1558,7 +1559,7 @@
GTK_VALUE_CHAR (*arg) = c;
}
break;
- case GTK_TYPE_UCHAR:
+ case G_TYPE_UCHAR:
{
Ichar c;
@@ -1567,11 +1568,11 @@
GTK_VALUE_CHAR (*arg) = c;
}
break;
- case GTK_TYPE_BOOL:
+ case G_TYPE_BOOLEAN:
GTK_VALUE_BOOL (*arg) = NILP (obj) ? FALSE : TRUE;
break;
- case GTK_TYPE_INT:
- case GTK_TYPE_UINT:
+ case G_TYPE_INT:
+ case G_TYPE_UINT:
if (NILP (obj) || EQ (Qt, obj))
{
/* For we are a kind mistress and allow sending t/nil for
@@ -1587,18 +1588,18 @@
GTK_VALUE_INT(*arg) = XINT (obj);
}
break;
- case GTK_TYPE_LONG:
- case GTK_TYPE_ULONG:
+ case G_TYPE_LONG:
+ case G_TYPE_ULONG:
ABORT();
- case GTK_TYPE_FLOAT:
+ case G_TYPE_FLOAT:
CHECK_INT_OR_FLOAT (obj);
GTK_VALUE_FLOAT(*arg) = extract_float (obj);
break;
- case GTK_TYPE_DOUBLE:
+ case G_TYPE_DOUBLE:
CHECK_INT_OR_FLOAT (obj);
GTK_VALUE_DOUBLE(*arg) = extract_float (obj);
break;
- case GTK_TYPE_STRING:
+ case G_TYPE_STRING:
if (NILP (obj))
GTK_VALUE_STRING (*arg) = NULL;
else
@@ -1607,12 +1608,12 @@
GTK_VALUE_STRING (*arg) = (char *) XSTRING_DATA (obj);
}
break;
- case GTK_TYPE_ENUM:
- case GTK_TYPE_FLAGS:
+ case G_TYPE_ENUM:
+ case G_TYPE_FLAGS:
/* Convert a lisp symbol to a GTK enum */
GTK_VALUE_ENUM(*arg) = lisp_to_flag (obj, arg->type);
break;
- case GTK_TYPE_BOXED:
+ case G_TYPE_BOXED:
if (NILP (obj))
{
GTK_VALUE_BOXED(*arg) = NULL;
@@ -1621,19 +1622,19 @@
{
GTK_VALUE_BOXED(*arg) = XGTK_BOXED (obj)->object;
}
- else if (arg->type == GTK_TYPE_STYLE)
+ else if (arg->type == G_TYPE_STYLE)
{
obj = Ffind_face (obj);
CHECK_FACE (obj);
GTK_VALUE_BOXED(*arg) = face_to_style (obj);
}
- else if (arg->type == GTK_TYPE_GDK_GC)
+ else if (arg->type == G_TYPE_GDK_GC)
{
obj = Ffind_face (obj);
CHECK_FACE (obj);
GTK_VALUE_BOXED(*arg) = face_to_gc (obj);
}
- else if (arg->type == GTK_TYPE_GDK_WINDOW)
+ else if (arg->type == G_TYPE_GDK_WINDOW)
{
if (GLYPHP (obj))
{
@@ -1667,7 +1668,7 @@
}
break;
}
- else if (arg->type == GTK_TYPE_GDK_COLOR)
+ else if (arg->type == G_TYPE_GDK_COLOR)
{
if (COLOR_SPECIFIERP (obj))
{
@@ -1691,7 +1692,7 @@
invalid_argument ("Don't know how to convert to GdkColor", obj);
}
}
- else if (arg->type == GTK_TYPE_GDK_FONT)
+ else if (arg->type == G_TYPE_GDK_FONT)
{
if (SYMBOLP (obj))
{
@@ -1737,7 +1738,7 @@
}
break;
- case GTK_TYPE_POINTER:
+ case G_TYPE_POINTER:
if (NILP (obj))
GTK_VALUE_POINTER(*arg) = NULL;
else
@@ -1745,17 +1746,17 @@
break;
/* structured types */
- case GTK_TYPE_SIGNAL:
- case GTK_TYPE_ARGS: /* This we can do as a list of values */
- case GTK_TYPE_C_CALLBACK:
- case GTK_TYPE_FOREIGN:
+ case G_TYPE_SIGNAL:
+ case G_TYPE_ARGS: /* This we can do as a list of values */
+ case G_TYPE_C_CALLBACK:
+ case G_TYPE_FOREIGN:
stderr_out ("Do not know how to convert `%s' from lisp!\n", gtk_type_name (arg->type));
return (-1);
#if 0
/* #### BILL! */
/* This is not used, and does not work with union type */
- case GTK_TYPE_CALLBACK:
+ case G_TYPE_CALLBACK:
{
GUI_ID id;
@@ -1773,7 +1774,7 @@
#endif
/* base type of the object system */
- case GTK_TYPE_OBJECT:
+ case G_TYPE_OBJECT:
if (NILP (obj))
GTK_VALUE_OBJECT (*arg) = NULL;
else
@@ -1827,9 +1828,9 @@
switch (GTK_FUNDAMENTAL_TYPE (arg->type))
{
/* flag types */
- case GTK_TYPE_NONE:
+ case G_TYPE_NONE:
return (0);
- case GTK_TYPE_CHAR:
+ case G_TYPE_CHAR:
{
Ichar c;
@@ -1838,7 +1839,7 @@
*(GTK_RETLOC_CHAR (*arg)) = c;
}
break;
- case GTK_TYPE_UCHAR:
+ case G_TYPE_UCHAR:
{
Ichar c;
@@ -1847,11 +1848,11 @@
*(GTK_RETLOC_CHAR (*arg)) = c;
}
break;
- case GTK_TYPE_BOOL:
+ case G_TYPE_BOOLEAN:
*(GTK_RETLOC_BOOL (*arg)) = NILP (obj) ? FALSE : TRUE;
break;
- case GTK_TYPE_INT:
- case GTK_TYPE_UINT:
+ case G_TYPE_INT:
+ case G_TYPE_UINT:
if (NILP (obj) || EQ (Qt, obj))
{
/* For we are a kind mistress and allow sending t/nil for
@@ -1867,18 +1868,18 @@
*(GTK_RETLOC_INT(*arg)) = XINT (obj);
}
break;
- case GTK_TYPE_LONG:
- case GTK_TYPE_ULONG:
+ case G_TYPE_LONG:
+ case G_TYPE_ULONG:
ABORT();
- case GTK_TYPE_FLOAT:
+ case G_TYPE_FLOAT:
CHECK_INT_OR_FLOAT (obj);
*(GTK_RETLOC_FLOAT(*arg)) = extract_float (obj);
break;
- case GTK_TYPE_DOUBLE:
+ case G_TYPE_DOUBLE:
CHECK_INT_OR_FLOAT (obj);
*(GTK_RETLOC_DOUBLE(*arg)) = extract_float (obj);
break;
- case GTK_TYPE_STRING:
+ case G_TYPE_STRING:
if (NILP (obj))
*(GTK_RETLOC_STRING (*arg)) = NULL;
else
@@ -1887,12 +1888,12 @@
*(GTK_RETLOC_STRING (*arg)) = (char *) XSTRING_DATA (obj);
}
break;
- case GTK_TYPE_ENUM:
- case GTK_TYPE_FLAGS:
+ case G_TYPE_ENUM:
+ case G_TYPE_FLAGS:
/* Convert a lisp symbol to a GTK enum */
*(GTK_RETLOC_ENUM(*arg)) = lisp_to_flag (obj, arg->type);
break;
- case GTK_TYPE_BOXED:
+ case G_TYPE_BOXED:
if (NILP (obj))
{
*(GTK_RETLOC_BOXED(*arg)) = NULL;
@@ -1901,19 +1902,19 @@
{
*(GTK_RETLOC_BOXED(*arg)) = XGTK_BOXED (obj)->object;
}
- else if (arg->type == GTK_TYPE_STYLE)
+ else if (arg->type == G_TYPE_STYLE)
{
obj = Ffind_face (obj);
CHECK_FACE (obj);
*(GTK_RETLOC_BOXED(*arg)) = face_to_style (obj);
}
- else if (arg->type == GTK_TYPE_GDK_GC)
+ else if (arg->type == G_TYPE_GDK_GC)
{
obj = Ffind_face (obj);
CHECK_FACE (obj);
*(GTK_RETLOC_BOXED(*arg)) = face_to_gc (obj);
}
- else if (arg->type == GTK_TYPE_GDK_WINDOW)
+ else if (arg->type == G_TYPE_GDK_WINDOW)
{
if (GLYPHP (obj))
{
@@ -1947,7 +1948,7 @@
}
break;
}
- else if (arg->type == GTK_TYPE_GDK_COLOR)
+ else if (arg->type == G_TYPE_GDK_COLOR)
{
if (COLOR_SPECIFIERP (obj))
{
@@ -1971,7 +1972,7 @@
invalid_argument ("Don't know how to convert to GdkColor", obj);
}
}
- else if (arg->type == GTK_TYPE_GDK_FONT)
+ else if (arg->type == G_TYPE_GDK_FONT)
{
if (SYMBOLP (obj))
{
@@ -2017,7 +2018,7 @@
}
break;
- case GTK_TYPE_POINTER:
+ case G_TYPE_POINTER:
if (NILP (obj))
*(GTK_RETLOC_POINTER(*arg)) = NULL;
else
@@ -2025,17 +2026,17 @@
break;
/* structured types */
- case GTK_TYPE_SIGNAL:
- case GTK_TYPE_ARGS: /* This we can do as a list of values */
- case GTK_TYPE_C_CALLBACK:
- case GTK_TYPE_FOREIGN:
+ case G_TYPE_SIGNAL:
+ case G_TYPE_ARGS: /* This we can do as a list of values */
+ case G_TYPE_C_CALLBACK:
+ case G_TYPE_FOREIGN:
stderr_out ("Do not know how to convert `%s' from lisp!\n", gtk_type_name (arg->type));
return (-1);
#if 0
/* #### BILL! */
/* This is not used, and does not work with union type */
- case GTK_TYPE_CALLBACK:
+ case G_TYPE_CALLBACK:
{
GUI_ID id;
@@ -2053,7 +2054,7 @@
#endif
/* base type of the object system */
- case GTK_TYPE_OBJECT:
+ case G_TYPE_OBJECT:
if (NILP (obj))
*(GTK_RETLOC_OBJECT (*arg)) = NULL;
else
@@ -2067,7 +2068,7 @@
break;
default:
- if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, GTK_TYPE_ARRAY))
+ if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, G_TYPE_ARRAY))
{
if (NILP (obj))
*(GTK_RETLOC_POINTER(*arg)) = NULL;
@@ -2076,7 +2077,7 @@
xemacs_list_to_array (obj, arg);
}
}
- else if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, GTK_TYPE_LISTOF))
+ else if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, G_TYPE_LISTOF))
{
if (NILP (obj))
*(GTK_RETLOC_POINTER(*arg)) = NULL;
@@ -2098,7 +2099,7 @@
/* This is used in glyphs-gtk.c as well */
static Lisp_Object
-get_enumeration (GtkType t)
+get_enumeration (GType t)
{
Lisp_Object alist;
@@ -2118,7 +2119,7 @@
}
guint
-symbol_to_enum (Lisp_Object obj, GtkType t)
+symbol_to_enum (Lisp_Object obj, GType t)
{
Lisp_Object alist = get_enumeration (t);
Lisp_Object value = Qnil;
@@ -2141,7 +2142,7 @@
}
static guint
-lisp_to_flag (Lisp_Object obj, GtkType t)
+lisp_to_flag (Lisp_Object obj, GType t)
{
guint val = 0;
@@ -2169,7 +2170,7 @@
}
static Lisp_Object
-flags_to_list (guint value, GtkType t)
+flags_to_list (guint value, GType t)
{
Lisp_Object rval = Qnil;
Lisp_Object alist = get_enumeration (t);
@@ -2187,7 +2188,7 @@
}
static Lisp_Object
-enum_to_symbol (guint value, GtkType t)
+enum_to_symbol (guint value, GType t)
{
Lisp_Object alist = get_enumeration (t);
Lisp_Object cell = Qnil;
https://bitbucket.org/xemacs/xemacs/commits/a13192122fc8/
Changeset: a13192122fc8
User: jsparkes
Date: 2010-04-23 12:38:21+00:00
Summary: gtk_xemacs_draw() may no longer be required.
Use fixed slider width until I figure out proper way to get the value.
Affected #: 2 files
diff -r 0dda2485bbe7ac362da5b11fd39b4e15037c0f79 -r a13192122fc820b38082ee1a7e01bb7375ebb858 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * gtk-xemacs.c (gtk_xemacs_class_init):
+ Don't use gtk_xemacs_draw.
+ (smash_scrollbar_specifiers):
+ Use fixed slider width for now.
+
2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (XLIKE_bevel_area):
diff -r 0dda2485bbe7ac362da5b11fd39b4e15037c0f79 -r a13192122fc820b38082ee1a7e01bb7375ebb858 src/gtk-xemacs.c
--- a/src/gtk-xemacs.c
+++ b/src/gtk-xemacs.c
@@ -90,7 +90,7 @@
widget_class->size_allocate = gtk_xemacs_size_allocate;
widget_class->size_request = gtk_xemacs_size_request;
- widget_class->draw = gtk_xemacs_draw;
+ //widget_class->draw = gtk_xemacs_draw;
widget_class->expose_event = gtk_xemacs_expose;
widget_class->realize = gtk_xemacs_realize;
widget_class->button_press_event = emacs_gtk_button_event_handler;
@@ -207,7 +207,9 @@
frame = wrap_frame (f);
- slider_size = style->slider_width;
+ // Note: where do I get this? -- jsparkes
+ //slider_size = style->slider_width;
+ slider_size = 4;
hsize = slider_size + (style->ythickness * 2);
vsize = slider_size + (style->xthickness * 2);
https://bitbucket.org/xemacs/xemacs/commits/5825ed9d8278/
Changeset: 5825ed9d8278
User: jsparkes
Date: 2010-04-26 11:06:11+00:00
Summary: Merge my remote changes.
Affected #: 3 files
diff -r a13192122fc820b38082ee1a7e01bb7375ebb858 -r 5825ed9d82786a198c4fc9c5c9b5f9fa849a0d4d src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -484,7 +484,7 @@
static Hashcode
gtk_image_instance_hash (struct Lisp_Image_Instance *p, int UNUSED (depth),
- Boolint UNUSED (equalp))
+ Boolint UNUSED (equalp))
{
switch (IMAGE_INSTANCE_TYPE (p))
{
diff -r a13192122fc820b38082ee1a7e01bb7375ebb858 -r 5825ed9d82786a198c4fc9c5c9b5f9fa849a0d4d src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -36,7 +36,7 @@
info.class_size = 0; //?
info.base_init = NULL;
- into.base_finalize = NULL;
+ info.base_finalize = NULL;
info.class_init = NULL;
info.class_finalize = NULL;
@@ -44,11 +44,10 @@
info.instance_size = 0;
info.n_preallocs = 0;
- info.object_size = 0;
- info.instanace_init = 0;
+ info.instance_init = 0;
info.value_table = 0;
- type_id = gtk_type_unique (parent, &info);
+ type_id = g_type_register_static (parent, name, &info, NULL);
return (type_id);
}
@@ -73,8 +72,9 @@
xemacs_list_to_gtklist (Lisp_Object obj, GType *arg)
{
CHECK_LIST (obj);
+
- if (arg->type == GTK_TYPE_STRING_LIST)
+ if (*arg == GTK_TYPE_STRING_LIST)
{
Lisp_Object temp = obj;
GList *strings = NULL;
@@ -93,9 +93,9 @@
temp = XCDR (temp);
}
- GTK_VALUE_POINTER (*arg) = strings;
+ G_TYPE_POINTER (*arg) = strings;
}
- else if (arg->type == GTK_TYPE_OBJECT_LIST)
+ else if (*arg == GTK_TYPE_OBJECT_LIST)
{
Lisp_Object temp = obj;
GList *objects = NULL;
@@ -143,9 +143,9 @@
{
Lisp_Object rval = Qnil;
- if (GTK_VALUE_POINTER (*arg))
+ if (G_TYPE_IS_ABSTRACT (*arg))
{
- if (arg->type == GTK_TYPE_STRING_LIST)
+ if (*arg == GTK_TYPE_STRING_LIST)
{
g_list_foreach ((GList*) GTK_VALUE_POINTER (*arg), __make_string_mapper, &rval);
}
@@ -192,15 +192,15 @@
GTK_VALUE_POINTER (*arg) = array; \
} while (0);
- if (arg->type == GTK_TYPE_STRING_ARRAY)
+ if (*arg == GTK_TYPE_STRING_ARRAY)
{
FROB (gchar *, CHECK_STRING, (gchar*) XSTRING_DATA);
}
- else if (arg->type == GTK_TYPE_FLOAT_ARRAY)
+ else if (*arg == GTK_TYPE_FLOAT_ARRAY)
{
FROB (gfloat, CHECK_FLOAT, extract_float);
}
- else if (arg->type == GTK_TYPE_INT_ARRAY)
+ else if (*arg == GTK_TYPE_INT_ARRAY)
{
FROB (gint, CHECK_INT, XINT);
}
diff -r a13192122fc820b38082ee1a7e01bb7375ebb858 -r 5825ed9d82786a198c4fc9c5c9b5f9fa849a0d4d src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -142,11 +142,11 @@
case GTK_TYPE_STRING:
case GTK_TYPE_BOXED:
case GTK_TYPE_POINTER:
- case GTK_TYPE_SIGNAL:
- case GTK_TYPE_ARGS:
- case GTK_TYPE_CALLBACK:
- case GTK_TYPE_C_CALLBACK:
- case GTK_TYPE_FOREIGN:
+ //case GTK_TYPE_SIGNAL:
+ //case GTK_TYPE_ARGS:
+ //case GTK_TYPE_CALLBACK:
+ //case GTK_TYPE_C_CALLBACK:
+ //case GTK_TYPE_FOREIGN:
return (1);
}
@@ -1460,15 +1460,15 @@
}
#endif
-Lisp_Object gtk_type_to_lisp (GType
- *arg)
+Lisp_Object gtk_type_to_lisp (GValue *arg)
{
- switch (GTK_FUNDAMENTAL_TYPE (G_TYPE_FROM_CLASS (arg)))
+ // G_TYPE_IS_VALUE_TYPE
+ switch (G_VALUE_TYPE (G_TYPE_FROM_CLASS (arg)))
{
case G_TYPE_NONE:
return (Qnil);
case G_TYPE_CHAR:
- return (make_char (GTK_VALUE_CHAR (*arg)));
+ return (make_char (g_value_get_char (*arg)));
case G_TYPE_UCHAR:
return (make_char (GTK_VALUE_UCHAR (*arg)));
case G_TYPE_BOOLEAN:
@@ -1481,16 +1481,20 @@
return (make_int (GTK_VALUE_INT (*arg)));
case G_TYPE_ULONG: /* I think these are wrong! */
return (make_int (GTK_VALUE_INT (*arg)));
+ case G_TYPE_INT64: /* bignum? */
+ return (make_int (GTK_VALUE_INT (*arg)));
+ case G_TYPE_UINT64: /* bignum? */
+ return (make_int (GTK_VALUE_INT (*arg)));
+ case G_TYPE_ENUM:
+ return (enum_to_symbol (GTK_VALUE_ENUM (*arg), arg->type));
+ case G_TYPE_FLAGS:
+ return (flags_to_list (GTK_VALUE_FLAGS (*arg), arg->type));
case G_TYPE_FLOAT:
return (make_float (GTK_VALUE_FLOAT (*arg)));
case G_TYPE_DOUBLE:
return (make_float (GTK_VALUE_DOUBLE (*arg)));
case G_TYPE_STRING:
return (build_cistring (GTK_VALUE_STRING (*arg)));
- case G_TYPE_FLAGS:
- return (flags_to_list (GTK_VALUE_FLAGS (*arg), arg->type));
- case G_TYPE_ENUM:
- return (enum_to_symbol (GTK_VALUE_ENUM (*arg), arg->type));
case G_TYPE_BOXED:
if (arg->type == G_TYPE_GDK_EVENT)
{
@@ -1516,6 +1520,9 @@
return (build_gtk_object (GTK_VALUE_OBJECT (*arg)));
else
return (Qnil);
+ //case G_TYPE_PARAM:
+ //case G_TYPE_GTYPE
+
case G_TYPE_CALLBACK:
{
https://bitbucket.org/xemacs/xemacs/commits/3542ff512957/
Changeset: 3542ff512957
User: jsparkes
Date: 2010-04-26 11:12:25+00:00
Summary: Put my changes into ChangeLog.GTK.
Affected #: 2 files
diff -r 5825ed9d82786a198c4fc9c5c9b5f9fa849a0d4d -r 3542ff512957c674abb61ca94d102ea8184b13cd src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,56 +1,3 @@
-2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * gtk-xemacs.c (gtk_xemacs_class_init):
- Don't use gtk_xemacs_draw.
- (smash_scrollbar_specifiers):
- Use fixed slider width for now.
-
-2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * redisplay-gtk.c (XLIKE_bevel_area):
- Cast GtkShadowStyle to edge_style for C++ compile.
- (our_draw_bitmap):
- Implement using GDK, not XLib.
-
- * fontcolor-gtk.c (gtk_color_instance_hash):
- Update hash function to match usage in fontcolor-x.c.
-
- * event-gtk.c (handle_focus_event_1):
- Extend X focus timestamp klduge to Gtk.
-
- * console-xlike-inc.h:
- Fix GET_XLIKE_DISPLAY for gtk.
-
- * frame-gtk.c (gtk_create_widgets):
- Declare array const to avoid C++ warning.
- (get_number, gnome_parse_geometry):
- Re-enable local geometry parsing temporarily.
-
- * config.h.in:
- Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
-
- * gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
- Slider width is now in GtkStyle instance, not class.
-
- * device-gtk.c (gtk_delete_device):
- NEW_GC doesn't allow/require freeing device directly.
-
-2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * fontcolor-gtk.c (gtk_color_instance_hash):
- Remove gtk_color_instance_hash equalp argument.
-
- * gtk-glue.c (xemacs_type_register):
- Change arg to const to avoid C++ warning.
-
- * gtk-xemacs.c (gtk_xemacs_get_type):
- Cast to avoid C++ const warning.
-
- * frame-gtk.c (gtk_initialize_frame_size):
- Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
- Use gtk geometry functions.
- Include gutter.h for frame size calculations.
-
2010-04-06 Ben Wing <ben(a)xemacs.org>
* elhash.c (Feq_hash):
diff -r 5825ed9d82786a198c4fc9c5c9b5f9fa849a0d4d -r 3542ff512957c674abb61ca94d102ea8184b13cd src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,56 @@
+2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * gtk-xemacs.c (gtk_xemacs_class_init):
+ Don't use gtk_xemacs_draw.
+ (smash_scrollbar_specifiers):
+ Use fixed slider width for now.
+
+2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (XLIKE_bevel_area):
+ Cast GtkShadowStyle to edge_style for C++ compile.
+ (our_draw_bitmap):
+ Implement using GDK, not XLib.
+
+ * fontcolor-gtk.c (gtk_color_instance_hash):
+ Update hash function to match usage in fontcolor-x.c.
+
+ * event-gtk.c (handle_focus_event_1):
+ Extend X focus timestamp klduge to Gtk.
+
+ * console-xlike-inc.h:
+ Fix GET_XLIKE_DISPLAY for gtk.
+
+ * frame-gtk.c (gtk_create_widgets):
+ Declare array const to avoid C++ warning.
+ (get_number, gnome_parse_geometry):
+ Re-enable local geometry parsing temporarily.
+
+ * config.h.in:
+ Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
+
+ * gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
+ Slider width is now in GtkStyle instance, not class.
+
+ * device-gtk.c (gtk_delete_device):
+ NEW_GC doesn't allow/require freeing device directly.
+
+2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * fontcolor-gtk.c (gtk_color_instance_hash):
+ Remove gtk_color_instance_hash equalp argument.
+
+ * gtk-glue.c (xemacs_type_register):
+ Change arg to const to avoid C++ warning.
+
+ * gtk-xemacs.c (gtk_xemacs_get_type):
+ Cast to avoid C++ const warning.
+
+ * frame-gtk.c (gtk_initialize_frame_size):
+ Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
+ Use gtk geometry functions.
+ Include gutter.h for frame size calculations.
+
2000-10-03 William M. Perry <wmperry(a)aventail.com>
* objects-gtk.c (gtk_font_instance_truename): Make sure we get the
https://bitbucket.org/xemacs/xemacs/commits/c6e0b59281cb/
Changeset: c6e0b59281cb
User: jsparkes
Date: 2010-04-26 11:15:04+00:00
Summary: Use G_BIG_ENDIAN instead of WORDS_BIGENDIAN.
Affected #: 3 files
diff -r 3542ff512957c674abb61ca94d102ea8184b13cd -r c6e0b59281cbb3ee5aedb45ec984290a40102945 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,13 @@
+2010-04-26 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * config.h.in:
+ We don't need WORDS_BIGENDIAN.
+
+ * glyphs-gtk.c (convert_EImage_to_GDKImage):
+ Use G_BIG_ENDIAN instead of WORDS_BIGENDIAN
+ (convert_EImage_to_GDKImage):
+ Ditto.
+
2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
* gtk-xemacs.c (gtk_xemacs_class_init):
@@ -9,7 +19,7 @@
* redisplay-gtk.c (XLIKE_bevel_area):
Cast GtkShadowStyle to edge_style for C++ compile.
- (our_draw_bitmap):
+ (our_draw_bitmap):
Implement using GDK, not XLib.
* fontcolor-gtk.c (gtk_color_instance_hash):
@@ -18,7 +28,7 @@
* event-gtk.c (handle_focus_event_1):
Extend X focus timestamp klduge to Gtk.
- * console-xlike-inc.h:
+ * console-xlike-inc.h:
Fix GET_XLIKE_DISPLAY for gtk.
* frame-gtk.c (gtk_create_widgets):
@@ -26,9 +36,9 @@
(get_number, gnome_parse_geometry):
Re-enable local geometry parsing temporarily.
- * config.h.in:
+ * config.h.in:
Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
-
+
* gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
Slider width is now in GtkStyle instance, not class.
diff -r 3542ff512957c674abb61ca94d102ea8184b13cd -r c6e0b59281cbb3ee5aedb45ec984290a40102945 src/config.h.in
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -319,7 +319,7 @@
#undef STDC_HEADERS
#undef TIME_WITH_SYS_TIME
-#undef WORDS_BIGENDIAN
+/* #undef WORDS_BIGENDIAN */
#undef HAVE_LONG_FILE_NAMES
diff -r 3542ff512957c674abb61ca94d102ea8184b13cd -r c6e0b59281cbb3ee5aedb45ec984290a40102945 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -255,7 +255,7 @@
gr = *ip++;
bl = *ip++;
conv.val = pixarray[QUANT_GET_COLOR(qtable,rd,gr,bl)];
-#if WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
if (outimg->byte_order == GDK_MSB_FIRST)
for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
else
@@ -330,7 +330,7 @@
bl = *ip++ >> (8 - bbits);
conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift);
-#if WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
if (outimg->byte_order == GDK_MSB_FIRST)
for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
else
https://bitbucket.org/xemacs/xemacs/commits/f09f26400270/
Changeset: f09f26400270
User: jsparkes
Date: 2010-04-26 12:16:28+00:00
Summary: Converted gtk-describe-type to 2.X
Affected #: 2 files
diff -r c6e0b59281cbb3ee5aedb45ec984290a40102945 -r f09f2640027069ca8d16f1038b409b6d3b2f53ef src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,10 @@
2010-04-26 Jeff Sparkes <jsparkes(a)gmail.com>
+ * ui-gtk.c (emacs_gtk_object_getprop):
+ Started conversion to 2.X.
+ (Fgtk_describe_type):
+ Converted to 2.X.
+
* config.h.in:
We don't need WORDS_BIGENDIAN.
diff -r c6e0b59281cbb3ee5aedb45ec984290a40102945 -r f09f2640027069ca8d16f1038b409b6d3b2f53ef src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -799,6 +799,7 @@
printing_unreadable_lisp_object (obj, 0);
write_ascstring (printcharfun, "#<GtkObject (");
+ /* Haven't found alive indicator in 2.X */
if (XGTK_OBJECT (obj)->alive_p)
write_cistring (printcharfun, gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object)));
else
@@ -811,7 +812,8 @@
{
Lisp_Object rval = Qnil;
Lisp_Object prop_name = Qnil;
- GtkArgInfo *info = NULL;
+ GParamSpec *info = NULL;
+ gchar *name = NULL;
char *err;
GtkArg args[2];
@@ -819,9 +821,11 @@
prop_name = Fsymbol_name (prop);
- args[0].name = (char *) XSTRING_DATA (prop_name);
+ name = (char *) XSTRING_DATA (prop_name);
- err = gtk_object_arg_get_info (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object),
+ /* Check class and instance property? */
+
+ err = g_object_get (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object),
args[0].name,
&info);
@@ -1218,6 +1222,15 @@
return (make_int (GTK_OBJECT_TYPE (XGTK_OBJECT (object)->object)));
}
+DEFUN ("g-object-type", Fg_object_type, 1, 1, 0, /*
+Return the GType of OBJECT.
+*/
+ (object))
+{
+ CHECK_GTK_OBJECT (object);
+ return (make_int (GTK_OBJECT_TYPE (XGTK_OBJECT (object)->object)));
+}
+
DEFUN ("gtk-describe-type", Fgtk_describe_type, 1, 1, 0, /*
Returns a cons of two lists describing the Gtk object TYPE.
The car is a list of all the signals that it will emit.
@@ -1237,8 +1250,8 @@
if (STRINGP (type))
{
- t = gtk_type_from_name ((gchar*) XSTRING_DATA (type));
- if (t == GTK_TYPE_INVALID)
+ t = g_type_from_name ((gchar*) XSTRING_DATA (type));
+ if (t == G_TYPE_INVALID)
{
invalid_argument ("Not a GTK type", type);
}
@@ -1247,9 +1260,11 @@
{
CHECK_INT (type);
t = XINT (type);
+ gchar *name = g_type_name (t);
+ // assert name is not "INVALID"
}
- if (GTK_FUNDAMENTAL_TYPE (t) != GTK_TYPE_OBJECT)
+ if (G_IS_OBJECT (t) != TRUE)
{
invalid_argument ("Not a GtkObject", type);
}
@@ -1258,10 +1273,9 @@
** registered... damn GTK and its lazy loading
*/
{
- GtkArg args[3];
- GtkObject *obj = gtk_object_newv (t, 0, args);
-
- gtk_object_destroy(obj);
+ GParameter args[3];
+ gpointer *obj = gtk_object_newv (t, 0, args);
+ /* No need to explictly destroy. */
}
do
@@ -1270,22 +1284,21 @@
/* Do the magic arguments first */
{
- GtkArg *args;
- guint32 *flags;
- guint n_args;
+ GParamSpec *params = NULL;
+ guint n_params;
+
+ params = g_object_class_list_properties (obj, &n_params);
- args = gtk_object_query_args(t,&flags,&n_args);
-
- for (i = 0; i < n_args; i++)
+ for (i = 0; i < n_params; i++)
{
- props = Fcons (Fcons (intern (gtk_type_name(args[i].type)),
- intern (args[i].name)), props);
+ assert (G_IS_PARAM_SPEC (params[i]));
+ props = Fcons (Fcons (intern (G_PARAM_SPEC_TYPE_NAME (params[i])),
+ intern (params[i]->name)), props);
}
- g_free (args);
- g_free (flags);
+ g_free (params);
}
-
+#if 0
/* Now the signals */
{
GtkObjectClass *klass;
@@ -1328,7 +1341,7 @@
} while (t != GTK_TYPE_INVALID);
rval = Fcons (signals, props);
-
+#endif
return (rval);
}
https://bitbucket.org/xemacs/xemacs/commits/c08663a648da/
Changeset: c08663a648da
User: jsparkes
Date: 2010-04-26 12:19:48+00:00
Summary: Someday I'll remember to merge before doing any more work.
Affected #: 4 files
diff -r f09f2640027069ca8d16f1038b409b6d3b2f53ef -r c08663a648da0931bdc232b681efbfb9c14d8d83 src/event-gtk.c
--- a/src/event-gtk.c
+++ b/src/event-gtk.c
@@ -565,7 +565,7 @@
milliseconds = 1;
timeout->timeout_id = gtk_timeout_add (milliseconds,
gtk_timeout_callback,
- (gpointer) timeout);
+ GINT_TO_POINTER(timeout));
return timeout->id;
}
diff -r f09f2640027069ca8d16f1038b409b6d3b2f53ef -r c08663a648da0931bdc232b681efbfb9c14d8d83 src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -1043,7 +1043,7 @@
if (!NILP (initially_unmapped))
{
gtk_object_set_data (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f)),
- UNMAPPED_DATA_IDENTIFIER, (gpointer) 1);
+ UNMAPPED_DATA_IDENTIFIER, GINT_TO_POINTER (1));
}
}
https://bitbucket.org/xemacs/xemacs/commits/4a6723a89edf/
Changeset: 4a6723a89edf
User: jsparkes
Date: 2010-04-26 12:26:38+00:00
Summary: Merged xemacs-beta.
Affected #: 24 files
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 CHANGES-beta
--- a/CHANGES-beta
+++ b/CHANGES-beta
@@ -2,26 +2,50 @@
by Ben Wing:
-debugging:
+Debugging (Lisp level):
-- make objects consistently print a UID, with a separate number space per
object type
-- add variable `debug-soe' for debugging stack-of-extents code in extents.c
+-- add variable debug-regexps for debugging regexp code, takes list of areas
+ to show info about
-- correctly note pdumped objects in memory-usage stats returned by
`garbage-collect' and `object-memory-usage-stats'.
-- make VDB debugging functions (e.g. `test-segfault', which causes an
immediate crash!) conditional on `--with-debug'
-- rename `debug-xemacs-searches' -> `debug-searches'
+-- rename `xft-debug-level' -> `debug-xft'
+-- rename `debug-x-objects' -> `debug-x-fonts'
-- Turn on "compiled-function annotation hack" so that compiled-function
objects print the function they are assigned to
-- Resurrect byte-metering code when --with-debug; enable with variables
`byte-code-meter', `byte-metering-on'
-- Add more checks for invalid byte code; when a byte-code-related crash
occurs, output the last 100 instructions processed
-
-documentation:
+-- Improved memory-usage mechanism -- removal of `*-memory-usage' in favor
+ of generalized `object-memory-usage'; `show-memory-usage' and
+ `show-object-memory-usage-stats' show, in addition to regular object usage,
+ associated non-Lisp usage as well as ancillary Lisp object usage;
+ `garbage-collect' and `object-memory-usage-stats' return information on
+ storage overhead, associated non-Lisp usage and ancillary Lisp usage
+
+Lisp documentation:
-- fix to `previous/next-single[-char]-property-change'
+-- Document the keywords to the various sequence/list functions:
+ reduce, fill, replace, remove*, remove-if, remove-if-not, delete*,
+ delete-if, delete-if-not, remove-duplicates, delete-duplicates,
+ substitute, substitute-if, substitute-if-not, nsubstitute,
+ nsubstitute-if, nsubstitute-if-not, find, find-if, find-if-not,
+ position, position-if, position-if-not, count, count-if, count-if-not,
+ mismatch, search, sort*, stable-sort, merge, member*, member-if,
+ member-if-not, assoc*, assoc-if, assoc-if-not, rassoc*, rassoc-if,
+ rassoc-if-not, union, nunion, intersection, nintersection,
+ set-difference, nset-difference, set-exclusive-or, nset-exclusive-or,
+ subsetp, subst-if, subst-if-not, nsubst, nsubst-if, nsubst-if-not,
+ sublis, nsublis, tree-equal, cl-tree-equal-rec, pushnew, adjoin, subst
+-- fix so that Common-Lisp argument lists get properly displayed in
+ function documentation
Lisp API:
@@ -38,56 +62,300 @@
-- In `scan-lists' and friends, when an error occurs, return a `scan-error'
along with two arguments specifying the range in which the error occurred,
for GNU compatibility
-
-Internals:
+-- Functions for dealing with conditional compilation of code depending on
+ presence or absence of features:
+ -- error-unless-tests-match -- signal an error unless a test expression
+ matches when file is compiled and loaded
+ -- byte-compile-file-being-compiled -- return name of file being
+ byte-compiled
+ -- compiled-if, compiled-when -- like `if' or `when' but test is evaluated
+ at compile time
+-- Functions for doing stable set operations
+ -- stable-union, stable-intersection
+
+Internals: Lisp objects
-- reduce lcrecord header size from 3 words to 2
-- major change to the way Lisp objects are defined and declared; introduce
a cleaner surface-layer API that eliminates references to "lrecords" and
"lcrecords", and uses "frob-block object" in place of "basic object"/
- "simple object"/etc.
+ "simple object"/etc.:
+
+ Renamed:
+
+ ALLOC_LCRECORD_TYPE -> ALLOC_NORMAL_LISP_OBJECT (returns a Lisp object
+ rather than a pointer)
+ ALLOCATE_FIXED_TYPE_AND_SET_IMPL -> ALLOC_FROB_BLOCK_LISP_OBJECT
+ BASIC_ALLOC_LCRECORD -> ALLOC_SIZED_LISP_OBJECT
+ DEFINE_LRECORD_IMPLEMENTATION -> DEFINE_*_LISP_OBJECT
+ DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION -> DEFINE_*SIZABLE_*LISP_OBJECT
+ DEFINE_LRECORD_*IMPLEMENTATION_WITH_PROPS -> DEFINE_*LISP_OBJECT, and
+ use OBJECT_HAS_METHOD() for the getprop, etc. methods
+ DEFINE_BASIC_LRECORD_IMPLEMENTATION -> DEFINE_*FROB_BLOCK_LISP_OBJECT
+ DEFINE_DUMPABLE_*/DEFINE_NODUMP_* instead of a 0 or 1 dumpable flag
+ DEFINE_*INTERNAL_* for "internal" Lisp objects (shouldn't escape
+ to Lisp)
+ DEFINE_EXTERNAL_* -> DEFINE_MODULE_*
+ MAKE_LRECORD_IMPLEMENTATION -> MAKE_LISP_OBJECT
+ MAKE_EXTERNAL_LRECORD_IMPLEMENTATION -> MAKE_MODULE_LISP_OBJECT
+ DECLARE_LRECORD -> DECLARE_LISP_OBJECT
+ INIT_LRECORD_IMPLEMENTATION -> INIT_LISP_OBJECT
+ LCRECORD_HEADER -> NORMAL_LISP_OBJECT_HEADER
+ alloc_lrecord -> alloc_sized_lrecord (since it takes a size)
+ printing_unreadable_object -> printing_unreadable_object_fmt
+ printing_unreadable_lcrecord -> printing_unreadable_lisp_object
+
+ New:
+
+ lisp_object_storage_size() -- storage used for Lisp object including
+ overhead
+ LISP_OBJECT_UID() -- UID of Lisp object
+ zero_sized_lisp_object() -- zero out a Lisp object of variable size
+ zero_nonsized_lisp_object() -- zero out a Lisp object of fixed size
+ free_normal_lisp_object() -- free a non-frob-block Lisp object
+ LISP_OBJECT_FROB_BLOCK_P() -- return whether a Lisp object is a
+ frob-block object
+ IF_OLD_GC, IF_NEW_GC -- simplify declaration of Lisp objects w.r.t. NEW-GC
+ when a finalizer may exist in one but not the
+ other
+
+ Eliminated:
+
+ free_lrecord()
+ FREE_LISP_OBJECT():
+ Use free_normal_lisp_object()
+
+ old_zero_lcrecord()
+ old_zero_sized_lcrecord()
+ ZERO_LISP_OBJECT()
+ zero_lrecord():
+ Use zero_sized_lisp_object(), zero_nonsized_lisp_object()
+
+ copy_lrecord()
+ copy_sized_lrecord()
+ old_copy_lcrecord()
+ old_copy_sized_lcrecord()
+ COPY_SIZED_LISP_OBJECT()
+ COPY_SIZED_LCRECORD()
+ COPY_LISP_OBJECT():
+ Use copy_lisp_object()
+
+ LISP_OBJECT_STORAGE_SIZE():
+ Use lisp_object_storage_size()
+
-- new disksave method for Lisp objects, separated out from the finalize method
+-- new, non-static way of initializing Lisp object methods; used for disksave,
+ getprop, putprop, remprop, object_plist, various memory-usage methods:
+ OBJECT_HAS_METHOD(), OBJECT_HAS_PROPERTY(), etc.
-- Lisp objects now must specify a print method; use either
internal_object_printer() or external_object_printer() as a default
-- equal method for Lisp objects has new `foldcase' param, to implement
case-folding comparison ala `equalp'
--- various changes to frame-geometry macros in frame-impl.h, gutter.h, etc.,
- and frame-sizing code in frame.c
--- Major rewrite, updated documentation to dynarr functions and macros
--- Major updates to internals manual and long comments in C files:
- frame geometry, specifier authors, MS-Windows compilation flags, xlike
- mechanism, ...
+-- Each type of Lisp object has separate UID space
+-- Redo and generalize memory-usage mechanism, add memory-usage methods for
+ various objects; the following objects now have memory-usage methods:
+ buffers, case tables, hash tables, frames, charsets, scrollbar instances,
+ specifiers, windows, window mirrors
-- Rename LISP_TO_VOID -> STORE_LISP_IN_VOID,
VOID_TO_LISP -> GET_LISP_FROM_VOID; add STORE_VOID_IN_LISP,
GET_VOID_FROM_LISP
+-- Other renames:
+ XD_LISP_OBJECT_BLOCK_PTR -> XD_INLINE_LISP_OBJECT_BLOCK_PTR
+-- Other new functions and macros:
+ lisp_object_memory_usage() -- memory usage of Lisp object, including
+ associated non-Lisp usage and ancillary Lisp
+ usage
+ tree_memory_usage() -- memory usage of a tree of conses and/or vectors
+ SAFE_LIST_LOOP_* -- loop over a possibly invalid list without signalling
+ an error
+ listn() -- variable-argument list creation, number of arguments specified
+ listu() -- variable-argument list creation, terminated with Qunbound
+
+-- Make the first lrecord type have value 1 not 0 so that attempts to
+ interpret 0'd memory as a Lisp object will fail more obviously
+
+Internals: Arrays and Tables
+
+-- Major rewrite, updated documentation to dynarr functions and macros
+
+ Rename:
+
+ Dynarr_add_lisp_string -> Dynarr_add_ext_lisp_string
+ Dynarr_set_length -> Dynarr_set_lengthr ("restricted")
+ Dynarr_increment -> Dynarr_incrementr
+ Dynarr_resize_if -> Dynarr_resize_to_add
+
+ New functions:
+
+ Dynarr_elsize = dy->elsize_
+ Dynarr_set_length(): Set length, resizing as necessary
+ Dynarr_set_length_and_zero(): Set length, resizing as necessary,
+ zeroing out new elements
+ Dynarr_increase_length(), Dynarr_increase_length_and_zero():
+ Optimization of Dynarr_set_length(), Dynarr_set_length_and_zero()
+ when size is known to increase
+ Dynarr_resize_to_fit(): Resize as necessary to fit a given length.
+ Dynarr_set(): Set element at a given position, increasing length
+ as necessary and setting any newly created positions to 0
+ ERROR_CHECK_DYNARR, dynarr_checking_assert()
+
+-- Extracted and generalized gap array code from extents.c to array.c
+-- Rewrite range tables to use gap arrays; redo put_range_table() so it's
+ O(log n) when adding a localized range
+
+Internals: Misc
+
+-- Collect allocation-statistics code in one place
+-- if (...) ABORT (); --> assert ();
+-- various changes to frame-geometry macros in frame-impl.h, gutter.h, etc.,
+ and frame-sizing code in frame.c:
+ -- TOP_BORDER, BOTTOM_BORDER, etc. -> TOP_EDGE, BOTTOM_EDGE, etc.
+ -- GUTTER_POS_LOOP -> EDGE_POS_LOOP
+ -- hardcoded use of '4' -> NUM_EDGES
+ -- default_face_height_and_width -> default_face_width_and_height, with
+ arguments reversed
+ -- width/height arguments reversed in the following, to put width first:
+ -- default_face_font_info
+ -- default_face_height_and_width (see above)
+ -- check_frame_size
+ -- frame_size_valid_p (made into a static function)
+ -- change_frame_size and
+ -- change_frame_size_1
+ -- FRAME_BORDER_* -> FRAME_INTERNAL_BORDER_*
+ -- new FRAME_INTERNAL_BORDER_SIZE(), FRAME_REAL_TOOLBAR_BOUNDS()
+ -- pixel_to_char_size -> pixel_to_frame_unit_size
+ -- char_to_pixel_size -> frame_unit_to_pixel_size
+ -- pixel_to_real_char_size -> pixel_to_char_size
+ -- char_to_real_pixel_size -> char_to_pixel_size
+ -- Eliminate old round_size_to_char, because it didn't really
+ do anything differently from round_size_to_real_char()
+ -- round_size_to_real_char -> round_size_to_char; any places that
+ called the old round_size_to_char should just call the new one.
+-- Major updates to internals manual and long comments in C files:
+ frame geometry, specifier authors, MS-Windows compilation flags, xlike
+ mechanism, magic symbols, lrecords, NEW-GC, dynarrs, ...
+-- Major reworking of DFC macros e.g. EXTERNAL_TO_C_STRING renamed to
+ EXTERNAL_TO_ITEXT; make them return their values when possible rather
+ than storing into a named variable:
+
+ EXTERNAL_TO_C_STRING -> EXTERNAL_TO_ITEXT
+ EXTERNAL_TO_C_STRING_MALLOC -> EXTERNAL_TO_ITEXT_MALLOC
+ SIZED_EXTERNAL_TO_C_STRING -> SIZED_EXTERNAL_TO_ITEXT
+ SIZED_EXTERNAL_TO_C_STRING_MALLOC -> SIZED_EXTERNAL_TO_ITEXT_MALLOC
+ C_STRING_TO_EXTERNAL -> ITEXT_TO_EXTERNAL
+ C_STRING_TO_EXTERNAL_MALLOC -> ITEXT_TO_EXTERNAL_MALLOC
+ LISP_STRING_TO_EXTERNAL
+ LISP_STRING_TO_EXTERNAL_MALLOC
+ LISP_STRING_TO_TSTR
+ C_STRING_TO_TSTR -> ITEXT_TO_TSTR
+ TSTR_TO_C_STRING -> TSTR_TO_ITEXT
+
+ The following four still return their values through parameters,
+ since they have more than one value to return:
+
+ C_STRING_TO_SIZED_EXTERNAL -> ITEXT_TO_SIZED_EXTERNAL
+ LISP_STRING_TO_SIZED_EXTERNAL
+ C_STRING_TO_SIZED_EXTERNAL_MALLOC -> ITEXT_TO_SIZED_EXTERNAL_MALLOC
+ LISP_STRING_TO_SIZED_EXTERNAL_MALLOC
+
+-- Eliminate unused second argument to xfree()
+-- Whenever xfree() a structure field, set the field to 0 afterwards, to
+ protect against double free or possible attempt to interpret the field
+ later on
+-- Move `equalp' to C
+-- Rename `enum font_specifier_matchspec_stages':
+ initial -> STAGE_INITIAL
+ final -> STAGE_FINAL
+ impossible -> NUM_MATCHSPEC_STAGES
+-- Rename:
+ PROCESSING_X_CODE -> THIS_IS_X
+ PROCESSING_GTK_CODE -> THIS_IS_GTK
+-- Rename:
+ write_c_string -> write_cistring
+ build_intstring -> build_istring
+ build_string -> build_cistring
+ build_ext_string -> build_extstring
+ make_ext_string -> make_extstring
+ buffer_insert_c_string -> buffer_insert_ascstring
+ intern_int -> intern_istring
+-- Lots of cleanup of (not-yet-working) message translation code
+-- Lots of Mule-izing:
+ -- change raw `char *' to some characterized type to indicate the
+ semantics properly
+ -- change all occurrences of Qnative to some more specific encoding
+ -- create new encodings:
+ -- Qtime_function_encoding
+ Qtime_zone_encoding
+ Quser_name_encoding
+ Qerror_message_encoding
+ Qjpeg_error_message_encoding
+ Qtooltalk_encoding
+ Qgtk_encoding
+ Qx_error_message_encoding
+-- Major unification of X and GTK redisplay code into "xlike" code, creation
+ of "xlike" mechanism
+-- Rename:
+ LOCAL_TO_WIN32_FILE_FORMAT -> LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN
+ WIN32_TO_LOCAL_FILE_FORMAT -> INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT
+ LOCAL_FILE_FORMAT_TO_TSTR -> LISP_LOCAL_FILE_FORMAT_TO_TSTR.
+ LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR -> LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR
+ Create new LOCAL_FILE_FORMAT_TO_TSTR
+-- Redo the code in code-init.el that initializes coding-system defaults
+-- separate HAVE_XFT into HAVE_XFT and USE_XFT, to facilitate compiling
+ simultaneously with X and GTK
+
+File Additions, Deletions, Renames, etc.
+
-- Convert various source files to UTF-8
-- File renames:
select-common.h -> select-xlike-inc.c
xgccache.{ch} -> gccache-x.{ch}
toolbar-common.{ch} -> toolbar-xlike.{ch}
+ objects*.{ch} -> fontcolor*.{ch}
+ dynarr.c -> array.c
-- New files:
bytecode-ops.h
sysgtk.h, sysgdkx.h
keymap-buttons.h, keymap-slots.h
-- Deleted files:
event-gtk.h
--- Major reworking of DFC macros e.g. EXTERNAL_TO_C_STRING renamed to
- EXTERNAL_TO_ITEXT; make them return their values when possible rather
- than storing into a named variable
--- Eliminate unused second argument to xfree()
--- separate HAVE_XFT into HAVE_XFT and USE_XFT, to facilitate compiling
- simultaneously with X and GTK
--- Move `equalp' to C
-
-Testing:
-
--- Move test-harness.el to Lisp directory
+-- File moves:
+ moved test-harness.el to Lisp directory
+ moved etc/gdbinit.in to src/.gdbinit.in.in
+
+Internals: Debugging
+
+-- New function debug_out_lisp() -- printf-like formatting for Lisp objects,
+ debug output
+-- Expand the KKCC backtrace mechanism -- new functions:
+ kkcc_short_backtrace()
+ kkcc_short_backtrace_full()
+ kkcc_detailed_backtrace()
+ kkcc_detailed_backtrace_full()
+-- Make print code even more careful about checking for bad memory,
+ bad object types, circular objects, etc.
+-- When --with-debug, set `debug-on-error' so we get an abort to debugger
+ upon Lisp error
Building:
-- Fix `--quick-build' so full rebuilds don't happen when changes are made
to files like lisp.h, config.h that are included by all C files
-- Fix C++ build on Cygwin when configured with --have-database
+-- Always insert a coding-system cookie in autoload files, fixing problems
+ when default coding system is UTF-8, as under Cygwin
+-- Redo compile warning system, turn on a number of warnings that had
+ mistakenly gotten turned off
+-- Fix so that builds properly under gcc v4, g++ v4
+-- Make `--with-error-checking' be the same as `--with-error-checking=all'
+-- Expand documentation of `--with-debug'
+-- Use -export-all-symbols instead of broken -export-dynamic on Cygwin/MinGW
+-- Add fix-perms target to correct permissions on executable/non-exec files
+-- rename all instances of --enable-FOO to --with-FOO.
+-- Fix make-mswin-unicode.pl so that it can work with Cygwin w32api headers
+ as well as actual VC++ headers
+-- make-msgfile.lex: Long documentation on what should be done if we ever want
+ message translation to work.
User-Visible Bug Fixes:
@@ -104,6 +372,11 @@
-- Fix a crash in frame creation due to lack of call to reset_glyph_cachels()
-- Fix long-standing bug: searching for Control-1 chars didn't work
-- Turn on `load-ignore-out-of-date-elc-files' by default
+-- Fix crash in event-TTY code when reading an event non-interactively
+-- Use UTF-8 consistently as encoding default under Cygwin 1.7
+-- Fix broken code in computing fastmap for [^...] regexps under Mule
+-- Fix display-table entries for error-octet characters so they display
+ as originally intended
by Aidan Kehoe:
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-09 Ben Wing <ben(a)xemacs.org>
+
+ * CHANGES-beta:
+ Update with my changes to the trunk since the release of 21.5.29
+ in 2009 up through April 9, 2010.
+
2010-04-02 Aidan Kehoe <kehoea(a)parhasard.net>
* CHANGES-beta:
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 lib-src/ChangeLog
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * make-docfile.c (scan_lisp_file):
+ Even if a function doesn't have a doc string, store its file name
+ in DOC.
+
2010-03-02 Ben Wing <ben(a)xemacs.org>
* digest-doc.c:
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 lib-src/make-docfile.c
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -1084,6 +1084,7 @@
{
char buffer[BUFSIZ];
char type;
+ int no_docstring = 0;
/* If not at end of line, skip till we get to one. */
if (c != '\n')
@@ -1187,7 +1188,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
@@ -1217,7 +1218,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
}
@@ -1276,7 +1277,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
}
@@ -1333,7 +1334,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
}
@@ -1391,7 +1392,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
}
@@ -1422,15 +1423,18 @@
putc (037, outfile);
putc (type, outfile);
fprintf (outfile, "%s\n", buffer);
- if (saved_string)
- {
- fputs (saved_string, outfile);
- /* Don't use one dynamic doc string twice. */
- free (saved_string);
- saved_string = 0;
- }
- else
- read_c_string (infile, 1, 0);
+ if (!no_docstring)
+ {
+ if (saved_string)
+ {
+ fputs (saved_string, outfile);
+ /* Don't use one dynamic doc string twice. */
+ free (saved_string);
+ saved_string = 0;
+ }
+ else
+ read_c_string (infile, 1, 0);
+ }
}
fclose (infile);
return 0;
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,29 @@
+2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * loadup.el (load-history): Be a bit more discriminate in the
+ entries we remove from load-history, only removing those where the
+ information is entirely available from DOC.
+ Fixes problems finding the files that dumped undocumented
+ variables were loaded from, reported by Didier Verna.
+ * loadhist.el (symbol-file): Correct a regexp here, I had
+ forgotten to double a backslash.
+
+2010-04-15 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * files.el (hack-local-variables-prop-line)
+ (hack-one-local-variable):
+ Only attempt to call MODENAME-mode on encountering a
+ -*-MODENAME-*- line if the corresponding symbol has a function
+ binding, avoiding an error if, for example, opening a log file
+ with XLFDs and wild cards. Thanks for the bug report, Henrique
+ Martins!
+
+2010-04-09 Didier Verna <didier(a)xemacs.org>
+
+ * hyper-apropos.el (hyper-apropos-get-doc): Use [not available]
+ when a function's arglist is unknown (this happens for autoloaded
+ functions).
+
2010-04-07 Didier Verna <didier(a)xemacs.org>
* font-lock.el (lisp-font-lock-keywords-2): Add missing CL style
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 lisp/files.el
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2044,7 +2044,7 @@
;; Without this guard, `normal-mode' would potentially run
;; the major mode function twice: once via `set-auto-mode'
;; and once via `hack-local-variables'.
- (if (not (eq mode major-mode))
+ (if (and (not (eq mode major-mode)) (fboundp mode))
(funcall mode))
))
(set-any-p
@@ -2091,8 +2091,9 @@
"\"Set\" one variable in a local variables spec.
A few variable names are treated specially."
(cond ((eq var 'mode)
- (funcall (intern (concat (downcase (symbol-name val))
- "-mode"))))
+ (and (fboundp (setq val (intern (concat (downcase (symbol-name val))
+ "-mode"))))
+ (funcall val)))
((eq var 'coding)
;; We have already handled coding: tag in set-auto-coding.
nil)
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 lisp/hyper-apropos.el
--- a/lisp/hyper-apropos.el
+++ b/lisp/hyper-apropos.el
@@ -772,11 +772,14 @@
global (current-global-map)
obsolete (get symbol 'byte-obsolete-info)
doc (function-documentation symbol t)
- arglist (replace-in-string
- (function-arglist symbol)
- (format "^(%s "
- (regexp-quote (symbol-name symbol)))
- "("))
+ arglist (let ((farglist (function-arglist symbol)))
+ (if farglist
+ (replace-in-string
+ farglist
+ (format "^(%s "
+ (regexp-quote (symbol-name symbol)))
+ "(")
+ "[not available]")))
(save-excursion
(set-buffer hyper-apropos-help-buf)
(goto-char (point-max))
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 lisp/loadhist.el
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -89,7 +89,7 @@
built-in-file
;; This is a bit heuristic, but shouldn't realistically be a
;; problem:
- (if (string-match "\.elc?$" built-in-file)
+ (if (string-match #r"\.elc?$" built-in-file)
(concat (if (file-readable-p source-lisp)
source-lisp
lisp-directory)
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 lisp/loadup.el
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -220,10 +220,22 @@
(load "site-init" t))
;; Add information from this file to the load history. Delete information
-;; for those files in preloaded-file-list; the symbol file information can
-;; be taken from DOC, and #'unload-feature makes very little sense for
-;; dumped functionality.
-(setq load-history (cons (nreverse current-load-list) (last load-history))
+;; that is available from DOC for those files in preloaded-file-list; in
+;; practice, this boils down to #'provide and #'require calls, and variables
+;; without documentation. Yes, this is a bit ugly.
+(setq load-history (cons (nreverse current-load-list)
+ (delete*
+ nil
+ (mapc #'(lambda (element)
+ (remassq 'defun element)
+ (delete-if
+ #'(lambda (elt)
+ (and
+ (symbolp elt)
+ (get elt 'variable-documentation)))
+ element))
+ load-history)
+ :key #'cdr))
;; Clear current-load-list; this (and adding information to
;; load-history) is normally done in lread.c after reading the
;; entirety of a file, something which never happens for loadup.el.
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 modules/ChangeLog
--- a/modules/ChangeLog
+++ b/modules/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-12 Ben Wing <ben(a)xemacs.org>
+
+ * canna/canna_api.c:
+ * canna/canna_api.c (Fcanna_henkan_begin):
+ Fixes for errors reported in smoketest build.
+
2010-03-12 Ben Wing <ben(a)xemacs.org>
* base64/base64.c:
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 modules/canna/canna_api.c
--- a/modules/canna/canna_api.c
+++ b/modules/canna/canna_api.c
@@ -2,7 +2,7 @@
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 2005 Ben Wing.
+ Copyright (C) 2005, 2010 Ben Wing.
This file is part of XEmacs.
@@ -661,7 +661,7 @@
#define RKBUFSIZE 1024
-static unsigned char yomibuf[RKBUFSIZE];
+static UExtbyte yomibuf[RKBUFSIZE];
static short kugiri[RKBUFSIZE / 2];
static int
@@ -720,7 +720,7 @@
strncpy ((char *) yomibuf, ext, sizeof (yomibuf));
yomibuf[sizeof (yomibuf) - 1] = '\0';
- nbun = RkBgnBun (IRCP_context, yomibuf, strlen ((char *) yomibuf),
+ nbun = RkBgnBun (IRCP_context, (char *) yomibuf, strlen ((char *) yomibuf),
(RK_XFER << RK_XFERBITS) | RK_KFER);
return kanjiYomiList (IRCP_context, nbun);
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,110 @@
+2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doc.c (Fdocumentation):
+ If we have a zero length doc string in DOC, as may happen for
+ undocumented compiled function objects which nonetheless have file
+ information stored, return nil.
+ (Fsnarf_documentation):
+ DOC info existing for compiled functions without docstrings is
+ perfectly legitimate, now the file is also used to store file names.
+ * bytecode.c (set_compiled_function_documentation):
+ Allow this function to set the documentation successfully for
+ compiled function objects that don't currently have documentation;
+ most relevant for functions without docstrings which have file
+ information stored in DOC.
+
+2010-04-15 Ben Wing <ben(a)xemacs.org>
+
+ * device-x.c (x_init_device):
+ Don't declare something const if we're going to modify it.
+ Clean up code to follow GNU coding standards.
+
+2010-04-12 Ben Wing <ben(a)xemacs.org>
+
+ * specifier.c (specifier_memory_usage):
+ Disable specifier memory-usage stats for now. Sometimes they can
+ end up with circularities in them and I'm not sure exactly whats
+ going on to produce them.
+
+2010-04-12 Ben Wing <ben(a)xemacs.org>
+
+ * charset.h:
+ * lisp.h:
+ * lisp.h (XREALLOC_ARRAY):
+ * text.h:
+ Port charset_codepoint_to_itext(), buffer_itext_to_charset_codepoint(),
+ EXTBYTE_STRING_TO_ALLOCA(), `enum converr' from ben-unicode-internal,
+ for use with the mule-wnnfns.c changes.
+
+ * mule-wnnfns.c:
+ * mule-wnnfns.c (Fwnn_open):
+ * mule-wnnfns.c (Fwnn_dict_add):
+ * mule-wnnfns.c (Fwnn_dict_list):
+ * mule-wnnfns.c (Fwnn_get_zenkouho):
+ * mule-wnnfns.c (Fwnn_inspect):
+ * mule-wnnfns.c (Fwnn_bunsetu_kanji):
+ * mule-wnnfns.c (Fwnn_bunsetu_yomi):
+ * mule-wnnfns.c (Fwnn_word_info):
+ * mule-wnnfns.c (Fwnn_dict_search):
+ * mule-wnnfns.c (Fwnn_get_msg):
+ * mule-wnnfns.c (Fwnn_fuzokugo_set):
+ * mule-wnnfns.c (Fwnn_fuzokugo_get):
+ * mule-wnnfns.c (Fwnn_hinsi_list):
+ * mule-wnnfns.c (Fwnn_fisys_dict_add):
+ * mule-wnnfns.c (Fwnn_fiusr_dict_add):
+ * mule-wnnfns.c (Fwnn_notrans_dict_add):
+ * mule-wnnfns.c (Fwnn_bmodify_dict_add):
+ * mule-wnnfns.c (reinit_vars_of_mule_wnn):
+ * mule-wnnfns.c (vars_of_mule_wnn):
+ * mule-wnnfns.c (w2m):
+ * mule-wnnfns.c (m2w):
+ * mule-wnnfns.c (yes_or_no):
+ * mule-wnnfns.c (puts2):
+ * mule-wnnfns.c (check_wnn_server_type):
+ Mule-ize, borrowed from ben-unicode-internal.
+
+2010-04-09 Ben Wing <ben(a)xemacs.org>
+
+ * fileio.c (check_writable):
+ * fileio.c (Fdo_auto_save):
+ * redisplay-xlike-inc.c (separate_textual_runs_nomule):
+ * redisplay-xlike-inc.c (separate_textual_runs_xft_nomule):
+ * redisplay-xlike-inc.c (separate_textual_runs_xft_mule):
+ * redisplay-xlike-inc.c (separate_textual_runs_mule):
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ * redisplay-xlike-inc.c (XLIKE_output_vertical_divider):
+ * redisplay.c (create_text_block):
+ * redisplay.c (regenerate_window):
+ * redisplay.c (redisplay_window):
+ * redisplay.c (redisplay_device):
+ * redisplay.c (window_line_number):
+ * redisplay.c (point_would_be_visible):
+ * redisplay.c (compute_display_line_dynarr_usage):
+ * specifier.c (prune_specifiers):
+ * specifier.c (finalize_specifier):
+ * specifier.c (make_magic_specifier):
+ * specifier.c (charset_matches_specifier_tag_set_p):
+ * specifier.c (Fdefine_specifier_tag):
+ * specifier.c (setup_device_initial_specifier_tags):
+ * specifier.c (bodily_specifier):
+ * specifier.c (add_spec_to_ghost_specifier):
+ * specifier.c (remove_ghost_specifier):
+ * specifier.c (set_specifier_fallback):
+ * specifier.c (specifier_instance_from_inst_list):
+ * specifier.c (set_specifier_caching):
+ Fix coding style to correspond to GNU standard.
+
+2010-04-09 Didier Verna <didier(a)xemacs.org>
+
+ * fontcolor-xlike-inc.c (DEBUG_FONTS2):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS3):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS4):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP1):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP2):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP3):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP4): Conditionalize
+ definitions on DEBUG_XEMACS, provide empty definitions otherwise.
+
2010-04-06 Ben Wing <ben(a)xemacs.org>
* elhash.c (Feq_hash):
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 src/bytecode.c
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -2562,22 +2562,36 @@
#endif
-/* used only by Snarf-documentation; there must be doc already. */
+/* used only by Snarf-documentation. */
void
set_compiled_function_documentation (Lisp_Compiled_Function *f,
Lisp_Object new_doc)
{
- assert (f->flags.documentationp);
assert (INTP (new_doc) || STRINGP (new_doc));
- if (f->flags.interactivep && f->flags.domainp)
- XCAR (f->doc_and_interactive) = new_doc;
- else if (f->flags.interactivep)
- XCAR (f->doc_and_interactive) = new_doc;
- else if (f->flags.domainp)
- XCAR (f->doc_and_interactive) = new_doc;
+ if (f->flags.documentationp)
+ {
+ if (f->flags.interactivep && f->flags.domainp)
+ XCAR (f->doc_and_interactive) = new_doc;
+ else if (f->flags.interactivep)
+ XCAR (f->doc_and_interactive) = new_doc;
+ else if (f->flags.domainp)
+ XCAR (f->doc_and_interactive) = new_doc;
+ else
+ f->doc_and_interactive = new_doc;
+ }
else
- f->doc_and_interactive = new_doc;
+ {
+ f->flags.documentationp = 1;
+ if (f->flags.interactivep || f->flags.domainp)
+ {
+ f->doc_and_interactive = Fcons (new_doc, f->doc_and_interactive);
+ }
+ else
+ {
+ f->doc_and_interactive = new_doc;
+ }
+ }
}
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 src/charset.h
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,7 +1,7 @@
/* Header for charsets.
Copyright (C) 1992, 1995 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 2001, 2002 Ben Wing.
+ Copyright (C) 2001, 2002, 2010 Ben Wing.
This file is part of XEmacs.
@@ -555,6 +555,46 @@
#define BREAKUP_ICHAR(c, charset, c1, c2) \
breakup_ichar_1 (c, &(charset), &(c1), &(c2))
+/* Forward compatibility from ben-unicode-internal: Convert a charset
+ codepoint into a character in the internal string representation.
+ Return number of bytes written out. FAIL controls failure mode when
+ charset conversion to Unicode is not possible (unused as of yet). */
+DECLARE_INLINE_HEADER (
+Bytecount
+charset_codepoint_to_itext (Lisp_Object charset, int c1, int c2, Ibyte *ptr,
+ enum converr UNUSED (fail))
+)
+{
+ Ichar ch;
+
+ if (EQ (charset, Vcharset_ascii))
+ {
+ ptr[0] = (Ibyte) c2;
+ return 1;
+ }
+
+ ch = make_ichar (charset, c1, c2);
+
+ /* We can't rely on the converted character being non-ASCII. For
+ example, JISX0208 codepoint (33, 64) == Unicode 0x5C (ASCII
+ backslash). */
+ return set_itext_ichar (ptr, ch);
+}
+
+/* Forward compatibility from ben-unicode-internal */
+
+DECLARE_INLINE_HEADER (
+void
+buffer_itext_to_charset_codepoint (const Ibyte *ptr,
+ struct buffer *UNUSED (buf),
+ Lisp_Object *charset, int *c1, int *c2,
+ enum converr UNUSED (fail))
+)
+{
+ Ichar ch = itext_ichar (ptr);
+ breakup_ichar_1 (ch, charset, c1, c2);
+}
+
void get_charset_limits (Lisp_Object charset, int *low, int *high);
int ichar_to_unicode (Ichar chr);
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 src/device-x.c
--- a/src/device-x.c
+++ b/src/device-x.c
@@ -689,7 +689,7 @@
Extbyte *path;
const Extbyte *format;
XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */
- const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
+ Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
Extbyte *locale_end;
if (STRINGP (Vx_app_defaults_directory) &&
@@ -720,28 +720,26 @@
if (!access (path, R_OK))
XrmCombineFileDatabase (path, &db, False);
- if ((locale_end = strchr(locale, '.'))) {
- *locale_end = '\0';
- sprintf (path, format, data_dir, locale);
+ if ((locale_end = strchr (locale, '.')))
+ {
+ *locale_end = '\0';
+ sprintf (path, format, data_dir, locale);
- if (!access (path, R_OK))
- XrmCombineFileDatabase (path, &db, False);
- }
+ if (!access (path, R_OK))
+ XrmCombineFileDatabase (path, &db, False);
+ }
- if ((locale_end = strchr(locale, '_'))) {
- *locale_end = '\0';
- sprintf (path, format, data_dir, locale);
+ if ((locale_end = strchr (locale, '_')))
+ {
+ *locale_end = '\0';
+ sprintf (path, format, data_dir, locale);
- if (!access (path, R_OK))
- XrmCombineFileDatabase (path, &db, False);
- }
+ if (!access (path, R_OK))
+ XrmCombineFileDatabase (path, &db, False);
+ }
no_data_directory:
- {
- /* Cast off const for G++ 4.3. */
- Extbyte *temp = (Extbyte *) locale;
- xfree (temp);
- }
+ xfree (locale);
}
#endif /* MULE */
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 src/doc.c
--- a/src/doc.c
+++ b/src/doc.c
@@ -613,7 +613,15 @@
if (STRINGP (tem))
doc = tem;
else if (NATNUMP (tem) || CONSP (tem))
- doc = get_doc_string (tem);
+ {
+ doc = get_doc_string (tem);
+ /* We may have zero length strings in the docfile for file
+ information. */
+ if (STRINGP (doc) && 0 == XSTRING_LENGTH (doc))
+ {
+ return Qnil;
+ }
+ }
else
return Qnil;
}
@@ -903,33 +911,24 @@
slots for it. */
Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
- /* This compiled-function object must have a
- slot for the docstring, since we've found a
- docstring for it. Unless there were multiple
- definitions of it, and the latter one didn't
- have any doc, which is a legal if slightly
- bogus situation, so don't blow up. */
+ /* If there were multiple definitions for this function,
+ and the latter one didn't
+ have any doc, warn and don't blow up. */
+ Lisp_Object old =
+ compiled_function_documentation (f);
+ if (!ZEROP (old) && !NILP (old))
+ {
+ weird_doc (sym, "duplicate", "bytecode", pos);
+ /* In the case of duplicate doc file entries,
+ always take the later one. But if the doc is
+ not an int (a string, say) leave it alone. */
+ if (!INTP (old))
+ goto weird;
+ }
- if (! (f->flags.documentationp))
- {
- weird_doc (sym, "no doc slot", "bytecode", pos);
- goto weird;
- }
- else
- {
- Lisp_Object old =
- compiled_function_documentation (f);
- if (!ZEROP (old))
- {
- weird_doc (sym, "duplicate", "bytecode", pos);
- /* In the case of duplicate doc file entries,
- always take the later one. But if the doc is
- not an int (a string, say) leave it alone. */
- if (!INTP (old))
- goto weird;
- }
- set_compiled_function_documentation (f, offset);
- }
+ /* This may be a function or variable where we want
+ to make the file name available. */
+ set_compiled_function_documentation (f, offset);
}
else
{
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 src/fileio.c
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2322,7 +2322,7 @@
GENERIC_MAPPING genericMapping;
DWORD accessMask;
PRIVILEGE_SET PrivilegeSet;
- DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET );
+ DWORD dwPrivSetSize = sizeof ( PRIVILEGE_SET );
BOOL fAccessGranted = FALSE;
DWORD dwAccessAllowed;
Extbyte *fnameext;
@@ -2330,48 +2330,57 @@
LOCAL_FILE_FORMAT_TO_TSTR (filename, fnameext);
// First check for a normal file with the old-style readonly bit
- attributes = qxeGetFileAttributes(fnameext);
- if (FILE_ATTRIBUTE_READONLY == (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY)))
+ attributes = qxeGetFileAttributes (fnameext);
+ if (FILE_ATTRIBUTE_READONLY ==
+ (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY)))
return 0;
/* Win32 prototype lacks const. */
- error = qxeGetNamedSecurityInfo(fnameext, SE_FILE_OBJECT,
- DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION,
- &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc);
- if(error != ERROR_SUCCESS) { // FAT?
- attributes = qxeGetFileAttributes(fnameext);
- return (attributes & FILE_ATTRIBUTE_DIRECTORY) || (0 == (attributes & FILE_ATTRIBUTE_READONLY));
- }
+ error = qxeGetNamedSecurityInfo (fnameext, SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION|
+ GROUP_SECURITY_INFORMATION|
+ OWNER_SECURITY_INFORMATION,
+ &psidOwner, &psidGroup, &pDacl, &pSacl,
+ &pDesc);
+ if (error != ERROR_SUCCESS)
+ { // FAT?
+ attributes = qxeGetFileAttributes (fnameext);
+ return (attributes & FILE_ATTRIBUTE_DIRECTORY) ||
+ (0 == (attributes & FILE_ATTRIBUTE_READONLY));
+ }
genericMapping.GenericRead = FILE_GENERIC_READ;
genericMapping.GenericWrite = FILE_GENERIC_WRITE;
genericMapping.GenericExecute = FILE_GENERIC_EXECUTE;
genericMapping.GenericAll = FILE_ALL_ACCESS;
- if(!ImpersonateSelf(SecurityDelegation)) {
- return 0;
- }
- if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &tokenHandle)) {
- return 0;
- }
+ if (!ImpersonateSelf (SecurityDelegation))
+ {
+ return 0;
+ }
+ if (!OpenThreadToken (GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE,
+ &tokenHandle))
+ {
+ return 0;
+ }
accessMask = GENERIC_WRITE;
- MapGenericMask(&accessMask, &genericMapping);
-
- if(!AccessCheck(pDesc, tokenHandle, accessMask, &genericMapping,
+ MapGenericMask (&accessMask, &genericMapping);
+
+ if (!AccessCheck(pDesc, tokenHandle, accessMask, &genericMapping,
&PrivilegeSet, // receives privileges used in check
&dwPrivSetSize, // size of PrivilegeSet buffer
&dwAccessAllowed, // receives mask of allowed access rights
&fAccessGranted))
{
- CloseHandle(tokenHandle);
+ CloseHandle (tokenHandle);
RevertToSelf();
- LocalFree(pDesc);
+ LocalFree (pDesc);
return 0;
}
- CloseHandle(tokenHandle);
+ CloseHandle (tokenHandle);
RevertToSelf();
- LocalFree(pDesc);
+ LocalFree (pDesc);
return fAccessGranted == TRUE;
#elif defined (HAVE_EACCESS)
return (qxe_eaccess (filename, W_OK) >= 0);
@@ -2959,7 +2968,7 @@
RETURN_UNGCPRO
(Fsignal (Qfile_error,
- list2 (build_msg_string("not a regular file"),
+ list2 (build_msg_string ("not a regular file"),
filename)));
}
}
@@ -4261,7 +4270,7 @@
auto_saved++;
/* Handler killed their own buffer! */
- if (!BUFFER_LIVE_P(b))
+ if (!BUFFER_LIVE_P (b))
continue;
b->auto_save_modified = BUF_MODIFF (b);
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 src/fontcolor-xlike-inc.c
--- a/src/fontcolor-xlike-inc.c
+++ b/src/fontcolor-xlike-inc.c
@@ -34,53 +34,64 @@
#include "console-xlike-inc.h"
-#define DEBUG_FONTS1(format, arg) \
+#ifdef DEBUG_XEMACS
+# define DEBUG_FONTS1(format, arg) \
do { \
if (debug_x_fonts) \
debug_out (format, arg); \
} while (0)
-#define DEBUG_FONTS2(format, arg1, arg2) \
+# define DEBUG_FONTS2(format, arg1, arg2) \
do { \
if (debug_x_fonts) \
debug_out (format, arg1, arg2); \
} while (0)
-#define DEBUG_FONTS3(format, arg1, arg2, arg3) \
+# define DEBUG_FONTS3(format, arg1, arg2, arg3) \
do { \
if (debug_x_fonts) \
debug_out (format, arg1, arg2, arg3); \
} while (0)
-#define DEBUG_FONTS4(format, arg1, arg2, arg3, arg4) \
+# define DEBUG_FONTS4(format, arg1, arg2, arg3, arg4) \
do { \
if (debug_x_fonts) \
debug_out (format, arg1, arg2, arg3, arg4); \
} while (0)
-#define DEBUG_FONTS_LISP1(format, arg) \
+# define DEBUG_FONTS_LISP1(format, arg) \
do { \
if (debug_x_fonts) \
debug_out_lisp (format, 1, arg); \
} while (0)
-#define DEBUG_FONTS_LISP2(format, arg1, arg2) \
+# define DEBUG_FONTS_LISP2(format, arg1, arg2) \
do { \
if (debug_x_fonts) \
debug_out_lisp (format, 2, arg1, arg2); \
} while (0)
-#define DEBUG_FONTS_LISP3(format, arg1, arg2, arg3) \
+# define DEBUG_FONTS_LISP3(format, arg1, arg2, arg3) \
do { \
if (debug_x_fonts) \
debug_out_lisp (format, 3, arg1, arg2, arg3); \
} while (0)
-#define DEBUG_FONTS_LISP4(format, arg1, arg2, arg3, arg4) \
+# define DEBUG_FONTS_LISP4(format, arg1, arg2, arg3, arg4) \
do { \
if (debug_x_fonts) \
debug_out_lisp (format, 4, arg1, arg2, arg3, arg4); \
} while (0)
+#else /* not DEBUG_XEMACS */
+# define DEBUG_FONTS1(format, arg)
+# define DEBUG_FONTS2(format, arg1, arg2)
+# define DEBUG_FONTS3(format, arg1, arg2, arg3)
+# define DEBUG_FONTS4(format, arg1, arg2, arg3, arg4)
+# define DEBUG_FONTS_LISP1(format, arg)
+# define DEBUG_FONTS_LISP2(format, arg1, arg2)
+# define DEBUG_FONTS_LISP3(format, arg1, arg2, arg3)
+# define DEBUG_FONTS_LISP4(format, arg1, arg2, arg3, arg4)
+#endif
#ifdef MULE
diff -r c08663a648da0931bdc232b681efbfb9c14d8d83 -r 4a6723a89edf55732f2fa5189409d85acae3d798 src/lisp.h
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1442,6 +1442,16 @@
memcpy (*_bsta_, _bsta_2, 1 + _bsta_3); \
} while (0)
+/* Make an alloca'd copy of a Extbyte * */
+#define EXTBYTE_STRING_TO_ALLOCA(p, lval) \
+do { \
+ Extbyte **_esta_ = (Extbyte **) &(lval); \
+ const Extbyte *_esta_2 = (p); \
+ Bytecount _esta_3 = strlen (_esta_2); \
+ *_esta_ = alloca_extbytes (1 + _esta_3); \
+ memcpy (*_esta_, _esta_2, 1 + _esta_3); \
+} while (0)
+
/* ----------------- convenience functions for reallocation --------------- */
#define XREALLOC_ARRAY(ptr, type, len) \
This diff is so big that we needed to truncate the remainder.
https://bitbucket.org/xemacs/xemacs/commits/37634997b004/
Changeset: 37634997b004
User: jsparkes
Date: 2010-04-24 23:57:45+00:00
Summary: * device-gtk.c (gtk_event_name):
Return event name as "EventXX" until I figure out event name lookup.
(Fgtk_style_info):
Leave font name out for now.
Affected #: 2 files
diff -r e21761df3a5fabaa10a9d38f6fdff1caec85488b -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,23 @@
+2010-04-24 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * device-gtk.c (gtk_event_name):
+ Return event name as "EventXX" until I figure out event name lookup.
+ (Fgtk_style_info):
+ Leave font name out for now.
+
+ * ui-gtk.c (import_gtk_enumeration_internal):
+ Convert to GObject.
+ (type_already_imported_p):
+ Use Gtk 2.X constants.
+ (import_gtk_flags_internal):
+ Create.
+ (import_gtk_type):
+ Flags and enumerations are implemented separately now.
+ (import_gtk_object_internal):
+ Update to use GObject.
+ (__allocate_object_storage):
+ Use g_type_query and instance_size.
+
2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
* glyphs-gtk.c (gtk_add_tab_item):
diff -r e21761df3a5fabaa10a9d38f6fdff1caec85488b -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -399,6 +399,7 @@
const char *
gtk_event_name (GdkEventType event_type)
{
+#if 0
GtkEnumValue *vals = gtk_type_enum_get_values (GTK_TYPE_GDK_EVENT_TYPE);
while (vals && ((GdkEventType)(vals->value) != event_type)) vals++;
@@ -407,6 +408,12 @@
return (vals->value_nick);
return (NULL);
+
+#else
+ char *name = (char *)xmalloc_and_zero (10);
+ sprintf (name, "%s%02d", name, event_type);
+ return name;
+#endif
}
@@ -666,7 +673,8 @@
FROB_COLOR (base, "base");
#undef FROB_COLOR
- result = nconc2 (result, list2 (Qfont, convert_font (style->font)));
+ // --jsparkes
+ // result = nconc2 (result, list2 (Qfont, convert_font (style->font)));
#define FROB_PIXMAP(state) (style->rc_style->bg_pixmap_name[state] ? build_cistring (style->rc_style->bg_pixmap_name[state]) : Qnil)
https://bitbucket.org/xemacs/xemacs/commits/5cf0022df9e3/
Changeset: 5cf0022df9e3
Branch: compiles
User: jsparkes
Date: 2010-05-01 22:47:11+00:00
Summary: It COMPILES!
Change over from 1.2 GtkType to 2.X GObject base.
No widgets, scrollbar etc.
Dumps to xemacs.
Lots of omitted code surrounded by "#ifdef JSPARKES"
Affected #: 35 files
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,83 +1,109 @@
-2010-04-24 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * device-gtk.c (gtk_event_name):
- Return event name as "EventXX" until I figure out event name lookup.
- (Fgtk_style_info):
- Leave font name out for now.
-
- * ui-gtk.c (import_gtk_enumeration_internal):
- Convert to GObject.
- (type_already_imported_p):
- Use Gtk 2.X constants.
- (import_gtk_flags_internal):
- Create.
- (import_gtk_type):
- Flags and enumerations are implemented separately now.
- (import_gtk_object_internal):
- Update to use GObject.
- (__allocate_object_storage):
- Use g_type_query and instance_size.
-
-2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * glyphs-gtk.c (gtk_add_tab_item):
- Use GINT_TO_POINTER.
-
- * frame-gtk.c (gtk_init_frame_1):
- Use GINT_TO_POINTER.
-
- * event-gtk.c (emacs_gtk_add_timeout):
- Use GPOINTER_TO_INT.
-
- * glyphs-gtk.c (convert_EImage_to_GDKImage):
- (convert_EImage_to_GDKImage):
- Use G_BIG_ENDIAN instead of WORDS_BIGENDIAN.
-
-2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * redisplay-gtk.c (XLIKE_bevel_area):
- Cast GtkShadowStyle to edge_style for C++ compile.
- (our_draw_bitmap):
- Implement using GDK, not XLib.
-
- * fontcolor-gtk.c (gtk_color_instance_hash):
- Update hash function to match usage in fontcolor-x.c.
-
- * event-gtk.c (handle_focus_event_1):
- Extend X focus timestamp klduge to Gtk.
-
- * console-xlike-inc.h:
- Fix GET_XLIKE_DISPLAY for gtk.
-
- * frame-gtk.c (gtk_create_widgets):
- Declare array const to avoid C++ warning.
- (get_number, gnome_parse_geometry):
- Re-enable local geometry parsing temporarily.
-
- * config.h.in:
- Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
-
- * gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
- Slider width is now in GtkStyle instance, not class.
-
- * device-gtk.c (gtk_delete_device):
- NEW_GC doesn't allow/require freeing device directly.
-
-2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * fontcolor-gtk.c (gtk_color_instance_hash):
- Remove gtk_color_instance_hash equalp argument.
-
- * gtk-glue.c (xemacs_type_register):
- Change arg to const to avoid C++ warning.
-
- * gtk-xemacs.c (gtk_xemacs_get_type):
- Cast to avoid C++ const warning.
-
- * frame-gtk.c (gtk_initialize_frame_size):
- Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
- Use gtk geometry functions.
- Include gutter.h for frame size calculations.
+2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doc.c (Fdocumentation):
+ If we have a zero length doc string in DOC, as may happen for
+ undocumented compiled function objects which nonetheless have file
+ information stored, return nil.
+ (Fsnarf_documentation):
+ DOC info existing for compiled functions without docstrings is
+ perfectly legitimate, now the file is also used to store file names.
+ * bytecode.c (set_compiled_function_documentation):
+ Allow this function to set the documentation successfully for
+ compiled function objects that don't currently have documentation;
+ most relevant for functions without docstrings which have file
+ information stored in DOC.
+
+2010-04-15 Ben Wing <ben(a)xemacs.org>
+
+ * device-x.c (x_init_device):
+ Don't declare something const if we're going to modify it.
+ Clean up code to follow GNU coding standards.
+
+2010-04-12 Ben Wing <ben(a)xemacs.org>
+
+ * specifier.c (specifier_memory_usage):
+ Disable specifier memory-usage stats for now. Sometimes they can
+ end up with circularities in them and I'm not sure exactly whats
+ going on to produce them.
+
+2010-04-12 Ben Wing <ben(a)xemacs.org>
+
+ * charset.h:
+ * lisp.h:
+ * lisp.h (XREALLOC_ARRAY):
+ * text.h:
+ Port charset_codepoint_to_itext(), buffer_itext_to_charset_codepoint(),
+ EXTBYTE_STRING_TO_ALLOCA(), `enum converr' from ben-unicode-internal,
+ for use with the mule-wnnfns.c changes.
+
+ * mule-wnnfns.c:
+ * mule-wnnfns.c (Fwnn_open):
+ * mule-wnnfns.c (Fwnn_dict_add):
+ * mule-wnnfns.c (Fwnn_dict_list):
+ * mule-wnnfns.c (Fwnn_get_zenkouho):
+ * mule-wnnfns.c (Fwnn_inspect):
+ * mule-wnnfns.c (Fwnn_bunsetu_kanji):
+ * mule-wnnfns.c (Fwnn_bunsetu_yomi):
+ * mule-wnnfns.c (Fwnn_word_info):
+ * mule-wnnfns.c (Fwnn_dict_search):
+ * mule-wnnfns.c (Fwnn_get_msg):
+ * mule-wnnfns.c (Fwnn_fuzokugo_set):
+ * mule-wnnfns.c (Fwnn_fuzokugo_get):
+ * mule-wnnfns.c (Fwnn_hinsi_list):
+ * mule-wnnfns.c (Fwnn_fisys_dict_add):
+ * mule-wnnfns.c (Fwnn_fiusr_dict_add):
+ * mule-wnnfns.c (Fwnn_notrans_dict_add):
+ * mule-wnnfns.c (Fwnn_bmodify_dict_add):
+ * mule-wnnfns.c (reinit_vars_of_mule_wnn):
+ * mule-wnnfns.c (vars_of_mule_wnn):
+ * mule-wnnfns.c (w2m):
+ * mule-wnnfns.c (m2w):
+ * mule-wnnfns.c (yes_or_no):
+ * mule-wnnfns.c (puts2):
+ * mule-wnnfns.c (check_wnn_server_type):
+ Mule-ize, borrowed from ben-unicode-internal.
+
+2010-04-09 Ben Wing <ben(a)xemacs.org>
+
+ * fileio.c (check_writable):
+ * fileio.c (Fdo_auto_save):
+ * redisplay-xlike-inc.c (separate_textual_runs_nomule):
+ * redisplay-xlike-inc.c (separate_textual_runs_xft_nomule):
+ * redisplay-xlike-inc.c (separate_textual_runs_xft_mule):
+ * redisplay-xlike-inc.c (separate_textual_runs_mule):
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ * redisplay-xlike-inc.c (XLIKE_output_vertical_divider):
+ * redisplay.c (create_text_block):
+ * redisplay.c (regenerate_window):
+ * redisplay.c (redisplay_window):
+ * redisplay.c (redisplay_device):
+ * redisplay.c (window_line_number):
+ * redisplay.c (point_would_be_visible):
+ * redisplay.c (compute_display_line_dynarr_usage):
+ * specifier.c (prune_specifiers):
+ * specifier.c (finalize_specifier):
+ * specifier.c (make_magic_specifier):
+ * specifier.c (charset_matches_specifier_tag_set_p):
+ * specifier.c (Fdefine_specifier_tag):
+ * specifier.c (setup_device_initial_specifier_tags):
+ * specifier.c (bodily_specifier):
+ * specifier.c (add_spec_to_ghost_specifier):
+ * specifier.c (remove_ghost_specifier):
+ * specifier.c (set_specifier_fallback):
+ * specifier.c (specifier_instance_from_inst_list):
+ * specifier.c (set_specifier_caching):
+ Fix coding style to correspond to GNU standard.
+
+2010-04-09 Didier Verna <didier(a)xemacs.org>
+
+ * fontcolor-xlike-inc.c (DEBUG_FONTS2):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS3):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS4):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP1):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP2):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP3):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP4): Conditionalize
+ definitions on DEBUG_XEMACS, provide empty definitions otherwise.
2010-04-06 Ben Wing <ben(a)xemacs.org>
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,71 @@
+2010-04-26 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * ui-gtk.c (emacs_gtk_object_getprop):
+ Started conversion to 2.X.
+ (Fgtk_describe_type):
+ Converted to 2.X.
+
+ * config.h.in:
+ We don't need WORDS_BIGENDIAN.
+
+ * glyphs-gtk.c (convert_EImage_to_GDKImage):
+ Use G_BIG_ENDIAN instead of WORDS_BIGENDIAN
+ (convert_EImage_to_GDKImage):
+ Ditto.
+
+2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * gtk-xemacs.c (gtk_xemacs_class_init):
+ Don't use gtk_xemacs_draw.
+ (smash_scrollbar_specifiers):
+ Use fixed slider width for now.
+
+2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (XLIKE_bevel_area):
+ Cast GtkShadowStyle to edge_style for C++ compile.
+ (our_draw_bitmap):
+ Implement using GDK, not XLib.
+
+ * fontcolor-gtk.c (gtk_color_instance_hash):
+ Update hash function to match usage in fontcolor-x.c.
+
+ * event-gtk.c (handle_focus_event_1):
+ Extend X focus timestamp klduge to Gtk.
+
+ * console-xlike-inc.h:
+ Fix GET_XLIKE_DISPLAY for gtk.
+
+ * frame-gtk.c (gtk_create_widgets):
+ Declare array const to avoid C++ warning.
+ (get_number, gnome_parse_geometry):
+ Re-enable local geometry parsing temporarily.
+
+ * config.h.in:
+ Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
+
+ * gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
+ Slider width is now in GtkStyle instance, not class.
+
+ * device-gtk.c (gtk_delete_device):
+ NEW_GC doesn't allow/require freeing device directly.
+
+2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * fontcolor-gtk.c (gtk_color_instance_hash):
+ Remove gtk_color_instance_hash equalp argument.
+
+ * gtk-glue.c (xemacs_type_register):
+ Change arg to const to avoid C++ warning.
+
+ * gtk-xemacs.c (gtk_xemacs_get_type):
+ Cast to avoid C++ const warning.
+
+ * frame-gtk.c (gtk_initialize_frame_size):
+ Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
+ Use gtk geometry functions.
+ Include gutter.h for frame size calculations.
+
2000-10-03 William M. Perry <wmperry(a)aventail.com>
* objects-gtk.c (gtk_font_instance_truename): Make sure we get the
@@ -286,7 +354,8 @@
* ui-gtk.c (lisp_to_gtk_type): Know how to deal with
GTK_TYPE_GDK_GC.
- * gtk-glue.c: Need to defien a GTK type for GdkGC so that we can
+ * gtk-glue.c: Need to defien a GTK type for
+ GdkGC so that we can
import all the GDK drawing primitives.
(face_to_gc): New function to convert a face object to a GC.
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/bytecode.c
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -2562,22 +2562,36 @@
#endif
-/* used only by Snarf-documentation; there must be doc already. */
+/* used only by Snarf-documentation. */
void
set_compiled_function_documentation (Lisp_Compiled_Function *f,
Lisp_Object new_doc)
{
- assert (f->flags.documentationp);
assert (INTP (new_doc) || STRINGP (new_doc));
- if (f->flags.interactivep && f->flags.domainp)
- XCAR (f->doc_and_interactive) = new_doc;
- else if (f->flags.interactivep)
- XCAR (f->doc_and_interactive) = new_doc;
- else if (f->flags.domainp)
- XCAR (f->doc_and_interactive) = new_doc;
+ if (f->flags.documentationp)
+ {
+ if (f->flags.interactivep && f->flags.domainp)
+ XCAR (f->doc_and_interactive) = new_doc;
+ else if (f->flags.interactivep)
+ XCAR (f->doc_and_interactive) = new_doc;
+ else if (f->flags.domainp)
+ XCAR (f->doc_and_interactive) = new_doc;
+ else
+ f->doc_and_interactive = new_doc;
+ }
else
- f->doc_and_interactive = new_doc;
+ {
+ f->flags.documentationp = 1;
+ if (f->flags.interactivep || f->flags.domainp)
+ {
+ f->doc_and_interactive = Fcons (new_doc, f->doc_and_interactive);
+ }
+ else
+ {
+ f->doc_and_interactive = new_doc;
+ }
+ }
}
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/charset.h
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,7 +1,7 @@
/* Header for charsets.
Copyright (C) 1992, 1995 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 2001, 2002 Ben Wing.
+ Copyright (C) 2001, 2002, 2010 Ben Wing.
This file is part of XEmacs.
@@ -555,6 +555,46 @@
#define BREAKUP_ICHAR(c, charset, c1, c2) \
breakup_ichar_1 (c, &(charset), &(c1), &(c2))
+/* Forward compatibility from ben-unicode-internal: Convert a charset
+ codepoint into a character in the internal string representation.
+ Return number of bytes written out. FAIL controls failure mode when
+ charset conversion to Unicode is not possible (unused as of yet). */
+DECLARE_INLINE_HEADER (
+Bytecount
+charset_codepoint_to_itext (Lisp_Object charset, int c1, int c2, Ibyte *ptr,
+ enum converr UNUSED (fail))
+)
+{
+ Ichar ch;
+
+ if (EQ (charset, Vcharset_ascii))
+ {
+ ptr[0] = (Ibyte) c2;
+ return 1;
+ }
+
+ ch = make_ichar (charset, c1, c2);
+
+ /* We can't rely on the converted character being non-ASCII. For
+ example, JISX0208 codepoint (33, 64) == Unicode 0x5C (ASCII
+ backslash). */
+ return set_itext_ichar (ptr, ch);
+}
+
+/* Forward compatibility from ben-unicode-internal */
+
+DECLARE_INLINE_HEADER (
+void
+buffer_itext_to_charset_codepoint (const Ibyte *ptr,
+ struct buffer *UNUSED (buf),
+ Lisp_Object *charset, int *c1, int *c2,
+ enum converr UNUSED (fail))
+)
+{
+ Ichar ch = itext_ichar (ptr);
+ breakup_ichar_1 (ch, charset, c1, c2);
+}
+
void get_charset_limits (Lisp_Object charset, int *low, int *high);
int ichar_to_unicode (Ichar chr);
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/config.h.in
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -319,7 +319,7 @@
#undef STDC_HEADERS
#undef TIME_WITH_SYS_TIME
-#undef WORDS_BIGENDIAN
+/* #undef WORDS_BIGENDIAN */
#undef HAVE_LONG_FILE_NAMES
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/console-gtk.h
--- a/src/console-gtk.h
+++ b/src/console-gtk.h
@@ -66,7 +66,8 @@
int cursor_height);
GdkGC *gtk_get_gc (struct frame *f,
Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
- Lisp_Object bg_pmap, Lisp_Object lwidth);
+ Lisp_Object bg_pmap, Lisp_Object bg_placement,
+ Lisp_Object lwidth);
int gtk_initialize_frame_menubar (struct frame *f);
void gtk_init_modifier_mapping (struct device *d);
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/console-xlike-inc.h
--- a/src/console-xlike-inc.h
+++ b/src/console-xlike-inc.h
@@ -274,7 +274,6 @@
/* functions */
/* Avoid unused-variable warning involving D */
-//#define GET_XLIKE_DISPLAY(d) (USED (d), NULL)
#define GET_XLIKE_DISPLAY(d) (d)
#define GET_XLIKE_X_DISPLAY(d) (USED (d), GDK_DISPLAY ())
#define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w))
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -399,21 +399,15 @@
const char *
gtk_event_name (GdkEventType event_type)
{
-#if 0
- GtkEnumValue *vals = gtk_type_enum_get_values (GTK_TYPE_GDK_EVENT_TYPE);
+ //GtkEnumValue *vals = gtk_type_enum_get_values (GTK_TYPE_GDK_EVENT_TYPE);
- while (vals && ((GdkEventType)(vals->value) != event_type)) vals++;
-
- if (vals)
- return (vals->value_nick);
+ //while (vals && ((GdkEventType)(vals->value) != event_type)) vals++;
- return (NULL);
+ //if (vals)
+ //return (vals->value_nick);
-#else
- char *name = (char *)xmalloc_and_zero (10);
- sprintf (name, "%s%02d", name, event_type);
- return name;
-#endif
+ //return (NULL);
+ return "GdkEvent";
}
@@ -673,8 +667,8 @@
FROB_COLOR (base, "base");
#undef FROB_COLOR
- // --jsparkes
- // result = nconc2 (result, list2 (Qfont, convert_font (style->font)));
+ result = nconc2 (result, list2 (Qfont,
+ convert_font (gtk_style_get_font (style))));
#define FROB_PIXMAP(state) (style->rc_style->bg_pixmap_name[state] ? build_cistring (style->rc_style->bg_pixmap_name[state]) : Qnil)
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/device-x.c
--- a/src/device-x.c
+++ b/src/device-x.c
@@ -689,7 +689,7 @@
Extbyte *path;
const Extbyte *format;
XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */
- const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
+ Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
Extbyte *locale_end;
if (STRINGP (Vx_app_defaults_directory) &&
@@ -720,28 +720,26 @@
if (!access (path, R_OK))
XrmCombineFileDatabase (path, &db, False);
- if ((locale_end = strchr(locale, '.'))) {
- *locale_end = '\0';
- sprintf (path, format, data_dir, locale);
+ if ((locale_end = strchr (locale, '.')))
+ {
+ *locale_end = '\0';
+ sprintf (path, format, data_dir, locale);
- if (!access (path, R_OK))
- XrmCombineFileDatabase (path, &db, False);
- }
+ if (!access (path, R_OK))
+ XrmCombineFileDatabase (path, &db, False);
+ }
- if ((locale_end = strchr(locale, '_'))) {
- *locale_end = '\0';
- sprintf (path, format, data_dir, locale);
+ if ((locale_end = strchr (locale, '_')))
+ {
+ *locale_end = '\0';
+ sprintf (path, format, data_dir, locale);
- if (!access (path, R_OK))
- XrmCombineFileDatabase (path, &db, False);
- }
+ if (!access (path, R_OK))
+ XrmCombineFileDatabase (path, &db, False);
+ }
no_data_directory:
- {
- /* Cast off const for G++ 4.3. */
- Extbyte *temp = (Extbyte *) locale;
- xfree (temp);
- }
+ xfree (locale);
}
#endif /* MULE */
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 src/doc.c
--- a/src/doc.c
+++ b/src/doc.c
@@ -613,7 +613,15 @@
if (STRINGP (tem))
doc = tem;
else if (NATNUMP (tem) || CONSP (tem))
- doc = get_doc_string (tem);
+ {
+ doc = get_doc_string (tem);
+ /* We may have zero length strings in the docfile for file
+ information. */
+ if (STRINGP (doc) && 0 == XSTRING_LENGTH (doc))
+ {
+ return Qnil;
+ }
+ }
else
return Qnil;
}
@@ -903,33 +911,24 @@
slots for it. */
Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
- /* This compiled-function object must have a
- slot for the docstring, since we've found a
- docstring for it. Unless there were multiple
- definitions of it, and the latter one didn't
- have any doc, which is a legal if slightly
- bogus situation, so don't blow up. */
+ /* If there were multiple definitions for this function,
+ and the latter one didn't
+ have any doc, warn and don't blow up. */
+ Lisp_Object old =
+ compiled_function_documentation (f);
+ if (!ZEROP (old) && !NILP (old))
+ {
+ weird_doc (sym, "duplicate", "bytecode", pos);
+ /* In the case of duplicate doc file entries,
+ always take the later one. But if the doc is
+ not an int (a string, say) leave it alone. */
+ if (!INTP (old))
+ goto weird;
+ }
- if (! (f->flags.documentationp))
- {
- weird_doc (sym, "no doc slot", "bytecode", pos);
- goto weird;
- }
- else
- {
- Lisp_Object old =
- compiled_function_documentation (f);
- if (!ZEROP (old))
- {
- weird_doc (sym, "duplicate", "bytecode", pos);
- /* In the case of duplicate doc file entries,
- always take the later one. But if the doc is
- not an int (a string, say) leave it alone. */
- if (!INTP (old))
- goto weird;
- }
- set_compiled_function_documentation (f, offset);
- }
+ /* This may be a function or variable where we want
+ to make the file name available. */
+ set_compiled_function_documentation (f, offset);
}
else
{
This diff is so big that we needed to truncate the remainder.
https://bitbucket.org/xemacs/xemacs/commits/d932f2259a01/
Changeset: d932f2259a01
Branch: compiles
User: jsparkes
Date: 2010-05-01 23:26:00+00:00
Summary: Implement check_pointer_size for cursor using gdk maximal cursor size.
Affected #: 1 file
diff -r 5cf0022df9e3f8e8a58c0c0038fac06019de78b8 -r d932f2259a01bdd19314256e83cb977d7665f544 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -628,24 +628,17 @@
message. */
static void
-check_pointer_sizes (unsigned int UNUSED (width), unsigned int UNUSED (height),
- Lisp_Object UNUSED (instantiator))
+check_pointer_sizes (GdkDisplay *display, guint width, guint height,
+ Lisp_Object instantiator)
{
- /* #### BILL!!! There is no way to call XQueryBestCursor from Gdk! */
-#if 0
- unsigned int best_width, best_height;
- if (! XQueryBestCursor (DisplayOfScreen (xs), RootWindowOfScreen (xs),
- width, height, &best_width, &best_height))
- /* this means that an X error of some sort occurred (we trap
- these so they're not fatal). */
- gui_error ("XQueryBestCursor() failed?", instantiator);
-
- if (width > best_width || height > best_height)
+ guint max_width, max_height;
+ gdk_display_get_maximal_cursor_size (display, &max_width, &max_height);
+
+ if (width > max_width || height > max_height)
signal_ferror_with_frob (Qgui_error, instantiator,
"pointer too large (%dx%d): "
"server requires %dx%d or smaller",
- width, height, best_width, best_height);
-#endif
+ width, height, max_width, max_height);
}
static void
@@ -718,6 +711,7 @@
GdkPixmap *pixmap = IMAGE_INSTANCE_GTK_PIXMAP (ii);
GdkPixmap *mask = (GdkPixmap *) IMAGE_INSTANCE_GTK_MASK (ii);
GdkColor fg, bg;
+ GdkDisplay *disp;
int xhot = 0, yhot = 0;
int w, h;
@@ -728,7 +722,8 @@
w = IMAGE_INSTANCE_PIXMAP_WIDTH (ii);
h = IMAGE_INSTANCE_PIXMAP_HEIGHT (ii);
- check_pointer_sizes (w, h, instantiator);
+ disp = gdk_drawable_get_display (pixmap);
+ check_pointer_sizes (disp, w, h, instantiator);
/* If the loaded pixmap has colors allocated (meaning it came from an
XPM file), then use those as the default colors for the cursor we
@@ -1071,8 +1066,8 @@
GdkColor fg_color, bg_color;
GdkPixmap *source;
- check_pointer_sizes (width, height, instantiator);
-
+ check_pointer_sizes (gdk_drawable_get_display (mask), width, height,
+ instantiator);
source = gdk_pixmap_create_from_data (draw, (char *) bits, width, height, 1, &black, &white);
if (NILP (foreground))
https://bitbucket.org/xemacs/xemacs/commits/819bc21020a5/
Changeset: 819bc21020a5
Branch: compiles
User: jsparkes
Date: 2010-05-03 11:04:24+00:00
Summary: Pretend that the cursors are initialized.
Turn off when XPM code is working.
Affected #: 1 file
diff -r d932f2259a01bdd19314256e83cb977d7665f544 -r 819bc21020a5e43a68af5eefc8b105ce9f3413c0 lisp/gtk-mouse.el
--- a/lisp/gtk-mouse.el
+++ b/lisp/gtk-mouse.el
@@ -35,6 +35,7 @@
(defvar gtk-pointers-initialized nil)
(defun gtk-init-pointers ()
+ (setq gtk-pointers-initialized t) ;; --jsparkes
(if gtk-pointers-initialized
nil
(set-glyph-image text-pointer-glyph
https://bitbucket.org/xemacs/xemacs/commits/938c07db9235/
Changeset: 938c07db9235
Branch: compiles
User: jsparkes
Date: 2010-05-03 11:05:41+00:00
Summary: Create initial list of cursor indexes. (Indices)
Affected #: 1 file
diff -r 819bc21020a5e43a68af5eefc8b105ce9f3413c0 -r 938c07db923551157abd04ea0ff1e5d6d03fda26 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -156,7 +156,7 @@
#endif
#ifdef HAVE_GTK
-Lisp_Object Vgtk_cursor_names;
+Lisp_Object Vgtk_cursors;
#endif
@@ -599,30 +599,6 @@
/* cursor functions */
/************************************************************************/
-#ifdef HAVE_GTK
-/*
- * Cursor names are stored a list, since they are retrieved by name.
- * The first one is default. We initialize a few useful ones here,
- * the rest are done in lisp.
- */
-static void
-check_cursor_names ()
-{
- if (NILP (Vgtk_cursor_names))
- {
- Lisp_Object names = Qnil;
- Vgtk_cursor_names = call2 (intern ("make-hashtable"),
- make_int (101), Qequal);
- names = Fcons (build_ascstring ("x-cursor"), names);
- names = Fcons (build_ascstring ("arrow"), names);
- names = Fcons (build_ascstring ("dot"), names);
- names = Fcons (build_ascstring ("xterm"), names);
-
- Vgtk_cursor_names = Fnreverse (names);
- }
-}
-#endif
-
/* Check that this server supports cursors of size WIDTH * HEIGHT. If
not, signal an error. INSTANTIATOR is only used in the error
message. */
@@ -675,6 +651,9 @@
Lisp_Object UNUSED (foreground),
Lisp_Object UNUSED (background))
{
+ /* We can get the cursor as a GdkPixBuf using gdk_cursor_get_image().
+ and maybe edit the data. Maybe gdk_pixdata_from_pixbuf()?
+ --jsparkes */
#if 0
/* #### BILL!!! */
Lisp_Object device = XIMAGE_INSTANCE_DEVICE (image_instance);
@@ -833,13 +812,54 @@
pointer_bg);
}
-#if 0
+
void init_image_instance_from_gdk_pixmap (struct Lisp_Image_Instance *ii,
struct device *device,
GdkPixmap *gdk_pixmap,
int dest_mask,
Lisp_Object instantiator)
{
+ {
+ Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
+ enum image_instance_type type;
+ gint x, y;
+
+ if (!DEVICE_GTK_P (XDEVICE (device)))
+ gui_error ("Not a Gtk device", device);
+
+ gdk_drawable_get_size (gdk_pixmap, &x, &y);
+
+ if (dest_mask & IMAGE_COLOR_PIXMAP_MASK)
+ type = IMAGE_COLOR_PIXMAP;
+ else if (dest_mask & IMAGE_POINTER_MASK)
+ type = IMAGE_POINTER;
+ else
+ incompatible_image_types (instantiator, dest_mask,
+ IMAGE_COLOR_PIXMAP_MASK
+ | IMAGE_POINTER_MASK);
+
+ //gtk_initialize_pixmap_image_instance (ii, slices, IMAGE_COLOR_PIXMAP);
+
+ IMAGE_INSTANCE_PIXMAP_FILENAME (ii) =
+ find_keyword_in_vector (instantiator, Q_file);
+
+ IMAGE_INSTANCE_GTK_PIXMAP (ii) = gdk_pixmap;
+ IMAGE_INSTANCE_PIXMAP_MASK (ii) = 0;
+ IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = x;
+ IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = y;
+ IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = gdk_drawable_get_depth (gdk_pixmap);
+ IMAGE_INSTANCE_GTK_COLORMAP (ii) = gdk_drawable_get_colormap (gdk_pixmap);
+ // IMAGE_INSTANCE_GTK_PIXELS (ii) = pixels;
+ IMAGE_INSTANCE_GTK_NPIXELS (ii) = x * y;
+
+#ifdef JSPARKES
+ if (type == IMAGE_POINTER)
+ image_instance_convert_to_pointer (ii, instantiator, pointer_fg,
+ pointer_bg);
+#endif
+ }
+
+#if 0
GdkWindow *d;
gint width, height, depth;
@@ -867,8 +887,8 @@
IMAGE_INSTANCE_GTK_COLORMAP (ii) = gdk_window_get_colormap (gdk_pixmap);
IMAGE_INSTANCE_GTK_PIXELS (ii) = 0;
IMAGE_INSTANCE_GTK_NPIXELS (ii) = 0;
+#endif
}
-#endif
static void
image_instance_add_gdk_image (Lisp_Image_Instance *ii,
@@ -1242,9 +1262,9 @@
Q_color_symbols);
enum image_instance_type type;
int force_mono;
- gint w, h;
+ gint w = 16, h = 16;
struct gcpro gcpro1, gcpro2, gcpro3;
- const Binbyte * volatile dstring;
+ const Extbyte * volatile dstring;
if (!DEVICE_GTK_P (XDEVICE (device)))
gui_error ("Not a Gtk device", device);
@@ -1277,8 +1297,6 @@
&nsymbols);
assert (!NILP (data));
- ABORT ();
-#if 0
dstring = LISP_STRING_TO_EXTERNAL (data, Qbinary);
/*
@@ -1330,7 +1348,7 @@
if (!pixmap)
signal_image_error ("Error reading pixmap", data);
- gdk_window_get_geometry (pixmap, NULL, NULL, &w, &h, &depth);
+ // gdk_window_get_geometry (pixmap, NULL, NULL, &w, &h, &depth);
IMAGE_INSTANCE_GTK_PIXMAP (ii) = pixmap;
IMAGE_INSTANCE_PIXMAP_MASK (ii) = mask;
@@ -1365,7 +1383,6 @@
default:
ABORT ();
}
-#endif
UNGCPRO;
}
#endif /* HAVE_XPM */
@@ -1492,11 +1509,12 @@
static guint resource_name_to_resource (Lisp_Object name,
enum image_instance_type type)
{
-#if 0
if (type == IMAGE_POINTER)
- return (symbol_to_gtk_enum (name, GTK_TYPE_GDK_CURSOR_TYPE));
+ {
+ stderr_out ("Lisp-level creation of widget failed... falling back\n");
+ //return (symbol_to_gtk_enum (name, GTK_TYPE_GDK_CURSOR_TYPE));
+ }
else
-#endif
return (0);
}
@@ -1870,72 +1888,64 @@
cursor_name_to_index (const char *name)
{
int i;
+ Lisp_Object elt;
+
//return gdk_cursor_new_from_name (name);
- return GDK_X_CURSOR;
-
- static char *the_gdk_cursors[GDK_LAST_CURSOR];
-
- if (!the_gdk_cursors[GDK_BASED_ARROW_UP])
- {
- /* Need to initialize the array */
- /* Supposedly since this array is static it should be
- initialized to NULLs for us, but I'm very paranoid. */
- for (i = 0; i <GDK_LAST_CURSOR; i++)
- {
- the_gdk_cursors[i] = NULL;
- }
-
-#define FROB_CURSOR(x) the_gdk_cursors[GDK_##x] = __downcase(#x)
- FROB_CURSOR(ARROW); FROB_CURSOR(BASED_ARROW_DOWN);
- FROB_CURSOR(BASED_ARROW_UP); FROB_CURSOR(BOAT);
- FROB_CURSOR(BOGOSITY); FROB_CURSOR(BOTTOM_LEFT_CORNER);
- FROB_CURSOR(BOTTOM_RIGHT_CORNER); FROB_CURSOR(BOTTOM_SIDE);
- FROB_CURSOR(BOTTOM_TEE); FROB_CURSOR(BOX_SPIRAL);
- FROB_CURSOR(CENTER_PTR); FROB_CURSOR(CIRCLE);
- FROB_CURSOR(CLOCK); FROB_CURSOR(COFFEE_MUG);
- FROB_CURSOR(CROSS); FROB_CURSOR(CROSS_REVERSE);
- FROB_CURSOR(CROSSHAIR); FROB_CURSOR(DIAMOND_CROSS);
- FROB_CURSOR(DOT); FROB_CURSOR(DOTBOX);
- FROB_CURSOR(DOUBLE_ARROW); FROB_CURSOR(DRAFT_LARGE);
- FROB_CURSOR(DRAFT_SMALL); FROB_CURSOR(DRAPED_BOX);
- FROB_CURSOR(EXCHANGE); FROB_CURSOR(FLEUR);
- FROB_CURSOR(GOBBLER); FROB_CURSOR(GUMBY);
- FROB_CURSOR(HAND1); FROB_CURSOR(HAND2);
- FROB_CURSOR(HEART); FROB_CURSOR(ICON);
- FROB_CURSOR(IRON_CROSS); FROB_CURSOR(LEFT_PTR);
- FROB_CURSOR(LEFT_SIDE); FROB_CURSOR(LEFT_TEE);
- FROB_CURSOR(LEFTBUTTON); FROB_CURSOR(LL_ANGLE);
- FROB_CURSOR(LR_ANGLE); FROB_CURSOR(MAN);
- FROB_CURSOR(MIDDLEBUTTON); FROB_CURSOR(MOUSE);
- FROB_CURSOR(PENCIL); FROB_CURSOR(PIRATE);
- FROB_CURSOR(PLUS); FROB_CURSOR(QUESTION_ARROW);
- FROB_CURSOR(RIGHT_PTR); FROB_CURSOR(RIGHT_SIDE);
- FROB_CURSOR(RIGHT_TEE); FROB_CURSOR(RIGHTBUTTON);
- FROB_CURSOR(RTL_LOGO); FROB_CURSOR(SAILBOAT);
- FROB_CURSOR(SB_DOWN_ARROW); FROB_CURSOR(SB_H_DOUBLE_ARROW);
- FROB_CURSOR(SB_LEFT_ARROW); FROB_CURSOR(SB_RIGHT_ARROW);
- FROB_CURSOR(SB_UP_ARROW); FROB_CURSOR(SB_V_DOUBLE_ARROW);
- FROB_CURSOR(SHUTTLE); FROB_CURSOR(SIZING);
- FROB_CURSOR(SPIDER); FROB_CURSOR(SPRAYCAN);
- FROB_CURSOR(STAR); FROB_CURSOR(TARGET);
- FROB_CURSOR(TCROSS); FROB_CURSOR(TOP_LEFT_ARROW);
- FROB_CURSOR(TOP_LEFT_CORNER); FROB_CURSOR(TOP_RIGHT_CORNER);
- FROB_CURSOR(TOP_SIDE); FROB_CURSOR(TOP_TEE);
- FROB_CURSOR(TREK); FROB_CURSOR(UL_ANGLE);
- FROB_CURSOR(UMBRELLA); FROB_CURSOR(UR_ANGLE);
- FROB_CURSOR(WATCH); FROB_CURSOR(XTERM);
- FROB_CURSOR(X_CURSOR);
+
+ if (NILP (Vgtk_cursors)) {
+ /* I really should check the hash table size to be zero before initializing. */
+ if (!HASH_TABLEP (Vgtk_cursors))
+ Vgtk_cursors = call2 (intern ("make-hashtable"), make_int (101), Qequal);
+
+
+#define FROB_CURSOR(x) Fputhash (build_ascstring (__downcase(#x)), \
+ make_int (GDK_##x), Vgtk_cursors);
+
+ FROB_CURSOR(ARROW); FROB_CURSOR(BASED_ARROW_DOWN);
+ FROB_CURSOR(BASED_ARROW_UP); FROB_CURSOR(BOAT);
+ FROB_CURSOR(BOGOSITY); FROB_CURSOR(BOTTOM_LEFT_CORNER);
+ FROB_CURSOR(BOTTOM_RIGHT_CORNER); FROB_CURSOR(BOTTOM_SIDE);
+ FROB_CURSOR(BOTTOM_TEE); FROB_CURSOR(BOX_SPIRAL);
+ FROB_CURSOR(CENTER_PTR); FROB_CURSOR(CIRCLE);
+ FROB_CURSOR(CLOCK); FROB_CURSOR(COFFEE_MUG);
+ FROB_CURSOR(CROSS); FROB_CURSOR(CROSS_REVERSE);
+ FROB_CURSOR(CROSSHAIR); FROB_CURSOR(DIAMOND_CROSS);
+ FROB_CURSOR(DOT); FROB_CURSOR(DOTBOX);
+ FROB_CURSOR(DOUBLE_ARROW); FROB_CURSOR(DRAFT_LARGE);
+ FROB_CURSOR(DRAFT_SMALL); FROB_CURSOR(DRAPED_BOX);
+ FROB_CURSOR(EXCHANGE); FROB_CURSOR(FLEUR);
+ FROB_CURSOR(GOBBLER); FROB_CURSOR(GUMBY);
+ FROB_CURSOR(HAND1); FROB_CURSOR(HAND2);
+ FROB_CURSOR(HEART); FROB_CURSOR(ICON);
+ FROB_CURSOR(IRON_CROSS); FROB_CURSOR(LEFT_PTR);
+ FROB_CURSOR(LEFT_SIDE); FROB_CURSOR(LEFT_TEE);
+ FROB_CURSOR(LEFTBUTTON); FROB_CURSOR(LL_ANGLE);
+ FROB_CURSOR(LR_ANGLE); FROB_CURSOR(MAN);
+ FROB_CURSOR(MIDDLEBUTTON); FROB_CURSOR(MOUSE);
+ FROB_CURSOR(PENCIL); FROB_CURSOR(PIRATE);
+ FROB_CURSOR(PLUS); FROB_CURSOR(QUESTION_ARROW);
+ FROB_CURSOR(RIGHT_PTR); FROB_CURSOR(RIGHT_SIDE);
+ FROB_CURSOR(RIGHT_TEE); FROB_CURSOR(RIGHTBUTTON);
+ FROB_CURSOR(RTL_LOGO); FROB_CURSOR(SAILBOAT);
+ FROB_CURSOR(SB_DOWN_ARROW); FROB_CURSOR(SB_H_DOUBLE_ARROW);
+ FROB_CURSOR(SB_LEFT_ARROW); FROB_CURSOR(SB_RIGHT_ARROW);
+ FROB_CURSOR(SB_UP_ARROW); FROB_CURSOR(SB_V_DOUBLE_ARROW);
+ FROB_CURSOR(SHUTTLE); FROB_CURSOR(SIZING);
+ FROB_CURSOR(SPIDER); FROB_CURSOR(SPRAYCAN);
+ FROB_CURSOR(STAR); FROB_CURSOR(TARGET);
+ FROB_CURSOR(TCROSS); FROB_CURSOR(TOP_LEFT_ARROW);
+ FROB_CURSOR(TOP_LEFT_CORNER); FROB_CURSOR(TOP_RIGHT_CORNER);
+ FROB_CURSOR(TOP_SIDE); FROB_CURSOR(TOP_TEE);
+ FROB_CURSOR(TREK); FROB_CURSOR(UL_ANGLE);
+ FROB_CURSOR(UMBRELLA); FROB_CURSOR(UR_ANGLE);
+ FROB_CURSOR(WATCH); FROB_CURSOR(XTERM);
+ FROB_CURSOR(X_CURSOR);
#undef FROB_CURSOR
}
- for (i = 0; i < GDK_LAST_CURSOR; i++)
- {
- if (!the_gdk_cursors[i]) continue;
- if (!strcmp (the_gdk_cursors[i], name))
- {
- return (GdkCursorType) i;
- }
- }
+ elt = call2 (intern ("gethash"), build_ascstring (name), Vgtk_cursors);
+ if (!NILP (elt))
+ return (GdkCursorType) XINT (elt);
return (GdkCursorType) -1;
}
@@ -2959,10 +2969,10 @@
Vgtk_bitmap_file_path = Qnil;
#ifdef HAVE_GTK
- DEFVAR_LISP ("gtk-cursor-names", &Vgtk_cursor_names /*
-A list of Gtk cursor names and internal integer values.
+ DEFVAR_LISP ("gtk-cursors", &Vgtk_cursors /*
+A hash table of cursor name to GdkCursorType values.
*/);
- Vgtk_cursor_names = Qnil;
+ Vgtk_cursors = Qnil;
#endif
}
https://bitbucket.org/xemacs/xemacs/commits/3c8a44741aa8/
Changeset: 3c8a44741aa8
Branch: compiles
User: jsparkes
Date: 2010-05-03 11:07:09+00:00
Summary: Use GPOINTER_TO_INT for data values.
Affected #: 1 file
diff -r 938c07db923551157abd04ea0ff1e5d6d03fda26 -r 3c8a44741aa8060bfa773b77059004ef39633d41 src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -618,7 +618,8 @@
{
GtkWidget *bogus_item = gtk_menu_item_new_with_label ("A suitably long label here...");
- gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FIRSTTIME_TAG, (gpointer)0x01);
+ gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FIRSTTIME_TAG,
+ GINT_TO_POINTER ()0x01);
gtk_widget_show_all (bogus_item);
gtk_menu_append (GTK_MENU (submenu), bogus_item);
}
@@ -660,8 +661,10 @@
invalid_argument ("unknown menu cascade keyword", cascade);
}
- gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, STORE_LISP_IN_VOID (desc));
- gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG, STORE_LISP_IN_VOID (hook_fn));
+ gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG,
+ STORE_LISP_IN_VOID (desc));
+ gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG,
+ STORE_LISP_IN_VOID (hook_fn));
if ((!NILP (config_tag)
&& NILP (Fmemq (config_tag, Vmenubar_configuration)))
@@ -719,16 +722,16 @@
GUI_ID id = new_gui_id ();
gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_GUIID_TAG,
- (gpointer) id);
+ GUINT_TO_POINTER (id));
/* Make sure we gcpro the menu descriptions */
gcpro_popup_callbacks (id, desc);
gtk_object_weakref (GTK_OBJECT (menu_item), __remove_gcpro_by_id,
- (gpointer) id);
+ GUINT_TO_POINTER (id));
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (__activate_menu),
- (gpointer) 0x01);
+ GUINT_TO_POINTER (0x01));
}
return (menu_item);
@@ -1235,8 +1238,8 @@
GTK_SIGNAL_FUNC (run_menubar_hook), NULL);
FRAME_GTK_MENUBAR_WIDGET (f) = menubar;
- gtk_object_set_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG, (gpointer) id);
- gtk_object_weakref (GTK_OBJECT (menubar), __remove_gcpro_by_id, (gpointer) id, NULL);
+ gtk_object_set_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG, GUINT_TO_POINTER (id));
+ gtk_object_weakref (GTK_OBJECT (menubar), __remove_gcpro_by_id, GUINT_TO_POINTER (id)), NULL);
}
static int
https://bitbucket.org/xemacs/xemacs/commits/8bd63e602d5d/
Changeset: 8bd63e602d5d
Branch: compiles
User: jsparkes
Date: 2010-05-03 11:08:06+00:00
Summary: Turn off pixmap/bitmap because they are crashing with XCopyArea 62
Affected #: 1 file
diff -r 3c8a44741aa8060bfa773b77059004ef39633d41 -r 8bd63e602d5dcd723921c15a7fe354fde53eb4dc src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -1693,9 +1693,11 @@
height, x, y);
#else /* THIS_IS_GTK */
USED (dpy);
+ #ifdef JSPARKES
gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc,
IMAGE_INSTANCE_GTK_PIXMAP (p),
xoffset, yoffset, x, y, width, height);
+ #endif
#endif /* THIS_IS_GTK */
}
else
@@ -1706,9 +1708,11 @@
xoffset, yoffset, width, height, x, y, 1L);
#else /* THIS_IS_GTK */
USED (dpy);
+ #ifdef JSPARKES
our_draw_bitmap (GDK_DRAWABLE (x_win), gc,
IMAGE_INSTANCE_GTK_PIXMAP (p),
xoffset, yoffset, x, y, width, height);
+ #endif
#endif /* THIS_IS_GTK */
}
}
https://bitbucket.org/xemacs/xemacs/commits/2225fabb1144/
Changeset: 2225fabb1144
Branch: compiles
User: jsparkes
Date: 2010-05-03 11:08:23+00:00
Summary: Use GPOINTER_TO_INT for data values.
Affected #: 2 files
diff -r 8bd63e602d5dcd723921c15a7fe354fde53eb4dc -r 2225fabb11445776859b350f3dfc1bf61a66a21d src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -82,8 +82,8 @@
scrollbar_drag_hack_cb (GtkWidget *UNUSED (w), GdkEventButton *UNUSED (ev),
gpointer v)
{
- vertical_drag_in_progress = (int) v;
- inhibit_slider_size_change = (int) v;
+ vertical_drag_in_progress = GPOINTER_TO_INT (v);
+ inhibit_slider_size_change = GPOINTER_TO_INT (v);
return (FALSE);
}
@@ -398,10 +398,10 @@
scrollbar_cb (GtkAdjustment *adj, gpointer user_data)
{
/* This function can GC */
- int vertical = (int) user_data;
+ int vertical = GPOINTER_TO_INT (user_data);
struct frame *f = (struct frame*) gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_FRAME_IDENTIFIER);
struct scrollbar_instance *instance;
- GUI_ID id = (GUI_ID) gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_GUI_IDENTIFIER);
+ GUI_ID id = GPOINTER_TO_UINT (gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_GUI_IDENTIFIER));
Lisp_Object win, frame;
struct window_mirror *mirror;
Lisp_Object event_type = Qnil;
diff -r 8bd63e602d5dcd723921c15a7fe354fde53eb4dc -r 2225fabb11445776859b350f3dfc1bf61a66a21d src/scrollbar-gtk.h
--- a/src/scrollbar-gtk.h
+++ b/src/scrollbar-gtk.h
@@ -45,7 +45,7 @@
struct gtk_scrollbar_data
{
/* Unique scrollbar identifier and name. */
- unsigned int id;
+ guint id;
/* Is set if we have already set the backing_store attribute correctly */
char backing_store_initialized;
https://bitbucket.org/xemacs/xemacs/commits/448bbdfb15eb/
Changeset: 448bbdfb15eb
User: jsparkes
Date: 2010-05-03 11:09:18+00:00
Summary: Merge from compiles branch.
Don't know why I bothered to make a branch anyway.
Affected #: 37 files
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a lisp/gtk-mouse.el
--- a/lisp/gtk-mouse.el
+++ b/lisp/gtk-mouse.el
@@ -35,6 +35,7 @@
(defvar gtk-pointers-initialized nil)
(defun gtk-init-pointers ()
+ (setq gtk-pointers-initialized t) ;; --jsparkes
(if gtk-pointers-initialized
nil
(set-glyph-image text-pointer-glyph
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,83 +1,109 @@
-2010-04-24 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * device-gtk.c (gtk_event_name):
- Return event name as "EventXX" until I figure out event name lookup.
- (Fgtk_style_info):
- Leave font name out for now.
-
- * ui-gtk.c (import_gtk_enumeration_internal):
- Convert to GObject.
- (type_already_imported_p):
- Use Gtk 2.X constants.
- (import_gtk_flags_internal):
- Create.
- (import_gtk_type):
- Flags and enumerations are implemented separately now.
- (import_gtk_object_internal):
- Update to use GObject.
- (__allocate_object_storage):
- Use g_type_query and instance_size.
-
-2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * glyphs-gtk.c (gtk_add_tab_item):
- Use GINT_TO_POINTER.
-
- * frame-gtk.c (gtk_init_frame_1):
- Use GINT_TO_POINTER.
-
- * event-gtk.c (emacs_gtk_add_timeout):
- Use GPOINTER_TO_INT.
-
- * glyphs-gtk.c (convert_EImage_to_GDKImage):
- (convert_EImage_to_GDKImage):
- Use G_BIG_ENDIAN instead of WORDS_BIGENDIAN.
-
-2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * redisplay-gtk.c (XLIKE_bevel_area):
- Cast GtkShadowStyle to edge_style for C++ compile.
- (our_draw_bitmap):
- Implement using GDK, not XLib.
-
- * fontcolor-gtk.c (gtk_color_instance_hash):
- Update hash function to match usage in fontcolor-x.c.
-
- * event-gtk.c (handle_focus_event_1):
- Extend X focus timestamp klduge to Gtk.
-
- * console-xlike-inc.h:
- Fix GET_XLIKE_DISPLAY for gtk.
-
- * frame-gtk.c (gtk_create_widgets):
- Declare array const to avoid C++ warning.
- (get_number, gnome_parse_geometry):
- Re-enable local geometry parsing temporarily.
-
- * config.h.in:
- Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
-
- * gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
- Slider width is now in GtkStyle instance, not class.
-
- * device-gtk.c (gtk_delete_device):
- NEW_GC doesn't allow/require freeing device directly.
-
-2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * fontcolor-gtk.c (gtk_color_instance_hash):
- Remove gtk_color_instance_hash equalp argument.
-
- * gtk-glue.c (xemacs_type_register):
- Change arg to const to avoid C++ warning.
-
- * gtk-xemacs.c (gtk_xemacs_get_type):
- Cast to avoid C++ const warning.
-
- * frame-gtk.c (gtk_initialize_frame_size):
- Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
- Use gtk geometry functions.
- Include gutter.h for frame size calculations.
+2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doc.c (Fdocumentation):
+ If we have a zero length doc string in DOC, as may happen for
+ undocumented compiled function objects which nonetheless have file
+ information stored, return nil.
+ (Fsnarf_documentation):
+ DOC info existing for compiled functions without docstrings is
+ perfectly legitimate, now the file is also used to store file names.
+ * bytecode.c (set_compiled_function_documentation):
+ Allow this function to set the documentation successfully for
+ compiled function objects that don't currently have documentation;
+ most relevant for functions without docstrings which have file
+ information stored in DOC.
+
+2010-04-15 Ben Wing <ben(a)xemacs.org>
+
+ * device-x.c (x_init_device):
+ Don't declare something const if we're going to modify it.
+ Clean up code to follow GNU coding standards.
+
+2010-04-12 Ben Wing <ben(a)xemacs.org>
+
+ * specifier.c (specifier_memory_usage):
+ Disable specifier memory-usage stats for now. Sometimes they can
+ end up with circularities in them and I'm not sure exactly whats
+ going on to produce them.
+
+2010-04-12 Ben Wing <ben(a)xemacs.org>
+
+ * charset.h:
+ * lisp.h:
+ * lisp.h (XREALLOC_ARRAY):
+ * text.h:
+ Port charset_codepoint_to_itext(), buffer_itext_to_charset_codepoint(),
+ EXTBYTE_STRING_TO_ALLOCA(), `enum converr' from ben-unicode-internal,
+ for use with the mule-wnnfns.c changes.
+
+ * mule-wnnfns.c:
+ * mule-wnnfns.c (Fwnn_open):
+ * mule-wnnfns.c (Fwnn_dict_add):
+ * mule-wnnfns.c (Fwnn_dict_list):
+ * mule-wnnfns.c (Fwnn_get_zenkouho):
+ * mule-wnnfns.c (Fwnn_inspect):
+ * mule-wnnfns.c (Fwnn_bunsetu_kanji):
+ * mule-wnnfns.c (Fwnn_bunsetu_yomi):
+ * mule-wnnfns.c (Fwnn_word_info):
+ * mule-wnnfns.c (Fwnn_dict_search):
+ * mule-wnnfns.c (Fwnn_get_msg):
+ * mule-wnnfns.c (Fwnn_fuzokugo_set):
+ * mule-wnnfns.c (Fwnn_fuzokugo_get):
+ * mule-wnnfns.c (Fwnn_hinsi_list):
+ * mule-wnnfns.c (Fwnn_fisys_dict_add):
+ * mule-wnnfns.c (Fwnn_fiusr_dict_add):
+ * mule-wnnfns.c (Fwnn_notrans_dict_add):
+ * mule-wnnfns.c (Fwnn_bmodify_dict_add):
+ * mule-wnnfns.c (reinit_vars_of_mule_wnn):
+ * mule-wnnfns.c (vars_of_mule_wnn):
+ * mule-wnnfns.c (w2m):
+ * mule-wnnfns.c (m2w):
+ * mule-wnnfns.c (yes_or_no):
+ * mule-wnnfns.c (puts2):
+ * mule-wnnfns.c (check_wnn_server_type):
+ Mule-ize, borrowed from ben-unicode-internal.
+
+2010-04-09 Ben Wing <ben(a)xemacs.org>
+
+ * fileio.c (check_writable):
+ * fileio.c (Fdo_auto_save):
+ * redisplay-xlike-inc.c (separate_textual_runs_nomule):
+ * redisplay-xlike-inc.c (separate_textual_runs_xft_nomule):
+ * redisplay-xlike-inc.c (separate_textual_runs_xft_mule):
+ * redisplay-xlike-inc.c (separate_textual_runs_mule):
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ * redisplay-xlike-inc.c (XLIKE_output_vertical_divider):
+ * redisplay.c (create_text_block):
+ * redisplay.c (regenerate_window):
+ * redisplay.c (redisplay_window):
+ * redisplay.c (redisplay_device):
+ * redisplay.c (window_line_number):
+ * redisplay.c (point_would_be_visible):
+ * redisplay.c (compute_display_line_dynarr_usage):
+ * specifier.c (prune_specifiers):
+ * specifier.c (finalize_specifier):
+ * specifier.c (make_magic_specifier):
+ * specifier.c (charset_matches_specifier_tag_set_p):
+ * specifier.c (Fdefine_specifier_tag):
+ * specifier.c (setup_device_initial_specifier_tags):
+ * specifier.c (bodily_specifier):
+ * specifier.c (add_spec_to_ghost_specifier):
+ * specifier.c (remove_ghost_specifier):
+ * specifier.c (set_specifier_fallback):
+ * specifier.c (specifier_instance_from_inst_list):
+ * specifier.c (set_specifier_caching):
+ Fix coding style to correspond to GNU standard.
+
+2010-04-09 Didier Verna <didier(a)xemacs.org>
+
+ * fontcolor-xlike-inc.c (DEBUG_FONTS2):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS3):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS4):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP1):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP2):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP3):
+ * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP4): Conditionalize
+ definitions on DEBUG_XEMACS, provide empty definitions otherwise.
2010-04-06 Ben Wing <ben(a)xemacs.org>
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,71 @@
+2010-04-26 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * ui-gtk.c (emacs_gtk_object_getprop):
+ Started conversion to 2.X.
+ (Fgtk_describe_type):
+ Converted to 2.X.
+
+ * config.h.in:
+ We don't need WORDS_BIGENDIAN.
+
+ * glyphs-gtk.c (convert_EImage_to_GDKImage):
+ Use G_BIG_ENDIAN instead of WORDS_BIGENDIAN
+ (convert_EImage_to_GDKImage):
+ Ditto.
+
+2010-04-23 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * gtk-xemacs.c (gtk_xemacs_class_init):
+ Don't use gtk_xemacs_draw.
+ (smash_scrollbar_specifiers):
+ Use fixed slider width for now.
+
+2010-04-22 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (XLIKE_bevel_area):
+ Cast GtkShadowStyle to edge_style for C++ compile.
+ (our_draw_bitmap):
+ Implement using GDK, not XLib.
+
+ * fontcolor-gtk.c (gtk_color_instance_hash):
+ Update hash function to match usage in fontcolor-x.c.
+
+ * event-gtk.c (handle_focus_event_1):
+ Extend X focus timestamp klduge to Gtk.
+
+ * console-xlike-inc.h:
+ Fix GET_XLIKE_DISPLAY for gtk.
+
+ * frame-gtk.c (gtk_create_widgets):
+ Declare array const to avoid C++ warning.
+ (get_number, gnome_parse_geometry):
+ Re-enable local geometry parsing temporarily.
+
+ * config.h.in:
+ Add WORDS_BIGENDIAN check back. It's used in src/glyphs-gtk.h.
+
+ * gtk-xemacs.c (smash_scrollbar_specifiers, smash_toolbar_specifiers):
+ Slider width is now in GtkStyle instance, not class.
+
+ * device-gtk.c (gtk_delete_device):
+ NEW_GC doesn't allow/require freeing device directly.
+
+2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * fontcolor-gtk.c (gtk_color_instance_hash):
+ Remove gtk_color_instance_hash equalp argument.
+
+ * gtk-glue.c (xemacs_type_register):
+ Change arg to const to avoid C++ warning.
+
+ * gtk-xemacs.c (gtk_xemacs_get_type):
+ Cast to avoid C++ const warning.
+
+ * frame-gtk.c (gtk_initialize_frame_size):
+ Remove ifndef HAVE_GNOME around gnome-parse-geometry and get_number.
+ Use gtk geometry functions.
+ Include gutter.h for frame size calculations.
+
2000-10-03 William M. Perry <wmperry(a)aventail.com>
* objects-gtk.c (gtk_font_instance_truename): Make sure we get the
@@ -286,7 +354,8 @@
* ui-gtk.c (lisp_to_gtk_type): Know how to deal with
GTK_TYPE_GDK_GC.
- * gtk-glue.c: Need to defien a GTK type for GdkGC so that we can
+ * gtk-glue.c: Need to defien a GTK type for
+ GdkGC so that we can
import all the GDK drawing primitives.
(face_to_gc): New function to convert a face object to a GC.
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/bytecode.c
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -2562,22 +2562,36 @@
#endif
-/* used only by Snarf-documentation; there must be doc already. */
+/* used only by Snarf-documentation. */
void
set_compiled_function_documentation (Lisp_Compiled_Function *f,
Lisp_Object new_doc)
{
- assert (f->flags.documentationp);
assert (INTP (new_doc) || STRINGP (new_doc));
- if (f->flags.interactivep && f->flags.domainp)
- XCAR (f->doc_and_interactive) = new_doc;
- else if (f->flags.interactivep)
- XCAR (f->doc_and_interactive) = new_doc;
- else if (f->flags.domainp)
- XCAR (f->doc_and_interactive) = new_doc;
+ if (f->flags.documentationp)
+ {
+ if (f->flags.interactivep && f->flags.domainp)
+ XCAR (f->doc_and_interactive) = new_doc;
+ else if (f->flags.interactivep)
+ XCAR (f->doc_and_interactive) = new_doc;
+ else if (f->flags.domainp)
+ XCAR (f->doc_and_interactive) = new_doc;
+ else
+ f->doc_and_interactive = new_doc;
+ }
else
- f->doc_and_interactive = new_doc;
+ {
+ f->flags.documentationp = 1;
+ if (f->flags.interactivep || f->flags.domainp)
+ {
+ f->doc_and_interactive = Fcons (new_doc, f->doc_and_interactive);
+ }
+ else
+ {
+ f->doc_and_interactive = new_doc;
+ }
+ }
}
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/charset.h
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,7 +1,7 @@
/* Header for charsets.
Copyright (C) 1992, 1995 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 2001, 2002 Ben Wing.
+ Copyright (C) 2001, 2002, 2010 Ben Wing.
This file is part of XEmacs.
@@ -555,6 +555,46 @@
#define BREAKUP_ICHAR(c, charset, c1, c2) \
breakup_ichar_1 (c, &(charset), &(c1), &(c2))
+/* Forward compatibility from ben-unicode-internal: Convert a charset
+ codepoint into a character in the internal string representation.
+ Return number of bytes written out. FAIL controls failure mode when
+ charset conversion to Unicode is not possible (unused as of yet). */
+DECLARE_INLINE_HEADER (
+Bytecount
+charset_codepoint_to_itext (Lisp_Object charset, int c1, int c2, Ibyte *ptr,
+ enum converr UNUSED (fail))
+)
+{
+ Ichar ch;
+
+ if (EQ (charset, Vcharset_ascii))
+ {
+ ptr[0] = (Ibyte) c2;
+ return 1;
+ }
+
+ ch = make_ichar (charset, c1, c2);
+
+ /* We can't rely on the converted character being non-ASCII. For
+ example, JISX0208 codepoint (33, 64) == Unicode 0x5C (ASCII
+ backslash). */
+ return set_itext_ichar (ptr, ch);
+}
+
+/* Forward compatibility from ben-unicode-internal */
+
+DECLARE_INLINE_HEADER (
+void
+buffer_itext_to_charset_codepoint (const Ibyte *ptr,
+ struct buffer *UNUSED (buf),
+ Lisp_Object *charset, int *c1, int *c2,
+ enum converr UNUSED (fail))
+)
+{
+ Ichar ch = itext_ichar (ptr);
+ breakup_ichar_1 (ch, charset, c1, c2);
+}
+
void get_charset_limits (Lisp_Object charset, int *low, int *high);
int ichar_to_unicode (Ichar chr);
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/config.h.in
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -319,7 +319,7 @@
#undef STDC_HEADERS
#undef TIME_WITH_SYS_TIME
-#undef WORDS_BIGENDIAN
+/* #undef WORDS_BIGENDIAN */
#undef HAVE_LONG_FILE_NAMES
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/console-gtk.h
--- a/src/console-gtk.h
+++ b/src/console-gtk.h
@@ -66,7 +66,8 @@
int cursor_height);
GdkGC *gtk_get_gc (struct frame *f,
Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
- Lisp_Object bg_pmap, Lisp_Object lwidth);
+ Lisp_Object bg_pmap, Lisp_Object bg_placement,
+ Lisp_Object lwidth);
int gtk_initialize_frame_menubar (struct frame *f);
void gtk_init_modifier_mapping (struct device *d);
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/console-xlike-inc.h
--- a/src/console-xlike-inc.h
+++ b/src/console-xlike-inc.h
@@ -274,7 +274,6 @@
/* functions */
/* Avoid unused-variable warning involving D */
-//#define GET_XLIKE_DISPLAY(d) (USED (d), NULL)
#define GET_XLIKE_DISPLAY(d) (d)
#define GET_XLIKE_X_DISPLAY(d) (USED (d), GDK_DISPLAY ())
#define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w))
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -399,21 +399,15 @@
const char *
gtk_event_name (GdkEventType event_type)
{
-#if 0
- GtkEnumValue *vals = gtk_type_enum_get_values (GTK_TYPE_GDK_EVENT_TYPE);
+ //GtkEnumValue *vals = gtk_type_enum_get_values (GTK_TYPE_GDK_EVENT_TYPE);
- while (vals && ((GdkEventType)(vals->value) != event_type)) vals++;
-
- if (vals)
- return (vals->value_nick);
+ //while (vals && ((GdkEventType)(vals->value) != event_type)) vals++;
- return (NULL);
+ //if (vals)
+ //return (vals->value_nick);
-#else
- char *name = (char *)xmalloc_and_zero (10);
- sprintf (name, "%s%02d", name, event_type);
- return name;
-#endif
+ //return (NULL);
+ return "GdkEvent";
}
@@ -673,8 +667,8 @@
FROB_COLOR (base, "base");
#undef FROB_COLOR
- // --jsparkes
- // result = nconc2 (result, list2 (Qfont, convert_font (style->font)));
+ result = nconc2 (result, list2 (Qfont,
+ convert_font (gtk_style_get_font (style))));
#define FROB_PIXMAP(state) (style->rc_style->bg_pixmap_name[state] ? build_cistring (style->rc_style->bg_pixmap_name[state]) : Qnil)
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/device-x.c
--- a/src/device-x.c
+++ b/src/device-x.c
@@ -689,7 +689,7 @@
Extbyte *path;
const Extbyte *format;
XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */
- const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
+ Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
Extbyte *locale_end;
if (STRINGP (Vx_app_defaults_directory) &&
@@ -720,28 +720,26 @@
if (!access (path, R_OK))
XrmCombineFileDatabase (path, &db, False);
- if ((locale_end = strchr(locale, '.'))) {
- *locale_end = '\0';
- sprintf (path, format, data_dir, locale);
+ if ((locale_end = strchr (locale, '.')))
+ {
+ *locale_end = '\0';
+ sprintf (path, format, data_dir, locale);
- if (!access (path, R_OK))
- XrmCombineFileDatabase (path, &db, False);
- }
+ if (!access (path, R_OK))
+ XrmCombineFileDatabase (path, &db, False);
+ }
- if ((locale_end = strchr(locale, '_'))) {
- *locale_end = '\0';
- sprintf (path, format, data_dir, locale);
+ if ((locale_end = strchr (locale, '_')))
+ {
+ *locale_end = '\0';
+ sprintf (path, format, data_dir, locale);
- if (!access (path, R_OK))
- XrmCombineFileDatabase (path, &db, False);
- }
+ if (!access (path, R_OK))
+ XrmCombineFileDatabase (path, &db, False);
+ }
no_data_directory:
- {
- /* Cast off const for G++ 4.3. */
- Extbyte *temp = (Extbyte *) locale;
- xfree (temp);
- }
+ xfree (locale);
}
#endif /* MULE */
diff -r 37634997b0045a43f72df4fe142e1f67a0c11ef1 -r 448bbdfb15eb34fe2640381f5524665270245f5a src/doc.c
--- a/src/doc.c
+++ b/src/doc.c
@@ -613,7 +613,15 @@
if (STRINGP (tem))
doc = tem;
else if (NATNUMP (tem) || CONSP (tem))
- doc = get_doc_string (tem);
+ {
+ doc = get_doc_string (tem);
+ /* We may have zero length strings in the docfile for file
+ information. */
+ if (STRINGP (doc) && 0 == XSTRING_LENGTH (doc))
+ {
+ return Qnil;
+ }
+ }
else
return Qnil;
}
@@ -903,33 +911,24 @@
slots for it. */
Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
- /* This compiled-function object must have a
- slot for the docstring, since we've found a
- docstring for it. Unless there were multiple
- definitions of it, and the latter one didn't
- have any doc, which is a legal if slightly
- bogus situation, so don't blow up. */
+ /* If there were multiple definitions for this function,
+ and the latter one didn't
+ have any doc, warn and don't blow up. */
+ Lisp_Object old =
+ compiled_function_documentation (f);
+ if (!ZEROP (old) && !NILP (old))
+ {
+ weird_doc (sym, "duplicate", "bytecode", pos);
+ /* In the case of duplicate doc file entries,
+ always take the later one. But if the doc is
+ not an int (a string, say) leave it alone. */
+ if (!INTP (old))
+ goto weird;
+ }
- if (! (f->flags.documentationp))
- {
- weird_doc (sym, "no doc slot", "bytecode", pos);
- goto weird;
- }
- else
- {
- Lisp_Object old =
- compiled_function_documentation (f);
- if (!ZEROP (old))
- {
- weird_doc (sym, "duplicate", "bytecode", pos);
- /* In the case of duplicate doc file entries,
- always take the later one. But if the doc is
- not an int (a string, say) leave it alone. */
- if (!INTP (old))
- goto weird;
- }
- set_compiled_function_documentation (f, offset);
- }
+ /* This may be a function or variable where we want
+ to make the file name available. */
+ set_compiled_function_documentation (f, offset);
}
else
{
This diff is so big that we needed to truncate the remainder.
https://bitbucket.org/xemacs/xemacs/commits/4073c6301f0a/
Changeset: 4073c6301f0a
User: jsparkes
Date: 2010-05-03 11:58:02+00:00
Summary: Merge from other.
Affected #: 20 files
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d configure
--- a/configure
+++ b/configure
@@ -11922,8 +11922,8 @@
fi
if test "${GNOME_CONFIG}" != "no"; then
- GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0`
- GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0`
+ GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0 pango pangoxft`
+ GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0 pango pangoxft`
$as_echo "#define HAVE_GNOME 1" >>confdefs.h
libs_gtk="$libs_gtk ${GNOME_LIBS}" && if test "$verbose" = "yes"; then echo " Appending \"${GNOME_LIBS}\" to \$libs_gtk"; fi
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -2846,8 +2846,8 @@
fi
if test "${GNOME_CONFIG}" != "no"; then
- GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0`
- GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0`
+ GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0 pango pangoxft`
+ GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0 pango pangoxft`
AC_DEFINE(HAVE_GNOME)
XE_APPEND(${GNOME_LIBS}, libs_gtk)
XE_APPEND(${GNOME_CFLAGS}, c_switch_gtk)
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -354,7 +354,8 @@
* ui-gtk.c (lisp_to_gtk_type): Know how to deal with
GTK_TYPE_GDK_GC.
- * gtk-glue.c: Need to defien a GTK type for GdkGC so that we can
+ * gtk-glue.c: Need to defien a GTK type for
+ GdkGC so that we can
import all the GDK drawing primitives.
(face_to_gc): New function to convert a face object to a GC.
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d src/console-gtk.h
--- a/src/console-gtk.h
+++ b/src/console-gtk.h
@@ -66,7 +66,8 @@
int cursor_height);
GdkGC *gtk_get_gc (struct frame *f,
Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
- Lisp_Object bg_pmap, Lisp_Object lwidth);
+ Lisp_Object bg_pmap, Lisp_Object bg_placement,
+ Lisp_Object lwidth);
int gtk_initialize_frame_menubar (struct frame *f);
void gtk_init_modifier_mapping (struct device *d);
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d src/console-xlike-inc.h
--- a/src/console-xlike-inc.h
+++ b/src/console-xlike-inc.h
@@ -274,7 +274,7 @@
/* functions */
/* Avoid unused-variable warning involving D */
-#define GET_XLIKE_DISPLAY(d) (USED (d))
+#define GET_XLIKE_DISPLAY(d) (d)
#define GET_XLIKE_X_DISPLAY(d) (USED (d), GDK_DISPLAY ())
#define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w))
#define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -107,7 +107,8 @@
extern Lisp_Object
xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w);
-extern Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font, int expandp);
+extern Lisp_Object __get_gtk_font_truename (PangoFontDescription *gdk_font,
+ int expandp);
#define convert_font(f) __get_gtk_font_truename (f, 0)
@@ -399,14 +400,15 @@
const char *
gtk_event_name (GdkEventType event_type)
{
- GtkEnumValue *vals = gtk_type_enum_get_values (GTK_TYPE_GDK_EVENT_TYPE);
+ //GtkEnumValue *vals = gtk_type_enum_get_values (GTK_TYPE_GDK_EVENT_TYPE);
- while (vals && ((GdkEventType)(vals->value) != event_type)) vals++;
+ //while (vals && ((GdkEventType)(vals->value) != event_type)) vals++;
- if (vals)
- return (vals->value_nick);
+ //if (vals)
+ //return (vals->value_nick);
- return (NULL);
+ //return (NULL);
+ return "GdkEvent";
}
@@ -666,7 +668,7 @@
FROB_COLOR (base, "base");
#undef FROB_COLOR
- result = nconc2 (result, list2 (Qfont, convert_font (style->font)));
+ result = nconc2 (result, list2 (Qfont, convert_font (style->font_desc)));
#define FROB_PIXMAP(state) (style->rc_style->bg_pixmap_name[state] ? build_cistring (style->rc_style->bg_pixmap_name[state]) : Qnil)
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d src/emacs-widget-accessors.c
--- a/src/emacs-widget-accessors.c
+++ b/src/emacs-widget-accessors.c
@@ -1,1787 +1,2 @@
/* This file was automatically generated by ../lisp/gtk-widget-accessors.el */
/* DO NOT EDIT BY HAND!!! */
-DEFUN ("gtk-adjustment-lower", Fgtk_adjustment_lower, 1, 1, 0, /*
-Access the `lower' slot of OBJ, a GtkAdjustment object.
-*/
- (obj))
-{
- GtkAdjustment *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkAdjustment", obj);
- };
-
- the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gfloat");
- GTK_VALUE_FLOAT (arg) = the_obj->lower;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-adjustment-upper", Fgtk_adjustment_upper, 1, 1, 0, /*
-Access the `upper' slot of OBJ, a GtkAdjustment object.
-*/
- (obj))
-{
- GtkAdjustment *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkAdjustment", obj);
- };
-
- the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gfloat");
- GTK_VALUE_FLOAT (arg) = the_obj->upper;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-adjustment-value", Fgtk_adjustment_value, 1, 1, 0, /*
-Access the `value' slot of OBJ, a GtkAdjustment object.
-*/
- (obj))
-{
- GtkAdjustment *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkAdjustment", obj);
- };
-
- the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gfloat");
- GTK_VALUE_FLOAT (arg) = the_obj->value;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-adjustment-step-increment", Fgtk_adjustment_step_increment, 1, 1, 0, /*
-Access the `step_increment' slot of OBJ, a GtkAdjustment object.
-*/
- (obj))
-{
- GtkAdjustment *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkAdjustment", obj);
- };
-
- the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gfloat");
- GTK_VALUE_FLOAT (arg) = the_obj->step_increment;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-adjustment-page-increment", Fgtk_adjustment_page_increment, 1, 1, 0, /*
-Access the `page_increment' slot of OBJ, a GtkAdjustment object.
-*/
- (obj))
-{
- GtkAdjustment *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkAdjustment", obj);
- };
-
- the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gfloat");
- GTK_VALUE_FLOAT (arg) = the_obj->page_increment;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-adjustment-page-size", Fgtk_adjustment_page_size, 1, 1, 0, /*
-Access the `page_size' slot of OBJ, a GtkAdjustment object.
-*/
- (obj))
-{
- GtkAdjustment *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkAdjustment", obj);
- };
-
- the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gfloat");
- GTK_VALUE_FLOAT (arg) = the_obj->page_size;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-widget-style", Fgtk_widget_style, 1, 1, 0, /*
-Access the `style' slot of OBJ, a GtkWidget object.
-*/
- (obj))
-{
- GtkWidget *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkWidget", obj);
- };
-
- the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkStyle");
- GTK_VALUE_BOXED (arg) = (void *)the_obj->style;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-widget-window", Fgtk_widget_window, 1, 1, 0, /*
-Access the `window' slot of OBJ, a GtkWidget object.
-*/
- (obj))
-{
- GtkWidget *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkWidget", obj);
- };
-
- the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GdkWindow");
- GTK_VALUE_BOXED (arg) = (void *)the_obj->window;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-widget-state", Fgtk_widget_state, 1, 1, 0, /*
-Access the `state' slot of OBJ, a GtkWidget object.
-*/
- (obj))
-{
- GtkWidget *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkWidget", obj);
- };
-
- the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkStateType");
- GTK_VALUE_ENUM (arg) = the_obj->state;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-widget-name", Fgtk_widget_name, 1, 1, 0, /*
-Access the `name' slot of OBJ, a GtkWidget object.
-*/
- (obj))
-{
- GtkWidget *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkWidget", obj);
- };
-
- the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkString");
- GTK_VALUE_STRING (arg) = the_obj->name;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-widget-parent", Fgtk_widget_parent, 1, 1, 0, /*
-Access the `parent' slot of OBJ, a GtkWidget object.
-*/
- (obj))
-{
- GtkWidget *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkWidget", obj);
- };
-
- the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->parent);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-button-child", Fgtk_button_child, 1, 1, 0, /*
-Access the `child' slot of OBJ, a GtkButton object.
-*/
- (obj))
-{
- GtkButton *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_BUTTON (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkButton", obj);
- };
-
- the_obj = GTK_BUTTON (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->child);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-button-in-button", Fgtk_button_in_button, 1, 1, 0, /*
-Access the `in_button' slot of OBJ, a GtkButton object.
-*/
- (obj))
-{
- GtkButton *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_BUTTON (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkButton", obj);
- };
-
- the_obj = GTK_BUTTON (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gboolean");
- GTK_VALUE_BOOL (arg) = the_obj->in_button;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-button-button-down", Fgtk_button_button_down, 1, 1, 0, /*
-Access the `button_down' slot of OBJ, a GtkButton object.
-*/
- (obj))
-{
- GtkButton *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_BUTTON (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkButton", obj);
- };
-
- the_obj = GTK_BUTTON (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gboolean");
- GTK_VALUE_BOOL (arg) = the_obj->button_down;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-combo-entry", Fgtk_combo_entry, 1, 1, 0, /*
-Access the `entry' slot of OBJ, a GtkCombo object.
-*/
- (obj))
-{
- GtkCombo *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCombo", obj);
- };
-
- the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->entry);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-combo-button", Fgtk_combo_button, 1, 1, 0, /*
-Access the `button' slot of OBJ, a GtkCombo object.
-*/
- (obj))
-{
- GtkCombo *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCombo", obj);
- };
-
- the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-combo-popup", Fgtk_combo_popup, 1, 1, 0, /*
-Access the `popup' slot of OBJ, a GtkCombo object.
-*/
- (obj))
-{
- GtkCombo *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCombo", obj);
- };
-
- the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->popup);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-combo-popwin", Fgtk_combo_popwin, 1, 1, 0, /*
-Access the `popwin' slot of OBJ, a GtkCombo object.
-*/
- (obj))
-{
- GtkCombo *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCombo", obj);
- };
-
- the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->popwin);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-combo-list", Fgtk_combo_list, 1, 1, 0, /*
-Access the `list' slot of OBJ, a GtkCombo object.
-*/
- (obj))
-{
- GtkCombo *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCombo", obj);
- };
-
- the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->list);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-gamma-curve-table", Fgtk_gamma_curve_table, 1, 1, 0, /*
-Access the `table' slot of OBJ, a GtkGammaCurve object.
-*/
- (obj))
-{
- GtkGammaCurve *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkGammaCurve", obj);
- };
-
- the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->table);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-gamma-curve-curve", Fgtk_gamma_curve_curve, 1, 1, 0, /*
-Access the `curve' slot of OBJ, a GtkGammaCurve object.
-*/
- (obj))
-{
- GtkGammaCurve *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkGammaCurve", obj);
- };
-
- the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->curve);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-gamma-curve-gamma", Fgtk_gamma_curve_gamma, 1, 1, 0, /*
-Access the `gamma' slot of OBJ, a GtkGammaCurve object.
-*/
- (obj))
-{
- GtkGammaCurve *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkGammaCurve", obj);
- };
-
- the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gfloat");
- GTK_VALUE_FLOAT (arg) = the_obj->gamma;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-gamma-curve-gamma-dialog", Fgtk_gamma_curve_gamma_dialog, 1, 1, 0, /*
-Access the `gamma_dialog' slot of OBJ, a GtkGammaCurve object.
-*/
- (obj))
-{
- GtkGammaCurve *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkGammaCurve", obj);
- };
-
- the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->gamma_dialog);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-gamma-curve-gamma-text", Fgtk_gamma_curve_gamma_text, 1, 1, 0, /*
-Access the `gamma_text' slot of OBJ, a GtkGammaCurve object.
-*/
- (obj))
-{
- GtkGammaCurve *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkGammaCurve", obj);
- };
-
- the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->gamma_text);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-check-menu-item-active", Fgtk_check_menu_item_active, 1, 1, 0, /*
-Access the `active' slot of OBJ, a GtkCheckMenuItem object.
-*/
- (obj))
-{
- GtkCheckMenuItem *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_CHECK_MENU_ITEM (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCheckMenuItem", obj);
- };
-
- the_obj = GTK_CHECK_MENU_ITEM (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gboolean");
- GTK_VALUE_BOOL (arg) = the_obj->active;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-notebook-tab-pos", Fgtk_notebook_tab_pos, 1, 1, 0, /*
-Access the `tab_pos' slot of OBJ, a GtkNotebook object.
-*/
- (obj))
-{
- GtkNotebook *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_NOTEBOOK (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkNotebook", obj);
- };
-
- the_obj = GTK_NOTEBOOK (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkPositionType");
- GTK_VALUE_ENUM (arg) = the_obj->tab_pos;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-text-hadj", Fgtk_text_hadj, 1, 1, 0, /*
-Access the `hadj' slot of OBJ, a GtkText object.
-*/
- (obj))
-{
- GtkText *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_TEXT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkText", obj);
- };
-
- the_obj = GTK_TEXT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkAdjustment");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->hadj);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-text-vadj", Fgtk_text_vadj, 1, 1, 0, /*
-Access the `vadj' slot of OBJ, a GtkText object.
-*/
- (obj))
-{
- GtkText *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_TEXT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkText", obj);
- };
-
- the_obj = GTK_TEXT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkAdjustment");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->vadj);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-file-selection-dir-list", Fgtk_file_selection_dir_list, 1, 1, 0, /*
-Access the `dir_list' slot of OBJ, a GtkFileSelection object.
-*/
- (obj))
-{
- GtkFileSelection *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFileSelection", obj);
- };
-
- the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->dir_list);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-file-selection-file-list", Fgtk_file_selection_file_list, 1, 1, 0, /*
-Access the `file_list' slot of OBJ, a GtkFileSelection object.
-*/
- (obj))
-{
- GtkFileSelection *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFileSelection", obj);
- };
-
- the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->file_list);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-file-selection-selection-entry", Fgtk_file_selection_selection_entry, 1, 1, 0, /*
-Access the `selection_entry' slot of OBJ, a GtkFileSelection object.
-*/
- (obj))
-{
- GtkFileSelection *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFileSelection", obj);
- };
-
- the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->selection_entry);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-file-selection-selection-text", Fgtk_file_selection_selection_text, 1, 1, 0, /*
-Access the `selection_text' slot of OBJ, a GtkFileSelection object.
-*/
- (obj))
-{
- GtkFileSelection *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFileSelection", obj);
- };
-
- the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->selection_text);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-file-selection-main-vbox", Fgtk_file_selection_main_vbox, 1, 1, 0, /*
-Access the `main_vbox' slot of OBJ, a GtkFileSelection object.
-*/
- (obj))
-{
- GtkFileSelection *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFileSelection", obj);
- };
-
- the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->main_vbox);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-file-selection-ok-button", Fgtk_file_selection_ok_button, 1, 1, 0, /*
-Access the `ok_button' slot of OBJ, a GtkFileSelection object.
-*/
- (obj))
-{
- GtkFileSelection *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFileSelection", obj);
- };
-
- the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->ok_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-file-selection-cancel-button", Fgtk_file_selection_cancel_button, 1, 1, 0, /*
-Access the `cancel_button' slot of OBJ, a GtkFileSelection object.
-*/
- (obj))
-{
- GtkFileSelection *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFileSelection", obj);
- };
-
- the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->cancel_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-file-selection-help-button", Fgtk_file_selection_help_button, 1, 1, 0, /*
-Access the `help_button' slot of OBJ, a GtkFileSelection object.
-*/
- (obj))
-{
- GtkFileSelection *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFileSelection", obj);
- };
-
- the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->help_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-file-selection-action-area", Fgtk_file_selection_action_area, 1, 1, 0, /*
-Access the `action_area' slot of OBJ, a GtkFileSelection object.
-*/
- (obj))
-{
- GtkFileSelection *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFileSelection", obj);
- };
-
- the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->action_area);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-font-selection-dialog-fontsel", Fgtk_font_selection_dialog_fontsel, 1, 1, 0, /*
-Access the `fontsel' slot of OBJ, a GtkFontSelectionDialog object.
-*/
- (obj))
-{
- GtkFontSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFontSelectionDialog", obj);
- };
-
- the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->fontsel);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-font-selection-dialog-main-vbox", Fgtk_font_selection_dialog_main_vbox, 1, 1, 0, /*
-Access the `main_vbox' slot of OBJ, a GtkFontSelectionDialog object.
-*/
- (obj))
-{
- GtkFontSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFontSelectionDialog", obj);
- };
-
- the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->main_vbox);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-font-selection-dialog-action-area", Fgtk_font_selection_dialog_action_area, 1, 1, 0, /*
-Access the `action_area' slot of OBJ, a GtkFontSelectionDialog object.
-*/
- (obj))
-{
- GtkFontSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFontSelectionDialog", obj);
- };
-
- the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->action_area);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-font-selection-dialog-ok-button", Fgtk_font_selection_dialog_ok_button, 1, 1, 0, /*
-Access the `ok_button' slot of OBJ, a GtkFontSelectionDialog object.
-*/
- (obj))
-{
- GtkFontSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFontSelectionDialog", obj);
- };
-
- the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->ok_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-font-selection-dialog-apply-button", Fgtk_font_selection_dialog_apply_button, 1, 1, 0, /*
-Access the `apply_button' slot of OBJ, a GtkFontSelectionDialog object.
-*/
- (obj))
-{
- GtkFontSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFontSelectionDialog", obj);
- };
-
- the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->apply_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-font-selection-dialog-cancel-button", Fgtk_font_selection_dialog_cancel_button, 1, 1, 0, /*
-Access the `cancel_button' slot of OBJ, a GtkFontSelectionDialog object.
-*/
- (obj))
-{
- GtkFontSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkFontSelectionDialog", obj);
- };
-
- the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->cancel_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-color-selection-dialog-colorsel", Fgtk_color_selection_dialog_colorsel, 1, 1, 0, /*
-Access the `colorsel' slot of OBJ, a GtkColorSelectionDialog object.
-*/
- (obj))
-{
- GtkColorSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkColorSelectionDialog", obj);
- };
-
- the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->colorsel);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-color-selection-dialog-main-vbox", Fgtk_color_selection_dialog_main_vbox, 1, 1, 0, /*
-Access the `main_vbox' slot of OBJ, a GtkColorSelectionDialog object.
-*/
- (obj))
-{
- GtkColorSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkColorSelectionDialog", obj);
- };
-
- the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->main_vbox);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-color-selection-dialog-ok-button", Fgtk_color_selection_dialog_ok_button, 1, 1, 0, /*
-Access the `ok_button' slot of OBJ, a GtkColorSelectionDialog object.
-*/
- (obj))
-{
- GtkColorSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkColorSelectionDialog", obj);
- };
-
- the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->ok_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-color-selection-dialog-reset-button", Fgtk_color_selection_dialog_reset_button, 1, 1, 0, /*
-Access the `reset_button' slot of OBJ, a GtkColorSelectionDialog object.
-*/
- (obj))
-{
- GtkColorSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkColorSelectionDialog", obj);
- };
-
- the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->reset_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-color-selection-dialog-cancel-button", Fgtk_color_selection_dialog_cancel_button, 1, 1, 0, /*
-Access the `cancel_button' slot of OBJ, a GtkColorSelectionDialog object.
-*/
- (obj))
-{
- GtkColorSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkColorSelectionDialog", obj);
- };
-
- the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->cancel_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-color-selection-dialog-help-button", Fgtk_color_selection_dialog_help_button, 1, 1, 0, /*
-Access the `help_button' slot of OBJ, a GtkColorSelectionDialog object.
-*/
- (obj))
-{
- GtkColorSelectionDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkColorSelectionDialog", obj);
- };
-
- the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->help_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-dialog-vbox", Fgtk_dialog_vbox, 1, 1, 0, /*
-Access the `vbox' slot of OBJ, a GtkDialog object.
-*/
- (obj))
-{
- GtkDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkDialog", obj);
- };
-
- the_obj = GTK_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->vbox);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-dialog-action-area", Fgtk_dialog_action_area, 1, 1, 0, /*
-Access the `action_area' slot of OBJ, a GtkDialog object.
-*/
- (obj))
-{
- GtkDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkDialog", obj);
- };
-
- the_obj = GTK_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->action_area);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-input-dialog-close-button", Fgtk_input_dialog_close_button, 1, 1, 0, /*
-Access the `close_button' slot of OBJ, a GtkInputDialog object.
-*/
- (obj))
-{
- GtkInputDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_INPUT_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkInputDialog", obj);
- };
-
- the_obj = GTK_INPUT_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->close_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-input-dialog-save-button", Fgtk_input_dialog_save_button, 1, 1, 0, /*
-Access the `save_button' slot of OBJ, a GtkInputDialog object.
-*/
- (obj))
-{
- GtkInputDialog *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_INPUT_DIALOG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkInputDialog", obj);
- };
-
- the_obj = GTK_INPUT_DIALOG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->save_button);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-plug-socket-window", Fgtk_plug_socket_window, 1, 1, 0, /*
-Access the `socket_window' slot of OBJ, a GtkPlug object.
-*/
- (obj))
-{
- GtkPlug *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_PLUG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkPlug", obj);
- };
-
- the_obj = GTK_PLUG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GdkWindow");
- GTK_VALUE_BOXED (arg) = (void *)the_obj->socket_window;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-plug-same-app", Fgtk_plug_same_app, 1, 1, 0, /*
-Access the `same_app' slot of OBJ, a GtkPlug object.
-*/
- (obj))
-{
- GtkPlug *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_PLUG (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkPlug", obj);
- };
-
- the_obj = GTK_PLUG (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gint");
- GTK_VALUE_INT (arg) = the_obj->same_app;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-object-flags", Fgtk_object_flags, 1, 1, 0, /*
-Access the `flags' slot of OBJ, a GtkObject object.
-*/
- (obj))
-{
- GtkObject *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_OBJECT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkObject", obj);
- };
-
- the_obj = GTK_OBJECT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("guint");
- GTK_VALUE_UINT (arg) = the_obj->flags;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-object-ref-count", Fgtk_object_ref_count, 1, 1, 0, /*
-Access the `ref_count' slot of OBJ, a GtkObject object.
-*/
- (obj))
-{
- GtkObject *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_OBJECT (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkObject", obj);
- };
-
- the_obj = GTK_OBJECT (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("guint");
- GTK_VALUE_UINT (arg) = the_obj->ref_count;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-paned-child1", Fgtk_paned_child1, 1, 1, 0, /*
-Access the `child1' slot of OBJ, a GtkPaned object.
-*/
- (obj))
-{
- GtkPaned *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkPaned", obj);
- };
-
- the_obj = GTK_PANED (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->child1);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-paned-child2", Fgtk_paned_child2, 1, 1, 0, /*
-Access the `child2' slot of OBJ, a GtkPaned object.
-*/
- (obj))
-{
- GtkPaned *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkPaned", obj);
- };
-
- the_obj = GTK_PANED (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->child2);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-paned-child1-resize", Fgtk_paned_child1_resize, 1, 1, 0, /*
-Access the `child1_resize' slot of OBJ, a GtkPaned object.
-*/
- (obj))
-{
- GtkPaned *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkPaned", obj);
- };
-
- the_obj = GTK_PANED (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gboolean");
- GTK_VALUE_BOOL (arg) = the_obj->child1_resize;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-paned-child2-resize", Fgtk_paned_child2_resize, 1, 1, 0, /*
-Access the `child2_resize' slot of OBJ, a GtkPaned object.
-*/
- (obj))
-{
- GtkPaned *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkPaned", obj);
- };
-
- the_obj = GTK_PANED (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gboolean");
- GTK_VALUE_BOOL (arg) = the_obj->child2_resize;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-paned-child1-shrink", Fgtk_paned_child1_shrink, 1, 1, 0, /*
-Access the `child1_shrink' slot of OBJ, a GtkPaned object.
-*/
- (obj))
-{
- GtkPaned *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkPaned", obj);
- };
-
- the_obj = GTK_PANED (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gboolean");
- GTK_VALUE_BOOL (arg) = the_obj->child1_shrink;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-paned-child2-shrink", Fgtk_paned_child2_shrink, 1, 1, 0, /*
-Access the `child2_shrink' slot of OBJ, a GtkPaned object.
-*/
- (obj))
-{
- GtkPaned *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkPaned", obj);
- };
-
- the_obj = GTK_PANED (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gboolean");
- GTK_VALUE_BOOL (arg) = the_obj->child2_shrink;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-clist-rows", Fgtk_clist_rows, 1, 1, 0, /*
-Access the `rows' slot of OBJ, a GtkCList object.
-*/
- (obj))
-{
- GtkCList *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCList", obj);
- };
-
- the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gint");
- GTK_VALUE_INT (arg) = the_obj->rows;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-clist-columns", Fgtk_clist_columns, 1, 1, 0, /*
-Access the `columns' slot of OBJ, a GtkCList object.
-*/
- (obj))
-{
- GtkCList *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCList", obj);
- };
-
- the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gint");
- GTK_VALUE_INT (arg) = the_obj->columns;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-clist-hadjustment", Fgtk_clist_hadjustment, 1, 1, 0, /*
-Access the `hadjustment' slot of OBJ, a GtkCList object.
-*/
- (obj))
-{
- GtkCList *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCList", obj);
- };
-
- the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkAdjustment");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->hadjustment);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-clist-vadjustment", Fgtk_clist_vadjustment, 1, 1, 0, /*
-Access the `vadjustment' slot of OBJ, a GtkCList object.
-*/
- (obj))
-{
- GtkCList *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCList", obj);
- };
-
- the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkAdjustment");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->vadjustment);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-clist-sort-type", Fgtk_clist_sort_type, 1, 1, 0, /*
-Access the `sort_type' slot of OBJ, a GtkCList object.
-*/
- (obj))
-{
- GtkCList *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCList", obj);
- };
-
- the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkSortType");
- GTK_VALUE_ENUM (arg) = the_obj->sort_type;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-clist-focus-row", Fgtk_clist_focus_row, 1, 1, 0, /*
-Access the `focus_row' slot of OBJ, a GtkCList object.
-*/
- (obj))
-{
- GtkCList *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCList", obj);
- };
-
- the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gint");
- GTK_VALUE_INT (arg) = the_obj->focus_row;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-clist-sort-column", Fgtk_clist_sort_column, 1, 1, 0, /*
-Access the `sort_column' slot of OBJ, a GtkCList object.
-*/
- (obj))
-{
- GtkCList *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkCList", obj);
- };
-
- the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gint");
- GTK_VALUE_INT (arg) = the_obj->sort_column;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-list-children", Fgtk_list_children, 1, 1, 0, /*
-Access the `children' slot of OBJ, a GtkList object.
-*/
- (obj))
-{
- GtkList *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_LIST (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkList", obj);
- };
-
- the_obj = GTK_LIST (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkListOfObject");
- GTK_VALUE_POINTER (arg) = the_obj->children;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-list-selection", Fgtk_list_selection, 1, 1, 0, /*
-Access the `selection' slot of OBJ, a GtkList object.
-*/
- (obj))
-{
- GtkList *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_LIST (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkList", obj);
- };
-
- the_obj = GTK_LIST (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkListOfObject");
- GTK_VALUE_POINTER (arg) = the_obj->selection;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-tree-children", Fgtk_tree_children, 1, 1, 0, /*
-Access the `children' slot of OBJ, a GtkTree object.
-*/
- (obj))
-{
- GtkTree *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_TREE (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkTree", obj);
- };
-
- the_obj = GTK_TREE (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkListOfObject");
- GTK_VALUE_POINTER (arg) = the_obj->children;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-tree-root-tree", Fgtk_tree_root_tree, 1, 1, 0, /*
-Access the `root_tree' slot of OBJ, a GtkTree object.
-*/
- (obj))
-{
- GtkTree *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_TREE (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkTree", obj);
- };
-
- the_obj = GTK_TREE (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkTree");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->root_tree);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-tree-tree-owner", Fgtk_tree_tree_owner, 1, 1, 0, /*
-Access the `tree_owner' slot of OBJ, a GtkTree object.
-*/
- (obj))
-{
- GtkTree *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_TREE (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkTree", obj);
- };
-
- the_obj = GTK_TREE (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->tree_owner);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-tree-selection", Fgtk_tree_selection, 1, 1, 0, /*
-Access the `selection' slot of OBJ, a GtkTree object.
-*/
- (obj))
-{
- GtkTree *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_TREE (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkTree", obj);
- };
-
- the_obj = GTK_TREE (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkListOfObject");
- GTK_VALUE_POINTER (arg) = the_obj->selection;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-tree-item-subtree", Fgtk_tree_item_subtree, 1, 1, 0, /*
-Access the `subtree' slot of OBJ, a GtkTreeItem object.
-*/
- (obj))
-{
- GtkTreeItem *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_TREE_ITEM (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkTreeItem", obj);
- };
-
- the_obj = GTK_TREE_ITEM (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->subtree);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-scrolled-window-hscrollbar", Fgtk_scrolled_window_hscrollbar, 1, 1, 0, /*
-Access the `hscrollbar' slot of OBJ, a GtkScrolledWindow object.
-*/
- (obj))
-{
- GtkScrolledWindow *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkScrolledWindow", obj);
- };
-
- the_obj = GTK_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->hscrollbar);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-scrolled-window-vscrollbar", Fgtk_scrolled_window_vscrollbar, 1, 1, 0, /*
-Access the `vscrollbar' slot of OBJ, a GtkScrolledWindow object.
-*/
- (obj))
-{
- GtkScrolledWindow *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkScrolledWindow", obj);
- };
-
- the_obj = GTK_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("GtkWidget");
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->vscrollbar);
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-scrolled-window-hscrollbar-visible", Fgtk_scrolled_window_hscrollbar_visible, 1, 1, 0, /*
-Access the `hscrollbar_visible' slot of OBJ, a GtkScrolledWindow object.
-*/
- (obj))
-{
- GtkScrolledWindow *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkScrolledWindow", obj);
- };
-
- the_obj = GTK_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gboolean");
- GTK_VALUE_BOOL (arg) = the_obj->hscrollbar_visible;
- return (gtk_type_to_lisp (&arg));
-}
-
-DEFUN ("gtk-scrolled-window-vscrollbar-visible", Fgtk_scrolled_window_vscrollbar_visible, 1, 1, 0, /*
-Access the `vscrollbar_visible' slot of OBJ, a GtkScrolledWindow object.
-*/
- (obj))
-{
- GtkScrolledWindow *the_obj = NULL;
- GtkArg arg;
-
- CHECK_GTK_OBJECT (obj);
-
- if (!GTK_IS_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object))
- {
- wtaerror ("Object is not a GtkScrolledWindow", obj);
- };
-
- the_obj = GTK_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object);
- arg.type = gtk_type_from_name ("gboolean");
- GTK_VALUE_BOOL (arg) = the_obj->vscrollbar_visible;
- return (gtk_type_to_lisp (&arg));
-}
-
-void syms_of_widget_accessors (void)
-{
- DEFSUBR (Fgtk_scrolled_window_vscrollbar_visible);
- DEFSUBR (Fgtk_scrolled_window_hscrollbar_visible);
- DEFSUBR (Fgtk_scrolled_window_vscrollbar);
- DEFSUBR (Fgtk_scrolled_window_hscrollbar);
- DEFSUBR (Fgtk_tree_item_subtree);
- DEFSUBR (Fgtk_tree_selection);
- DEFSUBR (Fgtk_tree_tree_owner);
- DEFSUBR (Fgtk_tree_root_tree);
- DEFSUBR (Fgtk_tree_children);
- DEFSUBR (Fgtk_list_selection);
- DEFSUBR (Fgtk_list_children);
- DEFSUBR (Fgtk_clist_sort_column);
- DEFSUBR (Fgtk_clist_focus_row);
- DEFSUBR (Fgtk_clist_sort_type);
- DEFSUBR (Fgtk_clist_vadjustment);
- DEFSUBR (Fgtk_clist_hadjustment);
- DEFSUBR (Fgtk_clist_columns);
- DEFSUBR (Fgtk_clist_rows);
- DEFSUBR (Fgtk_paned_child2_shrink);
- DEFSUBR (Fgtk_paned_child1_shrink);
- DEFSUBR (Fgtk_paned_child2_resize);
- DEFSUBR (Fgtk_paned_child1_resize);
- DEFSUBR (Fgtk_paned_child2);
- DEFSUBR (Fgtk_paned_child1);
- DEFSUBR (Fgtk_object_ref_count);
- DEFSUBR (Fgtk_object_flags);
- DEFSUBR (Fgtk_plug_same_app);
- DEFSUBR (Fgtk_plug_socket_window);
- DEFSUBR (Fgtk_input_dialog_save_button);
- DEFSUBR (Fgtk_input_dialog_close_button);
- DEFSUBR (Fgtk_dialog_action_area);
- DEFSUBR (Fgtk_dialog_vbox);
- DEFSUBR (Fgtk_color_selection_dialog_help_button);
- DEFSUBR (Fgtk_color_selection_dialog_cancel_button);
- DEFSUBR (Fgtk_color_selection_dialog_reset_button);
- DEFSUBR (Fgtk_color_selection_dialog_ok_button);
- DEFSUBR (Fgtk_color_selection_dialog_main_vbox);
- DEFSUBR (Fgtk_color_selection_dialog_colorsel);
- DEFSUBR (Fgtk_font_selection_dialog_cancel_button);
- DEFSUBR (Fgtk_font_selection_dialog_apply_button);
- DEFSUBR (Fgtk_font_selection_dialog_ok_button);
- DEFSUBR (Fgtk_font_selection_dialog_action_area);
- DEFSUBR (Fgtk_font_selection_dialog_main_vbox);
- DEFSUBR (Fgtk_font_selection_dialog_fontsel);
- DEFSUBR (Fgtk_file_selection_action_area);
- DEFSUBR (Fgtk_file_selection_help_button);
- DEFSUBR (Fgtk_file_selection_cancel_button);
- DEFSUBR (Fgtk_file_selection_ok_button);
- DEFSUBR (Fgtk_file_selection_main_vbox);
- DEFSUBR (Fgtk_file_selection_selection_text);
- DEFSUBR (Fgtk_file_selection_selection_entry);
- DEFSUBR (Fgtk_file_selection_file_list);
- DEFSUBR (Fgtk_file_selection_dir_list);
- DEFSUBR (Fgtk_text_vadj);
- DEFSUBR (Fgtk_text_hadj);
- DEFSUBR (Fgtk_notebook_tab_pos);
- DEFSUBR (Fgtk_check_menu_item_active);
- DEFSUBR (Fgtk_gamma_curve_gamma_text);
- DEFSUBR (Fgtk_gamma_curve_gamma_dialog);
- DEFSUBR (Fgtk_gamma_curve_gamma);
- DEFSUBR (Fgtk_gamma_curve_curve);
- DEFSUBR (Fgtk_gamma_curve_table);
- DEFSUBR (Fgtk_combo_list);
- DEFSUBR (Fgtk_combo_popwin);
- DEFSUBR (Fgtk_combo_popup);
- DEFSUBR (Fgtk_combo_button);
- DEFSUBR (Fgtk_combo_entry);
- DEFSUBR (Fgtk_button_button_down);
- DEFSUBR (Fgtk_button_in_button);
- DEFSUBR (Fgtk_button_child);
- DEFSUBR (Fgtk_widget_parent);
- DEFSUBR (Fgtk_widget_name);
- DEFSUBR (Fgtk_widget_state);
- DEFSUBR (Fgtk_widget_window);
- DEFSUBR (Fgtk_widget_style);
- DEFSUBR (Fgtk_adjustment_page_size);
- DEFSUBR (Fgtk_adjustment_page_increment);
- DEFSUBR (Fgtk_adjustment_step_increment);
- DEFSUBR (Fgtk_adjustment_value);
- DEFSUBR (Fgtk_adjustment_upper);
- DEFSUBR (Fgtk_adjustment_lower);
-}
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d src/emacs.c
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2393,8 +2393,10 @@
#ifdef HAVE_GTK
reinit_vars_of_event_gtk ();
+#ifdef HAVE_MENUBARS
reinit_vars_of_menubar_gtk ();
#endif
+#endif
#ifdef HAVE_X_WINDOWS
reinit_vars_of_device_x ();
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d src/event-gtk.c
--- a/src/event-gtk.c
+++ b/src/event-gtk.c
@@ -1343,6 +1343,7 @@
processing so send a null event into XEmacs to make sure it
does nothing.
*/
+#if 0
if (!NILP (Vmenu_accelerator_enabled)
&& gtk_accel_groups_activate(GTK_OBJECT (FRAME_GTK_SHELL_WIDGET(frame)),
key_event->keyval,
@@ -1352,6 +1353,7 @@
return 1;
}
#endif
+#endif
/* This used to compute the frame from the given X window and
store it here, but we really don't care about the frame. */
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -239,6 +239,7 @@
extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
+ //gf = gdk_font_load_for_display (extname);
gf = gdk_font_load (extname);
if (!gf)
@@ -459,9 +460,16 @@
Lisp_Object
__get_gtk_font_truename (GdkFont *gdk_font, int expandp)
{
- Display *dpy = GDK_FONT_XDISPLAY (gdk_font);
- GSList *names = ((GdkFontPrivate *) gdk_font)->names;
+ //Display *dpy = GDK_FONT_XDISPLAY (gdk_font);
+ //GSList *names = ((GdkFontPrivate *) gdk_font)->names;
Lisp_Object font_name = Qnil;
+ char *name = (char *) gdk_x11_font_get_name (gdk_font);
+
+ //name = GDK_FONT_X_FONT (gdk_font);
+ if (name != NULL)
+ font_name = build_cistring (name);
+
+#if 0
while (names)
{
@@ -492,6 +500,7 @@
}
names = names->next;
}
+#endif
return (font_name);
}
diff -r 4a6723a89edf55732f2fa5189409d85acae3d798 -r 4073c6301f0a897d3a40150fa44aeaee47ea066d src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -681,7 +681,7 @@
}
extern gboolean emacs_shell_event_handler (GtkWidget *wid, GdkEvent *event, gpointer closure);
-extern Lisp_Object build_gtk_object (GtkObject *obj);
+extern Lisp_Object build_gtk_object (GObject *obj);
#ifndef GNOME_IS_APP
#define GNOME_IS_APP(x) 0
@@ -935,9 +935,9 @@
gtk_widget_set_name (container, "XEmacs::container");
gtk_widget_set_name (text, "XEmacs::text");
- FRAME_GTK_LISP_WIDGETS(f)[0] = build_gtk_object (GTK_OBJECT (shell));
- FRAME_GTK_LISP_WIDGETS(f)[1] = build_gtk_object (GTK_OBJECT (container));
- FRAME_GTK_LISP_WIDGETS(f)[2] = build_gtk_object (GTK_OBJECT (text));
+ FRAME_GTK_LISP_WIDGETS(f)[0] = build_gtk_object (G_OBJECT (shell));
+ FRAME_GTK_LISP_WIDGETS(f)[1] = build_gtk_object (G_OBJECT (container));
+ FRAME_GTK_LISP_WIDGETS(f)[2] = build_gtk_object (G_OBJECT (text));
gtk_widget_realize (shell);
}
This diff is so big that we needed to truncate the remainder.
https://bitbucket.org/xemacs/xemacs/commits/7a6a7debe55d/
Changeset: 7a6a7debe55d
User: jsparkes
Date: 2010-05-03 12:48:39+00:00
Summary: made from autoconf, don't care about it.
Affected #: 1 file
This diff is so big that we needed to truncate the remainder.
https://bitbucket.org/xemacs/xemacs/commits/0ce1652df389/
Changeset: 0ce1652df389
User: jsparkes
Date: 2010-05-03 13:27:33+00:00
Summary: Fix badly merged code.
Use GdkFont instead of PangoFontDescription.
Affected #: 17 files
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 lisp/gtk-mouse.el
--- a/lisp/gtk-mouse.el
+++ b/lisp/gtk-mouse.el
@@ -35,6 +35,7 @@
(defvar gtk-pointers-initialized nil)
(defun gtk-init-pointers ()
+ (setq gtk-pointers-initialized t) ;; --jsparkes
(if gtk-pointers-initialized
nil
(set-glyph-image text-pointer-glyph
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -107,7 +107,7 @@
extern Lisp_Object
xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w);
-extern Lisp_Object __get_gtk_font_truename (PangoFontDescription *gdk_font,
+extern Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font,
int expandp);
#define convert_font(f) __get_gtk_font_truename (f, 0)
@@ -668,7 +668,8 @@
FROB_COLOR (base, "base");
#undef FROB_COLOR
- result = nconc2 (result, list2 (Qfont, convert_font (style->font_desc)));
+ result = nconc2 (result, list2 (Qfont,
+ convert_font (gtk_style_get_font (style))));
#define FROB_PIXMAP(state) (style->rc_style->bg_pixmap_name[state] ? build_cistring (style->rc_style->bg_pixmap_name[state]) : Qnil)
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 src/glade.c
--- a/src/glade.c
+++ b/src/glade.c
@@ -22,7 +22,7 @@
** You should have received a copy of the GNU General Public License
** along with XEmacs; see the file COPYING. If not, write to
** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
-** Boston, MA 02111-1301, USA. */
+** Boston, MA 02111-1301, USA.
*/
#if defined(HAVE_GLADE_H) || defined(HAVE_GLADE_GLADE_H)
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 src/gui-gtk.c
--- a/src/gui-gtk.c
+++ b/src/gui-gtk.c
@@ -50,7 +50,8 @@
void
gcpro_popup_callbacks (GUI_ID id, Lisp_Object data)
{
- Vpopup_callbacks = Fcons (Fcons (make_int (id), data), Vpopup_callbacks);
+ Vpopup_callbacks = Fcons (Fcons (make_int (GPOINTER_TO_UINT (id)), data),
+ Vpopup_callbacks);
}
void
@@ -64,7 +65,7 @@
Lisp_Object
get_gcpro_popup_callbacks (GUI_ID id)
{
- Lisp_Object lid = make_int (id);
+ Lisp_Object lid = make_int (GPOINTER_TO_UINT (id));
Lisp_Object this_callback = assq_no_quit (lid, Vpopup_callbacks);
if (!NILP (this_callback))
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -1693,9 +1693,11 @@
height, x, y);
#else /* THIS_IS_GTK */
USED (dpy);
+ #ifdef JSPARKES
gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc,
IMAGE_INSTANCE_GTK_PIXMAP (p),
xoffset, yoffset, x, y, width, height);
+ #endif
#endif /* THIS_IS_GTK */
}
else
@@ -1706,9 +1708,11 @@
xoffset, yoffset, width, height, x, y, 1L);
#else /* THIS_IS_GTK */
USED (dpy);
+ #ifdef JSPARKES
our_draw_bitmap (GDK_DRAWABLE (x_win), gc,
IMAGE_INSTANCE_GTK_PIXMAP (p),
xoffset, yoffset, x, y, width, height);
+ #endif
#endif /* THIS_IS_GTK */
}
}
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -82,8 +82,8 @@
scrollbar_drag_hack_cb (GtkWidget *UNUSED (w), GdkEventButton *UNUSED (ev),
gpointer v)
{
- vertical_drag_in_progress = (int) v;
- inhibit_slider_size_change = (int) v;
+ vertical_drag_in_progress = GPOINTER_TO_INT (v);
+ inhibit_slider_size_change = GPOINTER_TO_INT (v);
return (FALSE);
}
@@ -398,10 +398,10 @@
scrollbar_cb (GtkAdjustment *adj, gpointer user_data)
{
/* This function can GC */
- int vertical = (int) user_data;
+ int vertical = GPOINTER_TO_INT (user_data);
struct frame *f = (struct frame*) gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_FRAME_IDENTIFIER);
struct scrollbar_instance *instance;
- GUI_ID id = (GUI_ID) gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_GUI_IDENTIFIER);
+ GUI_ID id = GPOINTER_TO_UINT (gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_GUI_IDENTIFIER));
Lisp_Object win, frame;
struct window_mirror *mirror;
Lisp_Object event_type = Qnil;
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 src/scrollbar-gtk.h
--- a/src/scrollbar-gtk.h
+++ b/src/scrollbar-gtk.h
@@ -45,7 +45,7 @@
struct gtk_scrollbar_data
{
/* Unique scrollbar identifier and name. */
- unsigned int id;
+ guint id;
/* Is set if we have already set the backing_store attribute correctly */
char backing_store_initialized;
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 src/sysgtk.h
--- a/src/sysgtk.h
+++ b/src/sysgtk.h
@@ -34,5 +34,6 @@
#include <gtk/gtkfixed.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
+#include <glib.h>
#endif /* INCLUDED_sysgtk_h_ */
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 src/ui-byhand.c
--- a/src/ui-byhand.c
+++ b/src/ui-byhand.c
@@ -492,7 +492,7 @@
static void
__remove_gcpro_by_id (gpointer user_data, GObject *old_location)
{
- ungcpro_popup_callbacks ((GUI_ID) user_data);
+ ungcpro_popup_callbacks ((GUI_ID) GPOINTER_TO_UINT (user_data));
}
static void
diff -r 7a6a7debe55ddb0d1249fb957e0144ed83b832ed -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -56,8 +56,8 @@
Lisp_Object gtk_type_to_lisp (GValue *arg);
int lisp_to_gtk_type (Lisp_Object obj, GValue *arg);
+#if 0
int lisp_to_gtk_ret_type (Lisp_Object obj, GValue *arg);
-#if 0
void describe_gtk_arg (GType *arg);
#endif
gint symbol_to_gtk_enum (Lisp_Object obj, GValue *);
@@ -1102,7 +1102,8 @@
signal_fake_event ();
if (G_VALUE_TYPE (&args[n_args]) != G_TYPE_NONE)
- lisp_to_gtk_ret_type (rval, &args[n_args]);
+ //lisp_to_gtk_ret_type (rval, &args[n_args]);
+ lisp_to_gtk_type (rval, &args[n_args]);
UNGCPRO;
}
@@ -1541,7 +1542,7 @@
}
#endif
-Lisp_Object gtk_type_to_lisp (const GValue *arg)
+Lisp_Object gtk_type_to_lisp (GValue *arg)
{
if (G_TYPE_IS_FUNDAMENTAL (G_VALUE_TYPE (arg)))
{
@@ -1912,7 +1913,7 @@
*/
int lisp_to_gtk_ret_type (Lisp_Object obj, GValue *arg)
{
- switch (GTK_FUNDAMENTAL_TYPE (arg->type))
+ switch (G_TYPE_FUNDAMENTAL (G_VALUE_TYPE (arg)))
{
/* flag types */
case G_TYPE_NONE:
@@ -1923,7 +1924,8 @@
CHECK_CHAR_COERCE_INT (obj);
c = XCHAR (obj);
- *(GTK_RETLOC_CHAR (*arg)) = c;
+ //*(GTK_RETLOC_CHAR (*arg)) = c;
+ g_value_set_char (arg, c);
}
break;
case G_TYPE_UCHAR:
@@ -1932,11 +1934,13 @@
CHECK_CHAR_COERCE_INT (obj);
c = XCHAR (obj);
- *(GTK_RETLOC_CHAR (*arg)) = c;
+ //*(GTK_RETLOC_CHAR (*arg)) = c;
+ g_value_set_uchar (arg, (unsigned char) c);
}
break;
case G_TYPE_BOOLEAN:
- *(GTK_RETLOC_BOOL (*arg)) = NILP (obj) ? FALSE : TRUE;
+ //*(GTK_RETLOC_BOOL (*arg)) = NILP (obj) ? FALSE : TRUE;
+ g_value_set_boolean (arg, NILP (obj) ? FALSE : TRUE);
break;
case G_TYPE_INT:
case G_TYPE_UINT:
@@ -1947,7 +1951,8 @@
gint in the header files, but actually treat it like a
bool. *sigh*
*/
- *(GTK_RETLOC_INT(*arg)) = NILP (obj) ? 0 : 1;
+ // *(GTK_RETLOC_INT(*arg)) = NILP (obj) ? 0 : 1;
+ g_value_set_int (arg, NILP (obj) ? 0 : 1);
}
else
{
@@ -2183,10 +2188,8 @@
return (0);
}
+#endif
-#endif
-
-/* This is used in glyphs-gtk.c as well */
static Lisp_Object
get_enumeration (const GValue *arg)
{
https://bitbucket.org/xemacs/xemacs/commits/f0cadc51a60c/
Changeset: f0cadc51a60c
User: jsparkes
Date: 2010-05-03 19:05:21+00:00
Summary: Almost reasonable display of text.
The descender area seems to have reverse video display.
Affected #: 3 files
diff -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 -r f0cadc51a60c1c4bc7f6dbd2ead6e213363eaf97 src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -234,12 +234,12 @@
Lisp_Object UNUSED (device), Error_Behavior errb)
{
GdkFont *gf;
- XFontStruct *xf;
const char *extname;
extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
- //gf = gdk_font_load_for_display (extname);
+ /* Load font or fontset? */
+ /* gf = gdk_font_load_for_display (extname); --jsparkes */
gf = gdk_font_load (extname);
if (!gf)
@@ -249,77 +249,22 @@
return 0;
}
- xf = (XFontStruct*) GDK_FONT_XFONT (gf);
-
/* Don't allocate the data until we're sure that we will succeed,
or the finalize method may get fucked. */
f->data = xnew (struct gtk_font_instance_data);
FONT_INSTANCE_GTK_FONT (f) = gf;
+ /* Kludge until we support Pango. --jsparkes */
f->ascent = gf->ascent;
f->descent = gf->descent;
f->height = gf->ascent + gf->descent;
-
- /* Now lets figure out the width of the font */
- {
- /* following change suggested by Ted Phelps <phelps(a)dstc.edu.au> */
- unsigned int def_char = 'n'; /*xf->default_char;*/
- unsigned int byte1, byte2;
-
- once_more:
- byte1 = def_char >> 8;
- byte2 = def_char & 0xFF;
-
- if (xf->per_char)
- {
- /* Old versions of the R5 font server have garbage (>63k) as
- def_char. 'n' might not be a valid character. */
- if (byte1 < xf->min_byte1 ||
- byte1 > xf->max_byte1 ||
- byte2 < xf->min_char_or_byte2 ||
- byte2 > xf->max_char_or_byte2)
- f->width = 0;
- else
- f->width = xf->per_char[(byte1 - xf->min_byte1) *
- (xf->max_char_or_byte2 -
- xf->min_char_or_byte2 + 1) +
- (byte2 - xf->min_char_or_byte2)].width;
- }
- else
- f->width = xf->max_bounds.width;
+ f->height = gf->ascent;
- /* Some fonts have a default char whose width is 0. This is no good.
- If that's the case, first try 'n' as the default char, and if n has
- 0 width too (unlikely) then just use the max width. */
- if (f->width == 0)
- {
- if (def_char == xf->default_char)
- f->width = xf->max_bounds.width;
- else
- {
- def_char = xf->default_char;
- goto once_more;
- }
- }
- }
-
- /* If all characters don't exist then there could potentially be
- 0-width characters lurking out there. Not setting this flag
- trips an optimization that would make them appear to have width
- to redisplay. This is bad. So we set it if not all characters
- have the same width or if not all characters are defined.
- */
- /* #### This sucks. There is a measurable performance increase
- when using proportional width fonts if this flag is not set.
- Unfortunately so many of the fucking X fonts are not fully
- defined that we could almost just get rid of this damn flag and
- make it an assertion. */
- f->proportional_p = (xf->min_bounds.width != xf->max_bounds.width ||
- (/* x_handle_non_fully_specified_fonts */ 0 &&
- !xf->all_chars_exist));
-#if 0
- f->width = gdk_char_width (gf, 'n');
- f->proportional_p = (gdk_char_width (gf, '|') != gdk_char_width (gf, 'W')) ? 1 : 0;
-#endif
+ /* Now lets figure out the width of the font.
+ We could use a longer string and get the averaage length */
+ /* f->width = gdk_text_width (gf, "abcdefghijklmnopqrstuvwxyz", 26)/26; */
+ f->width = gdk_text_width (gf, "n", 1); /* em or en? */
+ f->proportional_p = (gdk_text_width (gf, "|", 1) !=
+ gdk_text_width (gf, "W", 1));
return 1;
}
diff -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 -r f0cadc51a60c1c4bc7f6dbd2ead6e213363eaf97 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -861,7 +861,8 @@
gtk_initialize_pixmap_image_instance (ii, IMAGE_COLOR_PIXMAP);
- gdk_window_get_geometry (gdk_pixmap, NULL, NULL, &width, &height, &depth);
+ depth = gdk_drawable_get_depth (pixmap);
+ gdk_drawable_get_size (pixmap, &w, &h);
IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = Qnil;
IMAGE_INSTANCE_GTK_PIXMAP (ii) = gdk_pixmap;
@@ -1249,7 +1250,7 @@
int force_mono;
gint w, h;
struct gcpro gcpro1, gcpro2, gcpro3;
- const Binbyte * volatile dstring;
+ const Extbyte * volatile dstring;
if (!DEVICE_GTK_P (XDEVICE (device)))
gui_error ("Not a Gtk device", device);
@@ -1282,8 +1283,6 @@
&nsymbols);
assert (!NILP (data));
- ABORT ();
-#if 0
dstring = LISP_STRING_TO_EXTERNAL (data, Qbinary);
/*
@@ -1335,7 +1334,8 @@
if (!pixmap)
signal_image_error ("Error reading pixmap", data);
- gdk_window_get_geometry (pixmap, NULL, NULL, &w, &h, &depth);
+ depth = gdk_drawable_get_depth (pixmap);
+ gdk_drawable_get_size (pixmap, &w, &h);
IMAGE_INSTANCE_GTK_PIXMAP (ii) = pixmap;
IMAGE_INSTANCE_PIXMAP_MASK (ii) = mask;
@@ -1370,7 +1370,6 @@
default:
ABORT ();
}
-#endif
UNGCPRO;
}
#endif /* HAVE_XPM */
@@ -1497,11 +1496,12 @@
static guint resource_name_to_resource (Lisp_Object name,
enum image_instance_type type)
{
-#if 0
if (type == IMAGE_POINTER)
- return (symbol_to_gtk_enum (name, GTK_TYPE_GDK_CURSOR_TYPE));
+ {
+ // return (symbol_to_gtk_enum (name, G_TYPE_ENUM));
+ return 1;
+ }
else
-#endif
return (0);
}
@@ -1510,7 +1510,7 @@
{
if (EQ (data, Qcursor))
return IMAGE_POINTER;
-#if 0
+#ifdef JSPARKES
else if (EQ (data, Qicon))
return IMAGE_ICON;
else if (EQ (data, Qbitmap))
diff -r 0ce1652df389b166e62e77d8399f2abf52b8e0d4 -r f0cadc51a60c1c4bc7f6dbd2ead6e213363eaf97 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -1711,7 +1711,11 @@
}
break;
case G_TYPE_ENUM:
- g_value_set_enum (arg, symbol_to_gtk_enum (obj, arg));
+ {
+ GValue enumValue;
+ gint val = symbol_to_gtk_enum (obj, &enumValue);
+ g_value_set_enum (arg, val);
+ }
break;
case G_TYPE_FLAGS:
/* Convert a lisp symbol to a GTK enum */
@@ -2188,8 +2192,10 @@
return (0);
}
+
#endif
-
+
+/* This is used in glyphs-gtk.c as well */
static Lisp_Object
get_enumeration (const GValue *arg)
{
https://bitbucket.org/xemacs/xemacs/commits/8f7b9898f13c/
Changeset: 8f7b9898f13c
User: jsparkes
Date: 2010-05-03 19:38:59+00:00
Summary: Make the default scrollbar wide enough to be clearly visible.
Affected #: 1 file
diff -r f0cadc51a60c1c4bc7f6dbd2ead6e213363eaf97 -r 8f7b9898f13cd67a2c7572d8e84d8519818cdad8 src/gtk-xemacs.c
--- a/src/gtk-xemacs.c
+++ b/src/gtk-xemacs.c
@@ -209,7 +209,7 @@
// Note: where do I get this? -- jsparkes
//slider_size = style->slider_width;
- slider_size = 4;
+ slider_size = 10;
hsize = slider_size + (style->ythickness * 2);
vsize = slider_size + (style->xthickness * 2);
https://bitbucket.org/xemacs/xemacs/commits/c5431298bd02/
Changeset: c5431298bd02
User: jsparkes
Date: 2010-05-03 19:39:47+00:00
Summary: Live with ascent/descent information form GdkFont.
Since we're currently using Xft functions to draw the text,
there are mismatches. Calling pango....
Affected #: 1 file
diff -r 8f7b9898f13cd67a2c7572d8e84d8519818cdad8 -r c5431298bd02d6fe785878ec63b9b480b9a6ac68 src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -257,7 +257,6 @@
f->ascent = gf->ascent;
f->descent = gf->descent;
f->height = gf->ascent + gf->descent;
- f->height = gf->ascent;
/* Now lets figure out the width of the font.
We could use a longer string and get the averaage length */
https://bitbucket.org/xemacs/xemacs/commits/3d8d69882391/
Changeset: 3d8d69882391
User: jsparkes
Date: 2010-05-03 21:30:57+00:00
Summary: Merge from work.
Affected #: 28 files
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 CHANGES-beta
--- a/CHANGES-beta
+++ b/CHANGES-beta
@@ -2,26 +2,50 @@
by Ben Wing:
-debugging:
+Debugging (Lisp level):
-- make objects consistently print a UID, with a separate number space per
object type
-- add variable `debug-soe' for debugging stack-of-extents code in extents.c
+-- add variable debug-regexps for debugging regexp code, takes list of areas
+ to show info about
-- correctly note pdumped objects in memory-usage stats returned by
`garbage-collect' and `object-memory-usage-stats'.
-- make VDB debugging functions (e.g. `test-segfault', which causes an
immediate crash!) conditional on `--with-debug'
-- rename `debug-xemacs-searches' -> `debug-searches'
+-- rename `xft-debug-level' -> `debug-xft'
+-- rename `debug-x-objects' -> `debug-x-fonts'
-- Turn on "compiled-function annotation hack" so that compiled-function
objects print the function they are assigned to
-- Resurrect byte-metering code when --with-debug; enable with variables
`byte-code-meter', `byte-metering-on'
-- Add more checks for invalid byte code; when a byte-code-related crash
occurs, output the last 100 instructions processed
-
-documentation:
+-- Improved memory-usage mechanism -- removal of `*-memory-usage' in favor
+ of generalized `object-memory-usage'; `show-memory-usage' and
+ `show-object-memory-usage-stats' show, in addition to regular object usage,
+ associated non-Lisp usage as well as ancillary Lisp object usage;
+ `garbage-collect' and `object-memory-usage-stats' return information on
+ storage overhead, associated non-Lisp usage and ancillary Lisp usage
+
+Lisp documentation:
-- fix to `previous/next-single[-char]-property-change'
+-- Document the keywords to the various sequence/list functions:
+ reduce, fill, replace, remove*, remove-if, remove-if-not, delete*,
+ delete-if, delete-if-not, remove-duplicates, delete-duplicates,
+ substitute, substitute-if, substitute-if-not, nsubstitute,
+ nsubstitute-if, nsubstitute-if-not, find, find-if, find-if-not,
+ position, position-if, position-if-not, count, count-if, count-if-not,
+ mismatch, search, sort*, stable-sort, merge, member*, member-if,
+ member-if-not, assoc*, assoc-if, assoc-if-not, rassoc*, rassoc-if,
+ rassoc-if-not, union, nunion, intersection, nintersection,
+ set-difference, nset-difference, set-exclusive-or, nset-exclusive-or,
+ subsetp, subst-if, subst-if-not, nsubst, nsubst-if, nsubst-if-not,
+ sublis, nsublis, tree-equal, cl-tree-equal-rec, pushnew, adjoin, subst
+-- fix so that Common-Lisp argument lists get properly displayed in
+ function documentation
Lisp API:
@@ -38,56 +62,300 @@
-- In `scan-lists' and friends, when an error occurs, return a `scan-error'
along with two arguments specifying the range in which the error occurred,
for GNU compatibility
-
-Internals:
+-- Functions for dealing with conditional compilation of code depending on
+ presence or absence of features:
+ -- error-unless-tests-match -- signal an error unless a test expression
+ matches when file is compiled and loaded
+ -- byte-compile-file-being-compiled -- return name of file being
+ byte-compiled
+ -- compiled-if, compiled-when -- like `if' or `when' but test is evaluated
+ at compile time
+-- Functions for doing stable set operations
+ -- stable-union, stable-intersection
+
+Internals: Lisp objects
-- reduce lcrecord header size from 3 words to 2
-- major change to the way Lisp objects are defined and declared; introduce
a cleaner surface-layer API that eliminates references to "lrecords" and
"lcrecords", and uses "frob-block object" in place of "basic object"/
- "simple object"/etc.
+ "simple object"/etc.:
+
+ Renamed:
+
+ ALLOC_LCRECORD_TYPE -> ALLOC_NORMAL_LISP_OBJECT (returns a Lisp object
+ rather than a pointer)
+ ALLOCATE_FIXED_TYPE_AND_SET_IMPL -> ALLOC_FROB_BLOCK_LISP_OBJECT
+ BASIC_ALLOC_LCRECORD -> ALLOC_SIZED_LISP_OBJECT
+ DEFINE_LRECORD_IMPLEMENTATION -> DEFINE_*_LISP_OBJECT
+ DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION -> DEFINE_*SIZABLE_*LISP_OBJECT
+ DEFINE_LRECORD_*IMPLEMENTATION_WITH_PROPS -> DEFINE_*LISP_OBJECT, and
+ use OBJECT_HAS_METHOD() for the getprop, etc. methods
+ DEFINE_BASIC_LRECORD_IMPLEMENTATION -> DEFINE_*FROB_BLOCK_LISP_OBJECT
+ DEFINE_DUMPABLE_*/DEFINE_NODUMP_* instead of a 0 or 1 dumpable flag
+ DEFINE_*INTERNAL_* for "internal" Lisp objects (shouldn't escape
+ to Lisp)
+ DEFINE_EXTERNAL_* -> DEFINE_MODULE_*
+ MAKE_LRECORD_IMPLEMENTATION -> MAKE_LISP_OBJECT
+ MAKE_EXTERNAL_LRECORD_IMPLEMENTATION -> MAKE_MODULE_LISP_OBJECT
+ DECLARE_LRECORD -> DECLARE_LISP_OBJECT
+ INIT_LRECORD_IMPLEMENTATION -> INIT_LISP_OBJECT
+ LCRECORD_HEADER -> NORMAL_LISP_OBJECT_HEADER
+ alloc_lrecord -> alloc_sized_lrecord (since it takes a size)
+ printing_unreadable_object -> printing_unreadable_object_fmt
+ printing_unreadable_lcrecord -> printing_unreadable_lisp_object
+
+ New:
+
+ lisp_object_storage_size() -- storage used for Lisp object including
+ overhead
+ LISP_OBJECT_UID() -- UID of Lisp object
+ zero_sized_lisp_object() -- zero out a Lisp object of variable size
+ zero_nonsized_lisp_object() -- zero out a Lisp object of fixed size
+ free_normal_lisp_object() -- free a non-frob-block Lisp object
+ LISP_OBJECT_FROB_BLOCK_P() -- return whether a Lisp object is a
+ frob-block object
+ IF_OLD_GC, IF_NEW_GC -- simplify declaration of Lisp objects w.r.t. NEW-GC
+ when a finalizer may exist in one but not the
+ other
+
+ Eliminated:
+
+ free_lrecord()
+ FREE_LISP_OBJECT():
+ Use free_normal_lisp_object()
+
+ old_zero_lcrecord()
+ old_zero_sized_lcrecord()
+ ZERO_LISP_OBJECT()
+ zero_lrecord():
+ Use zero_sized_lisp_object(), zero_nonsized_lisp_object()
+
+ copy_lrecord()
+ copy_sized_lrecord()
+ old_copy_lcrecord()
+ old_copy_sized_lcrecord()
+ COPY_SIZED_LISP_OBJECT()
+ COPY_SIZED_LCRECORD()
+ COPY_LISP_OBJECT():
+ Use copy_lisp_object()
+
+ LISP_OBJECT_STORAGE_SIZE():
+ Use lisp_object_storage_size()
+
-- new disksave method for Lisp objects, separated out from the finalize method
+-- new, non-static way of initializing Lisp object methods; used for disksave,
+ getprop, putprop, remprop, object_plist, various memory-usage methods:
+ OBJECT_HAS_METHOD(), OBJECT_HAS_PROPERTY(), etc.
-- Lisp objects now must specify a print method; use either
internal_object_printer() or external_object_printer() as a default
-- equal method for Lisp objects has new `foldcase' param, to implement
case-folding comparison ala `equalp'
--- various changes to frame-geometry macros in frame-impl.h, gutter.h, etc.,
- and frame-sizing code in frame.c
--- Major rewrite, updated documentation to dynarr functions and macros
--- Major updates to internals manual and long comments in C files:
- frame geometry, specifier authors, MS-Windows compilation flags, xlike
- mechanism, ...
+-- Each type of Lisp object has separate UID space
+-- Redo and generalize memory-usage mechanism, add memory-usage methods for
+ various objects; the following objects now have memory-usage methods:
+ buffers, case tables, hash tables, frames, charsets, scrollbar instances,
+ specifiers, windows, window mirrors
-- Rename LISP_TO_VOID -> STORE_LISP_IN_VOID,
VOID_TO_LISP -> GET_LISP_FROM_VOID; add STORE_VOID_IN_LISP,
GET_VOID_FROM_LISP
+-- Other renames:
+ XD_LISP_OBJECT_BLOCK_PTR -> XD_INLINE_LISP_OBJECT_BLOCK_PTR
+-- Other new functions and macros:
+ lisp_object_memory_usage() -- memory usage of Lisp object, including
+ associated non-Lisp usage and ancillary Lisp
+ usage
+ tree_memory_usage() -- memory usage of a tree of conses and/or vectors
+ SAFE_LIST_LOOP_* -- loop over a possibly invalid list without signalling
+ an error
+ listn() -- variable-argument list creation, number of arguments specified
+ listu() -- variable-argument list creation, terminated with Qunbound
+
+-- Make the first lrecord type have value 1 not 0 so that attempts to
+ interpret 0'd memory as a Lisp object will fail more obviously
+
+Internals: Arrays and Tables
+
+-- Major rewrite, updated documentation to dynarr functions and macros
+
+ Rename:
+
+ Dynarr_add_lisp_string -> Dynarr_add_ext_lisp_string
+ Dynarr_set_length -> Dynarr_set_lengthr ("restricted")
+ Dynarr_increment -> Dynarr_incrementr
+ Dynarr_resize_if -> Dynarr_resize_to_add
+
+ New functions:
+
+ Dynarr_elsize = dy->elsize_
+ Dynarr_set_length(): Set length, resizing as necessary
+ Dynarr_set_length_and_zero(): Set length, resizing as necessary,
+ zeroing out new elements
+ Dynarr_increase_length(), Dynarr_increase_length_and_zero():
+ Optimization of Dynarr_set_length(), Dynarr_set_length_and_zero()
+ when size is known to increase
+ Dynarr_resize_to_fit(): Resize as necessary to fit a given length.
+ Dynarr_set(): Set element at a given position, increasing length
+ as necessary and setting any newly created positions to 0
+ ERROR_CHECK_DYNARR, dynarr_checking_assert()
+
+-- Extracted and generalized gap array code from extents.c to array.c
+-- Rewrite range tables to use gap arrays; redo put_range_table() so it's
+ O(log n) when adding a localized range
+
+Internals: Misc
+
+-- Collect allocation-statistics code in one place
+-- if (...) ABORT (); --> assert ();
+-- various changes to frame-geometry macros in frame-impl.h, gutter.h, etc.,
+ and frame-sizing code in frame.c:
+ -- TOP_BORDER, BOTTOM_BORDER, etc. -> TOP_EDGE, BOTTOM_EDGE, etc.
+ -- GUTTER_POS_LOOP -> EDGE_POS_LOOP
+ -- hardcoded use of '4' -> NUM_EDGES
+ -- default_face_height_and_width -> default_face_width_and_height, with
+ arguments reversed
+ -- width/height arguments reversed in the following, to put width first:
+ -- default_face_font_info
+ -- default_face_height_and_width (see above)
+ -- check_frame_size
+ -- frame_size_valid_p (made into a static function)
+ -- change_frame_size and
+ -- change_frame_size_1
+ -- FRAME_BORDER_* -> FRAME_INTERNAL_BORDER_*
+ -- new FRAME_INTERNAL_BORDER_SIZE(), FRAME_REAL_TOOLBAR_BOUNDS()
+ -- pixel_to_char_size -> pixel_to_frame_unit_size
+ -- char_to_pixel_size -> frame_unit_to_pixel_size
+ -- pixel_to_real_char_size -> pixel_to_char_size
+ -- char_to_real_pixel_size -> char_to_pixel_size
+ -- Eliminate old round_size_to_char, because it didn't really
+ do anything differently from round_size_to_real_char()
+ -- round_size_to_real_char -> round_size_to_char; any places that
+ called the old round_size_to_char should just call the new one.
+-- Major updates to internals manual and long comments in C files:
+ frame geometry, specifier authors, MS-Windows compilation flags, xlike
+ mechanism, magic symbols, lrecords, NEW-GC, dynarrs, ...
+-- Major reworking of DFC macros e.g. EXTERNAL_TO_C_STRING renamed to
+ EXTERNAL_TO_ITEXT; make them return their values when possible rather
+ than storing into a named variable:
+
+ EXTERNAL_TO_C_STRING -> EXTERNAL_TO_ITEXT
+ EXTERNAL_TO_C_STRING_MALLOC -> EXTERNAL_TO_ITEXT_MALLOC
+ SIZED_EXTERNAL_TO_C_STRING -> SIZED_EXTERNAL_TO_ITEXT
+ SIZED_EXTERNAL_TO_C_STRING_MALLOC -> SIZED_EXTERNAL_TO_ITEXT_MALLOC
+ C_STRING_TO_EXTERNAL -> ITEXT_TO_EXTERNAL
+ C_STRING_TO_EXTERNAL_MALLOC -> ITEXT_TO_EXTERNAL_MALLOC
+ LISP_STRING_TO_EXTERNAL
+ LISP_STRING_TO_EXTERNAL_MALLOC
+ LISP_STRING_TO_TSTR
+ C_STRING_TO_TSTR -> ITEXT_TO_TSTR
+ TSTR_TO_C_STRING -> TSTR_TO_ITEXT
+
+ The following four still return their values through parameters,
+ since they have more than one value to return:
+
+ C_STRING_TO_SIZED_EXTERNAL -> ITEXT_TO_SIZED_EXTERNAL
+ LISP_STRING_TO_SIZED_EXTERNAL
+ C_STRING_TO_SIZED_EXTERNAL_MALLOC -> ITEXT_TO_SIZED_EXTERNAL_MALLOC
+ LISP_STRING_TO_SIZED_EXTERNAL_MALLOC
+
+-- Eliminate unused second argument to xfree()
+-- Whenever xfree() a structure field, set the field to 0 afterwards, to
+ protect against double free or possible attempt to interpret the field
+ later on
+-- Move `equalp' to C
+-- Rename `enum font_specifier_matchspec_stages':
+ initial -> STAGE_INITIAL
+ final -> STAGE_FINAL
+ impossible -> NUM_MATCHSPEC_STAGES
+-- Rename:
+ PROCESSING_X_CODE -> THIS_IS_X
+ PROCESSING_GTK_CODE -> THIS_IS_GTK
+-- Rename:
+ write_c_string -> write_cistring
+ build_intstring -> build_istring
+ build_string -> build_cistring
+ build_ext_string -> build_extstring
+ make_ext_string -> make_extstring
+ buffer_insert_c_string -> buffer_insert_ascstring
+ intern_int -> intern_istring
+-- Lots of cleanup of (not-yet-working) message translation code
+-- Lots of Mule-izing:
+ -- change raw `char *' to some characterized type to indicate the
+ semantics properly
+ -- change all occurrences of Qnative to some more specific encoding
+ -- create new encodings:
+ -- Qtime_function_encoding
+ Qtime_zone_encoding
+ Quser_name_encoding
+ Qerror_message_encoding
+ Qjpeg_error_message_encoding
+ Qtooltalk_encoding
+ Qgtk_encoding
+ Qx_error_message_encoding
+-- Major unification of X and GTK redisplay code into "xlike" code, creation
+ of "xlike" mechanism
+-- Rename:
+ LOCAL_TO_WIN32_FILE_FORMAT -> LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN
+ WIN32_TO_LOCAL_FILE_FORMAT -> INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT
+ LOCAL_FILE_FORMAT_TO_TSTR -> LISP_LOCAL_FILE_FORMAT_TO_TSTR.
+ LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR -> LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR
+ Create new LOCAL_FILE_FORMAT_TO_TSTR
+-- Redo the code in code-init.el that initializes coding-system defaults
+-- separate HAVE_XFT into HAVE_XFT and USE_XFT, to facilitate compiling
+ simultaneously with X and GTK
+
+File Additions, Deletions, Renames, etc.
+
-- Convert various source files to UTF-8
-- File renames:
select-common.h -> select-xlike-inc.c
xgccache.{ch} -> gccache-x.{ch}
toolbar-common.{ch} -> toolbar-xlike.{ch}
+ objects*.{ch} -> fontcolor*.{ch}
+ dynarr.c -> array.c
-- New files:
bytecode-ops.h
sysgtk.h, sysgdkx.h
keymap-buttons.h, keymap-slots.h
-- Deleted files:
event-gtk.h
--- Major reworking of DFC macros e.g. EXTERNAL_TO_C_STRING renamed to
- EXTERNAL_TO_ITEXT; make them return their values when possible rather
- than storing into a named variable
--- Eliminate unused second argument to xfree()
--- separate HAVE_XFT into HAVE_XFT and USE_XFT, to facilitate compiling
- simultaneously with X and GTK
--- Move `equalp' to C
-
-Testing:
-
--- Move test-harness.el to Lisp directory
+-- File moves:
+ moved test-harness.el to Lisp directory
+ moved etc/gdbinit.in to src/.gdbinit.in.in
+
+Internals: Debugging
+
+-- New function debug_out_lisp() -- printf-like formatting for Lisp objects,
+ debug output
+-- Expand the KKCC backtrace mechanism -- new functions:
+ kkcc_short_backtrace()
+ kkcc_short_backtrace_full()
+ kkcc_detailed_backtrace()
+ kkcc_detailed_backtrace_full()
+-- Make print code even more careful about checking for bad memory,
+ bad object types, circular objects, etc.
+-- When --with-debug, set `debug-on-error' so we get an abort to debugger
+ upon Lisp error
Building:
-- Fix `--quick-build' so full rebuilds don't happen when changes are made
to files like lisp.h, config.h that are included by all C files
-- Fix C++ build on Cygwin when configured with --have-database
+-- Always insert a coding-system cookie in autoload files, fixing problems
+ when default coding system is UTF-8, as under Cygwin
+-- Redo compile warning system, turn on a number of warnings that had
+ mistakenly gotten turned off
+-- Fix so that builds properly under gcc v4, g++ v4
+-- Make `--with-error-checking' be the same as `--with-error-checking=all'
+-- Expand documentation of `--with-debug'
+-- Use -export-all-symbols instead of broken -export-dynamic on Cygwin/MinGW
+-- Add fix-perms target to correct permissions on executable/non-exec files
+-- rename all instances of --enable-FOO to --with-FOO.
+-- Fix make-mswin-unicode.pl so that it can work with Cygwin w32api headers
+ as well as actual VC++ headers
+-- make-msgfile.lex: Long documentation on what should be done if we ever want
+ message translation to work.
User-Visible Bug Fixes:
@@ -104,6 +372,11 @@
-- Fix a crash in frame creation due to lack of call to reset_glyph_cachels()
-- Fix long-standing bug: searching for Control-1 chars didn't work
-- Turn on `load-ignore-out-of-date-elc-files' by default
+-- Fix crash in event-TTY code when reading an event non-interactively
+-- Use UTF-8 consistently as encoding default under Cygwin 1.7
+-- Fix broken code in computing fastmap for [^...] regexps under Mule
+-- Fix display-table entries for error-octet characters so they display
+ as originally intended
by Aidan Kehoe:
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-09 Ben Wing <ben(a)xemacs.org>
+
+ * CHANGES-beta:
+ Update with my changes to the trunk since the release of 21.5.29
+ in 2009 up through April 9, 2010.
+
2010-04-02 Aidan Kehoe <kehoea(a)parhasard.net>
* CHANGES-beta:
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 configure
--- a/configure
+++ b/configure
@@ -11922,8 +11922,8 @@
fi
if test "${GNOME_CONFIG}" != "no"; then
- GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0`
- GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0`
+ GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0 pango pangoxft`
+ GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0 pango pangoxft`
$as_echo "#define HAVE_GNOME 1" >>confdefs.h
libs_gtk="$libs_gtk ${GNOME_LIBS}" && if test "$verbose" = "yes"; then echo " Appending \"${GNOME_LIBS}\" to \$libs_gtk"; fi
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -2846,8 +2846,8 @@
fi
if test "${GNOME_CONFIG}" != "no"; then
- GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0`
- GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0`
+ GNOME_LIBS=`${GNOME_CONFIG} --libs libgnomeui-2.0 pango pangoxft`
+ GNOME_CFLAGS=`${GNOME_CONFIG} --cflags libgnomeui-2.0 pango pangoxft`
AC_DEFINE(HAVE_GNOME)
XE_APPEND(${GNOME_LIBS}, libs_gtk)
XE_APPEND(${GNOME_CFLAGS}, c_switch_gtk)
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 lib-src/ChangeLog
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * make-docfile.c (scan_lisp_file):
+ Even if a function doesn't have a doc string, store its file name
+ in DOC.
+
2010-03-02 Ben Wing <ben(a)xemacs.org>
* digest-doc.c:
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 lib-src/make-docfile.c
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -1084,6 +1084,7 @@
{
char buffer[BUFSIZ];
char type;
+ int no_docstring = 0;
/* If not at end of line, skip till we get to one. */
if (c != '\n')
@@ -1187,7 +1188,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
@@ -1217,7 +1218,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
}
@@ -1276,7 +1277,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
}
@@ -1333,7 +1334,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
}
@@ -1391,7 +1392,7 @@
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
- continue;
+ no_docstring = 1;
}
}
}
@@ -1422,15 +1423,18 @@
putc (037, outfile);
putc (type, outfile);
fprintf (outfile, "%s\n", buffer);
- if (saved_string)
- {
- fputs (saved_string, outfile);
- /* Don't use one dynamic doc string twice. */
- free (saved_string);
- saved_string = 0;
- }
- else
- read_c_string (infile, 1, 0);
+ if (!no_docstring)
+ {
+ if (saved_string)
+ {
+ fputs (saved_string, outfile);
+ /* Don't use one dynamic doc string twice. */
+ free (saved_string);
+ saved_string = 0;
+ }
+ else
+ read_c_string (infile, 1, 0);
+ }
}
fclose (infile);
return 0;
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,29 @@
+2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * loadup.el (load-history): Be a bit more discriminate in the
+ entries we remove from load-history, only removing those where the
+ information is entirely available from DOC.
+ Fixes problems finding the files that dumped undocumented
+ variables were loaded from, reported by Didier Verna.
+ * loadhist.el (symbol-file): Correct a regexp here, I had
+ forgotten to double a backslash.
+
+2010-04-15 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * files.el (hack-local-variables-prop-line)
+ (hack-one-local-variable):
+ Only attempt to call MODENAME-mode on encountering a
+ -*-MODENAME-*- line if the corresponding symbol has a function
+ binding, avoiding an error if, for example, opening a log file
+ with XLFDs and wild cards. Thanks for the bug report, Henrique
+ Martins!
+
+2010-04-09 Didier Verna <didier(a)xemacs.org>
+
+ * hyper-apropos.el (hyper-apropos-get-doc): Use [not available]
+ when a function's arglist is unknown (this happens for autoloaded
+ functions).
+
2010-04-07 Didier Verna <didier(a)xemacs.org>
* font-lock.el (lisp-font-lock-keywords-2): Add missing CL style
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 lisp/files.el
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2044,7 +2044,7 @@
;; Without this guard, `normal-mode' would potentially run
;; the major mode function twice: once via `set-auto-mode'
;; and once via `hack-local-variables'.
- (if (not (eq mode major-mode))
+ (if (and (not (eq mode major-mode)) (fboundp mode))
(funcall mode))
))
(set-any-p
@@ -2091,8 +2091,9 @@
"\"Set\" one variable in a local variables spec.
A few variable names are treated specially."
(cond ((eq var 'mode)
- (funcall (intern (concat (downcase (symbol-name val))
- "-mode"))))
+ (and (fboundp (setq val (intern (concat (downcase (symbol-name val))
+ "-mode"))))
+ (funcall val)))
((eq var 'coding)
;; We have already handled coding: tag in set-auto-coding.
nil)
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 lisp/hyper-apropos.el
--- a/lisp/hyper-apropos.el
+++ b/lisp/hyper-apropos.el
@@ -772,11 +772,14 @@
global (current-global-map)
obsolete (get symbol 'byte-obsolete-info)
doc (function-documentation symbol t)
- arglist (replace-in-string
- (function-arglist symbol)
- (format "^(%s "
- (regexp-quote (symbol-name symbol)))
- "("))
+ arglist (let ((farglist (function-arglist symbol)))
+ (if farglist
+ (replace-in-string
+ farglist
+ (format "^(%s "
+ (regexp-quote (symbol-name symbol)))
+ "(")
+ "[not available]")))
(save-excursion
(set-buffer hyper-apropos-help-buf)
(goto-char (point-max))
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 lisp/loadhist.el
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -89,7 +89,7 @@
built-in-file
;; This is a bit heuristic, but shouldn't realistically be a
;; problem:
- (if (string-match "\.elc?$" built-in-file)
+ (if (string-match #r"\.elc?$" built-in-file)
(concat (if (file-readable-p source-lisp)
source-lisp
lisp-directory)
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 lisp/loadup.el
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -220,10 +220,22 @@
(load "site-init" t))
;; Add information from this file to the load history. Delete information
-;; for those files in preloaded-file-list; the symbol file information can
-;; be taken from DOC, and #'unload-feature makes very little sense for
-;; dumped functionality.
-(setq load-history (cons (nreverse current-load-list) (last load-history))
+;; that is available from DOC for those files in preloaded-file-list; in
+;; practice, this boils down to #'provide and #'require calls, and variables
+;; without documentation. Yes, this is a bit ugly.
+(setq load-history (cons (nreverse current-load-list)
+ (delete*
+ nil
+ (mapc #'(lambda (element)
+ (remassq 'defun element)
+ (delete-if
+ #'(lambda (elt)
+ (and
+ (symbolp elt)
+ (get elt 'variable-documentation)))
+ element))
+ load-history)
+ :key #'cdr))
;; Clear current-load-list; this (and adding information to
;; load-history) is normally done in lread.c after reading the
;; entirety of a file, something which never happens for loadup.el.
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 modules/ChangeLog
--- a/modules/ChangeLog
+++ b/modules/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-12 Ben Wing <ben(a)xemacs.org>
+
+ * canna/canna_api.c:
+ * canna/canna_api.c (Fcanna_henkan_begin):
+ Fixes for errors reported in smoketest build.
+
2010-03-12 Ben Wing <ben(a)xemacs.org>
* base64/base64.c:
diff -r 448bbdfb15eb34fe2640381f5524665270245f5a -r 3d8d69882391898aa486c639770d66e61fd26586 modules/canna/canna_api.c
--- a/modules/canna/canna_api.c
+++ b/modules/canna/canna_api.c
@@ -2,7 +2,7 @@
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 2005 Ben Wing.
+ Copyright (C) 2005, 2010 Ben Wing.
This file is part of XEmacs.
@@ -661,7 +661,7 @@
#define RKBUFSIZE 1024
-static unsigned char yomibuf[RKBUFSIZE];
+static UExtbyte yomibuf[RKBUFSIZE];
static short kugiri[RKBUFSIZE / 2];
static int
@@ -720,7 +720,7 @@
strncpy ((char *) yomibuf, ext, sizeof (yomibuf));
yomibuf[sizeof (yomibuf) - 1] = '\0';
- nbun = RkBgnBun (IRCP_context, yomibuf, strlen ((char *) yomibuf),
+ nbun = RkBgnBun (IRCP_context, (char *) yomibuf, strlen ((char *) yomibuf),
(RK_XFER << RK_XFERBITS) | RK_KFER);
return kanjiYomiList (IRCP_context, nbun);
This diff is so big that we needed to truncate the remainder.
https://bitbucket.org/xemacs/xemacs/commits/dc129250008a/
Changeset: dc129250008a
User: jsparkes
Date: 2010-05-04 03:00:41+00:00
Summary: Use GPOINTER_TO_GUINT for data.
Affected #: 1 file
diff -r 3d8d69882391898aa486c639770d66e61fd26586 -r dc129250008a18d234f6636e7257fcf0b3ddea5e src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -1017,7 +1017,7 @@
static void
__notice_object_destruction (GtkObject *UNUSED (obj), gpointer user_data)
{
- ungcpro_popup_callbacks ((GUI_ID) user_data);
+ ungcpro_popup_callbacks ((GUI_ID) GPOINTER_TO_UINT (user_data));
}
Lisp_Object build_gtk_object (GObject *obj)
@@ -1026,7 +1026,7 @@
emacs_gtk_object_data *data = NULL;
GUI_ID id = 0;
- id = (GUI_ID) g_object_get_data (obj, GTK_DATA_GUI_IDENTIFIER);
+ id = (GUI_ID) GPOINTER_TO_UINT (g_object_get_data (obj , GTK_DATA_GUI_IDENTIFIER));
if (id)
{
https://bitbucket.org/xemacs/xemacs/commits/3eabd3a3c19b/
Changeset: 3eabd3a3c19b
User: jsparkes
Date: 2010-05-04 03:11:52+00:00
Summary: Messed up earlier merge.
Affected #: 1 file
diff -r dc129250008a18d234f6636e7257fcf0b3ddea5e -r 3eabd3a3c19b4f9da68a58a098f952e1bc0a728b src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -27,6 +27,8 @@
#include "fontcolor-gtk-impl.h"
#include "frame.h"
+extern int lisp_to_gtk_type (Lisp_Object obj, GValue *arg);
+
static GType
xemacs_type_register (const gchar *name, GType parent)
{
@@ -71,9 +73,27 @@
xemacs_list_to_gtklist (Lisp_Object obj, GValue *arg)
{
CHECK_LIST (obj);
+ int len;
+ GValueArray *array;
+
+ /*
+ * The list is converted into an array. I'll figure out
+ * how to a make a real list later, perhaps. --jsparkes
+ */
+ GET_LIST_LENGTH (obj, len);
+ //array = g_array_new (0, TRUE, sizeof (GValue *)); // XXX leak?
+ array = g_value_array_new (len);
- printf ("%d\n", (int) arg);
- ABORT();
+ SAFE_LIST_LOOP_2 (elt, obj)
+ {
+ GValue tmp, *copy;
+ lisp_to_gtk_type (elt, &tmp);
+ g_value_copy (&tmp, copy);/* leak XXX */
+ g_value_array_append (array, copy);
+ }
+
+ g_value_init (arg, G_TYPE_VALUE_ARRAY);
+ g_value_set_boxed (arg, array);
#if 0
assert (G_TYPE_IS_VALUE (arg));
@@ -99,13 +119,16 @@
}
#if 0
+
arg = strings;
#endif
+
}
// else if (*arg == GTK_TYPE_OBJECT_LIST)
{
ABORT();
#if 0
+
Lisp_Object temp = obj;
GList *objects = NULL;
https://bitbucket.org/xemacs/xemacs/commits/adfad17d7ddb/
Changeset: adfad17d7ddb
User: jsparkes
Date: 2010-05-04 03:17:11+00:00
Summary: Thought I'd fixed cursor_name_to_index already.
Affected #: 1 file
diff -r 3eabd3a3c19b4f9da68a58a098f952e1bc0a728b -r adfad17d7ddb96f2875c95580a2d710f08014775 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -1406,7 +1406,7 @@
int i, stattis;
char *p, *bits, *bp;
const char * volatile emsg = 0;
- const char * volatile dstring;
+ char * volatile dstring;
assert (!NILP (data));
@@ -1874,16 +1874,15 @@
static GdkCursorType
cursor_name_to_index (const char *name)
{
- int i;
-#if 0
- static char *the_gdk_cursors[GDK_NUM_GLYPHS];
+ static char *the_gdk_cursors[GDK_LAST_CURSOR];
+ guint i;
if (!the_gdk_cursors[GDK_BASED_ARROW_UP])
{
/* Need to initialize the array */
/* Supposedly since this array is static it should be
initialized to NULLs for us, but I'm very paranoid. */
- for (i = 0; i < GDK_NUM_GLYPHS; i++)
+ for (i = 0; i < GDK_LAST_CURSOR; i++)
{
the_gdk_cursors[i] = NULL;
}
@@ -1931,7 +1930,7 @@
#undef FROB_CURSOR
}
- for (i = 0; i < GDK_NUM_GLYPHS; i++)
+ for (i = 0; i < GDK_LAST_CURSOR; i++)
{
if (!the_gdk_cursors[i]) continue;
if (!strcmp (the_gdk_cursors[i], name))
@@ -1939,7 +1938,6 @@
return (GdkCursorType) i;
}
}
-#endif
return (GdkCursorType) -1;
}
https://bitbucket.org/xemacs/xemacs/commits/104632c68226/
Changeset: 104632c68226
User: jsparkes
Date: 2010-05-04 03:19:26+00:00
Summary: Fix indentation of cursor_name_to_index.
Affected #: 1 file
diff -r adfad17d7ddb96f2875c95580a2d710f08014775 -r 104632c6822653dfe442a590e269070b5d631b69 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -1874,71 +1874,71 @@
static GdkCursorType
cursor_name_to_index (const char *name)
{
- static char *the_gdk_cursors[GDK_LAST_CURSOR];
- guint i;
-
- if (!the_gdk_cursors[GDK_BASED_ARROW_UP])
+ static char *the_gdk_cursors[GDK_LAST_CURSOR];
+ guint i;
+
+ if (!the_gdk_cursors[GDK_BASED_ARROW_UP])
{
- /* Need to initialize the array */
- /* Supposedly since this array is static it should be
- initialized to NULLs for us, but I'm very paranoid. */
- for (i = 0; i < GDK_LAST_CURSOR; i++)
+ /* Need to initialize the array */
+ /* Supposedly since this array is static it should be
+ initialized to NULLs for us, but I'm very paranoid. */
+ for (i = 0; i < GDK_LAST_CURSOR; i++)
{
- the_gdk_cursors[i] = NULL;
+ the_gdk_cursors[i] = NULL;
}
#define FROB_CURSOR(x) the_gdk_cursors[GDK_##x] = __downcase(#x)
- FROB_CURSOR(ARROW); FROB_CURSOR(BASED_ARROW_DOWN);
- FROB_CURSOR(BASED_ARROW_UP); FROB_CURSOR(BOAT);
- FROB_CURSOR(BOGOSITY); FROB_CURSOR(BOTTOM_LEFT_CORNER);
- FROB_CURSOR(BOTTOM_RIGHT_CORNER); FROB_CURSOR(BOTTOM_SIDE);
- FROB_CURSOR(BOTTOM_TEE); FROB_CURSOR(BOX_SPIRAL);
- FROB_CURSOR(CENTER_PTR); FROB_CURSOR(CIRCLE);
- FROB_CURSOR(CLOCK); FROB_CURSOR(COFFEE_MUG);
- FROB_CURSOR(CROSS); FROB_CURSOR(CROSS_REVERSE);
- FROB_CURSOR(CROSSHAIR); FROB_CURSOR(DIAMOND_CROSS);
- FROB_CURSOR(DOT); FROB_CURSOR(DOTBOX);
- FROB_CURSOR(DOUBLE_ARROW); FROB_CURSOR(DRAFT_LARGE);
- FROB_CURSOR(DRAFT_SMALL); FROB_CURSOR(DRAPED_BOX);
- FROB_CURSOR(EXCHANGE); FROB_CURSOR(FLEUR);
- FROB_CURSOR(GOBBLER); FROB_CURSOR(GUMBY);
- FROB_CURSOR(HAND1); FROB_CURSOR(HAND2);
- FROB_CURSOR(HEART); FROB_CURSOR(ICON);
- FROB_CURSOR(IRON_CROSS); FROB_CURSOR(LEFT_PTR);
- FROB_CURSOR(LEFT_SIDE); FROB_CURSOR(LEFT_TEE);
- FROB_CURSOR(LEFTBUTTON); FROB_CURSOR(LL_ANGLE);
- FROB_CURSOR(LR_ANGLE); FROB_CURSOR(MAN);
- FROB_CURSOR(MIDDLEBUTTON); FROB_CURSOR(MOUSE);
- FROB_CURSOR(PENCIL); FROB_CURSOR(PIRATE);
- FROB_CURSOR(PLUS); FROB_CURSOR(QUESTION_ARROW);
- FROB_CURSOR(RIGHT_PTR); FROB_CURSOR(RIGHT_SIDE);
- FROB_CURSOR(RIGHT_TEE); FROB_CURSOR(RIGHTBUTTON);
- FROB_CURSOR(RTL_LOGO); FROB_CURSOR(SAILBOAT);
- FROB_CURSOR(SB_DOWN_ARROW); FROB_CURSOR(SB_H_DOUBLE_ARROW);
- FROB_CURSOR(SB_LEFT_ARROW); FROB_CURSOR(SB_RIGHT_ARROW);
- FROB_CURSOR(SB_UP_ARROW); FROB_CURSOR(SB_V_DOUBLE_ARROW);
- FROB_CURSOR(SHUTTLE); FROB_CURSOR(SIZING);
- FROB_CURSOR(SPIDER); FROB_CURSOR(SPRAYCAN);
- FROB_CURSOR(STAR); FROB_CURSOR(TARGET);
- FROB_CURSOR(TCROSS); FROB_CURSOR(TOP_LEFT_ARROW);
- FROB_CURSOR(TOP_LEFT_CORNER); FROB_CURSOR(TOP_RIGHT_CORNER);
- FROB_CURSOR(TOP_SIDE); FROB_CURSOR(TOP_TEE);
- FROB_CURSOR(TREK); FROB_CURSOR(UL_ANGLE);
- FROB_CURSOR(UMBRELLA); FROB_CURSOR(UR_ANGLE);
- FROB_CURSOR(WATCH); FROB_CURSOR(XTERM);
- FROB_CURSOR(X_CURSOR);
+ FROB_CURSOR(ARROW); FROB_CURSOR(BASED_ARROW_DOWN);
+ FROB_CURSOR(BASED_ARROW_UP); FROB_CURSOR(BOAT);
+ FROB_CURSOR(BOGOSITY); FROB_CURSOR(BOTTOM_LEFT_CORNER);
+ FROB_CURSOR(BOTTOM_RIGHT_CORNER); FROB_CURSOR(BOTTOM_SIDE);
+ FROB_CURSOR(BOTTOM_TEE); FROB_CURSOR(BOX_SPIRAL);
+ FROB_CURSOR(CENTER_PTR); FROB_CURSOR(CIRCLE);
+ FROB_CURSOR(CLOCK); FROB_CURSOR(COFFEE_MUG);
+ FROB_CURSOR(CROSS); FROB_CURSOR(CROSS_REVERSE);
+ FROB_CURSOR(CROSSHAIR); FROB_CURSOR(DIAMOND_CROSS);
+ FROB_CURSOR(DOT); FROB_CURSOR(DOTBOX);
+ FROB_CURSOR(DOUBLE_ARROW); FROB_CURSOR(DRAFT_LARGE);
+ FROB_CURSOR(DRAFT_SMALL); FROB_CURSOR(DRAPED_BOX);
+ FROB_CURSOR(EXCHANGE); FROB_CURSOR(FLEUR);
+ FROB_CURSOR(GOBBLER); FROB_CURSOR(GUMBY);
+ FROB_CURSOR(HAND1); FROB_CURSOR(HAND2);
+ FROB_CURSOR(HEART); FROB_CURSOR(ICON);
+ FROB_CURSOR(IRON_CROSS); FROB_CURSOR(LEFT_PTR);
+ FROB_CURSOR(LEFT_SIDE); FROB_CURSOR(LEFT_TEE);
+ FROB_CURSOR(LEFTBUTTON); FROB_CURSOR(LL_ANGLE);
+ FROB_CURSOR(LR_ANGLE); FROB_CURSOR(MAN);
+ FROB_CURSOR(MIDDLEBUTTON); FROB_CURSOR(MOUSE);
+ FROB_CURSOR(PENCIL); FROB_CURSOR(PIRATE);
+ FROB_CURSOR(PLUS); FROB_CURSOR(QUESTION_ARROW);
+ FROB_CURSOR(RIGHT_PTR); FROB_CURSOR(RIGHT_SIDE);
+ FROB_CURSOR(RIGHT_TEE); FROB_CURSOR(RIGHTBUTTON);
+ FROB_CURSOR(RTL_LOGO); FROB_CURSOR(SAILBOAT);
+ FROB_CURSOR(SB_DOWN_ARROW); FROB_CURSOR(SB_H_DOUBLE_ARROW);
+ FROB_CURSOR(SB_LEFT_ARROW); FROB_CURSOR(SB_RIGHT_ARROW);
+ FROB_CURSOR(SB_UP_ARROW); FROB_CURSOR(SB_V_DOUBLE_ARROW);
+ FROB_CURSOR(SHUTTLE); FROB_CURSOR(SIZING);
+ FROB_CURSOR(SPIDER); FROB_CURSOR(SPRAYCAN);
+ FROB_CURSOR(STAR); FROB_CURSOR(TARGET);
+ FROB_CURSOR(TCROSS); FROB_CURSOR(TOP_LEFT_ARROW);
+ FROB_CURSOR(TOP_LEFT_CORNER); FROB_CURSOR(TOP_RIGHT_CORNER);
+ FROB_CURSOR(TOP_SIDE); FROB_CURSOR(TOP_TEE);
+ FROB_CURSOR(TREK); FROB_CURSOR(UL_ANGLE);
+ FROB_CURSOR(UMBRELLA); FROB_CURSOR(UR_ANGLE);
+ FROB_CURSOR(WATCH); FROB_CURSOR(XTERM);
+ FROB_CURSOR(X_CURSOR);
#undef FROB_CURSOR
}
- for (i = 0; i < GDK_LAST_CURSOR; i++)
+ for (i = 0; i < GDK_LAST_CURSOR; i++)
{
- if (!the_gdk_cursors[i]) continue;
- if (!strcmp (the_gdk_cursors[i], name))
+ if (!the_gdk_cursors[i]) continue;
+ if (!strcmp (the_gdk_cursors[i], name))
{
return (GdkCursorType) i;
}
}
- return (GdkCursorType) -1;
+ return (GdkCursorType) -1;
}
static void
https://bitbucket.org/xemacs/xemacs/commits/f33d862cdff0/
Changeset: f33d862cdff0
User: jsparkes
Date: 2010-05-04 03:41:00+00:00
Summary: Implement check_pointer_sizes.
Affected #: 1 file
diff -r 104632c6822653dfe442a590e269070b5d631b69 -r f33d862cdff0473c4083cedd9e665df32985be29 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -628,24 +628,17 @@
message. */
static void
-check_pointer_sizes (unsigned int UNUSED (width), unsigned int UNUSED (height),
- Lisp_Object UNUSED (instantiator))
+check_pointer_sizes (GdkDisplay *display, guint width, guint height,
+ Lisp_Object instantiator)
{
- /* #### BILL!!! There is no way to call XQueryBestCursor from Gdk! */
-#if 0
- unsigned int best_width, best_height;
- if (! XQueryBestCursor (DisplayOfScreen (xs), RootWindowOfScreen (xs),
- width, height, &best_width, &best_height))
- /* this means that an X error of some sort occurred (we trap
- these so they're not fatal). */
- gui_error ("XQueryBestCursor() failed?", instantiator);
-
- if (width > best_width || height > best_height)
+ guint max_width, max_height;
+
+ gdk_display_get_maximal_cursor_size(display, &max_width, &max_height);
+ if (width > max_width || height > max_height)
signal_ferror_with_frob (Qgui_error, instantiator,
"pointer too large (%dx%d): "
"server requires %dx%d or smaller",
- width, height, best_width, best_height);
-#endif
+ width, height, max_width, max_height);
}
static void
@@ -728,7 +721,9 @@
w = IMAGE_INSTANCE_PIXMAP_WIDTH (ii);
h = IMAGE_INSTANCE_PIXMAP_HEIGHT (ii);
- check_pointer_sizes (w, h, instantiator);
+ check_pointer_sizes (gtk_widget_get_display
+ (DEVICE_GTK_APP_SHELL (XDEVICE (device))),
+ w, h, instantiator);
/* If the loaded pixmap has colors allocated (meaning it came from an
XPM file), then use those as the default colors for the cursor we
@@ -1072,7 +1067,8 @@
GdkColor fg_color, bg_color;
GdkPixmap *source;
- check_pointer_sizes (width, height, instantiator);
+ check_pointer_sizes (gdk_drawable_get_display (draw), width, height,
+ instantiator);
source = gdk_pixmap_create_from_data (draw, (char *) bits, width, height, 1, &black, &white);
https://bitbucket.org/xemacs/xemacs/commits/ec8ace1ed8bc/
Changeset: ec8ace1ed8bc
User: jsparkes
Date: 2010-05-04 10:39:07+00:00
Summary: Define g-type-from-name and g-object-class-list-properties.
They don't work yet.
Affected #: 1 file
diff -r f33d862cdff0473c4083cedd9e665df32985be29 -r ec8ace1ed8bc54d0fe2a45c0bafbcfcac82c5013 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -1411,6 +1411,51 @@
return (rval);
}
+
+DEFUN ("g-type-from-name", Fg_type_from_name, 1, 1, 0, /*
+Return the GType of NAME.
+The type is returned as a string, so this is a type validator.
+*/
+ (type_name))
+{
+ CHECK_STRING (type_name);
+ gchar *name = (gchar *)XSTRING_DATA (type_name);
+ return (build_ascstring (g_type_name (g_type_from_name (name))));
+}
+
+DEFUN ("g-object-class-list-properties", Fg_object_class_list_properties, 1, 1, 0, /*
+Return a list of all properties for CLASS name.
+*/
+ (name))
+{
+ GType gt;
+ GObject *obj;
+ Lisp_Object prop_list = Qnil;
+ GParamSpec **props;
+ guint n_props, i;
+
+ CHECK_STRING (name);
+ gt = g_type_from_name ((gchar *)XSTRING_DATA (name));
+ if (gt == G_TYPE_INVALID)
+ invalid_state ("type does not exist", name);
+
+ obj = (GObject *)g_object_newv (gt, 0, NULL);
+ if (obj == NULL)
+ invalid_state("Unable to create GObject of class", name);
+
+ props = g_object_class_list_properties (G_OBJECT_CLASS (obj),
+ &n_props);
+ for (i = 0; i < n_props; i++)
+ {
+ GValue v;
+ g_value_init (&v, props[i]->value_type);
+ prop_list = Fcons (gtk_type_to_lisp (&v), prop_list);
+ }
+ g_free (props);
+ g_free (obj);
+ return prop_list;
+}
+
void
ui_gtk_objects_create (void)
@@ -1438,6 +1483,8 @@
DEFSUBR (Fgtk_fundamental_type);
DEFSUBR (Fgtk_object_type);
DEFSUBR (Fgtk_describe_type);
+ DEFSUBR (Fg_type_from_name);
+ DEFSUBR (Fg_object_class_list_properties);
#ifdef HAVE_WIDGETS
syms_of_widget_accessors ();
#endif
https://bitbucket.org/xemacs/xemacs/commits/a452bae47457/
Changeset: a452bae47457
User: jsparkes
Date: 2010-05-05 01:16:33+00:00
Summary: GtkType is now GType.
Turn on ffi debugging.
Affected #: 1 file
diff -r ec8ace1ed8bc54d0fe2a45c0bafbcfcac82c5013 -r a452bae4745716fe6368850a8113aefcd781a784 lisp/gtk-ffi.el
--- a/lisp/gtk-ffi.el
+++ b/lisp/gtk-ffi.el
@@ -28,7 +28,7 @@
;; This file is dumped with XEmacs.
-(defvar gtk-type-aliases '((GtkType . guint)
+(defvar gtk-type-aliases '((GType . guint)
(GdkAtom . gulong)
(GdkBitmap . GdkWindow)
(time_t . guint)
@@ -39,7 +39,7 @@
"An assoc list of aliases for commonly used GTK types that are not
really part of the object system.")
-(defvar gtk-ffi-debug nil
+(defvar gtk-ffi-debug t
"If non-nil, all functions defined wiht `gtk-import-function' will be checked
for missing marshallers.")
https://bitbucket.org/xemacs/xemacs/commits/acc5f1057e32/
Changeset: acc5f1057e32
User: jsparkes
Date: 2010-05-04 19:31:39+00:00
Summary: Add a PangoContext to gtk device.
Affected #: 3 files
diff -r ec8ace1ed8bc54d0fe2a45c0bafbcfcac82c5013 -r acc5f1057e328e886d300a06b6d0851cbb1d0ee6 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,11 @@
+2010-05-04 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * console-gtk-impl.h (struct gtk_device):
+ * device-gtk.c (gtk_init_device):
+ Add a PangoContext to gtk-device.
+
+XXXXXX - too many changes in one big commit to document.
+
2010-04-26 Jeff Sparkes <jsparkes(a)gmail.com>
* ui-gtk.c (emacs_gtk_object_getprop):
diff -r ec8ace1ed8bc54d0fe2a45c0bafbcfcac82c5013 -r acc5f1057e328e886d300a06b6d0851cbb1d0ee6 src/console-gtk-impl.h
--- a/src/console-gtk-impl.h
+++ b/src/console-gtk-impl.h
@@ -66,6 +66,8 @@
int depth;
GdkColormap *device_cmap;
+ PangoContext *context;
+
/* Used by x_bevel_modeline in redisplay-x.c */
GdkBitmap *gray_pixmap;
@@ -131,6 +133,7 @@
#define DEVICE_GTK_VISUAL(d) (DEVICE_GTK_DATA (d)->visual)
#define DEVICE_GTK_DEPTH(d) (DEVICE_GTK_DATA (d)->depth)
#define DEVICE_GTK_COLORMAP(d) (DEVICE_GTK_DATA (d)->device_cmap)
+#define DEVICE_GTK_CONTEXT(d) (DEVICE_GTK_DATA (d)->context)
#define DEVICE_GTK_APP_SHELL(d) (DEVICE_GTK_DATA (d)->gtk_app_shell)
#define DEVICE_GTK_GC_CACHE(d) (DEVICE_GTK_DATA (d)->gc_cache)
#define DEVICE_GTK_GRAY_PIXMAP(d) (DEVICE_GTK_DATA (d)->gray_pixmap)
diff -r ec8ace1ed8bc54d0fe2a45c0bafbcfcac82c5013 -r acc5f1057e328e886d300a06b6d0851cbb1d0ee6 src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -287,7 +287,9 @@
DEVICE_GTK_VISUAL (d) = visual;
DEVICE_GTK_COLORMAP (d) = cmap;
DEVICE_GTK_DEPTH (d) = visual->depth;
-
+ DEVICE_GTK_CONTEXT (d) = pango_context_new ();
+ assert (DEVICE_GTK_CONTEXT (d) != NULL);
+
{
GtkWidget *w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -386,7 +388,7 @@
enable_strict_free_check ();
#endif
}
-
+ /* g_free(DEVICE_GTK_CONTEXT (d)); */
#ifndef NEW_GC
free_gtk_device_struct (d);
#endif
https://bitbucket.org/xemacs/xemacs/commits/650a19ddfbc9/
Changeset: 650a19ddfbc9
User: jsparkes
Date: 2010-05-04 19:32:25+00:00
Summary: Forgot to save the ChangeLog.GTK before committing.
Affected #: 1 file
diff -r acc5f1057e328e886d300a06b6d0851cbb1d0ee6 -r 650a19ddfbc944063194b25ffbae69f9973dd916 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -2,7 +2,7 @@
* console-gtk-impl.h (struct gtk_device):
* device-gtk.c (gtk_init_device):
- Add a PangoContext to gtk-device.
+ Add a PangoContext to gtk device.
XXXXXX - too many changes in one big commit to document.
https://bitbucket.org/xemacs/xemacs/commits/c16c21b862d6/
Changeset: c16c21b862d6
User: jsparkes
Date: 2010-05-06 18:21:08+00:00
Summary: Start implementation of pango code inside ifdef HAVE_PANGO
Affected #: 5 files
diff -r 650a19ddfbc944063194b25ffbae69f9973dd916 -r c16c21b862d652080c90c8625ef36aa3876ba56f src/console-xlike-inc.h
--- a/src/console-xlike-inc.h
+++ b/src/console-xlike-inc.h
@@ -287,8 +287,13 @@
(USED (dpy), gdk_draw_line (GDK_DRAWABLE (x_win), gc, x1, y1, x2, y2))
#define XLIKE_TEXT_WIDTH(fi, ptr, len) \
gdk_text_width (fi, (char *) ptr, len)
-#define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) \
+#ifdef HAVE_PANGO
+#define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) \
+ pango_text_width_wc (fi, (GdkWChar *) ptr, len)
+#else
+#define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) \
gdk_text_width_wc (fi, (GdkWChar *) ptr, len)
+#endif
/* FIXME: This is totally bogus. It removes dl->top_clip from the
equations. If there is a bug involving this, fix it properly!
diff -r 650a19ddfbc944063194b25ffbae69f9973dd916 -r c16c21b862d652080c90c8625ef36aa3876ba56f src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -107,8 +107,13 @@
extern Lisp_Object
xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w);
+#ifdef HAVE_PANGO
+extern Lisp_Object __get_gtk_font_truename (PangoFont *gdk_font,
+ int expandp);
+#else
extern Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font,
int expandp);
+#endif
#define convert_font(f) __get_gtk_font_truename (f, 0)
@@ -287,9 +292,19 @@
DEVICE_GTK_VISUAL (d) = visual;
DEVICE_GTK_COLORMAP (d) = cmap;
DEVICE_GTK_DEPTH (d) = visual->depth;
- DEVICE_GTK_CONTEXT (d) = pango_context_new ();
- assert (DEVICE_GTK_CONTEXT (d) != NULL);
-
+
+ /* Should this be easier to figure out? --jsparkes */
+ {
+#ifdef HAVE_PANGO
+ GdkDisplay *disp = gdk_display_get_default ();
+ GdkScreen *screen = gdk_display_get_default_screen (disp);
+ PangoFontMap *fmap = pango_xft_get_font_map(disp, screen);
+ DEVICE_GTK_CONTEXT (d) = pango_font_map_create_context(fmap);
+ // DEVICE_GTK_CONTEXT (d) = pango_xft_get_context (display, 0);
+ DEVICE_GTK_CONTEXT (d) = pango_context_new ();
+ assert (DEVICE_GTK_CONTEXT (d) != NULL);
+#endif
+ }
{
GtkWidget *w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
diff -r 650a19ddfbc944063194b25ffbae69f9973dd916 -r c16c21b862d652080c90c8625ef36aa3876ba56f src/fontcolor-gtk-impl.h
--- a/src/fontcolor-gtk-impl.h
+++ b/src/fontcolor-gtk-impl.h
@@ -52,13 +52,24 @@
struct gtk_font_instance_data
{
- /* Gtk-specific information */
+#ifdef HAVE_PANGO
+ /* Pango -specific information */
+ PangoFont *font;
+ PangoFontDescription *desc;
+ PangoFontMetrics *metrics;
+#else
GdkFont *font;
+#endif
};
#define GTK_FONT_INSTANCE_DATA(f) ((struct gtk_font_instance_data *) (f)->data)
#define FONT_INSTANCE_GTK_FONT(f) (GTK_FONT_INSTANCE_DATA (f)->font)
#define XFONT_INSTANCE_GTK_FONT(c) FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (c))
-
+#ifdef HAVE_PANGO
+#define FONT_INSTANCE_GTK_FONT_DESC(f) (GTK_FONT_INSTANCE_DATA (f)->desc)
+#define FONT_INSTANCE_GTK_FONT_METRICS(f) (GTK_FONT_INSTANCE_DATA (f)->metrics)
+#define XFONT_INSTANCE_GTK_FONT_DESC(c) FONT_INSTANCE_GTK_FONT_DESC (XFONT_INSTANCE (c))
+#define XFONT_INSTANCE_GTK_FONT_METRICS(c) FONT_INSTANCE_GTK_FONT_METRICS (XFONT_INSTANCE (c))
+#endif /* HAVE_PANGO */
#endif /* HAVE_GTK */
#endif /* _XEMACS_OBJECTS_GTK_IMPL_H_ */
diff -r 650a19ddfbc944063194b25ffbae69f9973dd916 -r c16c21b862d652080c90c8625ef36aa3876ba56f src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -231,39 +231,67 @@
static int
gtk_initialize_font_instance (struct Lisp_Font_Instance *f,
Lisp_Object UNUSED (name),
- Lisp_Object UNUSED (device), Error_Behavior errb)
+ Lisp_Object device, Error_Behavior errb)
{
- GdkFont *gf;
const char *extname;
+#ifdef HAVE_PANGO
+ PangoFont *pf;
+ PangoFontMetrics *pfm;
+ PangoFontDescription *pfd;
+ PangoLanguage *lang;
+#else
+ GdkFont *pf;
+#endif
extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
- /* Load font or fontset? */
- /* gf = gdk_font_load_for_display (extname); --jsparkes */
- gf = gdk_font_load (extname);
-
- if (!gf)
+#ifdef HAVE_PANGO
+ /* Should this be default language? --jsparkes */
+ lang = pango_context_get_language (DEVICE_GTK_CONTEXT (XDEVICE (device)));
+ /* How do we get XLFD information into a font description? --jsparkes */
+ FONT_INSTANCE_GTK_FONT_DESC (f) = pango_font_description_new ();
+ pf = pango_context_load_font (DEVICE_GTK_CONTEXT (XDEVICE (device)),
+ FONT_INSTANCE_GTK_FONT_DESC (f));
+#else
+ pf = gdk_font_load (extname);
+ gdk_font_ref (pf);
+#endif
+
+ if (!pf)
{
maybe_signal_error (Qgui_error, "couldn't load font", f->name,
Qfont, errb);
return 0;
}
+
/* Don't allocate the data until we're sure that we will succeed,
or the finalize method may get fucked. */
- f->data = xnew (struct gtk_font_instance_data);
- FONT_INSTANCE_GTK_FONT (f) = gf;
- /* Kludge until we support Pango. --jsparkes */
- f->ascent = gf->ascent;
- f->descent = gf->descent;
- f->height = gf->ascent + gf->descent;
+ f->data = xnew_and_zero (struct gtk_font_instance_data);
+
+ FONT_INSTANCE_GTK_FONT (f) = pf;
+#ifdef HAVE_PANGO
+ pfm = pango_font_get_metrics (pf,
+ pango_context_get_language (DEVICE_GTK_CONTEXT (XDEVICE (device))));
+ FONT_INSTANCE_GTK_FONT_METRICS (f) = pfm;
+ f->ascent = pango_font_metrics_get_ascent (pfm);
+ f->descent = pango_font_metrics_get_descent (pfm);
+ f->height = f->ascent + f->descent;
- /* Now lets figure out the width of the font.
- We could use a longer string and get the averaage length */
- /* f->width = gdk_text_width (gf, "abcdefghijklmnopqrstuvwxyz", 26)/26; */
- f->width = gdk_text_width (gf, "n", 1); /* em or en? */
- f->proportional_p = (gdk_text_width (gf, "|", 1) !=
- gdk_text_width (gf, "W", 1));
+ pfd = pango_font_describe_with_absolute_size(pf);
+ /* g_free (FONT_INSTANCE_GTK_FONT_DESC (f); */
+ FONT_INSTANCE_GTK_FONT_DESC (f) = pfd;
+ f->width = pango_font_metrics_get_approximate_char_width (pfm);
+ f->proportional_p = f->width !=
+ pango_font_metrics_get_approximate_digit_width (pfm);
+#else
+ f->ascent = pf->ascent;
+ f->descent = pf->descent;
+ f->height = f->ascent + f->descent;
+
+ f->width = gdk_char_width(pf, 'n');
+ f->proportional_p = gdk_char_width(pf, '|') != gdk_char_width(pf, 'W');
+#endif
return 1;
}
@@ -273,7 +301,7 @@
int UNUSED (escapeflag))
{
write_fmt_string (printcharfun, " 0x%lx",
- (unsigned long) gdk_font_id (FONT_INSTANCE_GTK_FONT (f)));
+ (unsigned long) FONT_INSTANCE_GTK_FONT (f));
}
static void
@@ -283,7 +311,12 @@
{
if (DEVICE_LIVE_P (XDEVICE (f->device)))
{
- gdk_font_unref (FONT_INSTANCE_GTK_FONT (f));
+#ifdef HAVE_PANGO
+ /* pango_font_free (FONT_INSTANCE_GTK_FONT (f)); */
+ pango_font_description_free (FONT_INSTANCE_GTK_FONT_DESC (f));
+#else
+ gdk_font_unref (FONT_INSTANCE_GTK_FONT (f));
+#endif
}
xfree (f->data);
f->data = 0;
@@ -291,7 +324,11 @@
}
/* Forward declarations for X specific functions at the end of the file */
-Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font, int expandp);
+#ifdef HAVE_PANGO
+Lisp_Object __get_gtk_font_truename (PangoFont *, int expandp);
+#else
+Lisp_Object __get_gtk_font_truename (GdkFont *, int expandp);
+#endif
static Lisp_Object __gtk_font_list_internal (const char *pattern);
static Lisp_Object
@@ -401,19 +438,30 @@
return (nnames != 0);
}
+#ifdef HAVE_PANGO
Lisp_Object
-__get_gtk_font_truename (GdkFont *gdk_font, int expandp)
+__get_gtk_font_truename (PangoFont *pango_font, int expandp)
{
- //Display *dpy = GDK_FONT_XDISPLAY (gdk_font);
- //GSList *names = ((GdkFontPrivate *) gdk_font)->names;
Lisp_Object font_name = Qnil;
- char *name = (char *) gdk_x11_font_get_name (gdk_font);
+
+ font_name = build_ascstring("a pango font");
+}
- //name = GDK_FONT_X_FONT (gdk_font);
+#else
+Lisp_Object
+__get_gtk_font_truename (GdkFont *font, int expandp)
+{
+ Lisp_Object font_name = Qnil;
+ //Display *dpy = GDK_FONT_XDISPLAY (font);
+ char *name = (char *) gdk_x11_font_get_name (font);
+
+ //name = GDK_FONT_X_FONT font);
if (name != NULL)
font_name = build_cistring (name);
-
+ else
+ font_name = build_ascstring ("unable to get font true name");
#if 0
+ GSList *names = ((GdkFontPrivate *) font)->names;
while (names)
{
@@ -447,6 +495,7 @@
#endif
return (font_name);
}
+#endif /* HAVE_PANGO */
static Lisp_Object __gtk_font_list_internal (const char *pattern)
{
diff -r 650a19ddfbc944063194b25ffbae69f9973dd916 -r c16c21b862d652080c90c8625ef36aa3876ba56f src/sysgtk.h
--- a/src/sysgtk.h
+++ b/src/sysgtk.h
@@ -33,7 +33,10 @@
#include <gtk/gtk.h>
#include <gtk/gtkfixed.h>
#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
+#include <pango/pango.h>
+#include <pango/pangoxft.h>
#endif /* INCLUDED_sysgtk_h_ */
https://bitbucket.org/xemacs/xemacs/commits/c5832c613475/
Changeset: c5832c613475
User: jsparkes
Date: 2010-05-06 18:22:43+00:00
Summary: Merge ffi types.
Affected #: 1 file
diff -r c16c21b862d652080c90c8625ef36aa3876ba56f -r c5832c61347561f597e3b9636d30460d15aa1917 lisp/gtk-ffi.el
--- a/lisp/gtk-ffi.el
+++ b/lisp/gtk-ffi.el
@@ -28,7 +28,7 @@
;; This file is dumped with XEmacs.
-(defvar gtk-type-aliases '((GtkType . guint)
+(defvar gtk-type-aliases '((GType . guint)
(GdkAtom . gulong)
(GdkBitmap . GdkWindow)
(time_t . guint)
https://bitbucket.org/xemacs/xemacs/commits/3201bb2429fd/
Changeset: 3201bb2429fd
User: jsparkes
Date: 2010-05-06 18:28:25+00:00
Summary: Add description for pango font work.
Affected #: 1 file
diff -r c5832c61347561f597e3b9636d30460d15aa1917 -r 3201bb2429fd5c005d97fb8be259c4ad78da7f4a src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,25 @@
+2010-05-06 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * fontcolor-gtk-impl.h (struct gtk_font_instance_data):
+ Add pango font data.
+ (FONT_INSTANCE_GTK_FONT_DESC):
+ Add macros for pango font data access.
+
+ * fontcolor-gtk.c (gtk_initialize_font_instance):
+ Add pango font size initialization.
+ (gtk_finalize_font_instance):
+ Add pango font finalization.
+ (__get_gtk_font_truename):
+ Add pango font truename function.
+
+ * device-gtk.c:
+ Add pango font truename function.
+ (gtk_init_device):
+ Add pango initialization.
+
+ * console-xlike-inc.h:
+ Add pango text width.
+
2010-05-04 Jeff Sparkes <jsparkes(a)gmail.com>
* console-gtk-impl.h (struct gtk_device):
https://bitbucket.org/xemacs/xemacs/commits/4062cab202f6/
Changeset: 4062cab202f6
User: jsparkes
Date: 2010-05-06 20:28:31+00:00
Summary: Gdk has a pango context.
Output successful font load message for debugging.
Affected #: 1 file
diff -r 3201bb2429fd5c005d97fb8be259c4ad78da7f4a -r 4062cab202f65d45955df2b5b96dc180232a82dc src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -249,9 +249,11 @@
/* Should this be default language? --jsparkes */
lang = pango_context_get_language (DEVICE_GTK_CONTEXT (XDEVICE (device)));
/* How do we get XLFD information into a font description? --jsparkes */
- FONT_INSTANCE_GTK_FONT_DESC (f) = pango_font_description_new ();
- pf = pango_context_load_font (DEVICE_GTK_CONTEXT (XDEVICE (device)),
- FONT_INSTANCE_GTK_FONT_DESC (f));
+ //FONT_INSTANCE_GTK_FONT_DESC (f) = pango_font_description_new ();
+ PangoContext *context = gdk_pango_context_get ();
+ pf = pango_context_load_font (context,
+/* pf = pango_context_load_font (DEVICE_GTK_CONTEXT (XDEVICE (device)), */
+/* FONT_INSTANCE_GTK_FONT_DESC (f)); */
#else
pf = gdk_font_load (extname);
gdk_font_ref (pf);
@@ -263,6 +265,11 @@
Qfont, errb);
return 0;
}
+ else
+ {
+ stderr_out ("loaded font %s\n", extname);
+ }
+
/* Don't allocate the data until we're sure that we will succeed,
https://bitbucket.org/xemacs/xemacs/commits/655302eb4998/
Changeset: 655302eb4998
User: jsparkes
Date: 2010-05-06 20:30:15+00:00
Summary: Use simple pango layout to draw text. Still doesn't erase the background.
Affected #: 2 files
diff -r 4062cab202f65d45955df2b5b96dc180232a82dc -r 655302eb4998fe3c8dddc6239ecb05ec72109707 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,9 @@
2010-05-06 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Use a simple pango layout to draw text. It does not erase the
+ background.
+
* fontcolor-gtk-impl.h (struct gtk_font_instance_data):
Add pango font data.
(FONT_INSTANCE_GTK_FONT_DESC):
diff -r 4062cab202f65d45955df2b5b96dc180232a82dc -r 655302eb4998fe3c8dddc6239ecb05ec72109707 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -93,11 +93,21 @@
gint text_length)
{
#if !USE_X_SPECIFIC_DRAW_ROUTINES
- int width = gdk_text_measure (font, text, text_length);
+ int width = gdk_text_width (font, text, text_length);
int height = gdk_text_height (font, text, text_length);
+ PangoLayout *layout;
+ GdkGCValues values;
+
+ gdk_gc_get_values (gc, &values);
+ layout = pango_layout_new (gdk_pango_context_get ());
+ pango_layout_set_text (layout, text, text_length);
+
+ /* Rectangle needs to be drawn with foreground = gc.background.
gdk_draw_rectangle (drawable, gc, TRUE, x, y, width, height);
- gdk_draw_text (drawable, font, gc, x, y, text, text_length);
+ */
+ gdk_draw_layout (drawable, gc, x, y, layout);
+ g_object_unref (layout);
#else
GdkWindowPrivate *drawable_private;
GdkFontPrivate *font_private;
https://bitbucket.org/xemacs/xemacs/commits/2f6b7e5fd00c/
Changeset: 2f6b7e5fd00c
User: jsparkes
Date: 2010-05-06 20:32:05+00:00
Summary: For pango, y is top to bottom.
Affected #: 2 files
diff -r 655302eb4998fe3c8dddc6239ecb05ec72109707 -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-05-06 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ For pango, y is top to bottom.
+
* redisplay-gtk.c (gdk_draw_text_image):
Use a simple pango layout to draw text. It does not erase the
background.
diff -r 655302eb4998fe3c8dddc6239ecb05ec72109707 -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -1323,7 +1323,7 @@
*/
(bgc ? gdk_draw_text : gdk_draw_text_image)
(GDK_DRAWABLE (x_win), FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
- dl->ypos, (char *) runs[i].ptr, runs[i].len * runs[i].dimension);
+ dl->ypos-height, (char *) runs[i].ptr, runs[i].len * runs[i].dimension);
#endif /* (not) THIS_IS_X */
}
https://bitbucket.org/xemacs/xemacs/commits/009b71404a7a/
Changeset: 009b71404a7a
User: jsparkes
Date: 2010-05-07 00:17:35+00:00
Summary: Merge of pango-font changes.
Affected #: 8 files
diff -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e lisp/gtk-ffi.el
--- a/lisp/gtk-ffi.el
+++ b/lisp/gtk-ffi.el
@@ -40,7 +40,7 @@
really part of the object system.")
(defvar gtk-ffi-debug nil
- "If non-nil, all functions defined wiht `gtk-import-function' will be checked
+ "If non-nil, all functions defined with `gtk-import-function' will be checked
for missing marshallers.")
(defun gtk-ffi-check-function (func)
diff -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e lisp/gtk-init.el
--- a/lisp/gtk-init.el
+++ b/lisp/gtk-init.el
@@ -1,4 +1,4 @@
-;;; gtk-init.el --- initialization code for mswindows
+;;; gtk-init.el --- initialization code for Gtk
;; Copyright (C) 1990, 1993, 1994 Free Software Foundation, Inc.
;; Copyright (C) 1995 Board of Trustees, University of Illinois.
;; Copyright (C) 1995, 1996 Ben Wing.
diff -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e lisp/gtk-widget-accessors.el
--- a/lisp/gtk-widget-accessors.el
+++ b/lisp/gtk-widget-accessors.el
@@ -20,33 +20,32 @@
(require 'gtk-ffi)
-(defconst GTK_TYPE_INVALID 0)
-(defconst GTK_TYPE_NONE 1)
-(defconst GTK_TYPE_CHAR 2)
-(defconst GTK_TYPE_UCHAR 3)
-(defconst GTK_TYPE_BOOL 4)
-(defconst GTK_TYPE_INT 5)
-(defconst GTK_TYPE_UINT 6)
-(defconst GTK_TYPE_LONG 7)
-(defconst GTK_TYPE_ULONG 8)
-(defconst GTK_TYPE_FLOAT 9)
-(defconst GTK_TYPE_DOUBLE 10)
-(defconst GTK_TYPE_STRING 11)
-(defconst GTK_TYPE_ENUM 12)
-(defconst GTK_TYPE_FLAGS 13)
-(defconst GTK_TYPE_BOXED 14)
-(defconst GTK_TYPE_POINTER 15)
-(defconst GTK_TYPE_SIGNAL 16)
-(defconst GTK_TYPE_ARGS 17)
-(defconst GTK_TYPE_CALLBACK 18)
-(defconst GTK_TYPE_C_CALLBACK 19)
-(defconst GTK_TYPE_FOREIGN 20)
-(defconst GTK_TYPE_OBJECT 21)
+(defconst G_TYPE_INVALID 0)
+(defconst G_TYPE_NONE 1)
+(defconst G_TYPE_INTERFACE 2)
+(defconst G_TYPE_CHAR 3)
+(defconst G_TYPE_UCHAR 4)
+(defconst G_TYPE_BOOLEAN 5)
+(defconst G_TYPE_INT 6)
+(defconst G_TYPE_UINT 7)
+(defconst G_TYPE_LONG 8)
+(defconst G_TYPE_ULONG 9)
+(defconst G_TYPE_INT64 10)
+(defconst G_TYPE_UINT64 11)
+(defconst G_TYPE_ENUM 12)
+(defconst G_TYPE_FLAGS 13)
+(defconst G_TYPE_FLOAT 14)
+(defconst G_TYPE_DOUBLE 15)
+(defconst G_TYPE_STRING 16)
+(defconst G_TYPE_POINTER 17)
+(defconst G_TYPE_BOXED 18)
+(defconst G_TYPE_PARAM 19)
+(defconst G_TYPE_OBJECT 20)
(defconst gtk-value-accessor-names
- '("INVALID" "NONE" "CHAR" "UCHAR" "BOOL" "INT" "UINT" "LONG" "ULONG" "FLOAT" "DOUBLE"
- "STRING" "ENUM" "FLAGS" "BOXED" "POINTER" "SIGNAL" "ARGS" "CALLBACK" "C_CALLBACK"
- "FOREIGN" "OBJECT"))
+ '("INVALID" "NONE" "INTERFACE" "CHAR" "UCHAR" "BOOLEAN" "INT" "UINT"
+ "LONG" "ULONG" "INT64" "UINT64" "ENUM" "FLAGS" "FLOAT" "DOUBLE"
+ "STRING" "POINTER" "BOXED" "PARAM" "OBJECT"))
(defun define-widget-accessors (gtk-class
wrapper
@@ -81,12 +80,12 @@
"\n"
"\tCHECK_GTK_OBJECT (obj);\n"
"\n"
- (format "\tif (!GTK_IS_%s (XGTK_OBJECT (obj)->object))\n" wrapper)
+ (format "\tif (!G_IS_%s (XGTK_OBJECT (obj)->object))\n" wrapper)
"\t{\n"
(format "\t\twtaerror (\"Object is not a %s\", obj);\n" gtk-class)
"\t};\n"
"\n"
- (format "\tthe_obj = GTK_%s (XGTK_OBJECT (obj)->object);\n" wrapper)
+ (format "\tthe_obj = G_%s (XGTK_OBJECT (obj)->object);\n" wrapper)
(format "\targ.type = gtk_type_from_name (\"%s\");\n" (symbol-name (car arg))))
; (format "\targ.type = GTK_TYPE_%s;\n" (or
@@ -102,17 +101,17 @@
(cond
((= base-arg-type GTK_TYPE_OBJECT)
(insert
- (format "\tGTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->%s);"
+ (format "\tG_VALUE_OBJECT (arg) = G_OBJECT (the_obj->%s);"
(cdr arg))))
((or (= base-arg-type GTK_TYPE_POINTER)
(= base-arg-type GTK_TYPE_BOXED))
(insert
- (format "\tGTK_VALUE_%s (arg) = (void *)the_obj->%s;"
+ (format "\tG_VALUE_%s (arg) = (void *)the_obj->%s;"
(nth (gtk-fundamental-type (car arg)) gtk-value-accessor-names)
(cdr arg))))
(t
(insert
- (format "\tGTK_VALUE_%s (arg) = the_obj->%s;"
+ (format "\tG_VALUE_%s (arg) = the_obj->%s;"
(or (nth (gtk-fundamental-type (car arg)) gtk-value-accessor-names) "POINTER")
(cdr arg)))))
(insert
diff -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e lisp/gtk-widgets.el
--- a/lisp/gtk-widgets.el
+++ b/lisp/gtk-widgets.el
@@ -1155,12 +1155,12 @@
(guint . build))
-(gtk-import-function GtkType gtk_plug_get_type)
+(gtk-import-function GtkType g_type_get_plugin)
(gtk-import-function GtkWidget gtk_plug_new guint)
(gtk-import-function nil gtk_plug_construct GtkPlug guint)
-(gtk-import-function GtkType gtk_progress_get_type)
+(gtk-import-function GtkType gtk_progresss_get_type)
(gtk-import-function nil gtk_progress_set_show_text GtkProgress gint)
(gtk-import-function nil gtk_progress_set_text_alignment GtkProgress gfloat gfloat)
(gtk-import-function nil gtk_progress_set_format_string GtkProgress GtkString)
diff -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -196,6 +196,8 @@
gnome_init ("XEmacs", EMACS_VERSION, argc, argv);
#endif /* INFODOCK */
#else
+ stderr_out ("gtk_init\n");
+
gtk_init (&argc, &argv);
#endif
@@ -213,6 +215,7 @@
speed_up_interrupts ();
free_argc_argv (argv);
+ done = 1;
return (Qt);
}
diff -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -231,74 +231,44 @@
static int
gtk_initialize_font_instance (struct Lisp_Font_Instance *f,
Lisp_Object UNUSED (name),
- Lisp_Object device, Error_Behavior errb)
+ Lisp_Object UNUSED (device), Error_Behavior errb)
{
+ GdkFont *gf;
const char *extname;
-#ifdef HAVE_PANGO
- PangoFont *pf;
- PangoFontMetrics *pfm;
- PangoFontDescription *pfd;
- PangoLanguage *lang;
-#else
- GdkFont *pf;
-#endif
-
+ PangoFontDescription *pango_desc;
+
extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
-#ifdef HAVE_PANGO
- /* Should this be default language? --jsparkes */
- lang = pango_context_get_language (DEVICE_GTK_CONTEXT (XDEVICE (device)));
- /* How do we get XLFD information into a font description? --jsparkes */
- //FONT_INSTANCE_GTK_FONT_DESC (f) = pango_font_description_new ();
- PangoContext *context = gdk_pango_context_get ();
- pf = pango_context_load_font (context,
-/* pf = pango_context_load_font (DEVICE_GTK_CONTEXT (XDEVICE (device)), */
-/* FONT_INSTANCE_GTK_FONT_DESC (f)); */
-#else
- pf = gdk_font_load (extname);
- gdk_font_ref (pf);
-#endif
-
- if (!pf)
+ /* Load font or fontset? */
+ /* gf = gdk_font_load_for_display (extname); --jsparkes */
+ pango_desc = pango_font_description_new ();
+ pango_font_description_set_family (pango_desc, extname);
+ char *nm = pango_font_description_to_string (pango_desc);
+
+ gf = gdk_font_load (extname);
+
+ if (!gf)
{
maybe_signal_error (Qgui_error, "couldn't load font", f->name,
Qfont, errb);
return 0;
}
- else
- {
- stderr_out ("loaded font %s\n", extname);
- }
-
-
/* Don't allocate the data until we're sure that we will succeed,
or the finalize method may get fucked. */
- f->data = xnew_and_zero (struct gtk_font_instance_data);
-
- FONT_INSTANCE_GTK_FONT (f) = pf;
-#ifdef HAVE_PANGO
- pfm = pango_font_get_metrics (pf,
- pango_context_get_language (DEVICE_GTK_CONTEXT (XDEVICE (device))));
- FONT_INSTANCE_GTK_FONT_METRICS (f) = pfm;
- f->ascent = pango_font_metrics_get_ascent (pfm);
- f->descent = pango_font_metrics_get_descent (pfm);
- f->height = f->ascent + f->descent;
+ f->data = xnew (struct gtk_font_instance_data);
+ FONT_INSTANCE_GTK_FONT (f) = gf;
+ /* Kludge until we support Pango. --jsparkes */
+ f->ascent = gf->ascent;
+ f->descent = gf->descent;
+ f->height = gf->ascent + gf->descent;
- pfd = pango_font_describe_with_absolute_size(pf);
- /* g_free (FONT_INSTANCE_GTK_FONT_DESC (f); */
- FONT_INSTANCE_GTK_FONT_DESC (f) = pfd;
- f->width = pango_font_metrics_get_approximate_char_width (pfm);
- f->proportional_p = f->width !=
- pango_font_metrics_get_approximate_digit_width (pfm);
-#else
- f->ascent = pf->ascent;
- f->descent = pf->descent;
- f->height = f->ascent + f->descent;
-
- f->width = gdk_char_width(pf, 'n');
- f->proportional_p = gdk_char_width(pf, '|') != gdk_char_width(pf, 'W');
-#endif
+ /* Now lets figure out the width of the font.
+ We could use a longer string and get the averaage length */
+ /* f->width = gdk_text_width (gf, "abcdefghijklmnopqrstuvwxyz", 26)/26; */
+ f->width = gdk_text_width (gf, "n", 1); /* em or en? */
+ f->proportional_p = (gdk_text_width (gf, "|", 1) !=
+ gdk_text_width (gf, "W", 1));
return 1;
}
@@ -308,7 +278,7 @@
int UNUSED (escapeflag))
{
write_fmt_string (printcharfun, " 0x%lx",
- (unsigned long) FONT_INSTANCE_GTK_FONT (f));
+ (unsigned long) gdk_font_id (FONT_INSTANCE_GTK_FONT (f)));
}
static void
@@ -318,12 +288,7 @@
{
if (DEVICE_LIVE_P (XDEVICE (f->device)))
{
-#ifdef HAVE_PANGO
- /* pango_font_free (FONT_INSTANCE_GTK_FONT (f)); */
- pango_font_description_free (FONT_INSTANCE_GTK_FONT_DESC (f));
-#else
- gdk_font_unref (FONT_INSTANCE_GTK_FONT (f));
-#endif
+ gdk_font_unref (FONT_INSTANCE_GTK_FONT (f));
}
xfree (f->data);
f->data = 0;
@@ -331,11 +296,7 @@
}
/* Forward declarations for X specific functions at the end of the file */
-#ifdef HAVE_PANGO
-Lisp_Object __get_gtk_font_truename (PangoFont *, int expandp);
-#else
-Lisp_Object __get_gtk_font_truename (GdkFont *, int expandp);
-#endif
+Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font, int expandp);
static Lisp_Object __gtk_font_list_internal (const char *pattern);
static Lisp_Object
@@ -445,30 +406,19 @@
return (nnames != 0);
}
-#ifdef HAVE_PANGO
Lisp_Object
-__get_gtk_font_truename (PangoFont *pango_font, int expandp)
+__get_gtk_font_truename (GdkFont *gdk_font, int expandp)
{
+ //Display *dpy = GDK_FONT_XDISPLAY (gdk_font);
+ //GSList *names = ((GdkFontPrivate *) gdk_font)->names;
Lisp_Object font_name = Qnil;
-
- font_name = build_ascstring("a pango font");
-}
+ char *name = (char *) gdk_x11_font_get_name (gdk_font);
-#else
-Lisp_Object
-__get_gtk_font_truename (GdkFont *font, int expandp)
-{
- Lisp_Object font_name = Qnil;
- //Display *dpy = GDK_FONT_XDISPLAY (font);
- char *name = (char *) gdk_x11_font_get_name (font);
-
- //name = GDK_FONT_X_FONT font);
+ //name = GDK_FONT_X_FONT (gdk_font);
if (name != NULL)
font_name = build_cistring (name);
- else
- font_name = build_ascstring ("unable to get font true name");
+
#if 0
- GSList *names = ((GdkFontPrivate *) font)->names;
while (names)
{
@@ -502,7 +452,6 @@
#endif
return (font_name);
}
-#endif /* HAVE_PANGO */
static Lisp_Object __gtk_font_list_internal (const char *pattern)
{
diff -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -56,6 +56,7 @@
static void
xemacs_init_gtk_classes (void)
{
+ g_type_init();
#if 0
/* These are all stored as GValue or GValueArray */
/* Why aren't GLib types GOBjects? */
diff -r 2f6b7e5fd00c6e793d6967eb5098fba570fc722c -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -310,6 +310,9 @@
{
return;
}
+
+ stderr_out ("import_gtk_type %0x %s\n", (gpointer)t, gtk_type_name(t));
+
if (G_TYPE_IS_FUNDAMENTAL (t))
{
switch (t)
@@ -321,14 +324,17 @@
import_gtk_flags_internal (t);
break;
default:
- ABORT();
+ stderr_out ("import_gtk_type %s\n", gtk_type_name(t));
+ // ABORT();
break;
}
}
else if (G_IS_OBJECT (t))
import_gtk_object_internal (t);
- else
- ABORT ();
+ else
+ {
+ stderr_out ("import_gtk_type unknown %s\n", gtk_type_name(t));
+ }
mark_type_as_imported (t);
}
@@ -535,6 +541,8 @@
case G_TYPE_POINTER:
return (build_ascstring ("POINTER"));
default:
+ stderr_out ("type_to_marshaller type %s\n", gtk_type_name(t));
+
ABORT();
/* I can't put this in the main switch statement because it is a
new fundamental type that is not fixed at compile time.
@@ -586,6 +594,7 @@
initialize_dll_cache ();
xemacs_init_gtk_classes ();
+ g_type_init();
arg.value_type = gtk_type_from_name ((char *) XSTRING_DATA (type));
@@ -700,8 +709,7 @@
}
else
{
- ABORT();
- //marshaller = concat3 (marshaller, build_ascstring ("_"), type_to_marshaller_type (G_TYPE_NONE));
+ marshaller = concat3 (marshaller, build_ascstring ("_"), type_to_marshaller_type (G_TYPE_NONE));
}
rettype = Fsymbol_name (rettype);
https://bitbucket.org/xemacs/xemacs/commits/6aa35659e97e/
Changeset: 6aa35659e97e
User: jsparkes
Date: 2010-05-07 00:59:30+00:00
Summary: Remove unused X specific text drawing now that we use pango.
Affected #: 2 files
diff -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e -r 6aa35659e97e1b6278b23d667258872994ed7fd1 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,7 +1,11 @@
2010-05-06 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Remove unused X specifc text drawing now that we use pango.
+
* redisplay-xlike-inc.c (XLIKE_output_string):
For pango, y is top to bottom.
+ (XLIKE_output_string):
* redisplay-gtk.c (gdk_draw_text_image):
Use a simple pango layout to draw text. It does not erase the
diff -r 009b71404a7ae2f6f49b82a98ffd57c6c6ac908e -r 6aa35659e97e1b6278b23d667258872994ed7fd1 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -79,7 +79,6 @@
/* This makes me feel incredibly dirty... but there is no other way to
get this done right other than calling clear_area before every
single $#!%@ing piece of text, which I do NOT want to do. */
-#define USE_X_SPECIFIC_DRAW_ROUTINES 0
#include "sysgdkx.h"
@@ -92,7 +91,6 @@
const gchar *text,
gint text_length)
{
-#if !USE_X_SPECIFIC_DRAW_ROUTINES
int width = gdk_text_width (font, text, text_length);
int height = gdk_text_height (font, text, text_length);
PangoLayout *layout;
@@ -103,51 +101,10 @@
layout = pango_layout_new (gdk_pango_context_get ());
pango_layout_set_text (layout, text, text_length);
- /* Rectangle needs to be drawn with foreground = gc.background.
- gdk_draw_rectangle (drawable, gc, TRUE, x, y, width, height);
- */
+ /* Rectangle needs to be drawn with foreground = gc.background. */
+ /* gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height); */
gdk_draw_layout (drawable, gc, x, y, layout);
g_object_unref (layout);
-#else
- GdkWindowPrivate *drawable_private;
- GdkFontPrivate *font_private;
- GdkGCPrivate *gc_private;
-
- g_return_if_fail (drawable != NULL);
- g_return_if_fail (font != NULL);
- g_return_if_fail (gc != NULL);
- g_return_if_fail (text != NULL);
-
- drawable_private = (GdkWindowPrivate*) drawable;
- if (drawable_private->destroyed)
- return;
- gc_private = (GdkGCPrivate*) gc;
- font_private = (GdkFontPrivate*) font;
-
- if (font->type == GDK_FONT_FONT)
- {
- XFontStruct *xfont = (XFontStruct *) font_private->xfont;
- XSetFont(drawable_private->xdisplay, gc_private->xgc, xfont->fid);
- if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
- {
- XDrawImageString (drawable_private->xdisplay, drawable_private->xwindow,
- gc_private->xgc, x, y, text, text_length);
- }
- else
- {
- XDrawImageString16 (drawable_private->xdisplay, drawable_private->xwindow,
- gc_private->xgc, x, y, (XChar2b *) text, text_length / 2);
- }
- }
- else if (font->type == GDK_FONT_FONTSET)
- {
- XFontSet fontset = (XFontSet) font_private->xfont;
- XmbDrawImageString (drawable_private->xdisplay, drawable_private->xwindow,
- fontset, gc_private->xgc, x, y, text, text_length);
- }
- else
- g_error("undefined font type\n");
-#endif
}
static void
https://bitbucket.org/xemacs/xemacs/commits/464d59cd7924/
Changeset: 464d59cd7924
User: jsparkes
Date: 2010-05-07 01:03:01+00:00
Summary: Draw the filled rectangle with the background before drawing the text.
Affected #: 2 files
diff -r 6aa35659e97e1b6278b23d667258872994ed7fd1 -r 464d59cd79242927bd9e33956cb750f4a36b19f3 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,7 +1,10 @@
2010-05-06 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Draw the filled rectangle with the background before drawing the text.
+
* redisplay-gtk.c (gdk_draw_text_image):
- Remove unused X specifc text drawing now that we use pango.
+ Remove unused X specific text drawing now that we use pango.
* redisplay-xlike-inc.c (XLIKE_output_string):
For pango, y is top to bottom.
diff -r 6aa35659e97e1b6278b23d667258872994ed7fd1 -r 464d59cd79242927bd9e33956cb750f4a36b19f3 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -1011,7 +1011,7 @@
/* Text-related variables */
Lisp_Object bg_pmap;
- XLIKE_GC bgc, gc;
+ XLIKE_GC gc, bgc;
int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
int ypos = XLIKE_DISPLAY_LINE_YPOS (dl);
int len = Dynarr_length (buf);
@@ -1100,16 +1100,18 @@
&& !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap))
bgc = 0;
else
- bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
- bg_pmap, cachel->background_placement, Qnil);
-
- if (bgc)
{
+ bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
+ bg_pmap, cachel->background_placement, Qnil);
+#ifdef THIS_IS_X
XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start,
ypos, clip_end - clip_start,
height);
+#else
+ gdk_draw_rectangle (GDK_DRAWABLE (x_win), bgc, TRUE, clip_start, ypos,
+ clip_end - clip_start, height);
+#endif
}
-
nruns = separate_textual_runs (text_storage, runs, Dynarr_begin (buf),
Dynarr_length (buf), cachel);
@@ -1321,9 +1323,12 @@
dimension of the text. This will do the right thing for
single-dimension runs as well of course.
*/
- (bgc ? gdk_draw_text : gdk_draw_text_image)
+ // gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, clip_start,
+ // ypos, clip_end - clip_start, height);
+
+ gdk_draw_text_image
(GDK_DRAWABLE (x_win), FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
- dl->ypos-height, (char *) runs[i].ptr, runs[i].len * runs[i].dimension);
+ dl->ypos-height, (char *) runs[i].ptr, runs[i].len);
#endif /* (not) THIS_IS_X */
}
@@ -1635,7 +1640,7 @@
{
struct device *d = XDEVICE (f->device);
XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
- XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+ /* XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f); */
XLIKE_GC gc;
XLIKE_GCVALUES gcv;
unsigned long pixmap_mask;
https://bitbucket.org/xemacs/xemacs/commits/c27c8ad5185e/
Changeset: c27c8ad5185e
User: jsparkes
Date: 2010-05-07 12:17:21+00:00
Summary: Smarter way to get class properties.
Affected #: 1 file
diff -r 464d59cd79242927bd9e33956cb750f4a36b19f3 -r c27c8ad5185ea7fcd699b035f21c54f1cdffdef5 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -183,7 +183,7 @@
{
//GType original_type = the_type;
int first_time = 1;
-
+ stderr_out ("import_gtk_object_internal %s\n", g_type_name (the_type));
do
{
#ifdef JSPARKES
@@ -635,6 +635,12 @@
Lisp_Object marshaller = Qnil;
emacs_ffi_data *data = NULL;
gint n_args = 0;
+ static int initialized = 0;
+
+ if (initialized == 0) {
+ g_type_init();
+ initialized = 1;
+ }
#if 0
dll_handle h = NULL;
#endif
@@ -1428,6 +1434,8 @@
{
CHECK_STRING (type_name);
gchar *name = (gchar *)XSTRING_DATA (type_name);
+ guint t = g_type_from_name (name);
+ const gchar *n2 = g_type_name (t);
return (build_ascstring (g_type_name (g_type_from_name (name))));
}
@@ -1437,6 +1445,7 @@
(name))
{
GType gt;
+ GObjectClass *type_class = NULL;
GObject *obj;
Lisp_Object prop_list = Qnil;
GParamSpec **props;
@@ -1446,13 +1455,12 @@
gt = g_type_from_name ((gchar *)XSTRING_DATA (name));
if (gt == G_TYPE_INVALID)
invalid_state ("type does not exist", name);
-
- obj = (GObject *)g_object_newv (gt, 0, NULL);
+
+ type_class = (GObjectClass *)g_type_class_peek (gt);
if (obj == NULL)
invalid_state("Unable to create GObject of class", name);
- props = g_object_class_list_properties (G_OBJECT_CLASS (obj),
- &n_props);
+ props = g_object_class_list_properties (type_class, &n_props);
for (i = 0; i < n_props; i++)
{
GValue v;
https://bitbucket.org/xemacs/xemacs/commits/c575d240bd88/
Changeset: c575d240bd88
User: jsparkes
Date: 2010-05-07 13:24:51+00:00
Summary: Use GQuarks instead of strings for GObject data attachments.
Affected #: 7 files
diff -r c27c8ad5185ea7fcd699b035f21c54f1cdffdef5 -r c575d240bd8811e871581a16688e442b236eeb12 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,29 +1,56 @@
-2010-05-06 Jeff Sparkes <jsparkes(a)gmail.com>
+2010-05-07 Jeff Sparkes <jsparkes(a)gmail.com>
- * redisplay-xlike-inc.c (XLIKE_output_string):
- Draw the filled rectangle with the background before drawing the text.
+ * ui-gtk.c (build_gtk_object):
+ Use g_object_get_qdata now that key is a GQuark.
- * redisplay-gtk.c (gdk_draw_text_image):
- Remove unused X specific text drawing now that we use pango.
+ * menubar-gtk.c (XEMACS_MENU_DESCR_TAG, XEMACS_MENU_FILTER_TAG,
+ XEMACS_MENU_GUIID_TAG, XEMACS_MENU_FIRSTTIME_TAG):
+ Use GQuark instead of string for GObject data key.
+ (__activate_menu):
+ Use g_object_get_qdata now that key is a GQuark.
+ (menu_convert): Ditto.
+ (menu_create_menubar): Ditto.
+ (gtk_popup_menu): Ditto.
- * redisplay-xlike-inc.c (XLIKE_output_string):
- For pango, y is top to bottom.
- (XLIKE_output_string):
+ * glyphs-gtk.c (gtk_tab_control_callback):
+ Use g_object_get_qdata now that key is a GQuark.
+
+ * frame-gtk.c (gtk_widget_to_frame):
+ Use g_object_get_qdata now that key is a GQuark.
+ (gtk_popup_frame): Ditto.
+ (gtk_get_frame_parent):
+ get_data is now a g_object method, not gtk_object.
+
+ * console-gtk-impl.h (GTK_DATA_FRAME_IDENTIFIER,
+ GTK_DATA_TAB_HASHCODE_IDENTIFIER, GTK_DATA_GUI_IDENTIFIER):
+ Use GQuark instead of string for GObject data key.
- * redisplay-gtk.c (gdk_draw_text_image):
- Use a simple pango layout to draw text. It does not erase the
- background.
+
+2010-05-06 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Draw the filled rectangle with the background before drawing the text.
+
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Remove unused X specific text drawing now that we use pango.
+
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ For pango, y is top to bottom.
+ (XLIKE_output_string):
- * fontcolor-gtk-impl.h (struct gtk_font_instance_data):
- Add pango font data.
- (FONT_INSTANCE_GTK_FONT_DESC):
- Add macros for pango font data access.
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Use a simple pango layout to draw text. It does not erase the
+ background.
- * fontcolor-gtk.c (gtk_initialize_font_instance):
- Add pango font size initialization.
- (gtk_finalize_font_instance):
- Add pango font finalization.
- (__get_gtk_font_truename):
+ * fontcolor-gtk-impl.h (struct gtk_font_instance_data):
+ Add pango font data.
+ (FONT_INSTANCE_GTK_FONT_DESC):
+ Add macros for pango font data access.
+
+ * fontcolor-gtk.c (gtk_initialize_font_instance):
+ Add pango font size initialization.
+ (gtk_finalize_font_instance):
+ Add pango font finalization.
+ (__get_gtk_font_truename):
Add pango font truename function.
* device-gtk.c:
@@ -94,7 +121,8 @@
* device-gtk.c (gtk_delete_device):
NEW_GC doesn't allow/require freeing device directly.
-2010-04-21 Jeff Sparkes <jsparkes(a)gmail.com>
+2010-04-21 Jeff Sparkes <jsparkes@gmail
+ .com>
* fontcolor-gtk.c (gtk_color_instance_hash):
Remove gtk_color_instance_hash equalp argument.
@@ -398,7 +426,7 @@
* ui-gtk.c (lisp_to_gtk_type): Know how to deal with
GTK_TYPE_GDK_GC.
- * gtk-glue.c: Need to defien a GTK type for
+ * gtk-glue.c: Need to define a GTK type for
GdkGC so that we can
import all the GDK drawing primitives.
(face_to_gc): New function to convert a face object to a GC.
diff -r c27c8ad5185ea7fcd699b035f21c54f1cdffdef5 -r c575d240bd8811e871581a16688e442b236eeb12 src/console-gtk-impl.h
--- a/src/console-gtk-impl.h
+++ b/src/console-gtk-impl.h
@@ -254,12 +254,12 @@
extern struct console_type *gtk_console_type;
/* Special data used to quickly identify the frame that contains a widget. */
-#define GTK_DATA_FRAME_IDENTIFIER "xemacs::frame"
+#define GTK_DATA_FRAME_IDENTIFIER g_quark_from_string ("xemacs::frame")
/* The hashcode in the frame hash table of a tab_control tab's callback data. */
-#define GTK_DATA_TAB_HASHCODE_IDENTIFIER "xemacs::tab_hashcode"
+#define GTK_DATA_TAB_HASHCODE_IDENTIFIER g_quark_static_string ("xemacs::tab_hashcode")
-#define GTK_DATA_GUI_IDENTIFIER "xemacs::gui_id"
+#define GTK_DATA_GUI_IDENTIFIER g_quark_from_string ("xemacs::gui_id")
#endif /* HAVE_GTK */
#endif /* INCLUDED_console_gtk_impl_h_ */
diff -r c27c8ad5185ea7fcd699b035f21c54f1cdffdef5 -r c575d240bd8811e871581a16688e442b236eeb12 src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -128,8 +128,8 @@
for (; w; w = w->parent)
{
- if ((f = (struct frame *) gtk_object_get_data (GTK_OBJECT (w),
- GTK_DATA_FRAME_IDENTIFIER)))
+ if ((f = (struct frame *) g_object_get_qdata (G_OBJECT(GTK_OBJECT (w)),
+ GTK_DATA_FRAME_IDENTIFIER)))
return (f);
}
@@ -849,7 +849,7 @@
/* Add a mapping from widget to frame to help widget callbacks quickly find
their corresponding frame. */
- gtk_object_set_data (GTK_OBJECT (shell), GTK_DATA_FRAME_IDENTIFIER, f);
+ g_object_set_qdata (G_OBJECT (GTK_OBJECT (shell)), GTK_DATA_FRAME_IDENTIFIER, f);
FRAME_GTK_SHELL_WIDGET (f) = shell;
@@ -950,7 +950,8 @@
{
/* */
- if (gtk_object_get_data (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f)), UNMAPPED_DATA_IDENTIFIER))
+ if (g_object_get_data (G_OBJECT (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f))),
+ UNMAPPED_DATA_IDENTIFIER))
{
FRAME_GTK_TOTALLY_VISIBLE_P (f) = 0;
f->visible = 0;
@@ -1129,8 +1130,9 @@
static Lisp_Object
gtk_get_frame_parent (struct frame *f)
{
- GtkWidget *parentwid = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f)),
- TRANSIENT_DATA_IDENTIFIER);
+ GtkWidget *parentwid = (GtkWidget*)
+ g_object_get_data (G_OBJECT (GTK_OBJECT (FRAME_GTK_SHELL_WIDGET (f))),
+ TRANSIENT_DATA_IDENTIFIER);
/* find the frame whose wid is parentwid */
if (parentwid)
diff -r c27c8ad5185ea7fcd699b035f21c54f1cdffdef5 -r c575d240bd8811e871581a16688e442b236eeb12 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -2599,8 +2599,8 @@
return;
frame = wrap_frame (f);
- //id = (int) gtk_object_get_data(GTK_OBJECT(page->child),
- GTK_DATA_TAB_HASHCODE_IDENTIFIER);
+ id = (int) g_object_get_qdata(GTK_OBJECT(page->child),
+ GTK_DATA_TAB_HASHCODE_IDENTIFIER);
image_instance = Fgethash(make_int_verify(id),
FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE(f), Qnil);
callback = Fgethash(make_int(id),
diff -r c27c8ad5185ea7fcd699b035f21c54f1cdffdef5 -r c575d240bd8811e871581a16688e442b236eeb12 src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -301,10 +301,10 @@
return Qnil;
}
-#define XEMACS_MENU_DESCR_TAG "xemacs::menu::description"
-#define XEMACS_MENU_FILTER_TAG "xemacs::menu::filter"
-#define XEMACS_MENU_GUIID_TAG "xemacs::menu::gui_id"
-#define XEMACS_MENU_FIRSTTIME_TAG "xemacs::menu::first_time"
+#define XEMACS_MENU_DESCR_TAG g_quark_from_string ("xemacs::menu::description")
+#define XEMACS_MENU_FILTER_TAG q_quark_from_string ("xemacs::menu::filter")
+#define XEMACS_MENU_GUIID_TAG q_quark_from_string ("xemacs::menu::gui_id")
+#define XEMACS_MENU_FIRSTTIME_TAG q_quark_from_string ("xemacs::menu::first_time")
static void __activate_menu(GtkMenuItem *, gpointer);
@@ -321,7 +321,7 @@
Lisp_Object menu_desc = Qnil;
GtkWidget *old_submenu = GTK_MENU_ITEM (menu_item)->submenu;
- menu_desc = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
+ menu_desc = GET_LISP_FROM_VOID (g_object_get_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
/* GCPRO all of our very own */
gcpro_popup_callbacks (id, menu_desc);
@@ -369,7 +369,7 @@
__activate_menu(GtkMenuItem *item, gpointer user_data)
{
Lisp_Object desc;
- gpointer force_clear = gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG);
+ gpointer force_clear = g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG);
gtk_object_set_data (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG, 0x00);
@@ -386,7 +386,7 @@
return;
}
- desc = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_DESCR_TAG));
+ desc = GET_LISP_FROM_VOID (g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_DESCR_TAG));
#ifdef TEAR_OFF_MENUS
/* Lets stick in a detacher just for giggles */
@@ -401,11 +401,11 @@
if (user_data)
{
- GUI_ID id = (GUI_ID) gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_GUIID_TAG);
+ GUI_ID id = (GUI_ID) g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_GUIID_TAG);
Lisp_Object hook_fn;
struct gcpro gcpro1, gcpro2;
- hook_fn = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FILTER_TAG));
+ hook_fn = GET_LISP_FROM_VOID (g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_FILTER_TAG));
GCPRO2 (desc, hook_fn);
@@ -687,7 +687,7 @@
*/
if (reuse)
{
- gpointer id = gtk_object_get_data (GTK_OBJECT (reuse), XEMACS_MENU_GUIID_TAG);
+ gpointer id = g_object_get_qdata (GTK_OBJECT (reuse), XEMACS_MENU_GUIID_TAG);
if (id)
{
@@ -1088,7 +1088,7 @@
gboolean right_justify = FALSE;
Lisp_Object value = descr;
GtkWidget *menubar = FRAME_GTK_MENUBAR_WIDGET (f);
- GUI_ID id = (GUI_ID) gtk_object_get_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG);
+ GUI_ID id = (GUI_ID) g_object_get_qdata (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG);
guint menu_position = 0;
GtkAccelGroup *menubar_accel_group;
@@ -1415,7 +1415,7 @@
widget = menu_descriptor_to_widget (menu_desc, NULL);
menu = GTK_MENU_ITEM (widget)->submenu;
gtk_widget_set_name (widget, "XEmacsPopupMenu");
- id = gtk_object_get_data (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG);
+ id = gtk_object_get_qdata (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG);
__activate_menu (GTK_MENU_ITEM (widget), id);
diff -r c27c8ad5185ea7fcd699b035f21c54f1cdffdef5 -r c575d240bd8811e871581a16688e442b236eeb12 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -102,8 +102,10 @@
SCROLLBAR_GTK_VDRAG_ORIG_VALUE (instance) = -1;
SCROLLBAR_GTK_LAST_VALUE (instance) = adj->value;
- gtk_object_set_data (GTK_OBJECT (adj), GTK_DATA_GUI_IDENTIFIER, (void *) SCROLLBAR_GTK_ID (instance));
- gtk_object_set_data (GTK_OBJECT (adj), GTK_DATA_FRAME_IDENTIFIER, f);
+ g_object_set_qdata (G_OBJECT (GTK_OBJECT (adj)), GTK_DATA_GUI_IDENTIFIER,
+ (void *) SCROLLBAR_GTK_ID (instance));
+ g_object_set_qdata (G_OBJECT (GTK_OBJECT (adj)), GTK_DATA_FRAME_IDENTIFIER,
+ f);
sb = GTK_SCROLLBAR (vertical ? gtk_vscrollbar_new (adj) : gtk_hscrollbar_new (adj));
SCROLLBAR_GTK_WIDGET (instance) = GTK_WIDGET (sb);
@@ -136,10 +138,11 @@
#define UPDATE_DATA_FIELD(field) \
if (new_##field >= 0 && \
- SCROLLBAR_GTK_POS_DATA (inst).field != new_##field) { \
- SCROLLBAR_GTK_POS_DATA (inst).field = new_##field; \
- inst->scrollbar_instance_changed = 1; \
- }
+ SCROLLBAR_GTK_POS_DATA (inst).field != new_##field) \
+ { \
+ SCROLLBAR_GTK_POS_DATA (inst).field = new_##field; \
+ inst->scrollbar_instance_changed = 1; \
+ }
/* A device method. */
/* #### The -1 check is such a hack. */
@@ -282,7 +285,7 @@
scrolls around in the XEmacs frame manually. So we
update the slider manually here.
*/
- if (!modified_p)
+ //if (!modified_p)
gtk_range_set_adjustment (GTK_RANGE (wid), adj);
instance->scrollbar_instance_changed = 0;
@@ -399,9 +402,11 @@
{
/* This function can GC */
int vertical = GPOINTER_TO_INT (user_data);
- struct frame *f = (struct frame*) gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_FRAME_IDENTIFIER);
+ struct frame *f = (struct frame*)
+ g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)), GTK_DATA_FRAME_IDENTIFIER);
struct scrollbar_instance *instance;
- GUI_ID id = GPOINTER_TO_UINT (gtk_object_get_data (GTK_OBJECT (adj), GTK_DATA_GUI_IDENTIFIER));
+ GUI_ID id = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)),
+ GTK_DATA_GUI_IDENTIFIER));
Lisp_Object win, frame;
struct window_mirror *mirror;
Lisp_Object event_type = Qnil;
@@ -515,3 +520,5 @@
{
Fprovide (intern ("gtk-scrollbars"));
}
+
+
diff -r c27c8ad5185ea7fcd699b035f21c54f1cdffdef5 -r c575d240bd8811e871581a16688e442b236eeb12 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -311,7 +311,7 @@
return;
}
- stderr_out ("import_gtk_type %0x %s\n", (gpointer)t, gtk_type_name(t));
+ stderr_out ("import_gtk_type %0x %s\n", (unsigned int)t, gtk_type_name(t));
if (G_TYPE_IS_FUNDAMENTAL (t))
{
@@ -1040,7 +1040,7 @@
emacs_gtk_object_data *data = NULL;
GUI_ID id = 0;
- id = (GUI_ID) GPOINTER_TO_UINT (g_object_get_data (obj , GTK_DATA_GUI_IDENTIFIER));
+ id = (GUI_ID) GPOINTER_TO_UINT (g_object_get_qdata (obj , GTK_DATA_GUI_IDENTIFIER));
if (id)
{
@@ -1056,7 +1056,7 @@
retval = wrap_emacs_gtk_object (data);
id = new_gui_id ();
- g_object_set_data (obj, GTK_DATA_GUI_IDENTIFIER, (gpointer) id);
+ g_object_set_qdata (obj, GTK_DATA_GUI_IDENTIFIER, (gpointer) id);
gcpro_popup_callbacks (id, retval);
g_object_ref (obj);
g_signal_connect (obj, "destroy", GTK_SIGNAL_FUNC (__notice_object_destruction), (gpointer)id);
@@ -1435,7 +1435,6 @@
CHECK_STRING (type_name);
gchar *name = (gchar *)XSTRING_DATA (type_name);
guint t = g_type_from_name (name);
- const gchar *n2 = g_type_name (t);
return (build_ascstring (g_type_name (g_type_from_name (name))));
}
https://bitbucket.org/xemacs/xemacs/commits/d4df4dafd7d9/
Changeset: d4df4dafd7d9
User: jsparkes
Date: 2010-05-07 14:32:48+00:00
Summary: Connect to "change-value" signal on the scrollbar to get more detailed
scrolling information similar to Gtk 1.x "value-changed" callback.
Affected #: 3 files
diff -r c575d240bd8811e871581a16688e442b236eeb12 -r d4df4dafd7d9638fff13acfad1d85d691c557756 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-07 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * scrollbar-gtk.c (scrollbar_cb):
+ Callback now gets GtkRange* and GtkScrollType arguments.
+
2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
* doc.c (Fdocumentation):
diff -r c575d240bd8811e871581a16688e442b236eeb12 -r d4df4dafd7d9638fff13acfad1d85d691c557756 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,9 @@
2010-05-07 Jeff Sparkes <jsparkes(a)gmail.com>
+ * scrollbar-gtk.c (gtk_create_scrollbar_instance):
+ Connect to signal from scrollbar to get 1.X like behaviour
+ from the scrollbar. Assert check the signal connect calls.
+
* ui-gtk.c (build_gtk_object):
Use g_object_get_qdata now that key is a GQuark.
diff -r c575d240bd8811e871581a16688e442b236eeb12 -r d4df4dafd7d9638fff13acfad1d85d691c557756 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -35,7 +35,9 @@
#include "glyphs-gtk.h"
#include "scrollbar-gtk.h"
-static gboolean scrollbar_cb (GtkAdjustment *adj, gpointer user_data);
+static gboolean scrollbar_cb (GtkRange *, GtkScrollType scroll,
+ gdouble value, gpointer user_data);
+
/* Used to prevent changing the size of the slider while drag
scrolling, under Motif. This is necessary because the Motif
@@ -110,14 +112,14 @@
sb = GTK_SCROLLBAR (vertical ? gtk_vscrollbar_new (adj) : gtk_hscrollbar_new (adj));
SCROLLBAR_GTK_WIDGET (instance) = GTK_WIDGET (sb);
- gtk_signal_connect (GTK_OBJECT (adj),"value-changed",
- GTK_SIGNAL_FUNC (scrollbar_cb), (gpointer) vertical);
+ assert(g_signal_connect (GTK_OBJECT (sb),"change-value",
+ G_CALLBACK (scrollbar_cb), (gpointer) vertical));
+ assert(gtk_signal_connect (GTK_OBJECT (sb), "button-press-event",
+ GTK_SIGNAL_FUNC (scrollbar_drag_hack_cb), (gpointer) 1));
+ assert(gtk_signal_connect (GTK_OBJECT (sb), "button-release-event",
+ GTK_SIGNAL_FUNC (scrollbar_drag_hack_cb), (gpointer) 0));
- gtk_signal_connect (GTK_OBJECT (sb), "button-press-event",
- GTK_SIGNAL_FUNC (scrollbar_drag_hack_cb), (gpointer) 1);
- gtk_signal_connect (GTK_OBJECT (sb), "button-release-event",
- GTK_SIGNAL_FUNC (scrollbar_drag_hack_cb), (gpointer) 0);
-
+ /* Do we need to connect to "destroy" too? --jsparkes */
gtk_fixed_put (GTK_FIXED (FRAME_GTK_TEXT_WIDGET (f)), SCROLLBAR_GTK_WIDGET (instance), 0, 0);
/*
@@ -398,23 +400,30 @@
}
static gboolean
-scrollbar_cb (GtkAdjustment *adj, gpointer user_data)
+scrollbar_cb (GtkRange *range, GtkScrollType scroll, gdouble value,
+ gpointer user_data)
{
/* This function can GC */
+ GtkAdjustment *adj = gtk_range_get_adjustment (range);
int vertical = GPOINTER_TO_INT (user_data);
- struct frame *f = (struct frame*)
- g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)), GTK_DATA_FRAME_IDENTIFIER);
+ struct frame *f = 0;
struct scrollbar_instance *instance;
- GUI_ID id = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)),
- GTK_DATA_GUI_IDENTIFIER));
+ GUI_ID id;
+ gdouble position = gtk_adjustment_get_value (adj);
Lisp_Object win, frame;
struct window_mirror *mirror;
Lisp_Object event_type = Qnil;
Lisp_Object event_data = Qnil;
+ f = (struct frame*) g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)),
+ GTK_DATA_FRAME_IDENTIFIER);
if (!f)
return(FALSE);
+ id = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)),
+ GTK_DATA_GUI_IDENTIFIER));
+ assert (id != 0);
+
mirror = find_scrollbar_window_mirror (f, id);
if (!mirror)
return(FALSE);
@@ -425,10 +434,10 @@
return(FALSE);
instance = vertical ? mirror->scrollbar_vertical_instance : mirror->scrollbar_horizontal_instance;
frame = WINDOW_FRAME (XWINDOW (win));
-#if 0
--- jsparkes
+ GtkRange *r = GTK_RANGE (SCROLLBAR_GTK_WIDGET (instance));
inhibit_slider_size_change = 0;
- switch (GTK_RANGE (SCROLLBAR_GTK_WIDGET (instance))->scroll_type)
+ /* Todo: add horizontal events from gtk-2.X */
+ switch (scroll)
{
case GTK_SCROLL_PAGE_BACKWARD:
event_type = vertical ? Qscrollbar_page_up : Qscrollbar_page_left;
@@ -455,7 +464,6 @@
default:
ABORT();
}
-#endif
signal_special_gtk_user_event (frame, event_type, event_data);
return (TRUE);
https://bitbucket.org/xemacs/xemacs/commits/661e8d3bd9c5/
Changeset: 661e8d3bd9c5
User: jsparkes
Date: 2010-05-07 14:47:24+00:00
Summary: Handle all GtkScrollType enum values.
Affected #: 2 files
diff -r d4df4dafd7d9638fff13acfad1d85d691c557756 -r 661e8d3bd9c5d82e098a63676386ad80649eb0ff src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -3,7 +3,8 @@
* scrollbar-gtk.c (gtk_create_scrollbar_instance):
Connect to signal from scrollbar to get 1.X like behaviour
from the scrollbar. Assert check the signal connect calls.
-
+ (scrollbar_cb): Handle all GtkScrollType enum values.
+
* ui-gtk.c (build_gtk_object):
Use g_object_get_qdata now that key is a GQuark.
diff -r d4df4dafd7d9638fff13acfad1d85d691c557756 -r 661e8d3bd9c5d82e098a63676386ad80649eb0ff src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -405,7 +405,8 @@
{
/* This function can GC */
GtkAdjustment *adj = gtk_range_get_adjustment (range);
- int vertical = GPOINTER_TO_INT (user_data);
+ int vertical = gtk_orientable_get_orientation ((GtkOrientable *)range) ==
+ GTK_ORIENTATION_VERTICAL;
struct frame *f = 0;
struct scrollbar_instance *instance;
GUI_ID id;
@@ -440,18 +441,26 @@
switch (scroll)
{
case GTK_SCROLL_PAGE_BACKWARD:
+ case GTK_SCROLL_PAGE_UP:
+ case GTK_SCROLL_START:
event_type = vertical ? Qscrollbar_page_up : Qscrollbar_page_left;
event_data = Fcons (win, Qnil);
break;
case GTK_SCROLL_PAGE_FORWARD:
+ case GTK_SCROLL_PAGE_DOWN:
+ case GTK_SCROLL_END:
event_type = vertical ? Qscrollbar_page_down : Qscrollbar_page_right;
event_data = Fcons (win, Qnil);
break;
case GTK_SCROLL_STEP_FORWARD:
+ case GTK_SCROLL_STEP_DOWN:
+ case GTK_SCROLL_STEP_LEFT:
event_type = vertical ? Qscrollbar_line_down : Qscrollbar_char_right;
event_data = win;
break;
case GTK_SCROLL_STEP_BACKWARD:
+ case GTK_SCROLL_STEP_UP:
+ case GTK_SCROLL_STEP_RIGHT:
event_type = vertical ? Qscrollbar_line_up : Qscrollbar_char_left;
event_data = win;
break;
@@ -465,6 +474,8 @@
ABORT();
}
signal_special_gtk_user_event (frame, event_type, event_data);
+ if (scroll != GTK_SCROLL_NONE)
+ gtk_adjustment_value_changed (adj);
return (TRUE);
}
https://bitbucket.org/xemacs/xemacs/commits/d9a949cd3cb5/
Changeset: d9a949cd3cb5
User: jsparkes
Date: 2010-05-08 23:14:08+00:00
Summary: Only fill the background rectangle in gdk_draw_text_image where the
true rectangle size can be calculated with pango.
Affected #: 3 files
diff -r 661e8d3bd9c5d82e098a63676386ad80649eb0ff -r d9a949cd3cb5e0540e2c371cdf4183a2bad45a96 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,14 @@
+2010-05-08 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Use pango_layout_get_pixel_size to get the true size of the text
+ rectangle. Fill that rectangle with the given background gc.
+
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Don't erase the background here because the true text width can't
+ be calculated without pango. Create a background gc if it doesn't
+ exist.
+
2010-05-07 Jeff Sparkes <jsparkes(a)gmail.com>
* scrollbar-gtk.c (gtk_create_scrollbar_instance):
diff -r 661e8d3bd9c5d82e098a63676386ad80649eb0ff -r d9a949cd3cb5e0540e2c371cdf4183a2bad45a96 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -82,17 +82,23 @@
#include "sysgdkx.h"
+/*
+ * Only this function can erase the text area because the text area
+ * is calculated by pango. The layout is currently not shared. There
+ * can only be one PangoLayout per line, I think. --jsparkes
+ */
static void
gdk_draw_text_image (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
+ GdkGC *bgc,
gint x,
gint y,
const gchar *text,
gint text_length)
{
- int width = gdk_text_width (font, text, text_length);
- int height = gdk_text_height (font, text, text_length);
+ int width = -1;
+ int height = -1;
PangoLayout *layout;
GdkGCValues values;
@@ -100,9 +106,10 @@
layout = pango_layout_new (gdk_pango_context_get ());
pango_layout_set_text (layout, text, text_length);
+ pango_layout_get_pixel_size (layout, &width, &height);
- /* Rectangle needs to be drawn with foreground = gc.background. */
- /* gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height); */
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
gdk_draw_layout (drawable, gc, x, y, layout);
g_object_unref (layout);
}
diff -r 661e8d3bd9c5d82e098a63676386ad80649eb0ff -r d9a949cd3cb5e0540e2c371cdf4183a2bad45a96 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -981,6 +981,7 @@
void gdk_draw_text_image (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
+ GdkGC *bgc,
gint x,
gint y,
const gchar *text,
@@ -1103,13 +1104,11 @@
{
bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
bg_pmap, cachel->background_placement, Qnil);
-#ifdef THIS_IS_X
+#ifndef THIS_IS_GTK
+ /* Gtk text width is unknown */
XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start,
ypos, clip_end - clip_start,
height);
-#else
- gdk_draw_rectangle (GDK_DRAWABLE (x_win), bgc, TRUE, clip_start, ypos,
- clip_end - clip_start, height);
#endif
}
nruns = separate_textual_runs (text_storage, runs, Dynarr_begin (buf),
@@ -1206,7 +1205,7 @@
bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
#endif
gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background,
- Qdim, Qnil, Qnil);
+ bg_pmap, cachel->background_placement, Qnil);
}
else
{
@@ -1323,12 +1322,20 @@
dimension of the text. This will do the right thing for
single-dimension runs as well of course.
*/
- // gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, clip_start,
- // ypos, clip_end - clip_start, height);
-
- gdk_draw_text_image
- (GDK_DRAWABLE (x_win), FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
- dl->ypos-height, (char *) runs[i].ptr, runs[i].len);
+ {
+ GdkGC *localgc = bgc;
+ /* The cursor clip rectangle is completely wrong for
+ the pango layout code. */
+
+ if (localgc == 0)
+ localgc = XLIKE_get_gc (f, font, cachel->background,
+ cachel->foreground, bg_pmap,
+ cachel->background_placement, Qnil);
+ gdk_draw_text_image (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
+ xpos, dl->ypos-height, (char *) runs[i].ptr,
+ runs[i].len);
+ }
#endif /* (not) THIS_IS_X */
}
@@ -1518,12 +1525,21 @@
length by the dimension of the text. This will do the
right thing for single-dimension runs as well of course.
*/
- gdk_draw_text_image (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), cgc, xpos,
- dl->ypos, (char *) runs[i].ptr,
- runs[i].len * runs[i].dimension);
+ {
+ GdkGC *localgc = bgc;
+
+ if (localgc == 0)
+ localgc = XLIKE_get_gc (f, font, cursor_cachel->background,
+ cursor_cachel->background,
+ Qnil, Qnil, Qnil);
+ XLIKE_SET_CLIP_RECTANGLE (dpy, localgc, cursor_start, ypos,
+ &clip_box);
+ gdk_draw_text_image (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), cgc, bgc,xpos,
+ dl->ypos, (char *) runs[i].ptr,
+ runs[i].len * runs[i].dimension);
+ }
#endif /* (not) THIS_IS_X */
-
XLIKE_CLEAR_CLIP_MASK (dpy, cgc);
}
}
https://bitbucket.org/xemacs/xemacs/commits/c23848d364d9/
Changeset: c23848d364d9
User: jsparkes
Date: 2010-05-08 23:15:20+00:00
Summary: Maybe someday I'll learn to save the ChangeLog before I commit.
Affected #: 1 file
diff -r d9a949cd3cb5e0540e2c371cdf4183a2bad45a96 -r c23848d364d944d01e6686645a8ec057ab69da6d src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -2,11 +2,11 @@
* redisplay-gtk.c (gdk_draw_text_image):
Use pango_layout_get_pixel_size to get the true size of the text
- rectangle. Fill that rectangle with the given background gc.
+ rectangle. Fill that rectangle with the given background GC.
* redisplay-xlike-inc.c (XLIKE_output_string):
Don't erase the background here because the true text width can't
- be calculated without pango. Create a background gc if it doesn't
+ be calculated without pango. Create a background GC if it doesn't
exist.
2010-05-07 Jeff Sparkes <jsparkes(a)gmail.com>
https://bitbucket.org/xemacs/xemacs/commits/a888b560c83f/
Changeset: a888b560c83f
User: jsparkes
Date: 2010-05-10 06:36:17+00:00
Summary: Update the scrollbar value change code to 2.x style.
Affected #: 2 files
diff -r c23848d364d944d01e6686645a8ec057ab69da6d -r a888b560c83f4aa81f2e5aae2c73b14c96fb1979 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,9 @@
+2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * scrollbar-gtk.c (gtk_update_scrollbar_instance_status):
+ Replace deprecated code. Notify the scrollbar when the slider
+ value changes
+
2010-05-08 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (gdk_draw_text_image):
diff -r c23848d364d944d01e6686645a8ec057ab69da6d -r a888b560c83f4aa81f2e5aae2c73b14c96fb1979 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -228,7 +228,7 @@
if ((wid->allocation.width != pos_data->scrollbar_width) ||
(wid->allocation.height != pos_data->scrollbar_height))
{
- gtk_widget_set_usize (wid,
+ gtk_widget_set_size_request (wid,
pos_data->scrollbar_width,
pos_data->scrollbar_height);
@@ -287,9 +287,12 @@
scrolls around in the XEmacs frame manually. So we
update the slider manually here.
*/
- //if (!modified_p)
- gtk_range_set_adjustment (GTK_RANGE (wid), adj);
-
+ if (!modified_p)
+ {
+ gtk_range_set_adjustment (GTK_RANGE (wid), adj);
+ gtk_adjustment_value_changed (adj);
+ }
+
instance->scrollbar_instance_changed = 0;
}
@@ -437,7 +440,6 @@
frame = WINDOW_FRAME (XWINDOW (win));
GtkRange *r = GTK_RANGE (SCROLLBAR_GTK_WIDGET (instance));
inhibit_slider_size_change = 0;
- /* Todo: add horizontal events from gtk-2.X */
switch (scroll)
{
case GTK_SCROLL_PAGE_BACKWARD:
@@ -466,7 +468,7 @@
break;
case GTK_SCROLL_NONE:
case GTK_SCROLL_JUMP:
- inhibit_slider_size_change = 1;
+ /* inhibit_slider_size_change = 1; */
event_type = vertical ? Qscrollbar_vertical_drag : Qscrollbar_horizontal_drag;
event_data = Fcons (win, make_int ((int)adj->value));
break;
@@ -476,6 +478,7 @@
signal_special_gtk_user_event (frame, event_type, event_data);
if (scroll != GTK_SCROLL_NONE)
gtk_adjustment_value_changed (adj);
+ gtk_adjustment_changed (adj);
return (TRUE);
}
https://bitbucket.org/xemacs/xemacs/commits/08d7bf1823b6/
Changeset: 08d7bf1823b6
User: jsparkes
Date: 2010-05-10 06:40:36+00:00
Summary: This time I saved the ChangeLog, forgot the change!
Affected #: 1 file
diff -r a888b560c83f4aa81f2e5aae2c73b14c96fb1979 -r 08d7bf1823b6dda4337582509fb510d5aec1f144 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -221,6 +221,7 @@
GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (wid));
scrollbar_values *pos_data = & SCROLLBAR_GTK_POS_DATA (instance);
int modified_p = 0;
+ gboolean valued_changed = 0;
/* We do not want to update the size all the time if we can
help it. This cuts down on annoying flicker.
@@ -280,7 +281,11 @@
adj->page_increment = pos_data->slider_size + 1;
adj->step_increment = w->max_line_len - 1;
adj->page_size = pos_data->slider_size + 1;
- adj->value = pos_data->slider_position;
+ if (adj->value != pos_data->slider_position)
+ {
+ adj->value = pos_data->slider_position;
+ valued_changed = 1;
+ }
/* But, if we didn't resize or move the scrollbar, the
widget will not get redrawn correctly when the user
https://bitbucket.org/xemacs/xemacs/commits/5cd31c3fa648/
Changeset: 5cd31c3fa648
User: jsparkes
Date: 2010-05-11 02:02:20+00:00
Summary: Explictly default to a monospaced font.
Affected #: 2 files
diff -r 08d7bf1823b6dda4337582509fb510d5aec1f144 -r 5cd31c3fa648c7a89bfa56e21c3edd819a087844 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,9 @@
2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
+ * faces.c (complex_vars_of_faces):
+ Set the fallback font to a monospaced lucidatypewriter. Without
+ the -m-, gdk loads a proportiional font.
+
* scrollbar-gtk.c (gtk_update_scrollbar_instance_status):
Replace deprecated code. Notify the scrollbar when the slider
value changes
diff -r 08d7bf1823b6dda4337582509fb510d5aec1f144 -r 5cd31c3fa648c7a89bfa56e21c3edd819a087844 src/faces.c
--- a/src/faces.c
+++ b/src/faces.c
@@ -2437,7 +2437,7 @@
Fcons
(Fcons
(list1 (device_symbol),
- build_ascstring ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-*-*")),
+ build_ascstring ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-m-*-*-*")),
inst_list);
#endif /* !HAVE_XFT */
https://bitbucket.org/xemacs/xemacs/commits/48a6ecbd54dc/
Changeset: 48a6ecbd54dc
User: jsparkes
Date: 2010-05-11 02:40:16+00:00
Summary: Move a change from ChangeLog to ChangeLog.GTK
Affected #: 2 files
diff -r 5cd31c3fa648c7a89bfa56e21c3edd819a087844 -r 48a6ecbd54dc73935f12feb4f1645b367765cfe8 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,8 +1,3 @@
-2010-05-07 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * scrollbar-gtk.c (scrollbar_cb):
- Callback now gets GtkRange* and GtkScrollType arguments.
-
2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
* doc.c (Fdocumentation):
diff -r 5cd31c3fa648c7a89bfa56e21c3edd819a087844 -r 48a6ecbd54dc73935f12feb4f1645b367765cfe8 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -26,6 +26,9 @@
from the scrollbar. Assert check the signal connect calls.
(scrollbar_cb): Handle all GtkScrollType enum values.
+ * scrollbar-gtk.c (scrollbar_cb):
+ Callback now gets GtkRange* and GtkScrollType arguments.
+
* ui-gtk.c (build_gtk_object):
Use g_object_get_qdata now that key is a GQuark.
https://bitbucket.org/xemacs/xemacs/commits/a6c21c90558c/
Changeset: a6c21c90558c
User: jsparkes
Date: 2010-05-11 02:50:40+00:00
Summary: Wrap pango code inside USE_PANGO.
Affected #: 7 files
diff -r 48a6ecbd54dc73935f12feb4f1645b367765cfe8 -r a6c21c90558c991ba66a0b6bdb2c632e55446f6c src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,26 @@
2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
+ * console-gtk-impl.h (struct gtk_device):
+ Add pango context inside ifdef USE_PANGO. (We don't want to
+ use HAVE_PANGO because the pango code isn't ready.)
+
+ * console-xlike-inc.h (XLIKE_TEXT_WIDTH_WIDE):
+ Use USE_PANGO instead of HAVE_PANGO.
+
+ * device-gtk.c:
+ Add pango font name lookup functions.
+ (gtk_init_device):
+ Initialize PangoContext for device.
+
+ * fontcolor-gtk.c (gtk_initialize_font_instance):
+ Add ifdef'd code for initializing pango fonts.
+
+ * fontcolor-gtk-impl.h (struct gtk_font_instance_data):
+ Add pango information to font instance data.
+
+ * sysgtk.h:
+ Include pango headers.
+
* faces.c (complex_vars_of_faces):
Set the fallback font to a monospaced lucidatypewriter. Without
the -m-, gdk loads a proportiional font.
diff -r 48a6ecbd54dc73935f12feb4f1645b367765cfe8 -r a6c21c90558c991ba66a0b6bdb2c632e55446f6c src/console-gtk-impl.h
--- a/src/console-gtk-impl.h
+++ b/src/console-gtk-impl.h
@@ -66,7 +66,9 @@
int depth;
GdkColormap *device_cmap;
+#ifdef USE_PANGO
PangoContext *context;
+#endif
/* Used by x_bevel_modeline in redisplay-x.c */
GdkBitmap *gray_pixmap;
diff -r 48a6ecbd54dc73935f12feb4f1645b367765cfe8 -r a6c21c90558c991ba66a0b6bdb2c632e55446f6c src/console-xlike-inc.h
--- a/src/console-xlike-inc.h
+++ b/src/console-xlike-inc.h
@@ -287,7 +287,7 @@
(USED (dpy), gdk_draw_line (GDK_DRAWABLE (x_win), gc, x1, y1, x2, y2))
#define XLIKE_TEXT_WIDTH(fi, ptr, len) \
gdk_text_width (fi, (char *) ptr, len)
-#ifdef HAVE_PANGO
+#ifdef USE_PANGO
#define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) \
pango_text_width_wc (fi, (GdkWChar *) ptr, len)
#else
diff -r 48a6ecbd54dc73935f12feb4f1645b367765cfe8 -r a6c21c90558c991ba66a0b6bdb2c632e55446f6c src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -107,8 +107,8 @@
extern Lisp_Object
xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w);
-#ifdef HAVE_PANGO
-extern Lisp_Object __get_gtk_font_truename (PangoFont *gdk_font,
+#ifdef USE_PANGO
+extern Lisp_Object __get_gtk_font_truename (PangoFont *font,
int expandp);
#else
extern Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font,
@@ -298,7 +298,7 @@
/* Should this be easier to figure out? --jsparkes */
{
-#ifdef HAVE_PANGO
+#ifdef USE_PANGO
GdkDisplay *disp = gdk_display_get_default ();
GdkScreen *screen = gdk_display_get_default_screen (disp);
PangoFontMap *fmap = pango_xft_get_font_map(disp, screen);
diff -r 48a6ecbd54dc73935f12feb4f1645b367765cfe8 -r a6c21c90558c991ba66a0b6bdb2c632e55446f6c src/fontcolor-gtk-impl.h
--- a/src/fontcolor-gtk-impl.h
+++ b/src/fontcolor-gtk-impl.h
@@ -52,7 +52,7 @@
struct gtk_font_instance_data
{
-#ifdef HAVE_PANGO
+#ifdef USE_PANGO
/* Pango -specific information */
PangoFont *font;
PangoFontDescription *desc;
@@ -65,11 +65,11 @@
#define GTK_FONT_INSTANCE_DATA(f) ((struct gtk_font_instance_data *) (f)->data)
#define FONT_INSTANCE_GTK_FONT(f) (GTK_FONT_INSTANCE_DATA (f)->font)
#define XFONT_INSTANCE_GTK_FONT(c) FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (c))
-#ifdef HAVE_PANGO
+#ifdef USE_PANGO
#define FONT_INSTANCE_GTK_FONT_DESC(f) (GTK_FONT_INSTANCE_DATA (f)->desc)
#define FONT_INSTANCE_GTK_FONT_METRICS(f) (GTK_FONT_INSTANCE_DATA (f)->metrics)
#define XFONT_INSTANCE_GTK_FONT_DESC(c) FONT_INSTANCE_GTK_FONT_DESC (XFONT_INSTANCE (c))
#define XFONT_INSTANCE_GTK_FONT_METRICS(c) FONT_INSTANCE_GTK_FONT_METRICS (XFONT_INSTANCE (c))
-#endif /* HAVE_PANGO */
+#endif /* USE_PANGO */
#endif /* HAVE_GTK */
#endif /* _XEMACS_OBJECTS_GTK_IMPL_H_ */
diff -r 48a6ecbd54dc73935f12feb4f1645b367765cfe8 -r a6c21c90558c991ba66a0b6bdb2c632e55446f6c src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -235,17 +235,23 @@
{
GdkFont *gf;
const char *extname;
+#ifdef USE_PANGO
PangoFontDescription *pango_desc;
-
+#endif
extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
/* Load font or fontset? */
- /* gf = gdk_font_load_for_display (extname); --jsparkes */
+#ifdef USE_PANGO
pango_desc = pango_font_description_new ();
pango_font_description_set_family (pango_desc, extname);
+ pango_font_description_set_size (pango_desc, 12);
char *nm = pango_font_description_to_string (pango_desc);
-
+#else
+ /* Loading a fontset gives a lot of warning about missing charsets,
+ including iso-8859-1. We probably require a font map as well. */
+ /* gf = gdk_fontset_load (extname); */
gf = gdk_font_load (extname);
+#endif
if (!gf)
{
@@ -262,10 +268,6 @@
f->ascent = gf->ascent;
f->descent = gf->descent;
f->height = gf->ascent + gf->descent;
-
- /* Now lets figure out the width of the font.
- We could use a longer string and get the averaage length */
- /* f->width = gdk_text_width (gf, "abcdefghijklmnopqrstuvwxyz", 26)/26; */
f->width = gdk_text_width (gf, "n", 1); /* em or en? */
f->proportional_p = (gdk_text_width (gf, "|", 1) !=
gdk_text_width (gf, "W", 1));
diff -r 48a6ecbd54dc73935f12feb4f1645b367765cfe8 -r a6c21c90558c991ba66a0b6bdb2c632e55446f6c src/sysgtk.h
--- a/src/sysgtk.h
+++ b/src/sysgtk.h
@@ -36,7 +36,9 @@
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
+#ifdef USE_PANGO
#include <pango/pango.h>
#include <pango/pangoxft.h>
+#endif
#endif /* INCLUDED_sysgtk_h_ */
https://bitbucket.org/xemacs/xemacs/commits/67d508bc0aa7/
Changeset: 67d508bc0aa7
User: jsparkes
Date: 2010-05-11 02:52:49+00:00
Summary: Use GType instead of GtkType.
Affected #: 2 files
diff -r a6c21c90558c991ba66a0b6bdb2c632e55446f6c -r 67d508bc0aa76410e4b96532eb272257d086938c src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -44,7 +44,7 @@
#include "gtk-glue.c"
/* Is the fundamental type of 't' the xemacs defined fundamental type 'type'? */
-#define IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t,type) (((GtkType) GTK_FUNDAMENTAL_TYPE(t)) == (type))
+#define IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t,type) (((GType) GTK_FUNDAMENTAL_TYPE(t)) == (type))
Lisp_Object Qemacs_ffip;
Lisp_Object Qemacs_gtk_objectp;
diff -r a6c21c90558c991ba66a0b6bdb2c632e55446f6c -r 67d508bc0aa76410e4b96532eb272257d086938c src/ui-gtk.h
--- a/src/ui-gtk.h
+++ b/src/ui-gtk.h
@@ -83,7 +83,7 @@
#define GTK_BOXEDP(x) RECORDP (x, emacs_gtk_boxed)
#define CHECK_GTK_BOXED(x) CHECK_RECORD (x, emacs_gtk_boxed)
-extern Lisp_Object build_gtk_boxed (void *obj, GtkType t);
+extern Lisp_Object build_gtk_boxed (void *obj, GType t);
#ifdef JSPARKES
/*
https://bitbucket.org/xemacs/xemacs/commits/f5263aa8e354/
Changeset: f5263aa8e354
User: jsparkes
Date: 2010-05-11 02:53:27+00:00
Summary: Use GType instead of GtkType.
Affected #: 1 file
diff -r 67d508bc0aa76410e4b96532eb272257d086938c -r f5263aa8e354da6a08e7fdd7c9dab40a19425a9a src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,10 @@
2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
+ * ui-gtk.c (IS_XEMACS_GTK_FUNDAMENTAL_TYPE):
+ Use GType, not GtkType.
+
+ * ui-gtk.h: build_gtk_boxed now takes a GType arg, not GtkType
+
* console-gtk-impl.h (struct gtk_device):
Add pango context inside ifdef USE_PANGO. (We don't want to
use HAVE_PANGO because the pango code isn't ready.)
https://bitbucket.org/xemacs/xemacs/commits/1bcff8aee327/
Changeset: 1bcff8aee327
User: jsparkes
Date: 2010-05-11 03:00:54+00:00
Summary: Add a wide char version of gdk_draw_text_image.
Affected #: 3 files
diff -r f5263aa8e354da6a08e7fdd7c9dab40a19425a9a -r 1bcff8aee32717aacec327c4ae87aead70f79cc6 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,13 @@
2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Put back plain Gdk text rendering, pango not complete.
+ (gdk_draw_text_image_wc):
+ Wide char version of text display.
+
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Call wide char version of text image draw where required.
+
* ui-gtk.c (IS_XEMACS_GTK_FUNDAMENTAL_TYPE):
Use GType, not GtkType.
diff -r f5263aa8e354da6a08e7fdd7c9dab40a19425a9a -r 1bcff8aee32717aacec327c4ae87aead70f79cc6 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -87,23 +87,19 @@
* is calculated by pango. The layout is currently not shared. There
* can only be one PangoLayout per line, I think. --jsparkes
*/
+
static void
-gdk_draw_text_image (GdkDrawable *drawable,
- GdkFont *font,
- GdkGC *gc,
- GdkGC *bgc,
- gint x,
- gint y,
- const gchar *text,
- gint text_length)
+gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y, gchar *text,
+ gint text_length)
{
int width = -1;
int height = -1;
+#ifdef USE_PANGO
PangoLayout *layout;
- GdkGCValues values;
+#endif
- gdk_gc_get_values (gc, &values);
-
+#ifdef USE_PANGO
layout = pango_layout_new (gdk_pango_context_get ());
pango_layout_set_text (layout, text, text_length);
pango_layout_get_pixel_size (layout, &width, &height);
@@ -112,6 +108,42 @@
gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
gdk_draw_layout (drawable, gc, x, y, layout);
g_object_unref (layout);
+#else
+ width = gdk_text_width (font, text, text_length);
+ height = font->ascent + font->descent;
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_text (drawable, font, gc, x, y, text, text_length);
+#endif
+}
+
+static void
+gdk_draw_text_image_wc (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y, GdkWChar *text,
+ gint text_length)
+{
+ int width = -1;
+ int height = -1;
+#ifdef USE_PANGO
+ PangoLayout *layout;
+#endif
+
+#ifdef USE_PANGO
+ layout = pango_layout_new (gdk_pango_context_get ());
+ pango_layout_set_text (layout, text, text_length);
+ pango_layout_get_pixel_size (layout, &width, &height);
+
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_layout (drawable, gc, x, y, layout);
+ g_object_unref (layout);
+#else
+ width = gdk_text_width_wc (font, text, text_length);
+ height = font->ascent + font->descent;
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_text_wc (drawable, font, gc, x, y, text, text_length);
+#endif
}
static void
diff -r f5263aa8e354da6a08e7fdd7c9dab40a19425a9a -r 1bcff8aee32717aacec327c4ae87aead70f79cc6 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -977,15 +977,14 @@
The cursor is drawn sometimes whether or not CURSOR is set. ???
****************************************************************************/
#ifdef THIS_IS_GTK
-static
-void gdk_draw_text_image (GdkDrawable *drawable,
- GdkFont *font,
- GdkGC *gc,
- GdkGC *bgc,
- gint x,
- gint y,
- const gchar *text,
- gint text_length);
+static void
+gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y, gchar *text,
+ gint text_length);
+static void
+gdk_draw_text_image_wc (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y, GdkWChar *text,
+ gint text_length);
#endif /* THIS_IS_GTK */
void
@@ -1104,13 +1103,11 @@
{
bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
bg_pmap, cachel->background_placement, Qnil);
-#ifndef THIS_IS_GTK
- /* Gtk text width is unknown */
XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start,
ypos, clip_end - clip_start,
height);
-#endif
}
+
nruns = separate_textual_runs (text_storage, runs, Dynarr_begin (buf),
Dynarr_length (buf), cachel);
@@ -1331,10 +1328,17 @@
localgc = XLIKE_get_gc (f, font, cachel->background,
cachel->foreground, bg_pmap,
cachel->background_placement, Qnil);
- gdk_draw_text_image (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
- xpos, dl->ypos-height, (char *) runs[i].ptr,
- runs[i].len);
+
+ if (runs[i].dimension == 1)
+ gdk_draw_text_image (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
+ xpos, dl->ypos, (char *) runs[i].ptr,
+ runs[i].len);
+ else
+ gdk_draw_text_image_wc (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
+ xpos, dl->ypos, (GdkWChar *) runs[i].ptr,
+ runs[i].len);
}
#endif /* (not) THIS_IS_X */
}
@@ -1506,8 +1510,8 @@
clip_box.width = cursor_width;
clip_box.height = height;
- XLIKE_SET_CLIP_RECTANGLE (dpy, cgc, cursor_start, ypos,
- &clip_box);
+ // XLIKE_SET_CLIP_RECTANGLE (dpy, cgc, cursor_start, ypos,
+ // &clip_box);
#ifdef THIS_IS_X
if (runs[i].dimension == 1)
XDrawImageString (dpy, x_win, cgc, xpos, dl->ypos,
@@ -1532,12 +1536,21 @@
localgc = XLIKE_get_gc (f, font, cursor_cachel->background,
cursor_cachel->background,
Qnil, Qnil, Qnil);
- XLIKE_SET_CLIP_RECTANGLE (dpy, localgc, cursor_start, ypos,
+ XLIKE_SET_CLIP_RECTANGLE (dpy, localgc, cursor_start, dl->ypos,
&clip_box);
- gdk_draw_text_image (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), cgc, bgc,xpos,
- dl->ypos, (char *) runs[i].ptr,
- runs[i].len * runs[i].dimension);
+ if (runs[i].dimension == 1)
+ gdk_draw_text_image (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), cgc,
+ localgc, xpos, dl->ypos,
+ (char *) runs[i].ptr,
+ runs[i].len);
+ else
+ gdk_draw_text_image_wc (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), cgc,
+ localgc, xpos, dl->ypos,
+ (GdkWChar *) runs[i].ptr,
+ runs[i].len);
+
}
#endif /* (not) THIS_IS_X */
XLIKE_CLEAR_CLIP_MASK (dpy, cgc);
@@ -1611,8 +1624,14 @@
if (!focus && NILP (bar_cursor_value))
{
+#ifdef THIS_IS_GTK
+ XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, tmp_y -
+ tmp_height - 1,
+ cursor_width - 1, tmp_height - 1);
+#else
XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, tmp_y,
cursor_width - 1, tmp_height - 1);
+#endif
}
else if (focus && !NILP (bar_cursor_value))
{
@@ -1785,8 +1804,10 @@
cursor_width = db->xpos + dga->width - cursor_start;
if (focus)
+ {
XLIKE_FILL_RECTANGLE (dpy, x_win, gc, cursor_start, db->ypos,
cursor_width, cursor_height);
+ }
else
{
XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, db->ypos,
@@ -1849,14 +1870,11 @@
x, y1, width, y2 - y1);
#endif /* THIS_IS_GTK */
-#ifndef THIS_IS_GTK
/* #### FIXME Why not? Formerly '#if 0' in the GDK code */
/* Draw the divider line. */
XLIKE_FILL_RECTANGLE (dpy, x_win, background_gc,
x + spacing + shadow_thickness, y1,
line_width, y2 - y1);
-#endif /* not THIS_IS_GTK */
-
if (shadow_thickness < 0)
{
shadow_thickness = -shadow_thickness;
@@ -1924,7 +1942,8 @@
if (NILP (bg_pmap))
gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
- Qnil, Qnil, Qnil, Qnil);
+ WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
+ Qnil, Qnil, Qnil);
else
gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
@@ -1978,10 +1997,8 @@
}
}
else if (NILP (bar_cursor_value))
- {
- XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
- fi->width - 1, cursor_height - 1);
- }
+ XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
+ fi->width - 1, cursor_height - 1);
}
}
https://bitbucket.org/xemacs/xemacs/commits/569de3223a9a/
Changeset: 569de3223a9a
User: jsparkes
Date: 2010-05-11 03:17:31+00:00
Summary: Pass a struct textual_run directly to gdk_draw_text_image so it can
handle the wide char case itself.
Affected #: 3 files
diff -r 1bcff8aee32717aacec327c4ae87aead70f79cc6 -r 569de3223a9a8df24901377acb0c135d854a8d4e src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,6 +1,13 @@
2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (gdk_draw_text_image):
+ Take a struct textual run* argument and handle the wide char
+ case ourselves.
+
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Call gdk_draw_text_image directly with a struct textual_run *.
+
+ * redisplay-gtk.c (gdk_draw_text_image):
Put back plain Gdk text rendering, pango not complete.
(gdk_draw_text_image_wc):
Wide char version of text display.
diff -r 1bcff8aee32717aacec327c4ae87aead70f79cc6 -r 569de3223a9a8df24901377acb0c135d854a8d4e src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -90,8 +90,7 @@
static void
gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, gchar *text,
- gint text_length)
+ GdkGC *bgc, gint x, gint y, struct textual_run *run)
{
int width = -1;
int height = -1;
@@ -109,40 +108,21 @@
gdk_draw_layout (drawable, gc, x, y, layout);
g_object_unref (layout);
#else
- width = gdk_text_width (font, text, text_length);
height = font->ascent + font->descent;
- if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
- gdk_draw_text (drawable, font, gc, x, y, text, text_length);
-#endif
-}
-
-static void
-gdk_draw_text_image_wc (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, GdkWChar *text,
- gint text_length)
-{
- int width = -1;
- int height = -1;
-#ifdef USE_PANGO
- PangoLayout *layout;
-#endif
-
-#ifdef USE_PANGO
- layout = pango_layout_new (gdk_pango_context_get ());
- pango_layout_set_text (layout, text, text_length);
- pango_layout_get_pixel_size (layout, &width, &height);
-
- if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
- gdk_draw_layout (drawable, gc, x, y, layout);
- g_object_unref (layout);
-#else
- width = gdk_text_width_wc (font, text, text_length);
- height = font->ascent + font->descent;
- if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
- gdk_draw_text_wc (drawable, font, gc, x, y, text, text_length);
+ if (run->dimension == 1)
+ {
+ width = gdk_text_width (font, (gchar *)run->ptr, run->len);
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_text (drawable, font, gc, x, y, (gchar *)run->ptr, run->len);
+ }
+ else
+ {
+ width = gdk_text_width_wc (font, (GdkWChar *)run->ptr, run->len);
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_text_wc (drawable, font, gc, x, y, (GdkWChar *)run->ptr, run->len);
+ }
#endif
}
diff -r 1bcff8aee32717aacec327c4ae87aead70f79cc6 -r 569de3223a9a8df24901377acb0c135d854a8d4e src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -979,14 +979,9 @@
#ifdef THIS_IS_GTK
static void
gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, gchar *text,
- gint text_length);
-static void
-gdk_draw_text_image_wc (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, GdkWChar *text,
- gint text_length);
+ GdkGC *bgc, gint x, gint y, struct textual_run *run);
+#endif /* THIS_IS_GTK */
-#endif /* THIS_IS_GTK */
void
XLIKE_output_string (struct window *w, struct display_line *dl,
Ichar_dynarr *buf, int xpos, int xoffset, int clip_start,
@@ -1329,16 +1324,9 @@
cachel->foreground, bg_pmap,
cachel->background_placement, Qnil);
- if (runs[i].dimension == 1)
- gdk_draw_text_image (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
- xpos, dl->ypos, (char *) runs[i].ptr,
- runs[i].len);
- else
- gdk_draw_text_image_wc (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
- xpos, dl->ypos, (GdkWChar *) runs[i].ptr,
- runs[i].len);
+ gdk_draw_text_image (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
+ xpos, dl->ypos, &runs[i]);
}
#endif /* (not) THIS_IS_X */
}
@@ -1538,19 +1526,9 @@
Qnil, Qnil, Qnil);
XLIKE_SET_CLIP_RECTANGLE (dpy, localgc, cursor_start, dl->ypos,
&clip_box);
- if (runs[i].dimension == 1)
- gdk_draw_text_image (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), cgc,
- localgc, xpos, dl->ypos,
- (char *) runs[i].ptr,
- runs[i].len);
- else
- gdk_draw_text_image_wc (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), cgc,
- localgc, xpos, dl->ypos,
- (GdkWChar *) runs[i].ptr,
- runs[i].len);
-
+ gdk_draw_text_image (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), cgc,
+ localgc, xpos, dl->ypos, &runs[i]);
}
#endif /* (not) THIS_IS_X */
XLIKE_CLEAR_CLIP_MASK (dpy, cgc);
https://bitbucket.org/xemacs/xemacs/commits/656f65fb27c5/
Changeset: 656f65fb27c5
User: jsparkes
Date: 2010-05-07 19:18:57+00:00
Summary: Fixed rectangle clearing areas to be properly aligned.
Affected #: 4 files
diff -r 661e8d3bd9c5d82e098a63676386ad80649eb0ff -r 656f65fb27c5645eabddbefe7e9e3cc613cfe817 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,8 +1,3 @@
-2010-05-07 Jeff Sparkes <jsparkes(a)gmail.com>
-
- * scrollbar-gtk.c (scrollbar_cb):
- Callback now gets GtkRange* and GtkScrollType arguments.
-
2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
* doc.c (Fdocumentation):
diff -r 661e8d3bd9c5d82e098a63676386ad80649eb0ff -r 656f65fb27c5645eabddbefe7e9e3cc613cfe817 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,16 @@
2010-05-07 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Remove obsolete workarounds for clearing rectangle mismatches.
+
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Calculate size with pango_layout_get_pixel_size. This also needs
+ to be changed in XLIKE_TEXT_WIDTH somehow. Works best with a
+ monospaced font.
+
+ * scrollbar-gtk.c (scrollbar_cb):
+ Callback now gets GtkRange* and GtkScrollType arguments.
+
* scrollbar-gtk.c (gtk_create_scrollbar_instance):
Connect to signal from scrollbar to get 1.X like behaviour
from the scrollbar. Assert check the signal connect calls.
diff -r 661e8d3bd9c5d82e098a63676386ad80649eb0ff -r 656f65fb27c5645eabddbefe7e9e3cc613cfe817 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -91,19 +91,15 @@
const gchar *text,
gint text_length)
{
- int width = gdk_text_width (font, text, text_length);
- int height = gdk_text_height (font, text, text_length);
+ int width;
+ int height;
PangoLayout *layout;
- GdkGCValues values;
-
- gdk_gc_get_values (gc, &values);
layout = pango_layout_new (gdk_pango_context_get ());
+ //layout = gtk_widget_create_pango_layout (drawable, text);
pango_layout_set_text (layout, text, text_length);
-
- /* Rectangle needs to be drawn with foreground = gc.background. */
- /* gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height); */
- gdk_draw_layout (drawable, gc, x, y, layout);
+ pango_layout_get_pixel_size (layout, &width, &height);
+ gdk_draw_layout (drawable, gc, x, y-height, layout);
g_object_unref (layout);
}
diff -r 661e8d3bd9c5d82e098a63676386ad80649eb0ff -r 656f65fb27c5645eabddbefe7e9e3cc613cfe817 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -985,7 +985,6 @@
gint y,
const gchar *text,
gint text_length);
-
#endif /* THIS_IS_GTK */
void
XLIKE_output_string (struct window *w, struct display_line *dl,
@@ -1103,15 +1102,11 @@
{
bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
bg_pmap, cachel->background_placement, Qnil);
-#ifdef THIS_IS_X
XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start,
ypos, clip_end - clip_start,
height);
-#else
- gdk_draw_rectangle (GDK_DRAWABLE (x_win), bgc, TRUE, clip_start, ypos,
- clip_end - clip_start, height);
-#endif
}
+
nruns = separate_textual_runs (text_storage, runs, Dynarr_begin (buf),
Dynarr_length (buf), cachel);
@@ -1323,12 +1318,11 @@
dimension of the text. This will do the right thing for
single-dimension runs as well of course.
*/
- // gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, clip_start,
- // ypos, clip_end - clip_start, height);
-
- gdk_draw_text_image
- (GDK_DRAWABLE (x_win), FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
- dl->ypos-height, (char *) runs[i].ptr, runs[i].len);
+ {
+ gdk_draw_text_image (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
+ dl->ypos, (char *)runs[i].ptr, runs[i].len);
+ }
#endif /* (not) THIS_IS_X */
}
@@ -1518,10 +1512,9 @@
length by the dimension of the text. This will do the
right thing for single-dimension runs as well of course.
*/
- gdk_draw_text_image (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), cgc, xpos,
- dl->ypos, (char *) runs[i].ptr,
- runs[i].len * runs[i].dimension);
+ gdk_draw_text_image (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
+ dl->ypos, (char *)runs[i].ptr, runs[i].len);
#endif /* (not) THIS_IS_X */
XLIKE_CLEAR_CLIP_MASK (dpy, cgc);
https://bitbucket.org/xemacs/xemacs/commits/38446c077d70/
Changeset: 38446c077d70
User: jsparkes
Date: 2010-05-10 11:26:11+00:00
Summary: Merge scrollbar and font work.
Affected #: 4 files
diff -r 656f65fb27c5645eabddbefe7e9e3cc613cfe817 -r 38446c077d7082aafc25eb4c6994d0e0507d2151 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,20 @@
+2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * scrollbar-gtk.c (gtk_update_scrollbar_instance_status):
+ Replace deprecated code. Notify the scrollbar when the slider
+ value changes
+
+2010-05-08 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Use pango_layout_get_pixel_size to get the true size of the text
+ rectangle. Fill that rectangle with the given background GC.
+
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Don't erase the background here because the true text width can't
+ be calculated without pango. Create a background GC if it doesn't
+ exist.
+
2010-05-07 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-xlike-inc.c (XLIKE_output_string):
diff -r 656f65fb27c5645eabddbefe7e9e3cc613cfe817 -r 38446c077d7082aafc25eb4c6994d0e0507d2151 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -221,6 +221,7 @@
GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (wid));
scrollbar_values *pos_data = & SCROLLBAR_GTK_POS_DATA (instance);
int modified_p = 0;
+ gboolean valued_changed = 0;
/* We do not want to update the size all the time if we can
help it. This cuts down on annoying flicker.
@@ -228,7 +229,7 @@
if ((wid->allocation.width != pos_data->scrollbar_width) ||
(wid->allocation.height != pos_data->scrollbar_height))
{
- gtk_widget_set_usize (wid,
+ gtk_widget_set_size_request (wid,
pos_data->scrollbar_width,
pos_data->scrollbar_height);
@@ -280,16 +281,23 @@
adj->page_increment = pos_data->slider_size + 1;
adj->step_increment = w->max_line_len - 1;
adj->page_size = pos_data->slider_size + 1;
- adj->value = pos_data->slider_position;
+ if (adj->value != pos_data->slider_position)
+ {
+ adj->value = pos_data->slider_position;
+ valued_changed = 1;
+ }
/* But, if we didn't resize or move the scrollbar, the
widget will not get redrawn correctly when the user
scrolls around in the XEmacs frame manually. So we
update the slider manually here.
*/
- //if (!modified_p)
- gtk_range_set_adjustment (GTK_RANGE (wid), adj);
-
+ if (!modified_p)
+ {
+ gtk_range_set_adjustment (GTK_RANGE (wid), adj);
+ gtk_adjustment_value_changed (adj);
+ }
+
instance->scrollbar_instance_changed = 0;
}
@@ -437,7 +445,6 @@
frame = WINDOW_FRAME (XWINDOW (win));
GtkRange *r = GTK_RANGE (SCROLLBAR_GTK_WIDGET (instance));
inhibit_slider_size_change = 0;
- /* Todo: add horizontal events from gtk-2.X */
switch (scroll)
{
case GTK_SCROLL_PAGE_BACKWARD:
@@ -466,7 +473,7 @@
break;
case GTK_SCROLL_NONE:
case GTK_SCROLL_JUMP:
- inhibit_slider_size_change = 1;
+ /* inhibit_slider_size_change = 1; */
event_type = vertical ? Qscrollbar_vertical_drag : Qscrollbar_horizontal_drag;
event_data = Fcons (win, make_int ((int)adj->value));
break;
@@ -476,6 +483,7 @@
signal_special_gtk_user_event (frame, event_type, event_data);
if (scroll != GTK_SCROLL_NONE)
gtk_adjustment_value_changed (adj);
+ gtk_adjustment_changed (adj);
return (TRUE);
}
https://bitbucket.org/xemacs/xemacs/commits/dc7f8b30eb85/
Changeset: dc7f8b30eb85
User: jsparkes
Date: 2010-05-10 11:32:11+00:00
Summary: Update the scrollbar when the displayed buffer is switched.
Affected #: 2 files
diff -r 38446c077d7082aafc25eb4c6994d0e0507d2151 -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -2,7 +2,7 @@
* scrollbar-gtk.c (gtk_update_scrollbar_instance_status):
Replace deprecated code. Notify the scrollbar when the slider
- value changes
+ value changes. Update the scrollbar when the buffer changes.
2010-05-08 Jeff Sparkes <jsparkes(a)gmail.com>
diff -r 38446c077d7082aafc25eb4c6994d0e0507d2151 -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -292,7 +292,11 @@
scrolls around in the XEmacs frame manually. So we
update the slider manually here.
*/
- if (!modified_p)
+ if (modified_p)
+ {
+ gtk_adjustment_changed (adj);
+ }
+ else
{
gtk_range_set_adjustment (GTK_RANGE (wid), adj);
gtk_adjustment_value_changed (adj);
https://bitbucket.org/xemacs/xemacs/commits/c46572ca00c3/
Changeset: c46572ca00c3
User: jsparkes
Date: 2010-05-11 13:54:34+00:00
Summary: Merge ifdef USE_PANGO changes.
Merge better text display code.
Affected #: 12 files
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,50 @@
2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Take a struct textual run* argument and handle the wide char
+ case ourselves.
+
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Call gdk_draw_text_image directly with a struct textual_run *.
+
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Put back plain Gdk text rendering, pango not complete.
+ (gdk_draw_text_image_wc):
+ Wide char version of text display.
+
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Call wide char version of text image draw where required.
+
+ * ui-gtk.c (IS_XEMACS_GTK_FUNDAMENTAL_TYPE):
+ Use GType, not GtkType.
+
+ * ui-gtk.h: build_gtk_boxed now takes a GType arg, not GtkType
+
+ * console-gtk-impl.h (struct gtk_device):
+ Add pango context inside ifdef USE_PANGO. (We don't want to
+ use HAVE_PANGO because the pango code isn't ready.)
+
+ * console-xlike-inc.h (XLIKE_TEXT_WIDTH_WIDE):
+ Use USE_PANGO instead of HAVE_PANGO.
+
+ * device-gtk.c:
+ Add pango font name lookup functions.
+ (gtk_init_device):
+ Initialize PangoContext for device.
+
+ * fontcolor-gtk.c (gtk_initialize_font_instance):
+ Add ifdef'd code for initializing pango fonts.
+
+ * fontcolor-gtk-impl.h (struct gtk_font_instance_data):
+ Add pango information to font instance data.
+
+ * sysgtk.h:
+ Include pango headers.
+
+ * faces.c (complex_vars_of_faces):
+ Set the fallback font to a monospaced lucidatypewriter. Without
+ the -m-, gdk loads a proportiional font.
+
* scrollbar-gtk.c (gtk_update_scrollbar_instance_status):
Replace deprecated code. Notify the scrollbar when the slider
value changes. Update the scrollbar when the buffer changes.
@@ -33,6 +78,9 @@
from the scrollbar. Assert check the signal connect calls.
(scrollbar_cb): Handle all GtkScrollType enum values.
+ * scrollbar-gtk.c (scrollbar_cb):
+ Callback now gets GtkRange* and GtkScrollType arguments.
+
* ui-gtk.c (build_gtk_object):
Use g_object_get_qdata now that key is a GQuark.
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/console-gtk-impl.h
--- a/src/console-gtk-impl.h
+++ b/src/console-gtk-impl.h
@@ -66,7 +66,9 @@
int depth;
GdkColormap *device_cmap;
+#ifdef USE_PANGO
PangoContext *context;
+#endif
/* Used by x_bevel_modeline in redisplay-x.c */
GdkBitmap *gray_pixmap;
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/console-xlike-inc.h
--- a/src/console-xlike-inc.h
+++ b/src/console-xlike-inc.h
@@ -287,7 +287,7 @@
(USED (dpy), gdk_draw_line (GDK_DRAWABLE (x_win), gc, x1, y1, x2, y2))
#define XLIKE_TEXT_WIDTH(fi, ptr, len) \
gdk_text_width (fi, (char *) ptr, len)
-#ifdef HAVE_PANGO
+#ifdef USE_PANGO
#define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) \
pango_text_width_wc (fi, (GdkWChar *) ptr, len)
#else
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -107,8 +107,8 @@
extern Lisp_Object
xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w);
-#ifdef HAVE_PANGO
-extern Lisp_Object __get_gtk_font_truename (PangoFont *gdk_font,
+#ifdef USE_PANGO
+extern Lisp_Object __get_gtk_font_truename (PangoFont *font,
int expandp);
#else
extern Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font,
@@ -298,7 +298,7 @@
/* Should this be easier to figure out? --jsparkes */
{
-#ifdef HAVE_PANGO
+#ifdef USE_PANGO
GdkDisplay *disp = gdk_display_get_default ();
GdkScreen *screen = gdk_display_get_default_screen (disp);
PangoFontMap *fmap = pango_xft_get_font_map(disp, screen);
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/faces.c
--- a/src/faces.c
+++ b/src/faces.c
@@ -2437,7 +2437,7 @@
Fcons
(Fcons
(list1 (device_symbol),
- build_ascstring ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-*-*")),
+ build_ascstring ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-m-*-*-*")),
inst_list);
#endif /* !HAVE_XFT */
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/fontcolor-gtk-impl.h
--- a/src/fontcolor-gtk-impl.h
+++ b/src/fontcolor-gtk-impl.h
@@ -52,7 +52,7 @@
struct gtk_font_instance_data
{
-#ifdef HAVE_PANGO
+#ifdef USE_PANGO
/* Pango -specific information */
PangoFont *font;
PangoFontDescription *desc;
@@ -65,11 +65,11 @@
#define GTK_FONT_INSTANCE_DATA(f) ((struct gtk_font_instance_data *) (f)->data)
#define FONT_INSTANCE_GTK_FONT(f) (GTK_FONT_INSTANCE_DATA (f)->font)
#define XFONT_INSTANCE_GTK_FONT(c) FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (c))
-#ifdef HAVE_PANGO
+#ifdef USE_PANGO
#define FONT_INSTANCE_GTK_FONT_DESC(f) (GTK_FONT_INSTANCE_DATA (f)->desc)
#define FONT_INSTANCE_GTK_FONT_METRICS(f) (GTK_FONT_INSTANCE_DATA (f)->metrics)
#define XFONT_INSTANCE_GTK_FONT_DESC(c) FONT_INSTANCE_GTK_FONT_DESC (XFONT_INSTANCE (c))
#define XFONT_INSTANCE_GTK_FONT_METRICS(c) FONT_INSTANCE_GTK_FONT_METRICS (XFONT_INSTANCE (c))
-#endif /* HAVE_PANGO */
+#endif /* USE_PANGO */
#endif /* HAVE_GTK */
#endif /* _XEMACS_OBJECTS_GTK_IMPL_H_ */
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -235,17 +235,23 @@
{
GdkFont *gf;
const char *extname;
+#ifdef USE_PANGO
PangoFontDescription *pango_desc;
-
+#endif
extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
/* Load font or fontset? */
- /* gf = gdk_font_load_for_display (extname); --jsparkes */
+#ifdef USE_PANGO
pango_desc = pango_font_description_new ();
pango_font_description_set_family (pango_desc, extname);
+ pango_font_description_set_size (pango_desc, 12);
char *nm = pango_font_description_to_string (pango_desc);
-
+#else
+ /* Loading a fontset gives a lot of warning about missing charsets,
+ including iso-8859-1. We probably require a font map as well. */
+ /* gf = gdk_fontset_load (extname); */
gf = gdk_font_load (extname);
+#endif
if (!gf)
{
@@ -262,10 +268,6 @@
f->ascent = gf->ascent;
f->descent = gf->descent;
f->height = gf->ascent + gf->descent;
-
- /* Now lets figure out the width of the font.
- We could use a longer string and get the averaage length */
- /* f->width = gdk_text_width (gf, "abcdefghijklmnopqrstuvwxyz", 26)/26; */
f->width = gdk_text_width (gf, "n", 1); /* em or en? */
f->proportional_p = (gdk_text_width (gf, "|", 1) !=
gdk_text_width (gf, "W", 1));
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -82,25 +82,49 @@
#include "sysgdkx.h"
+/*
+ * Only this function can erase the text area because the text area
+ * is calculated by pango. The layout is currently not shared. There
+ * can only be one PangoLayout per line, I think. --jsparkes
+ */
+
static void
-gdk_draw_text_image (GdkDrawable *drawable,
- GdkFont *font,
- GdkGC *gc,
- gint x,
- gint y,
- const gchar *text,
- gint text_length)
+gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y, struct textual_run *run)
{
- int width;
- int height;
+ int width = -1;
+ int height = -1;
+#ifdef USE_PANGO
PangoLayout *layout;
+#endif
+#ifdef USE_PANGO
layout = pango_layout_new (gdk_pango_context_get ());
//layout = gtk_widget_create_pango_layout (drawable, text);
pango_layout_set_text (layout, text, text_length);
pango_layout_get_pixel_size (layout, &width, &height);
- gdk_draw_layout (drawable, gc, x, y-height, layout);
+
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_layout (drawable, gc, x, y, layout);
g_object_unref (layout);
+#else
+ height = font->ascent + font->descent;
+ if (run->dimension == 1)
+ {
+ width = gdk_text_width (font, (gchar *)run->ptr, run->len);
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_text (drawable, font, gc, x, y, (gchar *)run->ptr, run->len);
+ }
+ else
+ {
+ width = gdk_text_width_wc (font, (GdkWChar *)run->ptr, run->len);
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_text_wc (drawable, font, gc, x, y, (GdkWChar *)run->ptr, run->len);
+ }
+#endif
}
static void
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -977,14 +977,9 @@
The cursor is drawn sometimes whether or not CURSOR is set. ???
****************************************************************************/
#ifdef THIS_IS_GTK
-static
-void gdk_draw_text_image (GdkDrawable *drawable,
- GdkFont *font,
- GdkGC *gc,
- gint x,
- gint y,
- const gchar *text,
- gint text_length);
+static void
+gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y, struct textual_run *run);
#endif /* THIS_IS_GTK */
void
XLIKE_output_string (struct window *w, struct display_line *dl,
@@ -1201,7 +1196,7 @@
bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
#endif
gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background,
- Qdim, Qnil, Qnil);
+ bg_pmap, cachel->background_placement, Qnil);
}
else
{
@@ -1319,9 +1314,18 @@
single-dimension runs as well of course.
*/
{
+ GdkGC *localgc = bgc;
+ /* The cursor clip rectangle is completely wrong for
+ the pango layout code. */
+
+ if (localgc == 0)
+ localgc = XLIKE_get_gc (f, font, cachel->background,
+ cachel->foreground, bg_pmap,
+ cachel->background_placement, Qnil);
+
gdk_draw_text_image (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
- dl->ypos, (char *)runs[i].ptr, runs[i].len);
+ FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
+ xpos, dl->ypos, &runs[i]);
}
#endif /* (not) THIS_IS_X */
}
@@ -1493,8 +1497,8 @@
clip_box.width = cursor_width;
clip_box.height = height;
- XLIKE_SET_CLIP_RECTANGLE (dpy, cgc, cursor_start, ypos,
- &clip_box);
+ // XLIKE_SET_CLIP_RECTANGLE (dpy, cgc, cursor_start, ypos,
+ // &clip_box);
#ifdef THIS_IS_X
if (runs[i].dimension == 1)
XDrawImageString (dpy, x_win, cgc, xpos, dl->ypos,
@@ -1512,9 +1516,19 @@
length by the dimension of the text. This will do the
right thing for single-dimension runs as well of course.
*/
- gdk_draw_text_image (GDK_DRAWABLE (x_win),
- FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
- dl->ypos, (char *)runs[i].ptr, runs[i].len);
+ {
+ GdkGC *localgc = bgc;
+
+ if (localgc == 0)
+ localgc = XLIKE_get_gc (f, font, cursor_cachel->background,
+ cursor_cachel->background,
+ Qnil, Qnil, Qnil);
+ XLIKE_SET_CLIP_RECTANGLE (dpy, localgc, cursor_start, dl->ypos,
+ &clip_box);
+ gdk_draw_text_image (GDK_DRAWABLE (x_win),
+ FONT_INSTANCE_GTK_FONT (fi), cgc,
+ localgc, xpos, dl->ypos, &runs[i]);
+ }
#endif /* (not) THIS_IS_X */
XLIKE_CLEAR_CLIP_MASK (dpy, cgc);
@@ -1588,8 +1602,14 @@
if (!focus && NILP (bar_cursor_value))
{
+#ifdef THIS_IS_GTK
+ XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, tmp_y -
+ tmp_height - 1,
+ cursor_width - 1, tmp_height - 1);
+#else
XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, tmp_y,
cursor_width - 1, tmp_height - 1);
+#endif
}
else if (focus && !NILP (bar_cursor_value))
{
@@ -1901,7 +1921,8 @@
if (NILP (bg_pmap))
gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
- Qnil, Qnil, Qnil, Qnil);
+ WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
+ Qnil, Qnil, Qnil);
else
gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
@@ -1955,10 +1976,8 @@
}
}
else if (NILP (bar_cursor_value))
- {
- XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
- fi->width - 1, cursor_height - 1);
- }
+ XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
+ fi->width - 1, cursor_height - 1);
}
}
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/sysgtk.h
--- a/src/sysgtk.h
+++ b/src/sysgtk.h
@@ -36,7 +36,9 @@
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
+#ifdef USE_PANGO
#include <pango/pango.h>
#include <pango/pangoxft.h>
+#endif
#endif /* INCLUDED_sysgtk_h_ */
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -44,7 +44,7 @@
#include "gtk-glue.c"
/* Is the fundamental type of 't' the xemacs defined fundamental type 'type'? */
-#define IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t,type) (((GtkType) GTK_FUNDAMENTAL_TYPE(t)) == (type))
+#define IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t,type) (((GType) GTK_FUNDAMENTAL_TYPE(t)) == (type))
Lisp_Object Qemacs_ffip;
Lisp_Object Qemacs_gtk_objectp;
diff -r dc7f8b30eb856927a82bf0e81e1e9931c070ad00 -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b src/ui-gtk.h
--- a/src/ui-gtk.h
+++ b/src/ui-gtk.h
@@ -83,7 +83,7 @@
#define GTK_BOXEDP(x) RECORDP (x, emacs_gtk_boxed)
#define CHECK_GTK_BOXED(x) CHECK_RECORD (x, emacs_gtk_boxed)
-extern Lisp_Object build_gtk_boxed (void *obj, GtkType t);
+extern Lisp_Object build_gtk_boxed (void *obj, GType t);
#ifdef JSPARKES
/*
https://bitbucket.org/xemacs/xemacs/commits/5d75de03a95e/
Changeset: 5d75de03a95e
User: jsparkes
Date: 2010-05-12 22:47:18+00:00
Summary: Revert gdk_draw_text_image to take a char * and length of the text.
Affected #: 3 files
diff -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b -r 5d75de03a95e01d619955cdb938a5301ba87b4ef src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,9 @@
+2010-05-12 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Revert from taking a struct textual run argument. Some incomplete
+ changes to pango drawing.
+
2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (gdk_draw_text_image):
diff -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b -r 5d75de03a95e01d619955cdb938a5301ba87b4ef src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -90,7 +90,7 @@
static void
gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, struct textual_run *run)
+ GdkGC *bgc, gint x, gint y, gchar *text, gint len)
{
int width = -1;
int height = -1;
@@ -99,31 +99,33 @@
#endif
#ifdef USE_PANGO
- layout = pango_layout_new (gdk_pango_context_get ());
- //layout = gtk_widget_create_pango_layout (drawable, text);
+ Display *disp = GDK_DRAWABLE_XDISPLAY (drawable);
+ int screen = GDK_SCREEN_XNUMBER (gdk_drawable_get_screen (drawable));
+
+ /* Xft render */
+ //context = pango_xft_get_context (display, screen);
+ //layout = pango_layout_new (context);
+ /* Gtk render */
+ context = gtk_widget_get_pango_context (widget);
+ layout = pango_layout_new (context);
+
pango_layout_set_text (layout, text, text_length);
pango_layout_get_pixel_size (layout, &width, &height);
if (bgc != 0)
gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+
+ /* xft draw */
+ //pango_xft_layout_render (xft_draw, xft_color, layout, x, y);
+ /* Gtk draw */
gdk_draw_layout (drawable, gc, x, y, layout);
- g_object_unref (layout);
+ //g_object_unref (layout);
#else
height = font->ascent + font->descent;
- if (run->dimension == 1)
- {
- width = gdk_text_width (font, (gchar *)run->ptr, run->len);
- if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
- gdk_draw_text (drawable, font, gc, x, y, (gchar *)run->ptr, run->len);
- }
- else
- {
- width = gdk_text_width_wc (font, (GdkWChar *)run->ptr, run->len);
- if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
- gdk_draw_text_wc (drawable, font, gc, x, y, (GdkWChar *)run->ptr, run->len);
- }
+ width = gdk_text_width (font, text, len);
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_text (drawable, font, gc, x, y, text, len);
#endif
}
@@ -152,5 +154,6 @@
if (height == -1)
height = src_height;
- gdk_draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height);
+ gdk_draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest,
+ width, height);
}
diff -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b -r 5d75de03a95e01d619955cdb938a5301ba87b4ef src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -979,7 +979,7 @@
#ifdef THIS_IS_GTK
static void
gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, struct textual_run *run);
+ GdkGC *bgc, gint x, gint y, gchar *text, gint len);
#endif /* THIS_IS_GTK */
void
XLIKE_output_string (struct window *w, struct display_line *dl,
@@ -1325,7 +1325,8 @@
gdk_draw_text_image (GDK_DRAWABLE (x_win),
FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
- xpos, dl->ypos, &runs[i]);
+ xpos, dl->ypos, (char *)runs[i].ptr,
+ runs[i].len);
}
#endif /* (not) THIS_IS_X */
}
@@ -1527,7 +1528,8 @@
&clip_box);
gdk_draw_text_image (GDK_DRAWABLE (x_win),
FONT_INSTANCE_GTK_FONT (fi), cgc,
- localgc, xpos, dl->ypos, &runs[i]);
+ localgc, xpos, dl->ypos,
+ (char *)runs[i].ptr, runs[i].len);
}
#endif /* (not) THIS_IS_X */
https://bitbucket.org/xemacs/xemacs/commits/6ceb39e2d395/
Changeset: 6ceb39e2d395
User: jsparkes
Date: 2010-05-13 12:06:41+00:00
Summary: Convert to Gtk 2.0.
Now it compiles, but the main windows collapses beneath the menu.
Affected #: 2 files
diff -r 5d75de03a95e01d619955cdb938a5301ba87b4ef -r 6ceb39e2d3955f18bb1572fb5734524337a39e6b src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,9 @@
+2010-05-13 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * menubar-gtk.c (gtk_xemacs_menubar_get_type):
+ Update to 2.0 so that it compiles.
+ (gtk_xemacs_accel_label_get_type):
+
2010-05-12 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (gdk_draw_text_image):
diff -r 5d75de03a95e01d619955cdb938a5301ba87b4ef -r 6ceb39e2d3955f18bb1572fb5734524337a39e6b src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -95,9 +95,9 @@
if (!xemacs_menubar_type)
{
- static const GTypeInfo xemacs_menubar_info =
+ static const GtkTypeInfo xemacs_menubar_info =
{
- "GtkXEmacsMenubar",
+ (gchar *)"GtkXEmacsMenubar",
sizeof (GtkXEmacsMenubar),
sizeof (GtkXEmacsMenubarClass),
(GtkClassInitFunc) gtk_xemacs_menubar_class_init,
@@ -199,14 +199,13 @@
static GType
gtk_xemacs_accel_label_get_type(void)
{
- static
-GType xemacs_accel_label_type = 0;
+ static GType xemacs_accel_label_type = 0;
if (!xemacs_accel_label_type)
{
- static const GTypeInfo xemacs_accel_label_info =
+ static const GtkTypeInfo xemacs_accel_label_info =
{
- "GtkXEmacsAccelLabel",
+ (gchar *)"GtkXEmacsAccelLabel",
sizeof (GtkXEmacsAccelLabel),
sizeof (GtkXEmacsAccelLabelClass),
(GtkClassInitFunc) gtk_xemacs_accel_label_class_init,
@@ -302,9 +301,9 @@
}
#define XEMACS_MENU_DESCR_TAG g_quark_from_string ("xemacs::menu::description")
-#define XEMACS_MENU_FILTER_TAG q_quark_from_string ("xemacs::menu::filter")
-#define XEMACS_MENU_GUIID_TAG q_quark_from_string ("xemacs::menu::gui_id")
-#define XEMACS_MENU_FIRSTTIME_TAG q_quark_from_string ("xemacs::menu::first_time")
+#define XEMACS_MENU_FILTER_TAG "xemacs::menu::filter"
+#define XEMACS_MENU_GUIID_TAG "xemacs::menu::gui_id"
+#define XEMACS_MENU_FIRSTTIME_TAG "xemacs::menu::first_time"
static void __activate_menu(GtkMenuItem *, gpointer);
@@ -321,7 +320,7 @@
Lisp_Object menu_desc = Qnil;
GtkWidget *old_submenu = GTK_MENU_ITEM (menu_item)->submenu;
- menu_desc = GET_LISP_FROM_VOID (g_object_get_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
+ menu_desc = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
/* GCPRO all of our very own */
gcpro_popup_callbacks (id, menu_desc);
@@ -369,7 +368,7 @@
__activate_menu(GtkMenuItem *item, gpointer user_data)
{
Lisp_Object desc;
- gpointer force_clear = g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG);
+ gpointer force_clear = gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG);
gtk_object_set_data (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG, 0x00);
@@ -386,7 +385,7 @@
return;
}
- desc = GET_LISP_FROM_VOID (g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_DESCR_TAG));
+ desc = GET_LISP_FROM_VOID (g_object_get_qdata (G_OBJECT (item), XEMACS_MENU_DESCR_TAG));
#ifdef TEAR_OFF_MENUS
/* Lets stick in a detacher just for giggles */
@@ -401,11 +400,11 @@
if (user_data)
{
- GUI_ID id = (GUI_ID) g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_GUIID_TAG);
+ GUI_ID id = (GUI_ID) GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_GUIID_TAG));
Lisp_Object hook_fn;
struct gcpro gcpro1, gcpro2;
- hook_fn = GET_LISP_FROM_VOID (g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_FILTER_TAG));
+ hook_fn = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FILTER_TAG));
GCPRO2 (desc, hook_fn);
@@ -430,8 +429,12 @@
}
else
{
+#ifdef JSPARKES
next = menu_descriptor_to_widget_1 (child,
gtk_menu_ensure_uline_accel_group (GTK_MENU (item->submenu)));
+#else
+
+#endif
}
if (!next)
@@ -449,9 +452,9 @@
that made sure callbacks and such were GCPRO-ed
*/
static void
-__remove_gcpro_by_id (gpointer user_data, GObject *previous_location)
+__remove_gcpro_by_id (gpointer user_data)
{
- ungcpro_popup_callbacks ((GUI_ID) user_data);
+ ungcpro_popup_callbacks ((GUI_ID) GPOINTER_TO_INT (user_data));
}
static void
@@ -573,15 +576,15 @@
guint accel_key;
gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
- accel_key = gtk_label_parse_uline (GTK_LABEL (accel_label), temp_menu_name);
-
+ gtk_label_set_use_underline (GTK_LABEL (accel_label), TRUE);
+ // accel_key = XCHAR (menu_line_to_
menu_item = gtk_menu_item_new ();
gtk_container_add (GTK_CONTAINER (menu_item), accel_label);
gtk_widget_show (accel_label);
if (menubar_accel_group)
gtk_widget_add_accelerator (menu_item,
- "activate_item",
+ "activate",
menubar_accel_group,
accel_key, GDK_MOD1_MASK,
GTK_ACCEL_LOCKED);
@@ -660,7 +663,7 @@
invalid_argument ("unknown menu cascade keyword", cascade);
}
- gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, STORE_LISP_IN_VOID (desc));
+ g_object_set_qdata (G_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, STORE_LISP_IN_VOID (desc));
gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG, STORE_LISP_IN_VOID (hook_fn));
if ((!NILP (config_tag)
@@ -687,12 +690,12 @@
*/
if (reuse)
{
- gpointer id = g_object_get_qdata (GTK_OBJECT (reuse), XEMACS_MENU_GUIID_TAG);
+ gpointer id = gtk_object_get_data (GTK_OBJECT (reuse), XEMACS_MENU_GUIID_TAG);
if (id)
{
/* If the menu item had a GUI_ID that means it was a filter menu */
- __remove_gcpro_by_id (id, NULL);
+ __remove_gcpro_by_id (id);
gtk_signal_disconnect_by_func (GTK_OBJECT (reuse),
GTK_SIGNAL_FUNC (__activate_menu),
(gpointer) 0x01 );
@@ -890,7 +893,8 @@
temp_label = convert_underscores (label_buffer);
main_label = gtk_xemacs_accel_label_new (NULL);
- accel_key = gtk_label_parse_uline (GTK_LABEL (main_label), temp_label);
+ /* accel_key = */
+ gtk_label_set_use_underline (GTK_LABEL (main_label), TRUE);
free (temp_label);
}
@@ -1027,9 +1031,10 @@
if (accel_group)
gtk_widget_add_accelerator (widget,
- "activate_item",
+ (gchar *)"activate_item",
accel_group,
- accel_key, 0,
+ accel_key,
+ (GdkModifierType)0,
GTK_ACCEL_LOCKED);
}
@@ -1088,7 +1093,7 @@
gboolean right_justify = FALSE;
Lisp_Object value = descr;
GtkWidget *menubar = FRAME_GTK_MENUBAR_WIDGET (f);
- GUI_ID id = (GUI_ID) g_object_get_qdata (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG);
+ GUI_ID id = (GUI_ID) GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG));
guint menu_position = 0;
GtkAccelGroup *menubar_accel_group;
@@ -1176,7 +1181,7 @@
while ((l = g_list_nth (GTK_MENU_SHELL (menubar)->children, menu_position)))
{
gpointer data = l->data;
- g_list_remove_link (GTK_MENU_SHELL (menubar)->children, l);
+ l = g_list_remove_link (GTK_MENU_SHELL (menubar)->children, l);
if (data)
{
@@ -1236,7 +1241,7 @@
FRAME_GTK_MENUBAR_WIDGET (f) = menubar;
gtk_object_set_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG, (gpointer) id);
- gtk_object_weakref (GTK_OBJECT (menubar), __remove_gcpro_by_id, (gpointer) id, NULL);
+ gtk_object_weakref (GTK_OBJECT (menubar), __remove_gcpro_by_id, (gpointer) id);
}
static int
@@ -1415,7 +1420,7 @@
widget = menu_descriptor_to_widget (menu_desc, NULL);
menu = GTK_MENU_ITEM (widget)->submenu;
gtk_widget_set_name (widget, "XEmacsPopupMenu");
- id = gtk_object_get_qdata (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG);
+ id = gtk_object_get_data (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG);
__activate_menu (GTK_MENU_ITEM (widget), id);
https://bitbucket.org/xemacs/xemacs/commits/f19dd48be29b/
Changeset: f19dd48be29b
User: jsparkes
Date: 2010-05-13 12:12:29+00:00
Summary: Add parsing of label accelerator back so that it gets added to the menu
correctly.
Affected #: 1 file
diff -r 6ceb39e2d3955f18bb1572fb5734524337a39e6b -r f19dd48be29b1d52b0aa83d7f07ca4a1f8d8ea79 src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -577,7 +577,7 @@
gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
gtk_label_set_use_underline (GTK_LABEL (accel_label), TRUE);
- // accel_key = XCHAR (menu_line_to_
+ accel_key = gtk_label_parse_uline (GTK_LABEL (accel_label), temp_menu_name);
menu_item = gtk_menu_item_new ();
gtk_container_add (GTK_CONTAINER (menu_item), accel_label);
gtk_widget_show (accel_label);
https://bitbucket.org/xemacs/xemacs/commits/aebc48ccb6c1/
Changeset: aebc48ccb6c1
User: jsparkes
Date: 2010-05-11 14:12:55+00:00
Summary: Display a text space instead of a rectangle for an onscreen blank.
Affected #: 2 files
diff -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b -r aebc48ccb6c1ea80a115e81a69d80db6e5d3e2e7 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,9 @@
+2010-05-11 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-xlike-inc.c (XLIKE_output_blank):
+ Display a text space instead of a rectangle for an
+ onscreen blank.
+
2010-05-10 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (gdk_draw_text_image):
diff -r c46572ca00c38b7f2d10bdc857677c8188dcbd0b -r aebc48ccb6c1ea80a115e81a69d80db6e5d3e2e7 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -1976,8 +1976,20 @@
}
}
else if (NILP (bar_cursor_value))
- XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
- fi->width - 1, cursor_height - 1);
+ {
+#ifndef THIS_IS_GTK
+ XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
+ fi->width - 1, cursor_height - 1);
+#else
+ struct textual_run run;
+ run.charset = Vcharset_ascii;
+ run.dimension = 1;
+ run.ptr = (unsigned char *)"a";
+ run.len = 1;
+ gdk_draw_text_image (x_win, FONT_INSTANCE_GTK_FONT (fi),
+ gc, gc, cursor_start, cursor_y, &run);
+#endif
+ }
}
}
https://bitbucket.org/xemacs/xemacs/commits/a2cfb9d290a0/
Changeset: a2cfb9d290a0
User: jsparkes
Date: 2010-05-11 14:37:22+00:00
Summary: Extract gdk_draw_text_blank function.
Affected #: 3 files
diff -r aebc48ccb6c1ea80a115e81a69d80db6e5d3e2e7 -r a2cfb9d290a0d97239b719397d64f8d63fdf7d56 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,6 +1,12 @@
2010-05-11 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-xlike-inc.c (XLIKE_output_blank):
+ Use new gdk draw blank function.
+
+ * redisplay-gtk.c (gdk_draw_text_blank):
+ Extract a new function.
+
+ * redisplay-xlike-inc.c (XLIKE_output_blank):
Display a text space instead of a rectangle for an
onscreen blank.
diff -r aebc48ccb6c1ea80a115e81a69d80db6e5d3e2e7 -r a2cfb9d290a0d97239b719397d64f8d63fdf7d56 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -128,6 +128,19 @@
}
static void
+gdk_draw_text_blank (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y)
+{
+ int width = -1;
+ int height = font->ascent + font->descent;
+
+ width = gdk_text_width (font, " ", 1);
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_text (drawable, font, gc, x, y, " ", 1);
+}
+
+static void
our_draw_bitmap (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
diff -r aebc48ccb6c1ea80a115e81a69d80db6e5d3e2e7 -r a2cfb9d290a0d97239b719397d64f8d63fdf7d56 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -980,6 +980,11 @@
static void
gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
GdkGC *bgc, gint x, gint y, struct textual_run *run);
+
+static void
+gdk_draw_text_blank (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y);
+
#endif /* THIS_IS_GTK */
void
XLIKE_output_string (struct window *w, struct display_line *dl,
@@ -1960,8 +1965,13 @@
{
if (NILP (bar_cursor_value))
{
+#ifndef THIS_IS_GTK
XLIKE_FILL_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
fi->width, cursor_height);
+#else
+ gdk_draw_text_blank (x_win, FONT_INSTANCE_GTK_FONT (fi),
+ gc, 0, cursor_start, cursor_y);
+#endif
}
else
{
@@ -1981,13 +1991,8 @@
XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
fi->width - 1, cursor_height - 1);
#else
- struct textual_run run;
- run.charset = Vcharset_ascii;
- run.dimension = 1;
- run.ptr = (unsigned char *)"a";
- run.len = 1;
- gdk_draw_text_image (x_win, FONT_INSTANCE_GTK_FONT (fi),
- gc, gc, cursor_start, cursor_y, &run);
+ gdk_draw_text_blank (x_win, FONT_INSTANCE_GTK_FONT (fi),
+ gc, 0, cursor_start, cursor_y);
#endif
}
}
https://bitbucket.org/xemacs/xemacs/commits/8bc69d348273/
Changeset: 8bc69d348273
User: jsparkes
Date: 2010-05-12 12:10:35+00:00
Summary: Rename gdk_draw_text_char to gdk_draw_text_char and take a character argument.
Affected #: 3 files
diff -r a2cfb9d290a0d97239b719397d64f8d63fdf7d56 -r 8bc69d34827362948080ed3c505adec2f14453ae src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,13 @@
+2010-05-12 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (gdk_draw_text_char):
+ Rename gdk_draw_text_char to gdk_draw_text_char and take
+ a character argument.
+
+ * redisplay-xlike-inc.c (XLIKE_output_blank):
+ Rename gdk_draw_text_char to gdk_draw_text_char and pass
+ a space as the character argument.
+
2010-05-11 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-xlike-inc.c (XLIKE_output_blank):
diff -r a2cfb9d290a0d97239b719397d64f8d63fdf7d56 -r 8bc69d34827362948080ed3c505adec2f14453ae src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -128,16 +128,16 @@
}
static void
-gdk_draw_text_blank (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y)
+gdk_draw_text_char (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y, gchar blank)
{
int width = -1;
int height = font->ascent + font->descent;
- width = gdk_text_width (font, " ", 1);
+ width = gdk_text_width (font, &blank, 1);
if (bgc != 0)
gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
- gdk_draw_text (drawable, font, gc, x, y, " ", 1);
+ gdk_draw_text (drawable, font, gc, x, y, &blank, 1);
}
static void
diff -r a2cfb9d290a0d97239b719397d64f8d63fdf7d56 -r 8bc69d34827362948080ed3c505adec2f14453ae src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -982,8 +982,8 @@
GdkGC *bgc, gint x, gint y, struct textual_run *run);
static void
-gdk_draw_text_blank (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y);
+gdk_draw_text_char (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
+ GdkGC *bgc, gint x, gint y, gchar blank);
#endif /* THIS_IS_GTK */
void
@@ -1875,6 +1875,7 @@
shadow_thickness, EDGE_ALL, style);
}
+
/*****************************************************************************
XLIKE_output_blank
@@ -1969,8 +1970,8 @@
XLIKE_FILL_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
fi->width, cursor_height);
#else
- gdk_draw_text_blank (x_win, FONT_INSTANCE_GTK_FONT (fi),
- gc, 0, cursor_start, cursor_y);
+ gdk_draw_text_char (x_win, FONT_INSTANCE_GTK_FONT (fi),
+ gc, 0, cursor_start, cursor_y, ' ');
#endif
}
else
@@ -1991,8 +1992,8 @@
XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
fi->width - 1, cursor_height - 1);
#else
- gdk_draw_text_blank (x_win, FONT_INSTANCE_GTK_FONT (fi),
- gc, 0, cursor_start, cursor_y);
+ gdk_draw_text_char (x_win, FONT_INSTANCE_GTK_FONT (fi),
+ gc, 0, cursor_start, cursor_y, ' ');
#endif
}
}
https://bitbucket.org/xemacs/xemacs/commits/f03b360b07a5/
Changeset: f03b360b07a5
User: jsparkes
Date: 2010-05-12 12:34:15+00:00
Summary: Use min() to clarify some math.
Affected #: 2 files
diff -r 8bc69d34827362948080ed3c505adec2f14453ae -r f03b360b07a5bcd98603ff10fd21f0adb41df9d0 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-05-12 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Use min() to clarify some math.
+
* redisplay-gtk.c (gdk_draw_text_char):
Rename gdk_draw_text_char to gdk_draw_text_char and take
a character argument.
diff -r 8bc69d34827362948080ed3c505adec2f14453ae -r f03b360b07a5bcd98603ff10fd21f0adb41df9d0 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -1049,9 +1049,7 @@
Dynarr_length (buf));
/* Regularize the variables passed in. */
-
- if (clip_start < xpos)
- clip_start = xpos;
+ clip_start = min (clip_start, xpos);
clip_end = xpos + width;
if (clip_start >= clip_end)
/* It's all clipped out. */
@@ -1100,6 +1098,7 @@
bgc = 0;
else
{
+ /* Clear the cursor location? */
bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
bg_pmap, cachel->background_placement, Qnil);
XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start,
@@ -1145,10 +1144,8 @@
/* Make sure we don't clear below the real bottom of the
line. */
- if (ypos1_string > ypos2_line)
- ypos1_string = ypos2_line;
- if (ypos2_string > ypos2_line)
- ypos2_string = ypos2_line;
+ ypos1_string = min (ypos1_string, ypos2_line);
+ ypos2_string = min (ypos2_string, ypos2_line);
if (ypos1_line < ypos1_string)
{
@@ -1325,7 +1322,7 @@
if (localgc == 0)
localgc = XLIKE_get_gc (f, font, cachel->background,
- cachel->foreground, bg_pmap,
+ cachel->background, bg_pmap,
cachel->background_placement, Qnil);
gdk_draw_text_image (GDK_DRAWABLE (x_win),
@@ -1525,11 +1522,14 @@
GdkGC *localgc = bgc;
if (localgc == 0)
- localgc = XLIKE_get_gc (f, font, cursor_cachel->background,
- cursor_cachel->background,
+ localgc = XLIKE_get_gc (f, font, cursor_cachel->foreground,
+ cursor_cachel->foreground,
Qnil, Qnil, Qnil);
XLIKE_SET_CLIP_RECTANGLE (dpy, localgc, cursor_start, dl->ypos,
&clip_box);
+ cgc = XLIKE_get_gc (f, font, cursor_cachel->foreground,
+ cursor_cachel->background,
+ Qnil, Qnil, Qnil);
gdk_draw_text_image (GDK_DRAWABLE (x_win),
FONT_INSTANCE_GTK_FONT (fi), cgc,
localgc, xpos, dl->ypos, &runs[i]);
@@ -1590,8 +1590,7 @@
if (tmp_y + tmp_height > (int) (ypos + height))
{
tmp_y = ypos + height - tmp_height;
- if (tmp_y < (int) ypos)
- tmp_y = ypos;
+ tmp_y = min (tmp_y, ypos);
tmp_height = ypos + height - tmp_y;
}
https://bitbucket.org/xemacs/xemacs/commits/11a9165aa710/
Changeset: 11a9165aa710
User: jsparkes
Date: 2010-05-13 13:06:29+00:00
Summary: Merge of menu bar code from home.
Affected #: 4 files
diff -r f03b360b07a5bcd98603ff10fd21f0adb41df9d0 -r 11a9165aa7104f8e1240cc01fbf3d5afb446dbf6 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,9 @@
+2010-05-13 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * menubar-gtk.c (gtk_xemacs_menubar_get_type):
+ Update to 2.0 so that it compiles.
+ (gtk_xemacs_accel_label_get_type):
+
2010-05-12 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-xlike-inc.c (XLIKE_output_string):
diff -r f03b360b07a5bcd98603ff10fd21f0adb41df9d0 -r 11a9165aa7104f8e1240cc01fbf3d5afb446dbf6 src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -95,9 +95,9 @@
if (!xemacs_menubar_type)
{
- static const GTypeInfo xemacs_menubar_info =
+ static const GtkTypeInfo xemacs_menubar_info =
{
- "GtkXEmacsMenubar",
+ (gchar *)"GtkXEmacsMenubar",
sizeof (GtkXEmacsMenubar),
sizeof (GtkXEmacsMenubarClass),
(GtkClassInitFunc) gtk_xemacs_menubar_class_init,
@@ -199,14 +199,13 @@
static GType
gtk_xemacs_accel_label_get_type(void)
{
- static
-GType xemacs_accel_label_type = 0;
+ static GType xemacs_accel_label_type = 0;
if (!xemacs_accel_label_type)
{
- static const GTypeInfo xemacs_accel_label_info =
+ static const GtkTypeInfo xemacs_accel_label_info =
{
- "GtkXEmacsAccelLabel",
+ (gchar *)"GtkXEmacsAccelLabel",
sizeof (GtkXEmacsAccelLabel),
sizeof (GtkXEmacsAccelLabelClass),
(GtkClassInitFunc) gtk_xemacs_accel_label_class_init,
@@ -302,9 +301,9 @@
}
#define XEMACS_MENU_DESCR_TAG g_quark_from_string ("xemacs::menu::description")
-#define XEMACS_MENU_FILTER_TAG q_quark_from_string ("xemacs::menu::filter")
-#define XEMACS_MENU_GUIID_TAG q_quark_from_string ("xemacs::menu::gui_id")
-#define XEMACS_MENU_FIRSTTIME_TAG q_quark_from_string ("xemacs::menu::first_time")
+#define XEMACS_MENU_FILTER_TAG "xemacs::menu::filter"
+#define XEMACS_MENU_GUIID_TAG "xemacs::menu::gui_id"
+#define XEMACS_MENU_FIRSTTIME_TAG "xemacs::menu::first_time"
static void __activate_menu(GtkMenuItem *, gpointer);
@@ -321,7 +320,7 @@
Lisp_Object menu_desc = Qnil;
GtkWidget *old_submenu = GTK_MENU_ITEM (menu_item)->submenu;
- menu_desc = GET_LISP_FROM_VOID (g_object_get_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
+ menu_desc = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
/* GCPRO all of our very own */
gcpro_popup_callbacks (id, menu_desc);
@@ -369,7 +368,7 @@
__activate_menu(GtkMenuItem *item, gpointer user_data)
{
Lisp_Object desc;
- gpointer force_clear = g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG);
+ gpointer force_clear = gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG);
gtk_object_set_data (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG, 0x00);
@@ -386,7 +385,7 @@
return;
}
- desc = GET_LISP_FROM_VOID (g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_DESCR_TAG));
+ desc = GET_LISP_FROM_VOID (g_object_get_qdata (G_OBJECT (item), XEMACS_MENU_DESCR_TAG));
#ifdef TEAR_OFF_MENUS
/* Lets stick in a detacher just for giggles */
@@ -401,11 +400,11 @@
if (user_data)
{
- GUI_ID id = (GUI_ID) g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_GUIID_TAG);
+ GUI_ID id = (GUI_ID) GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_GUIID_TAG));
Lisp_Object hook_fn;
struct gcpro gcpro1, gcpro2;
- hook_fn = GET_LISP_FROM_VOID (g_object_get_qdata (GTK_OBJECT (item), XEMACS_MENU_FILTER_TAG));
+ hook_fn = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FILTER_TAG));
GCPRO2 (desc, hook_fn);
@@ -430,8 +429,12 @@
}
else
{
+#ifdef JSPARKES
next = menu_descriptor_to_widget_1 (child,
gtk_menu_ensure_uline_accel_group (GTK_MENU (item->submenu)));
+#else
+
+#endif
}
if (!next)
@@ -449,9 +452,9 @@
that made sure callbacks and such were GCPRO-ed
*/
static void
-__remove_gcpro_by_id (gpointer user_data, GObject *previous_location)
+__remove_gcpro_by_id (gpointer user_data)
{
- ungcpro_popup_callbacks ((GUI_ID) user_data);
+ ungcpro_popup_callbacks ((GUI_ID) GPOINTER_TO_INT (user_data));
}
static void
@@ -573,15 +576,15 @@
guint accel_key;
gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
- accel_key = gtk_label_parse_uline (GTK_LABEL (accel_label), temp_menu_name);
-
+ gtk_label_set_use_underline (GTK_LABEL (accel_label), TRUE);
+ accel_key = gtk_label_parse_uline (GTK_LABEL (accel_label), temp_menu_name);
menu_item = gtk_menu_item_new ();
gtk_container_add (GTK_CONTAINER (menu_item), accel_label);
gtk_widget_show (accel_label);
if (menubar_accel_group)
gtk_widget_add_accelerator (menu_item,
- "activate_item",
+ "activate",
menubar_accel_group,
accel_key, GDK_MOD1_MASK,
GTK_ACCEL_LOCKED);
@@ -660,7 +663,7 @@
invalid_argument ("unknown menu cascade keyword", cascade);
}
- gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, STORE_LISP_IN_VOID (desc));
+ g_object_set_qdata (G_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, STORE_LISP_IN_VOID (desc));
gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG, STORE_LISP_IN_VOID (hook_fn));
if ((!NILP (config_tag)
@@ -687,12 +690,12 @@
*/
if (reuse)
{
- gpointer id = g_object_get_qdata (GTK_OBJECT (reuse), XEMACS_MENU_GUIID_TAG);
+ gpointer id = gtk_object_get_data (GTK_OBJECT (reuse), XEMACS_MENU_GUIID_TAG);
if (id)
{
/* If the menu item had a GUI_ID that means it was a filter menu */
- __remove_gcpro_by_id (id, NULL);
+ __remove_gcpro_by_id (id);
gtk_signal_disconnect_by_func (GTK_OBJECT (reuse),
GTK_SIGNAL_FUNC (__activate_menu),
(gpointer) 0x01 );
@@ -890,7 +893,8 @@
temp_label = convert_underscores (label_buffer);
main_label = gtk_xemacs_accel_label_new (NULL);
- accel_key = gtk_label_parse_uline (GTK_LABEL (main_label), temp_label);
+ /* accel_key = */
+ gtk_label_set_use_underline (GTK_LABEL (main_label), TRUE);
free (temp_label);
}
@@ -1027,9 +1031,10 @@
if (accel_group)
gtk_widget_add_accelerator (widget,
- "activate_item",
+ (gchar *)"activate_item",
accel_group,
- accel_key, 0,
+ accel_key,
+ (GdkModifierType)0,
GTK_ACCEL_LOCKED);
}
@@ -1088,7 +1093,7 @@
gboolean right_justify = FALSE;
Lisp_Object value = descr;
GtkWidget *menubar = FRAME_GTK_MENUBAR_WIDGET (f);
- GUI_ID id = (GUI_ID) g_object_get_qdata (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG);
+ GUI_ID id = (GUI_ID) GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG));
guint menu_position = 0;
GtkAccelGroup *menubar_accel_group;
@@ -1176,7 +1181,7 @@
while ((l = g_list_nth (GTK_MENU_SHELL (menubar)->children, menu_position)))
{
gpointer data = l->data;
- g_list_remove_link (GTK_MENU_SHELL (menubar)->children, l);
+ l = g_list_remove_link (GTK_MENU_SHELL (menubar)->children, l);
if (data)
{
@@ -1236,7 +1241,7 @@
FRAME_GTK_MENUBAR_WIDGET (f) = menubar;
gtk_object_set_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG, (gpointer) id);
- gtk_object_weakref (GTK_OBJECT (menubar), __remove_gcpro_by_id, (gpointer) id, NULL);
+ gtk_object_weakref (GTK_OBJECT (menubar), __remove_gcpro_by_id, (gpointer) id);
}
static int
@@ -1415,7 +1420,7 @@
widget = menu_descriptor_to_widget (menu_desc, NULL);
menu = GTK_MENU_ITEM (widget)->submenu;
gtk_widget_set_name (widget, "XEmacsPopupMenu");
- id = gtk_object_get_qdata (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG);
+ id = gtk_object_get_data (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG);
__activate_menu (GTK_MENU_ITEM (widget), id);
diff -r f03b360b07a5bcd98603ff10fd21f0adb41df9d0 -r 11a9165aa7104f8e1240cc01fbf3d5afb446dbf6 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -90,7 +90,7 @@
static void
gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, struct textual_run *run)
+ GdkGC *bgc, gint x, gint y, gchar *text, gint len)
{
int width = -1;
int height = -1;
@@ -99,31 +99,33 @@
#endif
#ifdef USE_PANGO
- layout = pango_layout_new (gdk_pango_context_get ());
- //layout = gtk_widget_create_pango_layout (drawable, text);
+ Display *disp = GDK_DRAWABLE_XDISPLAY (drawable);
+ int screen = GDK_SCREEN_XNUMBER (gdk_drawable_get_screen (drawable));
+
+ /* Xft render */
+ //context = pango_xft_get_context (display, screen);
+ //layout = pango_layout_new (context);
+ /* Gtk render */
+ context = gtk_widget_get_pango_context (widget);
+ layout = pango_layout_new (context);
+
pango_layout_set_text (layout, text, text_length);
pango_layout_get_pixel_size (layout, &width, &height);
if (bgc != 0)
gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+
+ /* xft draw */
+ //pango_xft_layout_render (xft_draw, xft_color, layout, x, y);
+ /* Gtk draw */
gdk_draw_layout (drawable, gc, x, y, layout);
- g_object_unref (layout);
+ //g_object_unref (layout);
#else
height = font->ascent + font->descent;
- if (run->dimension == 1)
- {
- width = gdk_text_width (font, (gchar *)run->ptr, run->len);
- if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
- gdk_draw_text (drawable, font, gc, x, y, (gchar *)run->ptr, run->len);
- }
- else
- {
- width = gdk_text_width_wc (font, (GdkWChar *)run->ptr, run->len);
- if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
- gdk_draw_text_wc (drawable, font, gc, x, y, (GdkWChar *)run->ptr, run->len);
- }
+ width = gdk_text_width (font, text, len);
+ if (bgc != 0)
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_text (drawable, font, gc, x, y, text, len);
#endif
}
@@ -165,5 +167,6 @@
if (height == -1)
height = src_height;
- gdk_draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height);
+ gdk_draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest,
+ width, height);
}
https://bitbucket.org/xemacs/xemacs/commits/1927352f70e7/
Changeset: 1927352f70e7
User: jsparkes
Date: 2010-05-14 14:40:32+00:00
Summary: gdk_draw_rectangle starts from top left corner!
Affected #: 2 files
diff -r 11a9165aa7104f8e1240cc01fbf3d5afb446dbf6 -r 1927352f70e76240a97c4f96aab0858e7e7fc092 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,9 @@
+2010-05-14 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (gdk_draw_text_image):
+ gdk_draw_rectangle starts from top left corner.
+ (gdk_draw_text_char): Ditto.
+
2010-05-13 Jeff Sparkes <jsparkes(a)gmail.com>
* menubar-gtk.c (gtk_xemacs_menubar_get_type):
diff -r 11a9165aa7104f8e1240cc01fbf3d5afb446dbf6 -r 1927352f70e76240a97c4f96aab0858e7e7fc092 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -124,7 +124,7 @@
height = font->ascent + font->descent;
width = gdk_text_width (font, text, len);
if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y-height+1, width, height);
gdk_draw_text (drawable, font, gc, x, y, text, len);
#endif
}
@@ -138,7 +138,7 @@
width = gdk_text_width (font, &blank, 1);
if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y-height+1, width, height);
gdk_draw_text (drawable, font, gc, x, y, &blank, 1);
}
https://bitbucket.org/xemacs/xemacs/commits/d83de99840cc/
Changeset: d83de99840cc
User: jsparkes
Date: 2010-05-14 15:09:49+00:00
Summary: Define and use XLIKE_output cursor.
XLIKE_FILL_RECTANGLE takes the same args in Gtk and non-Gtk. Again.
Affected #: 2 files
diff -r 1927352f70e76240a97c4f96aab0858e7e7fc092 -r d83de99840ccfc77f61c68a889441292b37bdd2c src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,11 @@
2010-05-14 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-xlike-inc.c (XLIKE_output_cursor):
+ New function that displays the cursor, but unfortunately not the
+ character underneath. Still, it's a display improvement.
+ (XLIKE_output_blank):
+ Use same args for XLIKE_DRAW_RECTANGLE in Gtk and non-Gtk cases.
+
* redisplay-gtk.c (gdk_draw_text_image):
gdk_draw_rectangle starts from top left corner.
(gdk_draw_text_char): Ditto.
diff -r 1927352f70e76240a97c4f96aab0858e7e7fc092 -r d83de99840ccfc77f61c68a889441292b37bdd2c src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -106,6 +106,10 @@
static void XLIKE_output_eol_cursor (struct window *w,
struct display_line *dl,
int xpos, face_index findex);
+static void XLIKE_output_cursor (struct window *w,
+ struct display_line *dl,
+ int xpos, face_index findex, int width,
+ char c);
static void XLIKE_clear_frame_windows (Lisp_Object window);
static void XLIKE_bevel_area (struct window *w, face_index findex,
int x, int y, int width, int height,
@@ -659,11 +663,14 @@
}
else
{
- Dynarr_add (buf, rb->object.chr.ch);
- XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos,
- rb->width, findex, 1,
- cursor_start, cursor_width,
- cursor_height);
+ XLIKE_output_cursor (w, dl, xpos, findex, cursor_width,
+ rb->object.chr.ch);
+
+ // Dynarr_add (buf, rb->object.chr.ch);
+ //XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos,
+ // rb->width, findex, 1,
+ // cursor_start, cursor_width,
+ // cursor_height);
Dynarr_reset (buf);
}
@@ -979,7 +986,7 @@
#ifdef THIS_IS_GTK
static void
gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, struct textual_run *run);
+ GdkGC *bgc, gint x, gint y, gchar *text, gint len);
static void
gdk_draw_text_char (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
@@ -1099,11 +1106,11 @@
else
{
/* Clear the cursor location? */
- bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
+ bgc = XLIKE_get_gc (f, Qnil, cachel->background, cachel->background,
bg_pmap, cachel->background_placement, Qnil);
XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start,
- ypos, clip_end - clip_start,
- height);
+ ypos, clip_end - clip_start,
+ height);
}
nruns = separate_textual_runs (text_storage, runs, Dynarr_begin (buf),
@@ -1327,7 +1334,8 @@
gdk_draw_text_image (GDK_DRAWABLE (x_win),
FONT_INSTANCE_GTK_FONT (fi), gc, localgc,
- xpos, dl->ypos, &runs[i]);
+ xpos, dl->ypos, (gchar *) runs[i].ptr,
+ runs[i].len);
}
#endif /* (not) THIS_IS_X */
}
@@ -1413,7 +1421,7 @@
ascent = gfont->ascent;
descent = gfont->descent;
- uthick = 1;
+ uthick = 2;
#endif /* THIS_IS_GTK */
upos = ascent - ((ascent + descent) / 2) + 1;
@@ -1429,8 +1437,8 @@
XLIKE_DRAW_LINE (dpy, x_win, gc, xpos, dl->ypos - upos,
xpos + this_width, dl->ypos - upos);
else if (uthick > 1)
- XLIKE_FILL_RECTANGLE (dpy, x_win, gc, xpos, dl->ypos + upos,
- this_width, uthick);
+ XLIKE_FILL_RECTANGLE (dpy, x_win, gc, xpos, dl->ypos + upos,
+ this_width, uthick);
}
}
@@ -1499,8 +1507,8 @@
clip_box.width = cursor_width;
clip_box.height = height;
- // XLIKE_SET_CLIP_RECTANGLE (dpy, cgc, cursor_start, ypos,
- // &clip_box);
+ XLIKE_SET_CLIP_RECTANGLE (dpy, cgc, cursor_start, ypos,
+ &clip_box);
#ifdef THIS_IS_X
if (runs[i].dimension == 1)
XDrawImageString (dpy, x_win, cgc, xpos, dl->ypos,
@@ -1532,7 +1540,8 @@
Qnil, Qnil, Qnil);
gdk_draw_text_image (GDK_DRAWABLE (x_win),
FONT_INSTANCE_GTK_FONT (fi), cgc,
- localgc, xpos, dl->ypos, &runs[i]);
+ localgc, xpos, dl->ypos, (gchar *)runs[i].ptr,
+ runs[i].len);
}
#endif /* (not) THIS_IS_X */
@@ -1606,14 +1615,8 @@
if (!focus && NILP (bar_cursor_value))
{
-#ifdef THIS_IS_GTK
- XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, tmp_y -
- tmp_height - 1,
+ XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, tmp_y,
cursor_width - 1, tmp_height - 1);
-#else
- XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, tmp_y,
- cursor_width - 1, tmp_height - 1);
-#endif
}
else if (focus && !NILP (bar_cursor_value))
{
@@ -1965,13 +1968,8 @@
{
if (NILP (bar_cursor_value))
{
-#ifndef THIS_IS_GTK
XLIKE_FILL_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
fi->width, cursor_height);
-#else
- gdk_draw_text_char (x_win, FONT_INSTANCE_GTK_FONT (fi),
- gc, 0, cursor_start, cursor_y, ' ');
-#endif
}
else
{
@@ -1987,13 +1985,8 @@
}
else if (NILP (bar_cursor_value))
{
-#ifndef THIS_IS_GTK
XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
fi->width - 1, cursor_height - 1);
-#else
- gdk_draw_text_char (x_win, FONT_INSTANCE_GTK_FONT (fi),
- gc, 0, cursor_start, cursor_y, ' ');
-#endif
}
}
}
@@ -2165,6 +2158,77 @@
}
static void
+XLIKE_output_cursor (struct window *w, struct display_line *dl, int xpos,
+ face_index findex, int width, char ch)
+{
+ struct frame *f = XFRAME (w->frame);
+ struct device *d = XDEVICE (f->device);
+ Lisp_Object window;
+
+ XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+ XLIKE_GC gc = NULL;
+ face_index elt = get_builtin_face_cache_index (w, Vtext_cursor_face);
+ struct face_cachel *cursor_cachel = WINDOW_FACE_CACHEL (w, elt);
+
+ int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
+ Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
+ WINDOW_BUFFER (w));
+
+ int x = xpos;
+ int y = XLIKE_DISPLAY_LINE_YPOS (dl);
+ int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
+ int cursor_height, cursor_y;
+ int defheight, defascent;
+
+ window = wrap_window (w);
+ redisplay_clear_region (window, findex, x, y, width, height);
+
+ if (NILP (w->text_cursor_visible_p))
+ return;
+
+ gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
+ Qnil, Qnil, Qnil);
+
+ default_face_font_info (window, &defascent, 0, 0, &defheight, 0);
+
+ /* make sure the cursor is entirely contained between y and y+height */
+ cursor_height = min (defheight, height) - 2;
+ cursor_y = max (y, min (y + height - cursor_height,
+ dl->ypos - defascent));
+
+ if (focus)
+ {
+#ifdef HAVE_XIM
+ XIM_SetSpotLocation (f, x - 2 , cursor_y + cursor_height - 2);
+#endif /* HAVE_XIM */
+
+ if (NILP (bar_cursor_value))
+ {
+ XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, cursor_y, width,
+ cursor_height);
+ }
+ else
+ {
+ int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
+
+ gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
+ Qnil, Qnil,
+ make_int (bar_width));
+ XLIKE_DRAW_LINE (dpy, x_win, gc, x + bar_width - 1, cursor_y,
+ x + bar_width - 1, cursor_y + cursor_height - 1);
+ }
+ }
+ else if (NILP (bar_cursor_value))
+ {
+ XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, x, cursor_y+1, width - 1,
+ cursor_height - 1);
+ }
+ // gdk_draw_text_image (GDK_DRAWABLE (x_win), FONT_INSTANCE_GTK_FONT (fi), gc, bgc,
+ // x, cursor_y + 1, dl->xpos, 1);
+}
+
+static void
XLIKE_clear_frame_window (Lisp_Object window)
{
struct window *w = XWINDOW (window);
https://bitbucket.org/xemacs/xemacs/commits/5d8139e5f462/
Changeset: 5d8139e5f462
User: jsparkes
Date: 2010-05-16 15:17:34+00:00
Summary: Shrink the cursor rectangle to avoid left over lines.
Affected #: 2 files
diff -r d83de99840ccfc77f61c68a889441292b37bdd2c -r 5d8139e5f462fe4025571b1222ce2998a50ebe7a src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,8 @@
+2010-05-16 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (gdk_draw_text_image):
+ Shrink the cursor rectangle to avoid left over lines.
+
2010-05-14 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-xlike-inc.c (XLIKE_output_cursor):
@@ -14,7 +19,8 @@
* menubar-gtk.c (gtk_xemacs_menubar_get_type):
Update to 2.0 so that it compiles.
- (gtk_xemacs_accel_label_get_type):
+ (gtk_xemacs_accel_label_get_type, menu_convert): Add parsing of
+ label accelerator back so that it gets added to the menu correctly.
2010-05-12 Jeff Sparkes <jsparkes(a)gmail.com>
diff -r d83de99840ccfc77f61c68a889441292b37bdd2c -r 5d8139e5f462fe4025571b1222ce2998a50ebe7a src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -124,7 +124,7 @@
height = font->ascent + font->descent;
width = gdk_text_width (font, text, len);
if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y-height+1, width, height);
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y-height+2, width, height-1);
gdk_draw_text (drawable, font, gc, x, y, text, len);
#endif
}
https://bitbucket.org/xemacs/xemacs/commits/19ea225452bf/
Changeset: 19ea225452bf
User: jsparkes
Date: 2010-05-16 16:17:42+00:00
Summary: Force outline cursor to be used for block mode cursor display. Kludge!
Affected #: 2 files
diff -r 5d8139e5f462fe4025571b1222ce2998a50ebe7a -r 19ea225452bfd85a51b401afa0a1aa77c8b3a0f6 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -124,23 +124,12 @@
height = font->ascent + font->descent;
width = gdk_text_width (font, text, len);
if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y-height+2, width, height-1);
+ /* The rectangle and text areas don't quite fit, so I have to the
+ te height a little --jsparkes */
+ gdk_draw_rectangle (drawable, bgc, TRUE, x, y-height+3, width, height);
gdk_draw_text (drawable, font, gc, x, y, text, len);
#endif
}
-
-static void
-gdk_draw_text_char (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, gchar blank)
-{
- int width = -1;
- int height = font->ascent + font->descent;
-
- width = gdk_text_width (font, &blank, 1);
- if (bgc != 0)
- gdk_draw_rectangle (drawable, bgc, TRUE, x, y-height+1, width, height);
- gdk_draw_text (drawable, font, gc, x, y, &blank, 1);
-}
static void
our_draw_bitmap (GdkDrawable *drawable,
diff -r 5d8139e5f462fe4025571b1222ce2998a50ebe7a -r 19ea225452bfd85a51b401afa0a1aa77c8b3a0f6 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -663,14 +663,11 @@
}
else
{
- XLIKE_output_cursor (w, dl, xpos, findex, cursor_width,
- rb->object.chr.ch);
-
- // Dynarr_add (buf, rb->object.chr.ch);
- //XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos,
- // rb->width, findex, 1,
- // cursor_start, cursor_width,
- // cursor_height);
+ Dynarr_add (buf, rb->object.chr.ch);
+ XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos,
+ rb->width, findex, 1,
+ cursor_start, cursor_width,
+ cursor_height);
Dynarr_reset (buf);
}
@@ -988,10 +985,6 @@
gdk_draw_text_image (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
GdkGC *bgc, gint x, gint y, gchar *text, gint len);
-static void
-gdk_draw_text_char (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
- GdkGC *bgc, gint x, gint y, gchar blank);
-
#endif /* THIS_IS_GTK */
void
XLIKE_output_string (struct window *w, struct display_line *dl,
@@ -1116,6 +1109,12 @@
nruns = separate_textual_runs (text_storage, runs, Dynarr_begin (buf),
Dynarr_length (buf), cachel);
+#ifdef THIS_IS_GTK
+ /* XXX Horrible kludge to force display of the only block cursor
+ I can get to work correctly! -- jsparkes */
+ if (NILP (bar_cursor_value))
+ focus = 0;
+#endif
for (i = 0; i < nruns; i++)
{
Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset);
@@ -1538,6 +1537,7 @@
cgc = XLIKE_get_gc (f, font, cursor_cachel->foreground,
cursor_cachel->background,
Qnil, Qnil, Qnil);
+ gdk_gc_set_function (gc, GDK_COPY);
gdk_draw_text_image (GDK_DRAWABLE (x_win),
FONT_INSTANCE_GTK_FONT (fi), cgc,
localgc, xpos, dl->ypos, (gchar *)runs[i].ptr,
@@ -1718,11 +1718,11 @@
height, x, y);
#else /* THIS_IS_GTK */
USED (dpy);
- #ifdef JSPARKES
+#ifdef JSPARKES
gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc,
IMAGE_INSTANCE_GTK_PIXMAP (p),
xoffset, yoffset, x, y, width, height);
- #endif
+#endif
#endif /* THIS_IS_GTK */
}
else
@@ -2158,77 +2158,6 @@
}
static void
-XLIKE_output_cursor (struct window *w, struct display_line *dl, int xpos,
- face_index findex, int width, char ch)
-{
- struct frame *f = XFRAME (w->frame);
- struct device *d = XDEVICE (f->device);
- Lisp_Object window;
-
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
- XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
- XLIKE_GC gc = NULL;
- face_index elt = get_builtin_face_cache_index (w, Vtext_cursor_face);
- struct face_cachel *cursor_cachel = WINDOW_FACE_CACHEL (w, elt);
-
- int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
- Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
- WINDOW_BUFFER (w));
-
- int x = xpos;
- int y = XLIKE_DISPLAY_LINE_YPOS (dl);
- int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
- int cursor_height, cursor_y;
- int defheight, defascent;
-
- window = wrap_window (w);
- redisplay_clear_region (window, findex, x, y, width, height);
-
- if (NILP (w->text_cursor_visible_p))
- return;
-
- gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
- Qnil, Qnil, Qnil);
-
- default_face_font_info (window, &defascent, 0, 0, &defheight, 0);
-
- /* make sure the cursor is entirely contained between y and y+height */
- cursor_height = min (defheight, height) - 2;
- cursor_y = max (y, min (y + height - cursor_height,
- dl->ypos - defascent));
-
- if (focus)
- {
-#ifdef HAVE_XIM
- XIM_SetSpotLocation (f, x - 2 , cursor_y + cursor_height - 2);
-#endif /* HAVE_XIM */
-
- if (NILP (bar_cursor_value))
- {
- XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, cursor_y, width,
- cursor_height);
- }
- else
- {
- int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
-
- gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
- Qnil, Qnil,
- make_int (bar_width));
- XLIKE_DRAW_LINE (dpy, x_win, gc, x + bar_width - 1, cursor_y,
- x + bar_width - 1, cursor_y + cursor_height - 1);
- }
- }
- else if (NILP (bar_cursor_value))
- {
- XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, x, cursor_y+1, width - 1,
- cursor_height - 1);
- }
- // gdk_draw_text_image (GDK_DRAWABLE (x_win), FONT_INSTANCE_GTK_FONT (fi), gc, bgc,
- // x, cursor_y + 1, dl->xpos, 1);
-}
-
-static void
XLIKE_clear_frame_window (Lisp_Object window)
{
struct window *w = XWINDOW (window);
https://bitbucket.org/xemacs/xemacs/commits/bfe72acd5a24/
Changeset: bfe72acd5a24
User: jsparkes
Date: 2010-05-17 11:31:26+00:00
Summary: Enable draw pixmap. Draw bitmap isn't working yet.
Affected #: 2 files
diff -r 19ea225452bfd85a51b401afa0a1aa77c8b3a0f6 -r bfe72acd5a241504dbef8ab6b9712c3fa034eae6 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,7 +1,19 @@
+2010-05-17 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-xlike-inc.c (XLIKE_output_xlike_pixmap):
+ Enable gdk_draw_pixmap, it tests okay. Drawing a bitmap
+ still needs work.
+
2010-05-16 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-xlike-inc.c (XLIKE_output_string):
+ Force outline cursor to be used for block mode cursor display,
+ since I can't make the regular one work correctly. Remove
+ gdk_draw_text_char.
+
* redisplay-gtk.c (gdk_draw_text_image):
- Shrink the cursor rectangle to avoid left over lines.
+ Shrink the cursor rectangle to avoid left over lines. Remove
+ gdk_draw_text_char.
2010-05-14 Jeff Sparkes <jsparkes(a)gmail.com>
diff -r 19ea225452bfd85a51b401afa0a1aa77c8b3a0f6 -r bfe72acd5a241504dbef8ab6b9712c3fa034eae6 src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -1660,7 +1660,7 @@
{
struct device *d = XDEVICE (f->device);
XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
- /* XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f); */
+ XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
XLIKE_GC gc;
XLIKE_GCVALUES gcv;
unsigned long pixmap_mask;
@@ -1718,11 +1718,9 @@
height, x, y);
#else /* THIS_IS_GTK */
USED (dpy);
-#ifdef JSPARKES
gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc,
IMAGE_INSTANCE_GTK_PIXMAP (p),
xoffset, yoffset, x, y, width, height);
-#endif
#endif /* THIS_IS_GTK */
}
else
@@ -1733,11 +1731,11 @@
xoffset, yoffset, width, height, x, y, 1L);
#else /* THIS_IS_GTK */
USED (dpy);
- #ifdef JSPARKES
+#ifdef JSPARKES
our_draw_bitmap (GDK_DRAWABLE (x_win), gc,
IMAGE_INSTANCE_GTK_PIXMAP (p),
xoffset, yoffset, x, y, width, height);
- #endif
+#endif
#endif /* THIS_IS_GTK */
}
}
https://bitbucket.org/xemacs/xemacs/commits/59b24c257f87/
Changeset: 59b24c257f87
User: jsparkes
Date: 2010-05-19 01:44:21+00:00
Summary: Add PangoContext slot to gtk device.
Affected #: 3 files
diff -r bfe72acd5a241504dbef8ab6b9712c3fa034eae6 -r 59b24c257f87d2c52c573840d42ed987262842f1 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,12 @@
+2010-05-18 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * console-gtk-impl.h (struct gtk_device):
+ Add pango context slot to device and accessor macro.
+
+ * device-gtk.c (gtk_init_device):
+ Set up pango context for device ifdef HAVE_PANGO. Using a pango
+ xft context.
+
2010-05-17 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-xlike-inc.c (XLIKE_output_xlike_pixmap):
diff -r bfe72acd5a241504dbef8ab6b9712c3fa034eae6 -r 59b24c257f87d2c52c573840d42ed987262842f1 src/console-gtk-impl.h
--- a/src/console-gtk-impl.h
+++ b/src/console-gtk-impl.h
@@ -135,7 +135,9 @@
#define DEVICE_GTK_VISUAL(d) (DEVICE_GTK_DATA (d)->visual)
#define DEVICE_GTK_DEPTH(d) (DEVICE_GTK_DATA (d)->depth)
#define DEVICE_GTK_COLORMAP(d) (DEVICE_GTK_DATA (d)->device_cmap)
+#ifdef USE_PANGO
#define DEVICE_GTK_CONTEXT(d) (DEVICE_GTK_DATA (d)->context)
+#endif
#define DEVICE_GTK_APP_SHELL(d) (DEVICE_GTK_DATA (d)->gtk_app_shell)
#define DEVICE_GTK_GC_CACHE(d) (DEVICE_GTK_DATA (d)->gc_cache)
#define DEVICE_GTK_GRAY_PIXMAP(d) (DEVICE_GTK_DATA (d)->gray_pixmap)
diff -r bfe72acd5a241504dbef8ab6b9712c3fa034eae6 -r 59b24c257f87d2c52c573840d42ed987262842f1 src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -299,12 +299,17 @@
/* Should this be easier to figure out? --jsparkes */
{
#ifdef USE_PANGO
- GdkDisplay *disp = gdk_display_get_default ();
- GdkScreen *screen = gdk_display_get_default_screen (disp);
- PangoFontMap *fmap = pango_xft_get_font_map(disp, screen);
- DEVICE_GTK_CONTEXT (d) = pango_font_map_create_context(fmap);
- // DEVICE_GTK_CONTEXT (d) = pango_xft_get_context (display, 0);
- DEVICE_GTK_CONTEXT (d) = pango_context_new ();
+ PangoFontDescription *pango_desc;
+ Display *disp = GDK_DRAWABLE_XDISPLAY (drawable);
+ int screen = GDK_SCREEN_XNUMBER (gdk_drawable_get_screen (drawable));
+
+ context = pango_xft_get_context (display, screen);
+ pango_desc = pango_font_description_new ();
+/* pango_desc = pango_font_description_from_string ("monospace 12"); */
+ pango_font_description_set_family (pango_desc, extname);
+/* pango_font_description_set_size (pango_desc, 12); */
+
+ DEVICE_GTK_CONTEXT (d) = context;
assert (DEVICE_GTK_CONTEXT (d) != NULL);
#endif
}
@@ -689,7 +694,12 @@
#undef FROB_COLOR
result = nconc2 (result, list2 (Qfont,
- convert_font (gtk_style_get_font (style))));
+#ifdef USE_PANGO
+ build_cistring (pango_font_description_to_string (style->font_desc))
+#else
+ convert_font (style->font_desc)
+#endif
+ ));
#define FROB_PIXMAP(state) (style->rc_style->bg_pixmap_name[state] ? build_cistring (style->rc_style->bg_pixmap_name[state]) : Qnil)
https://bitbucket.org/xemacs/xemacs/commits/2696ff7fb114/
Changeset: 2696ff7fb114
User: jsparkes
Date: 2010-05-19 01:49:14+00:00
Summary: We can only return the fontname in the style description for pango fonts.
Affected #: 2 files
diff -r 59b24c257f87d2c52c573840d42ed987262842f1 -r 2696ff7fb114c1d878f75cc8b0b81e19873fbc9e src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-05-18 Jeff Sparkes <jsparkes(a)gmail.com>
+ * device-gtk.c (Fgtk_style_info): Can only determine font
+ name using pango.
+
* console-gtk-impl.h (struct gtk_device):
Add pango context slot to device and accessor macro.
diff -r 59b24c257f87d2c52c573840d42ed987262842f1 -r 2696ff7fb114c1d878f75cc8b0b81e19873fbc9e src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -693,14 +693,13 @@
FROB_COLOR (base, "base");
#undef FROB_COLOR
+#ifdef USE_PANGO
result = nconc2 (result, list2 (Qfont,
-#ifdef USE_PANGO
build_cistring (pango_font_description_to_string (style->font_desc))
-#else
- convert_font (style->font_desc)
+ /* convert_font (style->font_desc) */
+ ));
#endif
- ));
-
+
#define FROB_PIXMAP(state) (style->rc_style->bg_pixmap_name[state] ? build_cistring (style->rc_style->bg_pixmap_name[state]) : Qnil)
if (style->rc_style)
https://bitbucket.org/xemacs/xemacs/commits/d5fd0d1a4885/
Changeset: d5fd0d1a4885
User: jsparkes
Date: 2010-05-19 01:52:56+00:00
Summary: Start of font loading code for Pango.
Affected #: 2 files
diff -r 2696ff7fb114c1d878f75cc8b0b81e19873fbc9e -r d5fd0d1a48852665ee89b44b2adc2372751170cd src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-05-18 Jeff Sparkes <jsparkes(a)gmail.com>
+ * fontcolor-gtk.c (gtk_initialize_font_instance):
+ Add USE_PANGO code.
+
* device-gtk.c (Fgtk_style_info): Can only determine font
name using pango.
diff -r 2696ff7fb114c1d878f75cc8b0b81e19873fbc9e -r d5fd0d1a48852665ee89b44b2adc2372751170cd src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -233,24 +233,33 @@
Lisp_Object UNUSED (name),
Lisp_Object UNUSED (device), Error_Behavior errb)
{
- GdkFont *gf;
const char *extname;
#ifdef USE_PANGO
PangoFontDescription *pango_desc;
+ //Display *disp = GDK_DRAWABLE_XDISPLAY (drawable);
+ //int screen = GDK_SCREEN_XNUMBER (gdk_drawable_get_screen (drawable));
+ PangoFont *gf;
+#else
+ GdkFont *gf;
#endif
+
+
extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
- /* Load font or fontset? */
#ifdef USE_PANGO
- pango_desc = pango_font_description_new ();
- pango_font_description_set_family (pango_desc, extname);
+ //context = pango_xft_get_context (display, screen);
+ pango_desc = pango_font_description_from_string ("monospace 12");
+ //pango_font_description_set_family (pango_desc, extname);
pango_font_description_set_size (pango_desc, 12);
+ gf = pango_load_font (pango_desc);
char *nm = pango_font_description_to_string (pango_desc);
+
#else
/* Loading a fontset gives a lot of warning about missing charsets,
including iso-8859-1. We probably require a font map as well. */
/* gf = gdk_fontset_load (extname); */
gf = gdk_font_load (extname);
+
#endif
if (!gf)
@@ -259,7 +268,9 @@
Qfont, errb);
return 0;
}
-
+#ifdef USE_PANGO
+ debug_out ("loaded font %s\n", nm);
+#endif
/* Don't allocate the data until we're sure that we will succeed,
or the finalize method may get fucked. */
f->data = xnew (struct gtk_font_instance_data);
https://bitbucket.org/xemacs/xemacs/commits/7aa02062300d/
Changeset: 7aa02062300d
User: jsparkes
Date: 2010-05-19 01:55:00+00:00
Summary: Remove duplicate image hash function.
Affected #: 2 files
diff -r d5fd0d1a48852665ee89b44b2adc2372751170cd -r 7aa02062300d5fa0f57c1ad806a9aea2f50cbbdd src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-05-18 Jeff Sparkes <jsparkes(a)gmail.com>
+ * glyphs.c (image_instance_hash):
+ Remove duplicate hash functions.
+
* fontcolor-gtk.c (gtk_initialize_font_instance):
Add USE_PANGO code.
diff -r d5fd0d1a48852665ee89b44b2adc2372751170cd -r 7aa02062300d5fa0f57c1ad806a9aea2f50cbbdd src/glyphs.c
--- a/src/glyphs.c
+++ b/src/glyphs.c
@@ -1260,7 +1260,7 @@
}
static Hashcode
-image_instance_hash (Lisp_Object obj, int depth)
+image_instance_hash (Lisp_Object obj, int depth, Boolint UNUSED (equalp))
{
Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj);
Hashcode hash = HASH5 (LISP_HASH (IMAGE_INSTANCE_DOMAIN (i)),
@@ -1316,12 +1316,6 @@
0));
}
-static Hashcode
-image_instance_hash (Lisp_Object obj, int depth, Boolint UNUSED (equalp))
-{
- return image_instance_hash (obj, depth, 0);
-}
-
DEFINE_NODUMP_LISP_OBJECT ("image-instance", image_instance,
mark_image_instance, print_image_instance,
finalize_image_instance, image_instance_equal,
https://bitbucket.org/xemacs/xemacs/commits/97d20c20469d/
Changeset: 97d20c20469d
User: jsparkes
Date: 2010-05-19 01:58:00+00:00
Summary: Set continuous update flag to try to fix scrollbar drag.
Affected #: 2 files
diff -r 7aa02062300d5fa0f57c1ad806a9aea2f50cbbdd -r 97d20c20469dc20f9c5624d7835dddd6264233e7 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-05-18 Jeff Sparkes <jsparkes(a)gmail.com>
+ * scrollbar-gtk.c (gtk_create_scrollbar_instance):
+ Set continuous update flag to try to fix scrollbar drag.
+
* glyphs.c (image_instance_hash):
Remove duplicate hash functions.
diff -r 7aa02062300d5fa0f57c1ad806a9aea2f50cbbdd -r 97d20c20469dc20f9c5624d7835dddd6264233e7 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -111,6 +111,7 @@
sb = GTK_SCROLLBAR (vertical ? gtk_vscrollbar_new (adj) : gtk_hscrollbar_new (adj));
SCROLLBAR_GTK_WIDGET (instance) = GTK_WIDGET (sb);
+ gtk_range_set_update_policy (GTK_RANGE (sb), GTK_UPDATE_CONTINUOUS);
assert(g_signal_connect (GTK_OBJECT (sb),"change-value",
G_CALLBACK (scrollbar_cb), (gpointer) vertical));
https://bitbucket.org/xemacs/xemacs/commits/96df44d07e18/
Changeset: 96df44d07e18
User: jsparkes
Date: 2010-05-19 08:56:27+00:00
Summary: Merge from main branch.
Affected #: 15 files
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,18 @@
+2010-05-16 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * files.el (default-file-system-ignore-case):
+ Move this to fileio.c, where it's a constant boolean variable
+ initialised at dump time.
+
+2010-04-29 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cmdloop.el (suggest-key-bindings):
+ Make this available, documenting that it's for GNU Emacs
+ compatibility.
+ Implement it in terms of teach-extended-commands-p and
+ teach-extended-commands-timeout, using Ben's
+ set-symbol-value-handler functionality.
+
2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
* loadup.el (load-history): Be a bit more discriminate in the
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 lisp/cmdloop.el
--- a/lisp/cmdloop.el
+++ b/lisp/cmdloop.el
@@ -301,16 +301,31 @@
:group 'keyboard)
;That damn RMS went off and implemented something differently, after
-;we had already implemented it. We can't support both properly until
-;we have Lisp magic variables.
-;(defvar suggest-key-bindings t
-; "*FSFmacs equivalent of `teach-extended-commands-*'.
-;Provided for compatibility only.
-;Non-nil means show the equivalent key-binding when M-x command has one.
-;The value can be a length of time to show the message for.
-;If the value is non-nil and not a number, we wait 2 seconds.")
-;
-;(make-obsolete-variable 'suggest-key-bindings 'teach-extended-commands-p)
+;we had already implemented it.
+(defcustom suggest-key-bindings t
+ "*FSFmacs equivalent of `teach-extended-commands-p'.
+Provided for compatibility only.
+Non-nil means show the equivalent key-binding when M-x command has one.
+The value can be a length of time to show the message for, in seconds.
+
+If the value is non-nil and not a number, we wait the number of seconds
+specified by `teach-extended-commands-timeout'."
+ :type '(choice
+ (const :tag "off" nil)
+ (integer :tag "time" 2)
+ (other :tag "on")))
+
+(dontusethis-set-symbol-value-handler
+ 'suggest-key-bindings
+ 'set-value
+ #'(lambda (sym args fun harg handler)
+ (setq args (car args))
+ (if (null args)
+ (setq teach-extended-commands-p nil)
+ (setq teach-extended-commands-p t
+ teach-extended-commands-timeout
+ (or (and (integerp args) args)
+ (and args teach-extended-commands-timeout))))))
(defun execute-extended-command (prefix-arg)
"Read a command name from the minibuffer using 'completing-read'.
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 lisp/files.el
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4515,17 +4515,8 @@
;; END SYNC WITH FSF 21.2.
-;; XEmacs:
-(defvar default-file-system-ignore-case (and
- (memq system-type '(windows-nt
- cygwin32
- darwin))
- t)
- "What `file-system-ignore-case-p' returns by default.
-This is in the case that nothing in `file-system-case-alist' matches.")
-
-;; Question; do any of the Linuxes mount Windows partitions in a fixed
-;; place?
+;; XEmacs. Question; do any of the Linuxes mount Windows partitions in
+;; a fixed place?
(defvar file-system-case-alist nil
"Alist to decide where file name case is significant.
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 lisp/obsolete.el
--- a/lisp/obsolete.el
+++ b/lisp/obsolete.el
@@ -273,6 +273,8 @@
parent)
(make-compatible 'set-keymap-parent 'set-keymap-parents)
+(make-compatible-variable 'suggest-key-bindings 'teach-extended-commands-p)
+
;; too bad there's not a way to check for aref, assq, and nconc
;; being called on the values of functions known to return keymaps,
;; or known to return vectors of events instead of strings...
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,39 @@
+2010-05-16 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ Move `default-file-system-ignore-case' to C; pay attention to it
+ in creating the directory hash tables for #'locate-file. Fix a bug
+ where #'eq was specified when creating directory hash tables in
+ dired.c.
+
+ * config.h.in (DEFAULT_FILE_SYSTEM_IGNORE_CASE): This is 1 on
+ Darwin.
+ * dired.c (make_directory_hash_table): If
+ #'file-system-ignore-case-p gives non-nil for a directory, created
+ the associated hash table with #'equalp as its test. Never use
+ #'eq as a directory hash table test.
+ * fileio.c (vars_of_fileio):
+ Move `default-file-system-ignore-case' here, so it can be a
+ constant boolean reflecting a compile-time #define.
+ * lisp.h: Update the declaration of make_directory_hash_table;
+ remove the declaration of wasteful_word_to_lisp, which was
+ #ifdef'd out.
+ * lread.c (Flocate_file): Take out a debugging statement from
+ this function.
+ (locate_file_refresh_hashing): Call make_directory_hash_table with
+ a Lisp string, not an Ibyte pointer.
+ (vars_of_lread): If DEFAULT_FILE_SYSTEM_IGNORE_CASE is defined,
+ use #'equalp as the hash table test for locate-file-hash-table,
+ not #'equal.
+ * s/win32-common.h (DEFAULT_FILE_SYSTEM_IGNORE_CASE):
+ Case should normally be ignored in file names on Win32.
+
+2010-04-29 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * eval.c (Fquote, Ffunction): Error on more than one argument to
+ these special operators.
+ * data.c (syms_of_data): Move Qquote to general-slots.h from this
+ file, now it's used in eval.c
+
2010-04-17 Aidan Kehoe <kehoea(a)parhasard.net>
* doc.c (Fdocumentation):
@@ -130,6 +166,12 @@
various hash methods with the correct number of arguments, fixing
the Win32 build. Thank you Vin.
+2010-04-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * frame.c (print_frame):
+ When printing a frame, print its device, making the output of
+ #'frame-list a lot more helpful if using gnuclient.
+
2010-04-04 Ben Wing <ben(a)xemacs.org>
* font-mgr.c:
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/config.h.in
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -339,6 +339,7 @@
/* Darwin; realpath corrects for case: */
#ifdef HAVE_DYLD
#define REALPATH_CORRECTS_CASE 1
+#define DEFAULT_FILE_SYSTEM_IGNORE_CASE 1
#endif
#undef HAVE_LIBINTL
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/data.c
--- a/src/data.c
+++ b/src/data.c
@@ -34,7 +34,7 @@
#include "syssignal.h"
#include "sysfloat.h"
-Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
+Lisp_Object Qnil, Qt, Qlambda, Qunbound;
Lisp_Object Qerror_conditions, Qerror_message;
Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax;
Lisp_Object Qlist_formation_error, Qstructure_formation_error;
@@ -3516,7 +3516,6 @@
INIT_LISP_OBJECT (ephemeron);
INIT_LISP_OBJECT (weak_box);
- DEFSYMBOL (Qquote);
DEFSYMBOL (Qlambda);
DEFSYMBOL (Qlistp);
DEFSYMBOL (Qtrue_list_p);
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/dired.c
--- a/src/dired.c
+++ b/src/dired.c
@@ -46,6 +46,7 @@
Lisp_Object Qfile_name_completion;
Lisp_Object Qfile_name_all_completions;
Lisp_Object Qfile_attributes;
+Lisp_Object Qfile_system_ignore_case_p;
static Lisp_Object
close_directory_unwind (Lisp_Object unwind_obj)
@@ -777,14 +778,21 @@
Lisp_Object
-make_directory_hash_table (const Ibyte *path)
+make_directory_hash_table (Lisp_Object path)
{
DIR *d;
- if ((d = qxe_opendir (path)))
+ if ((d = qxe_opendir (XSTRING_DATA (path))))
{
+ Lisp_Object hash_table_test = Qequal, hash = Qnil;
DIRENTRY *dp;
- Lisp_Object hash =
- make_lisp_hash_table (20, HASH_TABLE_NON_WEAK, Qeq);
+
+ if (!UNBOUNDP (XSYMBOL_FUNCTION (Qfile_system_ignore_case_p))
+ && !NILP (call1 (Qfile_system_ignore_case_p, path)))
+ {
+ hash_table_test = Qequalp;
+ }
+
+ hash = make_lisp_hash_table (20, HASH_TABLE_NON_WEAK, hash_table_test);
while ((dp = qxe_readdir (d)))
{
@@ -942,6 +950,7 @@
DEFSYMBOL (Qfile_name_completion);
DEFSYMBOL (Qfile_name_all_completions);
DEFSYMBOL (Qfile_attributes);
+ DEFSYMBOL (Qfile_system_ignore_case_p);
DEFSUBR (Fdirectory_files);
DEFSUBR (Ffile_name_completion);
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/eval.c
--- a/src/eval.c
+++ b/src/eval.c
@@ -1273,6 +1273,15 @@
*/
(args))
{
+ int nargs;
+
+ GET_LIST_LENGTH (args, nargs);
+ if (nargs != 1)
+ {
+ Fsignal (Qwrong_number_of_arguments,
+ list2 (Qquote, make_int (nargs)));
+ }
+
return XCAR (args);
}
@@ -1344,6 +1353,15 @@
*/
(args))
{
+ int nargs;
+
+ GET_LIST_LENGTH (args, nargs);
+ if (nargs != 1)
+ {
+ Fsignal (Qwrong_number_of_arguments,
+ list2 (Qfunction, make_int (nargs)));
+ }
+
return XCAR (args);
}
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/fileio.c
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -108,6 +108,8 @@
Lisp_Object Vdirectory_sep_char;
+int default_file_system_ignore_case;
+
#ifdef HAVE_FSYNC
/* Nonzero means skip the call to fsync in Fwrite-region. */
int write_region_inhibit_fsync;
@@ -4560,6 +4562,16 @@
what the normal separator is.
*/ );
Vdirectory_sep_char = make_char (DEFAULT_DIRECTORY_SEP);
+
+ DEFVAR_CONST_BOOL ("default-file-system-ignore-case", &default_file_system_ignore_case /*
+What `file-system-ignore-case-p' returns by default.
+This is in the case that nothing in `file-system-case-alist' matches.
+*/ );
+#ifdef DEFAULT_FILE_SYSTEM_IGNORE_CASE
+ default_file_system_ignore_case = DEFAULT_FILE_SYSTEM_IGNORE_CASE;
+#else
+ default_file_system_ignore_case = 0;
+#endif
}
void
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/frame.c
--- a/src/frame.c
+++ b/src/frame.c
@@ -642,6 +642,8 @@
write_fmt_string (printcharfun, "#<%s-frame ", !FRAME_LIVE_P (frm) ? "dead" :
FRAME_TYPE_NAME (frm));
print_internal (frm->name, printcharfun, 1);
+ write_ascstring (printcharfun, " on ");
+ print_internal (frm->device, printcharfun, 0);
write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj));
}
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/general-slots.h
--- a/src/general-slots.h
+++ b/src/general-slots.h
@@ -240,6 +240,7 @@
SYMBOL (Qquery_coding_warning_face);
SYMBOL (Qquestion);
SYMBOL_KEYWORD (Q_question);
+SYMBOL (Qquote);
SYMBOL (Qradio);
SYMBOL (Qrassoc);
SYMBOL (Qrassq);
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/lisp.h
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4504,8 +4504,7 @@
extern Lisp_Object Vx_initial_argv_list;
/* Defined in dired.c */
-Lisp_Object make_directory_hash_table (const Ibyte *);
-Lisp_Object wasteful_word_to_lisp (unsigned int);
+Lisp_Object make_directory_hash_table (Lisp_Object);
/* Defined in doc.c */
EXFUN (Fsubstitute_command_keys, 1);
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/lread.c
--- a/src/lread.c
+++ b/src/lread.c
@@ -894,9 +894,6 @@
{
/* This function can GC */
Lisp_Object tp;
- static int locate_file_called;
-
- ++locate_file_called;
CHECK_STRING (filename);
@@ -918,8 +915,7 @@
static Lisp_Object
locate_file_refresh_hashing (Lisp_Object directory)
{
- Lisp_Object hash =
- make_directory_hash_table (XSTRING_DATA (directory));
+ Lisp_Object hash = make_directory_hash_table (directory);
if (!NILP (hash))
Fputhash (directory, hash, Vlocate_file_hash_table);
@@ -3483,7 +3479,12 @@
Vlocate_file_hash_table = make_lisp_hash_table (200,
HASH_TABLE_NON_WEAK,
- Qequal);
+#ifdef DEFAULT_FILE_SYSTEM_IGNORE_CASE
+ Qequalp
+#else
+ Qequal
+#endif
+ );
staticpro (&Vlocate_file_hash_table);
#ifdef DEBUG_XEMACS
symbol_value (XSYMBOL (intern ("Vlocate-file-hash-table")))
diff -r 97d20c20469dc20f9c5624d7835dddd6264233e7 -r 96df44d07e180b2a863897ec18c80e29d6c89c36 src/s/win32-common.h
--- a/src/s/win32-common.h
+++ b/src/s/win32-common.h
@@ -30,3 +30,5 @@
/* Define an identifier for all MS Windows systems -- Cygwin, native, MinGW */
#define WIN32_ANY
+
+#define DEFAULT_FILE_SYSTEM_IGNORE_CASE 1
https://bitbucket.org/xemacs/xemacs/commits/6a9200beef5d/
Changeset: 6a9200beef5d
User: jsparkes
Date: 2010-05-19 09:55:30+00:00
Summary: Use GQuarks instead of text keys for attaching data to widgets.
Affected #: 2 files
diff -r 96df44d07e180b2a863897ec18c80e29d6c89c36 -r 6a9200beef5dd3ad06ab47614abddb9529a2ac19 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,8 @@
+2010-05-19 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * menubar-gtk.c: Use GQuarks instead of text keys for attaching
+ data to widgets.
+
2010-05-18 Jeff Sparkes <jsparkes(a)gmail.com>
* scrollbar-gtk.c (gtk_create_scrollbar_instance):
diff -r 96df44d07e180b2a863897ec18c80e29d6c89c36 -r 6a9200beef5dd3ad06ab47614abddb9529a2ac19 src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -49,6 +49,16 @@
#define SUBMENU_TYPE 1
#define POPUP_TYPE 2
+static GQuark XEMACS_MENU_DESCR_TAG =
+ g_quark_from_string ("xemacs::menu::description");
+static GQuark XEMACS_MENU_FILTER_TAG =
+ g_quark_from_string ("xemacs::menu::filter");
+static GQuark XEMACS_MENU_GUIID_TAG =
+ g_quark_from_string ("xemacs::menu::gui_id");
+static GQuark XEMACS_MENU_FIRSTTIME_TAG =
+ g_quark_from_string ("xemacs::menu::first_time");
+
+
static GtkWidget *menu_descriptor_to_widget_1 (Lisp_Object descr, GtkAccelGroup* accel_group);
#define FRAME_GTK_MENUBAR_DATA(f) (FRAME_GTK_DATA (f)->menubar_data)
@@ -154,9 +164,7 @@
gtk_xemacs_menubar_new (struct frame *f)
{
GtkXEmacsMenubar *menubar = (GtkXEmacsMenubar*) gtk_type_new (gtk_xemacs_menubar_get_type ());
-
menubar->frame = f;
-
return (GTK_WIDGET (menubar));
}
@@ -300,11 +308,6 @@
return Qnil;
}
-#define XEMACS_MENU_DESCR_TAG g_quark_from_string ("xemacs::menu::description")
-#define XEMACS_MENU_FILTER_TAG "xemacs::menu::filter"
-#define XEMACS_MENU_GUIID_TAG "xemacs::menu::gui_id"
-#define XEMACS_MENU_FIRSTTIME_TAG "xemacs::menu::first_time"
-
static void __activate_menu(GtkMenuItem *, gpointer);
#ifdef TEAR_OFF_MENUS
@@ -320,7 +323,7 @@
Lisp_Object menu_desc = Qnil;
GtkWidget *old_submenu = GTK_MENU_ITEM (menu_item)->submenu;
- menu_desc = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
+ menu_desc = GET_LISP_FROM_VOID (gtk_object_get_qdata (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
/* GCPRO all of our very own */
gcpro_popup_callbacks (id, menu_desc);
@@ -368,9 +371,9 @@
__activate_menu(GtkMenuItem *item, gpointer user_data)
{
Lisp_Object desc;
- gpointer force_clear = gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG);
+ gpointer force_clear = g_object_get_qdata (G_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG);
- gtk_object_set_data (GTK_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG, 0x00);
+ g_object_set_qdata (G_OBJECT (item), XEMACS_MENU_FIRSTTIME_TAG, 0x00);
/* Delete the old contents of the menu if we are the top level menubar */
if (GTK_IS_MENU_BAR (GTK_WIDGET (item)->parent) || force_clear)
@@ -400,11 +403,11 @@
if (user_data)
{
- GUI_ID id = (GUI_ID) GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_GUIID_TAG));
+ GUI_ID id = (GUI_ID) GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (item), XEMACS_MENU_GUIID_TAG));
Lisp_Object hook_fn;
struct gcpro gcpro1, gcpro2;
- hook_fn = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FILTER_TAG));
+ hook_fn = GET_LISP_FROM_VOID (g_object_get_qdata (G_OBJECT (item), XEMACS_MENU_FILTER_TAG));
GCPRO2 (desc, hook_fn);
@@ -621,7 +624,7 @@
{
GtkWidget *bogus_item = gtk_menu_item_new_with_label ("A suitably long label here...");
- gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FIRSTTIME_TAG, (gpointer)0x01);
+ g_object_set_qdata (G_OBJECT (menu_item), XEMACS_MENU_FIRSTTIME_TAG, (gpointer)0x01);
gtk_widget_show_all (bogus_item);
gtk_menu_append (GTK_MENU (submenu), bogus_item);
}
@@ -664,7 +667,7 @@
}
g_object_set_qdata (G_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, STORE_LISP_IN_VOID (desc));
- gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG, STORE_LISP_IN_VOID (hook_fn));
+ g_object_set_qdata (G_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG, STORE_LISP_IN_VOID (hook_fn));
if ((!NILP (config_tag)
&& NILP (Fmemq (config_tag, Vmenubar_configuration)))
@@ -690,7 +693,7 @@
*/
if (reuse)
{
- gpointer id = gtk_object_get_data (GTK_OBJECT (reuse), XEMACS_MENU_GUIID_TAG);
+ gpointer id = g_object_get_qdata (G_OBJECT (reuse), XEMACS_MENU_GUIID_TAG);
if (id)
{
@@ -721,7 +724,7 @@
{
GUI_ID id = new_gui_id ();
- gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_GUIID_TAG,
+ g_object_set_qdata (G_OBJECT (menu_item), XEMACS_MENU_GUIID_TAG,
(gpointer) id);
/* Make sure we gcpro the menu descriptions */
@@ -1093,7 +1096,7 @@
gboolean right_justify = FALSE;
Lisp_Object value = descr;
GtkWidget *menubar = FRAME_GTK_MENUBAR_WIDGET (f);
- GUI_ID id = (GUI_ID) GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG));
+ GUI_ID id = (GUI_ID) GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (menubar), XEMACS_MENU_GUIID_TAG));
guint menu_position = 0;
GtkAccelGroup *menubar_accel_group;
@@ -1240,7 +1243,7 @@
GTK_SIGNAL_FUNC (run_menubar_hook), NULL);
FRAME_GTK_MENUBAR_WIDGET (f) = menubar;
- gtk_object_set_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG, (gpointer) id);
+ g_object_set_qdata (G_OBJECT (menubar), XEMACS_MENU_GUIID_TAG, (gpointer) id);
gtk_object_weakref (GTK_OBJECT (menubar), __remove_gcpro_by_id, (gpointer) id);
}
@@ -1420,7 +1423,7 @@
widget = menu_descriptor_to_widget (menu_desc, NULL);
menu = GTK_MENU_ITEM (widget)->submenu;
gtk_widget_set_name (widget, "XEmacsPopupMenu");
- id = gtk_object_get_data (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG);
+ id = g_object_get_qdata (G_OBJECT (widget), XEMACS_MENU_GUIID_TAG);
__activate_menu (GTK_MENU_ITEM (widget), id);
https://bitbucket.org/xemacs/xemacs/commits/3d69123a1675/
Changeset: 3d69123a1675
User: jsparkes
Date: 2010-05-19 16:32:53+00:00
Summary: Use g_type* functions instead of deprecated gtk_type*
Rename lisp_to_gtk_type to lisp_to_g_value.
Affected #: 3 files
diff -r 6a9200beef5dd3ad06ab47614abddb9529a2ac19 -r 3d69123a167534845e6107a08fc62638627388b9 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,9 @@
2010-05-19 Jeff Sparkes <jsparkes(a)gmail.com>
+ * ui-gtk.c: Use g_type* functions instead of deprecated gtk_type*
+ ones. Rename lisp_to_gtk_type to lisp_to_g_value.
+ * gtk-glue.c: use renamed function.
+
* menubar-gtk.c: Use GQuarks instead of text keys for attaching
data to widgets.
diff -r 6a9200beef5dd3ad06ab47614abddb9529a2ac19 -r 3d69123a167534845e6107a08fc62638627388b9 src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -27,7 +27,7 @@
#include "fontcolor-gtk-impl.h"
#include "frame.h"
-extern int lisp_to_gtk_type (Lisp_Object obj, GValue *arg);
+static int lisp_to_g_value (Lisp_Object obj, GValue *arg);
static GType
xemacs_type_register (const gchar *name, GType parent)
@@ -88,7 +88,7 @@
SAFE_LIST_LOOP_2 (elt, obj)
{
GValue tmp, *copy;
- lisp_to_gtk_type (elt, &tmp);
+ lisp_to_g_value (elt, &tmp);
g_value_copy (&tmp, copy);/* leak XXX */
g_value_array_append (array, copy);
}
@@ -196,8 +196,6 @@
return (rval);
}
-int lisp_to_gtk_type (Lisp_Object obj, GValue *arg);
-
static void
xemacs_list_to_array (Lisp_Object obj, GValue *arg)
{
@@ -216,7 +214,7 @@
LIST_LOOP_3 (elt, obj, tail)
{
g_value_reset (&val);
- lisp_to_gtk_type (elt, &val);
+ lisp_to_g_value (elt, &val);
g_value_array_append (array, &val);
}
diff -r 6a9200beef5dd3ad06ab47614abddb9529a2ac19 -r 3d69123a167534845e6107a08fc62638627388b9 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -54,8 +54,8 @@
static GHashTable *dll_cache;
-Lisp_Object gtk_type_to_lisp (GValue *arg);
-int lisp_to_gtk_type (Lisp_Object obj, GValue *arg);
+static Lisp_Object g_type_to_lisp (GValue *arg);
+static int lisp_to_g_value (Lisp_Object obj, GValue *arg);
#if 0
int lisp_to_gtk_ret_type (Lisp_Object obj, GValue *arg);
void describe_gtk_arg (GType *arg);
@@ -246,7 +246,7 @@
}
#endif
- the_type = gtk_type_parent(the_type);
+ the_type = g_type_parent(the_type);
} while (the_type != G_TYPE_INVALID);
}
@@ -311,7 +311,7 @@
return;
}
- stderr_out ("import_gtk_type %0x %s\n", (unsigned int)t, gtk_type_name(t));
+ stderr_out ("import_gtk_type %d %s\n", (unsigned int)t, g_type_name(t));
if (G_TYPE_IS_FUNDAMENTAL (t))
{
@@ -324,7 +324,7 @@
import_gtk_flags_internal (t);
break;
default:
- stderr_out ("import_gtk_type %s\n", gtk_type_name(t));
+ stderr_out ("import_gtk_type %s\n", g_type_name(t));
// ABORT();
break;
}
@@ -333,7 +333,7 @@
import_gtk_object_internal (t);
else
{
- stderr_out ("import_gtk_type unknown %s\n", gtk_type_name(t));
+ stderr_out ("import_gtk_type unknown %s\n", g_type_name(t));
}
mark_type_as_imported (t);
@@ -347,7 +347,7 @@
Lisp_Object obj = ALLOC_NORMAL_LISP_OBJECT (emacs_ffi);
emacs_ffi_data *data = XFFI (obj);
- data->return_type = GTK_TYPE_NONE;
+ data->return_type = G_TYPE_NONE;
data->n_args = 0;
data->function_name = Qnil;
data->function_ptr = 0;
@@ -541,7 +541,7 @@
case G_TYPE_POINTER:
return (build_ascstring ("POINTER"));
default:
- stderr_out ("type_to_marshaller type %s\n", gtk_type_name(t));
+ stderr_out ("type_to_marshaller type %s\n", g_type_name(t));
ABORT();
/* I can't put this in the main switch statement because it is a
@@ -596,9 +596,9 @@
xemacs_init_gtk_classes ();
g_type_init();
- arg.value_type = gtk_type_from_name ((char *) XSTRING_DATA (type));
+ arg.value_type = g_type_from_name ((char *) XSTRING_DATA (type));
- if (arg.value_type == GTK_TYPE_INVALID)
+ if (arg.value_type == G_TYPE_INVALID)
{
sferror ("Unknown type", type);
}
@@ -622,7 +622,7 @@
ABORT();
//GTK_VALUE_POINTER(arg) = var;
//CONVERT_RETVAL (arg, 0);
- //return (gtk_type_to_lisp (&arg));
+ //return (g_type_to_lisp (&arg));
return Qnil;
}
@@ -691,9 +691,9 @@
type = Fsymbol_name (elt);
- the_type = gtk_type_from_name ((char *) XSTRING_DATA (type));
+ the_type = g_type_from_name ((char *) XSTRING_DATA (type));
- if (the_type == GTK_TYPE_INVALID)
+ if (the_type == G_TYPE_INVALID)
{
invalid_argument ("Unknown argument type", type);
}
@@ -719,9 +719,9 @@
}
rettype = Fsymbol_name (rettype);
- data->return_type = gtk_type_from_name ((char *) XSTRING_DATA (rettype));
+ data->return_type = g_type_from_name ((char *) XSTRING_DATA (rettype));
- if (data->return_type == GTK_TYPE_INVALID)
+ if (data->return_type == G_TYPE_INVALID)
{
invalid_argument ("Unknown return type", rettype);
}
@@ -807,7 +807,7 @@
EXTERNAL_LIST_LOOP_2 (elt, value)
{
g_value_init (&the_args[n_args], XFFI (func)->arg_type[n_args]);
- if (lisp_to_gtk_type (elt, &the_args[n_args]))
+ if (lisp_to_g_value (elt, &the_args[n_args]))
{
/* There was some sort of an error */
gui_error ("Error converting arguments", args);
@@ -819,7 +819,7 @@
/* Now we need to tack on space for a return value, if they have
asked for one */
- if (XFFI (func)->return_type != GTK_TYPE_NONE)
+ if (XFFI (func)->return_type != G_TYPE_NONE)
{
g_value_init (&the_args[n_args], XFFI (func)->return_type);
n_args++;
@@ -827,10 +827,10 @@
//XFFI (func)->marshal ((ffi_actual_function) (XFFI (func)->function_ptr), the_args);
- if (XFFI (func)->return_type != GTK_TYPE_NONE)
+ if (XFFI (func)->return_type != G_TYPE_NONE)
{
//CONVERT_RETVAL (the_args[n_args - 1], 1);
- //retval = gtk_type_to_lisp (&the_args[n_args - 1]);
+ //retval = g_type_to_lisp (&the_args[n_args - 1]);
}
/* Need to free any array or list pointers */
@@ -867,7 +867,7 @@
write_ascstring (printcharfun, "#<GtkObject (");
/* Haven't found alive indicator in 2.X */
if (XGTK_OBJECT (obj)->alive_p)
- write_cistring (printcharfun, gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object)));
+ write_cistring (printcharfun, g_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object)));
else
write_ascstring (printcharfun, "dead");
write_fmt_string (printcharfun, ") %p>", (void *) XGTK_OBJECT (obj)->object);
@@ -906,18 +906,18 @@
g_object_getv (XGTK_OBJECT (obj)->object, 1, args);
- if (args[0].type == GTK_TYPE_INVALID)
+ if (args[0].type == G_TYPE_INVALID)
{
/* If we can't get the attribute, then let the code in Fget know
so it can use the default value supplied by the caller */
return (Qunbound);
}
- rval = gtk_type_to_lisp (&args[0]);
+ rval = g_type_to_lisp (&args[0]);
/* Free up any memory. According to the documentation and Havoc's
book, if the fundamental type of the returned value is
- GTK_TYPE_STRING, GTK_TYPE_BOXED, or GTK_TYPE_ARGS, you are
+ GTK_TYPE_STRING, G_TYPE_BOXED, or G_TYPE_ARGS, you are
responsible for freeing it. */
switch (GTK_FUNDAMENTAL_TYPE (args[0].type))
{
@@ -965,7 +965,7 @@
return (1);
}
- if (lisp_to_gtk_type (value, &arg))
+ if (lisp_to_g_value (value, &arg))
{
gui_error ("Error converting to GType", value);
}
@@ -1026,7 +1026,7 @@
/* We need to keep track of when the object is destroyed so that we
can mark it as dead, otherwise even our print routine (which calls
GTK_OBJECT_TYPE) will crap out and die. This is also used in the
- lisp_to_gtk_type() routine to defend against passing dead objects
+ lisp_to_g_value() routine to defend against passing dead objects
to GTK routines. */
static void
__notice_object_destruction (GtkObject *UNUSED (obj), gpointer user_data)
@@ -1101,7 +1101,7 @@
/* Build up the argument list, lisp style */
for (i = n_args - 1; i >= 0; i--)
{
- arg_list = Fcons (gtk_type_to_lisp (&args[i]), arg_list);
+ arg_list = Fcons (g_type_to_lisp (&args[i]), arg_list);
}
/* We always pass the widget as the first parameter at the very least */
@@ -1116,8 +1116,7 @@
signal_fake_event ();
if (G_VALUE_TYPE (&args[n_args]) != G_TYPE_NONE)
- //lisp_to_gtk_ret_type (rval, &args[n_args]);
- lisp_to_gtk_type (rval, &args[n_args]);
+ lisp_to_g_value (rval, &args[n_args]);
UNGCPRO;
}
@@ -1168,7 +1167,7 @@
}
-/* GTK_TYPE_BOXED wrapper for Emacs lisp */
+/* G_TYPE_BOXED wrapper for Emacs lisp */
static const struct memory_description emacs_gtk_boxed_description [] = {
{ XD_END }
};
@@ -1181,7 +1180,7 @@
printing_unreadable_lisp_object (obj, 0);
write_ascstring (printcharfun, "#<GtkBoxed (");
- write_cistring (printcharfun, gtk_type_name (XGTK_BOXED (obj)->object_type));
+ write_cistring (printcharfun, g_type_name (XGTK_BOXED (obj)->object_type));
write_fmt_string (printcharfun, ") %p>", (void *) XGTK_BOXED (obj)->object);
}
@@ -1213,7 +1212,7 @@
emacs_gtk_boxed_hash,
emacs_gtk_boxed_description,
emacs_gtk_boxed_data);
-/* Currently defined GTK_TYPE_BOXED structures are:
+/* Currently defined G_TYPE_BOXED structures are:
GtkAccelGroup -
GtkSelectionData -
@@ -1281,9 +1280,9 @@
CHECK_STRING (type);
- t = gtk_type_from_name ((char *) XSTRING_DATA (type));
+ t = g_type_from_name ((char *) XSTRING_DATA (type));
- if (t == GTK_TYPE_INVALID)
+ if (t == G_TYPE_INVALID)
{
invalid_argument ("Not a GTK type", type);
}
@@ -1386,7 +1385,7 @@
guint32 *gtk_signals;
guint n_signals;
- klass = (GtkObjectClass *) gtk_type_class (t);
+ klass = (GtkObjectClass *) g_type_class (t);
gtk_signals = klass->signals;
n_signals = klass->nsignals;
@@ -1404,11 +1403,11 @@
for (j = query->nparams - 1; j >= 0; j--)
{
- params = Fcons (intern (gtk_type_name (query->params[j])), params);
+ params = Fcons (intern (g_type_name (query->params[j])), params);
}
}
- signals = Fcons (Fcons (intern (gtk_type_name (query->return_val)),
+ signals = Fcons (Fcons (intern (g_type_name (query->return_val)),
Fcons (intern (query->signal_name),
params)),
signals);
@@ -1418,8 +1417,8 @@
}
}
#endif
- t = gtk_type_parent(t);
- } while (t != GTK_TYPE_INVALID);
+ t = g_type_parent(t);
+ } while (t != G_TYPE_INVALID);
rval = Fcons (signals, props);
return (rval);
@@ -1464,7 +1463,7 @@
{
GValue v;
g_value_init (&v, props[i]->value_type);
- prop_list = Fcons (gtk_type_to_lisp (&v), prop_list);
+ prop_list = Fcons (g_type_to_lisp (&v), prop_list);
}
g_free (props);
g_free (obj);
@@ -1531,69 +1530,69 @@
switch (GTK_FUNDAMENTAL_TYPE (a.type))
{
/* flag types */
- case GTK_TYPE_CHAR:
+ case G_TYPE_CHAR:
stderr_out ("char: %c\n", GTK_VALUE_CHAR (a));
break;
- case GTK_TYPE_UCHAR:
+ case G_TYPE_UCHAR:
stderr_out ("uchar: %c\n", GTK_VALUE_CHAR (a));
break;
- case GTK_TYPE_BOOL:
+ case G_TYPE_BOOL:
stderr_out ("uchar: %s\n", GTK_VALUE_BOOL (a) ? "true" : "false");
break;
- case GTK_TYPE_INT:
+ case G_TYPE_INT:
stderr_out ("int: %d\n", GTK_VALUE_INT (a));
break;
- case GTK_TYPE_UINT:
+ case G_TYPE_UINT:
stderr_out ("uint: %du\n", GTK_VALUE_UINT (a));
break;
- case GTK_TYPE_LONG:
+ case G_TYPE_LONG:
stderr_out ("long: %ld\n", GTK_VALUE_LONG (a));
break;
- case GTK_TYPE_ULONG:
+ case G_TYPE_ULONG:
stderr_out ("ulong: %lu\n", GTK_VALUE_ULONG (a));
break;
- case GTK_TYPE_FLOAT:
+ case G_TYPE_FLOAT:
stderr_out ("float: %g\n", GTK_VALUE_FLOAT (a));
break;
- case GTK_TYPE_DOUBLE:
+ case G_TYPE_DOUBLE:
stderr_out ("double: %f\n", GTK_VALUE_DOUBLE (a));
break;
- case GTK_TYPE_STRING:
+ case G_TYPE_STRING:
stderr_out ("string: %s\n", GTK_VALUE_STRING (a));
break;
- case GTK_TYPE_ENUM:
- case GTK_TYPE_FLAGS:
- stderr_out ("%s: ", (a.type == GTK_TYPE_ENUM) ? "enum" : "flag");
+ case G_TYPE_ENUM:
+ case G_TYPE_FLAGS:
+ stderr_out ("%s: ", (a.type == G_TYPE_ENUM) ? "enum" : "flag");
{
- GtkEnumValue *vals = gtk_type_enum_get_values (a.type);
+ GtkEnumValue *vals = g_type_enum_get_values (a.type);
while (vals && vals->value_name && (vals->value != GTK_VALUE_ENUM(a))) vals++;
stderr_out ("%s\n", vals ? vals->value_name : "!!! UNKNOWN ENUM VALUE !!!");
}
break;
- case GTK_TYPE_BOXED:
+ case G_TYPE_BOXED:
stderr_out ("boxed: %p\n", GTK_VALUE_BOXED (a));
break;
- case GTK_TYPE_POINTER:
+ case G_TYPE_POINTER:
stderr_out ("pointer: %p\n", GTK_VALUE_BOXED (a));
break;
/* structured types */
- case GTK_TYPE_SIGNAL:
- case GTK_TYPE_ARGS: /* This we can do as a list of values */
+ case G_TYPE_SIGNAL:
+ case G_TYPE_ARGS: /* This we can do as a list of values */
ABORT();
- case GTK_TYPE_CALLBACK:
+ case G_TYPE_CALLBACK:
stderr_out ("callback fn: ...\n");
break;
- case GTK_TYPE_C_CALLBACK:
- case GTK_TYPE_FOREIGN:
+ case G_TYPE_C_CALLBACK:
+ case G_TYPE_FOREIGN:
ABORT();
/* base type of the object system */
- case GTK_TYPE_OBJECT:
+ case G_TYPE_OBJECT:
if (GTK_VALUE_OBJECT (a))
- stderr_out ("object: %s\n", gtk_type_name (GTK_OBJECT_TYPE (GTK_VALUE_OBJECT (a))));
+ stderr_out ("object: %s\n", g_type_name (GTK_OBJECT_TYPE (GTK_VALUE_OBJECT (a))));
else
stderr_out ("object: NULL\n");
break;
@@ -1604,7 +1603,7 @@
}
#endif
-Lisp_Object gtk_type_to_lisp (GValue *arg)
+Lisp_Object g_type_to_lisp (GValue *arg)
{
if (G_TYPE_IS_FUNDAMENTAL (G_VALUE_TYPE (arg)))
{
@@ -1689,14 +1688,14 @@
else
{
stderr_out ("Do not know how to convert `%s' to lisp!\n",
- gtk_type_name (G_VALUE_TYPE (arg)));
+ g_type_name (G_VALUE_TYPE (arg)));
ABORT ();
}
/* This is chuck reminding GCC to... SHUT UP! */
return (Qnil);
}
-int lisp_to_gtk_type (Lisp_Object obj, GValue *arg)
+int lisp_to_g_value (Lisp_Object obj, GValue *arg)
{
switch (G_VALUE_TYPE (arg))
{
@@ -1961,7 +1960,7 @@
{
#endif
stderr_out ("Do not know how to convert `%s' from lisp!\n",
- gtk_type_name (G_VALUE_TYPE (arg)));
+ g_type_name (G_VALUE_TYPE (arg)));
ABORT();
//}
break;
@@ -1972,7 +1971,7 @@
#ifdef JSPARKES
/* Convert lisp types to GTK return types. This is identical to
- lisp_to_gtk_type() except that the macro used to set the value is
+ lisp_to_g_value() except that the macro used to set the value is
different.
### There should be some way of combining these two functions.
@@ -2188,7 +2187,7 @@
case G_TYPE_ARGS: /* This we can do as a list of values */
case G_TYPE_C_CALLBACK:
case G_TYPE_FOREIGN:
- stderr_out ("Do not know how to convert `%s' from lisp!\n", gtk_type_name (arg->type));
+ stderr_out ("Do not know how to convert `%s' from lisp!\n", g_type_name (arg->type));
return (-1);
#if 0
@@ -2246,7 +2245,7 @@
}
else
{
- stderr_out ("Do not know how to convert `%s' from lisp!\n", gtk_type_name (arg->type));
+ stderr_out ("Do not know how to convert `%s' from lisp!\n", g_type_name (arg->type));
ABORT();
}
break;
@@ -2360,7 +2359,7 @@
if (NILP (alist))
{
invalid_argument ("Unknown enumeration",
- build_cistring (gtk_type_name (G_VALUE_TYPE (arg))));
+ build_cistring (g_type_name (G_VALUE_TYPE (arg))));
}
cell = Frassq (make_int (value), alist);
https://bitbucket.org/xemacs/xemacs/commits/0647d8900260/
Changeset: 0647d8900260
User: jsparkes
Date: 2010-05-19 17:04:32+00:00
Summary: Make internal types hash table visible as Vgtk_types.
Affected #: 2 files
diff -r 3d69123a167534845e6107a08fc62638627388b9 -r 0647d8900260cb7d3209654338a1440cdf9f764b src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -2,6 +2,12 @@
* ui-gtk.c: Use g_type* functions instead of deprecated gtk_type*
ones. Rename lisp_to_gtk_type to lisp_to_g_value.
+ Remove lisp_to_gtk_ret_type, lisp_to_gvalue now does that job.
+ (type_already_imported_p): Make internal type hash table visible
+ as gtk-types so it's viewable in lisp.
+ (mark_type_as_imported): Use Vgtk_types.
+ (vars_of_ui_gtk): DEFVAR Vgtk_types.
+
* gtk-glue.c: use renamed function.
* menubar-gtk.c: Use GQuarks instead of text keys for attaching
diff -r 3d69123a167534845e6107a08fc62638627388b9 -r 0647d8900260cb7d3209654338a1440cdf9f764b src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -51,13 +51,13 @@
Lisp_Object Qemacs_gtk_boxedp;
Lisp_Object Qvoid;
Lisp_Object Vgtk_enumeration_info;
+Lisp_Object Vgtk_types;
static GHashTable *dll_cache;
static Lisp_Object g_type_to_lisp (GValue *arg);
static int lisp_to_g_value (Lisp_Object obj, GValue *arg);
#if 0
-int lisp_to_gtk_ret_type (Lisp_Object obj, GValue *arg);
void describe_gtk_arg (GType *arg);
#endif
gint symbol_to_gtk_enum (Lisp_Object obj, GValue *);
@@ -120,13 +120,9 @@
/* Gtk object importing */
EXFUN (Fgtk_import_type, 1);
-static struct hash_table *internal_type_hash;
-
static int
type_already_imported_p (GType t)
{
- void *retval = NULL;
-
/* These are cases that we don't need to import */
switch (GTK_FUNDAMENTAL_TYPE (t))
{
@@ -154,16 +150,15 @@
return (1);
}
- if (!internal_type_hash)
+ if (NILP (Vgtk_types))
{
- internal_type_hash = make_hash_table (163);
+ Vgtk_types = call2 (intern ("make-hashtable"),
+ make_int (163), Qequal);
return (0);
}
- if (gethash ((void *)t, internal_type_hash, (const void **)&retval))
- {
+ if (!NILP (Fgethash (make_int (G_VALUE_TYPE (t)), Vgtk_types, Qnil)))
return (1);
- }
return (0);
}
@@ -173,7 +168,11 @@
if (type_already_imported_p (t))
return;
- puthash ((void *) t, (void *) 1, internal_type_hash);
+ /* Value should be a symbol? */
+ const gchar *name = g_type_name (t);
+ Lisp_Object value = Fmake_symbol (make_string ((const Ibyte *)name, strlen (name)));
+
+ Fputhash (make_int (G_VALUE_TYPE (t)), value, (Vgtk_types));
}
static void import_gtk_type (GType t);
@@ -1444,7 +1443,7 @@
{
GType gt;
GObjectClass *type_class = NULL;
- GObject *obj;
+ GObject *obj = 0;
Lisp_Object prop_list = Qnil;
GParamSpec **props;
guint n_props, i;
@@ -1517,6 +1516,11 @@
Do NOT modify unless you really understand ui-gtk.c.
*/);
Vgtk_enumeration_info = Qnil;
+ DEFVAR_LISP ("gtk-types", &Vgtk_types /*
+A hashtable holding type information about imported GTK types and name.
+Intended for read-only debugging.
+*/);
+ Vgtk_types = Qnil;
vars_of_glade ();
}
@@ -1968,293 +1972,6 @@
return (0);
}
-
-#ifdef JSPARKES
-/* Convert lisp types to GTK return types. This is identical to
- lisp_to_g_value() except that the macro used to set the value is
- different.
-
- ### There should be some way of combining these two functions.
-*/
-int lisp_to_gtk_ret_type (Lisp_Object obj, GValue *arg)
-{
- switch (G_TYPE_FUNDAMENTAL (G_VALUE_TYPE (arg)))
- {
- /* flag types */
- case G_TYPE_NONE:
- return (0);
- case G_TYPE_CHAR:
- {
- Ichar c;
-
- CHECK_CHAR_COERCE_INT (obj);
- c = XCHAR (obj);
- //*(GTK_RETLOC_CHAR (*arg)) = c;
- g_value_set_char (arg, c);
- }
- break;
- case G_TYPE_UCHAR:
- {
- Ichar c;
-
- CHECK_CHAR_COERCE_INT (obj);
- c = XCHAR (obj);
- //*(GTK_RETLOC_CHAR (*arg)) = c;
- g_value_set_uchar (arg, (unsigned char) c);
- }
- break;
- case G_TYPE_BOOLEAN:
- //*(GTK_RETLOC_BOOL (*arg)) = NILP (obj) ? FALSE : TRUE;
- g_value_set_boolean (arg, NILP (obj) ? FALSE : TRUE);
- break;
- case G_TYPE_INT:
- case G_TYPE_UINT:
- if (NILP (obj) || EQ (Qt, obj))
- {
- /* For we are a kind mistress and allow sending t/nil for
- 1/0 to stupid GTK functions that say they take guint or
- gint in the header files, but actually treat it like a
- bool. *sigh*
- */
- // *(GTK_RETLOC_INT(*arg)) = NILP (obj) ? 0 : 1;
- g_value_set_int (arg, NILP (obj) ? 0 : 1);
- }
- else
- {
- CHECK_INT (obj);
- *(GTK_RETLOC_INT(*arg)) = XINT (obj);
- }
- break;
- case G_TYPE_LONG:
- case G_TYPE_ULONG:
- ABORT();
- case G_TYPE_FLOAT:
- CHECK_INT_OR_FLOAT (obj);
- *(GTK_RETLOC_FLOAT(*arg)) = extract_float (obj);
- break;
- case G_TYPE_DOUBLE:
- CHECK_INT_OR_FLOAT (obj);
- *(GTK_RETLOC_DOUBLE(*arg)) = extract_float (obj);
- break;
- case G_TYPE_STRING:
- if (NILP (obj))
- *(GTK_RETLOC_STRING (*arg)) = NULL;
- else
- {
- CHECK_STRING (obj);
- *(GTK_RETLOC_STRING (*arg)) = (char *) XSTRING_DATA (obj);
- }
- break;
- case G_TYPE_ENUM:
- case G_TYPE_FLAGS:
- /* Convert a lisp symbol to a GTK enum */
- *(GTK_RETLOC_ENUM(*arg)) = lisp_to_gtk_flag (obj, arg->type);
- break;
- case G_TYPE_BOXED:
- if (NILP (obj))
- {
- *(GTK_RETLOC_BOXED(*arg)) = NULL;
- }
- else if (GTK_BOXEDP (obj))
- {
- *(GTK_RETLOC_BOXED(*arg)) = XGTK_BOXED (obj)->object;
- }
- else if (arg->type == G_TYPE_STYLE)
- {
- obj = Ffind_face (obj);
- CHECK_FACE (obj);
- *(GTK_RETLOC_BOXED(*arg)) = face_to_style (obj);
- }
- else if (arg->type == G_TYPE_GDK_GC)
- {
- obj = Ffind_face (obj);
- CHECK_FACE (obj);
- *(GTK_RETLOC_BOXED(*arg)) = face_to_gc (obj);
- }
- else if (arg->type == G_TYPE_GDK_WINDOW)
- {
- if (GLYPHP (obj))
- {
- Lisp_Object window = Fselected_window (Qnil);
- Lisp_Object instance =
- glyph_image_instance (obj, window, ERROR_ME_DEBUG_WARN, 1);
- struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (instance);
-
- switch (XIMAGE_INSTANCE_TYPE (instance))
- {
- case IMAGE_TEXT:
- case IMAGE_POINTER:
- case IMAGE_SUBWINDOW:
- case IMAGE_NOTHING:
- *(GTK_RETLOC_BOXED(*arg)) = NULL;
- break;
-
- case IMAGE_MONO_PIXMAP:
- case IMAGE_COLOR_PIXMAP:
- *(GTK_RETLOC_BOXED(*arg)) = IMAGE_INSTANCE_GTK_PIXMAP (p);
- break;
- }
- }
- else if (GTK_OBJECTP (obj) && GTK_IS_WIDGET (XGTK_OBJECT (obj)->object))
- {
- *(GTK_RETLOC_BOXED(*arg)) = GTK_WIDGET (XGTK_OBJECT (obj))->window;
- }
- else
- {
- invalid_argument ("Don't know how to convert object to GDK_WINDOW", obj);
- }
- break;
- }
- else if (G_VALUE_TYPE (arg) == G_TYPE_COLOR)
- {
- if (COLOR_SPECIFIERP (obj))
- {
- /* If it is a specifier, we just convert it to an
- instance, and let the ifs below handle it.
- */
- obj = Fspecifier_instance (obj, Qnil, Qnil, Qnil);
- }
-
- if (COLOR_INSTANCEP (obj))
- {
- /* Easiest one */
- *(GTK_RETLOC_BOXED(*arg)) = COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (obj));
- }
- else if (STRINGP (obj))
- {
- invalid_argument ("Please use a color specifier or instance, not a string", obj);
- }
- else
- {
- invalid_argument ("Don't know how to convert to GdkColor", obj);
- }
- }
- else if (arg->type == G_TYPE_GDK_FONT)
- {
- if (SYMBOLP (obj))
- {
- /* If it is a symbol, we treat that as a face name */
- obj = Ffind_face (obj);
- }
-
- if (FACEP (obj))
- {
- /* If it is a face, we just grab the font specifier, and
- cascade down until we finally reach a FONT_INSTANCE
- */
- obj = Fget (obj, Qfont, Qnil);
- }
-
- if (FONT_SPECIFIERP (obj))
- {
- /* If it is a specifier, we just convert it to an
- instance, and let the ifs below handle it
- */
- obj = Fspecifier_instance (obj, Qnil, Qnil, Qnil);
- }
-
- if (FONT_INSTANCEP (obj))
- {
- /* Easiest one */
- *(GTK_RETLOC_BOXED(*arg)) = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (obj));
- }
- else if (STRINGP (obj))
- {
- invalid_argument ("Please use a font specifier or instance, not a string", obj);
- }
- else
- {
- invalid_argument ("Don't know how to convert to GdkColor", obj);
- }
- }
- else
- {
- /* Unknown type to convert to boxed */
- stderr_out ("Don't know how to convert to boxed!\n");
- *(GTK_RETLOC_BOXED(*arg)) = NULL;
- }
- break;
-
- case G_TYPE_POINTER:
- if (NILP (obj))
- *(GTK_RETLOC_POINTER(*arg)) = NULL;
- else
- *(GTK_RETLOC_POINTER(*arg)) = STORE_LISP_IN_VOID (obj);
- break;
-
- /* structured types */
- case G_TYPE_SIGNAL:
- case G_TYPE_ARGS: /* This we can do as a list of values */
- case G_TYPE_C_CALLBACK:
- case G_TYPE_FOREIGN:
- stderr_out ("Do not know how to convert `%s' from lisp!\n", g_type_name (arg->type));
- return (-1);
-
-#if 0
- /* #### BILL! */
- /* This is not used, and does not work with union type */
- case G_TYPE_CALLBACK:
- {
- GUI_ID id;
-
- id = new_gui_id ();
- obj = Fcons (Qnil, obj); /* Empty data */
- obj = Fcons (make_int (id), obj);
-
- gcpro_popup_callbacks (id, obj);
-
- *(GTK_RETLOC_CALLBACK(*arg)).marshal = __internal_callback_marshal;
- *(GTK_RETLOC_CALLBACK(*arg)).data = (gpointer) obj;
- *(GTK_RETLOC_CALLBACK(*arg)).notify = __internal_callback_destroy;
- }
- break;
-#endif
-
- /* base type of the object system */
- case G_TYPE_OBJECT:
- if (NILP (obj))
- *(GTK_RETLOC_OBJECT (*arg)) = NULL;
- else
- {
- CHECK_GTK_OBJECT (obj);
- if (XGTK_OBJECT (obj)->alive_p)
- *(GTK_RETLOC_OBJECT (*arg)) = XGTK_OBJECT (obj)->object;
- else
- invalid_argument ("Attempting to pass dead object to GTK function", obj);
- }
- break;
-
- default:
- if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, G_TYPE_ARRAY))
- {
- if (NILP (obj))
- *(GTK_RETLOC_POINTER(*arg)) = NULL;
- else
- {
- xemacs_list_to_array (obj, arg);
- }
- }
- else if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, G_TYPE_LISTOF))
- {
- if (NILP (obj))
- *(GTK_RETLOC_POINTER(*arg)) = NULL;
- else
- {
- xemacs_list_to_gtklist (obj, arg);
- }
- }
- else
- {
- stderr_out ("Do not know how to convert `%s' from lisp!\n", g_type_name (arg->type));
- ABORT();
- }
- break;
- }
-
- return (0);
-}
-
-#endif
/* This is used in glyphs-gtk.c as well */
static Lisp_Object
https://bitbucket.org/xemacs/xemacs/commits/6553f64f1bc6/
Changeset: 6553f64f1bc6
User: jsparkes
Date: 2010-05-19 17:11:15+00:00
Summary: Commented out use of shadow enums until they're updated to 2.X values
to make gcc happy.
Affected #: 2 files
diff -r 0647d8900260cb7d3209654338a1440cdf9f764b -r 6553f64f1bc643de8d279cf2530c2b86debe59f6 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-05-19 Jeff Sparkes <jsparkes(a)gmail.com>
+ * redisplay-gtk.c (XLIKE_bevel_area): Commented out use of shadow
+ enums until they're updated to 2.X values.
+
* ui-gtk.c: Use g_type* functions instead of deprecated gtk_type*
ones. Rename lisp_to_gtk_type to lisp_to_g_value.
Remove lisp_to_gtk_ret_type, lisp_to_gvalue now does that job.
diff -r 0647d8900260cb7d3209654338a1440cdf9f764b -r 6553f64f1bc643de8d279cf2530c2b86debe59f6 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -46,11 +46,13 @@
else
switch (style)
{
+#ifdef JSPARKES
case EDGE_BEVEL_IN: style = (edge_style)GTK_SHADOW_IN; break;
case EDGE_BEVEL_OUT: style = (edge_style)GTK_SHADOW_OUT; break;
case EDGE_ETCHED_IN: style = (edge_style)GTK_SHADOW_ETCHED_IN; break;
case EDGE_ETCHED_OUT: style = (edge_style)GTK_SHADOW_ETCHED_OUT; break;
default: ABORT (); style = (edge_style)GTK_SHADOW_OUT;
+#endif
}
/* Do we want to have some magic constants to set
https://bitbucket.org/xemacs/xemacs/commits/0468ac9ca8fa/
Changeset: 0468ac9ca8fa
User: jsparkes
Date: 2010-05-19 10:19:51+00:00
Summary: Create PangoContext and PangoFontMap in device initialization.
Affected #: 2 files
diff -r 6a9200beef5dd3ad06ab47614abddb9529a2ac19 -r 0468ac9ca8fa4a452a2fd177a4e58c2333a449f2 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-05-19 Jeff Sparkes <jsparkes(a)gmail.com>
+ * device-gtk.c (gtk_init_device): Create PangoContext and
+ PangoFontMap in device initialization.
+
* menubar-gtk.c: Use GQuarks instead of text keys for attaching
data to widgets.
diff -r 6a9200beef5dd3ad06ab47614abddb9529a2ac19 -r 0468ac9ca8fa4a452a2fd177a4e58c2333a449f2 src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -296,23 +296,6 @@
DEVICE_GTK_COLORMAP (d) = cmap;
DEVICE_GTK_DEPTH (d) = visual->depth;
- /* Should this be easier to figure out? --jsparkes */
- {
-#ifdef USE_PANGO
- PangoFontDescription *pango_desc;
- Display *disp = GDK_DRAWABLE_XDISPLAY (drawable);
- int screen = GDK_SCREEN_XNUMBER (gdk_drawable_get_screen (drawable));
-
- context = pango_xft_get_context (display, screen);
- pango_desc = pango_font_description_new ();
-/* pango_desc = pango_font_description_from_string ("monospace 12"); */
- pango_font_description_set_family (pango_desc, extname);
-/* pango_font_description_set_size (pango_desc, 12); */
-
- DEVICE_GTK_CONTEXT (d) = context;
- assert (DEVICE_GTK_CONTEXT (d) != NULL);
-#endif
- }
{
GtkWidget *w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -320,6 +303,25 @@
gtk_container_add (GTK_CONTAINER (w), app_shell);
gtk_widget_realize (w);
+ {
+#ifdef USE_PANGO
+ PangoContext *context = 0;
+ PangoFontDescription *pango_desc = 0;
+ PangoFontMap *font_map = 0;
+ Display *disp = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (w));
+ int screen = GDK_SCREEN_XNUMBER (gtk_widget_get_screen (w));
+
+ context = pango_xft_get_context (disp, screen);
+ DEVICE_GTK_CONTEXT (d) = context;
+
+ pango_desc = pango_font_description_new ();
+ font_map = pango_xft_get_font_map (disp, screen);
+
+ DEVICE_GTK_FONT_MAP (d) = font_map;
+ /* pango_desc = pango_font_description_from_string ("monospace 12"); */
+ /* pango_font_description_set_size (pango_desc, 12); */
+#endif
+ }
}
DEVICE_GTK_APP_SHELL (d) = app_shell;
https://bitbucket.org/xemacs/xemacs/commits/12538b476f0b/
Changeset: 12538b476f0b
User: jsparkes
Date: 2010-05-20 09:10:20+00:00
Summary: Merge.
Affected #: 4 files
diff -r 0468ac9ca8fa4a452a2fd177a4e58c2333a449f2 -r 12538b476f0b3eca04720ca4a48c5af28ba12e42 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,7 +1,17 @@
2010-05-19 Jeff Sparkes <jsparkes(a)gmail.com>
- * device-gtk.c (gtk_init_device): Create PangoContext and
- PangoFontMap in device initialization.
+ * redisplay-gtk.c (XLIKE_bevel_area): Commented out use of shadow
+ enums until they're updated to 2.X values.
+
+ * ui-gtk.c: Use g_type* functions instead of deprecated gtk_type*
+ ones. Rename lisp_to_gtk_type to lisp_to_g_value.
+ Remove lisp_to_gtk_ret_type, lisp_to_gvalue now does that job.
+ (type_already_imported_p): Make internal type hash table visible
+ as gtk-types so it's viewable in lisp.
+ (mark_type_as_imported): Use Vgtk_types.
+ (vars_of_ui_gtk): DEFVAR Vgtk_types.
+
+ * gtk-glue.c: use renamed function.
* menubar-gtk.c: Use GQuarks instead of text keys for attaching
data to widgets.
diff -r 0468ac9ca8fa4a452a2fd177a4e58c2333a449f2 -r 12538b476f0b3eca04720ca4a48c5af28ba12e42 src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -27,7 +27,7 @@
#include "fontcolor-gtk-impl.h"
#include "frame.h"
-extern int lisp_to_gtk_type (Lisp_Object obj, GValue *arg);
+static int lisp_to_g_value (Lisp_Object obj, GValue *arg);
static GType
xemacs_type_register (const gchar *name, GType parent)
@@ -88,7 +88,7 @@
SAFE_LIST_LOOP_2 (elt, obj)
{
GValue tmp, *copy;
- lisp_to_gtk_type (elt, &tmp);
+ lisp_to_g_value (elt, &tmp);
g_value_copy (&tmp, copy);/* leak XXX */
g_value_array_append (array, copy);
}
@@ -196,8 +196,6 @@
return (rval);
}
-int lisp_to_gtk_type (Lisp_Object obj, GValue *arg);
-
static void
xemacs_list_to_array (Lisp_Object obj, GValue *arg)
{
@@ -216,7 +214,7 @@
LIST_LOOP_3 (elt, obj, tail)
{
g_value_reset (&val);
- lisp_to_gtk_type (elt, &val);
+ lisp_to_g_value (elt, &val);
g_value_array_append (array, &val);
}
diff -r 0468ac9ca8fa4a452a2fd177a4e58c2333a449f2 -r 12538b476f0b3eca04720ca4a48c5af28ba12e42 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -46,11 +46,13 @@
else
switch (style)
{
+#ifdef JSPARKES
case EDGE_BEVEL_IN: style = (edge_style)GTK_SHADOW_IN; break;
case EDGE_BEVEL_OUT: style = (edge_style)GTK_SHADOW_OUT; break;
case EDGE_ETCHED_IN: style = (edge_style)GTK_SHADOW_ETCHED_IN; break;
case EDGE_ETCHED_OUT: style = (edge_style)GTK_SHADOW_ETCHED_OUT; break;
default: ABORT (); style = (edge_style)GTK_SHADOW_OUT;
+#endif
}
/* Do we want to have some magic constants to set
diff -r 0468ac9ca8fa4a452a2fd177a4e58c2333a449f2 -r 12538b476f0b3eca04720ca4a48c5af28ba12e42 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -51,13 +51,13 @@
Lisp_Object Qemacs_gtk_boxedp;
Lisp_Object Qvoid;
Lisp_Object Vgtk_enumeration_info;
+Lisp_Object Vgtk_types;
static GHashTable *dll_cache;
-Lisp_Object gtk_type_to_lisp (GValue *arg);
-int lisp_to_gtk_type (Lisp_Object obj, GValue *arg);
+static Lisp_Object g_type_to_lisp (GValue *arg);
+static int lisp_to_g_value (Lisp_Object obj, GValue *arg);
#if 0
-int lisp_to_gtk_ret_type (Lisp_Object obj, GValue *arg);
void describe_gtk_arg (GType *arg);
#endif
gint symbol_to_gtk_enum (Lisp_Object obj, GValue *);
@@ -120,13 +120,9 @@
/* Gtk object importing */
EXFUN (Fgtk_import_type, 1);
-static struct hash_table *internal_type_hash;
-
static int
type_already_imported_p (GType t)
{
- void *retval = NULL;
-
/* These are cases that we don't need to import */
switch (GTK_FUNDAMENTAL_TYPE (t))
{
@@ -154,16 +150,15 @@
return (1);
}
- if (!internal_type_hash)
+ if (NILP (Vgtk_types))
{
- internal_type_hash = make_hash_table (163);
+ Vgtk_types = call2 (intern ("make-hashtable"),
+ make_int (163), Qequal);
return (0);
}
- if (gethash ((void *)t, internal_type_hash, (const void **)&retval))
- {
+ if (!NILP (Fgethash (make_int (G_VALUE_TYPE (t)), Vgtk_types, Qnil)))
return (1);
- }
return (0);
}
@@ -173,7 +168,11 @@
if (type_already_imported_p (t))
return;
- puthash ((void *) t, (void *) 1, internal_type_hash);
+ /* Value should be a symbol? */
+ const gchar *name = g_type_name (t);
+ Lisp_Object value = Fmake_symbol (make_string ((const Ibyte *)name, strlen (name)));
+
+ Fputhash (make_int (G_VALUE_TYPE (t)), value, (Vgtk_types));
}
static void import_gtk_type (GType t);
@@ -246,7 +245,7 @@
}
#endif
- the_type = gtk_type_parent(the_type);
+ the_type = g_type_parent(the_type);
} while (the_type != G_TYPE_INVALID);
}
@@ -311,7 +310,7 @@
return;
}
- stderr_out ("import_gtk_type %0x %s\n", (unsigned int)t, gtk_type_name(t));
+ stderr_out ("import_gtk_type %d %s\n", (unsigned int)t, g_type_name(t));
if (G_TYPE_IS_FUNDAMENTAL (t))
{
@@ -324,7 +323,7 @@
import_gtk_flags_internal (t);
break;
default:
- stderr_out ("import_gtk_type %s\n", gtk_type_name(t));
+ stderr_out ("import_gtk_type %s\n", g_type_name(t));
// ABORT();
break;
}
@@ -333,7 +332,7 @@
import_gtk_object_internal (t);
else
{
- stderr_out ("import_gtk_type unknown %s\n", gtk_type_name(t));
+ stderr_out ("import_gtk_type unknown %s\n", g_type_name(t));
}
mark_type_as_imported (t);
@@ -347,7 +346,7 @@
Lisp_Object obj = ALLOC_NORMAL_LISP_OBJECT (emacs_ffi);
emacs_ffi_data *data = XFFI (obj);
- data->return_type = GTK_TYPE_NONE;
+ data->return_type = G_TYPE_NONE;
data->n_args = 0;
data->function_name = Qnil;
data->function_ptr = 0;
@@ -541,7 +540,7 @@
case G_TYPE_POINTER:
return (build_ascstring ("POINTER"));
default:
- stderr_out ("type_to_marshaller type %s\n", gtk_type_name(t));
+ stderr_out ("type_to_marshaller type %s\n", g_type_name(t));
ABORT();
/* I can't put this in the main switch statement because it is a
@@ -596,9 +595,9 @@
xemacs_init_gtk_classes ();
g_type_init();
- arg.value_type = gtk_type_from_name ((char *) XSTRING_DATA (type));
+ arg.value_type = g_type_from_name ((char *) XSTRING_DATA (type));
- if (arg.value_type == GTK_TYPE_INVALID)
+ if (arg.value_type == G_TYPE_INVALID)
{
sferror ("Unknown type", type);
}
@@ -622,7 +621,7 @@
ABORT();
//GTK_VALUE_POINTER(arg) = var;
//CONVERT_RETVAL (arg, 0);
- //return (gtk_type_to_lisp (&arg));
+ //return (g_type_to_lisp (&arg));
return Qnil;
}
@@ -691,9 +690,9 @@
type = Fsymbol_name (elt);
- the_type = gtk_type_from_name ((char *) XSTRING_DATA (type));
+ the_type = g_type_from_name ((char *) XSTRING_DATA (type));
- if (the_type == GTK_TYPE_INVALID)
+ if (the_type == G_TYPE_INVALID)
{
invalid_argument ("Unknown argument type", type);
}
@@ -719,9 +718,9 @@
}
rettype = Fsymbol_name (rettype);
- data->return_type = gtk_type_from_name ((char *) XSTRING_DATA (rettype));
+ data->return_type = g_type_from_name ((char *) XSTRING_DATA (rettype));
- if (data->return_type == GTK_TYPE_INVALID)
+ if (data->return_type == G_TYPE_INVALID)
{
invalid_argument ("Unknown return type", rettype);
}
@@ -807,7 +806,7 @@
EXTERNAL_LIST_LOOP_2 (elt, value)
{
g_value_init (&the_args[n_args], XFFI (func)->arg_type[n_args]);
- if (lisp_to_gtk_type (elt, &the_args[n_args]))
+ if (lisp_to_g_value (elt, &the_args[n_args]))
{
/* There was some sort of an error */
gui_error ("Error converting arguments", args);
@@ -819,7 +818,7 @@
/* Now we need to tack on space for a return value, if they have
asked for one */
- if (XFFI (func)->return_type != GTK_TYPE_NONE)
+ if (XFFI (func)->return_type != G_TYPE_NONE)
{
g_value_init (&the_args[n_args], XFFI (func)->return_type);
n_args++;
@@ -827,10 +826,10 @@
//XFFI (func)->marshal ((ffi_actual_function) (XFFI (func)->function_ptr), the_args);
- if (XFFI (func)->return_type != GTK_TYPE_NONE)
+ if (XFFI (func)->return_type != G_TYPE_NONE)
{
//CONVERT_RETVAL (the_args[n_args - 1], 1);
- //retval = gtk_type_to_lisp (&the_args[n_args - 1]);
+ //retval = g_type_to_lisp (&the_args[n_args - 1]);
}
/* Need to free any array or list pointers */
@@ -867,7 +866,7 @@
write_ascstring (printcharfun, "#<GtkObject (");
/* Haven't found alive indicator in 2.X */
if (XGTK_OBJECT (obj)->alive_p)
- write_cistring (printcharfun, gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object)));
+ write_cistring (printcharfun, g_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object)));
else
write_ascstring (printcharfun, "dead");
write_fmt_string (printcharfun, ") %p>", (void *) XGTK_OBJECT (obj)->object);
@@ -906,18 +905,18 @@
g_object_getv (XGTK_OBJECT (obj)->object, 1, args);
- if (args[0].type == GTK_TYPE_INVALID)
+ if (args[0].type == G_TYPE_INVALID)
{
/* If we can't get the attribute, then let the code in Fget know
so it can use the default value supplied by the caller */
return (Qunbound);
}
- rval = gtk_type_to_lisp (&args[0]);
+ rval = g_type_to_lisp (&args[0]);
/* Free up any memory. According to the documentation and Havoc's
book, if the fundamental type of the returned value is
- GTK_TYPE_STRING, GTK_TYPE_BOXED, or GTK_TYPE_ARGS, you are
+ GTK_TYPE_STRING, G_TYPE_BOXED, or G_TYPE_ARGS, you are
responsible for freeing it. */
switch (GTK_FUNDAMENTAL_TYPE (args[0].type))
{
@@ -965,7 +964,7 @@
return (1);
}
- if (lisp_to_gtk_type (value, &arg))
+ if (lisp_to_g_value (value, &arg))
{
gui_error ("Error converting to GType", value);
}
@@ -1026,7 +1025,7 @@
/* We need to keep track of when the object is destroyed so that we
can mark it as dead, otherwise even our print routine (which calls
GTK_OBJECT_TYPE) will crap out and die. This is also used in the
- lisp_to_gtk_type() routine to defend against passing dead objects
+ lisp_to_g_value() routine to defend against passing dead objects
to GTK routines. */
static void
__notice_object_destruction (GtkObject *UNUSED (obj), gpointer user_data)
@@ -1101,7 +1100,7 @@
/* Build up the argument list, lisp style */
for (i = n_args - 1; i >= 0; i--)
{
- arg_list = Fcons (gtk_type_to_lisp (&args[i]), arg_list);
+ arg_list = Fcons (g_type_to_lisp (&args[i]), arg_list);
}
/* We always pass the widget as the first parameter at the very least */
@@ -1116,8 +1115,7 @@
signal_fake_event ();
if (G_VALUE_TYPE (&args[n_args]) != G_TYPE_NONE)
- //lisp_to_gtk_ret_type (rval, &args[n_args]);
- lisp_to_gtk_type (rval, &args[n_args]);
+ lisp_to_g_value (rval, &args[n_args]);
UNGCPRO;
}
@@ -1168,7 +1166,7 @@
}
-/* GTK_TYPE_BOXED wrapper for Emacs lisp */
+/* G_TYPE_BOXED wrapper for Emacs lisp */
static const struct memory_description emacs_gtk_boxed_description [] = {
{ XD_END }
};
@@ -1181,7 +1179,7 @@
printing_unreadable_lisp_object (obj, 0);
write_ascstring (printcharfun, "#<GtkBoxed (");
- write_cistring (printcharfun, gtk_type_name (XGTK_BOXED (obj)->object_type));
+ write_cistring (printcharfun, g_type_name (XGTK_BOXED (obj)->object_type));
write_fmt_string (printcharfun, ") %p>", (void *) XGTK_BOXED (obj)->object);
}
@@ -1213,7 +1211,7 @@
emacs_gtk_boxed_hash,
emacs_gtk_boxed_description,
emacs_gtk_boxed_data);
-/* Currently defined GTK_TYPE_BOXED structures are:
+/* Currently defined G_TYPE_BOXED structures are:
GtkAccelGroup -
GtkSelectionData -
@@ -1281,9 +1279,9 @@
CHECK_STRING (type);
- t = gtk_type_from_name ((char *) XSTRING_DATA (type));
+ t = g_type_from_name ((char *) XSTRING_DATA (type));
- if (t == GTK_TYPE_INVALID)
+ if (t == G_TYPE_INVALID)
{
invalid_argument ("Not a GTK type", type);
}
@@ -1386,7 +1384,7 @@
guint32 *gtk_signals;
guint n_signals;
- klass = (GtkObjectClass *) gtk_type_class (t);
+ klass = (GtkObjectClass *) g_type_class (t);
gtk_signals = klass->signals;
n_signals = klass->nsignals;
@@ -1404,11 +1402,11 @@
for (j = query->nparams - 1; j >= 0; j--)
{
- params = Fcons (intern (gtk_type_name (query->params[j])), params);
+ params = Fcons (intern (g_type_name (query->params[j])), params);
}
}
- signals = Fcons (Fcons (intern (gtk_type_name (query->return_val)),
+ signals = Fcons (Fcons (intern (g_type_name (query->return_val)),
Fcons (intern (query->signal_name),
params)),
signals);
@@ -1418,8 +1416,8 @@
}
}
#endif
- t = gtk_type_parent(t);
- } while (t != GTK_TYPE_INVALID);
+ t = g_type_parent(t);
+ } while (t != G_TYPE_INVALID);
rval = Fcons (signals, props);
return (rval);
@@ -1445,7 +1443,7 @@
{
GType gt;
GObjectClass *type_class = NULL;
- GObject *obj;
+ GObject *obj = 0;
Lisp_Object prop_list = Qnil;
GParamSpec **props;
guint n_props, i;
@@ -1464,7 +1462,7 @@
{
GValue v;
g_value_init (&v, props[i]->value_type);
- prop_list = Fcons (gtk_type_to_lisp (&v), prop_list);
+ prop_list = Fcons (g_type_to_lisp (&v), prop_list);
}
g_free (props);
g_free (obj);
@@ -1518,6 +1516,11 @@
Do NOT modify unless you really understand ui-gtk.c.
*/);
Vgtk_enumeration_info = Qnil;
+ DEFVAR_LISP ("gtk-types", &Vgtk_types /*
+A hashtable holding type information about imported GTK types and name.
+Intended for read-only debugging.
+*/);
+ Vgtk_types = Qnil;
vars_of_glade ();
}
@@ -1531,69 +1534,69 @@
switch (GTK_FUNDAMENTAL_TYPE (a.type))
{
/* flag types */
- case GTK_TYPE_CHAR:
+ case G_TYPE_CHAR:
stderr_out ("char: %c\n", GTK_VALUE_CHAR (a));
break;
- case GTK_TYPE_UCHAR:
+ case G_TYPE_UCHAR:
stderr_out ("uchar: %c\n", GTK_VALUE_CHAR (a));
break;
- case GTK_TYPE_BOOL:
+ case G_TYPE_BOOL:
stderr_out ("uchar: %s\n", GTK_VALUE_BOOL (a) ? "true" : "false");
break;
- case GTK_TYPE_INT:
+ case G_TYPE_INT:
stderr_out ("int: %d\n", GTK_VALUE_INT (a));
break;
- case GTK_TYPE_UINT:
+ case G_TYPE_UINT:
stderr_out ("uint: %du\n", GTK_VALUE_UINT (a));
break;
- case GTK_TYPE_LONG:
+ case G_TYPE_LONG:
stderr_out ("long: %ld\n", GTK_VALUE_LONG (a));
break;
- case GTK_TYPE_ULONG:
+ case G_TYPE_ULONG:
stderr_out ("ulong: %lu\n", GTK_VALUE_ULONG (a));
break;
- case GTK_TYPE_FLOAT:
+ case G_TYPE_FLOAT:
stderr_out ("float: %g\n", GTK_VALUE_FLOAT (a));
break;
- case GTK_TYPE_DOUBLE:
+ case G_TYPE_DOUBLE:
stderr_out ("double: %f\n", GTK_VALUE_DOUBLE (a));
break;
- case GTK_TYPE_STRING:
+ case G_TYPE_STRING:
stderr_out ("string: %s\n", GTK_VALUE_STRING (a));
break;
- case GTK_TYPE_ENUM:
- case GTK_TYPE_FLAGS:
- stderr_out ("%s: ", (a.type == GTK_TYPE_ENUM) ? "enum" : "flag");
+ case G_TYPE_ENUM:
+ case G_TYPE_FLAGS:
+ stderr_out ("%s: ", (a.type == G_TYPE_ENUM) ? "enum" : "flag");
{
- GtkEnumValue *vals = gtk_type_enum_get_values (a.type);
+ GtkEnumValue *vals = g_type_enum_get_values (a.type);
while (vals && vals->value_name && (vals->value != GTK_VALUE_ENUM(a))) vals++;
stderr_out ("%s\n", vals ? vals->value_name : "!!! UNKNOWN ENUM VALUE !!!");
}
break;
- case GTK_TYPE_BOXED:
+ case G_TYPE_BOXED:
stderr_out ("boxed: %p\n", GTK_VALUE_BOXED (a));
break;
- case GTK_TYPE_POINTER:
+ case G_TYPE_POINTER:
stderr_out ("pointer: %p\n", GTK_VALUE_BOXED (a));
break;
/* structured types */
- case GTK_TYPE_SIGNAL:
- case GTK_TYPE_ARGS: /* This we can do as a list of values */
+ case G_TYPE_SIGNAL:
+ case G_TYPE_ARGS: /* This we can do as a list of values */
ABORT();
- case GTK_TYPE_CALLBACK:
+ case G_TYPE_CALLBACK:
stderr_out ("callback fn: ...\n");
break;
- case GTK_TYPE_C_CALLBACK:
- case GTK_TYPE_FOREIGN:
+ case G_TYPE_C_CALLBACK:
+ case G_TYPE_FOREIGN:
ABORT();
/* base type of the object system */
- case GTK_TYPE_OBJECT:
+ case G_TYPE_OBJECT:
if (GTK_VALUE_OBJECT (a))
- stderr_out ("object: %s\n", gtk_type_name (GTK_OBJECT_TYPE (GTK_VALUE_OBJECT (a))));
+ stderr_out ("object: %s\n", g_type_name (GTK_OBJECT_TYPE (GTK_VALUE_OBJECT (a))));
else
stderr_out ("object: NULL\n");
break;
@@ -1604,7 +1607,7 @@
}
#endif
-Lisp_Object gtk_type_to_lisp (GValue *arg)
+Lisp_Object g_type_to_lisp (GValue *arg)
{
if (G_TYPE_IS_FUNDAMENTAL (G_VALUE_TYPE (arg)))
{
@@ -1689,14 +1692,14 @@
else
{
stderr_out ("Do not know how to convert `%s' to lisp!\n",
- gtk_type_name (G_VALUE_TYPE (arg)));
+ g_type_name (G_VALUE_TYPE (arg)));
ABORT ();
}
/* This is chuck reminding GCC to... SHUT UP! */
return (Qnil);
}
-int lisp_to_gtk_type (Lisp_Object obj, GValue *arg)
+int lisp_to_g_value (Lisp_Object obj, GValue *arg)
{
switch (G_VALUE_TYPE (arg))
{
@@ -1961,7 +1964,7 @@
{
#endif
stderr_out ("Do not know how to convert `%s' from lisp!\n",
- gtk_type_name (G_VALUE_TYPE (arg)));
+ g_type_name (G_VALUE_TYPE (arg)));
ABORT();
//}
break;
@@ -1969,293 +1972,6 @@
return (0);
}
-
-#ifdef JSPARKES
-/* Convert lisp types to GTK return types. This is identical to
- lisp_to_gtk_type() except that the macro used to set the value is
- different.
-
- ### There should be some way of combining these two functions.
-*/
-int lisp_to_gtk_ret_type (Lisp_Object obj, GValue *arg)
-{
- switch (G_TYPE_FUNDAMENTAL (G_VALUE_TYPE (arg)))
- {
- /* flag types */
- case G_TYPE_NONE:
- return (0);
- case G_TYPE_CHAR:
- {
- Ichar c;
-
- CHECK_CHAR_COERCE_INT (obj);
- c = XCHAR (obj);
- //*(GTK_RETLOC_CHAR (*arg)) = c;
- g_value_set_char (arg, c);
- }
- break;
- case G_TYPE_UCHAR:
- {
- Ichar c;
-
- CHECK_CHAR_COERCE_INT (obj);
- c = XCHAR (obj);
- //*(GTK_RETLOC_CHAR (*arg)) = c;
- g_value_set_uchar (arg, (unsigned char) c);
- }
- break;
- case G_TYPE_BOOLEAN:
- //*(GTK_RETLOC_BOOL (*arg)) = NILP (obj) ? FALSE : TRUE;
- g_value_set_boolean (arg, NILP (obj) ? FALSE : TRUE);
- break;
- case G_TYPE_INT:
- case G_TYPE_UINT:
- if (NILP (obj) || EQ (Qt, obj))
- {
- /* For we are a kind mistress and allow sending t/nil for
- 1/0 to stupid GTK functions that say they take guint or
- gint in the header files, but actually treat it like a
- bool. *sigh*
- */
- // *(GTK_RETLOC_INT(*arg)) = NILP (obj) ? 0 : 1;
- g_value_set_int (arg, NILP (obj) ? 0 : 1);
- }
- else
- {
- CHECK_INT (obj);
- *(GTK_RETLOC_INT(*arg)) = XINT (obj);
- }
- break;
- case G_TYPE_LONG:
- case G_TYPE_ULONG:
- ABORT();
- case G_TYPE_FLOAT:
- CHECK_INT_OR_FLOAT (obj);
- *(GTK_RETLOC_FLOAT(*arg)) = extract_float (obj);
- break;
- case G_TYPE_DOUBLE:
- CHECK_INT_OR_FLOAT (obj);
- *(GTK_RETLOC_DOUBLE(*arg)) = extract_float (obj);
- break;
- case G_TYPE_STRING:
- if (NILP (obj))
- *(GTK_RETLOC_STRING (*arg)) = NULL;
- else
- {
- CHECK_STRING (obj);
- *(GTK_RETLOC_STRING (*arg)) = (char *) XSTRING_DATA (obj);
- }
- break;
- case G_TYPE_ENUM:
- case G_TYPE_FLAGS:
- /* Convert a lisp symbol to a GTK enum */
- *(GTK_RETLOC_ENUM(*arg)) = lisp_to_gtk_flag (obj, arg->type);
- break;
- case G_TYPE_BOXED:
- if (NILP (obj))
- {
- *(GTK_RETLOC_BOXED(*arg)) = NULL;
- }
- else if (GTK_BOXEDP (obj))
- {
- *(GTK_RETLOC_BOXED(*arg)) = XGTK_BOXED (obj)->object;
- }
- else if (arg->type == G_TYPE_STYLE)
- {
- obj = Ffind_face (obj);
- CHECK_FACE (obj);
- *(GTK_RETLOC_BOXED(*arg)) = face_to_style (obj);
- }
- else if (arg->type == G_TYPE_GDK_GC)
- {
- obj = Ffind_face (obj);
- CHECK_FACE (obj);
- *(GTK_RETLOC_BOXED(*arg)) = face_to_gc (obj);
- }
- else if (arg->type == G_TYPE_GDK_WINDOW)
- {
- if (GLYPHP (obj))
- {
- Lisp_Object window = Fselected_window (Qnil);
- Lisp_Object instance =
- glyph_image_instance (obj, window, ERROR_ME_DEBUG_WARN, 1);
- struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (instance);
-
- switch (XIMAGE_INSTANCE_TYPE (instance))
- {
- case IMAGE_TEXT:
- case IMAGE_POINTER:
- case IMAGE_SUBWINDOW:
- case IMAGE_NOTHING:
- *(GTK_RETLOC_BOXED(*arg)) = NULL;
- break;
-
- case IMAGE_MONO_PIXMAP:
- case IMAGE_COLOR_PIXMAP:
- *(GTK_RETLOC_BOXED(*arg)) = IMAGE_INSTANCE_GTK_PIXMAP (p);
- break;
- }
- }
- else if (GTK_OBJECTP (obj) && GTK_IS_WIDGET (XGTK_OBJECT (obj)->object))
- {
- *(GTK_RETLOC_BOXED(*arg)) = GTK_WIDGET (XGTK_OBJECT (obj))->window;
- }
- else
- {
- invalid_argument ("Don't know how to convert object to GDK_WINDOW", obj);
- }
- break;
- }
- else if (G_VALUE_TYPE (arg) == G_TYPE_COLOR)
- {
- if (COLOR_SPECIFIERP (obj))
- {
- /* If it is a specifier, we just convert it to an
- instance, and let the ifs below handle it.
- */
- obj = Fspecifier_instance (obj, Qnil, Qnil, Qnil);
- }
-
- if (COLOR_INSTANCEP (obj))
- {
- /* Easiest one */
- *(GTK_RETLOC_BOXED(*arg)) = COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (obj));
- }
- else if (STRINGP (obj))
- {
- invalid_argument ("Please use a color specifier or instance, not a string", obj);
- }
- else
- {
- invalid_argument ("Don't know how to convert to GdkColor", obj);
- }
- }
- else if (arg->type == G_TYPE_GDK_FONT)
- {
- if (SYMBOLP (obj))
- {
- /* If it is a symbol, we treat that as a face name */
- obj = Ffind_face (obj);
- }
-
- if (FACEP (obj))
- {
- /* If it is a face, we just grab the font specifier, and
- cascade down until we finally reach a FONT_INSTANCE
- */
- obj = Fget (obj, Qfont, Qnil);
- }
-
- if (FONT_SPECIFIERP (obj))
- {
- /* If it is a specifier, we just convert it to an
- instance, and let the ifs below handle it
- */
- obj = Fspecifier_instance (obj, Qnil, Qnil, Qnil);
- }
-
- if (FONT_INSTANCEP (obj))
- {
- /* Easiest one */
- *(GTK_RETLOC_BOXED(*arg)) = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (obj));
- }
- else if (STRINGP (obj))
- {
- invalid_argument ("Please use a font specifier or instance, not a string", obj);
- }
- else
- {
- invalid_argument ("Don't know how to convert to GdkColor", obj);
- }
- }
- else
- {
- /* Unknown type to convert to boxed */
- stderr_out ("Don't know how to convert to boxed!\n");
- *(GTK_RETLOC_BOXED(*arg)) = NULL;
- }
- break;
-
- case G_TYPE_POINTER:
- if (NILP (obj))
- *(GTK_RETLOC_POINTER(*arg)) = NULL;
- else
- *(GTK_RETLOC_POINTER(*arg)) = STORE_LISP_IN_VOID (obj);
- break;
-
- /* structured types */
- case G_TYPE_SIGNAL:
- case G_TYPE_ARGS: /* This we can do as a list of values */
- case G_TYPE_C_CALLBACK:
- case G_TYPE_FOREIGN:
- stderr_out ("Do not know how to convert `%s' from lisp!\n", gtk_type_name (arg->type));
- return (-1);
-
-#if 0
- /* #### BILL! */
- /* This is not used, and does not work with union type */
- case G_TYPE_CALLBACK:
- {
- GUI_ID id;
-
- id = new_gui_id ();
- obj = Fcons (Qnil, obj); /* Empty data */
- obj = Fcons (make_int (id), obj);
-
- gcpro_popup_callbacks (id, obj);
-
- *(GTK_RETLOC_CALLBACK(*arg)).marshal = __internal_callback_marshal;
- *(GTK_RETLOC_CALLBACK(*arg)).data = (gpointer) obj;
- *(GTK_RETLOC_CALLBACK(*arg)).notify = __internal_callback_destroy;
- }
- break;
-#endif
-
- /* base type of the object system */
- case G_TYPE_OBJECT:
- if (NILP (obj))
- *(GTK_RETLOC_OBJECT (*arg)) = NULL;
- else
- {
- CHECK_GTK_OBJECT (obj);
- if (XGTK_OBJECT (obj)->alive_p)
- *(GTK_RETLOC_OBJECT (*arg)) = XGTK_OBJECT (obj)->object;
- else
- invalid_argument ("Attempting to pass dead object to GTK function", obj);
- }
- break;
-
- default:
- if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, G_TYPE_ARRAY))
- {
- if (NILP (obj))
- *(GTK_RETLOC_POINTER(*arg)) = NULL;
- else
- {
- xemacs_list_to_array (obj, arg);
- }
- }
- else if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(arg->type, G_TYPE_LISTOF))
- {
- if (NILP (obj))
- *(GTK_RETLOC_POINTER(*arg)) = NULL;
- else
- {
- xemacs_list_to_gtklist (obj, arg);
- }
- }
- else
- {
- stderr_out ("Do not know how to convert `%s' from lisp!\n", gtk_type_name (arg->type));
- ABORT();
- }
- break;
- }
-
- return (0);
-}
-
-#endif
/* This is used in glyphs-gtk.c as well */
static Lisp_Object
@@ -2360,7 +2076,7 @@
if (NILP (alist))
{
invalid_argument ("Unknown enumeration",
- build_cistring (gtk_type_name (G_VALUE_TYPE (arg))));
+ build_cistring (g_type_name (G_VALUE_TYPE (arg))));
}
cell = Frassq (make_int (value), alist);
https://bitbucket.org/xemacs/xemacs/commits/935adf347d42/
Changeset: 935adf347d42
User: jsparkes
Date: 2010-05-20 09:32:25+00:00
Summary: Use standard menu bar instead of custom one in menubar-gtk.c.
The main window was resizing into nothing.
Use a quark to store frame association instead of using a field in
local menu bar implementation.
Affected #: 2 files
diff -r 12538b476f0b3eca04720ca4a48c5af28ba12e42 -r 935adf347d42fb256e8088d013f43ead8c656b92 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,11 @@
+2010-05-20 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * menubar-gtk.c: Add quark for menu bar tag.
+ (gtk_xemacs_menubar_new): Use quark to store frame association.
+ Create a regular menu bar, not the one defined in this file.
+ There is a resize problem that shrinks the main window that may be
+ caused by our implementation.
+
2010-05-19 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (XLIKE_bevel_area): Commented out use of shadow
diff -r 12538b476f0b3eca04720ca4a48c5af28ba12e42 -r 935adf347d42fb256e8088d013f43ead8c656b92 src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -57,6 +57,8 @@
g_quark_from_string ("xemacs::menu::gui_id");
static GQuark XEMACS_MENU_FIRSTTIME_TAG =
g_quark_from_string ("xemacs::menu::first_time");
+static GQuark XEMACS_MENU_FRAME_TAG =
+ g_quark_from_string ("xemacs::menu::frame");
static GtkWidget *menu_descriptor_to_widget_1 (Lisp_Object descr, GtkAccelGroup* accel_group);
@@ -70,6 +72,8 @@
** to be bigger than the text widget. This prevents weird resizing
** when jumping around between buffers with radically different menu
** sizes.
+**
+** Currently unused --jsparkes
*/
#define GTK_XEMACS_MENUBAR(obj) GTK_CHECK_CAST (obj, gtk_xemacs_menubar_get_type (), GtkXEmacsMenubar)
@@ -163,8 +167,13 @@
GtkWidget *
gtk_xemacs_menubar_new (struct frame *f)
{
+#if 0
GtkXEmacsMenubar *menubar = (GtkXEmacsMenubar*) gtk_type_new (gtk_xemacs_menubar_get_type ());
menubar->frame = f;
+#endif
+ GtkWidget *menubar = gtk_menu_bar_new ();
+ /* I don't think this is used. --jsparkes */
+ g_object_set_qdata (G_OBJECT (menubar), XEMACS_MENU_FRAME_TAG, f);
return (GTK_WIDGET (menubar));
}
@@ -380,8 +389,8 @@
{
GtkWidget *selected = gtk_menu_get_active (GTK_MENU (item->submenu));
- gtk_container_foreach (GTK_CONTAINER (item->submenu),(GtkCallback) __maybe_destroy,
- selected);
+ gtk_container_foreach (GTK_CONTAINER (item->submenu),
+ (GtkCallback) __maybe_destroy, selected);
}
else if (gtk_container_children (GTK_CONTAINER (item->submenu)))
{
https://bitbucket.org/xemacs/xemacs/commits/0ff590577eba/
Changeset: 0ff590577eba
User: jsparkes
Date: 2010-05-20 10:09:55+00:00
Summary: Use Gtk 2.x accessors instead of Gtk 1.X ones.
Use G_OBJECT instead of GTK_OBJECT.
Use g_object_set_data instead of gtk_object_set_data.
Use g_signal_connect instead of gtk_signal_connect.
Affected #: 7 files
diff -r 935adf347d42fb256e8088d013f43ead8c656b92 -r 0ff590577eba104493e92f6372958d91d3ade9df src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,29 @@
2010-05-20 Jeff Sparkes <jsparkes(a)gmail.com>
+ * device-gtk.c (gtk_init_device): Use Gtk 2.x accessors instead of
+ Gtk 1.X ones. Use G_OBJECT instead of GTK_OBJECT. Use
+ g_object_set_data instead of gtk_object_set_data. Use
+ g_signal_connect instead of gtk_signal_connect.
+
+ * event-gtk.c (gtk_event_to_emacs_event): Ditto.
+
+ * frame-gtk.c (gtk_widget_to_frame): Ditto.
+ (gtk_create_widgets): Ditto.
+
+ * glyphs-gtk.c (gtk_add_tab_item): Ditto.
+ (gtk_tab_control_callback): Ditto.
+ (gtk_tab_control_instantiate): Ditto.
+
+ * menubar-gtk.c (__torn_off_sir): Ditto.
+ (__activate_menu): Ditto.
+ (menu_convert): Ditto.
+ (create_menubar_widget): Ditto.
+ (gtk_popup_menu): Ditto.
+
+ * scrollbar-gtk.c (gtk_create_scrollbar_instance): Ditto
+ (gtk_create_scrollbar_instance): Ditto.
+ (scrollbar_cb): Ditto.
+
* menubar-gtk.c: Add quark for menu bar tag.
(gtk_xemacs_menubar_new): Use quark to store frame association.
Create a regular menu bar, not the one defined in this file.
diff -r 935adf347d42fb256e8088d013f43ead8c656b92 -r 0ff590577eba104493e92f6372958d91d3ade9df src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -337,12 +337,12 @@
gdk_atom_intern("CLIPBOARD", FALSE),
GDK_SELECTION_TYPE_STRING, 0);
- gtk_signal_connect (GTK_OBJECT (app_shell), "selection_get",
+ g_signal_connect (G_OBJECT (app_shell), "selection_get",
GTK_SIGNAL_FUNC (emacs_gtk_selection_handle), NULL);
- gtk_signal_connect (GTK_OBJECT (app_shell), "selection_clear_event",
+ g_signal_connect (G_OBJECT (app_shell), "selection_clear_event",
GTK_SIGNAL_FUNC (emacs_gtk_selection_clear_event_handle),
NULL);
- gtk_signal_connect (GTK_OBJECT (app_shell), "selection_received",
+ g_signal_connect (G_OBJECT (app_shell), "selection_received",
GTK_SIGNAL_FUNC (emacs_gtk_selection_received), NULL);
DEVICE_GTK_WM_COMMAND_FRAME (d) = Qnil;
diff -r 935adf347d42fb256e8088d013f43ead8c656b92 -r 0ff590577eba104493e92f6372958d91d3ade9df src/event-gtk.c
--- a/src/event-gtk.c
+++ b/src/event-gtk.c
@@ -1345,7 +1345,7 @@
*/
#if 0
if (!NILP (Vmenu_accelerator_enabled)
- && gtk_accel_groups_activate(GTK_OBJECT (FRAME_GTK_SHELL_WIDGET(frame)),
+ && gtk_accel_groups_activate(G_OBJECT (FRAME_GTK_SHELL_WIDGET(frame)),
key_event->keyval,
(GdkModifierType) *state))
{
diff -r 935adf347d42fb256e8088d013f43ead8c656b92 -r 0ff590577eba104493e92f6372958d91d3ade9df src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -128,8 +128,8 @@
for (; w; w = w->parent)
{
- if ((f = (struct frame *) g_object_get_qdata (G_OBJECT(GTK_OBJECT (w)),
- GTK_DATA_FRAME_IDENTIFIER)))
+ if ((f = (struct frame *) g_object_get_qdata (G_OBJECT(w),
+ GTK_DATA_FRAME_IDENTIFIER)))
return (f);
}
@@ -841,7 +841,7 @@
{
/* If this is a transient window, keep the parent info around */
GtkWidget *parentwid = FRAME_GTK_SHELL_WIDGET (XFRAME (parent));
- gtk_object_set_data (GTK_OBJECT (shell), TRANSIENT_DATA_IDENTIFIER, parentwid);
+ g_object_set_data (G_OBJECT (shell), TRANSIENT_DATA_IDENTIFIER, parentwid);
gtk_window_set_transient_for (GTK_WINDOW (shell), GTK_WINDOW (parentwid));
}
@@ -849,7 +849,7 @@
/* Add a mapping from widget to frame to help widget callbacks quickly find
their corresponding frame. */
- g_object_set_qdata (G_OBJECT (GTK_OBJECT (shell)), GTK_DATA_FRAME_IDENTIFIER, f);
+ g_object_set_qdata (G_OBJECT (G_OBJECT (shell)), GTK_DATA_FRAME_IDENTIFIER, f);
FRAME_GTK_SHELL_WIDGET (f) = shell;
@@ -867,12 +867,12 @@
gtk_drag_dest_set (text, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT,
dnd_target_table, dnd_n_targets,
GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_ASK);
- gtk_signal_connect (GTK_OBJECT (text), "drag_drop",
- GTK_SIGNAL_FUNC (dragndrop_dropped), text);
- gtk_signal_connect (GTK_OBJECT (text), "drag_data_received",
- GTK_SIGNAL_FUNC (dragndrop_data_received), text);
- gtk_signal_connect (GTK_OBJECT (text), "drag_data_get",
- GTK_SIGNAL_FUNC (dragndrop_get_drag), NULL);
+ g_signal_connect (G_OBJECT (text), "drag_drop",
+ G_SIGNAL_FUNC (dragndrop_dropped), text);
+ g_signal_connect (GTK_OBJECT (text), "drag_data_received",
+ G_SIGNAL_FUNC (dragndrop_data_received), text);
+ g_signal_connect (G_OBJECT (text), "drag_data_get",
+ GTK_SIGNAL_FUNC (dragndrop_get_drag), NULL);
#endif
#ifdef HAVE_MENUBARS
@@ -894,7 +894,7 @@
gtk_box_pack_end (GTK_BOX (container), text, TRUE, TRUE, 0);
/* Connect main event handler */
- gtk_signal_connect (GTK_OBJECT (shell), "delete-event", GTK_SIGNAL_FUNC (delete_event_cb), f);
+ g_signal_connect (G_OBJECT (shell), "delete-event", GTK_SIGNAL_FUNC (delete_event_cb), f);
{
static const gchar *events_to_frob[] = { "focus-in-event",
@@ -915,12 +915,12 @@
for (i = 0; events_to_frob[i]; i++)
{
- gtk_signal_connect (GTK_OBJECT (shell), events_to_frob[i],
- GTK_SIGNAL_FUNC (emacs_shell_event_handler), f);
+ g_signal_connect (G_OBJECT (shell), events_to_frob[i],
+ GTK_SIGNAL_FUNC (emacs_shell_event_handler), f);
}
}
- gtk_signal_connect (GTK_OBJECT (shell), "size-allocate", GTK_SIGNAL_FUNC (resize_event_cb), f);
+ g_signal_connect (G_OBJECT (shell), "size-allocate", GTK_SIGNAL_FUNC (resize_event_cb), f);
/* This might be safe to call now... */
/* gtk_signal_connect (GTK_OBJECT (shell), "event", GTK_SIGNAL_FUNC (emacs_shell_event_handler), f); */
diff -r 935adf347d42fb256e8088d013f43ead8c656b92 -r 0ff590577eba104493e92f6372958d91d3ade9df src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -2569,8 +2569,8 @@
worry about the garbage collector running between here and the callback
function.
*/
- gtk_object_set_data(GTK_OBJECT(box), GTK_DATA_TAB_HASHCODE_IDENTIFIER,
- (gpointer) hash_id);
+ g_object_set_data(G_OBJECT(box), GTK_DATA_TAB_HASHCODE_IDENTIFIER,
+ (gpointer) hash_id);
gtk_notebook_append_page (nb, box, gtk_label_new (c_name));
}
@@ -2599,8 +2599,8 @@
return;
frame = wrap_frame (f);
- id = (int) g_object_get_qdata(GTK_OBJECT(page->child),
- GTK_DATA_TAB_HASHCODE_IDENTIFIER);
+ id = (int) g_object_get_qdata(G_OBJECT(page->child),
+ GTK_DATA_TAB_HASHCODE_IDENTIFIER);
image_instance = Fgethash(make_int_verify(id),
FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE(f), Qnil);
callback = Fgethash(make_int(id),
@@ -2684,8 +2684,8 @@
gtk_notebook_set_page(nb, selected);
/* Call per-tab lisp callback when a tab is pressed. */
- gtk_signal_connect (GTK_OBJECT (nb), "switch-page",
- GTK_SIGNAL_FUNC (gtk_tab_control_callback), NULL);
+ g_signal_connect (G_OBJECT (nb), "switch-page",
+ GTK_SIGNAL_FUNC (gtk_tab_control_callback), NULL);
}
/* Set the properties of a tab control */
diff -r 935adf347d42fb256e8088d013f43ead8c656b92 -r 0ff590577eba104493e92f6372958d91d3ade9df src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -332,7 +332,7 @@
Lisp_Object menu_desc = Qnil;
GtkWidget *old_submenu = GTK_MENU_ITEM (menu_item)->submenu;
- menu_desc = GET_LISP_FROM_VOID (gtk_object_get_qdata (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
+ menu_desc = GET_LISP_FROM_VOID (g_object_get_qdata (G_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
/* GCPRO all of our very own */
gcpro_popup_callbacks (id, menu_desc);
@@ -406,7 +406,7 @@
GtkWidget *w = gtk_tearoff_menu_item_new ();
gtk_widget_show (w);
gtk_menu_append (GTK_MENU (item->submenu), w);
- gtk_signal_connect (GTK_OBJECT (w), "activate", GTK_SIGNAL_FUNC (__torn_off_sir), item);
+ g_signal_connect (G_OBJECT (w), "activate", GTK_SIGNAL_FUNC (__torn_off_sir), item);
}
#endif
@@ -612,8 +612,8 @@
gtk_widget_show (submenu);
if (!reuse)
- gtk_signal_connect (GTK_OBJECT (menu_item), "destroy",
- GTK_SIGNAL_FUNC (__kill_stupid_gtk_timer), NULL);
+ g_signal_connect (G_OBJECT (menu_item), "destroy",
+ GTK_SIGNAL_FUNC (__kill_stupid_gtk_timer), NULL);
/* Without this sometimes a submenu gets left on the screen -
** urk
@@ -709,8 +709,8 @@
/* If the menu item had a GUI_ID that means it was a filter menu */
__remove_gcpro_by_id (id);
gtk_signal_disconnect_by_func (GTK_OBJECT (reuse),
- GTK_SIGNAL_FUNC (__activate_menu),
- (gpointer) 0x01 );
+ GTK_SIGNAL_FUNC (__activate_menu),
+ (gpointer) 0x01);
}
else
{
@@ -725,9 +725,9 @@
if (NILP (hook_fn))
{
/* Generic menu builder */
- gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
- GTK_SIGNAL_FUNC (__activate_menu),
- NULL);
+ g_signal_connect (G_OBJECT (menu_item), "activate",
+ GTK_SIGNAL_FUNC (__activate_menu),
+ NULL);
}
else
{
@@ -741,9 +741,9 @@
gtk_object_weakref (GTK_OBJECT (menu_item), __remove_gcpro_by_id,
(gpointer) id);
- gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
- GTK_SIGNAL_FUNC (__activate_menu),
- (gpointer) 0x01);
+ g_signal_connect (G_OBJECT (menu_item), "activate",
+ GTK_SIGNAL_FUNC (__activate_menu),
+ (gpointer) 0x01);
}
return (menu_item);
@@ -1022,15 +1022,15 @@
gtk_widget_set_sensitive (widget, ! NILP (active_p));
- gtk_signal_connect (GTK_OBJECT (widget), "activate-item",
- GTK_SIGNAL_FUNC (__generic_button_callback),
- STORE_LISP_IN_VOID (callback));
+ g_signal_connect (G_OBJECT (widget), "activate-item",
+ GTK_SIGNAL_FUNC (__generic_button_callback),
+ STORE_LISP_IN_VOID (callback));
- gtk_signal_connect (GTK_OBJECT (widget), "activate",
- GTK_SIGNAL_FUNC (__generic_button_callback),
- STORE_LISP_IN_VOID (callback));
+ g_signal_connect (G_OBJECT (widget), "activate",
+ GTK_SIGNAL_FUNC (__generic_button_callback),
+ STORE_LISP_IN_VOID (callback));
- /* Now that all the information about the menu item is know, set the
+ /* Now that all the information about the menu item is known, set the
remaining properties.
*/
@@ -1248,8 +1248,8 @@
gtk_box_pack_start (GTK_BOX (FRAME_GTK_CONTAINER_WIDGET (f)), menubar, FALSE, FALSE, 0);
}
- gtk_signal_connect (GTK_OBJECT (menubar), "button-press-event",
- GTK_SIGNAL_FUNC (run_menubar_hook), NULL);
+ g_signal_connect (G_OBJECT (menubar), "button-press-event",
+ GTK_SIGNAL_FUNC (run_menubar_hook), NULL);
FRAME_GTK_MENUBAR_WIDGET (f) = menubar;
g_object_set_qdata (G_OBJECT (menubar), XEMACS_MENU_GUIID_TAG, (gpointer) id);
@@ -1459,8 +1459,8 @@
gtk_widget_show (menu);
popup_up_p++;
- gtk_signal_connect (GTK_OBJECT (menu), "deactivate",
- GTK_SIGNAL_FUNC (popdown_menu_cb), NULL);
+ g_signal_connect (G_OBJECT (menu), "deactivate",
+ GTK_SIGNAL_FUNC (popdown_menu_cb), NULL);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
eev ? EVENT_BUTTON_BUTTON (eev) : 0,
diff -r 935adf347d42fb256e8088d013f43ead8c656b92 -r 0ff590577eba104493e92f6372958d91d3ade9df src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -104,20 +104,20 @@
SCROLLBAR_GTK_VDRAG_ORIG_VALUE (instance) = -1;
SCROLLBAR_GTK_LAST_VALUE (instance) = adj->value;
- g_object_set_qdata (G_OBJECT (GTK_OBJECT (adj)), GTK_DATA_GUI_IDENTIFIER,
+ g_object_set_qdata (G_OBJECT (G_OBJECT (adj)), GTK_DATA_GUI_IDENTIFIER,
(void *) SCROLLBAR_GTK_ID (instance));
- g_object_set_qdata (G_OBJECT (GTK_OBJECT (adj)), GTK_DATA_FRAME_IDENTIFIER,
+ g_object_set_qdata (G_OBJECT (G_OBJECT (adj)), GTK_DATA_FRAME_IDENTIFIER,
f);
sb = GTK_SCROLLBAR (vertical ? gtk_vscrollbar_new (adj) : gtk_hscrollbar_new (adj));
SCROLLBAR_GTK_WIDGET (instance) = GTK_WIDGET (sb);
gtk_range_set_update_policy (GTK_RANGE (sb), GTK_UPDATE_CONTINUOUS);
- assert(g_signal_connect (GTK_OBJECT (sb),"change-value",
+ assert(g_signal_connect (G_OBJECT (sb),"change-value",
G_CALLBACK (scrollbar_cb), (gpointer) vertical));
- assert(gtk_signal_connect (GTK_OBJECT (sb), "button-press-event",
+ assert(g_signal_connect (G_OBJECT (sb), "button-press-event",
GTK_SIGNAL_FUNC (scrollbar_drag_hack_cb), (gpointer) 1));
- assert(gtk_signal_connect (GTK_OBJECT (sb), "button-release-event",
+ assert(g_signal_connect (G_OBJECT (sb), "button-release-event",
GTK_SIGNAL_FUNC (scrollbar_drag_hack_cb), (gpointer) 0));
/* Do we need to connect to "destroy" too? --jsparkes */
@@ -429,12 +429,12 @@
Lisp_Object event_type = Qnil;
Lisp_Object event_data = Qnil;
- f = (struct frame*) g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)),
+ f = (struct frame*) g_object_get_qdata (G_OBJECT (adj),
GTK_DATA_FRAME_IDENTIFIER);
if (!f)
return(FALSE);
- id = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)),
+ id = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (adj),
GTK_DATA_GUI_IDENTIFIER));
assert (id != 0);
https://bitbucket.org/xemacs/xemacs/commits/bf21f3abcc83/
Changeset: bf21f3abcc83
User: jsparkes
Date: 2010-05-22 03:55:17+00:00
Summary: Figured out how to the font on a GtkStyle.
Affected #: 2 files
diff -r 0ff590577eba104493e92f6372958d91d3ade9df -r bf21f3abcc83bc1a19095ed535e78672ee954ba9 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,7 @@
+2010-05-21 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * gtk-glue.c (face_to_style): Figured out how to the font on a GtkStyle.
+
2010-05-20 Jeff Sparkes <jsparkes(a)gmail.com>
* device-gtk.c (gtk_init_device): Use Gtk 2.x accessors instead of
diff -r 0ff590577eba104493e92f6372958d91d3ade9df -r bf21f3abcc83bc1a19095ed535e78672ee954ba9 src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -316,9 +316,7 @@
style->bg_pixmap[i] = XIMAGE_INSTANCE_GTK_PIXMAP (pm);
}
-#ifdef JSPARKES
- style->font = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (font));
-#endif
+ gtk_style_set_font (style, FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (font)));
return (style);
}
https://bitbucket.org/xemacs/xemacs/commits/4b2e5e7f90c3/
Changeset: 4b2e5e7f90c3
User: jsparkes
Date: 2010-05-24 09:04:40+00:00
Summary: Always check fundamental types first.
Next check for GObjects and then enums or flags.
Affected #: 2 files
diff -r bf21f3abcc83bc1a19095ed535e78672ee954ba9 -r 4b2e5e7f90c3ccee57c64dde9ea178d7adc40a7e src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,8 @@
+2010-05-24 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * ui-gtk.c (type_to_marshaller_type): Always check fundamental
+ types first. Next check for GObjects and then enums or flags.
+
2010-05-21 Jeff Sparkes <jsparkes(a)gmail.com>
* gtk-glue.c (face_to_style): Figured out how to the font on a GtkStyle.
diff -r bf21f3abcc83bc1a19095ed535e78672ee954ba9 -r 4b2e5e7f90c3ccee57c64dde9ea178d7adc40a7e src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -512,50 +512,55 @@
static Lisp_Object type_to_marshaller_type (GType t)
{
- assert (G_TYPE_IS_FUNDAMENTAL (t));
- switch (G_TYPE_FUNDAMENTAL (t))
- {
- case G_TYPE_NONE:
- return (build_ascstring ("NONE"));
- /* flag types */
- case G_TYPE_CHAR:
- case G_TYPE_UCHAR:
- return (build_ascstring ("CHAR"));
- case G_TYPE_BOOLEAN:
- return (build_ascstring ("BOOL"));
- case G_TYPE_ENUM:
- case G_TYPE_FLAGS:
- case G_TYPE_INT:
- case G_TYPE_UINT:
- return (build_ascstring ("INT"));
- case G_TYPE_LONG:
- case G_TYPE_ULONG:
- return (build_ascstring ("LONG"));
- case G_TYPE_FLOAT:
- case G_TYPE_DOUBLE:
- return (build_ascstring ("FLOAT"));
- case G_TYPE_STRING:
- return (build_ascstring ("STRING"));
- case G_TYPE_BOXED:
- case G_TYPE_POINTER:
- return (build_ascstring ("POINTER"));
- default:
- stderr_out ("type_to_marshaller type %s\n", g_type_name(t));
+ if (G_TYPE_IS_FUNDAMENTAL (t))
+ switch (G_TYPE_FUNDAMENTAL (t))
+ {
+ case G_TYPE_NONE:
+ return (build_ascstring ("NONE"));
+ /* flag types */
+ case G_TYPE_CHAR:
+ case G_TYPE_UCHAR:
+ return (build_ascstring ("CHAR"));
+ case G_TYPE_BOOLEAN:
+ return (build_ascstring ("BOOL"));
+ case G_TYPE_ENUM:
+ case G_TYPE_FLAGS:
+ case G_TYPE_INT:
+ case G_TYPE_UINT:
+ return (build_ascstring ("INT"));
+ case G_TYPE_LONG:
+ case G_TYPE_ULONG:
+ return (build_ascstring ("LONG"));
+ case G_TYPE_FLOAT:
+ case G_TYPE_DOUBLE:
+ return (build_ascstring ("FLOAT"));
+ case G_TYPE_STRING:
+ return (build_ascstring ("STRING"));
+ case G_TYPE_BOXED:
+ case G_TYPE_POINTER:
+ case G_TYPE_OBJECT:
+ return (build_ascstring ("POINTER"));
+ default:
+ stderr_out ("type_to_marshaller type %s\n", g_type_name(t));
- ABORT();
- /* I can't put this in the main switch statement because it is a
- new fundamental type that is not fixed at compile time.
- *sigh*
- */
+ ABORT();
+ }
+ /* This is the base of almost all Gtk objects. */
+ if (g_type_is_a (t, G_TYPE_OBJECT))
+ return type_to_marshaller_type (G_TYPE_OBJECT);
+
+ /* Derived enums and flags */
+ if (G_TYPE_IS_ENUM (t) || G_TYPE_IS_FLAGS (t))
+ return type_to_marshaller_type (G_TYPE_ENUM);
+
#ifdef JSPARKES
- if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_ARRAY))
- return (build_ascstring ("ARRAY"));
+ if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_ARRAY))
+ return (build_ascstring ("ARRAY"));
- if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_LISTOF))
- return (build_ascstring ("LIST"));
- return (Qnil);
+ if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_LISTOF))
+ return (build_ascstring ("LIST"));
#endif
- }
+ stderr_out ("type_to_marshaller type %s\n", g_type_name(t));
ABORT ();
return (Qnil);
}
https://bitbucket.org/xemacs/xemacs/commits/8745a10c82a2/
Changeset: 8745a10c82a2
User: jsparkes
Date: 2010-05-30 21:12:07+00:00
Summary: Replace deprecated gdk_widget_draw() with gtk_widget_queue_draw().
Affected #: 2 files
diff -r 4b2e5e7f90c3ccee57c64dde9ea178d7adc40a7e -r 8745a10c82a2ce51ebbdafa2df80439c31d3e547 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,8 @@
+2010-05-30 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * glyphs-gtk.c (gtk_map_subwindow): Replace deprecated code with
+ gtk_widget_queue_draw().
+
2010-05-24 Jeff Sparkes <jsparkes(a)gmail.com>
* ui-gtk.c (type_to_marshaller_type): Always check fundamental
diff -r 4b2e5e7f90c3ccee57c64dde9ea178d7adc40a7e -r 8745a10c82a2ce51ebbdafa2df80439c31d3e547 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -2086,7 +2086,7 @@
gtk_widget_map (wid);
}
- gtk_widget_draw (wid, NULL);
+ gtk_widget_queue_draw (wid);
}
}
https://bitbucket.org/xemacs/xemacs/commits/705ea1eb2bac/
Changeset: 705ea1eb2bac
User: jsparkes
Date: 2010-05-31 09:59:22+00:00
Summary: Use Gtk toolbars instead of drawing out own at a lower level.
Affected #: 3 files
diff -r 8745a10c82a2ce51ebbdafa2df80439c31d3e547 -r 705ea1eb2bac53b51b18c35dc20df9ae0e86ee9c src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,19 @@
+2010-05-31 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * frame-impl.h (struct frame): Add gtk_toolbars here. This is the
+ wrong place, but it's used for now. Add a checksum slot.
+ (FRAME_GTK_TOOLBAR_WIDGET): Define accessor.
+ (FRAME_GTK_TOOLBAR_CHECKSUM): Define accessor.
+
+ * toolbar-gtk.c (gtk_toolbar_callback): Link to lisp callback.
+ (gtk_clear_toolbar): Delete toolbar widgets. Disabled.
+ (gtk_clear_frame_toolbars): Clear all toolbars on frame.
+ (gtk_output_toolbar): Create Gtk toolbar and buttons.
+ (gtk_output_frame_toolbars): Loop and create visible toolbars.
+ (console_type_create_toolbar_gtk): Define output, initialize and
+ free methods.
+ (vars_of_toolbar_gtk): Provide 'toolbar-gtk.
+
2010-05-30 Jeff Sparkes <jsparkes(a)gmail.com>
* glyphs-gtk.c (gtk_map_subwindow): Replace deprecated code with
diff -r 8745a10c82a2ce51ebbdafa2df80439c31d3e547 -r 705ea1eb2bac53b51b18c35dc20df9ae0e86ee9c src/frame-impl.h
--- a/src/frame-impl.h
+++ b/src/frame-impl.h
@@ -101,6 +101,12 @@
whether to re-layout windows by a call to change_frame_size early
in redisplay_frame. */
int current_toolbar_size[NUM_EDGES];
+
+#ifdef HAVE_GTK
+ void *gtk_toolbars[NUM_EDGES];
+ unsigned int gtk_toolbar_checksum[NUM_EDGES];
+#endif
+
#endif
/* Size of gutters as seen by redisplay. This is used to determine
@@ -782,6 +788,13 @@
(FRAME_REAL_TOOLBAR_BOUNDS (f, pos) + FRAME_INTERNAL_BORDER_SIZE (f, pos) + \
FRAME_GUTTER_BOUNDS (f, pos))
+#ifdef HAVE_TOOLBARS
+#ifdef HAVE_GTK
+#define FRAME_GTK_TOOLBAR_WIDGET(f) f->gtk_toolbars
+#define FRAME_GTK_TOOLBAR_CHECKSUM(f, pos) f->gtk_toolbar_checksum[pos]
+#endif
+#endif
+
#endif /* INCLUDED_frame_impl_h_ */
diff -r 8745a10c82a2ce51ebbdafa2df80439c31d3e547 -r 705ea1eb2bac53b51b18c35dc20df9ae0e86ee9c src/toolbar-gtk.c
--- a/src/toolbar-gtk.c
+++ b/src/toolbar-gtk.c
@@ -27,7 +27,13 @@
#include "lisp.h"
#include "frame.h"
+#include "frame-impl.h"
+#include "glyphs.h"
+#include "glyphs-gtk.h"
+#include "window.h"
+#include "window-impl.h"
+#include "toolbar.h"
#include "toolbar-xlike.h"
#include "console-gtk-impl.h"
@@ -36,16 +42,17 @@
** all the shared code. We would then just use
** CONSOLE_INHERITS_METHOD(x,xlike,blah)
*/
-#define gtk_output_frame_toolbars xlike_output_frame_toolbars
-#define gtk_output_toolbar_button xlike_output_toolbar_button
+/* #define gtk_output_frame_toolbars xlike_output_frame_toolbars */
+/* #define gtk_output_toolbar_button xlike_output_toolbar_button */
#define gtk_redraw_exposed_toolbars xlike_redraw_exposed_toolbars
#define gtk_redraw_frame_toolbars xlike_redraw_frame_toolbars
-#define gtk_clear_frame_toolbars xlike_clear_frame_toolbars
+/* #define gtk_clear_frame_toolbars xlike_clear_frame_toolbars */
static void
gtk_initialize_frame_toolbars (struct frame *UNUSED (f))
{
+ stderr_out ("gtk_initialize_frame_toolbars\n");
}
/* This only calls one function but we go ahead and create this in
@@ -53,8 +60,195 @@
static void
gtk_free_frame_toolbars (struct frame *UNUSED (f))
{
+ stderr_out ("gtk_free_frame_toolbars\n");
}
+static void
+gtk_toolbar_callback (GtkWidget *UNUSED (w), gpointer user_data)
+{
+ struct toolbar_button *tb = (struct toolbar_button *) user_data;
+
+ call0 (tb->callback);
+}
+
+void
+gtk_clear_toolbar (struct frame *f, enum edge_pos pos)
+{
+/* FRAME_GTK_TOOLBAR_CHECKSUM (f, pos) = 0; */
+/* SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0); */
+/* if (FRAME_GTK_TOOLBAR_WIDGET(f)[pos]) */
+/* gtk_widget_destroy ((GtkWidget *)FRAME_GTK_TOOLBAR_WIDGET(f)[pos]); */
+}
+
+void
+gtk_clear_frame_toolbars (struct frame *f)
+{
+ stderr_out ("gtk_clear_frame_toolbars\n");
+ enum edge_pos pos;
+
+ EDGE_POS_LOOP (pos)
+ {
+ gtk_clear_toolbar (f, pos);
+ }
+}
+
+static void
+gtk_output_toolbar (struct frame *f, enum edge_pos pos)
+{
+ GtkToolbar *toolbar;
+ Lisp_Object button, window, glyph, instance;
+ unsigned int checksum = 0;
+ struct window *w;
+ int x, y, bar_width, bar_height, vert;
+
+ window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+ w = XWINDOW (window);
+
+ get_toolbar_coords (f, pos, &x, &y, &bar_width, &bar_height, &vert, 0);
+
+ /* Get the toolbar and delete the old widgets in it */
+ button = FRAME_TOOLBAR_BUTTONS (f, pos);
+
+ /* First loop over all of the buttons to determine how many there
+ are. This loop will also make sure that all instances are
+ instantiated so when we actually output them they will come up
+ immediately. */
+ while (!NILP (button))
+ {
+ struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+ checksum = HASH4 (checksum,
+ internal_hash (get_toolbar_button_glyph(w, tb), 0, 0),
+ internal_hash (tb->callback, 0, 0),
+ 0 /* width */);
+ button = tb->next;
+ }
+
+ /* Only do updates if the toolbar has changed, or this is the first
+ time we have drawn it in this position
+ */
+ if (FRAME_GTK_TOOLBAR_WIDGET (f)[pos] &&
+ FRAME_GTK_TOOLBAR_CHECKSUM (f, pos) == checksum)
+ {
+ return;
+ }
+
+ /* Loop through buttons and add them to our toolbar.
+ This code ignores the button dimensions as we let GTK handle that :)
+ Attach the toolbar_button struct to the toolbar button so we know what
+ function to use as a callback. */
+
+ {
+ /* gtk_clear_toolbar (f, pos); */
+ FRAME_GTK_TOOLBAR_WIDGET (f)[pos] = toolbar = (GtkToolbar *)gtk_toolbar_new ();
+ gtk_widget_show (GTK_WIDGET (toolbar));
+ /* gtk_widget_set_name (toolbar, "toolbar"); */
+ if (EDGE_HORIZONTAL_P (pos))
+ {
+ gtk_orientable_set_orientation ((GtkOrientable *)toolbar,
+ GTK_ORIENTATION_HORIZONTAL);
+ /* gtk_widget_set_height (toolbar, bar_height); */
+ }
+ else
+ {
+ gtk_orientable_set_orientation ((GtkOrientable *)toolbar,
+ GTK_ORIENTATION_VERTICAL);
+ /* gtk_widget_set_width (toolbar, bar_width); */
+ }
+ gtk_toolbar_set_show_arrow ((GtkToolbar *)toolbar, TRUE);
+ }
+
+ if (NILP (w->toolbar_buttons_captioned_p))
+ gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_ICONS);
+ else
+ gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_BOTH);
+
+ FRAME_GTK_TOOLBAR_CHECKSUM(f, pos) = checksum;
+ button = FRAME_TOOLBAR_BUTTONS (f, pos);
+
+ while (!NILP (button))
+ {
+ struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+
+ if (tb->blank)
+ {
+ GtkToolItem *item = gtk_separator_tool_item_new ();
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
+ }
+ else
+ {
+ /* It actually has a glyph associated with it! What WILL
+ they think of next?
+ */
+ glyph = tb->up_glyph;
+
+ /* #### It is currently possible for users to trash us by directly
+ changing the toolbar glyphs. Avoid crashing in that case. */
+ if (GLYPHP (glyph))
+ instance = glyph_image_instance (glyph, window,
+ ERROR_ME_DEBUG_WARN, 1);
+ else
+ instance = Qnil;
+
+ if (IMAGE_INSTANCEP(instance))
+ {
+ GtkToolItem *item;
+ GtkWidget *pixmapwid;
+ GdkPixmap *pixmap;
+ GdkBitmap *mask;
+ Ibyte *tooltip = NULL;
+
+ if (STRINGP (tb->help_string))
+ tooltip = XSTRING_DATA (tb->help_string);
+
+/* item = gtk_tool_button_new (GTK_WIDGET (GTK_TOOLBAR (toolbar)), */
+/* (char*)XSTRING_DATA (tb->help_string)); */
+ item = gtk_tool_button_new_from_stock (GTK_STOCK_OPEN);
+
+ pixmap = XIMAGE_INSTANCE_GTK_PIXMAP(instance);
+ mask = XIMAGE_INSTANCE_GTK_MASK(instance);
+ pixmapwid = gtk_pixmap_new (pixmap, mask);
+
+ /* gtk_widget_set_size_request (pixmapwid, tb->width, tb->height); */
+
+ gtk_toolbar_insert (GTK_TOOLBAR(toolbar), item, -1);
+ /*
+ gtk_toolbar_callback, (gpointer) tb);
+ */
+ /* gtk_tool_button_set_icon_widget ((GtkToolButton *)item,
+ pixmapwid); */
+ gtk_tool_item_set_tooltip_text (item, (gchar *)tooltip);
+ }
+ }
+ /* Who's idea was it to use a linked list for toolbar buttons? */
+ button = tb->next;
+ }
+
+ SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
+
+ /* Are these border widths? */
+ x -= vert ? 3 : 2;
+ y -= vert ? 2 : 3;
+
+ gtk_fixed_put (GTK_FIXED (FRAME_GTK_TEXT_WIDGET (f)),
+ GTK_WIDGET (FRAME_GTK_TOOLBAR_WIDGET (f)[pos]), x, y);
+
+ gtk_widget_show_all (GTK_WIDGET (FRAME_GTK_TOOLBAR_WIDGET (f)[pos]));
+ gtk_widget_show_all (GTK_WIDGET (toolbar));
+}
+
+void
+gtk_output_frame_toolbars (struct frame *f)
+{
+ enum edge_pos pos;
+
+ EDGE_POS_LOOP (pos)
+ {
+ if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos))
+ gtk_output_toolbar (f, pos);
+ }
+}
+
+
/************************************************************************/
/* initialization */
@@ -64,10 +258,16 @@
console_type_create_toolbar_gtk (void)
{
CONSOLE_HAS_METHOD (gtk, output_frame_toolbars);
- CONSOLE_HAS_METHOD (gtk, clear_frame_toolbars);
+ /* CONSOLE_HAS_METHOD (gtk, clear_frame_toolbars); */
CONSOLE_HAS_METHOD (gtk, initialize_frame_toolbars);
CONSOLE_HAS_METHOD (gtk, free_frame_toolbars);
- CONSOLE_HAS_METHOD (gtk, output_toolbar_button);
- CONSOLE_HAS_METHOD (gtk, redraw_exposed_toolbars);
- CONSOLE_HAS_METHOD (gtk, redraw_frame_toolbars);
+ /* CONSOLE_HAS_METHOD (gtk, output_toolbar_button); */
+ /* CONSOLE_HAS_METHOD (gtk, redraw_exposed_toolbars); */
+ /* CONSOLE_HAS_METHOD (gtk, redraw_frame_toolbars); */
}
+
+void
+vars_of_toolbar_gtk (void)
+{
+ Fprovide (intern ("toolbar-gtk"));
+}
https://bitbucket.org/xemacs/xemacs/commits/32c8355e6f12/
Changeset: 32c8355e6f12
User: jsparkes
Date: 2010-05-31 10:01:13+00:00
Summary: Wrap entry.
Affected #: 1 file
diff -r 705ea1eb2bac53b51b18c35dc20df9ae0e86ee9c -r 32c8355e6f12c5027ec955ee3f47cce0feb04641 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -26,7 +26,8 @@
2010-05-21 Jeff Sparkes <jsparkes(a)gmail.com>
- * gtk-glue.c (face_to_style): Figured out how to the font on a GtkStyle.
+ * gtk-glue.c (face_to_style): Figured out how to set the font on a
+ GtkStyle.
2010-05-20 Jeff Sparkes <jsparkes(a)gmail.com>
https://bitbucket.org/xemacs/xemacs/commits/68bd90f5fc61/
Changeset: 68bd90f5fc61
User: jsparkes
Date: 2010-05-20 17:50:14+00:00
Summary: Check for enum and flag derived types in import_gtk_type.
Affected #: 2 files
diff -r 6553f64f1bc643de8d279cf2530c2b86debe59f6 -r 68bd90f5fc611ec407aa5a2aab1d9e97ca93b956 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,9 @@
+2010-05-20 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * ui-gtk.c (import_gtk_flags_internal): Use acons to build alist.
+ (import_gtk_enumeration_internal): Ditto.
+ (import_gtk_type): Check for enum and flag derived types.
+
2010-05-19 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (XLIKE_bevel_area): Commented out use of shadow
diff -r 6553f64f1bc643de8d279cf2530c2b86debe59f6 -r 68bd90f5fc611ec407aa5a2aab1d9e97ca93b956 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -124,6 +124,7 @@
type_already_imported_p (GType t)
{
/* These are cases that we don't need to import */
+#if 0
switch (GTK_FUNDAMENTAL_TYPE (t))
{
case G_TYPE_CHAR:
@@ -149,7 +150,7 @@
//case G_TYPE_GTYPE:
return (1);
}
-
+#endif
if (NILP (Vgtk_types))
{
Vgtk_types = call2 (intern ("make-hashtable"),
@@ -270,13 +271,11 @@
while (vals && vals->value_name)
{
- assoc = Fcons (Fcons (intern (vals->value_nick), make_int (vals->value)), assoc);
- assoc = Fcons (Fcons (intern (vals->value_name), make_int (vals->value)), assoc);
+ acons (intern (vals->value_nick), make_int (vals->value), assoc);
+ acons (intern (vals->value_name), make_int (vals->value), assoc);
vals++;
}
-
- assoc = Fnreverse (assoc);
-
+ /* Should we also index by name? I want to... --jsparkes */
Fputhash (make_int (the_type), assoc, Vgtk_enumeration_info);
}
@@ -292,13 +291,11 @@
while (vals && vals->value_name)
{
- assoc = Fcons (Fcons (intern (vals->value_nick), make_int (vals->value)), assoc);
- assoc = Fcons (Fcons (intern (vals->value_name), make_int (vals->value)), assoc);
+ acons (intern (vals->value_nick), make_int (vals->value), assoc);
+ acons (intern (vals->value_name), make_int (vals->value), assoc);
vals++;
}
-
- assoc = Fnreverse (assoc);
-
+
Fputhash (make_int (the_type), assoc, Vgtk_enumeration_info);
}
@@ -312,22 +309,10 @@
stderr_out ("import_gtk_type %d %s\n", (unsigned int)t, g_type_name(t));
- if (G_TYPE_IS_FUNDAMENTAL (t))
- {
- switch (t)
- {
- case G_TYPE_ENUM:
- import_gtk_enumeration_internal (t);
- break;
- case G_TYPE_FLAGS:
- import_gtk_flags_internal (t);
- break;
- default:
- stderr_out ("import_gtk_type %s\n", g_type_name(t));
- // ABORT();
- break;
- }
- }
+ if (G_TYPE_IS_ENUM (t))
+ import_gtk_enumeration_internal (t);
+ else if (G_TYPE_IS_FLAGS (t))
+ import_gtk_flags_internal (t);
else if (G_IS_OBJECT (t))
import_gtk_object_internal (t);
else
@@ -512,7 +497,6 @@
static Lisp_Object type_to_marshaller_type (GType t)
{
- assert (G_TYPE_IS_FUNDAMENTAL (t));
switch (G_TYPE_FUNDAMENTAL (t))
{
case G_TYPE_NONE:
https://bitbucket.org/xemacs/xemacs/commits/6576002ea7ec/
Changeset: 6576002ea7ec
User: jsparkes
Date: 2010-05-21 15:06:46+00:00
Summary: Use (void) instead of () as argument list.
Affected #: 3 files
diff -r 68bd90f5fc611ec407aa5a2aab1d9e97ca93b956 -r 6576002ea7ec3d1f453a6a9a7c09d3603c3582e7 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,10 @@
+2010-05-21 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * glyphs-gtk.c (check_cursor_names): Use (void) instead of () as
+ argument list.
+
+ * ui-gtk.c (check_enumeration_hashtable): Ditto
+
2010-05-20 Jeff Sparkes <jsparkes(a)gmail.com>
* ui-gtk.c (import_gtk_flags_internal): Use acons to build alist.
diff -r 68bd90f5fc611ec407aa5a2aab1d9e97ca93b956 -r 6576002ea7ec3d1f453a6a9a7c09d3603c3582e7 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -606,7 +606,7 @@
* the rest are done in lisp.
*/
static void
-check_cursor_names ()
+check_cursor_names (void)
{
if (NILP (Vgtk_cursor_names))
{
diff -r 68bd90f5fc611ec407aa5a2aab1d9e97ca93b956 -r 6576002ea7ec3d1f453a6a9a7c09d3603c3582e7 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -251,7 +251,7 @@
}
static void
-check_enumeration_hashtable ()
+check_enumeration_hashtable (void)
{
if (NILP (Vgtk_enumeration_info))
Vgtk_enumeration_info = call2 (intern ("make-hashtable"),
@@ -378,7 +378,7 @@
#define MANY_ARGS
#endif
-typedef void (*pfv)();
+typedef void (*pfv)(void);
typedef GtkObject * (*__OBJECT_fn) (MANY_ARGS);
typedef gint (*__INT_fn) (MANY_ARGS);
typedef void (*__NONE_fn) (MANY_ARGS);
https://bitbucket.org/xemacs/xemacs/commits/104195b32af6/
Changeset: 104195b32af6
User: jsparkes
Date: 2010-05-21 15:11:07+00:00
Summary: Correctly define GTK_DATA_TAB_HASHCODE_IDENTIFIER as a GQuark.
Affected #: 2 files
diff -r 6576002ea7ec3d1f453a6a9a7c09d3603c3582e7 -r 104195b32af6bd134328cd0812fd28beaba3fe32 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-05-21 Jeff Sparkes <jsparkes(a)gmail.com>
+ * console-gtk-impl.h (GTK_DATA_TAB_HASHCODE_IDENTIFIER): Correctly
+ define as a GQuark.
+
* glyphs-gtk.c (check_cursor_names): Use (void) instead of () as
argument list.
diff -r 6576002ea7ec3d1f453a6a9a7c09d3603c3582e7 -r 104195b32af6bd134328cd0812fd28beaba3fe32 src/console-gtk-impl.h
--- a/src/console-gtk-impl.h
+++ b/src/console-gtk-impl.h
@@ -261,7 +261,7 @@
#define GTK_DATA_FRAME_IDENTIFIER g_quark_from_string ("xemacs::frame")
/* The hashcode in the frame hash table of a tab_control tab's callback data. */
-#define GTK_DATA_TAB_HASHCODE_IDENTIFIER g_quark_static_string ("xemacs::tab_hashcode")
+#define GTK_DATA_TAB_HASHCODE_IDENTIFIER g_quark_from_string ("xemacs::tab_hashcode")
#define GTK_DATA_GUI_IDENTIFIER g_quark_from_string ("xemacs::gui_id")
https://bitbucket.org/xemacs/xemacs/commits/06c4e11b4aed/
Changeset: 06c4e11b4aed
User: jsparkes
Date: 2010-05-21 15:24:56+00:00
Summary: GNoteBookPage no longer has a child, so attach the data to the widget itself.
Use GLib type conversion macros for attached data.
Affected #: 2 files
diff -r 104195b32af6bd134328cd0812fd28beaba3fe32 -r 06c4e11b4aed890dba193f53a0d7a70f233946c7 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,10 @@
2010-05-21 Jeff Sparkes <jsparkes(a)gmail.com>
+ * glyphs-gtk.c (gtk_tab_control_callback): Use GLib type
+ conversion macros for attached data.
+ (gtk_tab_control_callback): Ditto. GNoteBookPage no longer has a
+ child, so attach the data to the widget itself.
+
* console-gtk-impl.h (GTK_DATA_TAB_HASHCODE_IDENTIFIER): Correctly
define as a GQuark.
diff -r 104195b32af6bd134328cd0812fd28beaba3fe32 -r 06c4e11b4aed890dba193f53a0d7a70f233946c7 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -2569,8 +2569,8 @@
worry about the garbage collector running between here and the callback
function.
*/
- gtk_object_set_data(GTK_OBJECT(box), GTK_DATA_TAB_HASHCODE_IDENTIFIER,
- (gpointer) hash_id);
+ g_object_set_qdata(G_OBJECT(box), GTK_DATA_TAB_HASHCODE_IDENTIFIER,
+ GUINT_TO_POINTER (hash_id));
gtk_notebook_append_page (nb, box, gtk_label_new (c_name));
}
@@ -2599,8 +2599,8 @@
return;
frame = wrap_frame (f);
- id = (int) g_object_get_qdata(GTK_OBJECT(page->child),
- GTK_DATA_TAB_HASHCODE_IDENTIFIER);
+ id = GPOINTER_TO_UINT (g_object_get_qdata(G_OBJECT(page),
+ GTK_DATA_TAB_HASHCODE_IDENTIFIER));
image_instance = Fgethash(make_int_verify(id),
FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE(f), Qnil);
callback = Fgethash(make_int(id),
https://bitbucket.org/xemacs/xemacs/commits/dd87dc148bc5/
Changeset: dd87dc148bc5
User: jsparkes
Date: 2010-05-21 15:30:31+00:00
Summary: Move all declarations before code. (Bad C++ habits)
Affected #: 4 files
diff -r 06c4e11b4aed890dba193f53a0d7a70f233946c7 -r dd87dc148bc525e0efa40a51f82e154ef964f495 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,12 @@
2010-05-21 Jeff Sparkes <jsparkes(a)gmail.com>
+ * gtk-glue.c (xemacs_list_to_gtklist): Move all declarations
+ before code. (Bad C++ habits)
+ (xemacs_list_to_gtklist): Ditto.
+ (xemacs_list_to_array): Ditto.
+ redisplay-gtk.c (our_draw_bitmap): Ditto.
+ ui-gtk.c (mark_type_as_imported): Ditto.
+
* glyphs-gtk.c (gtk_tab_control_callback): Use GLib type
conversion macros for attached data.
(gtk_tab_control_callback): Ditto. GNoteBookPage no longer has a
diff -r 06c4e11b4aed890dba193f53a0d7a70f233946c7 -r dd87dc148bc525e0efa40a51f82e154ef964f495 src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -73,10 +73,10 @@
static void
xemacs_list_to_gtklist (Lisp_Object obj, GValue *arg)
{
- CHECK_LIST (obj);
int len;
GValueArray *array;
+ CHECK_LIST (obj);
/*
* The list is converted into an array. I'll figure out
* how to a make a real list later, perhaps. --jsparkes
@@ -85,13 +85,15 @@
//array = g_array_new (0, TRUE, sizeof (GValue *)); // XXX leak?
array = g_value_array_new (len);
- SAFE_LIST_LOOP_2 (elt, obj)
- {
- GValue tmp, *copy;
- lisp_to_g_value (elt, &tmp);
- g_value_copy (&tmp, copy);/* leak XXX */
- g_value_array_append (array, copy);
- }
+ {
+ SAFE_LIST_LOOP_2 (elt, obj)
+ {
+ GValue tmp, *copy;
+ lisp_to_g_value (elt, &tmp);
+ g_value_copy (&tmp, copy);/* leak XXX */
+ g_value_array_append (array, copy);
+ }
+ }
g_value_init (arg, G_TYPE_VALUE_ARRAY);
g_value_set_boxed (arg, array);
@@ -211,12 +213,14 @@
/* Does g_value_array need to be pre-allocated? */
array = g_value_array_new (len);
- LIST_LOOP_3 (elt, obj, tail)
- {
- g_value_reset (&val);
- lisp_to_g_value (elt, &val);
- g_value_array_append (array, &val);
- }
+ {
+ LIST_LOOP_3 (elt, obj, tail)
+ {
+ g_value_reset (&val);
+ lisp_to_g_value (elt, &val);
+ g_value_array_append (array, &val);
+ }
+ }
g_value_set_boxed (arg, array);
diff -r 06c4e11b4aed890dba193f53a0d7a70f233946c7 -r dd87dc148bc525e0efa40a51f82e154ef964f495 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -144,12 +144,12 @@
gint width,
gint height)
{
+ gint src_width, src_height;
+
g_return_if_fail (drawable != NULL);
g_return_if_fail (src != NULL);
g_return_if_fail (gc != NULL);
- gint src_width, src_height;
-
gdk_drawable_get_size (src, &src_width, &src_height);
diff -r 06c4e11b4aed890dba193f53a0d7a70f233946c7 -r dd87dc148bc525e0efa40a51f82e154ef964f495 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -166,13 +166,12 @@
static void
mark_type_as_imported (GType t)
{
+ const gchar *name = g_type_name (t);
+ Lisp_Object value = Fmake_symbol (make_string ((const Ibyte *)name, strlen (name)));
+
if (type_already_imported_p (t))
return;
- /* Value should be a symbol? */
- const gchar *name = g_type_name (t);
- Lisp_Object value = Fmake_symbol (make_string ((const Ibyte *)name, strlen (name)));
-
Fputhash (make_int (G_VALUE_TYPE (t)), value, (Vgtk_types));
}
https://bitbucket.org/xemacs/xemacs/commits/3402d63a7e56/
Changeset: 3402d63a7e56
User: jsparkes
Date: 2010-05-28 13:31:18+00:00
Summary: Merge from trunk.
Affected #: 9 files
diff -r dd87dc148bc525e0efa40a51f82e154ef964f495 -r 3402d63a7e562948409a0346b600b78e89368299 man/ChangeLog
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,20 @@
+2010-05-28 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lispref/windows.texi (Buffers and Windows):
+ Reword the documentation of `buffer-display-count';
+ `buffer-display-time's documentation was taken from a version of
+ the GNU elisp manuwal with a compatible licence,
+ `buffer-display-count' was not.
+
+2010-05-17 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * lispref/windows.texi (Buffers and Windows):
+ Document buffer-display-count and buffer-display-time with
+ descriptions from GNU emacs lispref.
+
+ * lispref/locals.texi (Standard Buffer-Local Variables):
+ Add buffer-display-count and buffer-display-time.
+
2010-04-03 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/hash-tables.texi (Introduction to Hash Tables):
diff -r dd87dc148bc525e0efa40a51f82e154ef964f495 -r 3402d63a7e562948409a0346b600b78e89368299 man/lispref/locals.texi
--- a/man/lispref/locals.texi
+++ b/man/lispref/locals.texi
@@ -25,9 +25,15 @@
@item buffer-backed-up
@pxref{Backup Files}
+@item buffer-display-count
+@xref{Buffers and Windows}.
+
@item buffer-display-table
@pxref{Display Tables}
+@item buffer-display-time
+@xref{Buffers and Windows}.
+
@item buffer-file-format
@pxref{Format Conversion}
diff -r dd87dc148bc525e0efa40a51f82e154ef964f495 -r 3402d63a7e562948409a0346b600b78e89368299 man/lispref/windows.texi
--- a/man/lispref/windows.texi
+++ b/man/lispref/windows.texi
@@ -705,6 +705,11 @@
@end example
@end defun
+@defvar buffer-display-count
+This variable, local to a given buffer, reflects the number of times
+XEmacs has displayed the buffer in a window.
+@end defvar
+
@defun window-buffer &optional window
This function returns the buffer that @var{window} is displaying. If
@var{window} is omitted, this function returns the buffer for the
@@ -729,6 +734,16 @@
the same meaning as for @code{next-window}.
@end defun
+
+@defvar buffer-display-time
+This variable records the time at which a buffer was last made visible
+in a window. It is always local in each buffer; each time
+@code{set-window-buffer} is called, it sets this variable to
+@code{(current-time)} in the specified buffer (@pxref{Time of Day}).
+When a buffer is first created, @code{buffer-display-time} starts out
+with the value @code{nil}.
+@end defvar
+
@node Displaying Buffers
@section Displaying Buffers in Windows
@cindex switching to a buffer
diff -r dd87dc148bc525e0efa40a51f82e154ef964f495 -r 3402d63a7e562948409a0346b600b78e89368299 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
+2010-05-24 Mike Sperber <mike(a)xemacs.org>
+
+ * lread.c (read1): Accept #B<binary>, #O<octal>, and #X<hex>, just
+ like GNU Emacs.
+
+2010-05-17 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * buffer.c (complex_vars_of_buffer):
+ Add buffer local variables buffer-display-count and
+ buffer-display-time.
+ (common_init_complex_vars_of_buffer):
+ Initialize them here.
+
+ * bufslots.h: Add slots for buffer-display-count and buffer-display-time.
+
+ * window.c (Fset_window_buffer): Update buffer-display-count and
+ buffer-display-time whenever a buffer is displayed.
+
2010-05-16 Aidan Kehoe <kehoea(a)parhasard.net>
Move `default-file-system-ignore-case' to C; pay attention to it
diff -r dd87dc148bc525e0efa40a51f82e154ef964f495 -r 3402d63a7e562948409a0346b600b78e89368299 src/buffer.c
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2307,6 +2307,8 @@
#ifdef MULE
buffer_local_flags.category_table = resettable;
#endif
+ buffer_local_flags.display_time = always_local_no_default;
+ buffer_local_flags.display_count = make_int (0);
buffer_local_flags.modeline_format = make_int (1<<0);
buffer_local_flags.abbrev_mode = make_int (1<<1);
@@ -2800,6 +2802,18 @@
set when a file is visited. Automatically local in all buffers.
*/ );
+ DEFVAR_BUFFER_LOCAL ("buffer-display-count", display_count /*
+A number incremented each time this buffer is displayed in a window.
+The function `set-window-buffer' updates it.
+*/ );
+
+ DEFVAR_BUFFER_LOCAL ("buffer-display-time", display_time /*
+Time stamp updated each time this buffer is displayed in a window.
+The function `set-window-buffer' updates this variable
+to the value obtained by calling `current-time'.
+If the buffer has never been shown in a window, the value is nil.
+*/);
+
DEFVAR_BUFFER_LOCAL_MAGIC ("buffer-invisibility-spec", invisibility_spec /*
Invisibility spec of this buffer.
The default is t, which means that text is invisible
diff -r dd87dc148bc525e0efa40a51f82e154ef964f495 -r 3402d63a7e562948409a0346b600b78e89368299 src/bufslots.h
--- a/src/bufslots.h
+++ b/src/bufslots.h
@@ -216,6 +216,12 @@
/* The string generated by formatting the modeline in this buffer. */
MARKED_SLOT (generated_modeline_string)
+ /* Incremented each time a buffer is displayed using set-window-buffer. */
+ MARKED_SLOT (display_count)
+
+ /* Last time this buffer was displayed using set-window-buffer. */
+ MARKED_SLOT (display_time)
+
/* A hash table that maps from a "generic extent" (an extent in
`modeline-format') into a buffer-specific extent. */
MARKED_SLOT (modeline_extent_table)
diff -r dd87dc148bc525e0efa40a51f82e154ef964f495 -r 3402d63a7e562948409a0346b600b78e89368299 src/lisp.h
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4554,6 +4554,7 @@
EXFUN (Fbuffer_substring, 3);
EXFUN (Fchar_after, 2);
EXFUN (Fchar_to_string, 1);
+EXFUN (Fcurrent_time, 0);
EXFUN (Fdelete_region, 3);
EXFUN (Feobp, 1);
EXFUN (Feolp, 1);
diff -r dd87dc148bc525e0efa40a51f82e154ef964f495 -r 3402d63a7e562948409a0346b600b78e89368299 src/lread.c
--- a/src/lread.c
+++ b/src/lread.c
@@ -2652,11 +2652,11 @@
/* bit vectors */
case '*': return read_bit_vector (readcharfun);
/* #o10 => 8 -- octal constant syntax */
- case 'o': return read_integer (readcharfun, 8);
+ case 'o': case 'O': return read_integer (readcharfun, 8);
/* #xdead => 57005 -- hex constant syntax */
- case 'x': return read_integer (readcharfun, 16);
+ case 'x': case 'X': return read_integer (readcharfun, 16);
/* #b010 => 2 -- binary constant syntax */
- case 'b': return read_integer (readcharfun, 2);
+ case 'b': case 'B': return read_integer (readcharfun, 2);
/* #r"raw\stringt" -- raw string syntax */
case 'r': return read_raw_string(readcharfun);
/* #s(foobar key1 val1 key2 val2) -- structure syntax */
diff -r dd87dc148bc525e0efa40a51f82e154ef964f495 -r 3402d63a7e562948409a0346b600b78e89368299 src/window.c
--- a/src/window.c
+++ b/src/window.c
@@ -3757,6 +3757,11 @@
Fset_buffer (buffer);
}
+ if (NILP (XBUFFER (buffer)->display_count))
+ XBUFFER (buffer)->display_count = make_int (1);
+ else
+ XBUFFER (buffer)->display_count = make_int (1 + XINT (XBUFFER (buffer)->display_count));
+ XBUFFER (buffer)->display_time = Fcurrent_time();
return Qnil;
}
https://bitbucket.org/xemacs/xemacs/commits/7b11faa524a1/
Changeset: 7b11faa524a1
User: jsparkes
Date: 2010-05-31 17:54:08+00:00
Summary: Changes from other.
Affected #: 11 files
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,29 @@
+2010-05-31 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * frame-impl.h (struct frame): Add gtk_toolbars here. This is the
+ wrong place, but it's used for now. Add a checksum slot.
+ (FRAME_GTK_TOOLBAR_WIDGET): Define accessor.
+ (FRAME_GTK_TOOLBAR_CHECKSUM): Define accessor.
+
+ * toolbar-gtk.c (gtk_toolbar_callback): Link to lisp callback.
+ (gtk_clear_toolbar): Delete toolbar widgets. Disabled.
+ (gtk_clear_frame_toolbars): Clear all toolbars on frame.
+ (gtk_output_toolbar): Create Gtk toolbar and buttons.
+ (gtk_output_frame_toolbars): Loop and create visible toolbars.
+ (console_type_create_toolbar_gtk): Define output, initialize and
+ free methods.
+ (vars_of_toolbar_gtk): Provide 'toolbar-gtk.
+
+2010-05-30 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * glyphs-gtk.c (gtk_map_subwindow): Replace deprecated code with
+ gtk_widget_queue_draw().
+
+2010-05-24 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * ui-gtk.c (type_to_marshaller_type): Always check fundamental
+ types first. Next check for GObjects and then enums or flags.
+
2010-05-21 Jeff Sparkes <jsparkes(a)gmail.com>
* gtk-glue.c (xemacs_list_to_gtklist): Move all declarations
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/device-gtk.c
--- a/src/device-gtk.c
+++ b/src/device-gtk.c
@@ -296,23 +296,6 @@
DEVICE_GTK_COLORMAP (d) = cmap;
DEVICE_GTK_DEPTH (d) = visual->depth;
- /* Should this be easier to figure out? --jsparkes */
- {
-#ifdef USE_PANGO
- PangoFontDescription *pango_desc;
- Display *disp = GDK_DRAWABLE_XDISPLAY (drawable);
- int screen = GDK_SCREEN_XNUMBER (gdk_drawable_get_screen (drawable));
-
- context = pango_xft_get_context (display, screen);
- pango_desc = pango_font_description_new ();
-/* pango_desc = pango_font_description_from_string ("monospace 12"); */
- pango_font_description_set_family (pango_desc, extname);
-/* pango_font_description_set_size (pango_desc, 12); */
-
- DEVICE_GTK_CONTEXT (d) = context;
- assert (DEVICE_GTK_CONTEXT (d) != NULL);
-#endif
- }
{
GtkWidget *w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -320,6 +303,25 @@
gtk_container_add (GTK_CONTAINER (w), app_shell);
gtk_widget_realize (w);
+ {
+#ifdef USE_PANGO
+ PangoContext *context = 0;
+ PangoFontDescription *pango_desc = 0;
+ PangoFontMap *font_map = 0;
+ Display *disp = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (w));
+ int screen = GDK_SCREEN_XNUMBER (gtk_widget_get_screen (w));
+
+ context = pango_xft_get_context (disp, screen);
+ DEVICE_GTK_CONTEXT (d) = context;
+
+ pango_desc = pango_font_description_new ();
+ font_map = pango_xft_get_font_map (disp, screen);
+
+ DEVICE_GTK_FONT_MAP (d) = font_map;
+ /* pango_desc = pango_font_description_from_string ("monospace 12"); */
+ /* pango_font_description_set_size (pango_desc, 12); */
+#endif
+ }
}
DEVICE_GTK_APP_SHELL (d) = app_shell;
@@ -335,12 +337,12 @@
gdk_atom_intern("CLIPBOARD", FALSE),
GDK_SELECTION_TYPE_STRING, 0);
- gtk_signal_connect (GTK_OBJECT (app_shell), "selection_get",
+ g_signal_connect (G_OBJECT (app_shell), "selection_get",
GTK_SIGNAL_FUNC (emacs_gtk_selection_handle), NULL);
- gtk_signal_connect (GTK_OBJECT (app_shell), "selection_clear_event",
+ g_signal_connect (G_OBJECT (app_shell), "selection_clear_event",
GTK_SIGNAL_FUNC (emacs_gtk_selection_clear_event_handle),
NULL);
- gtk_signal_connect (GTK_OBJECT (app_shell), "selection_received",
+ g_signal_connect (G_OBJECT (app_shell), "selection_received",
GTK_SIGNAL_FUNC (emacs_gtk_selection_received), NULL);
DEVICE_GTK_WM_COMMAND_FRAME (d) = Qnil;
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/event-gtk.c
--- a/src/event-gtk.c
+++ b/src/event-gtk.c
@@ -1345,7 +1345,7 @@
*/
#if 0
if (!NILP (Vmenu_accelerator_enabled)
- && gtk_accel_groups_activate(GTK_OBJECT (FRAME_GTK_SHELL_WIDGET(frame)),
+ && gtk_accel_groups_activate(G_OBJECT (FRAME_GTK_SHELL_WIDGET(frame)),
key_event->keyval,
(GdkModifierType) *state))
{
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -128,8 +128,8 @@
for (; w; w = w->parent)
{
- if ((f = (struct frame *) g_object_get_qdata (G_OBJECT(GTK_OBJECT (w)),
- GTK_DATA_FRAME_IDENTIFIER)))
+ if ((f = (struct frame *) g_object_get_qdata (G_OBJECT(w),
+ GTK_DATA_FRAME_IDENTIFIER)))
return (f);
}
@@ -841,7 +841,7 @@
{
/* If this is a transient window, keep the parent info around */
GtkWidget *parentwid = FRAME_GTK_SHELL_WIDGET (XFRAME (parent));
- gtk_object_set_data (GTK_OBJECT (shell), TRANSIENT_DATA_IDENTIFIER, parentwid);
+ g_object_set_data (G_OBJECT (shell), TRANSIENT_DATA_IDENTIFIER, parentwid);
gtk_window_set_transient_for (GTK_WINDOW (shell), GTK_WINDOW (parentwid));
}
@@ -849,7 +849,7 @@
/* Add a mapping from widget to frame to help widget callbacks quickly find
their corresponding frame. */
- g_object_set_qdata (G_OBJECT (GTK_OBJECT (shell)), GTK_DATA_FRAME_IDENTIFIER, f);
+ g_object_set_qdata (G_OBJECT (G_OBJECT (shell)), GTK_DATA_FRAME_IDENTIFIER, f);
FRAME_GTK_SHELL_WIDGET (f) = shell;
@@ -867,12 +867,12 @@
gtk_drag_dest_set (text, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT,
dnd_target_table, dnd_n_targets,
GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_ASK);
- gtk_signal_connect (GTK_OBJECT (text), "drag_drop",
- GTK_SIGNAL_FUNC (dragndrop_dropped), text);
- gtk_signal_connect (GTK_OBJECT (text), "drag_data_received",
- GTK_SIGNAL_FUNC (dragndrop_data_received), text);
- gtk_signal_connect (GTK_OBJECT (text), "drag_data_get",
- GTK_SIGNAL_FUNC (dragndrop_get_drag), NULL);
+ g_signal_connect (G_OBJECT (text), "drag_drop",
+ G_SIGNAL_FUNC (dragndrop_dropped), text);
+ g_signal_connect (GTK_OBJECT (text), "drag_data_received",
+ G_SIGNAL_FUNC (dragndrop_data_received), text);
+ g_signal_connect (G_OBJECT (text), "drag_data_get",
+ GTK_SIGNAL_FUNC (dragndrop_get_drag), NULL);
#endif
#ifdef HAVE_MENUBARS
@@ -894,7 +894,7 @@
gtk_box_pack_end (GTK_BOX (container), text, TRUE, TRUE, 0);
/* Connect main event handler */
- gtk_signal_connect (GTK_OBJECT (shell), "delete-event", GTK_SIGNAL_FUNC (delete_event_cb), f);
+ g_signal_connect (G_OBJECT (shell), "delete-event", GTK_SIGNAL_FUNC (delete_event_cb), f);
{
static const gchar *events_to_frob[] = { "focus-in-event",
@@ -915,12 +915,12 @@
for (i = 0; events_to_frob[i]; i++)
{
- gtk_signal_connect (GTK_OBJECT (shell), events_to_frob[i],
- GTK_SIGNAL_FUNC (emacs_shell_event_handler), f);
+ g_signal_connect (G_OBJECT (shell), events_to_frob[i],
+ GTK_SIGNAL_FUNC (emacs_shell_event_handler), f);
}
}
- gtk_signal_connect (GTK_OBJECT (shell), "size-allocate", GTK_SIGNAL_FUNC (resize_event_cb), f);
+ g_signal_connect (G_OBJECT (shell), "size-allocate", GTK_SIGNAL_FUNC (resize_event_cb), f);
/* This might be safe to call now... */
/* gtk_signal_connect (GTK_OBJECT (shell), "event", GTK_SIGNAL_FUNC (emacs_shell_event_handler), f); */
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/frame-impl.h
--- a/src/frame-impl.h
+++ b/src/frame-impl.h
@@ -101,6 +101,12 @@
whether to re-layout windows by a call to change_frame_size early
in redisplay_frame. */
int current_toolbar_size[NUM_EDGES];
+
+#ifdef HAVE_GTK
+ void *gtk_toolbars[NUM_EDGES];
+ unsigned int gtk_toolbar_checksum[NUM_EDGES];
+#endif
+
#endif
/* Size of gutters as seen by redisplay. This is used to determine
@@ -782,6 +788,13 @@
(FRAME_REAL_TOOLBAR_BOUNDS (f, pos) + FRAME_INTERNAL_BORDER_SIZE (f, pos) + \
FRAME_GUTTER_BOUNDS (f, pos))
+#ifdef HAVE_TOOLBARS
+#ifdef HAVE_GTK
+#define FRAME_GTK_TOOLBAR_WIDGET(f) f->gtk_toolbars
+#define FRAME_GTK_TOOLBAR_CHECKSUM(f, pos) f->gtk_toolbar_checksum[pos]
+#endif
+#endif
+
#endif /* INCLUDED_frame_impl_h_ */
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -2086,7 +2086,7 @@
gtk_widget_map (wid);
}
- gtk_widget_draw (wid, NULL);
+ gtk_widget_queue_draw (wid);
}
}
@@ -2684,8 +2684,8 @@
gtk_notebook_set_page(nb, selected);
/* Call per-tab lisp callback when a tab is pressed. */
- gtk_signal_connect (GTK_OBJECT (nb), "switch-page",
- GTK_SIGNAL_FUNC (gtk_tab_control_callback), NULL);
+ g_signal_connect (G_OBJECT (nb), "switch-page",
+ GTK_SIGNAL_FUNC (gtk_tab_control_callback), NULL);
}
/* Set the properties of a tab control */
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/gtk-glue.c
--- a/src/gtk-glue.c
+++ b/src/gtk-glue.c
@@ -320,9 +320,7 @@
style->bg_pixmap[i] = XIMAGE_INSTANCE_GTK_PIXMAP (pm);
}
-#ifdef JSPARKES
- style->font = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (font));
-#endif
+ gtk_style_set_font (style, FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (font)));
return (style);
}
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/menubar-gtk.c
--- a/src/menubar-gtk.c
+++ b/src/menubar-gtk.c
@@ -57,6 +57,8 @@
g_quark_from_string ("xemacs::menu::gui_id");
static GQuark XEMACS_MENU_FIRSTTIME_TAG =
g_quark_from_string ("xemacs::menu::first_time");
+static GQuark XEMACS_MENU_FRAME_TAG =
+ g_quark_from_string ("xemacs::menu::frame");
static GtkWidget *menu_descriptor_to_widget_1 (Lisp_Object descr, GtkAccelGroup* accel_group);
@@ -70,6 +72,8 @@
** to be bigger than the text widget. This prevents weird resizing
** when jumping around between buffers with radically different menu
** sizes.
+**
+** Currently unused --jsparkes
*/
#define GTK_XEMACS_MENUBAR(obj) GTK_CHECK_CAST (obj, gtk_xemacs_menubar_get_type (), GtkXEmacsMenubar)
@@ -163,8 +167,13 @@
GtkWidget *
gtk_xemacs_menubar_new (struct frame *f)
{
+#if 0
GtkXEmacsMenubar *menubar = (GtkXEmacsMenubar*) gtk_type_new (gtk_xemacs_menubar_get_type ());
menubar->frame = f;
+#endif
+ GtkWidget *menubar = gtk_menu_bar_new ();
+ /* I don't think this is used. --jsparkes */
+ g_object_set_qdata (G_OBJECT (menubar), XEMACS_MENU_FRAME_TAG, f);
return (GTK_WIDGET (menubar));
}
@@ -323,7 +332,7 @@
Lisp_Object menu_desc = Qnil;
GtkWidget *old_submenu = GTK_MENU_ITEM (menu_item)->submenu;
- menu_desc = GET_LISP_FROM_VOID (gtk_object_get_qdata (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
+ menu_desc = GET_LISP_FROM_VOID (g_object_get_qdata (G_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
/* GCPRO all of our very own */
gcpro_popup_callbacks (id, menu_desc);
@@ -380,8 +389,8 @@
{
GtkWidget *selected = gtk_menu_get_active (GTK_MENU (item->submenu));
- gtk_container_foreach (GTK_CONTAINER (item->submenu),(GtkCallback) __maybe_destroy,
- selected);
+ gtk_container_foreach (GTK_CONTAINER (item->submenu),
+ (GtkCallback) __maybe_destroy, selected);
}
else if (gtk_container_children (GTK_CONTAINER (item->submenu)))
{
@@ -397,7 +406,7 @@
GtkWidget *w = gtk_tearoff_menu_item_new ();
gtk_widget_show (w);
gtk_menu_append (GTK_MENU (item->submenu), w);
- gtk_signal_connect (GTK_OBJECT (w), "activate", GTK_SIGNAL_FUNC (__torn_off_sir), item);
+ g_signal_connect (G_OBJECT (w), "activate", GTK_SIGNAL_FUNC (__torn_off_sir), item);
}
#endif
@@ -603,8 +612,8 @@
gtk_widget_show (submenu);
if (!reuse)
- gtk_signal_connect (GTK_OBJECT (menu_item), "destroy",
- GTK_SIGNAL_FUNC (__kill_stupid_gtk_timer), NULL);
+ g_signal_connect (G_OBJECT (menu_item), "destroy",
+ GTK_SIGNAL_FUNC (__kill_stupid_gtk_timer), NULL);
/* Without this sometimes a submenu gets left on the screen -
** urk
@@ -700,8 +709,8 @@
/* If the menu item had a GUI_ID that means it was a filter menu */
__remove_gcpro_by_id (id);
gtk_signal_disconnect_by_func (GTK_OBJECT (reuse),
- GTK_SIGNAL_FUNC (__activate_menu),
- (gpointer) 0x01 );
+ GTK_SIGNAL_FUNC (__activate_menu),
+ (gpointer) 0x01);
}
else
{
@@ -716,9 +725,9 @@
if (NILP (hook_fn))
{
/* Generic menu builder */
- gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
- GTK_SIGNAL_FUNC (__activate_menu),
- NULL);
+ g_signal_connect (G_OBJECT (menu_item), "activate",
+ GTK_SIGNAL_FUNC (__activate_menu),
+ NULL);
}
else
{
@@ -732,9 +741,9 @@
gtk_object_weakref (GTK_OBJECT (menu_item), __remove_gcpro_by_id,
(gpointer) id);
- gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
- GTK_SIGNAL_FUNC (__activate_menu),
- (gpointer) 0x01);
+ g_signal_connect (G_OBJECT (menu_item), "activate",
+ GTK_SIGNAL_FUNC (__activate_menu),
+ (gpointer) 0x01);
}
return (menu_item);
@@ -1013,15 +1022,15 @@
gtk_widget_set_sensitive (widget, ! NILP (active_p));
- gtk_signal_connect (GTK_OBJECT (widget), "activate-item",
- GTK_SIGNAL_FUNC (__generic_button_callback),
- STORE_LISP_IN_VOID (callback));
+ g_signal_connect (G_OBJECT (widget), "activate-item",
+ GTK_SIGNAL_FUNC (__generic_button_callback),
+ STORE_LISP_IN_VOID (callback));
- gtk_signal_connect (GTK_OBJECT (widget), "activate",
- GTK_SIGNAL_FUNC (__generic_button_callback),
- STORE_LISP_IN_VOID (callback));
+ g_signal_connect (G_OBJECT (widget), "activate",
+ GTK_SIGNAL_FUNC (__generic_button_callback),
+ STORE_LISP_IN_VOID (callback));
- /* Now that all the information about the menu item is know, set the
+ /* Now that all the information about the menu item is known, set the
remaining properties.
*/
@@ -1239,8 +1248,8 @@
gtk_box_pack_start (GTK_BOX (FRAME_GTK_CONTAINER_WIDGET (f)), menubar, FALSE, FALSE, 0);
}
- gtk_signal_connect (GTK_OBJECT (menubar), "button-press-event",
- GTK_SIGNAL_FUNC (run_menubar_hook), NULL);
+ g_signal_connect (G_OBJECT (menubar), "button-press-event",
+ GTK_SIGNAL_FUNC (run_menubar_hook), NULL);
FRAME_GTK_MENUBAR_WIDGET (f) = menubar;
g_object_set_qdata (G_OBJECT (menubar), XEMACS_MENU_GUIID_TAG, (gpointer) id);
@@ -1450,8 +1459,8 @@
gtk_widget_show (menu);
popup_up_p++;
- gtk_signal_connect (GTK_OBJECT (menu), "deactivate",
- GTK_SIGNAL_FUNC (popdown_menu_cb), NULL);
+ g_signal_connect (G_OBJECT (menu), "deactivate",
+ GTK_SIGNAL_FUNC (popdown_menu_cb), NULL);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
eev ? EVENT_BUTTON_BUTTON (eev) : 0,
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/scrollbar-gtk.c
--- a/src/scrollbar-gtk.c
+++ b/src/scrollbar-gtk.c
@@ -104,20 +104,20 @@
SCROLLBAR_GTK_VDRAG_ORIG_VALUE (instance) = -1;
SCROLLBAR_GTK_LAST_VALUE (instance) = adj->value;
- g_object_set_qdata (G_OBJECT (GTK_OBJECT (adj)), GTK_DATA_GUI_IDENTIFIER,
+ g_object_set_qdata (G_OBJECT (G_OBJECT (adj)), GTK_DATA_GUI_IDENTIFIER,
(void *) SCROLLBAR_GTK_ID (instance));
- g_object_set_qdata (G_OBJECT (GTK_OBJECT (adj)), GTK_DATA_FRAME_IDENTIFIER,
+ g_object_set_qdata (G_OBJECT (G_OBJECT (adj)), GTK_DATA_FRAME_IDENTIFIER,
f);
sb = GTK_SCROLLBAR (vertical ? gtk_vscrollbar_new (adj) : gtk_hscrollbar_new (adj));
SCROLLBAR_GTK_WIDGET (instance) = GTK_WIDGET (sb);
gtk_range_set_update_policy (GTK_RANGE (sb), GTK_UPDATE_CONTINUOUS);
- assert(g_signal_connect (GTK_OBJECT (sb),"change-value",
+ assert(g_signal_connect (G_OBJECT (sb),"change-value",
G_CALLBACK (scrollbar_cb), (gpointer) vertical));
- assert(gtk_signal_connect (GTK_OBJECT (sb), "button-press-event",
+ assert(g_signal_connect (G_OBJECT (sb), "button-press-event",
GTK_SIGNAL_FUNC (scrollbar_drag_hack_cb), (gpointer) 1));
- assert(gtk_signal_connect (GTK_OBJECT (sb), "button-release-event",
+ assert(g_signal_connect (G_OBJECT (sb), "button-release-event",
GTK_SIGNAL_FUNC (scrollbar_drag_hack_cb), (gpointer) 0));
/* Do we need to connect to "destroy" too? --jsparkes */
@@ -429,12 +429,12 @@
Lisp_Object event_type = Qnil;
Lisp_Object event_data = Qnil;
- f = (struct frame*) g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)),
+ f = (struct frame*) g_object_get_qdata (G_OBJECT (adj),
GTK_DATA_FRAME_IDENTIFIER);
if (!f)
return(FALSE);
- id = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (GTK_OBJECT (adj)),
+ id = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (adj),
GTK_DATA_GUI_IDENTIFIER));
assert (id != 0);
diff -r 3402d63a7e562948409a0346b600b78e89368299 -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 src/toolbar-gtk.c
--- a/src/toolbar-gtk.c
+++ b/src/toolbar-gtk.c
@@ -27,7 +27,13 @@
#include "lisp.h"
#include "frame.h"
+#include "frame-impl.h"
+#include "glyphs.h"
+#include "glyphs-gtk.h"
+#include "window.h"
+#include "window-impl.h"
+#include "toolbar.h"
#include "toolbar-xlike.h"
#include "console-gtk-impl.h"
@@ -36,16 +42,17 @@
** all the shared code. We would then just use
** CONSOLE_INHERITS_METHOD(x,xlike,blah)
*/
-#define gtk_output_frame_toolbars xlike_output_frame_toolbars
-#define gtk_output_toolbar_button xlike_output_toolbar_button
+/* #define gtk_output_frame_toolbars xlike_output_frame_toolbars */
+/* #define gtk_output_toolbar_button xlike_output_toolbar_button */
#define gtk_redraw_exposed_toolbars xlike_redraw_exposed_toolbars
#define gtk_redraw_frame_toolbars xlike_redraw_frame_toolbars
-#define gtk_clear_frame_toolbars xlike_clear_frame_toolbars
+/* #define gtk_clear_frame_toolbars xlike_clear_frame_toolbars */
static void
gtk_initialize_frame_toolbars (struct frame *UNUSED (f))
{
+ stderr_out ("gtk_initialize_frame_toolbars\n");
}
/* This only calls one function but we go ahead and create this in
@@ -53,8 +60,195 @@
static void
gtk_free_frame_toolbars (struct frame *UNUSED (f))
{
+ stderr_out ("gtk_free_frame_toolbars\n");
}
+static void
+gtk_toolbar_callback (GtkWidget *UNUSED (w), gpointer user_data)
+{
+ struct toolbar_button *tb = (struct toolbar_button *) user_data;
+
+ call0 (tb->callback);
+}
+
+void
+gtk_clear_toolbar (struct frame *f, enum edge_pos pos)
+{
+/* FRAME_GTK_TOOLBAR_CHECKSUM (f, pos) = 0; */
+/* SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0); */
+/* if (FRAME_GTK_TOOLBAR_WIDGET(f)[pos]) */
+/* gtk_widget_destroy ((GtkWidget *)FRAME_GTK_TOOLBAR_WIDGET(f)[pos]); */
+}
+
+void
+gtk_clear_frame_toolbars (struct frame *f)
+{
+ stderr_out ("gtk_clear_frame_toolbars\n");
+ enum edge_pos pos;
+
+ EDGE_POS_LOOP (pos)
+ {
+ gtk_clear_toolbar (f, pos);
+ }
+}
+
+static void
+gtk_output_toolbar (struct frame *f, enum edge_pos pos)
+{
+ GtkToolbar *toolbar;
+ Lisp_Object button, window, glyph, instance;
+ unsigned int checksum = 0;
+ struct window *w;
+ int x, y, bar_width, bar_height, vert;
+
+ window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+ w = XWINDOW (window);
+
+ get_toolbar_coords (f, pos, &x, &y, &bar_width, &bar_height, &vert, 0);
+
+ /* Get the toolbar and delete the old widgets in it */
+ button = FRAME_TOOLBAR_BUTTONS (f, pos);
+
+ /* First loop over all of the buttons to determine how many there
+ are. This loop will also make sure that all instances are
+ instantiated so when we actually output them they will come up
+ immediately. */
+ while (!NILP (button))
+ {
+ struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+ checksum = HASH4 (checksum,
+ internal_hash (get_toolbar_button_glyph(w, tb), 0, 0),
+ internal_hash (tb->callback, 0, 0),
+ 0 /* width */);
+ button = tb->next;
+ }
+
+ /* Only do updates if the toolbar has changed, or this is the first
+ time we have drawn it in this position
+ */
+ if (FRAME_GTK_TOOLBAR_WIDGET (f)[pos] &&
+ FRAME_GTK_TOOLBAR_CHECKSUM (f, pos) == checksum)
+ {
+ return;
+ }
+
+ /* Loop through buttons and add them to our toolbar.
+ This code ignores the button dimensions as we let GTK handle that :)
+ Attach the toolbar_button struct to the toolbar button so we know what
+ function to use as a callback. */
+
+ {
+ /* gtk_clear_toolbar (f, pos); */
+ FRAME_GTK_TOOLBAR_WIDGET (f)[pos] = toolbar = (GtkToolbar *)gtk_toolbar_new ();
+ gtk_widget_show (GTK_WIDGET (toolbar));
+ /* gtk_widget_set_name (toolbar, "toolbar"); */
+ if (EDGE_HORIZONTAL_P (pos))
+ {
+ gtk_orientable_set_orientation ((GtkOrientable *)toolbar,
+ GTK_ORIENTATION_HORIZONTAL);
+ /* gtk_widget_set_height (toolbar, bar_height); */
+ }
+ else
+ {
+ gtk_orientable_set_orientation ((GtkOrientable *)toolbar,
+ GTK_ORIENTATION_VERTICAL);
+ /* gtk_widget_set_width (toolbar, bar_width); */
+ }
+ gtk_toolbar_set_show_arrow ((GtkToolbar *)toolbar, TRUE);
+ }
+
+ if (NILP (w->toolbar_buttons_captioned_p))
+ gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_ICONS);
+ else
+ gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_BOTH);
+
+ FRAME_GTK_TOOLBAR_CHECKSUM(f, pos) = checksum;
+ button = FRAME_TOOLBAR_BUTTONS (f, pos);
+
+ while (!NILP (button))
+ {
+ struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+
+ if (tb->blank)
+ {
+ GtkToolItem *item = gtk_separator_tool_item_new ();
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
+ }
+ else
+ {
+ /* It actually has a glyph associated with it! What WILL
+ they think of next?
+ */
+ glyph = tb->up_glyph;
+
+ /* #### It is currently possible for users to trash us by directly
+ changing the toolbar glyphs. Avoid crashing in that case. */
+ if (GLYPHP (glyph))
+ instance = glyph_image_instance (glyph, window,
+ ERROR_ME_DEBUG_WARN, 1);
+ else
+ instance = Qnil;
+
+ if (IMAGE_INSTANCEP(instance))
+ {
+ GtkToolItem *item;
+ GtkWidget *pixmapwid;
+ GdkPixmap *pixmap;
+ GdkBitmap *mask;
+ Ibyte *tooltip = NULL;
+
+ if (STRINGP (tb->help_string))
+ tooltip = XSTRING_DATA (tb->help_string);
+
+/* item = gtk_tool_button_new (GTK_WIDGET (GTK_TOOLBAR (toolbar)), */
+/* (char*)XSTRING_DATA (tb->help_string)); */
+ item = gtk_tool_button_new_from_stock (GTK_STOCK_OPEN);
+
+ pixmap = XIMAGE_INSTANCE_GTK_PIXMAP(instance);
+ mask = XIMAGE_INSTANCE_GTK_MASK(instance);
+ pixmapwid = gtk_pixmap_new (pixmap, mask);
+
+ /* gtk_widget_set_size_request (pixmapwid, tb->width, tb->height); */
+
+ gtk_toolbar_insert (GTK_TOOLBAR(toolbar), item, -1);
+ /*
+ gtk_toolbar_callback, (gpointer) tb);
+ */
+ /* gtk_tool_button_set_icon_widget ((GtkToolButton *)item,
+ pixmapwid); */
+ gtk_tool_item_set_tooltip_text (item, (gchar *)tooltip);
+ }
+ }
+ /* Who's idea was it to use a linked list for toolbar buttons? */
+ button = tb->next;
+ }
+
+ SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
+
+ /* Are these border widths? */
+ x -= vert ? 3 : 2;
+ y -= vert ? 2 : 3;
+
+ gtk_fixed_put (GTK_FIXED (FRAME_GTK_TEXT_WIDGET (f)),
+ GTK_WIDGET (FRAME_GTK_TOOLBAR_WIDGET (f)[pos]), x, y);
+
+ gtk_widget_show_all (GTK_WIDGET (FRAME_GTK_TOOLBAR_WIDGET (f)[pos]));
+ gtk_widget_show_all (GTK_WIDGET (toolbar));
+}
+
+void
+gtk_output_frame_toolbars (struct frame *f)
+{
+ enum edge_pos pos;
+
+ EDGE_POS_LOOP (pos)
+ {
+ if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos))
+ gtk_output_toolbar (f, pos);
+ }
+}
+
+
/************************************************************************/
/* initialization */
@@ -64,10 +258,16 @@
console_type_create_toolbar_gtk (void)
{
CONSOLE_HAS_METHOD (gtk, output_frame_toolbars);
- CONSOLE_HAS_METHOD (gtk, clear_frame_toolbars);
+ /* CONSOLE_HAS_METHOD (gtk, clear_frame_toolbars); */
CONSOLE_HAS_METHOD (gtk, initialize_frame_toolbars);
CONSOLE_HAS_METHOD (gtk, free_frame_toolbars);
- CONSOLE_HAS_METHOD (gtk, output_toolbar_button);
- CONSOLE_HAS_METHOD (gtk, redraw_exposed_toolbars);
- CONSOLE_HAS_METHOD (gtk, redraw_frame_toolbars);
+ /* CONSOLE_HAS_METHOD (gtk, output_toolbar_button); */
+ /* CONSOLE_HAS_METHOD (gtk, redraw_exposed_toolbars); */
+ /* CONSOLE_HAS_METHOD (gtk, redraw_frame_toolbars); */
}
+
+void
+vars_of_toolbar_gtk (void)
+{
+ Fprovide (intern ("toolbar-gtk"));
+}
https://bitbucket.org/xemacs/xemacs/commits/7eafc5203ccc/
Changeset: 7eafc5203ccc
User: jsparkes
Date: 2010-06-01 19:28:04+00:00
Summary: Define EDGE_HORIZONTAL_P. It is already being using in toolbar-gtk.c due
to out of order commits. Oops.
HG
Affected #: 1 file
diff -r 7b11faa524a1cb7e37c033b3c588b4bed21f5db9 -r 7eafc5203cccc56a42a0b104438b748a2ab9df75 src/frame.h
--- a/src/frame.h
+++ b/src/frame.h
@@ -170,6 +170,9 @@
NUM_EDGES
};
+#define EDGE_HORIZONTAL_P(pos) ((pos == TOP_EDGE) || (pos == BOTTOM_EDGE))
+#define EDGE_VERTICAL_P(pos) ((pos == LEFT_EDGE || pos == RIGHT_EDGE))
+
/* Iterate over all possible edge positions */
#define EDGE_POS_LOOP(var) \
for (var = (enum edge_pos) 0; var < NUM_EDGES; \
https://bitbucket.org/xemacs/xemacs/commits/a62e2527cc9e/
Changeset: a62e2527cc9e
User: jsparkes
Date: 2010-06-01 19:29:44+00:00
Summary: Define type aliases GtkString as gchararray and GdkWindow as a pointer.
Affected #: 2 files
diff -r 7eafc5203cccc56a42a0b104438b748a2ab9df75 -r a62e2527cc9e4d1c5eb34d7305d70a09d1596f28 lisp/ChangeLog.GTK
--- a/lisp/ChangeLog.GTK
+++ b/lisp/ChangeLog.GTK
@@ -1,3 +1,8 @@
+2010-06-01 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * gtk-ffi.el (gtk-type-aliases): Define GtkString as gchararray
+ and GdkWindow as a pointer.
+
2000-09-12 William M. Perry <wmperry(a)aventail.com>
* dialog-gtk.el (popup-builtin-open-dialog): Went back to
diff -r 7eafc5203cccc56a42a0b104438b748a2ab9df75 -r a62e2527cc9e4d1c5eb34d7305d70a09d1596f28 lisp/gtk-ffi.el
--- a/lisp/gtk-ffi.el
+++ b/lisp/gtk-ffi.el
@@ -29,10 +29,12 @@
;; This file is dumped with XEmacs.
(defvar gtk-type-aliases '((GType . guint)
+ (GtkString . gchararray)
(GdkAtom . gulong)
(GdkBitmap . GdkWindow)
(time_t . guint)
(none . void)
+ (GdkWindow . gpointer)
(GdkDrawable . GdkWindow)
(GdkBitmap . GdkWindow)
(GdkPixmap . GdkWindow))
https://bitbucket.org/xemacs/xemacs/commits/11bf75cd3bab/
Changeset: 11bf75cd3bab
User: jsparkes
Date: 2010-06-01 19:34:24+00:00
Summary: Comment out serveral GtkWidget fields I don't know how to handle yet.
Comment out obsolete types that are no longer in 2.x.
Affected #: 2 files
diff -r a62e2527cc9e4d1c5eb34d7305d70a09d1596f28 -r 11bf75cd3bab5ac897b77e9cb124fcbe8f08b0c7 lisp/ChangeLog.GTK
--- a/lisp/ChangeLog.GTK
+++ b/lisp/ChangeLog.GTK
@@ -1,5 +1,9 @@
2010-06-01 Jeff Sparkes <jsparkes(a)gmail.com>
+ * gtk-widget-accessors.el ("../src/emacs-widget-accessors.c"):
+ Comment out serveral GtkWidget fields I don't handle yet. Comment
+ out obsolete types that are no longer in 2.x.
+
* gtk-ffi.el (gtk-type-aliases): Define GtkString as gchararray
and GdkWindow as a pointer.
diff -r a62e2527cc9e4d1c5eb34d7305d70a09d1596f28 -r 11bf75cd3bab5ac897b77e9cb124fcbe8f08b0c7 lisp/gtk-widget-accessors.el
--- a/lisp/gtk-widget-accessors.el
+++ b/lisp/gtk-widget-accessors.el
@@ -76,18 +76,19 @@
"\t(obj))\n"
"{\n"
(format "\t%s *the_obj = NULL;\n" gtk-class)
- "\tGtkArg arg;\n"
+ "\tGValue arg;\n"
"\n"
"\tCHECK_GTK_OBJECT (obj);\n"
"\n"
- (format "\tif (!G_IS_%s (XGTK_OBJECT (obj)->object))\n" wrapper)
+ (format "\tif (!GTK_IS_%s (XGTK_OBJECT (obj)->object))\n" wrapper)
"\t{\n"
(format "\t\twtaerror (\"Object is not a %s\", obj);\n" gtk-class)
"\t};\n"
"\n"
(format "\tthe_obj = G_%s (XGTK_OBJECT (obj)->object);\n" wrapper)
- (format "\targ.type = gtk_type_from_name (\"%s\");\n" (symbol-name (car arg))))
+ ;;(format "\targ.type = g_type_from_name (\"%s\");\n" (symbol-name (car arg)))
+ )
; (format "\targ.type = GTK_TYPE_%s;\n" (or
; (nth (gtk-fundamental-type (car arg))
; gtk-value-accessor-names)
@@ -99,12 +100,12 @@
(setq base-arg-type (gtk-fundamental-type (car arg)))
(cond
- ((= base-arg-type GTK_TYPE_OBJECT)
+ ((= base-arg-type G_TYPE_OBJECT)
(insert
(format "\tG_VALUE_OBJECT (arg) = G_OBJECT (the_obj->%s);"
(cdr arg))))
- ((or (= base-arg-type GTK_TYPE_POINTER)
- (= base-arg-type GTK_TYPE_BOXED))
+ ((or (= base-arg-type G_TYPE_POINTER)
+ (= base-arg-type G_TYPE_BOXED))
(insert
(format "\tG_VALUE_%s (arg) = (void *)the_obj->%s;"
(nth (gtk-fundamental-type (car arg)) gtk-value-accessor-names)
@@ -116,7 +117,7 @@
(cdr arg)))))
(insert
"\n"
- "\treturn (gtk_type_to_lisp (&arg));\n"
+ "\treturn (g_type_to_lisp (&arg));\n"
"}\n\n")
(push c-func-name func-names))
func-names))
@@ -163,10 +164,10 @@
(gfloat . page_size))
'GtkWidget "WIDGET" "widget"
- '((GtkStyle . style)
- (GdkWindow . window)
- (GtkStateType . state)
- (GtkString . name)
+ '(;(GtkStyle . style)
+ ;;(GdkWindow . window)
+ (gpointer . window)
+ (gchararray . name)
(GtkWidget . parent))
'GtkButton "BUTTON" "button"
@@ -249,24 +250,24 @@
(gboolean . child1_shrink)
(gboolean . child2_shrink))
- 'GtkCList "CLIST" "clist"
- '((gint . rows)
- (gint . columns)
- (GtkAdjustment . hadjustment)
- (GtkAdjustment . vadjustment)
- (GtkSortType . sort_type)
- (gint . focus_row)
- (gint . sort_column))
+;; 'GtkCList "CLIST" "clist"
+;; '((gint . rows)
+;; (gint . columns)
+;; (GtkAdjustment . hadjustment)
+;; (GtkAdjustment . vadjustment)
+;; (GtkSortType . sort_type)
+;; (gint . focus_row)
+;; (gint . sort_column))
- 'GtkList "LIST" "list"
- '((GtkListOfObject . children)
- (GtkListOfObject . selection))
+;; 'GtkList "LIST" "list"
+;; '((GtkListOfObject . children)
+;; (GtkListOfObject . selection))
- 'GtkTree "TREE" "tree"
- '((GtkListOfObject . children)
- (GtkTree . root_tree)
- (GtkWidget . tree_owner)
- (GtkListOfObject . selection))
+;; 'GtkTree "TREE" "tree"
+;; '((GtkListOfObject . children)
+;; (GtkTree . root_tree)
+;; (GtkWidget . tree_owner)
+;; (GtkListOfObject . selection))
'GtkTreeItem "TREE_ITEM" "tree-item"
'((GtkWidget . subtree))
https://bitbucket.org/xemacs/xemacs/commits/1438cb0375cd/
Changeset: 1438cb0375cd
User: jsparkes
Date: 2010-06-01 19:38:04+00:00
Summary: Replace GtkType with GType everywhere for Gtk 2.x.
Comment out removed widgets and related functions for GtkPacker type.
Affected #: 2 files
diff -r 11bf75cd3bab5ac897b77e9cb124fcbe8f08b0c7 -r 1438cb0375cd026f64a8fea91d22aff0f2f31a3a lisp/ChangeLog.GTK
--- a/lisp/ChangeLog.GTK
+++ b/lisp/ChangeLog.GTK
@@ -1,5 +1,9 @@
2010-06-01 Jeff Sparkes <jsparkes(a)gmail.com>
+ * gtk-widgets.el (GType): Replace GtkType with GType everyone for
+ Gtk 2.x. Comment out removed widgets and related functions for
+ GtkPacker type.
+
* gtk-widget-accessors.el ("../src/emacs-widget-accessors.c"):
Comment out serveral GtkWidget fields I don't handle yet. Comment
out obsolete types that are no longer in 2.x.
diff -r 11bf75cd3bab5ac897b77e9cb124fcbe8f08b0c7 -r 1438cb0375cd026f64a8fea91d22aff0f2f31a3a lisp/gtk-widgets.el
--- a/lisp/gtk-widgets.el
+++ b/lisp/gtk-widgets.el
@@ -38,14 +38,14 @@
(gtk-import-function GtkAccelGroup gtk_accel_group_new)
-(gtk-import-function GtkType gtk_accel_label_get_type)
+(gtk-import-function GType gtk_accel_label_get_type)
(gtk-import-function GtkWidget gtk_accel_label_new GtkString)
(gtk-import-function guint gtk_accel_label_get_accel_width GtkAccelLabel)
(gtk-import-function nil gtk_accel_label_set_accel_widget GtkAccelLabel GtkWidget)
(gtk-import-function gboolean gtk_accel_label_refetch GtkAccelLabel)
-(gtk-import-function GtkType gtk_adjustment_get_type)
+(gtk-import-function GType gtk_adjustment_get_type)
(gtk-import-function GtkObject gtk_adjustment_new gfloat gfloat gfloat gfloat gfloat gfloat)
(gtk-import-function nil gtk_adjustment_changed GtkAdjustment)
(gtk-import-function nil gtk_adjustment_value_changed GtkAdjustment)
@@ -53,25 +53,25 @@
(gtk-import-function nil gtk_adjustment_set_value GtkAdjustment gfloat)
-(gtk-import-function GtkType gtk_alignment_get_type)
+(gtk-import-function GType gtk_alignment_get_type)
(gtk-import-function GtkWidget gtk_alignment_new gfloat gfloat gfloat gfloat)
(gtk-import-function nil gtk_alignment_set GtkAlignment gfloat gfloat gfloat gfloat)
-(gtk-import-function GtkType gtk_arrow_get_type)
+(gtk-import-function GType gtk_arrow_get_type)
(gtk-import-function GtkWidget gtk_arrow_new GtkArrowType GtkShadowType)
(gtk-import-function nil gtk_arrow_set GtkArrow GtkArrowType GtkShadowType)
-(gtk-import-function GtkType gtk_aspect_frame_get_type)
+(gtk-import-function GType gtk_aspect_frame_get_type)
(gtk-import-function GtkWidget gtk_aspect_frame_new GtkString gfloat gfloat gfloat gboolean)
(gtk-import-function nil gtk_aspect_frame_set GtkAspectFrame gfloat gfloat gfloat gboolean)
-(gtk-import-function GtkType gtk_bin_get_type)
+(gtk-import-function GType gtk_bin_get_type)
-(gtk-import-function GtkType gtk_box_get_type)
+(gtk-import-function GType gtk_box_get_type)
(gtk-import-function nil gtk_box_pack_start
(GtkBox . box)
(GtkWidget . child)
@@ -124,7 +124,7 @@
(GtkPackType . pack_type))
-(gtk-import-function GtkType gtk_button_get_type)
+(gtk-import-function GType gtk_button_get_type)
(gtk-import-function GtkWidget gtk_button_new)
(gtk-import-function GtkWidget gtk_button_new_with_label GtkString)
(gtk-import-function nil gtk_button_pressed GtkButton)
@@ -147,7 +147,7 @@
button))
-(gtk-import-function GtkType gtk_button_box_get_type)
+(gtk-import-function GType gtk_button_box_get_type)
;Handcoded in ui-byhand.c... #### FIXME
;;;void gtk_button_box_get_child_size_default (gint *min_width, gint *min_height);
@@ -169,7 +169,7 @@
(gtk-import-function nil gtk_button_box_set_child_ipadding GtkButtonBox gint gint)
-(gtk-import-function GtkType gtk_calendar_get_type)
+(gtk-import-function GType gtk_calendar_get_type)
(gtk-import-function GtkWidget gtk_calendar_new)
(gtk-import-function gint gtk_calendar_select_month GtkCalendar guint guint)
(gtk-import-function nil gtk_calendar_select_day GtkCalendar guint)
@@ -188,12 +188,12 @@
(gtk-import-function nil gtk_calendar_thaw GtkCalendar)
-(gtk-import-function GtkType gtk_check_button_get_type)
+(gtk-import-function GType gtk_check_button_get_type)
(gtk-import-function GtkWidget gtk_check_button_new)
(gtk-import-function GtkWidget gtk_check_button_new_with_label GtkString)
-(gtk-import-function GtkType gtk_check_menu_item_get_type)
+(gtk-import-function GType gtk_check_menu_item_get_type)
(gtk-import-function GtkWidget gtk_check_menu_item_new)
(gtk-import-function GtkWidget gtk_check_menu_item_new_with_label GtkString)
(gtk-import-function nil gtk_check_menu_item_set_active GtkCheckMenuItem gboolean)
@@ -201,7 +201,7 @@
(gtk-import-function nil gtk_check_menu_item_toggled GtkCheckMenuItem)
-(gtk-import-function GtkType gtk_clist_get_type)
+(gtk-import-function GType gtk_clist_get_type)
(gtk-import-function GtkWidget gtk_clist_new gint)
(gtk-import-function GtkWidget gtk_clist_new_with_titles
@@ -446,7 +446,7 @@
;; ColorSelection
-(gtk-import-function GtkType gtk_color_selection_get_type)
+(gtk-import-function GType gtk_color_selection_get_type)
(gtk-import-function GtkWidget gtk_color_selection_new)
(gtk-import-function nil gtk_color_selection_set_update_policy GtkColorSelection GtkUpdateType)
(gtk-import-function nil gtk_color_selection_set_opacity GtkColorSelection gint)
@@ -457,11 +457,11 @@
; gdouble *color);
;; ColorSelectionDialog
-(gtk-import-function GtkType gtk_color_selection_dialog_get_type)
+(gtk-import-function GType gtk_color_selection_dialog_get_type)
(gtk-import-function GtkWidget gtk_color_selection_dialog_new GtkString)
-(gtk-import-function GtkType gtk_combo_get_type)
+(gtk-import-function GType gtk_combo_get_type)
(gtk-import-function GtkWidget gtk_combo_new)
;; the text in the entry must be or not be in the list
@@ -487,7 +487,7 @@
(gtk-import-function nil gtk_combo_disable_activate GtkCombo)
-(gtk-import-function GtkType gtk_container_get_type)
+(gtk-import-function GType gtk_container_get_type)
(gtk-import-function nil gtk_container_set_border_width GtkContainer guint)
(gtk-import-function nil gtk_container_add GtkContainer GtkWidget)
(gtk-import-function nil gtk_container_remove GtkContainer GtkWidget)
@@ -525,7 +525,7 @@
; the `arg_name' argument needs to be a const static string */
;void gtk_container_add_child_arg_type (const gchar *arg_name,
-; GtkType arg_type,
+; GType arg_type,
; guint arg_flags,
; guint arg_id);
@@ -538,7 +538,7 @@
; * It is the callers response to do a
; * g_free (returned_args); g_free (*arg_flags).
; */
-;GtkArg* gtk_container_query_child_args (GtkType class_type,
+;GtkArg* gtk_container_query_child_args (GType class_type,
; guint32 **arg_flags,
; guint *nargs);
@@ -575,7 +575,7 @@
; ...);
-(gtk-import-function GtkType gtk_curve_get_type)
+(gtk-import-function GType gtk_curve_get_type)
(gtk-import-function GtkWidget gtk_curve_new)
(gtk-import-function nil gtk_curve_reset GtkCurve)
(gtk-import-function nil gtk_curve_set_gamma GtkCurve gfloat)
@@ -591,19 +591,19 @@
(gtk-import-function nil gtk_curve_set_curve_type GtkCurve GtkCurveType)
-(gtk-import-function GtkType gtk_data_get_type)
+;; (gtk-import-function GType gtk_data_get_type)
-(gtk-import-function GtkType gtk_dialog_get_type)
+(gtk-import-function GType gtk_dialog_get_type)
(gtk-import-function GtkWidget gtk_dialog_new)
-(gtk-import-function GtkType gtk_drawing_area_get_type)
+(gtk-import-function GType gtk_drawing_area_get_type)
(gtk-import-function GtkWidget gtk_drawing_area_new)
(gtk-import-function nil gtk_drawing_area_size GtkDrawingArea gint gint)
-(gtk-import-function GtkType gtk_editable_get_type)
+(gtk-import-function GType gtk_editable_get_type)
(gtk-import-function nil gtk_editable_select_region GtkEditable gint gint)
;;;Handcoded in ui-byhand.c... #### FIXME
@@ -622,7 +622,7 @@
(gtk-import-function nil gtk_editable_set_editable GtkEditable gboolean)
-(gtk-import-function GtkType gtk_entry_get_type)
+(gtk-import-function GType gtk_entry_get_type)
(gtk-import-function GtkWidget gtk_entry_new)
(gtk-import-function GtkWidget gtk_entry_new_with_max_length guint)
(gtk-import-function nil gtk_entry_set_text GtkEntry GtkString)
@@ -640,11 +640,11 @@
(gtk-import-function nil gtk_entry_set_max_length GtkEntry guint)
-(gtk-import-function GtkType gtk_event_box_get_type)
+(gtk-import-function GType gtk_event_box_get_type)
(gtk-import-function GtkWidget gtk_event_box_new)
-(gtk-import-function GtkType gtk_file_selection_get_type)
+(gtk-import-function GType gtk_file_selection_get_type)
(gtk-import-function GtkWidget gtk_file_selection_new GtkString)
(gtk-import-function nil gtk_file_selection_set_filename GtkFileSelection GtkString)
(gtk-import-function GtkString gtk_file_selection_get_filename GtkFileSelection)
@@ -653,13 +653,13 @@
(gtk-import-function nil gtk_file_selection_hide_fileop_buttons GtkFileSelection)
-(gtk-import-function GtkType gtk_fixed_get_type)
+(gtk-import-function GType gtk_fixed_get_type)
(gtk-import-function GtkWidget gtk_fixed_new)
(gtk-import-function nil gtk_fixed_put GtkFixed GtkWidget gint gint)
(gtk-import-function nil gtk_fixed_move GtkFixed GtkWidget gint gint)
-(gtk-import-function GtkType gtk_font_selection_get_type)
+(gtk-import-function GType gtk_font_selection_get_type)
(gtk-import-function GtkWidget gtk_font_selection_new)
(gtk-import-function GtkString gtk_font_selection_get_font_name GtkFontSelection)
;(gtk-import-function GdkFont gtk_font_selection_get_font GtkFontSelection)
@@ -684,7 +684,7 @@
;; most of these functions simply call the corresponding function in the
;; GtkFontSelection.
-(gtk-import-function GtkType gtk_font_selection_dialog_get_type)
+(gtk-import-function GType gtk_font_selection_dialog_get_type)
(gtk-import-function GtkWidget gtk_font_selection_dialog_new GtkString)
;; This returns the X Logical Font Description fontname, or NULL if no font
@@ -747,29 +747,29 @@
(gtk-import-function nil gtk_font_selection_dialog_set_preview_text GtkFontSelectionDialog GtkString)
-(gtk-import-function GtkType gtk_frame_get_type)
+(gtk-import-function GType gtk_frame_get_type)
(gtk-import-function GtkWidget gtk_frame_new GtkString)
(gtk-import-function nil gtk_frame_set_label GtkFrame GtkString)
(gtk-import-function nil gtk_frame_set_label_align GtkFrame gfloat gfloat)
(gtk-import-function nil gtk_frame_set_shadow_type GtkFrame GtkShadowType)
-(gtk-import-function GtkType gtk_gamma_curve_get_type)
+(gtk-import-function GType gtk_gamma_curve_get_type)
(gtk-import-function GtkWidget gtk_gamma_curve_new)
-(gtk-import-function GtkType gtk_handle_box_get_type)
+(gtk-import-function GType gtk_handle_box_get_type)
(gtk-import-function GtkWidget gtk_handle_box_new)
(gtk-import-function nil gtk_handle_box_set_shadow_type GtkHandleBox GtkShadowType)
(gtk-import-function nil gtk_handle_box_set_handle_position GtkHandleBox GtkPositionType)
(gtk-import-function nil gtk_handle_box_set_snap_edge GtkHandleBox GtkPositionType)
-(gtk-import-function GtkType gtk_hbox_get_type)
+(gtk-import-function GType gtk_hbox_get_type)
(gtk-import-function GtkWidget gtk_hbox_new gboolean gint)
-(gtk-import-function GtkType gtk_hbutton_box_get_type)
+(gtk-import-function GType gtk_hbutton_box_get_type)
(gtk-import-function GtkWidget gtk_hbutton_box_new)
;; buttons can be added by gtk_container_add()
@@ -780,41 +780,41 @@
(gtk-import-function nil gtk_hbutton_box_set_layout_default GtkButtonBoxStyle)
-(gtk-import-function GtkType gtk_hpaned_get_type)
+(gtk-import-function GType gtk_hpaned_get_type)
(gtk-import-function GtkWidget gtk_hpaned_new)
-(gtk-import-function GtkType gtk_hruler_get_type)
+(gtk-import-function GType gtk_hruler_get_type)
(gtk-import-function GtkWidget gtk_hruler_new)
-(gtk-import-function GtkType gtk_hscale_get_type)
+(gtk-import-function GType gtk_hscale_get_type)
(gtk-import-function GtkWidget gtk_hscale_new GtkAdjustment)
-(gtk-import-function GtkType gtk_hscrollbar_get_type)
+(gtk-import-function GType gtk_hscrollbar_get_type)
(gtk-import-function GtkWidget gtk_hscrollbar_new GtkAdjustment)
-(gtk-import-function GtkType gtk_hseparator_get_type)
+(gtk-import-function GType gtk_hseparator_get_type)
(gtk-import-function GtkWidget gtk_hseparator_new)
-(gtk-import-function GtkType gtk_input_dialog_get_type)
+(gtk-import-function GType gtk_input_dialog_get_type)
(gtk-import-function GtkWidget gtk_input_dialog_new)
-(gtk-import-function GtkType gtk_invisible_get_type)
+(gtk-import-function GType gtk_invisible_get_type)
(gtk-import-function GtkWidget gtk_invisible_new)
-(gtk-import-function GtkType gtk_item_get_type)
+(gtk-import-function GType gtk_item_get_type)
(gtk-import-function nil gtk_item_select GtkItem)
(gtk-import-function nil gtk_item_deselect GtkItem)
(gtk-import-function nil gtk_item_toggle GtkItem)
-(gtk-import-function GtkType gtk_label_get_type)
+(gtk-import-function GType gtk_label_get_type)
(gtk-import-function GtkWidget gtk_label_new GtkString)
(gtk-import-function nil gtk_label_set_text GtkLabel GtkString)
(gtk-import-function nil gtk_label_set_justify GtkLabel GtkJustification)
@@ -831,7 +831,7 @@
(gtk-import-function guint gtk_label_parse_uline GtkLabel GtkString)
-(gtk-import-function GtkType gtk_layout_get_type)
+(gtk-import-function GType gtk_layout_get_type)
(gtk-import-function GtkWidget gtk_layout_new GtkAdjustment GtkAdjustment)
(gtk-import-function nil gtk_layout_put GtkLayout GtkWidget gint gint)
(gtk-import-function nil gtk_layout_move GtkLayout GtkWidget gint gint)
@@ -854,7 +854,7 @@
(gtk-import-function nil gtk_layout_thaw GtkLayout)
-(gtk-import-function GtkType gtk_list_get_type)
+(gtk-import-function GType gtk_list_get_type)
(gtk-import-function GtkWidget gtk_list_new)
(gtk-import-function nil gtk_list_insert_items
@@ -896,7 +896,7 @@
(gtk-import-function nil gtk_list_end_drag_selection GtkList)
-(gtk-import-function GtkType gtk_list_item_get_type)
+(gtk-import-function GType gtk_list_item_get_type)
(gtk-import-function GtkWidget gtk_list_item_new)
(gtk-import-function GtkWidget gtk_list_item_new_with_label GtkString)
(gtk-import-function nil gtk_list_item_select GtkListItem)
@@ -924,7 +924,7 @@
(gtk-import-function gint gtk_false)
-(gtk-import-function GtkType gtk_menu_get_type)
+(gtk-import-function GType gtk_menu_get_type)
(gtk-import-function GtkWidget gtk_menu_new)
;; Wrappers for the Menu Shell operations
@@ -978,7 +978,7 @@
(gtk-import-function nil gtk_menu_reorder_child GtkMenu GtkWidget gint)
-(gtk-import-function GtkType gtk_menu_bar_get_type)
+(gtk-import-function GType gtk_menu_bar_get_type)
(gtk-import-function GtkWidget gtk_menu_bar_new)
(gtk-import-function nil gtk_menu_bar_append GtkMenuBar GtkWidget)
(gtk-import-function nil gtk_menu_bar_prepend GtkMenuBar GtkWidget)
@@ -986,7 +986,7 @@
(gtk-import-function nil gtk_menu_bar_set_shadow_type GtkMenuBar GtkShadowType)
-(gtk-import-function GtkType gtk_menu_item_get_type)
+(gtk-import-function GType gtk_menu_item_get_type)
(gtk-import-function GtkWidget gtk_menu_item_new)
(gtk-import-function GtkWidget gtk_menu_item_new_with_label GtkString)
(gtk-import-function nil gtk_menu_item_set_submenu GtkMenuItem GtkWidget)
@@ -999,7 +999,7 @@
(gtk-import-function nil gtk_menu_item_right_justify GtkMenuItem)
-(gtk-import-function GtkType gtk_misc_get_type)
+(gtk-import-function GType gtk_misc_get_type)
(gtk-import-function nil gtk_misc_set_alignment
(GtkMisc . misc)
(gfloat . xalign)
@@ -1011,7 +1011,7 @@
(gint . ypad))
-(gtk-import-function GtkType gtk_notebook_get_type)
+(gtk-import-function GType gtk_notebook_get_type)
(gtk-import-function GtkWidget gtk_notebook_new)
(gtk-import-function nil gtk_notebook_append_page GtkNotebook GtkWidget GtkWidget)
(gtk-import-function nil gtk_notebook_append_page_menu GtkNotebook GtkWidget GtkWidget GtkWidget)
@@ -1062,7 +1062,7 @@
(gtk-import-function nil gtk_notebook_reorder_child GtkNotebook GtkWidget gint)
-(gtk-import-function GtkType gtk_object_get_type)
+(gtk-import-function GType gtk_object_get_type)
;(gtk-import-function 'GtkObject gtk_object_newv 'guint 'guint 'GtkArg)
(gtk-import-function nil gtk_object_sink GtkObject)
(gtk-import-function nil gtk_object_ref GtkObject)
@@ -1082,7 +1082,7 @@
;; handlers for types of GtkObject
-(gtk-import-function GtkType gtk_option_menu_get_type)
+(gtk-import-function GType gtk_option_menu_get_type)
(gtk-import-function GtkWidget gtk_option_menu_new)
(gtk-import-function GtkWidget gtk_option_menu_get_menu GtkOptionMenu)
(gtk-import-function nil gtk_option_menu_set_menu GtkOptionMenu GtkWidget)
@@ -1090,40 +1090,40 @@
(gtk-import-function nil gtk_option_menu_set_history GtkOptionMenu guint)
-(gtk-import-function GtkType gtk_packer_get_type)
-(gtk-import-function GtkWidget gtk_packer_new)
-(gtk-import-function nil gtk_packer_add_defaults GtkPacker GtkWidget
- GtkSideType GtkAnchorType GtkPackerOptions)
-(gtk-import-function nil gtk_packer_add GtkPacker
- GtkWidget
- GtkSideType
- GtkAnchorType
- GtkPackerOptions
- guint
- guint
- guint
- guint
- guint)
+;; (gtk-import-function GType gtk_packer_get_type)
+;; (gtk-import-function GtkWidget gtk_packer_new)
+;; (gtk-import-function nil gtk_packer_add_defaults GtkPacker GtkWidget
+;; GtkSideType GtkAnchorType GtkPackerOptions)
+;; (gtk-import-function nil gtk_packer_add GtkPacker
+;; GtkWidget
+;; GtkSideType
+;; GtkAnchorType
+;; GtkPackerOptions
+;; guint
+;; guint
+;; guint
+;; guint
+;; guint)
-(gtk-import-function nil gtk_packer_set_child_packing GtkPacker
- GtkWidget
- GtkSideType
- GtkAnchorType
- GtkPackerOptions
- guint
- guint
- guint
- guint
- guint)
+;; (gtk-import-function nil gtk_packer_set_child_packing GtkPacker
+;; GtkWidget
+;; GtkSideType
+;; GtkAnchorType
+;; GtkPackerOptions
+;; guint
+;; guint
+;; guint
+;; guint
+;; guint)
-(gtk-import-function nil gtk_packer_reorder_child GtkPacker GtkWidget gint)
-(gtk-import-function nil gtk_packer_set_spacing GtkPacker guint)
-(gtk-import-function nil gtk_packer_set_default_border_width GtkPacker guint)
-(gtk-import-function nil gtk_packer_set_default_pad GtkPacker guint guint)
-(gtk-import-function nil gtk_packer_set_default_ipad GtkPacker guint guint)
+;; (gtk-import-function nil gtk_packer_reorder_child GtkPacker GtkWidget gint)
+;; (gtk-import-function nil gtk_packer_set_spacing GtkPacker guint)
+;; (gtk-import-function nil gtk_packer_set_default_border_width GtkPacker guint)
+;; (gtk-import-function nil gtk_packer_set_default_pad GtkPacker guint guint)
+;; (gtk-import-function nil gtk_packer_set_default_ipad GtkPacker guint guint)
-(gtk-import-function GtkType gtk_paned_get_type)
+(gtk-import-function GType gtk_paned_get_type)
(gtk-import-function nil gtk_paned_add1 GtkPaned GtkWidget)
(gtk-import-function nil gtk_paned_add2 GtkPaned GtkWidget)
(gtk-import-function nil gtk_paned_pack1 GtkPaned GtkWidget gboolean gboolean)
@@ -1136,7 +1136,7 @@
(gtk-import-function nil gtk_paned_compute_position GtkPaned gint gint gint)
-(gtk-import-function GtkType gtk_pixmap_get_type)
+(gtk-import-function GType gtk_pixmap_get_type)
(gtk-import-function GtkWidget gtk_pixmap_new
(GdkPixmap . pixmap)
(GdkPixmap . mask))
@@ -1155,12 +1155,12 @@
(guint . build))
-(gtk-import-function GtkType g_type_get_plugin)
+(gtk-import-function GType g_type_get_plugin)
(gtk-import-function GtkWidget gtk_plug_new guint)
(gtk-import-function nil gtk_plug_construct GtkPlug guint)
-(gtk-import-function GtkType gtk_progresss_get_type)
+(gtk-import-function GType gtk_progress_get_type)
(gtk-import-function nil gtk_progress_set_show_text GtkProgress gint)
(gtk-import-function nil gtk_progress_set_text_alignment GtkProgress gfloat gfloat)
(gtk-import-function nil gtk_progress_set_format_string GtkProgress GtkString)
@@ -1176,7 +1176,7 @@
(gtk-import-function gfloat gtk_progress_get_percentage_from_value GtkProgress gfloat)
-(gtk-import-function GtkType gtk_progress_bar_get_type)
+(gtk-import-function GType gtk_progress_bar_get_type)
(gtk-import-function GtkWidget gtk_progress_bar_new)
(gtk-import-function GtkWidget gtk_progress_bar_new_with_adjustment GtkAdjustment)
(gtk-import-function nil gtk_progress_bar_set_bar_style GtkProgressBar GtkProgressBarStyle)
@@ -1190,7 +1190,7 @@
;; All of the gpointers below really need to be `GSList *'
;; For now, need to create the first radio button with 'nil' and then use
;; (gtk-radio-button-group first-radio) for the rest.
-(gtk-import-function GtkType gtk_radio_button_get_type)
+(gtk-import-function GType gtk_radio_button_get_type)
(gtk-import-function GtkWidget gtk_radio_button_new gpointer)
(gtk-import-function GtkWidget gtk_radio_button_new_from_widget GtkRadioButton)
(gtk-import-function GtkWidget gtk_radio_button_new_with_label gpointer GtkString)
@@ -1199,7 +1199,7 @@
(gtk-import-function nil gtk_radio_button_set_group GtkRadioButton gpointer)
-(gtk-import-function GtkType gtk_radio_menu_item_get_type)
+(gtk-import-function GType gtk_radio_menu_item_get_type)
;; #### BILLL!!
;; All of these gpointer args should be GList *
@@ -1209,7 +1209,7 @@
(gtk-import-function nil gtk_radio_menu_item_set_group GtkRadioMenuItem gpointer)
-(gtk-import-function GtkType gtk_range_get_type)
+(gtk-import-function GType gtk_range_get_type)
(gtk-import-function GtkAdjustment gtk_range_get_adjustment GtkRange)
(gtk-import-function nil gtk_range_set_update_policy GtkRange GtkUpdateType)
(gtk-import-function nil gtk_range_set_adjustment GtkRange GtkAdjustment)
@@ -1245,14 +1245,14 @@
(gtk-import-function nil gtk_range_default_vmotion GtkRange gint gint)
-(gtk-import-function GtkType gtk_ruler_get_type)
+(gtk-import-function GType gtk_ruler_get_type)
(gtk-import-function nil gtk_ruler_set_metric GtkRuler GtkMetricType)
(gtk-import-function nil gtk_ruler_set_range GtkRuler gfloat gfloat gfloat gfloat)
(gtk-import-function nil gtk_ruler_draw_ticks GtkRuler)
(gtk-import-function nil gtk_ruler_draw_pos GtkRuler)
-(gtk-import-function GtkType gtk_scale_get_type)
+(gtk-import-function GType gtk_scale_get_type)
(gtk-import-function nil gtk_scale_set_digits GtkScale gint)
(gtk-import-function nil gtk_scale_set_draw_value GtkScale gboolean)
(gtk-import-function nil gtk_scale_set_value_pos GtkScale GtkPositionType)
@@ -1260,10 +1260,10 @@
(gtk-import-function nil gtk_scale_draw_value GtkScale)
-(gtk-import-function GtkType gtk_scrollbar_get_type)
+(gtk-import-function GType gtk_scrollbar_get_type)
-(gtk-import-function GtkType gtk_scrolled_window_get_type)
+(gtk-import-function GType gtk_scrolled_window_get_type)
(gtk-import-function GtkWidget gtk_scrolled_window_new GtkAdjustment GtkAdjustment)
(gtk-import-function nil gtk_scrolled_window_set_hadjustment GtkScrolledWindow GtkAdjustment)
(gtk-import-function nil gtk_scrolled_window_set_vadjustment GtkScrolledWindow GtkAdjustment)
@@ -1274,15 +1274,15 @@
(gtk-import-function nil gtk_scrolled_window_add_with_viewport GtkScrolledWindow GtkWidget)
-(gtk-import-function GtkType gtk_separator_get_type)
+(gtk-import-function GType gtk_separator_get_type)
-(gtk-import-function GtkType gtk_socket_get_type)
+(gtk-import-function GType gtk_socket_get_type)
(gtk-import-function GtkWidget gtk_socket_new)
(gtk-import-function nil gtk_socket_steal GtkSocket guint)
-(gtk-import-function GtkType gtk_table_get_type)
+(gtk-import-function GType gtk_table_get_type)
(gtk-import-function GtkWidget gtk_table_new guint guint gboolean)
(gtk-import-function nil gtk_table_resize GtkTable guint guint)
@@ -1298,11 +1298,11 @@
(gtk-import-function nil gtk_table_set_homogeneous GtkTable gboolean)
-(gtk-import-function GtkType gtk_tearoff_menu_item_get_type)
+(gtk-import-function GType gtk_tearoff_menu_item_get_type)
(gtk-import-function GtkWidget gtk_tearoff_menu_item_new)
-(gtk-import-function GtkType gtk_text_get_type)
+(gtk-import-function GType gtk_text_get_type)
(gtk-import-function GtkWidget gtk_text_new GtkAdjustment GtkAdjustment)
(gtk-import-function nil gtk_text_set_editable GtkText gboolean)
(gtk-import-function nil gtk_text_set_word_wrap GtkText gint)
@@ -1318,7 +1318,7 @@
(gtk-import-function nil gtk_text_forward_delete GtkText guint)
-(gtk-import-function GtkType gtk_tips_query_get_type)
+(gtk-import-function GType gtk_tips_query_get_type)
(gtk-import-function GtkWidget gtk_tips_query_new)
(gtk-import-function nil gtk_tips_query_start_query GtkTipsQuery)
(gtk-import-function nil gtk_tips_query_stop_query GtkTipsQuery)
@@ -1326,7 +1326,7 @@
(gtk-import-function nil gtk_tips_query_set_labels GtkTipsQuery GtkString GtkString)
-(gtk-import-function GtkType gtk_toggle_button_get_type)
+(gtk-import-function GType gtk_toggle_button_get_type)
(gtk-import-function GtkWidget gtk_toggle_button_new)
(gtk-import-function GtkWidget gtk_toggle_button_new_with_label GtkString)
(gtk-import-function nil gtk_toggle_button_set_mode GtkToggleButton gboolean)
@@ -1335,7 +1335,7 @@
(gtk-import-function nil gtk_toggle_button_toggled GtkToggleButton)
-(gtk-import-function GtkType gtk_toolbar_get_type)
+(gtk-import-function GType gtk_toolbar_get_type)
(gtk-import-function GtkWidget gtk_toolbar_new GtkOrientation GtkToolbarStyle)
;; Simple button items
@@ -1422,7 +1422,7 @@
(gtk-import-function GtkReliefStyle gtk_toolbar_get_button_relief GtkToolbar)
-(gtk-import-function GtkType gtk_tooltips_get_type)
+(gtk-import-function GType gtk_tooltips_get_type)
(gtk-import-function GtkObject gtk_tooltips_new)
(gtk-import-function nil gtk_tooltips_enable GtkTooltips)
(gtk-import-function nil gtk_tooltips_disable GtkTooltips)
@@ -1435,7 +1435,7 @@
(gtk-import-function nil gtk_tooltips_force_window GtkTooltips)
-(gtk-import-function GtkType gtk_tree_get_type)
+(gtk-import-function GType gtk_tree_get_type)
(gtk-import-function GtkWidget gtk_tree_new)
(gtk-import-function nil gtk_tree_append
@@ -1497,7 +1497,7 @@
(GtkWidget . child))
-(gtk-import-function GtkType gtk_tree_item_get_type)
+(gtk-import-function GType gtk_tree_item_get_type)
(gtk-import-function GtkWidget gtk_tree_item_new)
(gtk-import-function GtkWidget gtk_tree_item_new_with_label GtkString)
(gtk-import-function nil gtk_tree_item_set_subtree GtkTreeItem GtkWidget)
@@ -1508,15 +1508,15 @@
(gtk-import-function nil gtk_tree_item_collapse GtkTreeItem)
-(gtk-import-function GtkString gtk_type_name GtkType)
+(gtk-import-function GtkString gtk_type_name GType)
(gtk-import-function guint gtk_type_from_name GtkString)
-(gtk-import-function GtkType gtk_vbox_get_type)
+(gtk-import-function GType gtk_vbox_get_type)
(gtk-import-function GtkWidget gtk_vbox_new gboolean gint)
-(gtk-import-function GtkType gtk_vbutton_box_get_type)
+(gtk-import-function GType gtk_vbutton_box_get_type)
(gtk-import-function GtkWidget gtk_vbutton_box_new)
;; buttons can be added by gtk_container_add()
@@ -1527,7 +1527,7 @@
(gtk-import-function nil gtk_vbutton_box_set_layout_default GtkButtonBoxStyle)
-(gtk-import-function GtkType gtk_viewport_get_type)
+(gtk-import-function GType gtk_viewport_get_type)
(gtk-import-function GtkWidget gtk_viewport_new GtkAdjustment GtkAdjustment)
(gtk-import-function GtkAdjustment gtk_viewport_get_hadjustment GtkViewport)
(gtk-import-function GtkAdjustment gtk_viewport_get_vadjustment GtkViewport)
@@ -1536,27 +1536,27 @@
(gtk-import-function nil gtk_viewport_set_shadow_type GtkViewport GtkShadowType)
-(gtk-import-function GtkType gtk_vpaned_get_type)
+(gtk-import-function GType gtk_vpaned_get_type)
(gtk-import-function GtkWidget gtk_vpaned_new)
-(gtk-import-function GtkType gtk_vruler_get_type)
+(gtk-import-function GType gtk_vruler_get_type)
(gtk-import-function GtkWidget gtk_vruler_new)
-(gtk-import-function GtkType gtk_vscale_get_type)
+(gtk-import-function GType gtk_vscale_get_type)
(gtk-import-function GtkWidget gtk_vscale_new GtkAdjustment)
-(gtk-import-function GtkType gtk_vscrollbar_get_type)
+(gtk-import-function GType gtk_vscrollbar_get_type)
(gtk-import-function GtkWidget gtk_vscrollbar_new GtkAdjustment)
-(gtk-import-function GtkType gtk_vseparator_get_type)
+(gtk-import-function GType gtk_vseparator_get_type)
(gtk-import-function GtkWidget gtk_vseparator_new)
-(gtk-import-function GtkType gtk_widget_get_type)
+(gtk-import-function GType gtk_widget_get_type)
(gtk-import-function nil gtk_widget_ref GtkWidget)
(gtk-import-function nil gtk_widget_unref GtkWidget)
(gtk-import-function nil gtk_widget_destroy GtkWidget)
@@ -1684,7 +1684,7 @@
; gchar **path_reversed);
-(gtk-import-function GtkType gtk_window_get_type)
+(gtk-import-function GType gtk_window_get_type)
(gtk-import-function GtkWidget gtk_window_new GtkWindowType)
(gtk-import-function nil gtk_window_set_title GtkWindow GtkString)
(gtk-import-function nil gtk_window_set_wmclass GtkWindow GtkString GtkString)
@@ -1708,7 +1708,7 @@
'(gtk-import-function nil gtk_window_reposition GtkWindow gint gint)
-(gtk-import-function GtkType gtk_spin_button_get_type)
+(gtk-import-function GType gtk_spin_button_get_type)
(gtk-import-function nil gtk_spin_button_configure
(GtkSpinButton . spin_button)
(GtkAdjustment . adjustment)
@@ -1756,7 +1756,7 @@
(GtkSpinButton . spin_button))
-(gtk-import-function GtkType gtk_statusbar_get_type)
+(gtk-import-function GType gtk_statusbar_get_type)
(gtk-import-function GtkWidget gtk_statusbar_new)
(gtk-import-function guint gtk_statusbar_get_context_id
(GtkStatusbar . statusbar)
@@ -1776,7 +1776,7 @@
(guint . message_id))
-(gtk-import-function GtkType gtk_ctree_get_type)
+(gtk-import-function GType gtk_ctree_get_type)
(gtk-import-function none gtk_ctree_construct
(GtkCTree . ctree)
(gint . columns)
@@ -2034,7 +2034,7 @@
(gtk-ctree-recurse ctree node func data nil depth))
-(gtk-import-function GtkType gtk_preview_get_type)
+(gtk-import-function GType gtk_preview_get_type)
(gtk-import-function void gtk_preview_uninit)
(gtk-import-function GtkWidget gtk_preview_new
(GtkPreviewType . type))
https://bitbucket.org/xemacs/xemacs/commits/64e6ebb3cf6c/
Changeset: 64e6ebb3cf6c
User: jsparkes
Date: 2010-06-01 19:38:47+00:00
Summary: ChangeLog entry for frame.h change.
Affected #: 1 file
diff -r 1438cb0375cd026f64a8fea91d22aff0f2f31a3a -r 64e6ebb3cf6ca80edd63a4dc0bddb32c8a78882f src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,8 @@
+2010-06-01 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * frame.h (EDGE_HORIZONTAL_P): It is already being using in
+ toolbar-gtk.c due to out of order commits.
+
2010-05-31 Jeff Sparkes <jsparkes(a)gmail.com>
* frame-impl.h (struct frame): Add gtk_toolbars here. This is the
https://bitbucket.org/xemacs/xemacs/commits/70d6b651a14b/
Changeset: 70d6b651a14b
User: jsparkes
Date: 2010-06-01 19:47:01+00:00
Summary: Uncomment special treatment of fundamental types. Treat them as already imported.
Use G_TYPE_IS_OBJECT, not G_IS_OBJECT on a type.
Don't set the type of a GValue before using
it to hold a converted Lisp_Object, the type cannot be changed.
Fix documentation string of gtk-fundamental-type.
Affected #: 2 files
diff -r 64e6ebb3cf6ca80edd63a4dc0bddb32c8a78882f -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,12 @@
2010-06-01 Jeff Sparkes <jsparkes(a)gmail.com>
+ * ui-gtk.c (type_already_imported_p): Uncomment special treatment
+ of fundamental types. Treat them as already imported.
+ (import_gtk_type): Use G_TYPE_IS_OBJECT, not G_IS_OBJECT on a type.
+ (Fgtk_call_function): Don't set the type of a GValue before using
+ it to hold a converted Lisp_Object, the type cannot be changed.
+ (Fgtk_fundamental_type): Fix documentation string.
+
* frame.h (EDGE_HORIZONTAL_P): It is already being using in
toolbar-gtk.c due to out of order commits.
diff -r 64e6ebb3cf6ca80edd63a4dc0bddb32c8a78882f -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -124,7 +124,6 @@
type_already_imported_p (GType t)
{
/* These are cases that we don't need to import */
-#if 0
switch (GTK_FUNDAMENTAL_TYPE (t))
{
case G_TYPE_CHAR:
@@ -150,14 +149,13 @@
//case G_TYPE_GTYPE:
return (1);
}
-#endif
if (NILP (Vgtk_types))
{
Vgtk_types = call2 (intern ("make-hashtable"),
make_int (163), Qequal);
return (0);
}
-
+ Lisp_Object key = make_int (G_VALUE_TYPE (t));
if (!NILP (Fgethash (make_int (G_VALUE_TYPE (t)), Vgtk_types, Qnil)))
return (1);
return (0);
@@ -312,7 +310,7 @@
import_gtk_enumeration_internal (t);
else if (G_TYPE_IS_FLAGS (t))
import_gtk_flags_internal (t);
- else if (G_IS_OBJECT (t))
+ else if (G_TYPE_IS_OBJECT (t))
import_gtk_object_internal (t);
else
{
@@ -788,7 +786,6 @@
{
EXTERNAL_LIST_LOOP_2 (elt, value)
{
- g_value_init (&the_args[n_args], XFFI (func)->arg_type[n_args]);
if (lisp_to_g_value (elt, &the_args[n_args]))
{
/* There was some sort of an error */
@@ -803,7 +800,6 @@
asked for one */
if (XFFI (func)->return_type != G_TYPE_NONE)
{
- g_value_init (&the_args[n_args], XFFI (func)->return_type);
n_args++;
}
@@ -1250,8 +1246,8 @@
/* Type manipulation */
DEFUN ("gtk-fundamental-type", Fgtk_fundamental_type, 1, 1, 0, /*
-Load a shared library DLL into XEmacs. No initialization routines are required.
-This is for loading dependency DLLs into XEmacs.
+Return the fundamental GType of OBJECT.
+This is the base object type.
*/
(type))
{
https://bitbucket.org/xemacs/xemacs/commits/b27437e822f0/
Changeset: b27437e822f0
User: jsparkes
Date: 2010-06-02 14:43:30+00:00
Summary: A set of patches from Aidan Kehoe, fixing compilation problems.
Affected #: 9 files
diff -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 -r b27437e822f0f790ddc63a938ebe1878a9062a1d configure
--- a/configure
+++ b/configure
@@ -11935,9 +11935,9 @@
$as_echo_n "checking for GTK configuration script... " >&6; }
for possible in gtk+-2.0
do
- possible_version=`$GNOME_CONFIG {possible} --version 2> /dev/null`
+ possible_version=`pkg-config ${possible} --version 2> /dev/null`
if test "x${possible_version}" != "x"; then
- GTK_CONFIG="$GNOME_CONFIG ${possible}"
+ GTK_CONFIG="pkg-config ${possible}"
case "${possible_version}" in
1.0.*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GTK 1.2 is required, please upgrade your version of GTK." >&5
$as_echo "$as_me: WARNING: GTK 1.2 is required, please upgrade your version of GTK." >&2;}; with_gtk=no;;
diff -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 -r b27437e822f0f790ddc63a938ebe1878a9062a1d configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -2857,9 +2857,9 @@
AC_MSG_CHECKING(for GTK configuration script)
for possible in gtk+-2.0
do
- possible_version=`$GNOME_CONFIG {possible} --version 2> /dev/null`
+ possible_version=`pkg-config ${possible} --version 2> /dev/null`
if test "x${possible_version}" != "x"; then
- GTK_CONFIG="$GNOME_CONFIG ${possible}"
+ GTK_CONFIG="pkg-config ${possible}"
case "${possible_version}" in
1.0.*) AC_MSG_WARN([GTK 1.2 is required, please upgrade your version of GTK.]); with_gtk=no;;
1.3.*) AC_MSG_WARN([GTK 1.3 is not supported right now]); with_gtk=no;;
diff -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 -r b27437e822f0f790ddc63a938ebe1878a9062a1d src/fontcolor-gtk.c
--- a/src/fontcolor-gtk.c
+++ b/src/fontcolor-gtk.c
@@ -46,7 +46,7 @@
#define MAX_FONT_COUNT INT_MAX
#ifdef DEBUG_XEMACS
-Fixnum debug_x_objects;
+Fixnum debug_x_fonts;
#endif /* DEBUG_XEMACS */
@@ -395,10 +395,10 @@
vars_of_fontcolor_gtk (void)
{
#ifdef DEBUG_XEMACS
- DEFVAR_INT ("debug-x-objects", &debug_x_objects /*
-If non-zero, display debug information about X objects
+ DEFVAR_INT ("debug-x-fonts", &debug_x_fonts /*
+If non-zero, display debug information about X fonts.
*/ );
- debug_x_objects = 0;
+ debug_x_fonts = 0;
#endif
}
diff -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 -r b27437e822f0f790ddc63a938ebe1878a9062a1d src/fontcolor-xlike-inc.c
--- a/src/fontcolor-xlike-inc.c
+++ b/src/fontcolor-xlike-inc.c
@@ -239,7 +239,7 @@
xlfd, stage == STAGE_INITIAL ? "initial" : "final");
DEBUG_FONTS_LISP1 (" charset %s\n", charset);
fontext = ITEXT_TO_EXTERNAL (xlfd, Qx_font_name_encoding);
- names = XListFonts (GET_XLIKE_DISPLAY (XDEVICE (device)),
+ names = XListFonts (GET_XLIKE_X_DISPLAY (XDEVICE (device)),
fontext, MAX_FONT_COUNT, &count);
for (i = 0; i < count; ++i)
diff -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 -r b27437e822f0f790ddc63a938ebe1878a9062a1d src/glyphs-gtk.c
--- a/src/glyphs-gtk.c
+++ b/src/glyphs-gtk.c
@@ -2578,7 +2578,7 @@
/* Signal handler for the switch-page signal. */
static void gtk_tab_control_callback(GtkNotebook *notebook,
GtkNotebookPage *page,
- gint UNUSED (page_num),
+ gint page_num,
gpointer UNUSED (user_data))
{
/*
diff -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 -r b27437e822f0f790ddc63a938ebe1878a9062a1d src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -46,13 +46,11 @@
else
switch (style)
{
-#ifdef JSPARKES
- case EDGE_BEVEL_IN: style = (edge_style)GTK_SHADOW_IN; break;
- case EDGE_BEVEL_OUT: style = (edge_style)GTK_SHADOW_OUT; break;
- case EDGE_ETCHED_IN: style = (edge_style)GTK_SHADOW_ETCHED_IN; break;
- case EDGE_ETCHED_OUT: style = (edge_style)GTK_SHADOW_ETCHED_OUT; break;
- default: ABORT (); style = (edge_style)GTK_SHADOW_OUT;
-#endif
+ case EDGE_BEVEL_IN: style = GTK_SHADOW_IN; break;
+ case EDGE_BEVEL_OUT: style = GTK_SHADOW_OUT; break;
+ case EDGE_ETCHED_IN: style = GTK_SHADOW_ETCHED_IN; break;
+ case EDGE_ETCHED_OUT: style = GTK_SHADOW_ETCHED_OUT; break;
+ default: ABORT (); style = GTK_SHADOW_OUT;
}
/* Do we want to have some magic constants to set
diff -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 -r b27437e822f0f790ddc63a938ebe1878a9062a1d src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -995,7 +995,7 @@
/* General variables */
struct frame *f = XFRAME (w->frame);
struct device *d = XDEVICE (f->device);
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
Lisp_Object window = wrap_window (w);
@@ -1659,7 +1659,7 @@
XLIKE_GC override_gc)
{
struct device *d = XDEVICE (f->device);
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
XLIKE_GC gc;
XLIKE_GCVALUES gcv;
@@ -1749,7 +1749,7 @@
struct frame *f = XFRAME (w->frame);
struct device *d = XDEVICE (f->device);
Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
/* Output the pixmap. */
@@ -1808,7 +1808,7 @@
struct frame *f = XFRAME (w->frame);
struct device *d = XDEVICE (f->device);
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
Lisp_Object tmp_pixel;
XLIKE_GCVALUES gcv;
@@ -1889,7 +1889,7 @@
struct frame *f = XFRAME (w->frame);
struct device *d = XDEVICE (f->device);
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
XLIKE_GC gc;
struct face_cachel *cursor_cachel =
@@ -2001,7 +2001,7 @@
struct frame *f = XFRAME (w->frame);
struct device *d = XDEVICE (f->device);
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
XLIKE_GC gc;
@@ -2063,7 +2063,7 @@
Lisp_Object background_pixmap,
Lisp_Object background_placement)
{
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
XLIKE_GC gc = NULL;
@@ -2093,7 +2093,7 @@
struct device *d = XDEVICE (f->device);
Lisp_Object window;
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
XLIKE_GC gc = NULL;
face_index elt = get_builtin_face_cache_index (w, Vtext_cursor_face);
@@ -2186,7 +2186,7 @@
static void
XLIKE_clear_frame (struct frame *f)
{
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (XDEVICE (f->device));
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (XDEVICE (f->device));
XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
int x, y, width, height;
Lisp_Object frame;
@@ -2228,7 +2228,7 @@
XLIKE_flash (struct device *d)
{
struct frame *f = device_selected_frame (d);
- XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+ XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
XLIKE_WINDOW win = GET_XLIKE_WINDOW (f);
XLIKE_GC gc = NULL;
XLIKE_GCVALUES gcv;
diff -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 -r b27437e822f0f790ddc63a938ebe1878a9062a1d src/symsinit.h
--- a/src/symsinit.h
+++ b/src/symsinit.h
@@ -200,7 +200,6 @@
void syms_of_undo (void);
void syms_of_unicode (void);
void syms_of_widget (void);
-void syms_of_widget_accessors (void);
void syms_of_win32 (void);
void syms_of_window (void);
diff -r 70d6b651a14bc07aae1e7d5ecbe7812f262f6531 -r b27437e822f0f790ddc63a938ebe1878a9062a1d src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -1477,9 +1477,6 @@
DEFSUBR (Fgtk_describe_type);
DEFSUBR (Fg_type_from_name);
DEFSUBR (Fg_object_class_list_properties);
-#ifdef HAVE_WIDGETS
- syms_of_widget_accessors ();
-#endif
syms_of_ui_byhand ();
#ifdef JSPARKES
syms_of_glade ();
https://bitbucket.org/xemacs/xemacs/commits/af00fa592604/
Changeset: af00fa592604
User: jsparkes
Date: 2010-06-02 19:02:04+00:00
Summary: style and stype variable names are hard to distinguish. You get fewer
errors when you assign to the right one.
Affected #: 2 files
diff -r b27437e822f0f790ddc63a938ebe1878a9062a1d -r af00fa5926043dfe4223ea01134c42675d5b5fa0 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,8 @@
+2010-06-02 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * redisplay-gtk.c (XLIKE_bevel_area): style and stype variable
+ names are hard to distinguish.
+
2010-06-01 Jeff Sparkes <jsparkes(a)gmail.com>
* ui-gtk.c (type_already_imported_p): Uncomment special treatment
diff -r b27437e822f0f790ddc63a938ebe1878a9062a1d -r af00fa5926043dfe4223ea01134c42675d5b5fa0 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -46,11 +46,11 @@
else
switch (style)
{
- case EDGE_BEVEL_IN: style = GTK_SHADOW_IN; break;
- case EDGE_BEVEL_OUT: style = GTK_SHADOW_OUT; break;
- case EDGE_ETCHED_IN: style = GTK_SHADOW_ETCHED_IN; break;
- case EDGE_ETCHED_OUT: style = GTK_SHADOW_ETCHED_OUT; break;
- default: ABORT (); style = GTK_SHADOW_OUT;
+ case EDGE_BEVEL_IN: stype = GTK_SHADOW_IN; break;
+ case EDGE_BEVEL_OUT: stype = GTK_SHADOW_OUT; break;
+ case EDGE_ETCHED_IN: stype = GTK_SHADOW_ETCHED_IN; break;
+ case EDGE_ETCHED_OUT: stype = GTK_SHADOW_ETCHED_OUT; break;
+ default: ABORT (); stype = GTK_SHADOW_OUT;
}
/* Do we want to have some magic constants to set
https://bitbucket.org/xemacs/xemacs/commits/12d6589b05a5/
Changeset: 12d6589b05a5
User: jsparkes
Date: 2010-06-02 19:04:10+00:00
Summary: Use C style to comment out lines of code.
Affected #: 1 file
diff -r af00fa5926043dfe4223ea01134c42675d5b5fa0 -r 12d6589b05a55a8ff37c734aaa0795375e23e718 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -103,8 +103,8 @@
int screen = GDK_SCREEN_XNUMBER (gdk_drawable_get_screen (drawable));
/* Xft render */
- //context = pango_xft_get_context (display, screen);
- //layout = pango_layout_new (context);
+ /* context = pango_xft_get_context (display, screen); */
+ /* layout = pango_layout_new (context); */
/* Gtk render */
context = gtk_widget_get_pango_context (widget);
layout = pango_layout_new (context);
@@ -116,7 +116,7 @@
gdk_draw_rectangle (drawable, bgc, TRUE, x, y, width, height);
/* xft draw */
- //pango_xft_layout_render (xft_draw, xft_color, layout, x, y);
+ /* pango_xft_layout_render (xft_draw, xft_color, layout, x, y); */
/* Gtk draw */
gdk_draw_layout (drawable, gc, x, y, layout);
//g_object_unref (layout);
@@ -124,8 +124,8 @@
height = font->ascent + font->descent;
width = gdk_text_width (font, text, len);
if (bgc != 0)
- /* The rectangle and text areas don't quite fit, so I have to the
- te height a little --jsparkes */
+ /* The rectangle and text areas don't quite fit, so I have to extend
+ the height a little --jsparkes */
gdk_draw_rectangle (drawable, bgc, TRUE, x, y-height+3, width, height);
gdk_draw_text (drawable, font, gc, x, y, text, len);
#endif
https://bitbucket.org/xemacs/xemacs/commits/5d53af4d5fa4/
Changeset: 5d53af4d5fa4
User: jsparkes
Date: 2010-06-03 13:03:32+00:00
Summary: Had omitted G_TYPE_OBJECT in type_to_marshaller().
Affected #: 2 files
diff -r 12d6589b05a55a8ff37c734aaa0795375e23e718 -r 5d53af4d5fa4072dd9b43cf7644383dd83f48f84 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,7 @@
+2010-06-03 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * ui-gtk.c (type_to_marshaller_type): Had omitted G_OBJECT_TYPE.
+
2010-06-02 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (XLIKE_bevel_area): style and stype variable
diff -r 12d6589b05a55a8ff37c734aaa0795375e23e718 -r 5d53af4d5fa4072dd9b43cf7644383dd83f48f84 src/ui-gtk.c
--- a/src/ui-gtk.c
+++ b/src/ui-gtk.c
@@ -518,12 +518,14 @@
case G_TYPE_STRING:
return (build_ascstring ("STRING"));
case G_TYPE_BOXED:
+ case G_TYPE_OBJECT:
case G_TYPE_POINTER:
return (build_ascstring ("POINTER"));
default:
- stderr_out ("type_to_marshaller type %s\n", g_type_name(t));
+ stderr_out ("type_to_marshaller type %s, fundamental %s\n", g_type_name(t),
+ g_type_name (GTK_FUNDAMENTAL_TYPE (t)));
- ABORT();
+ /* ABORT(); */
/* I can't put this in the main switch statement because it is a
new fundamental type that is not fixed at compile time.
*sigh*
https://bitbucket.org/xemacs/xemacs/commits/a901c012d9f6/
Changeset: a901c012d9f6
User: jsparkes
Date: 2010-06-03 13:26:48+00:00
Summary: Added new marshaller, POINTER__STRING, needed by gtk-label-new.
Affected #: 4 files
diff -r 5d53af4d5fa4072dd9b43cf7644383dd83f48f84 -r a901c012d9f614bb9fafa91846e3e610ced1a2bc lisp/ChangeLog.GTK
--- a/lisp/ChangeLog.GTK
+++ b/lisp/ChangeLog.GTK
@@ -1,3 +1,7 @@
+2010-06-03 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * gtk-marshal.el (find-file): Add "pointer string" marshaller.
+
2010-06-01 Jeff Sparkes <jsparkes(a)gmail.com>
* gtk-widgets.el (GType): Replace GtkType with GType everyone for
diff -r 5d53af4d5fa4072dd9b43cf7644383dd83f48f84 -r a901c012d9f614bb9fafa91846e3e610ced1a2bc lisp/gtk-marshal.el
--- a/lisp/gtk-marshal.el
+++ b/lisp/gtk-marshal.el
@@ -258,8 +258,9 @@
("POINTER" "OBJECT" "POINTER")
("POINTER" "OBJECT")
("POINTER" "POINTER")
+ ("POINTER" "STRING")
("POINTER" "STRING" "INT")
- ("POINTER")
+ ("POINTER")
("STRING" "INT" "INT" "INT")
("STRING" "INT")
("STRING" "OBJECT" "BOOL")
diff -r 5d53af4d5fa4072dd9b43cf7644383dd83f48f84 -r a901c012d9f614bb9fafa91846e3e610ced1a2bc src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,5 +1,8 @@
2010-06-03 Jeff Sparkes <jsparkes(a)gmail.com>
+ * emacs-marshals.c (emacs_gtk_marshal_POINTER__STRING): Added new
+ marshaller, needed by gtk-label-new.
+
* ui-gtk.c (type_to_marshaller_type): Had omitted G_OBJECT_TYPE.
2010-06-02 Jeff Sparkes <jsparkes(a)gmail.com>
diff -r 5d53af4d5fa4072dd9b43cf7644383dd83f48f84 -r a901c012d9f614bb9fafa91846e3e610ced1a2bc src/emacs-marshals.c
--- a/src/emacs-marshals.c
+++ b/src/emacs-marshals.c
@@ -1344,6 +1344,16 @@
}
static void
+emacs_gtk_marshal_POINTER__STRING (ffi_actual_function func, GtkArg *args)
+{
+ __POINTER_fn rfunc = (__POINTER_fn) func;
+ void * *return_val;
+
+ return_val = GTK_RETLOC_POINTER (args[1]);
+ *return_val = (*rfunc) (GTK_VALUE_STRING (args[0]));
+}
+
+static void
emacs_gtk_marshal_POINTER__STRING_INT (ffi_actual_function func, GtkArg *args)
{
__POINTER_fn rfunc = (__POINTER_fn) func;
@@ -1632,6 +1642,7 @@
puthash ("emacs_gtk_marshal_POINTER__OBJECT_POINTER", (void *) emacs_gtk_marshal_POINTER__OBJECT_POINTER, marshaller_hashtable);
puthash ("emacs_gtk_marshal_POINTER__OBJECT", (void *) emacs_gtk_marshal_POINTER__OBJECT, marshaller_hashtable);
puthash ("emacs_gtk_marshal_POINTER__POINTER", (void *) emacs_gtk_marshal_POINTER__POINTER, marshaller_hashtable);
+ puthash ("emacs_gtk_marshal_POINTER__STRING", (void *) emacs_gtk_marshal_POINTER__STRING, marshaller_hashtable);
puthash ("emacs_gtk_marshal_POINTER__STRING_INT", (void *) emacs_gtk_marshal_POINTER__STRING_INT, marshaller_hashtable);
puthash ("emacs_gtk_marshal_POINTER__NONE", (void *) emacs_gtk_marshal_POINTER__NONE, marshaller_hashtable);
puthash ("emacs_gtk_marshal_STRING__INT_INT_INT", (void *) emacs_gtk_marshal_STRING__INT_INT_INT, marshaller_hashtable);
https://bitbucket.org/xemacs/xemacs/commits/f87661ba65db/
Changeset: f87661ba65db
User: jsparkes
Date: 2010-06-04 09:18:51+00:00
Summary: * frame-gtk.c (gtk_any_window_to_device): Fix indentation.
Affected #: 2 files
diff -r a901c012d9f614bb9fafa91846e3e610ced1a2bc -r f87661ba65db25af74ec163cbbc16b7e8284c507 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,3 +1,7 @@
+2010-06-04 Jeff Sparkes <jsparkes(a)gmail.com>
+
+ * frame-gtk.c (gtk_any_window_to_device): Fix indentation.
+
2010-06-03 Jeff Sparkes <jsparkes(a)gmail.com>
* emacs-marshals.c (emacs_gtk_marshal_POINTER__STRING): Added new
diff -r a901c012d9f614bb9fafa91846e3e610ced1a2bc -r f87661ba65db25af74ec163cbbc16b7e8284c507 src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -53,8 +53,8 @@
#include <libgnomeui/libgnomeui.h>
#endif
-#define BORDER_WIDTH 0
-#define INTERNAL_BORDER_WIDTH 0
+#define BORDER_WIDTH 2
+#define INTERNAL_BORDER_WIDTH 2
#define TRANSIENT_DATA_IDENTIFIER "xemacs::transient_for"
#define UNMAPPED_DATA_IDENTIFIER "xemacs::initially_unmapped"
https://bitbucket.org/xemacs/xemacs/commits/9ee1f463e624/
Changeset: 9ee1f463e624
User: jsparkes
Date: 2010-06-04 09:51:32+00:00
Summary: * frame-gtk.c:
(gtk_set_frame_properties): Replace deprecated
gdk_window_get_deskrelative_origin with gdk_window_get_origin.
(gtk_frame_property): Ditto.
(gtk_frame_properties): Ditto
Affected #: 1 file
diff -r f87661ba65db25af74ec163cbbc16b7e8284c507 -r 9ee1f463e62467383d0a5f0cdffc2b546422377c src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -197,17 +197,17 @@
struct device *
gtk_any_window_to_device (GdkWindow *w)
{
- struct device *d = NULL;
- Lisp_Object devcons, concons;
+ struct device *d = NULL;
+ Lisp_Object devcons, concons;
- DEVICE_LOOP_NO_BREAK (devcons, concons)
- {
- d = XDEVICE (XCAR (devcons));
- if (!DEVICE_GTK_P (d)) continue;
- if (gtk_any_window_to_frame (d, w))
- return (d);
- }
- return (NULL);
+ DEVICE_LOOP_NO_BREAK (devcons, concons)
+ {
+ d = XDEVICE (XCAR (devcons));
+ if (!DEVICE_GTK_P (d)) continue;
+ if (gtk_any_window_to_frame (d, w))
+ return (d);
+ }
+ return (NULL);
}
struct frame *
@@ -247,7 +247,7 @@
gint x, y;
if (!GET_GTK_WIDGET_WINDOW(shell))
return Qzero;
- gdk_window_get_deskrelative_origin (GET_GTK_WIDGET_WINDOW (shell), &x, &y);
+ gdk_window_get_origin (GET_GTK_WIDGET_WINDOW (shell), &x, &y);
if (EQ (Qleft, property)) return make_int (x);
if (EQ (Qtop, property)) return make_int (y);
}
@@ -301,7 +301,7 @@
if (!GET_GTK_WIDGET_WINDOW (shell))
x = y = 0;
else
- gdk_window_get_deskrelative_origin (GET_GTK_WIDGET_WINDOW (shell), &x, &y);
+ gdk_window_get_origin (GET_GTK_WIDGET_WINDOW (shell), &x, &y);
props = cons3 (Qtop, make_int (y), props);
props = cons3 (Qleft, make_int (x), props);
@@ -478,9 +478,9 @@
{
gint dummy;
GtkWidget *shell = FRAME_GTK_SHELL_WIDGET (f);
- gdk_window_get_deskrelative_origin (GET_GTK_WIDGET_WINDOW (shell),
- (x_position_specified_p ? &dummy : &x),
- (y_position_specified_p ? &dummy : &y));
+ gdk_window_get_origin (GET_GTK_WIDGET_WINDOW (shell),
+ (x_position_specified_p ? &dummy : &x),
+ (y_position_specified_p ? &dummy : &y));
}
if (!f->init_finished)
https://bitbucket.org/xemacs/xemacs/commits/d59513c2a40e/
Changeset: d59513c2a40e
User: jsparkes
Date: 2010-06-04 10:01:56+00:00
Summary: (gtk_set_mouse_position): Gdk now has a function to warp the
cursor position.
Affected #: 2 files
diff -r 9ee1f463e62467383d0a5f0cdffc2b546422377c -r d59513c2a40e2a19139ca3d153d20ff4698305b0 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK
+++ b/src/ChangeLog.GTK
@@ -1,6 +1,12 @@
2010-06-04 Jeff Sparkes <jsparkes(a)gmail.com>
* frame-gtk.c (gtk_any_window_to_device): Fix indentation.
+ (gtk_set_frame_properties): Replace deprecated
+ gdk_window_get_deskrelative_origin with gdk_window_get_origin.
+ (gtk_frame_property): Ditto.
+ (gtk_frame_properties): Ditto
+ (gtk_set_mouse_position): Gdk now has a function to warp the
+ cursor position.
2010-06-03 Jeff Sparkes <jsparkes(a)gmail.com>
diff -r 9ee1f463e62467383d0a5f0cdffc2b546422377c -r d59513c2a40e2a19139ca3d153d20ff4698305b0 src/frame-gtk.c
--- a/src/frame-gtk.c
+++ b/src/frame-gtk.c
@@ -1207,18 +1207,15 @@
}
}
-#ifdef STUPID_X_SPECIFIC_GTK_STUFF
-/* There is NO equivalent to XWarpPointer under Gtk */
static void
gtk_set_mouse_position (struct window *w, int x, int y)
{
struct frame *f = XFRAME (w->frame);
- Display *display = GDK_DISPLAY ();
- XWarpPointer (display, None,
- GDK_WINDOW_XWINDOW (GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f))),
- 0, 0, 0, 0, w->pixel_left + x, w->pixel_top + y);
+ GdkDisplay *display = gtk_widget_get_display (FRAME_GTK_TEXT_WIDGET (f));
+ GdkScreen *screen = gtk_widget_get_screen (FRAME_GTK_TEXT_WIDGET (f));
+ gdk_display_warp_pointer (display, screen,
+ w->pixel_left + x, w->pixel_top + y);
}
-#endif /* STUPID_X_SPECIFIC_GTK_STUFF */
static int
gtk_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y)
https://bitbucket.org/xemacs/xemacs/commits/ff4709418f6e/
Changeset: ff4709418f6e
User: jsparkes
Date: 2010-06-04 10:26:28+00:00
Summary: Merge from main.
Affected #: 25 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ec032c7ceba7/
Changeset: ec032c7ceba7
User: jsparkes
Date: 2010-06-05 08:44:36+00:00
Summary: * gtk-marshal.el (find-file): Add a marshaller that takes a
pointer and a bool and returns no value.
* emacs-marshals.c (emacs_gtk_marshal_NONE__POINTER_BOOL): Newly
added marshaller.
Affected #: 4 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/7a3dd63520e9/
Changeset: 7a3dd63520e9
User: jsparkes
Date: 2010-06-05 08:52:49+00:00
Summary: * ui-gtk.c (type_already_imported_p): Mark G_TYPE_NONE as
imported. Was mistakenly using G_VALUE_TYPE where just the type
was required.
(lisp_to_g_value): Ignore G_TYPE_INVALID.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/f9d58380527b/
Changeset: f9d58380527b
User: jsparkes
Date: 2010-06-08 20:21:09+00:00
Summary: * sysgtk.h: Include libgnomeui if we HAVE_GNOME. Remove other inclusions
of that header.
Affected #: 5 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ff8f51ca2b59/
Changeset: ff8f51ca2b59
User: jsparkes
Date: 2010-06-08 20:23:28+00:00
Summary: * menubar-gtk.c (XEMACS_MENU_DESCR_TAG): Convert GQuark defintions
back into #define constants.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/0bc7149cdf84/
Changeset: 0bc7149cdf84
User: jsparkes
Date: 2010-06-08 20:26:22+00:00
Summary: * menubar-gtk.c: (create_menubar_widget): Use cleaner logic when setting the
gnome app menubar.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/3c20d33b6562/
Changeset: 3c20d33b6562
User: jsparkes
Date: 2010-06-09 07:18:07+00:00
Summary: * toolbar-gtk.c (gtk_output_toolbar): If HAVE_GNOME, put the
TOP_EDGE toolbar into the GnomeApp toolbar slot. Create captioned
buttons if specified. Create the button using the toolbar
glyphs in the specifier and set the tooltip. Connect the click
callback action.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/bb50a74aefc8/
Changeset: bb50a74aefc8
User: jsparkes
Date: 2010-06-09 15:30:18+00:00
Summary: * toolbar-gtk.c (gtk_clear_toolbar): Uncomment.
(gtk_output_toolbar): Name toolbar. Clean up formatting.
(console_type_create_toolbar_gtk): Re-enable gtk_clear_toolbar.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ce41952f3d7f/
Changeset: ce41952f3d7f
User: jsparkes
Date: 2010-06-10 16:12:17+00:00
Summary: * fontcolor-impl.h (FONT_INSTANCE_PROPORTIONAL): Define accessor.
(XFONT_INSTANCE_PROPORTIONAL): Define accessor.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/acfccb98fd77/
Changeset: acfccb98fd77
User: jsparkes
Date: 2010-06-11 08:57:24+00:00
Summary: * lisp.h (XFREE): A macro to frees a pointer and then sets it to
zero.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/d8cadeef2c59/
Changeset: d8cadeef2c59
User: jsparkes
Date: 2010-06-11 09:00:39+00:00
Summary: * scrollbar-gtk.c (gtk_free_scrollbar_instance): Set the widget to
zero. Set the scrollbar_data to zero.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/f60c91a62052/
Changeset: f60c91a62052
User: jsparkes
Date: 2010-06-11 09:06:37+00:00
Summary: * frame-gtk.c (gtk_create_widgets): Assert return value of
g_signal_connect to validate.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/1d01d887e545/
Changeset: 1d01d887e545
User: jsparkes
Date: 2010-06-11 09:56:46+00:00
Summary: i * gtk-widgets.el: import new GtkNotebook functions.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/c804a9407c8c/
Changeset: c804a9407c8c
User: jsparkes
Date: 2010-06-11 10:00:18+00:00
Summary: * glyphs-gtk.c (gtk_tab_control_instantiate): Validate
g_signal_connect().
(gtk_tab_control_redisplay): Use gtk_notebook_set_current_page()
instead of deprecated gtk_notebook_set_page().
(gtk_tab_control_redisplay): Remove notebook pages from end.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/a1f17583463b/
Changeset: a1f17583463b
User: jsparkes
Date: 2010-06-21 08:13:39+00:00
Summary: * event-gtk.c (gtk_keysym_to_emacs_keysym):
Add GDK_Prior and GDK_Next.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/5e0faa7c4d02/
Changeset: 5e0faa7c4d02
User: jsparkes
Date: 2010-06-27 15:14:44+00:00
Summary: * console-x-impl.h (DEVICE_X_XFTDRAW): Define, instead of
FRAME_X_FTDRAW.
(struct x_device): Add XftDraw field.
(struct x_frame): Remove XftDraw field.
* device-x.c (x_delete_device): Free XftDraw here.
* frame-x.c (x_delete_frame): Remove freeing of XftDraw.
* redisplay-xlike-inc.c (XLIKE_output_string): Use
DEVICE_X_XFTDRAW instead of FRAME_X_XFTDRAW when lazily creating
XftDraw structure.
Affected #: 5 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/123ee0986a8a/
Changeset: 123ee0986a8a
User: jsparkes
Date: 2010-06-11 12:41:27+00:00
Summary: * frame-gtk.c (size_allocate_cb): Rename from resize_event_cb.
(gtk_create_widgets): Pass new name to signal callback. Validate
g_signal_connect().
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/0394aa3591a9/
Changeset: 0394aa3591a9
Branch: pango
User: jsparkes
Date: 2010-06-22 17:37:28+00:00
Summary: * console-x-impl.h (struct x_device): Move XftDraw from here.
(struct x_device): To here.
Rename FRAME_X_XFTDRAW to DEVICE_X_XFTDRAW.
(DEVICE_X_XFTDRAW): Move it to here.
* device-x.c (x_delete_device): Free device XftDraw here.
* frame-x.c (x_delete_frame): Move freeing of XftDraw from here.
* redisplay-xlike-inc.c (XLIKE_output_string): Allocate
DEVICE_X_XFTDRAW instead of obsolete FRAME_X_XFTDRAW.
Affected #: 5 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/5d4a3102e765/
Changeset: 5d4a3102e765
User: jsparkes
Date: 2010-06-30 17:31:27+00:00
Summary: * gtk-xemacs.c (gtk_xemacs_new): Make the xemacs widget require a
GdkWindow. This fixes the shrinking window problem for both menus
and toolbars.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/92a7800c407d/
Changeset: 92a7800c407d
User: jsparkes
Date: 2010-06-30 18:36:40+00:00
Summary: Removed debug printout.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/de831e6dc1f4/
Changeset: de831e6dc1f4
User: jsparkes
Date: 2010-06-30 18:49:34+00:00
Summary: Convert lisp args to gtk values correctly.
* ui-gtk.c (import_gtk_flags_internal): Added debug output for gtk
flag import.
(import_gtk_enumeration_internal): Added debug output for gtk enum
import.
(Fgtk_import_function_internal): Added debug message on function
import success.
(Fgtk_import_function_internal): Added debug message about
marshaller being used.
(Fgtk_call_function): Convert internal arguments to gtk types correctly.
(lisp_to_g_value): Convert lisp value to the base fundamental type
of requested arguments. Rename arg to val for better looking code.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/f0669a3b7f16/
Changeset: f0669a3b7f16
User: jsparkes
Date: 2010-06-30 18:56:06+00:00
Summary: Add two more sets of args for marshalling.
* gtk-marshal.el (find-file): Add two more sets of args for marshalling.
* emacs-marshals.c (emacs_gtk_marshal_POINTER__BOOL_INT): New
marshaller.
(emacs_gtk_marshal_POINTER__POINTER_POINTER): New marshaller.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/175dd6b763f6/
Changeset: 175dd6b763f6
User: jsparkes
Date: 2010-06-30 18:56:49+00:00
Summary: ChangeLog entries for previous changeset.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/c520f9e8b0aa/
Changeset: c520f9e8b0aa
User: jsparkes
Date: 2010-06-30 22:42:07+00:00
Summary: Fix shrinking window problem. Finally.
* gtk-xemacs.c (gtk_xemacs_new): Force gtk-xemacs widget to create
a window. This fixes the shrinking window problem.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ad68b5b515f4/
Changeset: ad68b5b515f4
User: jsparkes
Date: 2010-06-30 22:44:40+00:00
Summary: Merge from other side. I made a mess of it.
Affected #: 8 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/9d3acf5efa17/
Changeset: 9d3acf5efa17
User: jsparkes
Date: 2010-06-30 22:51:25+00:00
Summary: Prepare for putting the menu into a GnomeApp slot.
* frame-gtk.c (gtk_create_widgets): Ensure that the container is a
box before trying to pack it. This may not be true when using GnomeApp.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/7121b626d48a/
Changeset: 7121b626d48a
User: jsparkes
Date: 2010-06-30 22:52:24+00:00
Summary: Remove a debug message.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/277829b09f2e/
Changeset: 277829b09f2e
User: jsparkes
Date: 2010-06-30 22:52:48+00:00
Summary: Remove a debug message.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/de6fdec49044/
Changeset: de6fdec49044
User: jsparkes
Date: 2010-07-01 17:49:40+00:00
Summary: Assert checks on g_signal_connect.
* menubar-gtk.c (menu_convert): Check g_signal_connect with assert.
(menu_convert): Ditto. Use GINT_TO_POINTER for callback data.
(menu_descriptor_to_widget_1): Ditto.
(create_menubar_widget): Ditto.
(gtk_popup_menu): Ditto. Fix indentation.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/46856d46f47c/
Changeset: 46856d46f47c
User: jsparkes
Date: 2010-07-02 11:20:22+00:00
Summary: Enable menu code by avoid accelerators.
* menubar-gtk.c (__activate_menu): Use NULL accelerator until I
figure out Gtk 2.0 accelerators. Refactor loop code to avoid continue.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/4ec6ef05c652/
Changeset: 4ec6ef05c652
User: jsparkes
Date: 2010-07-02 15:44:19+00:00
Summary: Actually set the label on individual menu items.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/a9cb31f9caf4/
Changeset: a9cb31f9caf4
User: jsparkes
Date: 2010-07-02 15:47:17+00:00
Summary: Use an explicit separator where required.
* menubar-gtk.c (__activate_menu): Use NULL accelerator until I
figure out Gtk 2.0 accelerators. Refactor loop code to avoid continue.
(menu_descriptor_to_widget_1): Actually set the label on
individual menu items.
(menu_descriptor_to_widget_1): Use an explicit separator where required.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/b2af15770627/
Changeset: b2af15770627
User: jsparkes
Date: 2010-07-02 19:02:38+00:00
Summary: Use gtk stock icons for first four toolbar icons, as a demo.
* toolbar-gtk.c (gtk_output_toolbar): Hardwire first four toolbar
icons to be the correct gtk stock icons. This is for demo
purposes; this should be done in lisp.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/2a3d6ec5ab3f/
Changeset: 2a3d6ec5ab3f
User: jsparkes
Date: 2010-07-02 19:05:09+00:00
Summary: Define HAVE_PANGO via configure.
Affected #: 5 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/d09449dd0daf/
Changeset: d09449dd0daf
User: jsparkes
Date: 2010-07-07 18:11:27+00:00
Summary: When HAVE_GNOME, the top toolbar is drawn outside the text area.
* frame-impl.h: If HAVE_GNOME, the top toolbar is outside the text
widget. All measurements of the top toolbar size are returned as
zero. (Now there is an extra line at the bottom of the modeline
instead of the top of the text pane.)
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/28c81093e916/
Changeset: 28c81093e916
User: jsparkes
Date: 2010-07-08 13:05:36+00:00
Summary: Use gtk stock icons for most toolbar actions.
* toolbar-gtk.c (gtk_output_toolbar): Add gtk stock icons for
those toolbar buttons that match clearly.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/fd3c7f7fd0dd/
Changeset: fd3c7f7fd0dd
User: jsparkes
Date: 2010-07-08 13:26:14+00:00
Summary: * emacs.c (main_1): Call vars_of_toolbar_gtk when appropriate.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/fbddec3e0916/
Changeset: fbddec3e0916
User: jsparkes
Date: 2010-07-08 14:17:50+00:00
Summary: Look up gtk stock icons in a hash table indexed by function name.
* toolbar-gtk.c (init_gtk_toolbar_stock_icons): Build a hash table
of toolbar function to gtk stock icon name.
(gtk_output_toolbar): Look in the hash table for the stock icon
name, and try to load it. If loading fails, fall back to default
toolbar icon.
(vars_of_toolbar_gtk): Declare and initialize stock icon hash map
variable.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ffb867c8ad1d/
Changeset: ffb867c8ad1d
User: jsparkes
Date: 2010-07-04 11:59:29+00:00
Summary: Merge from main branch.
Affected #: 80 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/07d48a489c05/
Changeset: 07d48a489c05
User: jsparkes
Date: 2010-07-09 00:35:53+00:00
Summary: Merge main banch.
Affected #: 80 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/86a429eaeec1/
Changeset: 86a429eaeec1
Branch: pango
User: jsparkes
Date: 2010-07-16 21:44:21+00:00
Summary: Fix warnings.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/8906cb7527a7/
Changeset: 8906cb7527a7
User: jsparkes
Date: 2010-07-21 07:44:14+00:00
Summary: Silence a gtk warning.
* menubar-gtk.c (menu_descriptor_to_widget_1): Use activate signal
instead of activate-item when add an accelerator or else Gtk gives
a warning.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/5d5d8e302c26/
Changeset: 5d5d8e302c26
User: jsparkes
Date: 2010-07-22 08:21:07+00:00
Summary: * gtk-widgets.el: Import gtk-dialog functions.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/c0fff1030284/
Changeset: c0fff1030284
User: jsparkes
Date: 2010-07-22 08:27:14+00:00
Summary: Update to Gtk 2.0 dialog functions.
Affected #: 4 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/cb59c8870a02/
Changeset: cb59c8870a02
User: jsparkes
Date: 2010-07-27 11:36:37+00:00
Summary: Fix warning.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/1019f02ee8dd/
Changeset: 1019f02ee8dd
User: jsparkes
Date: 2010-07-27 11:37:12+00:00
Summary: Fix warning.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/9bc244609f0e/
Changeset: 9bc244609f0e
User: jsparkes
Date: 2010-07-12 16:43:40+00:00
Summary: Remove trace messages.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/b0549719052c/
Changeset: b0549719052c
User: jsparkes
Date: 2010-07-27 15:15:42+00:00
Summary: Define accessor macros for FFI types.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ca347d3a8e63/
Changeset: ca347d3a8e63
User: jsparkes
Date: 2010-07-28 18:30:51+00:00
Summary: Remove old workaround.
* scrollbar-gtk.c (gtk_create_scrollbar_instance): Remove
workaround for setting scrollbar size. Gtk 2.21.2 actively warns
when resizing to current size.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ff35c80d18a2/
Changeset: ff35c80d18a2
User: jsparkes
Date: 2010-07-29 13:40:29+00:00
Summary: Remove dockable and tear off menus.
* menubar-gtk.c: Remove dockable_menubar and tear_off_menus
variables. Remove TEAR_OFF_MENUS ifdefed code.
(__maybe_destroy): Remove tear off menus check.
(__activate_menu): Remove tear off menu initialization. Remove
dockable menu initialization.
(reinit_vars_of_menubar_gtk): No variables to initialize.
(vars_of_menubar_gtk): Remove DEFVAR of
menubar-dockable-p and menubar-tearable-p.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/4258aba8c536/
Changeset: 4258aba8c536
User: jsparkes
Date: 2010-07-30 13:56:07+00:00
Summary: Use small toolbar icons.
* toolbar-gtk.c (gtk_output_toolbar): Use small toolbar icons.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/f0dd00e5e00d/
Changeset: f0dd00e5e00d
User: jsparkes
Date: 2010-08-02 15:01:47+00:00
Summary: Convert marshalling from Gtk 1.X style using GtkArg to Gtk 2.X
style using GValue.
Affected #: 4 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/74bc1a27fe1a/
Changeset: 74bc1a27fe1a
User: jsparkes
Date: 2010-08-02 15:04:29+00:00
Summary: Merge from remote.
Affected #: 6 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/8fa1be71300f/
Changeset: 8fa1be71300f
User: jsparkes
Date: 2010-08-02 15:27:59+00:00
Summary: Add 0x to FFI pointer display.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/02d7bcf48158/
Changeset: 02d7bcf48158
User: jsparkes
Date: 2010-08-02 15:30:06+00:00
Summary: Remove extraneous calls to g_type_init.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/54ce7026fbe7/
Changeset: 54ce7026fbe7
User: jsparkes
Date: 2010-08-02 18:12:45+00:00
Summary: Intialize return value type in marshalling functions.
Affected #: 4 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/0589634a9d89/
Changeset: 0589634a9d89
User: jsparkes
Date: 2010-08-04 16:24:55+00:00
Summary: Removed unused variable.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/190ce81012d0/
Changeset: 190ce81012d0
User: jsparkes
Date: 2010-08-04 16:51:14+00:00
Summary: Fix g-type-from-name in ui-gtk.c
(Fg_type_from_name): Return nil for invalid types.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/f7d7dbef8535/
Changeset: f7d7dbef8535
User: jsparkes
Date: 2010-08-07 17:26:03+00:00
Summary: * ui-gtk.c (type_to_marshaller_type): Marshal OBJECT separate from
POINTER.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/5cc2e7752d23/
Changeset: 5cc2e7752d23
User: jsparkes
Date: 2010-08-07 18:04:21+00:00
Summary: Use the fundamental GType when converting to lisp.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/753d32ee5c51/
Changeset: 753d32ee5c51
User: jsparkes
Date: 2010-08-07 18:15:33+00:00
Summary: Actually call marshalling function and convert the return value to lisp.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ca2d2f9ed6cc/
Changeset: ca2d2f9ed6cc
User: jsparkes
Date: 2010-08-08 14:57:27+00:00
Summary: g-type-from-name now handles symbol argument.
* ui-gtk.c (Fg_type_from_name): Accept a symbol as an argument in
addition to a string.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/a53f53092ff5/
Changeset: a53f53092ff5
User: jsparkes
Date: 2010-08-06 12:49:04+00:00
Summary: Remove deprecated gtk-button-box functions.
* ui-byhand.c: remove deprecated gtk-button-box functions that
returned more than one value. Use properties instead.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/88aa6b193bc2/
Changeset: 88aa6b193bc2
User: jsparkes
Date: 2010-08-08 15:07:49+00:00
Summary: write_fmt_string doesn't have a %p format, use %0x instead.
* glyphs.c (print_image_instance): write_fmt_string doesn't have a %p
format, use %0x instead.
* ui-gtk.c (Fg_type_from_name): Accept a symbol as an argument in
addition to a string.
(emacs_gtk_boxed_printer): Use %0x instead of %p.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/79ef36b344de/
Changeset: 79ef36b344de
User: jsparkes
Date: 2010-08-08 15:25:22+00:00
Summary: Initialize GValue variables with memset.
2010-08-08 Jeff Sparkes <jsparkes(a)gmail.com>
* ui-gtk.c (emacs_gtk_object_putprop)
(Fg_object_class_list_properties): Initialize GValue with memset.
Using only g_value_init causes an error.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/c14162d09ed5/
Changeset: c14162d09ed5
User: jsparkes
Date: 2010-08-09 12:56:59+00:00
Summary: Merged from home.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/dbdfcd8d933f/
Changeset: dbdfcd8d933f
User: jsparkes
Date: 2010-08-10 16:10:30+00:00
Summary: Merging badly again.
Affected #: 4 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/7f9b78c52b30/
Changeset: 7f9b78c52b30
User: jsparkes
Date: 2010-08-10 16:15:35+00:00
Summary: Merge removal of trace messages.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/60d440827d1a/
Changeset: 60d440827d1a
User: jsparkes
Date: 2010-08-16 18:34:47+00:00
Summary: Initialize arg vector to NULL to avoid crash.
2010-08-16 Jeff Sparkes <jsparkes(a)gmail.com>
* ui-gtk.c (Fgtk_call_function): Initialize arg array to NULLs
before proceeding.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/29ee0ef08511/
Changeset: 29ee0ef08511
User: jsparkes
Date: 2010-08-18 13:14:59+00:00
Summary: 2010-08-18 Jeff Sparkes <jsparkes(a)gmail.com>
* toolbar.c (update_frame_toolbars_geometry): Use
FRAME_CURRENT_TOOLBAR_SIZE accessor macro.
(init_frame_toolbars): Ditto.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/b8f78ae41c1e/
Changeset: b8f78ae41c1e
User: jsparkes
Date: 2010-08-20 13:10:53+00:00
Summary: Remove obsolete comment.
2010-08-20 Jeff Sparkes <jsparkes(a)gmail.com>
* menubar-gtk.c (gtk_xemacs_menubar_size_request): Remove comment
about detached menus since we longer do that.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/7ed79adec943/
Changeset: 7ed79adec943
Branch: pango
User: jsparkes
Date: 2010-08-27 15:49:08+00:00
Summary: Named branch pango was a mistake
Affected #: 0 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/cbde1600c377/
Changeset: cbde1600c377
Branch: compiles
User: jsparkes
Date: 2010-08-27 15:49:55+00:00
Summary: Named branch compiles was a mistake
Affected #: 0 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/2eb66b797484/
Changeset: 2eb66b797484
User: jsparkes
Date: 2010-09-03 13:11:32+00:00
Summary: Don't look for libgnomeui, don't define HAVE_GNOME.
2010-09-03 Jeff Sparkes <jsparkes(a)gmail.com>
* configure.ac: libgnomeui will be removed in Gtk 3.0, and is
barely used anyway. No longer define HAVE_GNOME.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/c61f31f95c56/
Changeset: c61f31f95c56
User: jsparkes
Date: 2010-09-03 13:12:38+00:00
Summary: Missed last second changelog comment.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/8b05cef7c519/
Changeset: 8b05cef7c519
User: jsparkes
Date: 2010-09-03 13:22:40+00:00
Summary: libgnomeui was required for menu support.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/2a25eeaf78e9/
Changeset: 2a25eeaf78e9
User: jsparkes
Date: 2010-09-24 14:48:47+00:00
Summary: 2010-09-24 Jeff Sparkes <jsparkes(a)gmail.com>
* frame-gtk.c (gtk_create_widgets): Use GTK_SIGNAL_CONNECT instead
of obsolete G_SIGNAL_CONNECT.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/3205e3cedf7e/
Changeset: 3205e3cedf7e
User: jsparkes
Date: 2010-10-03 14:47:38+00:00
Summary: Add accelerator label to menu item.
2010-10-03 Jeff Sparkes <jsparkes(a)gmail.com>
* menubar-gtk.c (menu_descriptor_to_widget_1): Add second label
containing the accelerator to the menu item.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/4dbc4bee2b02/
Changeset: 4dbc4bee2b02
User: jsparkes
Date: 2010-10-03 19:29:42+00:00
Summary: Merge menubar accelerator change.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ad9ae39faf81/
Changeset: ad9ae39faf81
User: jsparkes
Date: 2010-10-03 19:42:10+00:00
Summary: Use %0x instead of %p to print pointers.
2010-10-03 Jeff Sparkes <jsparkes(a)gmail.com>
* ui-gtk.c (emacs_gtk_object_printer): Use %0x instead of %p to
print pointers.
(emacs_gtk_boxed_printer): Ditto.
(describe_gtk_arg): Ditto.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/6de38c114c51/
Changeset: 6de38c114c51
User: jsparkes
Date: 2010-10-04 17:12:23+00:00
Summary: Don't try to use an invalid accelerator key.
2010-10-04 Jeff Sparkes <jsparkes(a)gmail.com>
* menubar-gtk.c (menu_descriptor_to_widget_1): Don't try to use an
invalid accelerator key.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/38748b0baa6a/
Changeset: 38748b0baa6a
User: jsparkes
Date: 2010-10-04 17:20:06+00:00
Summary: Remove GtkXEmacsAccelLabel.
2010-10-04 Jeff Sparkes <jsparkes(a)gmail.com>
* menubar-gtk.c (menu_descriptor_to_widget_1): Don't try to use an
invalid accelerator key.
* menubar-gtk.c: Remove GtkXEmacsAccelLabel now that an easier
method to set the menu item accelerator labels is used.
(menu_convert): Use GtkLabel instead.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/d81733561de8/
Changeset: d81733561de8
User: jsparkes
Date: 2010-10-05 17:41:16+00:00
Summary: Set cleared toolbar widget to NULL.
2010-10-05 Jeff Sparkes <jsparkes(a)gmail.com>
* toolbar-gtk.c (gtk_clear_toolbar): Set cleared toolbar widget to
NULL.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/b7410ae25a81/
Changeset: b7410ae25a81
User: jsparkes
Date: 2010-10-05 19:56:48+00:00
Summary: symsinit.h: Add vars_of_toolbar_gtk () prototype.
2010-10-05 Jeff Sparkes <jsparkes(a)gmail.com>
* symsinit.h: Add vars_of_toolbar_gtk () prototype.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/5f63a8f38bfb/
Changeset: 5f63a8f38bfb
User: jsparkes
Date: 2010-10-19 15:52:17+00:00
Summary: memset local GValue variable to zero to reset the type.
2010-10-19 Jeff Sparkes <jsparkes(a)gmail.com>
* gtk-glue.c (xemacs_list_to_gtklist): memset local GValue
variable to zero to reset the type.
(xemacs_list_to_array): Ditto.
* ui-gtk.c: Ditto. (Two DEFUNs)
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/88de9a927158/
Changeset: 88de9a927158
User: jsparkes
Date: 2010-10-19 15:56:58+00:00
Summary: * gui.c (gui_item_value): Disable error check to avoid errors.
There is still a problem here to be fixed.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/5786ac742814/
Changeset: 5786ac742814
User: jsparkes
Date: 2010-10-19 16:04:29+00:00
Summary: Marshalling functions now use GValue, not GtkArg.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/3da2333211ca/
Changeset: 3da2333211ca
User: jsparkes
Date: 2010-10-19 16:19:39+00:00
Summary: Fix some warnings.
2010-10-19 Jeff Sparkes <jsparkes(a)gmail.com>
* menubar-gtk.c (menu_descriptor_to_widget_1): Initialize
gtk_accel variable.
(menu_descriptor_to_widget_1): Fix GTK type warnings.
(create_menubar_widget): Remove unused variable.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/22f7ca54f620/
Changeset: 22f7ca54f620
User: jsparkes
Date: 2010-10-20 14:21:58+00:00
Summary: Move some entries from ChangeLog to ChangeLog.GTK where they belong.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/8c38b630d309/
Changeset: 8c38b630d309
User: jsparkes
Date: 2010-10-27 15:31:59+00:00
Summary: 2010-10-27 Jeff Sparkes <jsparkes(a)gmail.com>
* ui-byhand.c (Fgtk_notebook_query_tab_label_packing): Wrong type
in error message.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/fb83677dd0e5/
Changeset: fb83677dd0e5
User: jsparkes
Date: 2010-11-03 14:36:13+00:00
Summary: Remove use of libgnome and HAVE_GNOME.
2010-11-02 Jeff Sparkes <jsparkes(a)gmail.com>
* config.h.in: libgnome and libgnomeui will be deprecated in GNOME
3.0; remove HAVE_GNOME.
* toolbar-gtk.c (gtk_output_toolbar): Remove HAVE_GNOME code.
* sysgtk.h: Remove HAVE_GNOME code.
* menubar-gtk.c (create_menubar_widget): Remove HAVE_GNOME code.
* frame-gtk.c (gtk_create_widgets): Remove HAVE_GNOME code.
* device-gtk.c (Fgtk_init): Remove gnome_init().
Affected #: 7 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/c30259b291a0/
Changeset: c30259b291a0
User: jsparkes
Date: 2010-11-03 14:40:29+00:00
Summary: Remove libgnome code.
2010-11-03 Jeff Sparkes <jsparkes(a)gmail.com>
* frame-impl.h (FRAME_REAL_TOP_TOOLBAR_BOUNDS): Remove HAVE_GNOME
code, which only worked for the top toolbar using GnomeApp.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/936a81aa26d3/
Changeset: 936a81aa26d3
User: jsparkes
Date: 2010-11-08 09:51:56+00:00
Summary: Old anti-flickering code causes scrollbar flickering.
2010-11-08 Jeff Sparkes <jsparkes(a)gmail.com>
* scrollbar-gtk.c (gtk_update_scrollbar_instance_status): Remove
old code to avoid flickering. It actually causes flickering in
gtk 2.28.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/5e8f0a9418aa/
Changeset: 5e8f0a9418aa
User: jsparkes
Date: 2010-11-08 14:11:23+00:00
Summary: Merge scrollbar flicker simplication code.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/8ff9013321ac/
Changeset: 8ff9013321ac
User: jsparkes
Date: 2011-03-09 17:18:05+00:00
Summary: gtkfixed.h no longer needed in Gtk 2.0; will be removed in Gtk 3.0
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/a7dc53d1db7f/
Changeset: a7dc53d1db7f
User: jsparkes
Date: 2011-03-09 17:32:17+00:00
Summary: Updat gdk key names from 1.0 style to 2.0 style.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/731dd82ca6ee/
Changeset: 731dd82ca6ee
User: jsparkes
Date: 2011-03-09 17:33:10+00:00
Summary: Move last two change log entries to ChangeLog.GTK.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/23a2bee0c658/
Changeset: 23a2bee0c658
User: jsparkes
Date: 2011-03-09 17:45:47+00:00
Summary: Move last two change log entries to ChangeLog.GTK.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/bc93a04210bb/
Changeset: bc93a04210bb
User: jsparkes
Date: 2011-02-21 19:26:32+00:00
Summary: Use cairo to clear text rectangle.
2010-11-22 Jeff Sparkes <jsparkes(a)gmail.com>
* redisplay-gtk.c (gtk_fill_rectangle): New function to fill a
rectangle using cairo.
(gdk_draw_text_image): Use it here.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/e63bea5d21e8/
Changeset: e63bea5d21e8
User: jsparkes
Date: 2011-03-09 18:19:42+00:00
Summary: Merge from home. Maybe I did it right this time.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/53291689820a/
Changeset: 53291689820a
User: jsparkes
Date: 2011-03-09 18:48:22+00:00
Summary: Add HAVE_PANGOXFT to configuration.
Affected #: 4 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/83640f28bf46/
Changeset: 83640f28bf46
User: jsparkes
Date: 2011-03-11 01:18:12+00:00
Summary: GDK draws text relative to the baseline, so we offset by font descent.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/23ebde6e3584/
Changeset: 23ebde6e3584
User: jsparkes
Date: 2011-03-18 18:06:00+00:00
Summary: gdk_draw_text_image now has a GtkWidget argument.
Also made pango case compile, but the text display is blank.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/04d32378c395/
Changeset: 04d32378c395
User: jsparkes
Date: 2011-03-21 18:09:08+00:00
Summary: Uppercase a define value.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/4d4516238392/
Changeset: 4d4516238392
User: jsparkes
Date: 2011-03-24 19:43:21+00:00
Summary: Improved pango and pangoxft detection.
gtk-config 0.25 is valid.
HAVE_GTK implies HAVE_PANGO.
Move HAVE_PANGOXFT check after HAVE_GTK check.
Remove unused libgnomeui check.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/59987915a643/
Changeset: 59987915a643
User: jsparkes
Date: 2011-03-26 11:26:32+00:00
Summary: Fix pangoxft checks.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/b2a7913ddf5d/
Changeset: b2a7913ddf5d
User: jsparkes
Date: 2011-04-01 13:02:56+00:00
Summary: Use PangoFont instead of GtkFont for drawing text.
* console-gtk-impl.h (struct gtk_device): Add PangoFontMap.
(DEVICE_GTK_FONT_MAP): Add accessor macro.
* device-gtk.c (gtk_init_device): Remove ifdef around pango setup.
* faces.c (complex_vars_of_faces): Define default faces for
Gtk/Pango. Monospace, unifont and a CJK one, based on Ubuntu
ttf fonts.
* fontcolor-gtk-impl.h (struct gtk_font_instance_data): No longer
ifdefed.
* fontcolor-gtk.c (gtk_initialize_font_instance): Initialize a
pango font, also looking up the font description and font metrics.
(gtk_print_font_instance): gdk_font_id isn't valid for a PangoFont.
(gtk_finalize_font_instance): free pango font resources.
(__get_gtk_font_truename): Return name from pango font
description. This may be insufficient.
* redisplay-gtk.c (gdk_draw_text_image): Draw the text using pango
layout. Take foreground and background color arguments for cairo
instead of a GdkGc.
(XLIKE_text_width_single_run): Implement pango based version.
* redisplay-xlike-inc.c (XLIKE_output_string): Use pango font
metrics for underline and strikethrough positions.
(XLIKE_output_string): Pass foreground and background colors to
gdk instead of a background Gc.
(XLIKE_get_gc): No longer need to copy the font; now a PangoFont
is used instead.
(XLIKE_text_width_single_run): Don't use this one for Gtk, use the
one in redisplay-gtk.c.
* sysgtk.h (include): Always include pango.h and pangoxft.h
Affected #: 9 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/341a8c44815f/
Changeset: 341a8c44815f
User: jsparkes
Date: 2011-04-01 18:59:42+00:00
Summary: gdk_draw_text_image now takes a face argument.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/825334c0c2d1/
Changeset: 825334c0c2d1
User: jsparkes
Date: 2011-04-01 19:32:08+00:00
Summary: Implement strikethrough and underline as pango text attributes.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/d8355ed6b7b3/
Changeset: d8355ed6b7b3
User: jsparkes
Date: 2011-04-01 19:49:07+00:00
Summary: Make default Gtk font be Monospace Normal 10.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/9ea45a706043/
Changeset: 9ea45a706043
User: jsparkes
Date: 2011-04-03 18:11:03+00:00
Summary: Move font-{bold,italic} functions into C from lisp.
Affected #: 4 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/ff819e119201/
Changeset: ff819e119201
User: jsparkes
Date: 2011-04-04 13:26:45+00:00
Summary: Not sure why I needed this merge..
Affected #: 4 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/3205b02056f9/
Changeset: 3205b02056f9
User: jsparkes
Date: 2011-04-05 17:46:04+00:00
Summary: Use recommended pango initialization sequence.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/424a242cd7d7/
Changeset: 424a242cd7d7
User: jsparkes
Date: 2011-04-06 13:51:44+00:00
Summary: Define a function to convert XLFD a fontconfig names to pango font format.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/4323a31d9e7e/
Changeset: 4323a31d9e7e
User: jsparkes
Date: 2011-04-11 17:21:49+00:00
Summary: Don't use XLFD based logic to match font with charset for Gtk.
Created a dummy function for gtk, that just returns the same font.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/5b3d00286d41/
Changeset: 5b3d00286d41
User: jsparkes
Date: 2011-04-11 17:24:48+00:00
Summary: Define a function to convert internal characters into utf-8 for Gtk.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/790b0c11fd68/
Changeset: 790b0c11fd68
User: jsparkes
Date: 2011-04-11 17:30:05+00:00
Summary: Always layout text when determining width to account for combining marks.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/1ad656e4aedb/
Changeset: 1ad656e4aedb
User: jsparkes
Date: 2011-04-11 17:31:53+00:00
Summary: Forgot to check in ChangeLog.gtk.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/e7645029d081/
Changeset: e7645029d081
User: jsparkes
Date: 2011-04-13 12:06:36+00:00
Summary: Define gtk-fallback-font-name and gtk-fallback-font-size.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/4b5aeba1c3f0/
Changeset: 4b5aeba1c3f0
User: jsparkes
Date: 2011-04-13 12:24:35+00:00
Summary: Implement font list for pango fonts.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/bc3f0ff85cc7/
Changeset: bc3f0ff85cc7
User: jsparkes
Date: 2011-04-13 12:26:00+00:00
Summary: Make fallback font size same as defaults: 12.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/750f4cd11f8d/
Changeset: 750f4cd11f8d
User: jsparkes
Date: 2011-04-13 12:28:00+00:00
Summary: Wrap some lines to fit.
Affected #: 1 file
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/cc0b68a50a36/
Changeset: cc0b68a50a36
User: jsparkes
Date: 2011-04-13 12:33:56+00:00
Summary: Remove obsolete comments about Gtk 8/16 bit text display.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/3cf6b9c3d96b/
Changeset: 3cf6b9c3d96b
User: jsparkes
Date: 2011-04-13 12:40:19+00:00
Summary: Move ifdef THIS_IS_X outside of if statements for underline and strikthru
handling. Gtk does it differently.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/60bbf5ec1020/
Changeset: 60bbf5ec1020
User: jsparkes
Date: 2011-04-13 14:47:42+00:00
Summary: Fix errors and warnings from compiling with g++.
Affected #: 5 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/cd564b5898f0/
Changeset: cd564b5898f0
User: jsparkes
Date: 2011-04-13 14:49:23+00:00
Summary: Set default fonts for Gtk, avoidig XLFD specifications.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/d98640bd6899/
Changeset: d98640bd6899
User: jsparkes
Date: 2011-04-14 20:16:50+00:00
Summary: Add a monospace pattern to gtk-font-list.
Use FcNameParse to handle a fontconfig name.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/c612167e682d/
Changeset: c612167e682d
User: jsparkes
Date: 2011-04-18 18:09:15+00:00
Summary: Use 10 pt instead of 12 pt fonts for Gtk.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/58c23ac829d0/
Changeset: 58c23ac829d0
User: jsparkes
Date: 2011-04-17 21:44:27+00:00
Summary: Define g-type-name.
Make g-object-class-list-properties return an alist of property name
plus property type.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/9e3b24b9999a/
Changeset: 9e3b24b9999a
User: jsparkes
Date: 2011-04-21 08:48:01+00:00
Summary: Merge.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/59c4d91f386e/
Changeset: 59c4d91f386e
User: jsparkes
Date: 2011-04-21 08:52:27+00:00
Summary: Define g-type-parent and g-type-children.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/e6181ef4e01a/
Changeset: e6181ef4e01a
User: jsparkes
Date: 2011-04-22 15:31:32+00:00
Summary: Comment out unused variable.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/e1bcadd3fea6/
Changeset: e1bcadd3fea6
User: jsparkes
Date: 2011-04-22 15:34:09+00:00
Summary: Add gtk-window-new.
Remove 1.X args from gtk-toolbar-new.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/e363c0901567/
Changeset: e363c0901567
User: jsparkes
Date: 2011-04-23 07:55:30+00:00
Summary: Add new marshaller INT__INT.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/0d45d323ede8/
Changeset: 0d45d323ede8
User: jsparkes
Date: 2011-04-23 07:56:41+00:00
Summary: Mark an unused argument.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/16e525304900/
Changeset: 16e525304900
User: jsparkes
Date: 2011-04-23 08:30:00+00:00
Summary: Use alists to hold enumeration, flags and imported types.
* glyphs-gtk.c (resource_name_to_resource): Update for renamed
lisp_to_gtk_enum.
* ui-gtk.c: Enumerations and flags are now stored in an alist.
GType is represented as a symbol in lisp because an unsigned int
might be too large.
(type_as_symbol): Define.
(type_already_imported_p): Return imported type as symbol. Look up
type in alist. Enumeration and flags need to be imported.
(mark_type_as_imported): Add to Vgtk_types alist. Return symbol.
(mark_type_as_imported): Handle type as symbol. Return symbol
(import_gtk_flags_internal): Use Vgtk_flags alist.
(import_gtk_enumeration_internal): Use Vgtk_enumerations alist.
(import_gtk_type): Handle type as symbol.
(Fgtk_import_function_internal): Invalid argument, not sf error.
(vars_of_ui_gtk): Add Vgtk_flags, rename to Vgtk_enumerations,
update doc of Vgtk_type for alist.
(g_type_to_lisp): Handle flags correctly.
(lisp_to_g_value): Handle enums and flags correctly.
(get_enumeration): Update for alist.
(lisp_to_gtk_flag): Update called function args.
(lisp_to_gtk_enum): Rename from symbol_to_gtk_enum. Update for
alist. Error if unknown enum.
(lisp_to_gtk_flag): Update for alist. Error if unknown flag.
Affected #: 3 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/1c630371ab3a/
Changeset: 1c630371ab3a
User: jsparkes
Date: 2011-04-23 09:01:52+00:00
Summary: Fix mistakes checked in accidentally.
Use type conversion macros for Gtk data.
Affected #: 2 files
Diff not available.
https://bitbucket.org/xemacs/xemacs/commits/7201a174a71e/
Changeset: 7201a174a71e
User: jsparkes
Date: 2011-04-23 09:02:31+00:00
Summary: Use type conversion macros.
Affected #: 2 files
Diff not available.
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fix fontification of first declaration within a
C++ lambda form.
7 years
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/125218d347ca/
Changeset: 125218d347ca
User: acm
Date: 2017-12-14 20:55:10+00:00
Summary: Fix fontification of first declaration within a C++ lambda form.
* cc-engine.el (c-looking-at-or-maybe-in-bracelist): Cease spuriously
recognizing the braces of a lambda form as a brace list when there is an "="
preceding the introductory brackets.
Affected #: 1 file
diff -r f403d0ee1451d89f9bc647ae8c73dc96c7551952 -r 125218d347ca602b4f09318fb79c8ca6fb895fc9 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -10449,7 +10449,7 @@
c-decl-block-key))
(braceassignp 'dontknow)
inexpr-brace-list bufpos macro-start res pos after-type-id-pos
- in-paren)
+ in-paren parens-before-brace)
(setq res (c-backward-token-2 1 t lim))
;; Checks to do only on the first sexp before the brace.
@@ -10467,6 +10467,9 @@
((and (looking-at c-symbol-start)
(not (looking-at c-keywords-regexp)))
(setq after-type-id-pos (point)))
+ ((eq (char-after) ?\()
+ (setq parens-before-brace t)
+ nil)
(t nil))
(save-excursion
(cond
@@ -10515,6 +10518,14 @@
;; Single identifier between '(' and '{'. We have a bracelist.
(cons after-type-id-pos 'in-paren))
+ ;; Are we at the parens of a C++ lambda expression?
+ ((and parens-before-brace
+ (save-excursion
+ (and
+ (zerop (c-backward-token-2 1 t lim))
+ (c-looking-at-c++-lambda-capture-list))))
+ nil) ; a lambda expression isn't a brace list.
+
(t
(goto-char pos)
;; Checks to do on all sexps before the brace, up to the
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fix misfontification of C++ member
initialization list after "throw"
7 years
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/f403d0ee1451/
Changeset: f403d0ee1451
User: acm
Date: 2017-12-14 17:43:41+00:00
Summary: Fix misfontification of C++ member initialization list after "throw"
* cc-engine.el (c-forward-type): Stop recognizing a "type" starting with
"throw", by using c-opt-type-modifier-prefix-key.
* cc-langs.el (c-type-modifier-prefix-kwds): New lang const which, in C++,
doesn't contain "throw", otherwise like c-type-modifier-kwds.
(c-opt-type-modifier-prefix-key): New lang const and var, a regexp matching
any keyword in the previous lang const.
Affected #: 2 files
diff -r f317d82b1010097a2b092dd010c6d0ec5b45a85d -r f403d0ee1451d89f9bc647ae8c73dc96c7551952 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -7583,8 +7583,8 @@
;; Skip leading type modifiers. If any are found we know it's a
;; prefix of a type.
- (when c-opt-type-modifier-key ; e.g. "const" "volatile", but NOT "typedef"
- (while (looking-at c-opt-type-modifier-key)
+ (when c-opt-type-modifier-prefix-key ; e.g. "const" "volatile", but NOT "typedef"
+ (while (looking-at c-opt-type-modifier-prefix-key)
(goto-char (match-end 1))
(c-forward-syntactic-ws)
(setq res 'prefix)))
diff -r f317d82b1010097a2b092dd010c6d0ec5b45a85d -r f403d0ee1451d89f9bc647ae8c73dc96c7551952 cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -1908,16 +1908,32 @@
t (c-make-keywords-re t (c-lang-const c-type-prefix-kwds)))
(c-lang-defvar c-type-prefix-key (c-lang-const c-type-prefix-key))
-(c-lang-defconst c-type-modifier-kwds
- "Type modifier keywords. These can occur almost anywhere in types
-but they don't build a type of themselves. Unlike the keywords on
-`c-primitive-type-kwds', they are fontified with the keyword face and
-not the type face."
+(c-lang-defconst c-type-modifier-prefix-kwds
+ "Type modifier keywords which can appear in front of a type. These can
+also occur almost anywhere in types but they don't build a type of
+themselves. Unlike the keywords on `c-primitive-type-kwds', they are
+fontified with the keyword face and not the type face."
t nil
c '("const" "restrict" "volatile")
- c++ '("const" "noexcept" "volatile" "throw")
+ c++ '("const" "noexcept" "volatile")
objc '("const" "volatile"))
+(c-lang-defconst c-opt-type-modifier-prefix-key
+ ;; Adorned regexp matching `c-type-modifier-prefix-kwds', or nil in
+ ;; languages without such keywords.
+ t (and (c-lang-const c-type-modifier-prefix-kwds)
+ (c-make-keywords-re t (c-lang-const c-type-modifier-prefix-kwds))))
+(c-lang-defvar c-opt-type-modifier-prefix-key
+ (c-lang-const c-opt-type-modifier-prefix-key))
+
+(c-lang-defconst c-type-modifier-kwds
+ "Type modifier keywords. These can occur almost anywhere in types except
+at the start, but they don't build a type of themselves. Unlike the keywords
+on `c-primitive-type-kwds', they are fontified with the keyword face and not
+the type face."
+ t (c-lang-const c-type-modifier-prefix-kwds)
+ c++ (append (c-lang-const c-type-modifier-prefix-kwds) '("throw")))
+
(c-lang-defconst c-opt-type-modifier-key
;; Adorned regexp matching `c-type-modifier-kwds', or nil in
;; languages without such keywords.
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Don't misfontify "foo ()" inside C++
initialization parentheses as a type
7 years
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/f317d82b1010/
Changeset: f317d82b1010
User: acm
Date: 2017-12-13 20:28:28+00:00
Summary: Don't misfontify "foo ()" inside C++ initialization parentheses as a type
Also recognize and handle function names introduced by "extern" inside a
function.
* cc-engine.el (c-forward-decl-or-cast-1): Add a new element to the result
list which is t when our declaration is, or is to be treated as, being at top
level.
* cc-fonts.el (c-get-fontification-context): Detect being inside a C++ uniform
initialization and return (not-decl nil) for this case.
(c-font-lock-declarations): Use the new element 4 of the result of
c-forward-decl-or-cast-1.
* cc-langs.el (c-make-top-level-kwds, c-make-top-level-key): New lang
consts/vars.
Affected #: 3 files
diff -r 73e4dec237e8ae7a2ce08cc9f788c141e90e13db -r f317d82b1010097a2b092dd010c6d0ec5b45a85d cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -8178,9 +8178,9 @@
;; If a declaration is parsed:
;;
;; The point is left at the first token after the first complete
- ;; declarator, if there is one. The return value is a list of 4 elements,
+ ;; declarator, if there is one. The return value is a list of 5 elements,
;; where the first is the position of the first token in the declarator.
- ;; (See below for the other three.)
+ ;; (See below for the other four.)
;; Some examples:
;;
;; void foo (int a, char *b) stuff ...
@@ -8219,7 +8219,9 @@
;;
;; The third element of the return value is non-nil when the declaration
;; parsed might be an expression. The fourth element is the position of
- ;; the start of the type identifier.
+ ;; the start of the type identifier. The fifth element is t if either
+ ;; CONTEXT was 'top, or the declaration is detected to be treated as top
+ ;; level (e.g. with the keyword "extern").
;;
;; If a cast is parsed:
;;
@@ -8317,6 +8319,9 @@
;; Set when the symbol before `preceding-token-end' is known to
;; terminate the previous construct, or when we're at point-min.
at-decl-start
+ ;; Set when we have encountered a keyword (e.g. "extern") which
+ ;; causes the following declaration to be treated as though top-level.
+ make-top
;; Save `c-record-type-identifiers' and
;; `c-record-ref-identifiers' since ranges are recorded
;; speculatively and should be thrown away if it turns out
@@ -8348,7 +8353,9 @@
(cond
;; Look for a specifier keyword clause.
- ((or (looking-at c-prefix-spec-kwds-re)
+ ((or (and (looking-at c-make-top-level-key)
+ (setq make-top t))
+ (looking-at c-prefix-spec-kwds-re)
(and (c-major-mode-is 'java-mode)
(looking-at "@[A-Za-z0-9]+")))
(save-match-data
@@ -8618,7 +8625,7 @@
;; construct here in C, since we want to recognize this as a
;; typeless function declaration.
(not (and (c-major-mode-is 'c-mode)
- (eq context 'top)
+ (or (eq context 'top) make-top)
(eq (char-after) ?\)))))
(if (eq (char-after) ?\))
(when (> paren-depth 0)
@@ -8666,7 +8673,7 @@
;; Recognize a top-level typeless
;; function declaration in C.
(and (c-major-mode-is 'c-mode)
- (eq context 'top)
+ (or (eq context 'top) make-top)
(eq (char-after) ?\))))))))
(setq pos (c-up-list-forward (point)))
(eq (char-before pos) ?\)))
@@ -8923,6 +8930,7 @@
(when (and got-identifier
(looking-at c-after-suffixed-type-decl-key)
(or (eq context 'top)
+ make-top
(and (eq context nil)
(match-beginning 1)))
(if (and got-parens
@@ -9089,7 +9097,7 @@
;; CASE 19
(or (eq context 'decl)
(and (c-major-mode-is 'c-mode)
- (eq context 'top))))))
+ (or (eq context 'top) make-top))))))
;; The point is now after the type decl expression.
@@ -9194,7 +9202,8 @@
(and (or at-type-decl at-typedef)
(cons at-type-decl at-typedef))
maybe-expression
- type-start))
+ type-start
+ (or (eq context 'top) make-top)))
(t
;; False alarm. Restore the recorded ranges.
diff -r 73e4dec237e8ae7a2ce08cc9f788c141e90e13db -r f317d82b1010097a2b092dd010c6d0ec5b45a85d cc-fonts.el
--- a/cc-fonts.el
+++ b/cc-fonts.el
@@ -1251,6 +1251,17 @@
;; Got a cached hit in some other type of arglist.
(type
(cons 'arglist t))
+ ;; We're at a C++ uniform initialization.
+ ((and (c-major-mode-is 'c++-mode)
+ (eq (char-before match-pos) ?\()
+ (save-excursion
+ (goto-char match-pos)
+ (and
+ (zerop (c-backward-token-2 2))
+ (looking-at c-identifier-start)
+ (c-got-face-at (point)
+ '(font-lock-variable-name-face)))))
+ (cons 'not-decl nil))
((and not-front-decl
;; The point is within the range of a previously
;; encountered type decl expression, so the arglist
@@ -1589,7 +1600,8 @@
(setq max-type-decl-end (point))))
(goto-char start-pos)
(c-font-lock-single-decl limit decl-or-cast match-pos
- context toplev))
+ context
+ (or toplev (nth 4 decl-or-cast))))
(t t))))
diff -r 73e4dec237e8ae7a2ce08cc9f788c141e90e13db -r f317d82b1010097a2b092dd010c6d0ec5b45a85d cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -2338,6 +2338,16 @@
t nil
(c c++ objc) '("extern"))
+(c-lang-defconst c-make-top-level-kwds
+ "Keywords which make declarations they introduce be handled as top-level."
+ t nil
+ (c c++ objc) '("extern"))
+
+(c-lang-defconst c-make-top-level-key
+ ;; A regexp which matches any `c-make-top-level-kwds' keyword.
+ t (c-make-keywords-re t (c-lang-const c-make-top-level-kwds)))
+(c-lang-defvar c-make-top-level-key (c-lang-const c-make-top-level-key))
+
(c-lang-defconst c-type-list-kwds
"Keywords that may be followed by a comma separated list of type
identifiers, where each optionally can be prefixed by keywords. (Can
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Set input FDs to non-blocking unconditionally,
thank you Myrkraverk
7 years
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/affc195870d6/
Changeset: affc195870d6
User: kehoea
Date: 2017-12-12 08:27:11+00:00
Summary: Set input FDs to non-blocking unconditionally, thank you Myrkraverk
src/ChangeLog addition:
2017-12-12 Aidan Kehoe <kehoea(a)parhasard.net>
* process-unix.c (unix_init_process_io_handles):
Set input FDs to non-blocking unconditionally, see recent patch
posted to xemacs-beta from Johann "Myrkraverk" Oskarsson.
Affected #: 2 files
diff -r 0f7f0274157b50c71683368d0614b8912e2b70d7 -r affc195870d60c7f3f61d304cc01f205f63432d8 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-12 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * process-unix.c (unix_init_process_io_handles):
+ Set input FDs to non-blocking unconditionally, see recent patch
+ posted to xemacs-beta from Johann "Myrkraverk" Oskarsson.
+
2017-12-02 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecode.c (set_compiled_function_arglist):
diff -r 0f7f0274157b50c71683368d0614b8912e2b70d7 -r affc195870d60c7f3f61d304cc01f205f63432d8 src/process-unix.c
--- a/src/process-unix.c
+++ b/src/process-unix.c
@@ -831,6 +831,25 @@
/* if sizeof(EMACS_INT) > sizeof(int) this truncates the value */
UNIX_DATA(p)->infd = (EMACS_INT) in;
UNIX_DATA(p)->errfd = (EMACS_INT) err;
+
+ /* In the event where the input file descriptor is a pipe, XEmacs as of
+ * 21.4.24 will hang on the read() system call when the pipe doesn't
+ * have enough to fill the incoming buffer.
+ *
+ * This will likely affect other kinds of blocking file descriptors also, so
+ * we unconditionally set the input fd to non-blocking mode. See:
+ * http://mid.xemacs.org/CAA_SOw__WYNiUO=4hHhiwg0LXq7++9Xr=tnBMgN5Uc8iAa+mvg...
+ * and the related thread.
+ */
+ {
+ int f = fcntl (UNIX_DATA(p)->infd, F_SETFL, O_NONBLOCK);
+ if (f == -1)
+ {
+ warn_when_safe (Qio_error, lisp_strerror (errno),
+ "failed setting pipe (fd %ld) to nonblocking mode",
+ (EMACS_INT) in);
+ }
+ }
}
/* Move the file descriptor FD so that its number is not less than MIN. *
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Get X11 redisplay working again for the
just-in-time Unicode characters.
7 years
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/0f7f0274157b/
Changeset: 0f7f0274157b
User: kehoea
Date: 2017-12-06 20:52:28+00:00
Summary: Get X11 redisplay working again for the just-in-time Unicode characters.
src/ChangeLog addition:
2017-12-06 Aidan Kehoe <kehoea(a)parhasard.net>
* unicode.c (allocate_jit_ucs_charset):
Ben removed the ccl-encode-to-ucs-2 CCL program even from the
non-unicode-internal build, and this meant that redisplay of the
just-in-time characters failed on X11.
Address this and simplify the code by leaving charset-registries
as nil for the just in time charsets, meaning the second-stage
code always gets invoked, and we don't need the CCL program.
Affected #: 2 files
diff -r 1f54a2879725779c7da8c8a3b22de821a595e049 -r 0f7f0274157b50c71683368d0614b8912e2b70d7 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -13,6 +13,16 @@
If KEY is a cons, loop using EXTERNAL_LIST_LOOP_3(), giving us
type and circularity checking.
+2017-12-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * unicode.c (allocate_jit_ucs_charset):
+ Ben removed the ccl-encode-to-ucs-2 CCL program even from the
+ non-unicode-internal build, and this meant that redisplay of the
+ just-in-time characters failed on X11.
+ Address this and simplify the code by leaving charset-registries
+ as nil for the just in time charsets, meaning the second-stage
+ code always gets invoked, and we don't need the CCL program.
+
2017-11-30 Aidan Kehoe <kehoea(a)parhasard.net>
* keymap.c (describe_command):
diff -r 1f54a2879725779c7da8c8a3b22de821a595e049 -r 0f7f0274157b50c71683368d0614b8912e2b70d7 src/unicode.c
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -1301,17 +1301,17 @@
sprintf (setname, "jit-ucs-charset-%d", number_of_jit_charsets);
- Vcurrent_jit_charset = Fmake_charset
- (intern (setname), Vcharset_descr,
- nconc2 (list6 (Qcolumns, Qone, Qchars,
- make_fixnum (96),
- Qdimension, make_fixnum (2)),
- list4 (Qregistries, Qunicode_registries,
- /* not allowed to set non-nil tags when not yet
- initialized, for bootstrapping reasons; these
- get set in mule-charset.el */
- Qtags, initialized ? list2 (intern ("jit"), Qinternal)
- : Qnil)));
+ Vcurrent_jit_charset
+ = Fmake_charset (intern (setname), Vcharset_descr,
+ listu (Qcolumns, Qone, Qchars, make_fixnum (96),
+ Qdimension, make_fixnum (2),
+ /* not allowed to set non-nil tags when not yet
+ initialized, for bootstrapping reasons; these
+ get set in mule-charset.el */
+ Qtags, initialized ? list2 (intern ("jit"),
+ Qinternal) : Qnil,
+ Qunbound));
+
XCHARSET (Vcurrent_jit_charset)->jit_charset_p = 1;
last_allocated_jit_c1 = last_allocated_jit_c2 = 32;
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.