Decided not to bother with destruction blocking for now.
This commit is contained in:
parent
7a70c3f568
commit
127f025eee
1
TODO.md
1
TODO.md
|
@ -23,3 +23,4 @@
|
|||
|
||||
ultimately:
|
||||
- add some sort of runtime type checking
|
||||
- MAYBE readd lifetime blocking
|
||||
|
|
|
@ -171,7 +171,6 @@ static void windowSetMargined(uiWindow *ww, int margined)
|
|||
binSetMargins(w->bin, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
// TODO destruction blocking
|
||||
uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
||||
{
|
||||
struct window *w;
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
// 19 april 2015
|
||||
#include "uipriv_unix.h"
|
||||
|
||||
static void destroyBlocker(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
complain("trying to destroy object at %p before destroy function called", data);
|
||||
}
|
||||
|
||||
gulong blockDestruction(GtkWidget *widget, void *object)
|
||||
{
|
||||
return g_signal_connect(widget, "destroy", G_CALLBACK(destroyBlocker), object);
|
||||
}
|
||||
|
||||
void readyToDestroy(GtkWidget *widget, gulong block)
|
||||
{
|
||||
g_signal_handler_disconnect(widget, block);
|
||||
}
|
3
uipriv.h
3
uipriv.h
|
@ -14,6 +14,3 @@ extern uiContainer *newBin(void);
|
|||
extern void binSetMainControl(uiContainer *, uiControl *);
|
||||
extern void binSetMargins(uiContainer *, intmax_t, intmax_t, intmax_t, intmax_t);
|
||||
extern void binSetParent(uiContainer *, uintptr_t);
|
||||
|
||||
// lifetimes.c
|
||||
extern void properlyDestroyControl(uiControl *);
|
||||
|
|
|
@ -33,7 +33,6 @@ static void containerWidget_init(containerWidget *c)
|
|||
gtk_widget_set_has_window(GTK_WIDGET(c), FALSE);
|
||||
}
|
||||
|
||||
// TODO destroy blocking
|
||||
static void containerWidget_dispose(GObject *obj)
|
||||
{
|
||||
G_OBJECT_CLASS(containerWidget_parent_class)->dispose(obj);
|
||||
|
|
|
@ -16,8 +16,6 @@ struct singleWidget {
|
|||
void *onDestroyData;
|
||||
};
|
||||
|
||||
// TODO destruction blockers
|
||||
|
||||
static void singleDestroy(uiControl *c)
|
||||
{
|
||||
singleWidget *s = (singleWidget *) (c->Internal);
|
||||
|
|
|
@ -163,7 +163,6 @@ static void windowSetMargined(uiWindow *ww, int margined)
|
|||
binSetMargins(w->bin, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
// TODO destruction blocking
|
||||
uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
||||
{
|
||||
struct window *w;
|
||||
|
|
|
@ -13,7 +13,6 @@ struct singleHWND {
|
|||
int hidden;
|
||||
};
|
||||
|
||||
// TODO destruction blocking
|
||||
static void singleDestroy(uiControl *c)
|
||||
{
|
||||
singleHWND *s = (singleHWND *) (c->Internal);
|
||||
|
@ -148,7 +147,7 @@ void uiWindowsNewControl(uiControl *c, uiWindowsNewControlParams *p)
|
|||
if (p->useStandardControlFont)
|
||||
SendMessageW(s->hwnd, WM_SETFONT, (WPARAM) hMessageFont, (LPARAM) TRUE);
|
||||
|
||||
// this handles both blocking control destruction and redirected notification messages
|
||||
// this handles redirected notification messages
|
||||
if ((*fv_SetWindowSubclass)(s->hwnd, singleSubclassProc, 0, (DWORD_PTR) c) == FALSE)
|
||||
logLastError("error subclassing Windows control in uiWindowsNewControl()");
|
||||
|
||||
|
|
|
@ -220,7 +220,6 @@ static void windowSetMargined(uiWindow *ww, int margined)
|
|||
binSetMargins(w->bin, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
// TODO destruction blocking
|
||||
uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
||||
{
|
||||
struct window *w;
|
||||
|
|
Loading…
Reference in New Issue