* fixed a lot of compiler warnings (mostly const char * stuff and use of uninitialized data)

* add support for translating radiant (just marked three strings, more to come)


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@264 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
mattn 2008-06-26 07:52:02 +00:00
parent 5efe3f31db
commit e4b1c1a55c
47 changed files with 1713 additions and 1685 deletions

View file

@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// //
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "bkgrnd2d.h" #include "bkgrnd2d.h"
#include "dialog.h" #include "dialog.h"

View file

@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View file

@ -36,6 +36,7 @@ Copyright (C) 2002 Splash Damage Ltd.
class CCamera; class CCamera;
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "str.h" #include "str.h"

View file

@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View file

@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
/* /*

View file

@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define _GENSURF_H_ #define _GENSURF_H_
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "qerplugin.h" #include "qerplugin.h"
//#include "qertypes.h" //#include "qertypes.h"

View file

@ -311,7 +311,7 @@ static bool save_var (const char *filename, const char *section, const char *key
#endif #endif
int INIGetInt(char *key, int def) int INIGetInt(const char *key, int def)
{ {
#if defined(__linux__) || defined(__APPLE__) #if defined(__linux__) || defined(__APPLE__)
char value[1024]; char value[1024];
@ -325,7 +325,7 @@ int INIGetInt(char *key, int def)
#endif #endif
} }
void INISetInt(char *key, int val, char *comment /* = NULL */) void INISetInt(const char *key, int val, const char *comment /* = NULL */)
{ {
char s[1000]; char s[1000];

View file

@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define __PRTVIEW_AFX_H__ #define __PRTVIEW_AFX_H__
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#if defined(__linux__) || defined(__APPLE__) #if defined(__linux__) || defined(__APPLE__)
#include <GL/glx.h> #include <GL/glx.h>
@ -69,8 +70,8 @@ typedef int BOOL;
#define UPDATE_3D (W_CAMERA) #define UPDATE_3D (W_CAMERA)
#define UPDATE_ALL (UPDATE_2D | UPDATE_3D) #define UPDATE_ALL (UPDATE_2D | UPDATE_3D)
int INIGetInt(char *key, int def); int INIGetInt(const char *key, int def);
void INISetInt(char *key, int val, char *comment = NULL); void INISetInt(const char *key, int val, const char *comment = NULL);
extern bool interfaces_started; extern bool interfaces_started;

View file

@ -50,9 +50,9 @@ static const char *PLUGIN_ABOUT = "UFO: Alien Invasion plugin " PLUGIN_VERSION "
#define NUM_TOOLBAR_BUTTONS FILTER_MAX #define NUM_TOOLBAR_BUTTONS FILTER_MAX
typedef struct toolbar_button_info_s typedef struct toolbar_button_info_s
{ {
char *image; const char *image;
char *text; const char *text;
char *tip; const char *tip;
void (*func)(); void (*func)();
IToolbarButton::EType type; IToolbarButton::EType type;
} toolbar_button_info_t; } toolbar_button_info_t;
@ -61,29 +61,29 @@ static const toolbar_button_info_t toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
{ {
{ {
"ufoai_actorclip.bmp", "ufoai_actorclip.bmp",
"Filter actorclip", _("Filter actorclip"),
"Actorclip", _("Actorclip"),
DoActorClipFiltering, DoActorClipFiltering,
IToolbarButton::eToggleButton IToolbarButton::eToggleButton
}, },
{ {
"ufoai_weaponclip.bmp", "ufoai_weaponclip.bmp",
"Filter weaponclip", _("Filter weaponclip"),
"Weaponclip", _("Weaponclip"),
DoWeaponClipFiltering, DoWeaponClipFiltering,
IToolbarButton::eToggleButton IToolbarButton::eToggleButton
}, },
{ {
"ufoai_nodraw.bmp", "ufoai_nodraw.bmp",
"Filter nodraw", _("Filter nodraw"),
"NoDraw", _("NoDraw"),
DoNoDrawFiltering, DoNoDrawFiltering,
IToolbarButton::eToggleButton IToolbarButton::eToggleButton
}, },
{ {
"ufoai_stepon.bmp", "ufoai_stepon.bmp",
"Filter stepon", _("Filter stepon"),
"Stepon", _("Stepon"),
DoSteponFiltering, DoSteponFiltering,
IToolbarButton::eToggleButton IToolbarButton::eToggleButton
}, },

View file

@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define FILTER_MAJOR "filter" #define FILTER_MAJOR "filter"
// adds a new filter // adds a new filter
typedef bfilter_t* (* PFN_QERPLUG_FILTERADD) (int type, int bmask, char *str, int exclude); typedef bfilter_t* (* PFN_QERPLUG_FILTERADD) (int type, int bmask, const char *str, int exclude);
// performs the filtering // performs the filtering
typedef void (* PFN_QERPLUG_FILTERACTIVATE) (void); typedef void (* PFN_QERPLUG_FILTERACTIVATE) (void);

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define UNDO_MAJOR "undo" #define UNDO_MAJOR "undo"
//start operation //start operation
typedef void (*PFN_UNDOSTART) (char *operation); typedef void (*PFN_UNDOSTART) (const char *operation);
//end operation //end operation
typedef void (*PFN_UNDOEND) (void); typedef void (*PFN_UNDOEND) (void);
//add brush to the undo //add brush to the undo

View file

@ -495,7 +495,7 @@ typedef void (WINAPI * PFN_QERAPP_GETDISPATCHPARAMS)(vec3_t vMin, vec3_t vMax, b
typedef int (WINAPI * PFN_QERAPP_REQUESTINTERFACE)( REFGUID, void* ); typedef int (WINAPI * PFN_QERAPP_REQUESTINTERFACE)( REFGUID, void* );
// use this one for errors, Radiant will stop after the "edit preferences" dialog // use this one for errors, Radiant will stop after the "edit preferences" dialog
typedef void (WINAPI * PFN_QERAPP_ERROR)(char* pMsg, ...); typedef void (WINAPI * PFN_QERAPP_ERROR)(const char* pMsg, ...);
// use to gain read access to the project epairs // use to gain read access to the project epairs
// FIXME: removed, accessed through QERPlug_RegisterPluginEntities with the IEpair interface // FIXME: removed, accessed through QERPlug_RegisterPluginEntities with the IEpair interface
// typedef void (WINAPI* PFN_QERAPP_GETPROJECTEPAIR)(epair_t **); // typedef void (WINAPI* PFN_QERAPP_GETPROJECTEPAIR)(epair_t **);
@ -610,7 +610,7 @@ typedef const char* (* PFN_QERAPP_READPROJECTKEY)(const char* key);
typedef char* (* PFN_GETMAPFILENAME)(); typedef char* (* PFN_GETMAPFILENAME)();
typedef bfilter_t* (* PFN_QERPLUG_FILTERADD)(int type, int bmask, char *str, int exclude); typedef bfilter_t* (* PFN_QERPLUG_FILTERADD)(int type, int bmask, const char *str, int exclude);
typedef void (* PFN_QERPLUG_FILTERACTIVATE) (void); typedef void (* PFN_QERPLUG_FILTERACTIVATE) (void);

View file

@ -756,7 +756,7 @@ struct bfilter_t //c++ style
// 5=brush->face->texdef.flags (q2) // 5=brush->face->texdef.flags (q2)
// 6=brush->face->texdef.contents (q2) // 6=brush->face->texdef.contents (q2)
int mask; int mask;
char *string; const char *string;
bool active; bool active;
}; };

View file

@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include "surfdlg_plugin.h" #include "surfdlg_plugin.h"

View file

@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include "surfdlg_plugin.h" #include "surfdlg_plugin.h"

View file

@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include "surfdlg_plugin.h" #include "surfdlg_plugin.h"

View file

@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include "surfdlg_plugin.h" #include "surfdlg_plugin.h"

View file

@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include "surfdlg_plugin.h" #include "surfdlg_plugin.h"

View file

@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include "surfdlg_plugin.h" #include "surfdlg_plugin.h"

View file

@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include "surfdlg_plugin.h" #include "surfdlg_plugin.h"

View file

@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// standard headers // standard headers
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View file

@ -1337,7 +1337,7 @@ void CheckName( face_t *fa, char *pname )
// TODO: clean this detection part when bug will have disappeared // TODO: clean this detection part when bug will have disappeared
if (fa->texdef.GetName()[0] == '(') if (fa->texdef.GetName()[0] == '(')
{ {
char *text = "Bug #103494 detected, dropping texture. Please report to timo@qeradiant.com if you have a way to reproduce!\nNOTE: this message may popup several times .. once for each buggy face detected."; const char *text = "Bug #103494 detected, dropping texture. Please report to timo@qeradiant.com if you have a way to reproduce!\nNOTE: this message may popup several times .. once for each buggy face detected.";
Sys_Printf("%s\n", text); Sys_Printf("%s\n", text);
gtk_MessageBox(g_pParentWnd->m_pWidget, text, "Error saving map", MB_OK ); gtk_MessageBox(g_pParentWnd->m_pWidget, text, "Error saving map", MB_OK );
// need to cleanup this dead face name or we may loop endlessly // need to cleanup this dead face name or we may loop endlessly

View file

@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "stdafx.h" #include "stdafx.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <GL/gl.h> #include <GL/gl.h>
extern void DrawPathLines(); extern void DrawPathLines();
@ -891,7 +892,6 @@ extern void DrawModelBBox(brush_t *b);
void CamWnd::Cam_DrawBrush(brush_t *b, int mode) void CamWnd::Cam_DrawBrush(brush_t *b, int mode)
{ {
int nGLState = m_Camera.draw_glstate; int nGLState = m_Camera.draw_glstate;
int nDrawMode = m_Camera.draw_mode;
int nModelMode = g_PrefsDlg.m_nEntityShowState; int nModelMode = g_PrefsDlg.m_nEntityShowState;
GLfloat material[4], identity[4]; GLfloat material[4], identity[4];

View file

@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "stdafx.h" #include "stdafx.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
@ -249,7 +250,7 @@ void Dialog::UpdateData (bool retrieve)
break; break;
case DLG_COMBO_INT: { case DLG_COMBO_INT: {
GList *lst = GTK_LIST (GTK_COMBO (data->object)->list)->children; GList *lst = GTK_LIST (GTK_COMBO (data->object)->list)->children;
char *entry = ""; char *entry = NULL;
if (*(int*)data->buffer != -1) if (*(int*)data->buffer != -1)
{ {
@ -257,8 +258,10 @@ void Dialog::UpdateData (bool retrieve)
if (lst != NULL) if (lst != NULL)
gtk_label_get (GTK_LABEL (GTK_BIN (lst->data)->child), &entry); gtk_label_get (GTK_LABEL (GTK_BIN (lst->data)->child), &entry);
} }
if (entry)
gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (data->object)->entry), entry); gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (data->object)->entry), entry);
else
gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (data->object)->entry), "");
} }
break; break;
case DLG_COMBO_BOX_INT: { case DLG_COMBO_BOX_INT: {

View file

@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define _DIALOG_H_ #define _DIALOG_H_
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "str.h" #include "str.h"
#include "gtkmisc.h" #include "gtkmisc.h"

View file

@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "stdafx.h" #include "stdafx.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
//#include "qe3.h" //#include "qe3.h"
GtkWidget *g_dlgInfo; GtkWidget *g_dlgInfo;

View file

@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// type 5 = surface flags (q2) // type 5 = surface flags (q2)
// type 6 = content flags (q2) // type 6 = content flags (q2)
// type 7 = content flags - no match (q2) // type 7 = content flags - no match (q2)
bfilter_t *FilterAdd(bfilter_t *pFilter, int type, int bmask, char *str, int exclude) bfilter_t *FilterAdd(bfilter_t *pFilter, int type, int bmask, const char *str, int exclude)
{ {
bfilter_t *pNew = new bfilter_t; bfilter_t *pNew = new bfilter_t;
pNew->next = pFilter; pNew->next = pFilter;
@ -51,7 +51,7 @@ bfilter_t *FilterAdd(bfilter_t *pFilter, int type, int bmask, char *str, int exc
return pNew; return pNew;
} }
bfilter_t *FilterCreate (int type, int bmask, char *str, int exclude) bfilter_t *FilterCreate (int type, int bmask, const char *str, int exclude)
{ {
g_qeglobals.d_savedinfo.filters = FilterAdd(g_qeglobals.d_savedinfo.filters, type, bmask, str, exclude); g_qeglobals.d_savedinfo.filters = FilterAdd(g_qeglobals.d_savedinfo.filters, type, bmask, str, exclude);
Syn_Printf("Added filter %s (type: %i, bmask: %i, exclude: %i)\n", str, type, bmask, exclude); Syn_Printf("Added filter %s (type: %i, bmask: %i, exclude: %i)\n", str, type, bmask, exclude);

View file

@ -23,8 +23,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define _FILTERS_H_ #define _FILTERS_H_
void FiltersActivate(void); void FiltersActivate(void);
bfilter_t *FilterCreate(int type, int bmask, char *str, int exclude); bfilter_t *FilterCreate(int type, int bmask, const char *str, int exclude);
bfilter_t *FilterAdd(bfilter_t *pFilter, int type, int bmask, char *str, int exclude); bfilter_t *FilterAdd(bfilter_t *pFilter, int type, int bmask, const char *str, int exclude);
bfilter_t *FilterListDelete(bfilter_t *pFilter); bfilter_t *FilterListDelete(bfilter_t *pFilter);
bfilter_t *FilterUpdate(bfilter_t *pFilter); bfilter_t *FilterUpdate(bfilter_t *pFilter);
bool FilterBrush(brush_t *pb); bool FilterBrush(brush_t *pb);

View file

@ -212,9 +212,6 @@ static gint font_height;
void gtk_glwidget_create_font (GtkWidget *widget) void gtk_glwidget_create_font (GtkWidget *widget)
{ {
GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);
GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget);
PangoFontDescription *font_desc; PangoFontDescription *font_desc;
PangoFont *font; PangoFont *font;
PangoFontMetrics *font_metrics; PangoFontMetrics *font_metrics;

View file

@ -1329,7 +1329,7 @@ void GroupDlg::Create ()
{ {
// Spawnflags (4 colums wide max, or window gets too wide.) // Spawnflags (4 colums wide max, or window gets too wide.)
GtkWidget* table = LayoutTable = gtk_table_new (4, 4, FALSE); GtkWidget* LayoutTable = gtk_table_new (4, 4, FALSE);
gtk_box_pack_start (GTK_BOX (vbox2), LayoutTable, FALSE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox2), LayoutTable, FALSE, TRUE, 0);
gtk_widget_show(LayoutTable); gtk_widget_show(LayoutTable);

View file

@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "stdafx.h" #include "stdafx.h"
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#ifdef _WIN32 #ifdef _WIN32
#include <gdk/gdkwin32.h> #include <gdk/gdkwin32.h>

View file

@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif #endif
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#ifdef _WIN32 #ifdef _WIN32
#include <gdk/gdkwin32.h> #include <gdk/gdkwin32.h>
@ -686,7 +686,7 @@ void load_pixmap (const char* filename, GtkWidget* widget, GdkPixmap **gdkpixmap
if (*gdkpixmap == NULL) if (*gdkpixmap == NULL)
{ {
printf("gdkpixmap was null\n"); printf("gdkpixmap was null\n");
char *dummy[] = { "1 1 1 1", " c None", " " }; gchar *dummy[] = { "1 1 1 1", " c None", " " };
printf("calling gdk_pixmap_create_from_xpm_d\n"); printf("calling gdk_pixmap_create_from_xpm_d\n");
*gdkpixmap = gdk_pixmap_create_from_xpm_d (gdk_get_default_root_window(), mask, NULL, dummy); *gdkpixmap = gdk_pixmap_create_from_xpm_d (gdk_get_default_root_window(), mask, NULL, dummy);
} }
@ -725,7 +725,7 @@ bool WINAPI load_plugin_bitmap (const char* filename, void **gdkpixmap, void **m
if (*gdkpixmap == NULL) if (*gdkpixmap == NULL)
{ {
char *dummy[] = { "1 1 1 1", " c None", " " }; gchar *dummy[] = { "1 1 1 1", " c None", " " };
*gdkpixmap = gdk_pixmap_create_from_xpm_d (gdk_get_default_root_window(), (GdkBitmap **)mask, NULL, dummy); *gdkpixmap = gdk_pixmap_create_from_xpm_d (gdk_get_default_root_window(), (GdkBitmap **)mask, NULL, dummy);
return false; return false;
} }
@ -735,7 +735,7 @@ bool WINAPI load_plugin_bitmap (const char* filename, void **gdkpixmap, void **m
} }
// Load a xpm file and return a pixmap widget. // Load a xpm file and return a pixmap widget.
GtkWidget* new_pixmap (GtkWidget* widget, char* filename) GtkWidget* new_pixmap (GtkWidget* widget, const char* filename)
{ {
GdkPixmap *gdkpixmap; GdkPixmap *gdkpixmap;
GdkBitmap *mask; GdkBitmap *mask;
@ -771,7 +771,7 @@ GtkWidget* menu_tearoff (GtkWidget *menu)
return menu_item; return menu_item;
} }
GtkWidget* create_sub_menu_with_mnemonic (GtkWidget *bar, gchar *mnemonic) GtkWidget* create_sub_menu_with_mnemonic (GtkWidget *bar, const gchar *mnemonic)
{ {
GtkWidget *item, *sub_menu; GtkWidget *item, *sub_menu;
@ -787,7 +787,7 @@ GtkWidget* create_sub_menu_with_mnemonic (GtkWidget *bar, gchar *mnemonic)
extern void AddMenuItem (GtkWidget* menu, unsigned int id); extern void AddMenuItem (GtkWidget* menu, unsigned int id);
GtkWidget* create_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id) GtkWidget* create_menu_item_with_mnemonic (GtkWidget *menu, const gchar *mnemonic, GtkSignalFunc func, int id)
{ {
GtkWidget *item; GtkWidget *item;
@ -801,7 +801,7 @@ GtkWidget* create_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, Gtk
return item; return item;
} }
GtkWidget* create_check_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id, gboolean active) GtkWidget* create_check_menu_item_with_mnemonic (GtkWidget *menu, const gchar *mnemonic, GtkSignalFunc func, int id, gboolean active)
{ {
GtkWidget *item; GtkWidget *item;
@ -816,7 +816,7 @@ GtkWidget* create_check_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemoni
return item; return item;
} }
GtkWidget* create_radio_menu_item_with_mnemonic (GtkWidget *menu, GtkWidget *last, gchar *mnemonic, GtkSignalFunc func, int id, gboolean state) GtkWidget* create_radio_menu_item_with_mnemonic (GtkWidget *menu, GtkWidget *last, const gchar *mnemonic, GtkSignalFunc func, int id, gboolean state)
{ {
GtkWidget *item; GtkWidget *item;
GSList *group = (GSList*)NULL; GSList *group = (GSList*)NULL;

View file

@ -62,14 +62,14 @@ gint widget_delete_hide (GtkWidget *widget);
// GdkPixmap **gdkpixmap, GdkBitmap **mask // GdkPixmap **gdkpixmap, GdkBitmap **mask
bool WINAPI load_plugin_bitmap (const char* filename, void **gdkpixmap, void **mask); bool WINAPI load_plugin_bitmap (const char* filename, void **gdkpixmap, void **mask);
void load_pixmap (const char* filename, GtkWidget* widget, GdkPixmap **gdkpixmap, GdkBitmap **mask); void load_pixmap (const char* filename, GtkWidget* widget, GdkPixmap **gdkpixmap, GdkBitmap **mask);
GtkWidget* new_pixmap (GtkWidget* widget, char* filename); GtkWidget* new_pixmap (GtkWidget* widget, const char* filename);
GtkWidget* menu_separator (GtkWidget *menu); GtkWidget* menu_separator (GtkWidget *menu);
GtkWidget* menu_tearoff (GtkWidget *menu); GtkWidget* menu_tearoff (GtkWidget *menu);
GtkWidget* create_sub_menu_with_mnemonic (GtkWidget *bar, char *mnemonic); GtkWidget* create_sub_menu_with_mnemonic (GtkWidget *bar, const gchar *mnemonic);
GtkWidget* create_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id); GtkWidget* create_menu_item_with_mnemonic (GtkWidget *menu, const gchar *mnemonic, GtkSignalFunc func, int id);
GtkWidget* create_check_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id, gboolean active); GtkWidget* create_check_menu_item_with_mnemonic (GtkWidget *menu, const gchar *mnemonic, GtkSignalFunc func, int id, gboolean active);
GtkWidget* create_radio_menu_item_with_mnemonic (GtkWidget *menu, GtkWidget *last, gchar *mnemonic, GtkSignalFunc func, int id, gboolean state); GtkWidget* create_radio_menu_item_with_mnemonic (GtkWidget *menu, GtkWidget *last, const gchar *mnemonic, GtkSignalFunc func, int id, gboolean state);
GtkWidget* create_menu_in_menu_with_mnemonic (GtkWidget *menu, const gchar *mnemonic); GtkWidget* create_menu_in_menu_with_mnemonic (GtkWidget *menu, const gchar *mnemonic);

View file

@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif #endif
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "stdafx.h" #include "stdafx.h"
#include <assert.h> #include <assert.h>
#include <sys/types.h> #include <sys/types.h>

View file

@ -34,6 +34,7 @@ extern "C" {
} }
#endif #endif
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <gdk/gdkprivate.h> #include <gdk/gdkprivate.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -849,7 +850,7 @@ void HandleHelpCommand (GtkWidget *widget, gpointer data)
g_pParentWnd->handle_help_command(id); g_pParentWnd->handle_help_command(id);
} }
void MainFrame::process_xlink (Str &FileName, char *menu_name, const char *base_url, GtkWidget *menu, GtkAccelGroup *accel) void MainFrame::process_xlink (Str &FileName, const char *menu_name, const char *base_url, GtkWidget *menu, GtkAccelGroup *accel)
{ {
xmlDocPtr pDoc; xmlDocPtr pDoc;
pDoc = xmlParseFile(FileName.GetBuffer()); pDoc = xmlParseFile(FileName.GetBuffer());
@ -6683,7 +6684,7 @@ void MainFrame::OnHelpAbout()
void MainFrame::OnPopupSelection() void MainFrame::OnPopupSelection()
{ {
GtkWidget *menu, *item; GtkWidget *menu, *item;
char *labels[] = { "Select Complete Tall", "Select Touching", "Select Partial Tall", "Select Inside"}; const gchar *labels[] = { _("Select Complete Tall"), _("Select Touching"), _("Select Partial Tall"), _("Select Inside")};
int ids[] = { ID_SELECTION_SELECTCOMPLETETALL, ID_SELECTION_SELECTTOUCHING, int ids[] = { ID_SELECTION_SELECTCOMPLETETALL, ID_SELECTION_SELECTTOUCHING,
ID_SELECTION_SELECTPARTIALTALL, ID_SELECTION_SELECTINSIDE}; ID_SELECTION_SELECTPARTIALTALL, ID_SELECTION_SELECTINSIDE};
@ -7369,6 +7370,7 @@ void MainFrame::OnGridNext()
case 64: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_64")); break; case 64: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_64")); break;
case 128: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_128")); break; case 128: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_128")); break;
case 256: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_256")); break; case 256: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_256")); break;
default: item = NULL;
} }
} else } else

