antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright gtkshell/Makefile gtkshell/gtkshell.c...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright gtkshell/Makefile gtkshell/gtkshell.c...
Date: Sun, 11 Feb 2007 04:23:30 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/02/11 04:23:30

Modified files:
        gtkshell       : Makefile gtkshell.c gtkshell.h 
        libantiright   : util.c util.h 
Added files:
        gtkshell       : geometry.c geometry.h 

Log message:
        Split out geometry parsing functions in gtkshell.
        Added random number generation functions to libantiright.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.c?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/geometry.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/geometry.h?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/util.c?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/util.h?cvsroot=antiright&r1=1.2&r2=1.3

Patches:
Index: gtkshell/Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gtkshell/Makefile   10 Feb 2007 18:54:06 -0000      1.4
+++ gtkshell/Makefile   11 Feb 2007 04:23:30 -0000      1.5
@@ -8,7 +8,7 @@
 objects=gtkshell.o arguments.o options.o callbacks.o updated.o\
        label.o button.o text.o updated_label.o updated_progress.o\
        updated_options.o add_options.o option_options.o dialog_options.o\
-       file_dialog.o row.o containers.o
+       file_dialog.o row.o containers.o geometry.o
 all: $(objects) main.o
        $(CC) -o gtkshell $(objects) main.o $(LDFLAGS)
        ar rcs libgtkshell.a $(objects)

Index: gtkshell/gtkshell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gtkshell/gtkshell.c 9 Feb 2007 03:16:12 -0000       1.3
+++ gtkshell/gtkshell.c 11 Feb 2007 04:23:30 -0000      1.4
@@ -22,32 +22,6 @@
 
 #include "gtkshell.h"
 
-extern char *gsh_geometry;
-
-void
-gsh_set_geometry()
-{
-       assert(gsh_geometry);
-       gtk_window_parse_geometry(GTK_WINDOW(gsh_window), 
-               gsh_geometry);
-}
-void
-gsh_check_and_set_geometry()
-{
-       if(gsh_geometry!=NULL)
-       {       
-               gsh_set_geometry();
-               free(gsh_geometry);
-       }
-       else
-       {
-               asprintf(&gsh_geometry, "500x300");
-               gsh_set_geometry();
-               free(gsh_geometry);
-       }
-
-}
-
 GtkWidget *
 gsh_create_main_window()
 {

Index: gtkshell/gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gtkshell/gtkshell.h 9 Feb 2007 03:16:12 -0000       1.3
+++ gtkshell/gtkshell.h 11 Feb 2007 04:23:30 -0000      1.4
@@ -42,6 +42,7 @@
 #include "file_dialog.h"
 #include "row.h"
 #include "containers.h"
+#include "geometry.h"
 
 GtkWidget      *gsh_window;
 GtkWidget      *gsh_hbox;

Index: libantiright/util.c
===================================================================
RCS file: /sources/antiright/antiright/libantiright/util.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- libantiright/util.c 9 Feb 2007 16:28:34 -0000       1.4
+++ libantiright/util.c 11 Feb 2007 04:23:30 -0000      1.5
@@ -22,7 +22,7 @@
 
 #include "library.h"
 
-void *
+gpointer
 xmalloc(size_t size)
 {
   gpointer pointer;
@@ -32,4 +32,16 @@
   return(pointer);
 }
 
+void
+rand_seed()
+{
+       srand((unsigned int)time(NULL));
+}
+
+int
+rand_ranged(int start, int finish)
+{
+       return rand()%(finish-start)+start;
+}
+
 

Index: libantiright/util.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/util.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- libantiright/util.h 9 Feb 2007 03:16:12 -0000       1.2
+++ libantiright/util.h 11 Feb 2007 04:23:30 -0000      1.3
@@ -22,10 +22,17 @@
 
 #ifndef LIBAR_UTIL_H
 #define LIBAR_UTIL_H
-void *
+
+gpointer
 xmalloc(size_t size);
 
 #define UNUSED(arg) { arg = arg; }
 
+void
+rand_seed();
+
+int
+rand_ranged(int start, int finish);
+
 #endif
 

Index: gtkshell/geometry.c
===================================================================
RCS file: gtkshell/geometry.c
diff -N gtkshell/geometry.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gtkshell/geometry.c 11 Feb 2007 04:23:30 -0000      1.1
@@ -0,0 +1,52 @@
+/*
+  AntiRight
+  (c) 2002-2006 Jeffrey Bedard
+  address@hidden
+
+  This file is part of AntiRight.
+
+  AntiRight is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  AntiRight is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with AntiRight; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+*/
+
+#include "gtkshell.h"
+
+
+extern char *gsh_geometry;
+
+void
+gsh_set_geometry()
+{
+       assert(gsh_geometry);
+       gtk_window_parse_geometry(GTK_WINDOW(gsh_window), 
+               gsh_geometry);
+}
+void
+gsh_check_and_set_geometry()
+{
+       if(gsh_geometry!=NULL)
+       {       
+               gsh_set_geometry();
+               free(gsh_geometry);
+       }
+       else
+       {
+               asprintf(&gsh_geometry, "400x300");
+               gsh_set_geometry();
+               free(gsh_geometry);
+       }
+
+}
+
+

Index: gtkshell/geometry.h
===================================================================
RCS file: gtkshell/geometry.h
diff -N gtkshell/geometry.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gtkshell/geometry.h 11 Feb 2007 04:23:30 -0000      1.1
@@ -0,0 +1,33 @@
+/*
+  AntiRight
+  (c) 2002-2006 Jeffrey Bedard
+  address@hidden
+
+  This file is part of AntiRight.
+
+  AntiRight is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  AntiRight is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with AntiRight; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+*/
+
+#ifndef GSH_GEOMETRY_H
+#define GSH_GEOMETRY_H
+
+void
+gsh_set_geometry();
+
+void
+gsh_check_and_set_geometry();
+
+#endif /* GSH_GEOMETRY_H */
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]