applied jamesa-971010-0 for stability. applied jamesa-971010-2 for a small

* gtkfilesel.c: applied jamesa-971010-0 for stability.
        * gtkrc.c: applied jamesa-971010-2 for a small optimization.
        * gtkcheckmenuitem.h:
        * gtkcheckmenuitem.c:
        * gtkradiomenuitem.c:
        * testgtk.c: applied johannes-971113-0 which adds
        gtk_check_menu_item_set_show_toggle() to change the way check
        menu items and radio menu items look.
-timj
This commit is contained in:
Tim Janik 1997-12-07 02:34:38 +00:00
parent 7e4ee8cb4f
commit 37f6b421f2
14 changed files with 137 additions and 26 deletions

View File

@ -1,3 +1,14 @@
Sun Dec 7 03:19:02 1997 Tim Janik <timj@psynet.net>
* gtkfilesel.c: applied jamesa-971010-0 for stability.
* gtkrc.c: applied jamesa-971010-2 for a small optimization.
* gtkcheckmenuitem.h:
* gtkcheckmenuitem.c:
* gtkradiomenuitem.c:
* testgtk.c: applied johannes-971113-0 which adds
gtk_check_menu_item_set_show_toggle() to change the way check
menu items and radio menu items look.
Fri Dec 5 1997 Elliot Lee <sopwith@cuc.edu>
* gdk/gdk.c: clean up warnings, remove some un-ifdef'd debugging
printing, DnD is Bug Free now, etc.

View File

@ -1,3 +1,14 @@
Sun Dec 7 03:19:02 1997 Tim Janik <timj@psynet.net>
* gtkfilesel.c: applied jamesa-971010-0 for stability.
* gtkrc.c: applied jamesa-971010-2 for a small optimization.
* gtkcheckmenuitem.h:
* gtkcheckmenuitem.c:
* gtkradiomenuitem.c:
* testgtk.c: applied johannes-971113-0 which adds
gtk_check_menu_item_set_show_toggle() to change the way check
menu items and radio menu items look.
Fri Dec 5 1997 Elliot Lee <sopwith@cuc.edu>
* gdk/gdk.c: clean up warnings, remove some un-ifdef'd debugging
printing, DnD is Bug Free now, etc.

View File

@ -1,3 +1,14 @@
Sun Dec 7 03:19:02 1997 Tim Janik <timj@psynet.net>
* gtkfilesel.c: applied jamesa-971010-0 for stability.
* gtkrc.c: applied jamesa-971010-2 for a small optimization.
* gtkcheckmenuitem.h:
* gtkcheckmenuitem.c:
* gtkradiomenuitem.c:
* testgtk.c: applied johannes-971113-0 which adds
gtk_check_menu_item_set_show_toggle() to change the way check
menu items and radio menu items look.
Fri Dec 5 1997 Elliot Lee <sopwith@cuc.edu>
* gdk/gdk.c: clean up warnings, remove some un-ifdef'd debugging
printing, DnD is Bug Free now, etc.

View File

@ -1,3 +1,14 @@
Sun Dec 7 03:19:02 1997 Tim Janik <timj@psynet.net>
* gtkfilesel.c: applied jamesa-971010-0 for stability.
* gtkrc.c: applied jamesa-971010-2 for a small optimization.
* gtkcheckmenuitem.h:
* gtkcheckmenuitem.c:
* gtkradiomenuitem.c:
* testgtk.c: applied johannes-971113-0 which adds
gtk_check_menu_item_set_show_toggle() to change the way check
menu items and radio menu items look.
Fri Dec 5 1997 Elliot Lee <sopwith@cuc.edu>
* gdk/gdk.c: clean up warnings, remove some un-ifdef'd debugging
printing, DnD is Bug Free now, etc.

View File

@ -1,3 +1,14 @@
Sun Dec 7 03:19:02 1997 Tim Janik <timj@psynet.net>
* gtkfilesel.c: applied jamesa-971010-0 for stability.
* gtkrc.c: applied jamesa-971010-2 for a small optimization.
* gtkcheckmenuitem.h:
* gtkcheckmenuitem.c:
* gtkradiomenuitem.c:
* testgtk.c: applied johannes-971113-0 which adds
gtk_check_menu_item_set_show_toggle() to change the way check
menu items and radio menu items look.
Fri Dec 5 1997 Elliot Lee <sopwith@cuc.edu>
* gdk/gdk.c: clean up warnings, remove some un-ifdef'd debugging
printing, DnD is Bug Free now, etc.