View file

@ -44,16 +44,16 @@ const int RAD_PRESS = 0x08;
struct SCommandInfo struct SCommandInfo
{ {
char* m_strCommand; const char* m_strCommand;
unsigned int m_nKey; unsigned int m_nKey;
unsigned int m_nModifiers; unsigned int m_nModifiers;
unsigned int m_nCommand; unsigned int m_nCommand;
char* m_strMenu; const char* m_strMenu;
}; };
struct SKeyInfo struct SKeyInfo
{ {
char* m_strName; const char* m_strName;
unsigned int m_nVKKey; unsigned int m_nVKKey;
}; };
@ -475,7 +475,7 @@ protected:
/*! /*!
build the menu once the filename is found build the menu once the filename is found
*/ */
void process_xlink (Str &FileName, char *menu_name, const char *base_url, GtkWidget *menu, GtkAccelGroup *accel); void process_xlink (Str &FileName, const char *menu_name, const char *base_url, GtkWidget *menu, GtkAccelGroup *accel);
void Create (); void Create ();
void create_main_menu (GtkWidget *window, GtkWidget *vbox); void create_main_menu (GtkWidget *window, GtkWidget *vbox);

View file

@ -136,7 +136,7 @@ void Map_BuildBrushData(void)
Sys_EndWait(); Sys_EndWait();
} }
entity_t *Map_FindClass (char *cname) entity_t *Map_FindClass (const char *cname)
{ {
entity_t *ent; entity_t *ent;

View file

@ -2170,8 +2170,10 @@ void BTree_ListCurveRecurse(BTreeList_t *pBTList)
//int i; //int i;
bool bFlipped = false; bool bFlipped = false;
if (g_PrefsDlg.m_nSubdivisions >= 1) if (g_PrefsDlg.m_nSubdivisions >= 1)
threshold = g_PrefsDlg.m_nSubdivisions; threshold = g_PrefsDlg.m_nSubdivisions;
else
threshold = 0;
leftBTList = rightBTList = NULL; leftBTList = rightBTList = NULL;
@ -2581,6 +2583,8 @@ void Patch_CVNormal(vec3_t ctrl[3][3], vec3_t &normal)
//Sys_Printf("p1: (%1.1f %1.1f %1.1f) p2: (%1.1f %1.1f %1.1f) p2: (%1.1f %1.1f %1.1f)\n", //Sys_Printf("p1: (%1.1f %1.1f %1.1f) p2: (%1.1f %1.1f %1.1f) p2: (%1.1f %1.1f %1.1f)\n",
// ctrl[0][0][0], ctrl[0][0][1], ctrl[0][0][2], ctrl[0][2][0], ctrl[0][2][1], ctrl[0][2][2], ctrl[2][0][0], ctrl[2][0][1], ctrl[2][0][2]); // ctrl[0][0][0], ctrl[0][0][1], ctrl[0][0][2], ctrl[0][2][0], ctrl[0][2][1], ctrl[0][2][2], ctrl[2][0][0], ctrl[2][0][1], ctrl[2][0][2]);
v1[0] = v1[1] = v1[2] = v2[0] = v2[1] = v2[2] = 0;
if (a == 2) if (a == 2)
{ {
a = Patch_GetCVTangent(v1, ctrl[0][0], ctrl[1][1], ctrl[1][2]); a = Patch_GetCVTangent(v1, ctrl[0][0], ctrl[1][1], ctrl[1][2]);
@ -4250,6 +4254,7 @@ void Patch_InsertColumn(patchMesh_t *p, bool bAdd)
if (p->width + 2 >= MAX_PATCH_WIDTH) if (p->width + 2 >= MAX_PATCH_WIDTH)
return; return;
w = 1;
// check for selected column points // check for selected column points
for (h = 0; h < p->height; h++) for (h = 0; h < p->height; h++)
{ {
@ -4330,6 +4335,7 @@ void Patch_InsertRow(patchMesh_t *p, bool bAdd)
if (p->height + 2 >= MAX_PATCH_HEIGHT) if (p->height + 2 >= MAX_PATCH_HEIGHT)
return; return;
h = 1;
// check for selected row points // check for selected row points
for (w = 0; w < p->width; w++) for (w = 0; w < p->width; w++)
{ {
@ -4409,6 +4415,7 @@ void Patch_RemoveRow(patchMesh_t *p, bool bFirst)
if (p->height <= MIN_PATCH_HEIGHT) if (p->height <= MIN_PATCH_HEIGHT)
return; return;
h = 0;
for (w = 0; w < p->width; w++) for (w = 0; w < p->width; w++)
{ {
for (h = 0; h < p->height; h+=2) for (h = 0; h < p->height; h+=2)
@ -4488,6 +4495,7 @@ void Patch_RemoveColumn(patchMesh_t *p, bool bFirst)
if (p->width <= MIN_PATCH_WIDTH) if (p->width <= MIN_PATCH_WIDTH)
return; return;
w = 0;
for (h = 0; h < p->height; h++) for (h = 0; h < p->height; h++)
{ {
for (w = 0; w < p->width; w+=2) for (w = 0; w < p->width; w+=2)

View file

@ -231,7 +231,7 @@ CXMLPropertyBag::CXMLPropertyBag() {
// generic preference functions // generic preference functions
void CXMLPropertyBag::PushAssignment(char *name, PrefTypes_t type, void *pV) void CXMLPropertyBag::PushAssignment(const char *name, PrefTypes_t type, void *pV)
{ {
list<CPrefAssignment>::iterator iAssign; list<CPrefAssignment>::iterator iAssign;
for(iAssign=mPrefAssignments.begin(); iAssign!=mPrefAssignments.end(); iAssign++) for(iAssign=mPrefAssignments.begin(); iAssign!=mPrefAssignments.end(); iAssign++)
@ -274,7 +274,7 @@ xmlNodePtr CXMLPropertyBag::EpairForName(const char *name)
return ret; return ret;
} }
void CXMLPropertyBag::GetPref(char *name, Str *pV, char *V) void CXMLPropertyBag::GetPref(const char *name, Str *pV, const char *V)
{ {
xmlNodePtr pNode = EpairForName( name ); xmlNodePtr pNode = EpairForName( name );
if ( pNode ) if ( pNode )
@ -296,7 +296,7 @@ void CXMLPropertyBag::GetPref(char *name, Str *pV, char *V)
PushAssignment(name, PREF_STR, pV); PushAssignment(name, PREF_STR, pV);
} }
void CXMLPropertyBag::GetPref(char *name, int *pV, int V) void CXMLPropertyBag::GetPref(const char *name, int *pV, int V)
{ {
xmlNodePtr pNode; xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
@ -315,7 +315,7 @@ void CXMLPropertyBag::GetPref(char *name, int *pV, int V)
PushAssignment(name, PREF_INT, pV); PushAssignment(name, PREF_INT, pV);
} }
void CXMLPropertyBag::GetPref(char *name, bool *pV, bool V) void CXMLPropertyBag::GetPref(const char *name, bool *pV, bool V)
{ {
xmlNodePtr pNode; xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
@ -341,7 +341,7 @@ void CXMLPropertyBag::GetPref(char *name, bool *pV, bool V)
PushAssignment(name, PREF_BOOL, pV); PushAssignment(name, PREF_BOOL, pV);
} }
void CXMLPropertyBag::GetPref(char *name, float *pV, float V) void CXMLPropertyBag::GetPref(const char *name, float *pV, float V)
{ {
xmlNodePtr pNode; xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
@ -360,7 +360,7 @@ void CXMLPropertyBag::GetPref(char *name, float *pV, float V)
PushAssignment(name, PREF_FLOAT, pV); PushAssignment(name, PREF_FLOAT, pV);
} }
void CXMLPropertyBag::GetPref(char *name, float* pV, float* V) void CXMLPropertyBag::GetPref(const char *name, float* pV, float* V)
{ {
xmlNodePtr pNode; xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
@ -381,7 +381,7 @@ void CXMLPropertyBag::GetPref(char *name, float* pV, float* V)
PushAssignment(name, PREF_VEC3, pV); PushAssignment(name, PREF_VEC3, pV);
} }
void CXMLPropertyBag::GetPref(char *name, window_position_t* pV, window_position_t V) void CXMLPropertyBag::GetPref(const char *name, window_position_t* pV, window_position_t V)
{ {
xmlNodePtr pNode; xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
@ -918,8 +918,6 @@ CPrefAssignment::CPrefAssignment(const CPrefAssignment& ass)
void CGameDialog::LoadPrefs() void CGameDialog::LoadPrefs()
{ {
bool bEmpty = false;
// if we already have a document loaded, we will free and reload from file // if we already have a document loaded, we will free and reload from file
if (mGlobalPrefs.InUse()) if (mGlobalPrefs.InUse())
{ {

View file

@ -50,7 +50,7 @@ public:
PrefTypes_t mType; PrefTypes_t mType;
void *mVal; void *mVal;
CPrefAssignment(char *name, PrefTypes_t Type, void *Val) CPrefAssignment(const char *name, PrefTypes_t Type, void *Val)
{ {
mName = name; mType = Type; mVal = Val; mName = name; mType = Type; mVal = Val;
} }
@ -86,7 +86,7 @@ private:
/*! /*!
store assignment in the property list if not already there store assignment in the property list if not already there
*/ */
void PushAssignment(char *name, PrefTypes_t type, void *pV); void PushAssignment(const char *name, PrefTypes_t type, void *pV);
/*! /*!
find the xmlnode relating to the epair name find the xmlnode relating to the epair name
@ -110,12 +110,12 @@ public:
(name, type and pointer to value) (name, type and pointer to value)
this is used in UpdatePrefTree this is used in UpdatePrefTree
*/ */
void GetPref(char *name, Str *pV, char *V); void GetPref(const char *name, Str *pV, const char *V);
void GetPref(char *name, int *pV, int V); void GetPref(const char *name, int *pV, int V);
void GetPref(char *name, bool *pV, bool V); void GetPref(const char *name, bool *pV, bool V);
void GetPref(char *name, float *pV, float V); void GetPref(const char *name, float *pV, float V);
void GetPref(char *name, float *pV, float* V); void GetPref(const char *name, float *pV, float* V);
void GetPref(char *name, window_position_t* pV, window_position_t V); void GetPref(const char *name, window_position_t* pV, window_position_t V);
/*! /*!
returns whether or not the property bag is already open returns whether or not the property bag is already open

View file

@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "stdafx.h" #include "stdafx.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "gtkmisc.h" #include "gtkmisc.h"
#if defined (__linux__) || defined (__APPLE__) #if defined (__linux__) || defined (__APPLE__)
@ -1118,7 +1119,7 @@ Checks for the given parameter in the program's command line arguments
Returns the argument number (1 to argc-1) or 0 if not present Returns the argument number (1 to argc-1) or 0 if not present
================= =================
*/ */
int CheckParm (char *check) int CheckParm (const char *check)
{ {
int i; int i;
@ -1139,7 +1140,7 @@ int CheckParm (char *check)
ParseNum / ParseHex ParseNum / ParseHex
============== ==============
*/ */
int ParseHex (char *hex) int ParseHex (const char *hex)
{ {
char *str; char *str;
int num; int num;
@ -1165,7 +1166,7 @@ int ParseHex (char *hex)
} }
int ParseNum (char *str) int ParseNum (const char *str)
{ {
if (str[0] == '$') if (str[0] == '$')
return ParseHex (str+1); return ParseHex (str+1);

View file

@ -43,6 +43,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "qgl.h" #include "qgl.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
@ -141,11 +142,11 @@ vec_t Rad_rint (vec_t in);
double I_FloatTime (void); double I_FloatTime (void);
void Error (char *error, ...); void Error (const char *error, ...);
int CheckParm (char *check); int CheckParm (const char *check);
void ParseCommandLine (char *lpCmdLine); void ParseCommandLine (char *lpCmdLine);
int ParseNum (char *str); int ParseNum (const char *str);
char* COM_Parse (char *data); char* COM_Parse (char *data);
char* Get_COM_Token(); char* Get_COM_Token();

View file

@ -41,6 +41,7 @@ Clean up texture menu.
#include <dirent.h> #include <dirent.h>
#endif #endif
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <assert.h> #include <assert.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "stdafx.h" #include "stdafx.h"
@ -570,9 +571,6 @@ void FillTextureMenu (GSList** pArray)
GSList *texdirs_tmp = NULL; GSList *texdirs_tmp = NULL;
GSList *p; GSList *p;
char dirRoot[NAME_MAX]; char dirRoot[NAME_MAX];
// this is an index used to count the number of texture items (for splitting/avoiding to get out of window)
// we start with a != 0 value to compensate for the initial number of items in the texture menu
int nMenuCount = 12;
// delete everything // delete everything
menu = GTK_WIDGET (g_object_get_data (G_OBJECT (g_qeglobals_gui.d_main_window), "menu_textures")); menu = GTK_WIDGET (g_object_get_data (G_OBJECT (g_qeglobals_gui.d_main_window), "menu_textures"));
@ -767,7 +765,7 @@ void Texture_ShowDirectory ()
sprintf (dirstring, "textures/%s", texture_directory); sprintf (dirstring, "textures/%s", texture_directory);
g_ImageManager.BeginExtensionsScan(); g_ImageManager.BeginExtensionsScan();
const char* ext; const char* ext;
while(ext=g_ImageManager.GetNextExtension()) while((ext=g_ImageManager.GetNextExtension()) != NULL)
{ {
files = g_slist_concat(files, vfsGetFileList (dirstring, ext)); files = g_slist_concat(files, vfsGetFileList (dirstring, ext));
} }

View file

@ -335,7 +335,7 @@ int Undo_EntityInUndo(undo_t *undo, entity_t *ent)
Undo_Start Undo_Start
============= =============
*/ */
void Undo_Start(char *operation) void Undo_Start(const char *operation)
{ {
// spog - disable undo if undo levels = 0 // spog - disable undo if undo levels = 0
if (g_PrefsDlg.m_nUndoLevels == 0) if (g_PrefsDlg.m_nUndoLevels == 0)

View file

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// //
//start operation //start operation
void Undo_Start(char *operation); void Undo_Start(const char *operation);
//end operation //end operation
void Undo_End(void); void Undo_End(void);
//add brush to the undo //add brush to the undo

View file

@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "stdafx.h" #include "stdafx.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <assert.h> #include <assert.h>
#include <GL/gl.h> #include <GL/gl.h>