2015-08-28 09:01:57 -05:00
|
|
|
// 16 august 2015
|
2015-06-11 18:23:47 -05:00
|
|
|
#include "uipriv_unix.h"
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
static uintmax_t type_uiUnixControl = 0;
|
2015-06-11 18:23:47 -05:00
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
uintmax_t uiUnixControlType(void)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
if (type_uiUnixControl == 0)
|
|
|
|
type_uiUnixControl = uiRegisterType("uiUnixControl", uiControlType(), sizeof (uiUnixControl));
|
|
|
|
return type_uiUnixControl;
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
static void defaultCommitShow(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
gtk_widget_show(GTK_WIDGET(uiControlHandle(c)));
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
static void defaultCommitHide(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
gtk_widget_hide(GTK_WIDGET(uiControlHandle(c)));
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
void osCommitEnable(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(uiControlHandle(c)), TRUE);
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
void osCommitDisable(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(uiControlHandle(c)), FALSE);
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
void uiUnixFinishControl(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
g_object_ref_sink(GTK_WIDGET(uiControlHandle(c)));
|
|
|
|
if (!isToplevel(c))
|
|
|
|
gtk_widget_show(GTK_WIDGET(uiControlHandle(c)));
|
|
|
|
c->CommitShow = defaultCommitShow;
|
|
|
|
c->CommitHide = defaultCommitHide;
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|