View File

@ -1,3 +1,14 @@
Sun Dec 7 03:19:02 1997 Tim Janik <timj@psynet.net>
* gtkfilesel.c: applied jamesa-971010-0 for stability.
* gtkrc.c: applied jamesa-971010-2 for a small optimization.
* gtkcheckmenuitem.h:
* gtkcheckmenuitem.c:
* gtkradiomenuitem.c:
* testgtk.c: applied johannes-971113-0 which adds
gtk_check_menu_item_set_show_toggle() to change the way check
menu items and radio menu items look.
Fri Dec 5 1997 Elliot Lee <sopwith@cuc.edu>
* gdk/gdk.c: clean up warnings, remove some un-ifdef'd debugging
printing, DnD is Bug Free now, etc.

View File

@ -1,3 +1,14 @@
Sun Dec 7 03:19:02 1997 Tim Janik <timj@psynet.net>
* gtkfilesel.c: applied jamesa-971010-0 for stability.
* gtkrc.c: applied jamesa-971010-2 for a small optimization.
* gtkcheckmenuitem.h:
* gtkcheckmenuitem.c:
* gtkradiomenuitem.c:
* testgtk.c: applied johannes-971113-0 which adds
gtk_check_menu_item_set_show_toggle() to change the way check
menu items and radio menu items look.
Fri Dec 5 1997 Elliot Lee <sopwith@cuc.edu>
* gdk/gdk.c: clean up warnings, remove some un-ifdef'd debugging
printing, DnD is Bug Free now, etc.

View File

@ -102,13 +102,22 @@ gtk_check_menu_item_set_state (GtkCheckMenuItem *check_menu_item,
gtk_menu_item_activate (GTK_MENU_ITEM (check_menu_item));
}
void
gtk_check_menu_item_set_show_toggle (GtkCheckMenuItem *menu_item,
gboolean always)
{
g_return_if_fail (menu_item != NULL);
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (menu_item));
menu_item->always_show_toggle = always != FALSE;
}
void
gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item)
{
gtk_signal_emit (GTK_OBJECT (check_menu_item), check_menu_item_signals[TOGGLED]);
}
static void
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
{
@ -146,6 +155,7 @@ static void
gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item)
{
check_menu_item->active = FALSE;
check_menu_item->always_show_toggle = FALSE;
}
static void
@ -231,14 +241,25 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
gdk_window_clear_area (widget->window, x, y, width, height);
if (check_menu_item->active ||
check_menu_item->always_show_toggle ||
(GTK_WIDGET_STATE (check_menu_item) == GTK_STATE_PRELIGHT))
{
state_type = GTK_WIDGET_STATE (widget);
shadow_type = GTK_SHADOW_IN;
if (check_menu_item->active && (state_type == GTK_STATE_PRELIGHT))
shadow_type = GTK_SHADOW_OUT;
if (check_menu_item->always_show_toggle)
{
shadow_type = GTK_SHADOW_OUT;
if (check_menu_item->active)
shadow_type = GTK_SHADOW_IN;
}
else
{
shadow_type = GTK_SHADOW_IN;
if (check_menu_item->active &&
(state_type == GTK_STATE_PRELIGHT))
shadow_type = GTK_SHADOW_OUT;
}
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[state_type],
TRUE, x, y, width, height);

View File

@ -41,6 +41,7 @@ struct _GtkCheckMenuItem
GtkMenuItem menu_item;
guint active : 1;
guint always_show_toggle : 1;
};
struct _GtkCheckMenuItemClass
@ -58,6 +59,8 @@ GtkWidget* gtk_check_menu_item_new (void);
GtkWidget* gtk_check_menu_item_new_with_label (const gchar *label);
void gtk_check_menu_item_set_state (GtkCheckMenuItem *check_menu_item,
gint state);
void gtk_check_menu_item_set_show_toggle(GtkCheckMenuItem *menu_item,
gboolean always);
void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item);

View File

