[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright ACE-desktop/ACE gtkshell/add_options....
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright ACE-desktop/ACE gtkshell/add_options.... |
Date: |
Mon, 05 Mar 2007 01:05:42 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/03/05 01:05:42
Modified files:
ACE-desktop : ACE
gtkshell : add_options.c arguments.c button.c
image_button.c image_button.h row.c text.c
text.h
Log message:
Set text widgets to mono font by default. Consolidate text buffer
setting. Removed -ai and -aI options, and related functions.
Refactored button creation functions. Use new icon button definition
format in ACE. Fix spurious ! in row.c.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/ACE?cvsroot=antiright&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/arguments.c?cvsroot=antiright&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.c?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.h?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row.c?cvsroot=antiright&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.h?cvsroot=antiright&r1=1.5&r2=1.6
Patches:
Index: ACE-desktop/ACE
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/ACE,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- ACE-desktop/ACE 4 Mar 2007 23:11:04 -0000 1.24
+++ ACE-desktop/ACE 5 Mar 2007 01:05:42 -0000 1.25
@@ -180,7 +180,7 @@
CMD="$CMD -al '--------'"
local FILE
for FILE in *; do
- CMD="$CMD -ai \"ACE -A ARO $FILE & # $FILE\" gtk-file"
+ CMD="$CMD \"ACE -A ARO $FILE & # $FILE\",gtk-file"
done
CMD="$CMD 'exit # CLOSE'"
CMD="$CMD \"cd .. ; $FM & # UP\""
@@ -250,7 +250,7 @@
local OPTIONS="-or 1"
fi
- local ACE_STRING=" -aI ACE $icon/ACE.png"
+ local ACE_STRING="ACE,$icon/ACE.png::'ACE'::eclipse::xload"
local UPDATER=$(ACE deskbar_updater)
local CMD="exec $ARSHELL -of -on $OPTIONS"
@@ -265,7 +265,7 @@
fi
for item in $(ACE Panel_Items); do
- CMD="$CMD -aI \"ACE $item\" $icon/$item.png"
+ CMD="$CMD \"ACE $item # \",$icon/$item.png"
done
if [ "$UPDATER" = "TRUE" ]; then
Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- gtkshell/add_options.c 4 Mar 2007 23:11:04 -0000 1.14
+++ gtkshell/add_options.c 5 Mar 2007 01:05:42 -0000 1.15
@@ -45,14 +45,11 @@
add_piped_text(struct GSH * gsh)
{
gchar * output;
- GtkTextBuffer * buffer;
GtkWidget * widget;
widget=gsh_text_area(gsh);
- buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
output=antiright_read_file(stdin);
- gtk_text_buffer_set_text(buffer, output,
- strlen(output));
+ gsh_text_area_set_text(widget, output);
g_free(output);
}
@@ -68,15 +65,6 @@
gsh_text_editor(gsh, argv[*counter]);
break;
- case 'I':
- gsh_handle_add_unlabeled_image_button(gsh, argc,
- argv, counter);
- break;
-
- case 'i':
- gsh_handle_add_image_button(gsh, argc, argv, counter);
- break;
-
case 'l':
gsh_count(argc, counter);
gsh_add_label(gsh, argv[(*counter)]);
Index: gtkshell/arguments.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/arguments.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- gtkshell/arguments.c 4 Mar 2007 23:23:20 -0000 1.10
+++ gtkshell/arguments.c 5 Mar 2007 01:05:42 -0000 1.11
@@ -31,14 +31,20 @@
pair=g_strsplit(string, ",", 2);
+
if(ARPBOOL(pair[0]) && ARPBOOL(pair[1]))
- gsh_image_button(gsh, pair[0], pair[1]);
+ {
+ gchar * command;
+
+ ar_asprintf(&command, "%s", pair[0]);
+ gsh_image_button(gsh, command, pair[1]);
+ }
else
- gsh_command_button(gsh, pair[0]);
+ gsh_command_button(gsh, string);
g_strfreev(pair);
- gsh->rows.row--;
+ //gsh->rows.row--;
}
static void
activate_cb(GtkWidget * widget, gpointer data)
@@ -107,7 +113,7 @@
gsh->rows.v=oldrow;
}
else
- gsh_command_button(gsh, (char *)string);
+ new_button(gsh, (char *)string);
g_strfreev(tokens);
}
Index: gtkshell/button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- gtkshell/button.c 4 Mar 2007 23:23:20 -0000 1.19
+++ gtkshell/button.c 5 Mar 2007 01:05:42 -0000 1.20
@@ -26,43 +26,33 @@
setup_label(GtkWidget *widget, char *command);
static void
-setup_label(GtkWidget *widget, char *command)
+create_label_in_menu_item(GtkWidget * widget, char * formatted)
{
- gchar *formatted;
-
- formatted = antiright_beautified_label(command);
- if(GTK_IS_MENU_ITEM(widget))
- {
GtkWidget * label;
+
label = gtk_label_new(formatted);
gtk_container_add(GTK_CONTAINER(widget), label);
gtk_widget_show(label);
- }
- else
- gtk_button_set_label(GTK_BUTTON(widget), formatted);
- free(formatted);
}
-void
-gsh_command_button(struct GSH * gsh, char *command)
+
+static void
+setup_label(GtkWidget *widget, char *command)
{
-#ifdef DEBUG
- ARBUG("gsh_command_button");
-#endif /* DEBUG */
+ gchar *formatted;
- ARPASSERT(gsh);
+ formatted = antiright_beautified_label(command);
- if(!GTK_IS_MENU(gsh->rows.v))
- gsh->button = gtk_button_new();
+ if(GTK_IS_MENU_ITEM(widget))
+ create_label_in_menu_item(widget, formatted);
else
- gsh->button = gtk_menu_item_new();
-
- gtk_widget_show(gsh->button);
-
- setup_label(gsh->button, command);
+ gtk_button_set_label(GTK_BUTTON(widget), formatted);
- gsh_setup_drag_drop(gsh, gsh->button);
+ free(formatted);
+}
- {
+static struct GSH_CBData *
+setup_callback_data(struct GSH * gsh, char * command)
+{
struct GSH_CBData * cb;
/* Allocate and initialize elements. */
@@ -70,7 +60,18 @@
cb->gsh = gsh;
cb->data = command; /* command from argv, literal, or
- * preallocated. */
+ * preallocated
+ * */
+
+ return cb;
+}
+
+static void
+setup_callback(struct GSH * gsh, char * command)
+{
+ struct GSH_CBData * cb;
+
+ cb=setup_callback_data(gsh, command);
if(GTK_IS_MENU_ITEM(gsh->button))
{
@@ -87,8 +88,32 @@
else if((gsh->bflags & GSH_MENU_BUTTON) == GSH_MENU_BUTTON)
gsh->bflags ^= GSH_MENU_BUTTON;
- }
+}
+static void
+create_button(struct GSH * gsh)
+{
+ if(!GTK_IS_MENU(gsh->rows.v))
+ gsh->button = gtk_button_new();
+ else
+ gsh->button = gtk_menu_item_new();
+
+ gtk_widget_show(gsh->button);
+}
+
+void
+gsh_command_button(struct GSH * gsh, char *command)
+{
+#ifdef DEBUG
+ ARBUG("gsh_command_button");
+#endif /* DEBUG */
+
+ ARPASSERT(gsh);
+
+ create_button(gsh);
+ setup_label(gsh->button, command);
+ gsh_setup_drag_drop(gsh, gsh->button);
+ setup_callback(gsh, command);
gsh_manage_unexpanded(gsh, gsh->button);
#ifdef DEBUG
Index: gtkshell/image_button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/image_button.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gtkshell/image_button.c 4 Mar 2007 23:11:04 -0000 1.4
+++ gtkshell/image_button.c 5 Mar 2007 01:05:42 -0000 1.5
@@ -22,7 +22,6 @@
#include "gtkshell.h"
-
static void
generic_image_button(struct GSH * gsh, char *command,
GtkWidget * image)
@@ -67,27 +66,3 @@
generic_image_button(gsh, command, image);
}
-static void
-generic_add(struct GSH * gsh, int argc, char **argv, int *counter,
- void (*button_func)(struct GSH *, char *, char *))
-{
- gsh_count(argc, counter);
- (*button_func)(gsh, argv[(*counter)], argv[(*counter) + 1]);
- gsh_count(argc, counter);
-}
-
-void
-gsh_handle_add_image_button(struct GSH * gsh, int argc,
- char **argv, int *counter)
-{
- generic_add(gsh, argc, argv, counter, &gsh_image_button);
-}
-
-void
-gsh_handle_add_unlabeled_image_button(struct GSH * gsh, int argc,
- char **argv, int *counter)
-{
- gsh_handle_add_image_button(gsh, argc, argv, counter);
- gtk_button_set_label(GTK_BUTTON(gsh->button), "");
-}
-
Index: gtkshell/image_button.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/image_button.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gtkshell/image_button.h 4 Mar 2007 23:11:04 -0000 1.4
+++ gtkshell/image_button.h 5 Mar 2007 01:05:42 -0000 1.5
@@ -26,12 +26,5 @@
void
gsh_image_button(struct GSH * gsh, char *command, char *name);
-void
-gsh_handle_add_image_button(struct GSH * gsh, int argc,
- char **argv, int *counter);
-
-void
-gsh_handle_add_unlabeled_image_button(struct GSH * gsh, int argc,
- char **argv, int *counter);
#endif /* GSH_IMAGE_BUTTON_H */
Index: gtkshell/row.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/row.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- gtkshell/row.c 4 Mar 2007 23:11:04 -0000 1.13
+++ gtkshell/row.c 5 Mar 2007 01:05:42 -0000 1.14
@@ -62,7 +62,7 @@
* Checking for a 1 row counter allows the ACE Deskbar to
* maintain a decent appearance.
*/
- if ((!gsh->rows.rows != 1) && !GTK_IS_MENU(gsh->rows.v))
+ if ((gsh->rows.rows != 1) && !GTK_IS_MENU(gsh->rows.v))
{
gsh_check_row(gsh);
gtk_box_pack_start(GTK_BOX(gsh->rows.v), widget,
Index: gtkshell/text.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- gtkshell/text.c 2 Mar 2007 19:12:00 -0000 1.15
+++ gtkshell/text.c 5 Mar 2007 01:05:42 -0000 1.16
@@ -65,16 +65,26 @@
text = gtk_text_view_new();
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
gsh_manage(gsh, text);
+ gsh_widget_set_font_mono(text);
return text;
}
+void
+gsh_text_area_set_text(GtkWidget * widget, const gchar * text)
+{
+ GtkTextBuffer * buffer;
+
+ buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
+ gtk_text_buffer_set_text(buffer, text,
+ strlen(text));
+}
+
/* This is currently just a text file viewer. */
void
gsh_text_editor(struct GSH * gsh, char *filename)
{
GtkWidget *widget;
- GtkTextBuffer *buffer;
FILE *file;
ARPASSERT(gsh);
@@ -82,7 +92,6 @@
file=NULL;
widget = gsh_text_area(gsh);
- buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
ARPASSERT(filename);
@@ -92,13 +101,12 @@
{
char *text;
text=antiright_read_file(file);
- gtk_text_buffer_set_text(buffer, text, strlen(text));
+ gsh_text_area_set_text(widget, text);
(void) fclose(file);
}
ARIFNP(gsh->geometry)
asprintf(&gsh->geometry, "775x700");
- gsh_widget_set_font_mono(widget);
}
Index: gtkshell/text.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gtkshell/text.h 28 Feb 2007 03:53:51 -0000 1.5
+++ gtkshell/text.h 5 Mar 2007 01:05:42 -0000 1.6
@@ -24,15 +24,18 @@
#define GSH_TEXT_H
GtkWidget *
- gsh_setup_command_entry(struct GSH * gsh, char *command);
+gsh_setup_command_entry(struct GSH * gsh, char *command);
void
- gsh_setup_prompt_command_entry(struct GSH * gsh, char *command);
+gsh_setup_prompt_command_entry(struct GSH * gsh, char *command);
GtkWidget *
- gsh_text_area(struct GSH * gsh);
+gsh_text_area(struct GSH * gsh);
void
- gsh_text_editor(struct GSH * gsh, char *filename);
+gsh_text_area_set_text(GtkWidget * widget, const gchar * text);
+
+void
+gsh_text_editor(struct GSH * gsh, char *filename);
#endif