[Xbubble-commits] xbubble/src dialog.c,1.1,1.2 dialog.h,1.1,1.2
Martin Quinson
xbubble-devel@lists.alioth.debian.org
Wed, 27 Apr 2005 14:55:14 +0000
Update of /cvsroot/xbubble/xbubble/src
In directory haydn:/tmp/cvs-serv15148
Modified Files:
dialog.c dialog.h
Log Message:
constify the strings which need it
Index: dialog.h
===================================================================
RCS file: /cvsroot/xbubble/xbubble/src/dialog.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dialog.h 5 Dec 2004 20:40:59 -0000 1.1
+++ dialog.h 27 Apr 2005 14:55:12 -0000 1.2
@@ -4,7 +4,7 @@
#include <X11/Xlib.h>
void get_column_size( int nb_lines,
- char ** line,
+ const char ** line,
XFontStruct *xfont,
int *width,
int *height );
@@ -12,27 +12,27 @@
Window create_column( int x,
int y,
int nb_lines,
- char ** line,
+ const char ** line,
XFontStruct *xfont,
unsigned long *pixel,
double expand );
Window create_dialog( int x,
int y,
- char * msg,
+ const char * msg,
XFontStruct *xfont,
unsigned long pixel,
int border_width,
double expand );
void get_menu_size( int nb_entries,
- char ** entries,
+ const char ** entries,
int *width,
int *height,
int horizontal );
void get_menu_choices( int nb_entries,
- char ** entries,
+ const char ** entries,
int *x,
int *y,
int *selection,
Index: dialog.c
===================================================================
RCS file: /cvsroot/xbubble/xbubble/src/dialog.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dialog.c 5 Dec 2004 20:40:59 -0000 1.1
+++ dialog.c 27 Apr 2005 14:55:12 -0000 1.2
@@ -24,6 +24,7 @@
#include "rgba.h"
#include "controls.h"
+#include "dialog.h"
extern Display *display;
extern Window root;
@@ -37,7 +38,7 @@
extern GC selected_gc;
extern XFontStruct *menu_font;
-void get_column_size( int nb_lines, char ** line, XFontStruct *xfont,
+void get_column_size( int nb_lines, const char ** line, XFontStruct *xfont,
int *width, int *height ) {
int i, entry_width;
*width = 0;
@@ -49,7 +50,7 @@
}
}
-Window create_column( int x, int y, int nb_lines, char ** line,
+Window create_column( int x, int y, int nb_lines, const char ** line,
XFontStruct *xfont, unsigned long *pixel,
double expand ) {
int i;
@@ -92,7 +93,7 @@
return box;
}
-Window create_dialog( int x, int y, char * msg, XFontStruct *xfont,
+Window create_dialog( int x, int y, const char * msg, XFontStruct *xfont,
unsigned long pixel, int border_width, double expand ) {
int tx;
int ty;
@@ -130,14 +131,14 @@
static void draw_menu_entry( Window menu_win,
int win_width,
- char ** entries,
+ const char ** entries,
int nb,
int entry,
GC gc,
int horizontal ) {
int tx;
int ty;
- char * line = entries[entry];
+ const char * line = entries[entry];
if ( horizontal ) {
tx = (entry+0.5)*win_width/nb - XTextWidth( menu_font,line,strlen(line))/2;
ty = menu_font->ascent;
@@ -149,7 +150,7 @@
XDrawString( display, menu_win, gc, tx, ty, line, strlen(line) );
}
-void get_menu_size( int nb, char ** entries, int *w, int *h, int horizontal ) {
+void get_menu_size( int nb, const char ** entries, int *w, int *h, int horizontal ) {
get_column_size( nb, entries, menu_font, w, h );
if ( horizontal ) {
*w *= 2*nb;
@@ -158,7 +159,7 @@
}
void get_menu_choices( int nb_entries,
- char ** entries,
+ const char ** entries,
int *x,
int *y,
int *selection,