@ -1180,6 +1180,7 @@ prune_memory_usage(CompletionState *cmpl_state)
cdsl->next = NULL;
}
cmpl_state->directory_storage = NULL;
while (cdl) {
if (cdl->data == cmpl_state->reference_dir)
cmpl_state->directory_storage = g_list_prepend(NULL, cdl->data);
@ -1577,7 +1578,7 @@ correct_dir_fullname(CompletionDir* cmpl_dir)
return FALSE;
}
cmpl_dir->fullname[length - 3] = 0;
cmpl_dir->fullname[length - 2] = 0;
if(!correct_parent(cmpl_dir, &sbuf))
return FALSE;
@ -1597,7 +1598,7 @@ correct_dir_fullname(CompletionDir* cmpl_dir)
return FALSE;
}
cmpl_dir->fullname[length - 4] = 0;
cmpl_dir->fullname[length - 3] = 0;
if(!correct_parent(cmpl_dir, &sbuf))
return FALSE;
@ -1621,7 +1622,7 @@ correct_parent(CompletionDir* cmpl_dir, struct stat *sbuf)
g_assert(last_slash);
if(last_slash != cmpl_dir->fullname)
last_slash[0] = 0;
{ /* last_slash[0] = 0; */ }
else
{
c = last_slash[1];
@ -1640,8 +1641,8 @@ correct_parent(CompletionDir* cmpl_dir, struct stat *sbuf)
if(c)
last_slash[1] = c;
else
last_slash[0] = '/';
/* else
last_slash[0] = '/'; */
/* it was a link, have to figure it out the hard way */

View File

@ -215,10 +215,15 @@ gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
gdk_window_clear_area (widget->window, x, y, width, height);
if (check_menu_item->active ||
check_menu_item->always_show_toggle ||
(GTK_WIDGET_STATE (check_menu_item) == GTK_STATE_PRELIGHT))
{
state_type = GTK_WIDGET_STATE (widget);
shadow_type = GTK_SHADOW_IN;
if (check_menu_item->active ||
!check_menu_item->always_show_toggle)
shadow_type = GTK_SHADOW_IN;
else
shadow_type = GTK_SHADOW_OUT;
pts[0].x = x + width / 2;
pts[0].y = y;

View File

@ -1257,41 +1257,41 @@ gtk_rc_parse_pixmap_path ()
return PARSE_OK;
}
static void gtk_rc_parse_pixmap_path_string(gchar *pix_path)
static void
gtk_rc_parse_pixmap_path_string (gchar *pix_path)
{
gchar *buf;
gint end_offset;
gint start_offset = 0;
gint path_len;
gint path_num;
/* free the old one, or just add to the old one ? */
for (path_num=0; pixmap_path[path_num]; path_num++)
{
g_free(pixmap_path[path_num]);
g_free (pixmap_path[path_num]);
pixmap_path[path_num] = NULL;
}
path_num = 0;
path_len = strlen (pix_path);
buf = g_strdup (pix_path);
path_len = strlen(pix_path);
buf = g_strdup(pix_path);
for(end_offset = 0; end_offset <= path_len; end_offset++)
for (end_offset = 0; end_offset <= path_len; end_offset++)
{
if ( (buf[end_offset] == ':') || (end_offset == path_len) )
if ((buf[end_offset] == ':') ||
(end_offset == path_len))
{
buf[end_offset] = '\0';
pixmap_path[path_num] = g_strdup(buf + start_offset);
pixmap_path[path_num] = g_strdup (buf + start_offset);
path_num++;
pixmap_path[path_num] = NULL;
start_offset = end_offset + 1;
g_free(buf);
buf = g_strdup(pix_path);
}
}
g_free(buf);
g_free (buf);
}
static gint

View File

@ -859,6 +859,8 @@ create_menu (int depth)
sprintf (buf, "item %2d - %d", depth, j);
menuitem = gtk_radio_menu_item_new_with_label (group, buf);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
if (depth % 2)
gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_widget_show (menuitem);

View File

@ -859,6 +859,8 @@ create_menu (int depth)
sprintf (buf, "item %2d - %d", depth, j);
menuitem = gtk_radio_menu_item_new_with_label (group, buf);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
if (depth % 2)
gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_widget_show (menuitem);