Exported the GTK+ backend's strdupText() as uiUnixStrdupText().
This commit is contained in:
parent
9f2bb5b1fa
commit
0ee2a72446
|
@ -14,6 +14,9 @@ This file assumes that you have included <gtk/gtk.h> and "ui.h" beforehand. It p
|
|||
// The firstProperty parameter and beyond allow passing construct properties to the new control, as with g_object_new(); end this list with NULL.
|
||||
_UI_EXTERN void uiUnixNewControl(uiControl *c, GType type, gboolean inScrolledWindow, gboolean scrolledWindowHasBorder, void (*destroy)(void *), void *onDestroyData, const char *firstProperty, ...);
|
||||
|
||||
// uiUnixStrdupText() takes the given string and produces a copy of it suitable for being freed by uiFreeText().
|
||||
extern char *uiUnixStrdupText(const char *);
|
||||
|
||||
struct uiSizingSys {
|
||||
// this structure currently left blank
|
||||
};
|
||||
|
|
|
@ -32,7 +32,7 @@ static char *buttonText(uiButton *bb)
|
|||
{
|
||||
struct button *b = (struct button *) bb;
|
||||
|
||||
return strdupText(gtk_button_get_label(b->button));
|
||||
return uiUnixStrdupText(gtk_button_get_label(b->button));
|
||||
}
|
||||
|
||||
static void buttonSetText(uiButton *bb, const char *text)
|
||||
|
|
|
@ -35,7 +35,7 @@ static char *checkboxText(uiCheckbox *cc)
|
|||
{
|
||||
struct checkbox *c = (struct checkbox *) cc;
|
||||
|
||||
return strdupText(gtk_button_get_label(c->button));
|
||||
return uiUnixStrdupText(gtk_button_get_label(c->button));
|
||||
}
|
||||
|
||||
static void checkboxSetText(uiCheckbox *cc, const char *text)
|
||||
|
|
|
@ -18,7 +18,7 @@ static char *entryText(uiEntry *ee)
|
|||
{
|
||||
struct entry *e = (struct entry *) ee;
|
||||
|
||||
return strdupText(gtk_entry_get_text(e->entry));
|
||||
return uiUnixStrdupText(gtk_entry_get_text(e->entry));
|
||||
}
|
||||
|
||||
static void entrySetText(uiEntry *ee, const char *text)
|
||||
|
|
|
@ -18,7 +18,7 @@ static char *labelText(uiLabel *ll)
|
|||
{
|
||||
struct label *l = (struct label *) ll;
|
||||
|
||||
return strdupText(gtk_label_get_text(l->label));
|
||||
return uiUnixStrdupText(gtk_label_get_text(l->label));
|
||||
}
|
||||
|
||||
static void labelSetText(uiLabel *ll, const char *text)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "uipriv_unix.h"
|
||||
|
||||
// TODO rename to uiUnixStrdupText()
|
||||
char *strdupText(const char *t)
|
||||
char *uiUnixStrdupText(const char *t)
|
||||
{
|
||||
return g_strdup(t);
|
||||
}
|
||||
|
|
|
@ -13,9 +13,6 @@
|
|||
#define gtkXMargin 12
|
||||
#define gtkYMargin 12
|
||||
|
||||
// text.c
|
||||
extern char *strdupText(const char *);
|
||||
|
||||
// menu.c
|
||||
extern GtkWidget *makeMenubar(uiWindow *);
|
||||
extern void freeMenubar(GtkWidget *);
|
||||
|
|
|
@ -121,7 +121,7 @@ static char *windowTitle(uiWindow *ww)
|
|||
{
|
||||
struct window *w = (struct window *) ww;
|
||||
|
||||
return strdupText(gtk_window_get_title(w->window));
|
||||
return uiUnixStrdupText(gtk_window_get_title(w->window));
|
||||
}
|
||||
|
||||
static void windowSetTitle(uiWindow *ww, const char *title)
|
||||
|
|
Loading…
Reference in New Issue